Documentation ¶
Index ¶
- Constants
- func GenerateOwnedByLabelValue(namespace, name string) string
- func GetMockAgentClusterInstallTemplate() string
- func GetMockBasicClusterTemplate(kind string) string
- func GetMockBasicNodeTemplate(kind string) string
- func GetMockBmcSecret(name, namespace string) *corev1.Secret
- func GetMockClusterImageSet(name string) *hivev1.ClusterImageSet
- func GetMockClusterTemplate(name, namespace string) *corev1.ConfigMap
- func GetMockExtraManifest(name, namespace string) *corev1.ConfigMap
- func GetMockImageClusterInstallTemplate() string
- func GetMockNMStateConfigTemplate() string
- func GetMockNodeTemplate(name, namespace string) *corev1.ConfigMap
- func GetMockPullSecret(name, namespace string) *corev1.Secret
- func GetMockSNOClusterInstance(testParams *TestParams) *v1alpha1.ClusterInstance
- func GetNamespacedNameFromOwnedByLabel(ownedByLabel string) (types.NamespacedName, error)
- func GetResourceId(name, namespace, kind string) string
- func SetupTestResources(ctx context.Context, c client.Client, testParams *TestParams)
- func TeardownTestResources(ctx context.Context, c client.Client, testParams *TestParams)
- func Validate(ctx context.Context, c client.Client, ...) error
- type ClusterData
- type NetConfigData
- type RenderedObject
- func (r *RenderedObject) GetAPIVersion() string
- func (r *RenderedObject) GetAnnotations() map[string]string
- func (r *RenderedObject) GetKind() string
- func (r *RenderedObject) GetLabels() map[string]string
- func (r *RenderedObject) GetName() string
- func (r *RenderedObject) GetNamespace() string
- func (r *RenderedObject) GetObject() unstructured.Unstructured
- func (r *RenderedObject) GetResourceId() string
- func (r *RenderedObject) GetSyncWave() (int, error)
- func (r *RenderedObject) SetObject(manifest map[string]interface{}) error
- type RenderedObjectCollection
- func (r *RenderedObjectCollection) AddObject(object RenderedObject) error
- func (r *RenderedObjectCollection) AddObjects(objects []RenderedObject) error
- func (r *RenderedObjectCollection) GetPruneObjects() []RenderedObject
- func (r *RenderedObjectCollection) GetRenderObjects() []RenderedObject
- func (r *RenderedObjectCollection) GetSuppressObjects() []RenderedObject
- type SpecialVars
- type TemplateEngine
- type TestParams
- func (tp *TestParams) GenerateBMCSecret() *corev1.Secret
- func (tp *TestParams) GenerateClusterImageSet() *hivev1.ClusterImageSet
- func (tp *TestParams) GenerateClusterTemplate() *corev1.ConfigMap
- func (tp *TestParams) GenerateExtraManifest() *corev1.ConfigMap
- func (tp *TestParams) GenerateNodeTemplate() *corev1.ConfigMap
- func (tp *TestParams) GeneratePullSecret() *corev1.Secret
- func (tp *TestParams) GenerateSNOClusterInstance() *v1alpha1.ClusterInstance
- func (tp *TestParams) GetResources() map[string]string
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 ¶
GenerateOwnedByLabelValue is a utility function that generates the ownedBy label value using the ClusterInstance namespace and name
func GetMockAgentClusterInstallTemplate ¶
func GetMockAgentClusterInstallTemplate() string
func GetMockBmcSecret ¶
func GetMockClusterImageSet ¶
func GetMockClusterImageSet(name string) *hivev1.ClusterImageSet
func GetMockClusterTemplate ¶
func GetMockExtraManifest ¶
func GetMockImageClusterInstallTemplate ¶
func GetMockImageClusterInstallTemplate() string
func GetMockNMStateConfigTemplate ¶
func GetMockNMStateConfigTemplate() string
func GetMockNodeTemplate ¶
func GetMockPullSecret ¶
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 SetupTestResources ¶
func SetupTestResources(ctx context.Context, c client.Client, testParams *TestParams)
func TeardownTestResources ¶
func TeardownTestResources(ctx context.Context, c client.Client, testParams *TestParams)
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 ¶
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 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
Click to show internal directories.
Click to hide internal directories.