executables

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2021 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultEksaImage

func DefaultEksaImage() string

Types

type AwsCli

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

func NewAwsCli

func NewAwsCli(executable Executable) *AwsCli

func (*AwsCli) CreateAccessKey

func (ac *AwsCli) CreateAccessKey(ctx context.Context, username string) (string, error)

type Clusterawsadm

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

func NewClusterawsadm

func NewClusterawsadm(executable Executable) *Clusterawsadm

func (*Clusterawsadm) BootstrapCreds

func (c *Clusterawsadm) BootstrapCreds(ctx context.Context, envs map[string]string) (string, error)

func (*Clusterawsadm) BootstrapIam

func (c *Clusterawsadm) BootstrapIam(ctx context.Context, envs map[string]string, configFile string) error

func (*Clusterawsadm) DeleteCloudformationStack

func (c *Clusterawsadm) DeleteCloudformationStack(ctx context.Context, envs map[string]string, fileName string) error

func (*Clusterawsadm) ListAccessKeys

func (c *Clusterawsadm) ListAccessKeys(ctx context.Context, userName string) (string, error)

type Clusterctl

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

func NewClusterctl

func NewClusterctl(executable Executable, writer filewriter.FileWriter) *Clusterctl

func (*Clusterctl) GetWorkloadKubeconfig

func (c *Clusterctl) GetWorkloadKubeconfig(ctx context.Context, clusterName string, cluster *types.Cluster) ([]byte, error)

func (*Clusterctl) InitInfrastructure

func (c *Clusterctl) InitInfrastructure(ctx context.Context, clusterSpec *cluster.Spec, cluster *types.Cluster, provider providers.Provider) error

func (*Clusterctl) MoveManagement

func (c *Clusterctl) MoveManagement(ctx context.Context, from, to *types.Cluster) error

type ClustersResponse

type ClustersResponse struct {
	Items []types.CAPICluster `json:"items,omitempty"`
}

type Docker

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

func BuildDockerExecutable

func BuildDockerExecutable() *Docker

func NewDocker

func NewDocker(executable Executable) *Docker

func (*Docker) AllocatedMemory

func (d *Docker) AllocatedMemory(ctx context.Context) (uint64, error)

func (*Docker) DockerPullImage

func (d *Docker) DockerPullImage(ctx context.Context, image string) error

func (*Docker) GetDockerLBPort

func (d *Docker) GetDockerLBPort(ctx context.Context, clusterName string) (port string, err error)

func (*Docker) SetUpCLITools

func (d *Docker) SetUpCLITools(ctx context.Context, image string) error

func (*Docker) Version

func (d *Docker) Version(ctx context.Context) (int, error)

type Executable

type Executable interface {
	Execute(ctx context.Context, args ...string) (stdout bytes.Buffer, err error)
	ExecuteWithEnv(ctx context.Context, envs map[string]string, args ...string) (stdout bytes.Buffer, err error)
	ExecuteWithStdin(ctx context.Context, in []byte, args ...string) (stdout bytes.Buffer, err error)
}

func NewDockerExecutable

func NewDockerExecutable(cli, image string, mountDir string) Executable

This currently returns a linuxDockerExecutable, but if we support other types of docker executables we can change the name of this constructor

func NewExecutable

func NewExecutable(cli string) Executable

this should only be called through the executables.builder

type ExecutableBuilder

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

func NewExecutableBuilder

func NewExecutableBuilder(ctx context.Context, image string) (*ExecutableBuilder, error)

func (*ExecutableBuilder) BuildAwsCli

func (b *ExecutableBuilder) BuildAwsCli() *AwsCli

func (*ExecutableBuilder) BuildClusterAwsAdmExecutable

func (b *ExecutableBuilder) BuildClusterAwsAdmExecutable() *Clusterawsadm

func (*ExecutableBuilder) BuildClusterCtlExecutable

func (b *ExecutableBuilder) BuildClusterCtlExecutable(writer filewriter.FileWriter) *Clusterctl

func (*ExecutableBuilder) BuildFluxExecutable

func (b *ExecutableBuilder) BuildFluxExecutable() *Flux

func (*ExecutableBuilder) BuildGovcExecutable

func (b *ExecutableBuilder) BuildGovcExecutable(writer filewriter.FileWriter) *Govc

func (*ExecutableBuilder) BuildKindExecutable

func (b *ExecutableBuilder) BuildKindExecutable(writer filewriter.FileWriter) *Kind

func (*ExecutableBuilder) BuildKubectlExecutable

func (b *ExecutableBuilder) BuildKubectlExecutable() *Kubectl

type Flux

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

func NewFlux

func NewFlux(executable Executable) *Flux

func (*Flux) BootstrapToolkitsComponents

func (f *Flux) BootstrapToolkitsComponents(ctx context.Context, cluster *types.Cluster, gitOpsConfig *v1alpha1.GitOpsConfig) error

BootstrapToolkitsComponents creates the GitHub repository if it doesn’t exist, and commits the toolkit components manifests to the main branch. Then it configures the target cluster to synchronize with the repository. If the toolkit components are present on the cluster, the bootstrap command will perform an upgrade if needed.

func (*Flux) PauseKustomization

func (f *Flux) PauseKustomization(ctx context.Context, cluster *types.Cluster, gitOpsConfig *v1alpha1.GitOpsConfig) error

func (*Flux) ResumeKustomization

func (f *Flux) ResumeKustomization(ctx context.Context, cluster *types.Cluster, gitOpsConfig *v1alpha1.GitOpsConfig) error

func (*Flux) UninstallToolkitsComponents

func (f *Flux) UninstallToolkitsComponents(ctx context.Context, cluster *types.Cluster, gitOpsConfig *v1alpha1.GitOpsConfig) error

type FolderType

type FolderType string

type Govc

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

func NewGovc

func NewGovc(executable Executable, writer filewriter.FileWriter) *Govc

func (*Govc) AddTag

func (g *Govc) AddTag(ctx context.Context, path, tag string) error

func (*Govc) CleanupVms

func (g *Govc) CleanupVms(ctx context.Context, clusterName string, dryRun bool) error

func (*Govc) CreateCategoryForVM

func (g *Govc) CreateCategoryForVM(ctx context.Context, name string) error

func (*Govc) CreateLibrary

func (g *Govc) CreateLibrary(ctx context.Context, datastore, library string) error

func (*Govc) CreateTag

func (g *Govc) CreateTag(ctx context.Context, tag, category string) error

func (*Govc) DeleteTemplate

func (g *Govc) DeleteTemplate(ctx context.Context, resourcePool, templatePath string) error

func (*Govc) DeployTemplateFromLibrary

func (g *Govc) DeployTemplateFromLibrary(ctx context.Context, templateDir, templateName, library, resourcePool string, resizeDisk2 bool) error

func (*Govc) DevicesInfo

func (g *Govc) DevicesInfo(ctx context.Context, template string) (interface{}, error)

func (*Govc) GetTags

func (g *Govc) GetTags(ctx context.Context, path string) ([]string, error)

func (*Govc) GetWorkloadAvailableSpace

func (g *Govc) GetWorkloadAvailableSpace(ctx context.Context, machineConfig *v1alpha1.VSphereMachineConfig) (float64, error)

func (*Govc) ImportTemplate

func (g *Govc) ImportTemplate(ctx context.Context, library, ovaURL, name string) error

func (*Govc) LibraryElementExists

func (g *Govc) LibraryElementExists(ctx context.Context, library string) (bool, error)

func (*Govc) ListCategories

func (g *Govc) ListCategories(ctx context.Context) ([]string, error)

func (*Govc) ListTags

func (g *Govc) ListTags(ctx context.Context) ([]string, error)

func (*Govc) ResizeDisk

func (g *Govc) ResizeDisk(ctx context.Context, template, diskName string, diskSizeInGB int) error

func (*Govc) SearchTemplate

func (g *Govc) SearchTemplate(ctx context.Context, datacenter string, machineConfig *v1alpha1.VSphereMachineConfig) (string, error)

func (*Govc) TemplateHasSnapshot

func (g *Govc) TemplateHasSnapshot(ctx context.Context, template string) (bool, error)

func (*Govc) ValidateVCenterSetup

func (g *Govc) ValidateVCenterSetup(ctx context.Context, datacenterConfig *v1alpha1.VSphereDatacenterConfig, selfSigned *bool) error

func (*Govc) ValidateVCenterSetupMachineConfig

func (g *Govc) ValidateVCenterSetupMachineConfig(ctx context.Context, datacenterConfig *v1alpha1.VSphereDatacenterConfig, machineConfig *v1alpha1.VSphereMachineConfig, selfSigned *bool) error

type Kind

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

func NewKind

func NewKind(executable Executable, writer filewriter.FileWriter) *Kind

func (*Kind) ClusterExists

func (k *Kind) ClusterExists(ctx context.Context, clusterName string) (bool, error)

func (*Kind) CreateBootstrapCluster

func (k *Kind) CreateBootstrapCluster(ctx context.Context, clusterSpec *cluster.Spec, opts ...bootstrapper.BootstrapClusterClientOption) (kubeconfig string, err error)

func (*Kind) DeleteBootstrapCluster

func (k *Kind) DeleteBootstrapCluster(ctx context.Context, cluster *types.Cluster) error

func (*Kind) GetKubeconfig

func (k *Kind) GetKubeconfig(ctx context.Context, clusterName string) (string, error)

func (*Kind) WithDefaultCNIDisabled

func (k *Kind) WithDefaultCNIDisabled() bootstrapper.BootstrapClusterClientOption

func (*Kind) WithEnv

func (*Kind) WithExtraDockerMounts

func (k *Kind) WithExtraDockerMounts() bootstrapper.BootstrapClusterClientOption

type Kubectl

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

func NewKubectl

func NewKubectl(executable Executable) *Kubectl

func (*Kubectl) ApplyKubeSpec

func (k *Kubectl) ApplyKubeSpec(ctx context.Context, cluster *types.Cluster, spec string) error

func (*Kubectl) ApplyKubeSpecFromBytes

func (k *Kubectl) ApplyKubeSpecFromBytes(ctx context.Context, cluster *types.Cluster, data []byte) error

func (*Kubectl) ApplyKubeSpecFromBytesForce

func (k *Kubectl) ApplyKubeSpecFromBytesForce(ctx context.Context, cluster *types.Cluster, data []byte) error

func (*Kubectl) ApplyKubeSpecWithNamespace

func (k *Kubectl) ApplyKubeSpecWithNamespace(ctx context.Context, cluster *types.Cluster, spec string, namespace string) error

func (*Kubectl) CreateNamespace

func (k *Kubectl) CreateNamespace(ctx context.Context, kubeconfig string, namespace string) error

func (*Kubectl) DeleteCluster

func (k *Kubectl) DeleteCluster(ctx context.Context, managementCluster, clusterToDelete *types.Cluster) error

func (*Kubectl) GetApiServerUrl

func (k *Kubectl) GetApiServerUrl(ctx context.Context, cluster *types.Cluster) (string, error)

func (*Kubectl) GetClusters

func (k *Kubectl) GetClusters(ctx context.Context, cluster *types.Cluster) ([]types.CAPICluster, error)

func (*Kubectl) GetCurrentClusterContext

func (k *Kubectl) GetCurrentClusterContext(ctx context.Context, cluster *types.Cluster) (string, error)

func (*Kubectl) GetDeployments

func (k *Kubectl) GetDeployments(ctx context.Context, opts ...KubectlOpt) ([]appsv1.Deployment, error)

func (*Kubectl) GetEksaAWSDatacenterConfig

func (k *Kubectl) GetEksaAWSDatacenterConfig(ctx context.Context, awsDatacenterConfigName string, kubeconfigFile string) (*v1alpha1.AWSDatacenterConfig, error)

func (*Kubectl) GetEksaCluster

func (k *Kubectl) GetEksaCluster(ctx context.Context, cluster *types.Cluster) (*v1alpha1.Cluster, error)

func (*Kubectl) GetEksaGitOpsConfig

func (k *Kubectl) GetEksaGitOpsConfig(ctx context.Context, gitOpsConfigName string, kubeconfigFile string) (*v1alpha1.GitOpsConfig, error)

func (*Kubectl) GetEksaOIDCConfig

func (k *Kubectl) GetEksaOIDCConfig(ctx context.Context, oidcConfigName string, kubeconfigFile string) (*v1alpha1.OIDCConfig, error)

func (*Kubectl) GetEksaVSphereDatacenterConfig

func (k *Kubectl) GetEksaVSphereDatacenterConfig(ctx context.Context, vsphereDatacenterConfigName string, kubeconfigFile string) (*v1alpha1.VSphereDatacenterConfig, error)

func (*Kubectl) GetEksaVSphereMachineConfig

func (k *Kubectl) GetEksaVSphereMachineConfig(ctx context.Context, vsphereMachineConfigName string, kubeconfigFile string) (*v1alpha1.VSphereMachineConfig, error)

func (*Kubectl) GetEtcdadmCluster

func (k *Kubectl) GetEtcdadmCluster(ctx context.Context, cluster *types.Cluster, opts ...KubectlOpt) (*etcdv1alpha3.EtcdadmCluster, error)

func (*Kubectl) GetKubeadmControlPlane

func (k *Kubectl) GetKubeadmControlPlane(ctx context.Context, cluster *types.Cluster, opts ...KubectlOpt) (*kubeadmnv1alpha3.KubeadmControlPlane, error)

func (*Kubectl) GetKubeadmControlPlanes

func (k *Kubectl) GetKubeadmControlPlanes(ctx context.Context, opts ...KubectlOpt) ([]kubeadmnv1alpha3.KubeadmControlPlane, error)

func (*Kubectl) GetMachineDeployment

func (k *Kubectl) GetMachineDeployment(ctx context.Context, cluster *types.Cluster, opts ...KubectlOpt) (*v1alpha3.MachineDeployment, error)

func (*Kubectl) GetMachineDeployments

func (k *Kubectl) GetMachineDeployments(ctx context.Context, opts ...KubectlOpt) ([]v1alpha3.MachineDeployment, error)

func (*Kubectl) GetMachines

func (k *Kubectl) GetMachines(ctx context.Context, cluster *types.Cluster) ([]types.Machine, error)

func (*Kubectl) GetPods

func (k *Kubectl) GetPods(ctx context.Context, opts ...KubectlOpt) ([]corev1.Pod, error)

func (*Kubectl) GetSecret

func (k *Kubectl) GetSecret(ctx context.Context, secretObjectName string, opts ...KubectlOpt) (*corev1.Secret, error)

func (*Kubectl) ListCluster

func (k *Kubectl) ListCluster(ctx context.Context) error

func (*Kubectl) LoadSecret

func (k *Kubectl) LoadSecret(ctx context.Context, secretObject string, secretObjectType string, secretObjectName string, kubeConfFile string) error

func (*Kubectl) MachineTemplateName

func (k *Kubectl) MachineTemplateName(ctx context.Context, clusterName string, kubeconfig string) (string, error)

func (*Kubectl) RemoveAnnotation

func (k *Kubectl) RemoveAnnotation(ctx context.Context, resourceType, objectName string, key string, opts ...KubectlOpt) error

func (*Kubectl) RemoveAnnotationInNamespace

func (k *Kubectl) RemoveAnnotationInNamespace(ctx context.Context, resourceType, objectName, key string, cluster *types.Cluster, namespace string) error

func (*Kubectl) SaveLog

func (k *Kubectl) SaveLog(ctx context.Context, cluster *types.Cluster, deployment *types.Deployment, fileName string, writer filewriter.FileWriter) error

func (*Kubectl) UpdateAnnotation

func (k *Kubectl) UpdateAnnotation(ctx context.Context, resourceType, objectName string, annotations map[string]string, opts ...KubectlOpt) error

func (*Kubectl) UpdateAnnotationInNamespace

func (k *Kubectl) UpdateAnnotationInNamespace(ctx context.Context, resourceType, objectName string, annotations map[string]string, cluster *types.Cluster, namespace string) error

func (*Kubectl) ValidateClustersCRD

func (k *Kubectl) ValidateClustersCRD(ctx context.Context, cluster *types.Cluster) error

func (*Kubectl) ValidateControlPlaneNodes

func (k *Kubectl) ValidateControlPlaneNodes(ctx context.Context, cluster *types.Cluster) error

func (*Kubectl) ValidateNodes

func (k *Kubectl) ValidateNodes(ctx context.Context, kubeconfig string) error

func (*Kubectl) ValidateNodesVersion

func (k *Kubectl) ValidateNodesVersion(ctx context.Context, kubeconfig string, kubeVersion v1alpha1.KubernetesVersion) error

func (*Kubectl) ValidatePods

func (k *Kubectl) ValidatePods(ctx context.Context, kubeconfig string) error

func (*Kubectl) ValidateWorkerNodes

func (k *Kubectl) ValidateWorkerNodes(ctx context.Context, cluster *types.Cluster) error

func (*Kubectl) Version

func (k *Kubectl) Version(ctx context.Context, cluster *types.Cluster) (*VersionResponse, error)

func (*Kubectl) VsphereWorkerNodesMachineTemplate

func (k *Kubectl) VsphereWorkerNodesMachineTemplate(ctx context.Context, clusterName string, kubeconfig string) (*vspherev3.VSphereMachineTemplate, error)

func (*Kubectl) Wait

func (k *Kubectl) Wait(ctx context.Context, kubeconfig string, timeout string, forCondition string, property string, namespace string) error

func (*Kubectl) WaitForControlPlaneReady

func (k *Kubectl) WaitForControlPlaneReady(ctx context.Context, cluster *types.Cluster, timeout string, newClusterName string) error

func (*Kubectl) WaitForDeployment

func (k *Kubectl) WaitForDeployment(ctx context.Context, cluster *types.Cluster, timeout string, condition string, target string, namespace string) error

func (*Kubectl) WaitForManagedExternalEtcdReady

func (k *Kubectl) WaitForManagedExternalEtcdReady(ctx context.Context, cluster *types.Cluster, timeout string, newClusterName string) error

type KubectlOpt

type KubectlOpt func(*[]string)

func WithAllNamespaces

func WithAllNamespaces() KubectlOpt

func WithCluster

func WithCluster(c *types.Cluster) KubectlOpt

func WithNamespace

func WithNamespace(n string) KubectlOpt

func WithOverwrite

func WithOverwrite() KubectlOpt

func WithServer

func WithServer(s string) KubectlOpt

func WithSkipTLSVerify

func WithSkipTLSVerify() KubectlOpt

func WithToken

func WithToken(t string) KubectlOpt

type Sonobuoy

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

func BuildSonobuoyExecutable

func BuildSonobuoyExecutable() *Sonobuoy

func NewSonobuoy

func NewSonobuoy(executable Executable) *Sonobuoy

func (*Sonobuoy) Run

func (k *Sonobuoy) Run(ctx context.Context, contextName string, args ...string) (string, error)

type VersionResponse

type VersionResponse struct {
	ClientVersion version.Info `json:"clientVersion"`
	ServerVersion version.Info `json:"serverVersion"`
}

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳