machine

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2021 License: Apache-2.0 Imports: 16 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NoOpInvalidMachinesHandler = func(machines []*clusterv1.Machine, errors field.ErrorList) ([]*clusterv1.Machine, error) {
	return nil, nil
}

NoOpInvalidMachinesHandler does nothing when an invalid machines manifest is being provided.

Functions

func FirstMaster added in v0.0.4

FirstMaster scans the provided array of machines and return the first one which is a "Master" or nil if none. Machines and ExistingInfraMachines must be in the same order

func GetKubernetesNamespaceFromMachines added in v0.0.4

func GetKubernetesNamespaceFromMachines(ctx context.Context, c client.Client) (string, error)

GetKubernetesNamespaceFromMachines reads the namespace of the Kubernetes control plane from the applied machines. If no namespace is found, the default Kubernetes namespace will be returned.

func GetKubernetesVersion

func GetKubernetesVersion(machine *clusterv1.Machine) string

GetKubernetesVersion reads the Kubernetes version of the provided machine, or if missing, returns the default version.

func GetKubernetesVersionFromManifest added in v0.0.4

func GetKubernetesVersionFromManifest(machinesManifestPath string) (string, string, error)

GetKubernetesVersionFromManifest reads the version of the Kubernetes control plane from the provided machines' manifest. If no version is configured, the default Kubernetes version will be returned.

func GetKubernetesVersionFromMasterIn added in v0.0.4

func GetKubernetesVersionFromMasterIn(machines []*clusterv1.Machine, bl []*existinginfrav1.ExistingInfraMachine) (string, string, error)

GetKubernetesVersionFromMasterIn reads the version of the Kubernetes control plane from the provided machines. If no version is configured, the default Kubernetes version will be returned.

func IsMaster added in v0.0.4

func IsMaster(machine *clusterv1.Machine) bool

IsMaster returns true if the provided machine is a "Master", and false if it is a "Node" (i.e. worker node) or any other type of machine.

func IsNode added in v0.0.4

func IsNode(machine *clusterv1.Machine) bool

IsNode returns false if the provided machine is a "Master", and true if it is a "Node" (i.e. worker node) or any other type of machine.

func Parse added in v0.0.4

Parse parses the provided machines io.Reader.

func ParseAndDefaultAndValidate added in v0.0.4

func ParseAndDefaultAndValidate(machinesManifestPath string, errorsHandler InvalidMachinesHandler) ([]*clusterv1.Machine, []*existinginfrav1.ExistingInfraMachine, error)

ParseAndDefaultAndValidate parses the provided manifest, validates it and defaults values where possible.

func ParseManifest added in v0.0.4

func ParseManifest(file string) (ml []*clusterv1.Machine, bl []*existinginfrav1.ExistingInfraMachine, err error)

ParseManifest parses the provided machines manifest file.

func Populate added in v0.0.4

func Populate(machines []*clusterv1.Machine)

Populate mutates the machines manifests:

  • fill in default values

func Validate added in v0.0.4

Validate validates the provided machines.

func WriteManifest added in v0.0.4

func WriteManifest(machines []*clusterv1.Machine, eiMachines []*existinginfrav1.ExistingInfraMachine, path string) error

WriteManifest takes an array of Machine and ExistingInfraMachine objects and creates the machines manifest file

Types

type InvalidMachinesHandler added in v0.0.4

type InvalidMachinesHandler = func(machines []*clusterv1.Machine, bl []*existinginfrav1.ExistingInfraMachine, errors field.ErrorList) ([]*clusterv1.Machine, []*existinginfrav1.ExistingInfraMachine, error)

InvalidMachinesHandler encapsulates logic to apply in case of an invalid machines manifest being provided.

Jump to

Keyboard shortcuts

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