common

package
v0.0.0-...-3385690 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: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CloudControllerManagerProviderLabel = "infrastructure.openshift.io/cloud-controller-manager"
	CloudNodeManagerCloudProviderLabel  = "infrastructure.openshift.io/cloud-node-manager"
)

Variables

This section is empty.

Functions

func GetCommonResources

func GetCommonResources(config config.OperatorConfig) ([]client.Object, error)

func NoOpTransformer

func NoOpTransformer(source string, infra *configv1.Infrastructure, network *configv1.Network) (string, error)

NoOpTransformer implements the cloudConfigTransformer. It makes no changes to the source configuration and simply returns it as-is.

func RenderTemplates

func RenderTemplates(templates []ObjectTemplate, values TemplateValues) ([]client.Object, error)

RenderTemplates renders array of templates with given TemplateValues map. Returns list of controller-runtime's client.Objects which are ready to further substitution or for passing it directly to kubernetes cluster.

func SubstituteCommonPartsFromConfig

func SubstituteCommonPartsFromConfig(config config.OperatorConfig, renderedObjects []client.Object) []client.Object

Types

type CloudProviderAssets

type CloudProviderAssets interface {
	// GetRenderedResources intended to return ready to apply list of resources.
	// Expected that resources returned by this method is completely prepared and do not need additional handling.
	GetRenderedResources() []client.Object
}

CloudProviderAssets represent cloud provider specific assets object. Such as Azure/Aws/OpenStack/etc. Intended to hide provider specific resource management, manifests checks and rendering behind this interface.

type ObjectTemplate

type ObjectTemplate struct {
	TemplateSource
	// contains filtered or unexported fields
}

ObjectTemplate extension of TemplateSource, contains Template object from 'text/template' for further rendering with TemplateValues

func ReadTemplates

func ReadTemplates(f embed.FS, sources []TemplateSource) ([]ObjectTemplate, error)

ReadTemplates reads templates content from given embed.FS instance by paths passed in each TemplateSource. Basically this function transforms TemplateSource to ObjectTemplate by populating each object with a bit configured 'text/template' Templates.

type TemplateSource

type TemplateSource struct {
	ReferenceObject client.Object
	EmbedFsPath     string
}

TemplateSource structure which intended to keep path to template and reference kubernetes object for further unmarshalling (such as Deployment, DaemonSet, ConfigMap, etc)

type TemplateValues

type TemplateValues map[string]interface{}

TemplateValues represents values map which would be used in ObjectTemplate rendering

Jump to

Keyboard shortcuts

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