clusterinstance

package
v0.0.0-...-76f76a2 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AnnotationsKey = "annotations"
	LabelsKey      = "labels"
)
View Source
const (
	WaveAnnotation        = v1alpha1.Group + "/sync-wave"
	DefaultWaveAnnotation = "0"
	OwnedByLabel          = v1alpha1.Group + "/owned-by"
)

Variables

This section is empty.

Functions

func GenerateOwnedByLabelValue

func GenerateOwnedByLabelValue(namespace, name string) string

GenerateOwnedByLabelValue is a utility function that generates the ownedBy label value using the ClusterInstance namespace and name

func GetMockAgentClusterInstallTemplate

func GetMockAgentClusterInstallTemplate() string

func GetMockBasicClusterTemplate

func GetMockBasicClusterTemplate(kind string) string

func GetMockBasicNodeTemplate

func GetMockBasicNodeTemplate(kind string) string

func GetMockBmcSecret

func GetMockBmcSecret(name, namespace string) *corev1.Secret

func GetMockClusterImageSet

func GetMockClusterImageSet(name string) *hivev1.ClusterImageSet

func GetMockClusterTemplate

func GetMockClusterTemplate(name, namespace string) *corev1.ConfigMap

func GetMockExtraManifest

func GetMockExtraManifest(name, namespace string) *corev1.ConfigMap

func GetMockImageClusterInstallTemplate

func GetMockImageClusterInstallTemplate() string

func GetMockNMStateConfigTemplate

func GetMockNMStateConfigTemplate() string

func GetMockNodeTemplate

func GetMockNodeTemplate(name, namespace string) *corev1.ConfigMap

func GetMockPullSecret

func GetMockPullSecret(name, namespace string) *corev1.Secret

func GetMockSNOClusterInstance

func GetMockSNOClusterInstance(testParams *TestParams) *v1alpha1.ClusterInstance

func GetNamespacedNameFromOwnedByLabel

func GetNamespacedNameFromOwnedByLabel(ownedByLabel string) (types.NamespacedName, error)

GetNamespacedNameFromOwnedByLabel extracts the namespace and name from the ownedBy label value

func GetResourceId

func GetResourceId(name, namespace, kind string) string

func SetupTestResources

func SetupTestResources(ctx context.Context, c client.Client, testParams *TestParams)

func TeardownTestResources

func TeardownTestResources(ctx context.Context, c client.Client, testParams *TestParams)

func Validate

func Validate(ctx context.Context, c client.Client, clusterInstance *v1alpha1.ClusterInstance) error

Validate checks the given ClusterInstance, returns an error if validation fails, returns nil if it succeeds

Types

type ClusterData

type ClusterData struct {
	Spec        v1alpha1.ClusterInstanceSpec
	SpecialVars SpecialVars
}

ClusterData is a special object that provides an interface to the ClusterInstance spec fields for use in rendering templates

type NetConfigData

type NetConfigData struct {
	Interfaces []*aiv1beta1.Interface
	Config     map[string]interface{}
}

func GetMockNetConfig

func GetMockNetConfig() *NetConfigData

func (*NetConfigData) GetInterfaces

func (nc *NetConfigData) GetInterfaces() []interface{}

func (*NetConfigData) RawNetConfig

func (nc *NetConfigData) RawNetConfig() string

type RenderedObject

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

func (*RenderedObject) GetAPIVersion

func (r *RenderedObject) GetAPIVersion() string

func (*RenderedObject) GetAnnotations

func (r *RenderedObject) GetAnnotations() map[string]string

func (*RenderedObject) GetKind

func (r *RenderedObject) GetKind() string

func (*RenderedObject) GetLabels

func (r *RenderedObject) GetLabels() map[string]string

func (*RenderedObject) GetName

func (r *RenderedObject) GetName() string

func (*RenderedObject) GetNamespace

func (r *RenderedObject) GetNamespace() string

func (*RenderedObject) GetObject

func (r *RenderedObject) GetObject() unstructured.Unstructured

func (*RenderedObject) GetResourceId

func (r *RenderedObject) GetResourceId() string

func (*RenderedObject) GetSyncWave

func (r *RenderedObject) GetSyncWave() (int, error)

func (*RenderedObject) SetObject

func (r *RenderedObject) SetObject(manifest map[string]interface{}) error

type RenderedObjectCollection

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

func (*RenderedObjectCollection) AddObject

func (r *RenderedObjectCollection) AddObject(object RenderedObject) error

func (*RenderedObjectCollection) AddObjects

func (r *RenderedObjectCollection) AddObjects(objects []RenderedObject) error

func (*RenderedObjectCollection) GetPruneObjects

func (r *RenderedObjectCollection) GetPruneObjects() []RenderedObject

func (*RenderedObjectCollection) GetRenderObjects

func (r *RenderedObjectCollection) GetRenderObjects() []RenderedObject

func (*RenderedObjectCollection) GetSuppressObjects

func (r *RenderedObjectCollection) GetSuppressObjects() []RenderedObject

type SpecialVars

type SpecialVars struct {
	CurrentNode                      v1alpha1.NodeSpec
	InstallConfigOverrides           string
	ControlPlaneAgents, WorkerAgents int
}

type TemplateEngine

type TemplateEngine struct{}

func NewTemplateEngine

func NewTemplateEngine() *TemplateEngine

func (*TemplateEngine) ProcessTemplates

func (te *TemplateEngine) ProcessTemplates(
	ctx context.Context,
	c client.Client,
	log *zap.Logger,
	clusterInstance v1alpha1.ClusterInstance,
) (RenderedObjectCollection, error)

type TestParams

type TestParams struct {
	ClusterName         string
	ClusterNamespace    string
	PullSecret          string
	BmcCredentialsName  string
	ClusterImageSetName string
	ExtraManifestName   string
	ClusterTemplateRef  string
	NodeTemplateRef     string
}

func (*TestParams) GenerateBMCSecret

func (tp *TestParams) GenerateBMCSecret() *corev1.Secret

func (*TestParams) GenerateClusterImageSet

func (tp *TestParams) GenerateClusterImageSet() *hivev1.ClusterImageSet

func (*TestParams) GenerateClusterTemplate

func (tp *TestParams) GenerateClusterTemplate() *corev1.ConfigMap

func (*TestParams) GenerateExtraManifest

func (tp *TestParams) GenerateExtraManifest() *corev1.ConfigMap

func (*TestParams) GenerateNodeTemplate

func (tp *TestParams) GenerateNodeTemplate() *corev1.ConfigMap

func (*TestParams) GeneratePullSecret

func (tp *TestParams) GeneratePullSecret() *corev1.Secret

func (*TestParams) GenerateSNOClusterInstance

func (tp *TestParams) GenerateSNOClusterInstance() *v1alpha1.ClusterInstance

func (*TestParams) GetResources

func (tp *TestParams) GetResources() map[string]string

Jump to

Keyboard shortcuts

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