deployer

package
v0.0.0-...-2ad99af Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 26, 2022 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Overview

Package deployer implements the kubetest2 GKE deployer

Index

Constants

View Source
const Name = "gke"

Name is the name of the deployer

Variables

View Source
var GitTag string

Functions

func New

func New(opts types.Options) (types.Deployer, *pflag.FlagSet)

New implements deployer.New for gke

Types

type Deployer

type Deployer struct {
	// generic parts
	Kubetest2CommonOptions types.Options

	*options.BuildOptions
	*options.CommonOptions
	*options.ProjectOptions
	*options.NetworkOptions
	*options.ClusterOptions
	// contains filtered or unexported fields
}

func NewDeployer

func NewDeployer(opts types.Options) *Deployer

NewDeployer returns a deployer object with fields that are not flag controlled

func (*Deployer) Build

func (d *Deployer) Build() error

func (*Deployer) CleanupNetworkFirewalls

func (d *Deployer) CleanupNetworkFirewalls(hostProject, network string) (int, error)

Ensure that all firewall-rules are deleted from specific network.

func (*Deployer) CreateCluster

func (d *Deployer) CreateCluster(project string, cluster cluster, subNetworkArgs []string, locationArg string) error

func (*Deployer) CreateClusters

func (d *Deployer) CreateClusters() error

func (*Deployer) CreateNetwork

func (d *Deployer) CreateNetwork() error

func (*Deployer) CreateSubnets

func (d *Deployer) CreateSubnets() error

func (*Deployer) DeleteCluster

func (d *Deployer) DeleteCluster(project, loc string, cluster cluster)

func (*Deployer) DeleteClusters

func (d *Deployer) DeleteClusters(retryCount int)

func (*Deployer) DeleteNetwork

func (d *Deployer) DeleteNetwork() error

func (*Deployer) DeleteSubnets

func (d *Deployer) DeleteSubnets(retryCount int) error

func (*Deployer) Down

func (d *Deployer) Down() error

func (*Deployer) DumpClusterLogs

func (d *Deployer) DumpClusterLogs() error

DumpClusterLogs for GKE generates a small script that wraps log-dump.sh with the appropriate shell-fu to get the cluster dumped.

TODO(RonWeber): This whole path is really gross, but this seemed the least gross hack to get this done.

TODO(RonWeber): Make this work with multizonal and regional clusters.

func (*Deployer) EnsureFirewallRules

func (d *Deployer) EnsureFirewallRules() error

func (*Deployer) GetInstanceGroups

func (d *Deployer) GetInstanceGroups() error

func (*Deployer) Init

func (d *Deployer) Init() error

func (*Deployer) Initialize

func (d *Deployer) Initialize() error

Initialize should only be called by init(), behind a sync.Once

func (*Deployer) IsUp

func (d *Deployer) IsUp() (up bool, err error)

func (*Deployer) Kubeconfig

func (d *Deployer) Kubeconfig() (string, error)

Kubeconfig returns a path to a kubeconfig file for the cluster in a temp directory, creating one if one does not exist. It also sets the KUBECONFIG environment variable appropriately.

func (*Deployer) PostTest

func (d *Deployer) PostTest(testErr error) error

PostTest will check if there's any error in the test. If there's no error in the test, and the --update-latest-green-marker is set to true, this method will stage the build marker to the GCS bucket.

func (*Deployer) PrepareGcpIfNeeded

func (d *Deployer) PrepareGcpIfNeeded(projectID string) error

func (*Deployer) Provider

func (d *Deployer) Provider() string

func (*Deployer) SetupNetwork

func (d *Deployer) SetupNetwork() error

func (*Deployer) TeardownNetwork

func (d *Deployer) TeardownNetwork() error

func (*Deployer) TestSetup

func (d *Deployer) TestSetup() error

func (*Deployer) Up

func (d *Deployer) Up() error

Deployer implementation methods below

func (*Deployer) VerifyBuildFlags

func (d *Deployer) VerifyBuildFlags() error

func (*Deployer) VerifyDownFlags

func (d *Deployer) VerifyDownFlags() error

VerifyDownFlags validates flags for down phase.

func (*Deployer) VerifyLocationFlags

func (d *Deployer) VerifyLocationFlags() error

func (*Deployer) VerifyNetworkFlags

func (d *Deployer) VerifyNetworkFlags() error

func (*Deployer) VerifyUpFlags

func (d *Deployer) VerifyUpFlags() error

verifyCommonFlags validates flags for up phase.

func (*Deployer) Version

func (d *Deployer) Version() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL