executables

package
v0.20.10 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 64 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DeployOptsFile = "deploy-opts.json"

	MemoryAvailable = "Memory_Available"
)

Variables

View Source
var (
	TinkerbellHardwareResourceType = fmt.Sprintf("hardware.%s", tinkv1alpha1.GroupVersion.Group)
)

Functions

func DefaultEksaImage

func DefaultEksaImage() string

func ExecutablesInDocker added in v0.11.0

func ExecutablesInDocker() bool

RunExecutablesInDocker determines if binary executables should be ran from a docker container or native binaries from the host path It reads MR_TOOLS_DISABLE variable.

func GetHelmValueArgs added in v0.9.0

func GetHelmValueArgs(values []string) []string

func InitInDockerExecutablesBuilder added in v0.11.0

func InitInDockerExecutablesBuilder(ctx context.Context, image string, mountDirs ...string) (*ExecutablesBuilder, Closer, error)

InitInDockerExecutablesBuilder builds and inits a default ExecutablesBuilder to run executables in a docker container that will make use of a long running docker container.

func IsKubectlNotFoundError added in v0.19.0

func IsKubectlNotFoundError(err error) bool

IsKubectlNotFoundError returns true if the kubectl call returned the NotFound error.

func NewDockerContainerCustomBinary added in v0.9.1

func NewDockerContainerCustomBinary(docker DockerClient) *dockerContainer

func NewDockerExecutableBuilder added in v0.11.0

func NewDockerExecutableBuilder(dockerContainer DockerContainer) *dockerExecutableBuilder

func NoOpClose added in v0.11.0

func NoOpClose(ctx context.Context) error

func RedactCreds added in v0.12.0

func RedactCreds(cmd string, envMap map[string]string) string

Types

type AwsCli

type AwsCli struct {
	Executable
}

func NewAwsCli

func NewAwsCli(executable Executable) *AwsCli

func (*AwsCli) CreateAccessKey

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

type Closer added in v0.7.0

type Closer func(ctx context.Context) error

func (Closer) CheckErr added in v0.7.0

func (c Closer) CheckErr(ctx context.Context)

CheckErr just calls the closer and logs an error if present It's mostly a helper for defering the close in a oneliner without ignoring the error.

func (Closer) Close added in v0.7.0

func (c Closer) Close(ctx context.Context) error

Close implements interface types.Closer.

type CloudStackDatacenterConfigResponse added in v0.9.0

type CloudStackDatacenterConfigResponse struct {
	Items []*v1alpha1.CloudStackDatacenterConfig `json:"items,omitempty"`
}

type CloudStackMachineConfigResponse added in v0.9.0

type CloudStackMachineConfigResponse struct {
	Items []*v1alpha1.CloudStackMachineConfig `json:"items,omitempty"`
}

type Clusterawsadm

type Clusterawsadm struct {
	Executable
}

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 {
	Executable
	// contains filtered or unexported fields
}

func NewClusterctl

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

NewClusterctl builds a new Clusterctl.

func (*Clusterctl) BackupManagement added in v0.14.4

func (c *Clusterctl) BackupManagement(ctx context.Context, cluster *types.Cluster, managementStatePath, clusterName string) error

BackupManagement saves the CAPI resources of a cluster to the provided path. This will overwrite any existing contents in the path if the backup succeeds. If `clusterName` is provided, it filters and backs up only the provided cluster.

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, managementComponents *cluster.ManagementComponents, clusterSpec *cluster.Spec, cluster *types.Cluster, provider providers.Provider) error

InitInfrastructure initializes the infrastructure for the cluster using clusterctl.

func (*Clusterctl) InstallEtcdadmProviders added in v0.6.0

func (c *Clusterctl) InstallEtcdadmProviders(ctx context.Context, managementComponents *cluster.ManagementComponents, clusterSpec *cluster.Spec, cluster *types.Cluster, infraProvider providers.Provider, installProviders []string) error

InstallEtcdadmProviders installs the etcdadm providers for the cluster using clusterctl.

func (*Clusterctl) MoveManagement

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

MoveManagement moves management components `from` cluster `to` cluster If `clusterName` is provided, it filters and moves only the provided cluster.

func (*Clusterctl) Upgrade added in v0.6.0

func (c *Clusterctl) Upgrade(ctx context.Context, managementCluster *types.Cluster, provider providers.Provider, managementComponents *cluster.ManagementComponents, newSpec *cluster.Spec, changeDiff *clusterapi.CAPIChangeDiff) error

Upgrade executes an upgrade of the cluster to the new management components and the spec.

type ClustersResponse

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

type Cmk added in v0.8.0

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

Cmk this struct wraps around the CloudMonkey executable CLI to perform operations against a CloudStack endpoint.

func NewCmk added in v0.8.0

func NewCmk(executable Executable, writer filewriter.FileWriter, config *decoder.CloudStackExecConfig) (*Cmk, error)

NewCmk initializes CloudMonkey executable to query CloudStack via CLI.

func (*Cmk) CleanupVms added in v0.9.1

func (c *Cmk) CleanupVms(ctx context.Context, profile string, clusterName string, dryRun bool) error

func (*Cmk) Close added in v0.8.0

func (c *Cmk) Close(ctx context.Context) error

func (*Cmk) EnsureNoDuplicateNetwork added in v0.20.0

func (c *Cmk) EnsureNoDuplicateNetwork(ctx context.Context, profile string, networkName string) error

EnsureNoDuplicateNetwork ensures that there are no duplicate networks with the name networkName. If it finds duplicates that are not shared networks, it deletes them.

func (*Cmk) GetManagementApiEndpoint added in v0.11.0

func (c *Cmk) GetManagementApiEndpoint(profile string) (string, error)

func (*Cmk) SearchTemplate added in v0.17.0

func (c *Cmk) SearchTemplate(ctx context.Context, profile string, template v1alpha1.CloudStackResourceIdentifier) (string, error)

SearchTemplate looks for a template by name or by id and returns template name if found.

func (*Cmk) ValidateAccountPresent added in v0.8.0

func (c *Cmk) ValidateAccountPresent(ctx context.Context, profile string, account string, domainId string) error

func (*Cmk) ValidateAffinityGroupsPresent added in v0.8.0

func (c *Cmk) ValidateAffinityGroupsPresent(ctx context.Context, profile string, domainId string, account string, affinityGroupIds []string) error

func (*Cmk) ValidateDiskOfferingPresent added in v0.9.0

func (c *Cmk) ValidateDiskOfferingPresent(ctx context.Context, profile string, zoneId string, diskOffering v1alpha1.CloudStackResourceDiskOffering) error

func (*Cmk) ValidateDomainAndGetId added in v0.11.0

func (c *Cmk) ValidateDomainAndGetId(ctx context.Context, profile string, domain string) (string, error)

func (*Cmk) ValidateNetworkPresent added in v0.8.0

func (c *Cmk) ValidateNetworkPresent(ctx context.Context, profile string, domainId string, network v1alpha1.CloudStackResourceIdentifier, zoneId string, account string) error

func (*Cmk) ValidateServiceOfferingPresent added in v0.8.0

func (c *Cmk) ValidateServiceOfferingPresent(ctx context.Context, profile string, zoneId string, serviceOffering v1alpha1.CloudStackResourceIdentifier) error

func (*Cmk) ValidateTemplatePresent added in v0.8.0

func (c *Cmk) ValidateTemplatePresent(ctx context.Context, profile string, domainId string, zoneId string, account string, template v1alpha1.CloudStackResourceIdentifier) error

func (*Cmk) ValidateZoneAndGetId added in v0.11.0

func (c *Cmk) ValidateZoneAndGetId(ctx context.Context, profile string, zone v1alpha1.CloudStackZone) (string, error)

type Command added in v0.7.0

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

func NewCommand added in v0.7.0

func NewCommand(ctx context.Context, commandRunner commandRunner, args ...string) *Command

func (*Command) Run added in v0.7.0

func (c *Command) Run() (out bytes.Buffer, err error)

func (*Command) WithEnvVars added in v0.7.0

func (c *Command) WithEnvVars(envVars map[string]string) *Command

func (*Command) WithStdIn added in v0.7.0

func (c *Command) WithStdIn(stdIn []byte) *Command

type Docker

type Docker struct {
	Executable
}

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) CheckContainerExistence added in v0.9.2

func (d *Docker) CheckContainerExistence(ctx context.Context, name string) (bool, error)

CheckContainerExistence checks whether a Docker container with the provided name exists It returns true if a container with the name exists, false if it doesn't and an error if it encounters some other error.

func (*Docker) ForceRemove added in v0.9.2

func (d *Docker) ForceRemove(ctx context.Context, name string) error

func (*Docker) GetDockerLBPort

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

func (*Docker) LoadFromFile added in v0.8.0

func (d *Docker) LoadFromFile(ctx context.Context, filepath string) error

func (*Docker) Login added in v0.6.0

func (d *Docker) Login(ctx context.Context, endpoint, username, password string) error

func (*Docker) PullImage added in v0.6.0

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

func (*Docker) PushImage added in v0.6.0

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

func (*Docker) Run added in v0.9.2

func (d *Docker) Run(ctx context.Context, image string, name string, cmd []string, flags ...string) error

func (*Docker) SaveToFile added in v0.8.0

func (d *Docker) SaveToFile(ctx context.Context, filepath string, images ...string) error

func (*Docker) TagImage added in v0.6.0

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

func (*Docker) Version

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

type DockerClient added in v0.9.1

type DockerClient interface {
	Login(ctx context.Context, endpoint, username, password string) error
	PullImage(ctx context.Context, image string) error
	Execute(ctx context.Context, args ...string) (stdout bytes.Buffer, err error)
}

type DockerContainer added in v0.11.0

type DockerContainer interface {
	Init(ctx context.Context) error
	Close(ctx context.Context) error
	ContainerName() string
}

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) // TODO: remove this from interface in favor of Command
	ExecuteWithStdin(ctx context.Context, in []byte, args ...string) (stdout bytes.Buffer, err error)            // TODO: remove this from interface in favor of Command
	Command(ctx context.Context, args ...string) *Command
	Run(cmd *Command) (stdout bytes.Buffer, err error)
}

func NewDockerExecutable

func NewDockerExecutable(cli string, containerName 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 interface {
	Init(ctx context.Context) (Closer, error)
	Build(binaryPath string) Executable
}

type ExecutablesBuilder added in v0.11.0

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

func NewExecutablesBuilder added in v0.11.0

func NewExecutablesBuilder(executableBuilder ExecutableBuilder) *ExecutablesBuilder

func NewInDockerExecutablesBuilder added in v0.11.0

func NewInDockerExecutablesBuilder(dockerClient DockerClient, image string, mountDirs ...string) (*ExecutablesBuilder, error)

NewInDockerExecutablesBuilder builds an executables builder for docker.

func NewLocalExecutablesBuilder added in v0.11.0

func NewLocalExecutablesBuilder() *ExecutablesBuilder

func (*ExecutablesBuilder) BuildAwsCli added in v0.11.0

func (b *ExecutablesBuilder) BuildAwsCli() *AwsCli

func (*ExecutablesBuilder) BuildClusterAwsAdmExecutable added in v0.11.0

func (b *ExecutablesBuilder) BuildClusterAwsAdmExecutable() *Clusterawsadm

func (*ExecutablesBuilder) BuildClusterCtlExecutable added in v0.11.0

func (b *ExecutablesBuilder) BuildClusterCtlExecutable(writer filewriter.FileWriter, reader manifests.FileReader) *Clusterctl

BuildClusterCtlExecutable builds a new Clusterctl executable.

func (*ExecutablesBuilder) BuildCmkExecutable added in v0.11.0

func (b *ExecutablesBuilder) BuildCmkExecutable(writer filewriter.FileWriter, config *decoder.CloudStackExecConfig) (*Cmk, error)

BuildCmkExecutable initializes a Cmk object and returns it.

func (*ExecutablesBuilder) BuildDockerExecutable added in v0.13.0

func (b *ExecutablesBuilder) BuildDockerExecutable() *Docker

BuildDockerExecutable initializes a docker executable and returns it.

func (*ExecutablesBuilder) BuildFluxExecutable added in v0.11.0

func (b *ExecutablesBuilder) BuildFluxExecutable() *Flux

func (*ExecutablesBuilder) BuildGovcExecutable added in v0.11.0

func (b *ExecutablesBuilder) BuildGovcExecutable(writer filewriter.FileWriter, opts ...GovcOpt) *Govc

func (*ExecutablesBuilder) BuildHelm added in v0.17.6

func (b *ExecutablesBuilder) BuildHelm(opts ...helm.Opt) helm.Client

BuildHelm initializes a helm executable and returns it.

func (*ExecutablesBuilder) BuildHelmExecutable added in v0.11.0

func (b *ExecutablesBuilder) BuildHelmExecutable(opts ...helm.Opt) *Helm

BuildHelmExecutable initializes a helm executable and returns it.

func (*ExecutablesBuilder) BuildKindExecutable added in v0.11.0

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

func (*ExecutablesBuilder) BuildKubectlExecutable added in v0.11.0

func (b *ExecutablesBuilder) BuildKubectlExecutable() *Kubectl

func (*ExecutablesBuilder) BuildSSHExecutable added in v0.15.0

func (b *ExecutablesBuilder) BuildSSHExecutable() *SSH

BuildSSHExecutable initializes a SSH executable and returns it.

func (*ExecutablesBuilder) BuildTroubleshootExecutable added in v0.11.0

func (b *ExecutablesBuilder) BuildTroubleshootExecutable() *Troubleshoot

func (*ExecutablesBuilder) Init added in v0.11.0

func (b *ExecutablesBuilder) Init(ctx context.Context) (Closer, error)

Init initializes the executable builder and returns a Closer that needs to be called once the executables are not in used anymore The closer will cleanup and free all internal resources.

type Flux

type Flux struct {
	Executable
}

func NewFlux

func NewFlux(executable Executable) *Flux

func (*Flux) BootstrapGit added in v0.11.0

func (f *Flux) BootstrapGit(ctx context.Context, cluster *types.Cluster, fluxConfig *v1alpha1.FluxConfig, cliConfig *config.CliConfig) error

BootstrapGit commits the toolkit components manifests to the branch of a Git repository. It then 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) BootstrapGithub added in v0.11.0

func (f *Flux) BootstrapGithub(ctx context.Context, cluster *types.Cluster, fluxConfig *v1alpha1.FluxConfig) error

BootstrapGithub 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) Reconcile added in v0.6.0

func (f *Flux) Reconcile(ctx context.Context, cluster *types.Cluster, fluxConfig *v1alpha1.FluxConfig) error

func (*Flux) ResumeKustomization

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

func (*Flux) SuspendKustomization added in v0.11.0

func (f *Flux) SuspendKustomization(ctx context.Context, cluster *types.Cluster, fluxConfig *v1alpha1.FluxConfig) error

func (*Flux) Uninstall added in v0.11.0

func (f *Flux) Uninstall(ctx context.Context, cluster *types.Cluster, fluxConfig *v1alpha1.FluxConfig) error

type FolderType

type FolderType string

type GitOpsConfigResponse added in v0.6.0

type GitOpsConfigResponse struct {
	Items []*v1alpha1.GitOpsConfig `json:"items,omitempty"`
}

type Govc

type Govc struct {
	Executable
	*retrier.Retrier
	// contains filtered or unexported fields
}

func NewGovc

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

func (*Govc) AddTag

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

func (*Govc) AddUserToGroup added in v0.12.0

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

AddUserToGroup adds a user to a group.

func (*Govc) CleanupVms

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

func (*Govc) Close added in v0.7.0

func (g *Govc) Close(ctx context.Context) error

func (*Govc) ConfigureCertThumbprint added in v0.7.0

func (g *Govc) ConfigureCertThumbprint(ctx context.Context, server, thumbprint string) error

func (*Govc) CreateCategoryForVM

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

func (*Govc) CreateGroup added in v0.12.0

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

CreateGroup creates a group.

func (*Govc) CreateLibrary

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

func (*Govc) CreateRole added in v0.12.0

func (g *Govc) CreateRole(ctx context.Context, name string, privileges []string) error

CreateRole creates a role with specified privileges.

func (*Govc) CreateTag

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

func (*Govc) CreateUser added in v0.12.0

func (g *Govc) CreateUser(ctx context.Context, username string, password string) error

CreateUser creates a user.

func (*Govc) DatacenterExists added in v0.7.0

func (g *Govc) DatacenterExists(ctx context.Context, datacenter string) (bool, error)

func (*Govc) DeleteLibraryElement added in v0.6.0

func (g *Govc) DeleteLibraryElement(ctx context.Context, element string) error

func (*Govc) DeleteTemplate

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

func (*Govc) DeployTemplate added in v0.9.2

func (g *Govc) DeployTemplate(ctx context.Context, library, templateName, vmName, deployFolder, datacenter, datastore, network, resourcePool string, deployOptionsOverride []byte) error

func (*Govc) DeployTemplateFromLibrary

func (g *Govc) DeployTemplateFromLibrary(ctx context.Context, templateDir, templateName, library, datacenter, datastore, network, resourcePool string, resizeBRDisk bool) error

func (*Govc) DevicesInfo

func (g *Govc) DevicesInfo(ctx context.Context, datacenter, template string, args ...string) ([]VirtualDevice, error)

DevicesInfo returns the device info for te provided virtual machine.

func (*Govc) GetCertThumbprint added in v0.7.0

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

func (*Govc) GetHardDiskSize added in v0.15.0

func (g *Govc) GetHardDiskSize(ctx context.Context, vm, datacenter string) (map[string]float64, error)

GetHardDiskSize returns the size of all the hard disks for given VM.

func (*Govc) GetLibraryElementContentVersion added in v0.6.0

func (g *Govc) GetLibraryElementContentVersion(ctx context.Context, element string) (string, error)

func (*Govc) GetResourcePoolInfo added in v0.18.0

func (g *Govc) GetResourcePoolInfo(ctx context.Context, datacenter, resourcepool string, args ...string) (map[string]int, error)

GetResourcePoolInfo returns the pool info for the provided resource pool.

func (*Govc) GetTags

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

func (*Govc) GetVMDiskSizeInGB added in v0.15.0

func (g *Govc) GetVMDiskSizeInGB(ctx context.Context, vm, datacenter string) (int, error)

GetVMDiskSizeInGB returns the size of the first disk on the VM in GB.

func (*Govc) GetWorkloadAvailableSpace

func (g *Govc) GetWorkloadAvailableSpace(ctx context.Context, datastore string) (float64, error)

func (*Govc) GroupExists added in v0.12.0

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

GroupExists checks if a group exists.

func (*Govc) ImportTemplate

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

func (*Govc) IsCertSelfSigned added in v0.7.0

func (g *Govc) IsCertSelfSigned(ctx context.Context) bool

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) ([]Tag, error)

ListTags list all vSphere tags in vCenter.

func (*Govc) Logout added in v0.7.0

func (g *Govc) Logout(ctx context.Context) error

func (*Govc) NetworkExists added in v0.7.0

func (g *Govc) NetworkExists(ctx context.Context, network string) (bool, error)

func (*Govc) ResizeDisk

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

func (*Govc) RoleExists added in v0.12.0

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

RoleExists checks if a role exists.

func (*Govc) SearchTemplate

func (g *Govc) SearchTemplate(ctx context.Context, datacenter, template string) (string, error)

SearchTemplate looks for a vm template with the same base name as the provided template path. If found, it returns the full qualified path to the template. If multiple matching templates are found, it returns an error.

func (*Govc) SetGroupRoleOnObject added in v0.12.0

func (g *Govc) SetGroupRoleOnObject(ctx context.Context, principal string, role string, object string, domain string) error

SetGroupRoleOnObject sets a role for a given group on target object.

func (*Govc) TemplateHasSnapshot

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

func (*Govc) UserExists added in v0.12.0

func (g *Govc) UserExists(ctx context.Context, username string) (bool, error)

UserExists checks if a user exists.

func (*Govc) ValidateVCenterAuthentication added in v0.7.0

func (g *Govc) ValidateVCenterAuthentication(ctx context.Context) error

func (*Govc) ValidateVCenterConnection added in v0.7.0

func (g *Govc) ValidateVCenterConnection(ctx context.Context, server string) error

func (*Govc) ValidateVCenterSetupMachineConfig

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

type GovcOpt added in v0.9.2

type GovcOpt func(*Govc)

func WithGovcEnvMap added in v0.9.2

func WithGovcEnvMap(envMap map[string]string) GovcOpt

type Helm added in v0.7.0

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

func NewHelm added in v0.7.0

func NewHelm(executable Executable, opts ...helm.Opt) *Helm

NewHelm returns a new Helm executable client.

func (*Helm) Delete added in v0.15.0

func (h *Helm) Delete(ctx context.Context, kubeconfigFilePath, installName, namespace string) error

Delete removes an installation.

func (*Helm) InstallChart added in v0.9.0

func (h *Helm) InstallChart(ctx context.Context, chart, ociURI, version, kubeconfigFilePath, namespace, valueFilePath string, skipCRDs bool, values []string) error

InstallChart installs a helm chart to the target cluster.

If kubeconfigFilePath is the empty string, it won't be passed at all.

func (*Helm) InstallChartFromName added in v0.9.0

func (h *Helm) InstallChartFromName(ctx context.Context, ociURI, kubeConfig, name, version string) error

func (*Helm) ListCharts added in v0.12.0

func (h *Helm) ListCharts(ctx context.Context, kubeconfigFilePath, filter string) ([]string, error)

ListCharts lists helm charts filtered on the given regex filter.

func (*Helm) PullChart added in v0.8.0

func (h *Helm) PullChart(ctx context.Context, ociURI, version string) error

func (*Helm) PushChart added in v0.8.0

func (h *Helm) PushChart(ctx context.Context, chart, registry string) error

func (*Helm) RegistryLogin added in v0.8.0

func (h *Helm) RegistryLogin(ctx context.Context, registry, username, password string) error

func (*Helm) SaveChart added in v0.9.0

func (h *Helm) SaveChart(ctx context.Context, ociURI, version, folder string) error

func (*Helm) ShowValues added in v0.17.0

func (h *Helm) ShowValues(ctx context.Context, ociURI, version string) (bytes.Buffer, error)

ShowValues get the values of a chart.

func (*Helm) Template added in v0.7.0

func (h *Helm) Template(ctx context.Context, ociURI, version, namespace string, values interface{}, kubeVersion string) ([]byte, error)

func (*Helm) Uninstall added in v0.20.0

func (h *Helm) Uninstall(ctx context.Context, chart, kubeconfigFilePath, namespace string, opts ...helm.Opt) error

Uninstall runs a helm uninstall for the given chart in given namespace.

func (*Helm) UpgradeInstallChartWithValuesFile added in v0.20.0

func (h *Helm) UpgradeInstallChartWithValuesFile(ctx context.Context, chart, ociURI, version, kubeconfigFilePath, namespace, valuesFilePath string, opts ...helm.Opt) error

UpgradeInstallChartWithValuesFile runs a helm upgrade --install with the provided values file and waits for the chart deployment to be ready. This will upgrade the chart if it exists and install if it does not.

type IdentityProviderConfigResponse added in v0.6.0

type IdentityProviderConfigResponse struct {
	Items []*v1alpha1.Ref `json:"items,omitempty"`
}

type Kind

type Kind struct {
	Executable
	// 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) WithEnv

func (*Kind) WithExtraDockerMounts

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

func (*Kind) WithExtraPortMappings added in v0.9.0

func (k *Kind) WithExtraPortMappings(ports []int) bootstrapper.BootstrapClusterClientOption

type Kubectl

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

func NewKubectl

func NewKubectl(executable Executable, opts ...KubectlConfigOpt) *Kubectl

NewKubectl builds a new Kubectl.

func (*Kubectl) AllBaseboardManagements added in v0.15.0

func (k *Kubectl) AllBaseboardManagements(ctx context.Context, kubeconfig string) ([]rufiounreleased.BaseboardManagement, error)

AllBaseboardManagements returns all the baseboard management resources in the cluster.

func (*Kubectl) AllTinkerbellHardware added in v0.15.0

func (k *Kubectl) AllTinkerbellHardware(ctx context.Context, kubeconfig string) ([]tinkv1alpha1.Hardware, error)

AllTinkerbellHardware returns all the hardware resources in the cluster.

func (*Kubectl) Apply added in v0.12.0

func (k *Kubectl) Apply(ctx context.Context, kubeconfig string, obj runtime.Object, opts ...kubernetes.KubectlApplyOption) error

Apply creates the resource or it updates if it already exists.

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) ApplyKubeSpecFromBytesWithNamespace added in v0.6.0

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

func (*Kubectl) ApplyKubeSpecWithNamespace

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

func (*Kubectl) ApplyManifest added in v0.14.0

func (k *Kubectl) ApplyManifest(ctx context.Context, kubeconfigPath, manifestPath string) error

ApplyManifest uses client-side logic to create/update objects defined in a yaml manifest.

func (*Kubectl) ApplyTolerationsFromTaints added in v0.6.1

func (k *Kubectl) ApplyTolerationsFromTaints(ctx context.Context, oldTaints []corev1.Taint, newTaints []corev1.Taint, resource string, name string, kubeconfigFile string, namespace string, path string) error

func (*Kubectl) ApplyTolerationsFromTaintsToDaemonSet added in v0.6.1

func (k *Kubectl) ApplyTolerationsFromTaintsToDaemonSet(ctx context.Context, oldTaints []corev1.Taint, newTaints []corev1.Taint, dsName string, kubeconfigFile string) error

func (*Kubectl) CheckProviderExists added in v0.6.0

func (k *Kubectl) CheckProviderExists(ctx context.Context, kubeconfigFile, name, namespace string) (bool, error)

func (*Kubectl) CloudstackWorkerNodesMachineTemplate added in v0.9.0

func (k *Kubectl) CloudstackWorkerNodesMachineTemplate(ctx context.Context, clusterName string, kubeconfig string, namespace string) (*cloudstackv1.CloudStackMachineTemplate, error)

func (*Kubectl) CountMachineDeploymentReplicasReady added in v0.9.2

func (k *Kubectl) CountMachineDeploymentReplicasReady(ctx context.Context, clusterName string, kubeconfig string) (ready, total int, err error)

func (*Kubectl) Create added in v0.15.2

func (k *Kubectl) Create(ctx context.Context, kubeconfig string, obj runtime.Object) error

Create performs a kubectl create command.

func (*Kubectl) CreateNamespace

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

func (*Kubectl) CreateNamespaceIfNotPresent added in v0.11.0

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

func (*Kubectl) Delete added in v0.9.0

func (k *Kubectl) Delete(ctx context.Context, resourceType, kubeconfig string, opts ...kubernetes.KubectlDeleteOption) error

Delete performs a delete command authenticating with a kubeconfig file.

func (*Kubectl) DeleteAWSIamConfig added in v0.6.0

func (k *Kubectl) DeleteAWSIamConfig(ctx context.Context, managementCluster *types.Cluster, awsIamConfigName, awsIamConfigNamespace string) error

func (*Kubectl) DeleteCRD added in v0.15.0

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

DeleteCRD removes the given CRD from the cluster specified in kubeconfig.

func (*Kubectl) DeleteCluster

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

func (*Kubectl) DeleteClusterObject added in v0.12.0

func (k *Kubectl) DeleteClusterObject(ctx context.Context, resourceType, name, kubeconfig string) error

DeleteClusterObject performs a DELETE call like above except without namespace required.

func (*Kubectl) DeleteEKSACluster added in v0.6.0

func (k *Kubectl) DeleteEKSACluster(ctx context.Context, managementCluster *types.Cluster, eksaClusterName, eksaClusterNamespace string) error

func (*Kubectl) DeleteEksaCloudStackDatacenterConfig added in v0.8.0

func (k *Kubectl) DeleteEksaCloudStackDatacenterConfig(ctx context.Context, cloudstackDatacenterConfigName string, kubeconfigFile string, namespace string) error

func (*Kubectl) DeleteEksaCloudStackMachineConfig added in v0.8.0

func (k *Kubectl) DeleteEksaCloudStackMachineConfig(ctx context.Context, cloudstackMachineConfigName string, kubeconfigFile string, namespace string) error

func (*Kubectl) DeleteEksaDatacenterConfig added in v0.7.0

func (k *Kubectl) DeleteEksaDatacenterConfig(ctx context.Context, eksaDatacenterResourceType string, eksaDatacenterConfigName string, kubeconfigFile string, namespace string) error

func (*Kubectl) DeleteEksaMachineConfig added in v0.7.0

func (k *Kubectl) DeleteEksaMachineConfig(ctx context.Context, eksaMachineConfigResourceType string, eksaMachineConfigName string, kubeconfigFile string, namespace string) error

func (*Kubectl) DeleteEksaNutanixDatacenterConfig added in v0.12.0

func (k *Kubectl) DeleteEksaNutanixDatacenterConfig(ctx context.Context, nutanixDatacenterConfigName string, kubeconfigFile string, namespace string) error

func (*Kubectl) DeleteEksaNutanixMachineConfig added in v0.12.0

func (k *Kubectl) DeleteEksaNutanixMachineConfig(ctx context.Context, nutanixMachineConfigName string, kubeconfigFile string, namespace string) error

func (*Kubectl) DeleteFluxConfig added in v0.9.0

func (k *Kubectl) DeleteFluxConfig(ctx context.Context, managementCluster *types.Cluster, fluxConfigName, fluxConfigNamespace string) error

func (*Kubectl) DeleteGitOpsConfig added in v0.6.0

func (k *Kubectl) DeleteGitOpsConfig(ctx context.Context, managementCluster *types.Cluster, gitOpsConfigName, gitOpsConfigNamespace string) error

func (*Kubectl) DeleteKubeSpecFromBytes added in v0.6.0

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

func (*Kubectl) DeleteManifest added in v0.15.0

func (k *Kubectl) DeleteManifest(ctx context.Context, kubeconfigPath, manifestPath string, opts ...KubectlOpt) error

DeleteManifest uses client-side logic to delete objects defined in a yaml manifest.

func (*Kubectl) DeleteNamespace added in v0.6.0

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

func (*Kubectl) DeleteOIDCConfig added in v0.6.0

func (k *Kubectl) DeleteOIDCConfig(ctx context.Context, managementCluster *types.Cluster, oidcConfigName, oidcConfigNamespace string) error

func (*Kubectl) DeleteOldWorkerNodeGroup added in v0.7.1

func (k *Kubectl) DeleteOldWorkerNodeGroup(ctx context.Context, md *clusterv1.MachineDeployment, kubeconfig string) error

func (*Kubectl) DeletePackageResources added in v0.12.0

func (k *Kubectl) DeletePackageResources(ctx context.Context, managementCluster *types.Cluster, clusterName string) error

func (*Kubectl) DeleteSecret added in v0.6.1

func (k *Kubectl) DeleteSecret(ctx context.Context, managementCluster *types.Cluster, secretName, namespace string) error

func (*Kubectl) ExecuteCommand added in v0.9.0

func (k *Kubectl) ExecuteCommand(ctx context.Context, opts ...string) (bytes.Buffer, error)

func (*Kubectl) ExecuteFromYaml added in v0.11.0

func (k *Kubectl) ExecuteFromYaml(ctx context.Context, yaml []byte, opts ...string) (bytes.Buffer, error)

func (*Kubectl) Get added in v0.15.2

func (k *Kubectl) Get(ctx context.Context, resourceType, kubeconfig string, obj runtime.Object, opts ...kubernetes.KubectlGetOption) error

Get performs a kubectl get command.

func (*Kubectl) GetApiServerUrl

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

func (*Kubectl) GetBundles added in v0.6.0

func (k *Kubectl) GetBundles(ctx context.Context, kubeconfigFile, name, namespace string) (*releasev1alpha1.Bundles, error)

func (*Kubectl) GetCAPIMachines added in v0.14.5

func (k *Kubectl) GetCAPIMachines(ctx context.Context, cluster *types.Cluster, clusterName string) ([]clusterv1.Machine, error)

GetCAPIMachines returns all the CAPI machines for the provided clusterName.

func (*Kubectl) GetClusterObject added in v0.12.0

func (k *Kubectl) GetClusterObject(ctx context.Context, resourceType, name, kubeconfig string, obj runtime.Object) error

GetClusterObject performs a GET class like above except without namespace required.

func (*Kubectl) GetClusterResourceSet added in v0.6.0

func (k *Kubectl) GetClusterResourceSet(ctx context.Context, kubeconfigFile, name, namespace string) (*addons.ClusterResourceSet, error)

func (*Kubectl) GetClusters

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

func (*Kubectl) GetConfigMap added in v0.6.0

func (k *Kubectl) GetConfigMap(ctx context.Context, kubeconfigFile, name, namespace string) (*corev1.ConfigMap, error)

func (*Kubectl) GetControlPlaneNodes added in v0.7.1

func (k *Kubectl) GetControlPlaneNodes(ctx context.Context, kubeconfig string) ([]corev1.Node, error)

func (*Kubectl) GetCurrentClusterContext

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

func (*Kubectl) GetDaemonSet added in v0.7.0

func (k *Kubectl) GetDaemonSet(ctx context.Context, name, namespace, kubeconfig string) (*appsv1.DaemonSet, error)

func (*Kubectl) GetDeployment added in v0.7.0

func (k *Kubectl) GetDeployment(ctx context.Context, name, namespace, kubeconfig string) (*appsv1.Deployment, 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, namespace string) (*v1alpha1.AWSDatacenterConfig, error)

func (*Kubectl) GetEksaAWSIamConfig added in v0.6.0

func (k *Kubectl) GetEksaAWSIamConfig(ctx context.Context, awsIamConfigName string, kubeconfigFile string, namespace string) (*v1alpha1.AWSIamConfig, error)

func (*Kubectl) GetEksaCloudStackDatacenterConfig added in v0.8.0

func (k *Kubectl) GetEksaCloudStackDatacenterConfig(ctx context.Context, cloudstackDatacenterConfigName string, kubeconfigFile string, namespace string) (*v1alpha1.CloudStackDatacenterConfig, error)

func (*Kubectl) GetEksaCloudStackMachineConfig added in v0.8.0

func (k *Kubectl) GetEksaCloudStackMachineConfig(ctx context.Context, cloudstackMachineConfigName string, kubeconfigFile string, namespace string) (*v1alpha1.CloudStackMachineConfig, error)

func (*Kubectl) GetEksaCluster

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

func (*Kubectl) GetEksaFluxConfig added in v0.9.0

func (k *Kubectl) GetEksaFluxConfig(ctx context.Context, gitOpsConfigName string, kubeconfigFile string, namespace string) (*v1alpha1.FluxConfig, error)

func (*Kubectl) GetEksaGitOpsConfig

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

func (*Kubectl) GetEksaNutanixDatacenterConfig added in v0.12.0

func (k *Kubectl) GetEksaNutanixDatacenterConfig(ctx context.Context, nutanixDatacenterConfigName string, kubeconfigFile string, namespace string) (*v1alpha1.NutanixDatacenterConfig, error)

func (*Kubectl) GetEksaNutanixMachineConfig added in v0.12.0

func (k *Kubectl) GetEksaNutanixMachineConfig(ctx context.Context, nutanixMachineConfigName string, kubeconfigFile string, namespace string) (*v1alpha1.NutanixMachineConfig, error)

func (*Kubectl) GetEksaOIDCConfig

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

func (*Kubectl) GetEksaTinkerbellDatacenterConfig added in v0.9.0

func (k *Kubectl) GetEksaTinkerbellDatacenterConfig(ctx context.Context, tinkerbellDatacenterConfigName string, kubeconfigFile string, namespace string) (*v1alpha1.TinkerbellDatacenterConfig, error)

func (*Kubectl) GetEksaTinkerbellMachineConfig added in v0.9.0

func (k *Kubectl) GetEksaTinkerbellMachineConfig(ctx context.Context, tinkerbellMachineConfigName string, kubeconfigFile string, namespace string) (*v1alpha1.TinkerbellMachineConfig, error)

func (*Kubectl) GetEksaVSphereDatacenterConfig

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

func (*Kubectl) GetEksaVSphereMachineConfig

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

func (*Kubectl) GetEksdRelease added in v0.8.0

func (k *Kubectl) GetEksdRelease(ctx context.Context, name, namespace, kubeconfigFile string) (*eksdv1alpha1.Release, error)

func (*Kubectl) GetEtcdadmCluster

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

func (*Kubectl) GetKubeadmControlPlane

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

func (*Kubectl) GetKubeadmControlPlanes

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

func (*Kubectl) GetMachineDeployment

func (k *Kubectl) GetMachineDeployment(ctx context.Context, workerNodeGroupName string, opts ...KubectlOpt) (*clusterv1.MachineDeployment, error)

func (*Kubectl) GetMachineDeployments

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

GetMachineDeployments retrieves all Machine Deployments.

func (*Kubectl) GetMachineDeploymentsForCluster added in v0.13.0

func (k *Kubectl) GetMachineDeploymentsForCluster(ctx context.Context, clusterName string, opts ...KubectlOpt) ([]clusterv1.MachineDeployment, error)

GetMachineDeploymentsForCluster retrieves all the Machine Deployments for a cluster with name "clusterName".

func (*Kubectl) GetMachineSets added in v0.7.1

func (k *Kubectl) GetMachineSets(ctx context.Context, machineDeploymentName string, cluster *types.Cluster) ([]clusterv1.MachineSet, error)

func (*Kubectl) GetMachines

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

func (*Kubectl) GetNamespace added in v0.6.0

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

func (*Kubectl) GetNodes added in v0.7.1

func (k *Kubectl) GetNodes(ctx context.Context, kubeconfig string) ([]corev1.Node, error)

func (*Kubectl) GetObject added in v0.9.0

func (k *Kubectl) GetObject(ctx context.Context, resourceType, name, namespace, kubeconfig string, obj runtime.Object) error

GetObject performs a GET call to the kube API server authenticating with a kubeconfig file and unmarshalls the response into the provided Object If the object is not found, it returns an error implementing apimachinery errors.APIStatus.

func (*Kubectl) GetPackageBundleController added in v0.12.1

func (k *Kubectl) GetPackageBundleController(ctx context.Context, kubeconfigFile, clusterName string) (packagesv1.PackageBundleController, error)

GetPackageBundleController will retrieve the packagebundlecontroller from eksa-packages namespace and return the object.

func (*Kubectl) GetPackageBundleList added in v0.12.1

func (k *Kubectl) GetPackageBundleList(ctx context.Context, kubeconfigFile string) ([]packagesv1.PackageBundle, error)

GetPackageBundleList will retrieve the packagebundle list from eksa-packages namespace and return the list.

func (*Kubectl) GetPodIP added in v0.13.0

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

GetPodIP will return the ip of the pod.

func (*Kubectl) GetPodLogs added in v0.12.1

func (k *Kubectl) GetPodLogs(ctx context.Context, namespace, podName, containerName, kubeconfig string) (string, error)

GetPodLogs returns the logs of the specified container (namespace/pod/container).

func (*Kubectl) GetPodLogsSince added in v0.12.1

func (k *Kubectl) GetPodLogsSince(ctx context.Context, namespace, podName, containerName, kubeconfig string, since time.Time) (string, error)

GetPodLogsSince returns the logs of the specified container (namespace/pod/container) since a timestamp.

func (*Kubectl) GetPodNameByLabel added in v0.13.0

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

GetPodNameByLabel will return the name of the first pod that matches the label.

func (*Kubectl) GetPods

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

func (*Kubectl) GetProvisionedTinkerbellHardware added in v0.11.0

func (k *Kubectl) GetProvisionedTinkerbellHardware(ctx context.Context, kubeconfig, namespace string) ([]tinkv1alpha1.Hardware, error)

GetProvisionedTinkerbellHardware retrieves provisioned Tinkerbell Hardware objects. Provisioned objects are those with owner reference information.

func (*Kubectl) GetSecret

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

func (*Kubectl) GetSecretFromNamespace added in v0.6.0

func (k *Kubectl) GetSecretFromNamespace(ctx context.Context, kubeconfigFile, name, namespace string) (*corev1.Secret, error)

func (*Kubectl) GetUnprovisionedTinkerbellHardware added in v0.9.2

func (k *Kubectl) GetUnprovisionedTinkerbellHardware(ctx context.Context, kubeconfig, namespace string) ([]tinkv1alpha1.Hardware, error)

GetUnprovisionedTinkerbellHardware retrieves unprovisioned Tinkerbell Hardware objects. Unprovisioned objects are those without any owner reference information.

func (*Kubectl) GetVsphereMachine added in v0.18.0

func (k *Kubectl) GetVsphereMachine(ctx context.Context, kubeconfig string, selector string) ([]vspherev1.VSphereMachine, error)

GetVsphereMachine will return list of vSphere machines.

func (*Kubectl) HasCRD added in v0.15.0

func (k *Kubectl) HasCRD(ctx context.Context, crd, kubeconfig string) (bool, error)

HasCRD checks if the given CRD exists in the cluster specified by kubeconfig.

func (*Kubectl) HasResource added in v0.12.0

func (k *Kubectl) HasResource(ctx context.Context, resourceType string, name string, kubeconfig string, namespace string) (bool, error)

HasResource implements KubectlRunner.

func (*Kubectl) KubeconfigSecretAvailable added in v0.6.1

func (k *Kubectl) KubeconfigSecretAvailable(ctx context.Context, kubeconfig string, clusterName string, namespace string) (bool, error)

func (*Kubectl) ListCluster

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

func (*Kubectl) ListObjects added in v0.12.0

func (k *Kubectl) ListObjects(ctx context.Context, resourceType, namespace, kubeconfig string, list kubernetes.ObjectList) 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, opts ...KubectlOpt) (string, error)

func (*Kubectl) MergePatchResource added in v0.16.0

func (k *Kubectl) MergePatchResource(ctx context.Context, resource, name, patch, kubeconfig, namespace string) error

MergePatchResource patches named resource using merge patch.

func (*Kubectl) PauseCAPICluster added in v0.16.0

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

PauseCAPICluster adds a `spec.Paused: true` to the CAPI cluster resource. This will cause all downstream CAPI + provider controllers to skip reconciling on the paused cluster's objects.

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) Replace added in v0.15.2

func (k *Kubectl) Replace(ctx context.Context, kubeconfig string, obj runtime.Object) error

Replace performs a kubectl replace command.

func (*Kubectl) ResumeCAPICluster added in v0.16.0

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

ResumeCAPICluster removes the `spec.Paused` on the CAPI cluster resource. This will cause all downstream CAPI + provider controllers to resume reconciling on the paused cluster's objects `spec.Paused` is set to `null` to drop the field instead of setting it to `false`.

func (*Kubectl) RolloutRestartDaemonSet added in v0.9.1

func (k *Kubectl) RolloutRestartDaemonSet(ctx context.Context, dsName, dsNamespace, kubeconfig string) error

func (*Kubectl) RunCurlPod added in v0.16.3

func (k *Kubectl) RunCurlPod(ctx context.Context, namespace, name, kubeconfig string, command []string) (string, error)

RunCurlPod will run Kubectl with an image (with curl installed) and the command you pass in.

func (*Kubectl) SaveLog

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

func (*Kubectl) SearchCloudStackDatacenterConfig added in v0.8.0

func (k *Kubectl) SearchCloudStackDatacenterConfig(ctx context.Context, name string, kubeconfigFile string, namespace string) ([]*v1alpha1.CloudStackDatacenterConfig, error)

func (*Kubectl) SearchCloudStackMachineConfig added in v0.8.0

func (k *Kubectl) SearchCloudStackMachineConfig(ctx context.Context, name string, kubeconfigFile string, namespace string) ([]*v1alpha1.CloudStackMachineConfig, error)

func (*Kubectl) SearchIdentityProviderConfig added in v0.6.0

func (k *Kubectl) SearchIdentityProviderConfig(ctx context.Context, ipName string, kind string, kubeconfigFile string, namespace string) ([]*v1alpha1.VSphereDatacenterConfig, error)

func (*Kubectl) SearchNutanixDatacenterConfig added in v0.12.0

func (k *Kubectl) SearchNutanixDatacenterConfig(ctx context.Context, name string, kubeconfigFile string, namespace string) ([]*v1alpha1.NutanixDatacenterConfig, error)

func (*Kubectl) SearchNutanixMachineConfig added in v0.12.0

func (k *Kubectl) SearchNutanixMachineConfig(ctx context.Context, name string, kubeconfigFile string, namespace string) ([]*v1alpha1.NutanixMachineConfig, error)

func (*Kubectl) SearchTinkerbellDatacenterConfig added in v0.13.0

func (k *Kubectl) SearchTinkerbellDatacenterConfig(ctx context.Context, datacenterName string, kubeconfigFile string, namespace string) ([]*v1alpha1.TinkerbellDatacenterConfig, error)

SearchTinkerbellDatacenterConfig returns the list of TinkerbellDatacenterConfig in the cluster.

func (*Kubectl) SearchTinkerbellMachineConfig added in v0.13.0

func (k *Kubectl) SearchTinkerbellMachineConfig(ctx context.Context, name string, kubeconfigFile string, namespace string) ([]*v1alpha1.TinkerbellMachineConfig, error)

SearchTinkerbellMachineConfig returns the list of TinkerbellMachineConfig in the cluster.

func (*Kubectl) SearchVsphereDatacenterConfig added in v0.6.0

func (k *Kubectl) SearchVsphereDatacenterConfig(ctx context.Context, datacenterName string, kubeconfigFile string, namespace string) ([]*v1alpha1.VSphereDatacenterConfig, error)

func (*Kubectl) SearchVsphereMachineConfig added in v0.6.0

func (k *Kubectl) SearchVsphereMachineConfig(ctx context.Context, name string, kubeconfigFile string, namespace string) ([]*v1alpha1.VSphereMachineConfig, error)

func (*Kubectl) SetDaemonSetImage added in v0.6.0

func (k *Kubectl) SetDaemonSetImage(ctx context.Context, kubeconfigFile, name, namespace, container, image string) error

func (*Kubectl) SetEksaControllerEnvVar added in v0.9.0

func (k *Kubectl) SetEksaControllerEnvVar(ctx context.Context, envVar, envVarVal, kubeconfig string) 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) UpdateEnvironmentVariables added in v0.6.0

func (k *Kubectl) UpdateEnvironmentVariables(ctx context.Context, resourceType, resourceName string, envMap map[string]string, opts ...KubectlOpt) error

func (*Kubectl) UpdateEnvironmentVariablesInNamespace added in v0.6.0

func (k *Kubectl) UpdateEnvironmentVariablesInNamespace(ctx context.Context, resourceType, resourceName string, envMap 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, clusterName string) error

func (*Kubectl) ValidateEKSAClustersCRD added in v0.6.0

func (k *Kubectl) ValidateEKSAClustersCRD(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, clusterName string, kubeconfig string) 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, namespace string) (*vspherev1.VSphereMachineTemplate, error)

func (*Kubectl) Wait

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

func (*Kubectl) WaitForClusterReady added in v0.10.1

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

func (*Kubectl) WaitForControlPlaneAvailable added in v0.13.0

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

WaitForControlPlaneAvailable blocks until the first control plane is available.

func (*Kubectl) WaitForControlPlaneNotReady added in v0.9.0

func (k *Kubectl) WaitForControlPlaneNotReady(ctx context.Context, cluster *types.Cluster, timeout string, newClusterName 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) WaitForJobCompleted added in v0.12.1

func (k *Kubectl) WaitForJobCompleted(ctx context.Context, kubeconfig, timeout string, condition string, target string, namespace string) error

WaitForJobCompleted waits for a job resource to reach desired condition before returning.

func (*Kubectl) WaitForMachineDeploymentReady added in v0.12.0

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

func (*Kubectl) WaitForManagedExternalEtcdNotReady added in v0.10.1

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

func (*Kubectl) WaitForManagedExternalEtcdReady

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

func (*Kubectl) WaitForPackagesInstalled added in v0.12.1

func (k *Kubectl) WaitForPackagesInstalled(ctx context.Context, cluster *types.Cluster, name string, timeout string, namespace string) error

WaitForPackagesInstalled waits for a package resource to reach installed state before returning.

func (*Kubectl) WaitForPod added in v0.12.1

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

WaitForPod waits for a pod resource to reach desired condition before returning.

func (*Kubectl) WaitForPodCompleted added in v0.12.1

func (k *Kubectl) WaitForPodCompleted(ctx context.Context, cluster *types.Cluster, name string, timeout string, namespace string) error

WaitForPodCompleted waits for a pod to be terminated with a Completed state before returning.

func (*Kubectl) WaitForResourceRolledout added in v0.14.0

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

WaitForResourceRolledout waits for a resource (deployment, daemonset, or statefulset) to be successfully rolled out before returning.

func (*Kubectl) WaitForRufioMachines added in v0.15.0

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

WaitForRufioMachines blocks until all Rufio Machines have the desired condition.

func (*Kubectl) WaitForService added in v0.9.2

func (k *Kubectl) WaitForService(ctx context.Context, kubeconfig string, timeout string, target string, namespace string) error

WaitForService blocks until an IP address is assigned.

Until more generic status matching comes around (possibly in 1.23), poll the service, checking for an IP address. Would you like to know more? https://github.com/kubernetes/kubernetes/issues/83094

func (*Kubectl) WaitJSONPath added in v0.12.1

func (k *Kubectl) WaitJSONPath(ctx context.Context, kubeconfig string, timeout string, jsonpath, forCondition string, property string, namespace string, opts ...KubectlOpt) error

WaitJSONPath will wait for a given JSONPath of a required state. Only compatible on K8s 1.23+.

func (*Kubectl) WaitJSONPathLoop added in v0.12.1

func (k *Kubectl) WaitJSONPathLoop(ctx context.Context, kubeconfig string, timeout string, jsonpath, forCondition string, property string, namespace string, opts ...KubectlOpt) error

WaitJSONPathLoop will wait for a given JSONPath to reach a required state similar to wait command for objects without conditions. This will be deprecated in favor of WaitJSONPath after version 1.23.

type KubectlConfigOpt added in v0.15.2

type KubectlConfigOpt func(*Kubectl)

KubectlConfigOpt configures Kubectl on construction.

func WithKubectlNetworkFaultBaseRetryTime added in v0.15.2

func WithKubectlNetworkFaultBaseRetryTime(wait time.Duration) KubectlConfigOpt

WithKubectlNetworkFaultBaseRetryTime configures the base time wait for the exponential backoff for transient network failures during retry operations.

func WithNetworkFaultBackoffFactor added in v0.15.2

func WithNetworkFaultBackoffFactor(factor float64) KubectlConfigOpt

WithNetworkFaultBackoffFactor configures the exponential backoff wait for transient network failures during retry operations.

type KubectlOpt

type KubectlOpt func(*[]string)

func WithAllNamespaces

func WithAllNamespaces() KubectlOpt

WithAllNamespaces is a kubectl option to add all namespaces when making a kubectl call.

func WithCluster

func WithCluster(c *types.Cluster) KubectlOpt

func WithKubeconfig added in v0.6.0

func WithKubeconfig(kubeconfigFile string) KubectlOpt

func WithNamespace

func WithNamespace(n string) KubectlOpt

func WithOverwrite

func WithOverwrite() KubectlOpt

func WithResourceName added in v0.12.0

func WithResourceName(name string) KubectlOpt

WithResourceName is a kubectl option to pass a resource name when making a kubectl call.

func WithSelector added in v0.13.0

func WithSelector(selector string) KubectlOpt

WithSelector is a kubectl option to pass a selector when making kubectl calls.

func WithServer

func WithServer(s string) KubectlOpt

func WithSkipTLSVerify

func WithSkipTLSVerify() KubectlOpt

func WithToken

func WithToken(t string) KubectlOpt

WithToken is a kubectl option to pass a token when making a kubectl call.

func WithWaitAll added in v0.12.0

func WithWaitAll() KubectlOpt

type NutanixDatacenterConfigResponse added in v0.12.0

type NutanixDatacenterConfigResponse struct {
	Items []*v1alpha1.NutanixDatacenterConfig `json:"items,omitempty"`
}

type NutanixMachineConfigResponse added in v0.12.0

type NutanixMachineConfigResponse struct {
	Items []*v1alpha1.NutanixMachineConfig `json:"items,omitempty"`
}

type SSH added in v0.15.0

type SSH struct {
	Executable
}

SSH is an executable for running SSH commands.

func NewSSH added in v0.15.0

func NewSSH(executable Executable) *SSH

NewSSH returns a new instance of SSH client.

func (*SSH) RunCommand added in v0.15.0

func (s *SSH) RunCommand(ctx context.Context, privateKeyPath, username, IP string, command ...string) (string, error)

RunCommand runs a command on the host using SSH.

type Sonobuoy

type Sonobuoy struct {
	Executable
}

func BuildSonobuoyExecutable

func BuildSonobuoyExecutable() *Sonobuoy

func NewSonobuoy

func NewSonobuoy(executable Executable) *Sonobuoy

func (*Sonobuoy) GetResults added in v0.6.0

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

func (*Sonobuoy) Run

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

type SupportBundleAnalysis added in v0.6.0

type SupportBundleAnalysis struct {
	Title   string `json:"title"`
	IsPass  bool   `json:"isPass"`
	IsFail  bool   `json:"isFail"`
	IsWarn  bool   `json:"isWarn"`
	Message string `json:"message"`
	Uri     string `json:"URI"`
}

type Tag added in v0.13.0

type Tag struct {
	Id         string
	Name       string
	CategoryId string `json:"category_id,omitempty"`
}

Tag struct to represent a vSphere Tag.

type TinkerbellDatacenterConfigResponse added in v0.13.0

type TinkerbellDatacenterConfigResponse struct {
	Items []*v1alpha1.TinkerbellDatacenterConfig `json:"items,omitempty"`
}

TinkerbellDatacenterConfigResponse contains list of TinkerbellDatacenterConfig.

type TinkerbellMachineConfigResponse added in v0.13.0

type TinkerbellMachineConfigResponse struct {
	Items []*v1alpha1.TinkerbellMachineConfig `json:"items,omitempty"`
}

TinkerbellMachineConfigResponse contains list of TinkerbellMachineConfig.

type Toleration added in v0.6.1

type Toleration struct {
	Effect            string      `json:"effect,omitempty"`
	Key               string      `json:"key,omitempty"`
	Operator          string      `json:"operator,omitempty"`
	Value             string      `json:"value,omitempty"`
	TolerationSeconds json.Number `json:"tolerationSeconds,omitempty"`
}

type Troubleshoot added in v0.6.0

type Troubleshoot struct {
	Executable
}

func NewTroubleshoot added in v0.6.0

func NewTroubleshoot(executable Executable) *Troubleshoot

func (*Troubleshoot) Analyze added in v0.6.0

func (t *Troubleshoot) Analyze(ctx context.Context, bundleSpecPath string, archivePath string) ([]*SupportBundleAnalysis, error)

func (*Troubleshoot) Collect added in v0.6.0

func (t *Troubleshoot) Collect(ctx context.Context, bundlePath string, sinceTime *time.Time, kubeconfig string) (archivePath string, err error)

type VSphereDatacenterConfigResponse added in v0.6.0

type VSphereDatacenterConfigResponse struct {
	Items []*v1alpha1.VSphereDatacenterConfig `json:"items,omitempty"`
}

type VSphereMachineConfigResponse added in v0.6.0

type VSphereMachineConfigResponse struct {
	Items []*v1alpha1.VSphereMachineConfig `json:"items,omitempty"`
}

type VersionResponse

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

type VirtualDevice added in v0.15.0

type VirtualDevice struct {
	Name         string
	DeviceInfo   deviceInfo
	CapacityInKB float64
}

VirtualDevice describes a virtual device for a VM.

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