Documentation ¶
Index ¶
- Constants
- func GetCommonResources(config config.OperatorConfig) ([]client.Object, error)
- func NoOpTransformer(source string, infra *configv1.Infrastructure, network *configv1.Network) (string, error)
- func RenderTemplates(templates []ObjectTemplate, values TemplateValues) ([]client.Object, error)
- func SubstituteCommonPartsFromConfig(config config.OperatorConfig, renderedObjects []client.Object) []client.Object
- type CloudProviderAssets
- type ObjectTemplate
- type TemplateSource
- type TemplateValues
Constants ¶
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.
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 ¶
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