Documentation
¶
Index ¶
- Variables
- func FirstMaster(machines []*clusterv1.Machine, bl []*existinginfrav1.ExistingInfraMachine) (*clusterv1.Machine, *existinginfrav1.ExistingInfraMachine)
- func GetKubernetesNamespaceFromMachines(ctx context.Context, c client.Client) (string, error)
- func GetKubernetesVersion(machine *clusterv1.Machine) string
- func GetKubernetesVersionFromManifest(machinesManifestPath string) (string, string, error)
- func GetKubernetesVersionFromMasterIn(machines []*clusterv1.Machine, bl []*existinginfrav1.ExistingInfraMachine) (string, string, error)
- func IsMaster(machine *clusterv1.Machine) bool
- func IsNode(machine *clusterv1.Machine) bool
- func Parse(rc io.ReadCloser) (ml []*clusterv1.Machine, bl []*existinginfrav1.ExistingInfraMachine, err error)
- func ParseAndDefaultAndValidate(machinesManifestPath string, errorsHandler InvalidMachinesHandler) ([]*clusterv1.Machine, []*existinginfrav1.ExistingInfraMachine, error)
- func ParseManifest(file string) (ml []*clusterv1.Machine, bl []*existinginfrav1.ExistingInfraMachine, err error)
- func Populate(machines []*clusterv1.Machine)
- func Validate(machines []*clusterv1.Machine, bl []*existinginfrav1.ExistingInfraMachine) field.ErrorList
- func WriteManifest(machines []*clusterv1.Machine, ...) error
- type InvalidMachinesHandler
Constants ¶
This section is empty.
Variables ¶
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
func FirstMaster(machines []*clusterv1.Machine, bl []*existinginfrav1.ExistingInfraMachine) (*clusterv1.Machine, *existinginfrav1.ExistingInfraMachine)
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
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 ¶
GetKubernetesVersion reads the Kubernetes version of the provided machine, or if missing, returns the default version.
func GetKubernetesVersionFromManifest ¶ added in v0.0.4
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
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
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
func Parse(rc io.ReadCloser) (ml []*clusterv1.Machine, bl []*existinginfrav1.ExistingInfraMachine, err error)
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 Validate ¶ added in v0.0.4
func Validate(machines []*clusterv1.Machine, bl []*existinginfrav1.ExistingInfraMachine) field.ErrorList
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.