Documentation ¶
Index ¶
- Constants
- func NewFakeManagedCluster(name string) *clusterv1.ManagedCluster
- func NewFakeManagedClusterAddon(name, clusterName, installNamespace, values string) *addonapiv1alpha1.ManagedClusterAddOn
- type AgentAddonFactory
- func (f *AgentAddonFactory) BuildHelmAgentAddon() (agent.AgentAddon, error)
- func (f *AgentAddonFactory) BuildTemplateAgentAddon() (agent.AgentAddon, error)
- func (f *AgentAddonFactory) WithAgentHealthProber(prober *agent.HealthProber) *AgentAddonFactory
- func (f *AgentAddonFactory) WithAgentRegistrationOption(option *agent.RegistrationOption) *AgentAddonFactory
- func (f *AgentAddonFactory) WithGetValuesFuncs(getValuesFuncs ...GetValuesFunc) *AgentAddonFactory
- func (f *AgentAddonFactory) WithInstallStrategy(strategy *agent.InstallStrategy) *AgentAddonFactory
- func (f *AgentAddonFactory) WithScheme(scheme *runtime.Scheme) *AgentAddonFactory
- func (f *AgentAddonFactory) WithTrimCRDDescription() *AgentAddonFactory
- type GetValuesFunc
- type HelmAgentAddon
- type TemplateAgentAddon
- type Values
Constants ¶
const AddonDefaultInstallNamespace = "open-cluster-management-agent-addon"
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 ¶
func (a *HelmAgentAddon) Manifests( cluster *clusterv1.ManagedCluster, addon *addonapiv1alpha1.ManagedClusterAddOn) ([]runtime.Object, error)
type TemplateAgentAddon ¶
type TemplateAgentAddon struct {
// contains filtered or unexported fields
}
func (*TemplateAgentAddon) GetAgentAddonOptions ¶
func (a *TemplateAgentAddon) GetAgentAddonOptions() agent.AgentAddonOptions
func (*TemplateAgentAddon) Manifests ¶
func (a *TemplateAgentAddon) Manifests( cluster *clusterv1.ManagedCluster, addon *addonapiv1alpha1.ManagedClusterAddOn) ([]runtime.Object, error)
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 ¶
JsonStructToValues converts the given json struct to a Values
func MergeValues ¶
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