addonfactory

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2022 License: Apache-2.0 Imports: 23 Imported by: 31

Documentation

Index

Constants

View Source
const AddonDefaultInstallNamespace = "open-cluster-management-agent-addon"
View Source
const AnnotationValuesName string = "addon.open-cluster-management.io/values"

AnnotationValuesName is the annotation Name of customized values

Variables

This section is empty.

Functions

func NewFakeManagedCluster

func NewFakeManagedCluster(name string) *clusterv1.ManagedCluster

func NewFakeManagedClusterAddon

func NewFakeManagedClusterAddon(name, clusterName, installNamespace, values string) *addonapiv1alpha1.ManagedClusterAddOn

Types

type AgentAddonFactory

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

AgentAddonFactory includes the common fields for building different agentAddon instances.

func NewAgentAddonFactory

func NewAgentAddonFactory(addonName string, fs embed.FS, dir string) *AgentAddonFactory

NewAgentAddonFactory builds an addonAgentFactory instance with addon name and fs. dir is the path prefix based on the fs path.

func (*AgentAddonFactory) BuildHelmAgentAddon

func (f *AgentAddonFactory) BuildHelmAgentAddon() (agent.AgentAddon, error)

BuildHelmAgentAddon builds a helm agentAddon instance.

func (*AgentAddonFactory) BuildTemplateAgentAddon

func (f *AgentAddonFactory) BuildTemplateAgentAddon() (agent.AgentAddon, error)

BuildTemplateAgentAddon builds a template agentAddon instance.

func (*AgentAddonFactory) WithAgentHealthProber added in v0.4.0

func (f *AgentAddonFactory) WithAgentHealthProber(prober *agent.HealthProber) *AgentAddonFactory

WithAgentHealthProber defines how is the healthiness status of the ManagedClusterAddon probed.

func (*AgentAddonFactory) WithAgentRegistrationOption

func (f *AgentAddonFactory) WithAgentRegistrationOption(option *agent.RegistrationOption) *AgentAddonFactory

WithAgentRegistrationOption defines how agent is registered to the hub cluster.

func (*AgentAddonFactory) WithGetValuesFuncs

func (f *AgentAddonFactory) WithGetValuesFuncs(getValuesFuncs ...GetValuesFunc) *AgentAddonFactory

WithGetValuesFuncs adds a list of the getValues func. the values got from the big index Func will override the one from small index Func.

func (*AgentAddonFactory) WithInstallStrategy

func (f *AgentAddonFactory) WithInstallStrategy(strategy *agent.InstallStrategy) *AgentAddonFactory

WithInstallStrategy defines the installation strategy of the manifests prescribed by Manifests(..).

func (*AgentAddonFactory) WithScheme

func (f *AgentAddonFactory) WithScheme(scheme *runtime.Scheme) *AgentAddonFactory

WithScheme is an optional configuration, only used when the agentAddon has customized resource types.

func (*AgentAddonFactory) WithTrimCRDDescription

func (f *AgentAddonFactory) WithTrimCRDDescription() *AgentAddonFactory

WithTrimCRDDescription is to enable trim the description of CRDs in manifestWork.

type GetValuesFunc

type GetValuesFunc func(cluster *clusterv1.ManagedCluster,
	addon *addonapiv1alpha1.ManagedClusterAddOn) (Values, error)

type HelmAgentAddon

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

func (*HelmAgentAddon) GetAgentAddonOptions

func (a *HelmAgentAddon) GetAgentAddonOptions() agent.AgentAddonOptions

func (*HelmAgentAddon) Manifests

type TemplateAgentAddon

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

func (*TemplateAgentAddon) GetAgentAddonOptions

func (a *TemplateAgentAddon) GetAgentAddonOptions() agent.AgentAddonOptions

func (*TemplateAgentAddon) Manifests

type Values

type Values map[string]interface{}

func GetValuesFromAddonAnnotation

func GetValuesFromAddonAnnotation(
	cluster *clusterv1.ManagedCluster,
	addon *addonapiv1alpha1.ManagedClusterAddOn) (Values, error)

GetValuesFromAddonAnnotation get the values in the annotation of addon cr. the key of the annotation is `addon.open-cluster-management.io/values`, the value is a json string which has the values. for example: "addon.open-cluster-management.io/values": `{"NodeSelector":{"host":"ssd"},"Image":"quay.io/helloworld:2.4"}`

func JsonStructToValues

func JsonStructToValues(a interface{}) (Values, error)

JsonStructToValues converts the given json struct to a Values

func MergeValues

func MergeValues(a, b Values) Values

MergeValues merges the 2 given Values to a Values. the values of b will override that in a for the same fields.

func StructToValues

func StructToValues(a interface{}) Values

StructToValues converts the given struct to a Values

Jump to

Keyboard shortcuts

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