pkg

package
v0.0.0-...-6d46272 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster

type Cluster struct {
	Kops *KopsCluster `yaml:"kops"`
	Eks  *EksCluster  `yaml:"eks"`
}

type ClusterCreator

type ClusterCreator interface {
	// Initialize the creator such as downloading dependencies
	Init() (Step, error)

	// Create and wait for cluster creation
	Up() (Step, error)

	// Teardown the cluster
	TearDown() (Step, error)
}

func NewClusterCreator

func NewClusterCreator(config *TestConfig, testDir string, testId string) (ClusterCreator, error)

type EksCluster

type EksCluster struct {
	Region            string `yaml:"region"`
	NodeCount         int    `yaml:"nodeCount"`
	NodeSize          string `yaml:"nodeSize"`
	KubernetesVersion string `yaml:"kubernetesVersion"`
}

type EksctlClusterCreator

type EksctlClusterCreator struct {
	// TestId is used as cluster name
	TestId string

	// EksClsuter represents the configuration to create EKS cluster
	EksCluster *EksCluster

	// directory where tempory data is saved
	TestDir string

	// The path to eksctl executable
	EksctlBinaryPath string
}

func NewEksctlClusterCreator

func NewEksctlClusterCreator(ekscluster *EksCluster, dir string, testId string) *EksctlClusterCreator

func (*EksctlClusterCreator) Init

func (c *EksctlClusterCreator) Init() (Step, error)

func (*EksctlClusterCreator) TearDown

func (c *EksctlClusterCreator) TearDown() (Step, error)

func (*EksctlClusterCreator) Up

func (c *EksctlClusterCreator) Up() (Step, error)

type FuncStep

type FuncStep struct {
	// contains filtered or unexported fields
}

func (*FuncStep) Run

func (s *FuncStep) Run(ctx context.Context) error

type KopsCluster

type KopsCluster struct {
	StateFile         string `yaml:"stateFile"`
	Region            string `yaml:"region"`
	Zones             string `yaml:"zones"`
	NodeCount         int    `yaml:"nodeCount"`
	NodeSize          string `yaml:"nodeSize"`
	KubernetesVersion string `yaml:"kubernetesVersion"`
	FeatureGates      string `yaml:"featureGates"`
	IamPolicies       string `yaml:"iamPolicies"`
}

type KopsClusterCreator

type KopsClusterCreator struct {
	// TestId is used as cluster name
	TestId string

	// Kops represents the configuration to create kops cluster
	Kops *KopsCluster

	// directory where tempory data is saved
	TestDir string

	// The path to Kops executable
	KopsBinaryPath string
}

func NewKopsClusterCreator

func NewKopsClusterCreator(kops *KopsCluster, dir string, testId string) *KopsClusterCreator

func (*KopsClusterCreator) Init

func (c *KopsClusterCreator) Init() (Step, error)

func (*KopsClusterCreator) TearDown

func (c *KopsClusterCreator) TearDown() (Step, error)

func (*KopsClusterCreator) Up

func (c *KopsClusterCreator) Up() (Step, error)

type Step

type Step interface {
	Run(ctx context.Context) error
}

func EmptyStep

func EmptyStep() Step

type TestConfig

type TestConfig struct {
	Cluster         *Cluster `yaml:"cluster"`
	Region          string   `yaml:"region"`
	BuildScript     string   `yaml:"build"`
	InstallScript   string   `yaml:"install"`
	UninstallScript string   `yaml:"uninstall"`
	TestScript      string   `yaml:"test"`
}

type TestStep

type TestStep struct {
	Script string
	TestId string
}

func (*TestStep) Run

func (s *TestStep) Run(ctx context.Context) error

TestStep run execute a user provided script using sh It substitutes script variable TEST_ID and set `eu` flag so that the script exits when the first error happens or there is an undefined variable during execution. When error occurs, it terminates all the processes within the process group

Jump to

Keyboard shortcuts

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