util

package
v1.10.0 Latest Latest
Warning

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

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

Documentation

Overview

Package util contains common tools for flavorgen.

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultReplacements = []Replacement{
		{
			Kind:      "KubeadmControlPlane",
			Name:      "${CLUSTER_NAME}",
			Value:     env.ControlPlaneMachineCountVar,
			FieldPath: []string{"spec", "replicas"},
		},
		{
			Kind:      "MachineDeployment",
			Name:      "${CLUSTER_NAME}-md-0",
			Value:     env.WorkerMachineCountVar,
			FieldPath: []string{"spec", "replicas"},
		},
		{
			Kind:      "MachineDeployment",
			Name:      "${CLUSTER_NAME}-md-0",
			Value:     map[string]interface{}{},
			FieldPath: []string{"spec", "selector", "matchLabels"},
		},
		{
			Kind:      "VSphereClusterTemplate",
			Name:      "${CLUSTER_CLASS_NAME}",
			Value:     map[string]interface{}{},
			FieldPath: []string{"spec", "template", "spec"},
		},
		{
			Kind:      "VSphereCluster",
			Name:      "${CLUSTER_NAME}",
			Value:     env.ControlPlaneEndpointPortVar,
			FieldPath: []string{"spec", "controlPlaneEndpoint", "port"},
		},
	}
)

Functions

func GenerateManifestYaml

func GenerateManifestYaml(objs []runtime.Object, replacements []Replacement) string

func GenerateObjectYAML

func GenerateObjectYAML(obj runtime.Object, replacements []Replacement) string

func TypeToKind

func TypeToKind(i interface{}) string

Types

type Replacement

type Replacement struct {
	Kind      string
	Name      string
	Value     interface{}
	FieldPath []string
}

Jump to

Keyboard shortcuts

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