yaml

package
v0.18.5 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProcessCluster

func ProcessCluster[C clusterapi.Object[C], M clusterapi.Object[M]](cp *clusterapi.ControlPlane[C, M], lookup yamlutil.ObjectLookup)

ProcessCluster finds the CAPI cluster in the parsed objects and sets it in ControlPlane.

func ProcessControlPlaneObjects

func ProcessControlPlaneObjects[C clusterapi.Object[C], M clusterapi.Object[M]](cp *clusterapi.ControlPlane[C, M], lookup yamlutil.ObjectLookup)

ProcessControlPlaneObjects finds all necessary objects in the parsed objects and sets them in the ControlPlane.

func ProcessEtcdCluster

func ProcessEtcdCluster[C clusterapi.Object[C], M clusterapi.Object[M]](cp *clusterapi.ControlPlane[C, M], lookup yamlutil.ObjectLookup)

ProcessEtcdCluster finds the CAPI etcdadm cluster (for unstacked clusters) in the parsed objects and sets it in ControlPlane.

func ProcessKubeadmControlPlane

func ProcessKubeadmControlPlane[C clusterapi.Object[C], M clusterapi.Object[M]](cp *clusterapi.ControlPlane[C, M], lookup yamlutil.ObjectLookup)

ProcessKubeadmControlPlane finds the CAPI kubeadm control plane and the kubeadm control plane machine template in the parsed objects and sets it in ControlPlane.

func ProcessProviderCluster

func ProcessProviderCluster[C clusterapi.Object[C], M clusterapi.Object[M]](cp *clusterapi.ControlPlane[C, M], lookup yamlutil.ObjectLookup)

ProcessProviderCluster finds the provider cluster in the parsed objects and sets it in ControlPlane.

func ProcessWorkerGroupObjects

func ProcessWorkerGroupObjects[M clusterapi.Object[M]](g *clusterapi.WorkerGroup[M], lookup yamlutil.ObjectLookup)

ProcessWorkerGroupObjects looks in the parsed objects for the KubeadmConfigTemplate and the provider machine template referenced in the MachineDeployment and sets them in the WorkerGroup. MachineDeployment needs to be already set in the WorkerGroup.

func ProcessWorkerObjects

func ProcessWorkerObjects[M clusterapi.Object[M]](w *clusterapi.Workers[M], lookup yamlutil.ObjectLookup)

ProcessWorkerObjects finds all necessary objects in the parsed objects and sets them in Workers.

func RegisterControlPlaneMappings

func RegisterControlPlaneMappings(parser *yamlutil.Parser) error

RegisterControlPlaneMappings records the basic mappings for CAPI cluster, kubeadmcontrolplane and etcdadm cluster in a Parser.

func RegisterWorkerMappings

func RegisterWorkerMappings(parser *yamlutil.Parser) error

RegisterWorkerMappings records the basic mappings for CAPI MachineDeployment and KubeadmConfigTemplate in a Parser.

Types

type ControlPlaneBuilder

type ControlPlaneBuilder[C clusterapi.Object[C], M clusterapi.Object[M]] struct {
	ControlPlane *clusterapi.ControlPlane[C, M]
}

ControlPlaneBuilder implements yamlutil.Builder It's a wrapper around ControlPlane to provide yaml parsing functionality.

func NewControlPlaneBuilder

func NewControlPlaneBuilder[C clusterapi.Object[C], M clusterapi.Object[M]]() *ControlPlaneBuilder[C, M]

NewControlPlaneBuilder builds a ControlPlaneBuilder.

func NewControlPlaneParserAndBuilder

func NewControlPlaneParserAndBuilder[C clusterapi.Object[C], M clusterapi.Object[M]](logger logr.Logger, clusterMapping yamlutil.Mapping[C], machineTemplateMapping yamlutil.Mapping[M]) (*yamlutil.Parser, *ControlPlaneBuilder[C, M], error)

NewControlPlaneParserAndBuilder builds a Parser and a Builder for a particular provider ControlPlane It registers the basic shared mappings plus another two for the provider cluster and machine template For ControlPlane that need to include more objects, wrap around the provider builder and implement BuildFromParsed Any extra mappings will need to be registered manually in the Parser.

func (*ControlPlaneBuilder[C, M]) BuildFromParsed

func (cp *ControlPlaneBuilder[C, M]) BuildFromParsed(lookup yamlutil.ObjectLookup) error

BuildFromParsed reads parsed objects in ObjectLookup and sets them in the ControlPlane.

type WorkersBuilder

type WorkersBuilder[M clusterapi.Object[M]] struct {
	Workers *clusterapi.Workers[M]
}

WorkersBuilder implements yamlutil.Builder It's a wrapper around Workers to provide yaml parsing functionality.

func NewWorkersBuilder

func NewWorkersBuilder[M clusterapi.Object[M]]() *WorkersBuilder[M]

NewWorkersBuilder builds a WorkersBuilder.

func NewWorkersParserAndBuilder

func NewWorkersParserAndBuilder[M clusterapi.Object[M]](
	logger logr.Logger,
	machineTemplateMapping yamlutil.Mapping[M],
) (*yamlutil.Parser, *WorkersBuilder[M], error)

NewWorkersParserAndBuilder builds a Parser and a Builder for a particular provider Workers It registers the basic shared mappings plus another one for the provider machine template For worker specs that need to include more objects, wrap around the provider builder and implement BuildFromParsed. Any extra mappings will need to be registered manually in the Parser.

func (*WorkersBuilder[M]) BuildFromParsed

func (cp *WorkersBuilder[M]) BuildFromParsed(lookup yamlutil.ObjectLookup) error

BuildFromParsed reads parsed objects in ObjectLookup and sets them in the Workers.

Jump to

Keyboard shortcuts

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