From c5d1261c4624bb6ffc1e61a90200384a75e21311 Mon Sep 17 00:00:00 2001 From: Artur Shad Nik Date: Mon, 14 Jul 2025 16:42:50 -0700 Subject: [PATCH 1/4] feat: update fleetconfig API to support configuring add-ons Signed-off-by: Artur Shad Nik chore: whitespace Signed-off-by: Artur Shad Nik --- .../api/v1alpha1/fleetconfig_types.go | 41 ++++++++++++++ .../api/v1alpha1/zz_generated.deepcopy.go | 55 +++++++++++++++++++ .../charts/fleetconfig-controller/README.md | 10 ++-- ...onfig.open-cluster-management.io-crds.yaml | 55 +++++++++++++++++++ .../templates/fleetconfig.yaml | 2 + .../templates/ocm/add-ons.yaml | 17 ++++++ .../charts/fleetconfig-controller/values.yaml | 23 ++++++++ ...en-cluster-management.io_fleetconfigs.yaml | 55 +++++++++++++++++++ 8 files changed, 253 insertions(+), 5 deletions(-) create mode 100644 fleetconfig-controller/charts/fleetconfig-controller/templates/ocm/add-ons.yaml diff --git a/fleetconfig-controller/api/v1alpha1/fleetconfig_types.go b/fleetconfig-controller/api/v1alpha1/fleetconfig_types.go index 887328a4..cad515ba 100644 --- a/fleetconfig-controller/api/v1alpha1/fleetconfig_types.go +++ b/fleetconfig-controller/api/v1alpha1/fleetconfig_types.go @@ -29,6 +29,7 @@ type FleetConfigSpec struct { Hub Hub `json:"hub"` Spokes []Spoke `json:"spokes"` RegistrationAuth *RegistrationAuth `json:"registrationAuth,omitempty"` + AddOns []*AddOnConfig `json:"addOns,omitempty"` } // FleetConfigStatus defines the observed state of FleetConfig. @@ -306,6 +307,21 @@ type Spoke struct { // ClusterARN is the ARN of the spoke cluster. // This field is optionally used for AWS IRSA registration authentication. ClusterARN string `json:"clusterARN,omitempty"` + + // AddOns are the add-ons to enable for the spoke cluster. + AddOns []SpokeAddOn `json:"addOns,omitempty"` +} + +// SpokeAddOn is the configuration for enabling add-on installation on the spoke cluster. +type SpokeAddOn struct { + // The name of the add-on. Must match one of the default or manually configured addon names. + Name string `json:"name"` + + // The spoke cluster namespace to install the add-on in. If left empty, installs into "open-cluster-managedment-addon" namespace. + InstallNamespace string `json:"installNamespace,omitempty"` + + // Optional annotations to apply to the add-on. + Annotations map[string]string `json:"annotations,omitempty"` } // JoinType returns a status condition type indicating that a particular Spoke cluster has joined the Hub. @@ -450,6 +466,31 @@ type RegistrationAuth struct { AutoApprovedARNPatterns []string `json:"autoApprovedARNPatterns,omitempty"` } +// AddOnConfig is the configuration of a custom AddOn that can be installed on spoke clusters. +type AddOnConfig struct { + // The name of the add-on. + Name string `json:"name"` + + // The add-on version. Optional, defaults to "v0.0.1" + // +optional + // +kubebuilder:default:="v0.0.1" + Version string `json:"version,omitempty"` + + // The rolebinding to the clusterrole in the cluster namespace for the addon agent + // +optional + ClusterRoleBinding string `json:"clusterRoleBinding,omitempty"` + + // Enable the agent to register to the hub cluster. Optional, defaults to false. + // +optional + // +kubebuilder:default:=false + HubRegistration bool `json:"hubRegistration,omitempty"` + + // Whether to overwrite the add-on if it already exists. Optional, defaults to false. + // +optional + // +kubebuilder:default:=false + Overwrite bool `json:"overwrite,omitempty"` +} + // +kubebuilder:object:root=true // +kubebuilder:subresource:status // +kubebuilder:printcolumn:name="PHASE",type=string,JSONPath=`.status.phase` diff --git a/fleetconfig-controller/api/v1alpha1/zz_generated.deepcopy.go b/fleetconfig-controller/api/v1alpha1/zz_generated.deepcopy.go index e6141432..857ff12f 100644 --- a/fleetconfig-controller/api/v1alpha1/zz_generated.deepcopy.go +++ b/fleetconfig-controller/api/v1alpha1/zz_generated.deepcopy.go @@ -24,6 +24,21 @@ import ( "k8s.io/apimachinery/pkg/runtime" ) +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AddOnConfig) DeepCopyInto(out *AddOnConfig) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AddOnConfig. +func (in *AddOnConfig) DeepCopy() *AddOnConfig { + if in == nil { + return nil + } + out := new(AddOnConfig) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ClusterManager) DeepCopyInto(out *ClusterManager) { *out = *in @@ -170,6 +185,17 @@ func (in *FleetConfigSpec) DeepCopyInto(out *FleetConfigSpec) { *out = new(RegistrationAuth) (*in).DeepCopyInto(*out) } + if in.AddOns != nil { + in, out := &in.AddOns, &out.AddOns + *out = make([]*AddOnConfig, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(AddOnConfig) + **out = **in + } + } + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FleetConfigSpec. @@ -463,6 +489,13 @@ func (in *Spoke) DeepCopyInto(out *Spoke) { (*in).DeepCopyInto(*out) } in.Klusterlet.DeepCopyInto(&out.Klusterlet) + if in.AddOns != nil { + in, out := &in.AddOns, &out.AddOns + *out = make([]SpokeAddOn, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Spoke. @@ -474,3 +507,25 @@ func (in *Spoke) DeepCopy() *Spoke { in.DeepCopyInto(out) return out } + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SpokeAddOn) DeepCopyInto(out *SpokeAddOn) { + *out = *in + if in.Annotations != nil { + in, out := &in.Annotations, &out.Annotations + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SpokeAddOn. +func (in *SpokeAddOn) DeepCopy() *SpokeAddOn { + if in == nil { + return nil + } + out := new(SpokeAddOn) + in.DeepCopyInto(out) + return out +} diff --git a/fleetconfig-controller/charts/fleetconfig-controller/README.md b/fleetconfig-controller/charts/fleetconfig-controller/README.md index 960c68f7..880edfe2 100644 --- a/fleetconfig-controller/charts/fleetconfig-controller/README.md +++ b/fleetconfig-controller/charts/fleetconfig-controller/README.md @@ -57,11 +57,11 @@ If provided, deploy a singleton control plane instead of Cluster Manager. To enable singleton mode, `fleetConfig.hub.singletonControlPlane` must be uncommented and configured with the following options: - **name**: The name of the singleton control plane (default: "singleton-controlplane") - **helm**: Helm configuration for the multicluster-controlplane Helm chart - - **values**: Raw, YAML-formatted Helm values - - **set**: List of comma-separated Helm values (e.g., key1=val1,key2=val2) - - **setJson**: List of comma-separated Helm JSON values - - **setLiteral**: List of comma-separated Helm literal STRING values - - **setString**: List of comma-separated Helm STRING values +- **values**: Raw, YAML-formatted Helm values +- **set**: List of comma-separated Helm values (e.g., key1=val1,key2=val2) +- **setJson**: List of comma-separated Helm JSON values +- **setLiteral**: List of comma-separated Helm literal STRING values +- **setString**: List of comma-separated Helm STRING values Refer to the [Multicluster Controlplane configuration](https://github.com/open-cluster-management-io/multicluster-controlplane/blob/main/charts/multicluster-controlplane/values.yaml) for more details. diff --git a/fleetconfig-controller/charts/fleetconfig-controller/crds/fleetconfig.open-cluster-management.io-crds.yaml b/fleetconfig-controller/charts/fleetconfig-controller/crds/fleetconfig.open-cluster-management.io-crds.yaml index 5b5322c3..91bf8c5e 100644 --- a/fleetconfig-controller/charts/fleetconfig-controller/crds/fleetconfig.open-cluster-management.io-crds.yaml +++ b/fleetconfig-controller/charts/fleetconfig-controller/crds/fleetconfig.open-cluster-management.io-crds.yaml @@ -56,6 +56,36 @@ spec: spec: description: FleetConfigSpec defines the desired state of FleetConfig. properties: + addOns: + items: + description: AddOnConfig is the configuration of a custom AddOn + that can be installed on spoke clusters. + properties: + clusterRoleBinding: + description: The rolebinding to the clusterrole in the cluster + namespace for the addon agent + type: string + hubRegistration: + default: false + description: Enable the agent to register to the hub cluster. + Optional, defaults to false. + type: boolean + name: + description: The name of the add-on. + type: string + overwrite: + default: false + description: Whether to overwrite the add-on if it already exists. + Optional, defaults to false. + type: boolean + version: + default: v0.0.1 + description: The add-on version. Optional, defaults to "v0.0.1" + type: string + required: + - name + type: object + type: array hub: description: Hub provides specifications for an OCM hub cluster. properties: @@ -281,6 +311,31 @@ spec: description: Spoke provides specifications for joining and potentially upgrading spokes. properties: + addOns: + description: AddOns are the add-ons to enable for the spoke + cluster. + items: + description: SpokeAddOn is the configuration for enabling + add-on installation on the spoke cluster. + properties: + annotations: + additionalProperties: + type: string + description: Optional annotations to apply to the add-on. + type: object + installNamespace: + description: The spoke cluster namespace to install the + add-on in. If left empty, installs into "open-cluster-managedment-addon" + namespace. + type: string + name: + description: The name of the add-on. Must match one of + the default or manually configured addon names. + type: string + required: + - name + type: object + type: array ca: description: Hub cluster CA certificate, optional type: string diff --git a/fleetconfig-controller/charts/fleetconfig-controller/templates/fleetconfig.yaml b/fleetconfig-controller/charts/fleetconfig-controller/templates/fleetconfig.yaml index 0c1cfc9f..7ac2d4c2 100644 --- a/fleetconfig-controller/charts/fleetconfig-controller/templates/fleetconfig.yaml +++ b/fleetconfig-controller/charts/fleetconfig-controller/templates/fleetconfig.yaml @@ -60,5 +60,7 @@ spec: source: bundleVersion: {{ $.Values.fleetConfig.source.bundleVersion }} registry: {{ $.Values.fleetConfig.source.registry }} + addOns: {{- toYaml .addOns | nindent 8 }} {{- end }} + addOns: {{- toYaml .Values.fleetConfig.addOns | nindent 4 }} {{- end }} diff --git a/fleetconfig-controller/charts/fleetconfig-controller/templates/ocm/add-ons.yaml b/fleetconfig-controller/charts/fleetconfig-controller/templates/ocm/add-ons.yaml new file mode 100644 index 00000000..bd0c0a25 --- /dev/null +++ b/fleetconfig-controller/charts/fleetconfig-controller/templates/ocm/add-ons.yaml @@ -0,0 +1,17 @@ +{{- if .Values.fleetConfig.addOns }} +{{ $addOns := .Values.fleetConfig.addOns }} +apiVersion: v1 +kind: ConfigMap +metadata: + name: fleet-add-ons + namespace: {{ .Release.Namespace }} +data: + {{- range $addOns }} + {{- if or (hasPrefix "http://" .manifests) (hasPrefix "https://" .manifests) (hasPrefix "oci://" .manifests) }} + {{ .name }}: {{ .manifests }} + {{- else }} + {{ .name }}: |- + {{- .manifests | nindent 4 }} + {{- end }} + {{- end }} +{{- end }} \ No newline at end of file diff --git a/fleetconfig-controller/charts/fleetconfig-controller/values.yaml b/fleetconfig-controller/charts/fleetconfig-controller/values.yaml index 6ceb8f02..ef984694 100644 --- a/fleetconfig-controller/charts/fleetconfig-controller/values.yaml +++ b/fleetconfig-controller/charts/fleetconfig-controller/values.yaml @@ -224,6 +224,29 @@ fleetConfig: # # Options: [ Default | BestEffort | ResourceRequirement ]. # qosClass: "Default" singleton: false + # Add-on configuration for the spoke cluster. + # ## @param fleetConfig.spokes[0].addOns[0].name Name of the add-on. + # ## @param fleetConfig.spokes[0].addOns[0].installNamespace Namespace to install the add-on. + # ## @param fleetConfig.spokes[0].addOns[0].annotations Annotations to apply to the add-on. + # addOns: + # - name: "" + # installNamespace: "" + # annotations: {} + + # Global add-on configuration for the hub cluster. + # ## @param fleetConfig.addOns[0].name Name of the add-on. + # ## @param fleetConfig.addOns[0].manifests Manifests to install. Can either be inline or a URL. + # ## @param fleetConfig.addOns[0].version Version of the add-on. + # ## @param fleetConfig.addOns[0].clusterRoleBinding Cluster role binding to apply to the add-on. + # ## @param fleetConfig.addOns[0].hubRegistration Enable the agent to register to the hub cluster. + # ## @param fleetConfig.addOns[0].overwrite Whether to overwrite the add-on if it already exists. + # addOns: + # - name: "" + # manifests: "" + # version: "v0.0.1" + # clusterRoleBinding: "" + # hubRegistration: false + # overwrite: false ## @section Topology Resources diff --git a/fleetconfig-controller/config/crd/bases/fleetconfig.open-cluster-management.io_fleetconfigs.yaml b/fleetconfig-controller/config/crd/bases/fleetconfig.open-cluster-management.io_fleetconfigs.yaml index 8f0f64a6..f5adf769 100644 --- a/fleetconfig-controller/config/crd/bases/fleetconfig.open-cluster-management.io_fleetconfigs.yaml +++ b/fleetconfig-controller/config/crd/bases/fleetconfig.open-cluster-management.io_fleetconfigs.yaml @@ -46,6 +46,36 @@ spec: spec: description: FleetConfigSpec defines the desired state of FleetConfig. properties: + addOns: + items: + description: AddOnConfig is the configuration of a custom AddOn + that can be installed on spoke clusters. + properties: + clusterRoleBinding: + description: The rolebinding to the clusterrole in the cluster + namespace for the addon agent + type: string + hubRegistration: + default: false + description: Enable the agent to register to the hub cluster. + Optional, defaults to false. + type: boolean + name: + description: The name of the add-on. + type: string + overwrite: + default: false + description: Whether to overwrite the add-on if it already exists. + Optional, defaults to false. + type: boolean + version: + default: v0.0.1 + description: The add-on version. Optional, defaults to "v0.0.1" + type: string + required: + - name + type: object + type: array hub: description: Hub provides specifications for an OCM hub cluster. properties: @@ -271,6 +301,31 @@ spec: description: Spoke provides specifications for joining and potentially upgrading spokes. properties: + addOns: + description: AddOns are the add-ons to enable for the spoke + cluster. + items: + description: SpokeAddOn is the configuration for enabling + add-on installation on the spoke cluster. + properties: + annotations: + additionalProperties: + type: string + description: Optional annotations to apply to the add-on. + type: object + installNamespace: + description: The spoke cluster namespace to install the + add-on in. If left empty, installs into "open-cluster-managedment-addon" + namespace. + type: string + name: + description: The name of the add-on. Must match one of + the default or manually configured addon names. + type: string + required: + - name + type: object + type: array ca: description: Hub cluster CA certificate, optional type: string From 4bef349268805ed83c542db721951f68d96614d9 Mon Sep 17 00:00:00 2001 From: Artur Shad Nik <37195151+arturshadnik@users.noreply.github.com> Date: Mon, 14 Jul 2025 17:13:30 -0700 Subject: [PATCH 2/4] chore: Update fleetconfig-controller/api/v1alpha1/fleetconfig_types.go Co-authored-by: Ahmad Malik Ibrahim Signed-off-by: Artur Shad Nik chore: Update fleetconfig-controller/api/v1alpha1/fleetconfig_types.go Co-authored-by: Ahmad Malik Ibrahim Signed-off-by: Artur Shad Nik chore: update chart to reflect field rename Signed-off-by: Artur Shad Nik chore: update chart to reflect field rename Signed-off-by: Artur Shad Nik --- .../api/v1alpha1/fleetconfig_types.go | 4 ++-- .../api/v1alpha1/zz_generated.deepcopy.go | 4 ++-- .../charts/fleetconfig-controller/README.md | 10 +++++----- ...leetconfig.open-cluster-management.io-crds.yaml | 4 ++-- .../templates/fleetconfig.yaml | 2 +- .../charts/fleetconfig-controller/values.yaml | 14 +++++++------- ...ig.open-cluster-management.io_fleetconfigs.yaml | 4 ++-- 7 files changed, 21 insertions(+), 21 deletions(-) diff --git a/fleetconfig-controller/api/v1alpha1/fleetconfig_types.go b/fleetconfig-controller/api/v1alpha1/fleetconfig_types.go index cad515ba..55948eaf 100644 --- a/fleetconfig-controller/api/v1alpha1/fleetconfig_types.go +++ b/fleetconfig-controller/api/v1alpha1/fleetconfig_types.go @@ -29,7 +29,7 @@ type FleetConfigSpec struct { Hub Hub `json:"hub"` Spokes []Spoke `json:"spokes"` RegistrationAuth *RegistrationAuth `json:"registrationAuth,omitempty"` - AddOns []*AddOnConfig `json:"addOns,omitempty"` + AddOnConfigs []*AddOnConfig `json:"addOnConfigs,omitempty"` } // FleetConfigStatus defines the observed state of FleetConfig. @@ -317,7 +317,7 @@ type SpokeAddOn struct { // The name of the add-on. Must match one of the default or manually configured addon names. Name string `json:"name"` - // The spoke cluster namespace to install the add-on in. If left empty, installs into "open-cluster-managedment-addon" namespace. + // The spoke cluster namespace to install the add-on in. If left empty, installs into the "open-cluster-management-addon" namespace. InstallNamespace string `json:"installNamespace,omitempty"` // Optional annotations to apply to the add-on. diff --git a/fleetconfig-controller/api/v1alpha1/zz_generated.deepcopy.go b/fleetconfig-controller/api/v1alpha1/zz_generated.deepcopy.go index 857ff12f..976ca2f2 100644 --- a/fleetconfig-controller/api/v1alpha1/zz_generated.deepcopy.go +++ b/fleetconfig-controller/api/v1alpha1/zz_generated.deepcopy.go @@ -185,8 +185,8 @@ func (in *FleetConfigSpec) DeepCopyInto(out *FleetConfigSpec) { *out = new(RegistrationAuth) (*in).DeepCopyInto(*out) } - if in.AddOns != nil { - in, out := &in.AddOns, &out.AddOns + if in.AddOnConfigs != nil { + in, out := &in.AddOnConfigs, &out.AddOnConfigs *out = make([]*AddOnConfig, len(*in)) for i := range *in { if (*in)[i] != nil { diff --git a/fleetconfig-controller/charts/fleetconfig-controller/README.md b/fleetconfig-controller/charts/fleetconfig-controller/README.md index 880edfe2..960c68f7 100644 --- a/fleetconfig-controller/charts/fleetconfig-controller/README.md +++ b/fleetconfig-controller/charts/fleetconfig-controller/README.md @@ -57,11 +57,11 @@ If provided, deploy a singleton control plane instead of Cluster Manager. To enable singleton mode, `fleetConfig.hub.singletonControlPlane` must be uncommented and configured with the following options: - **name**: The name of the singleton control plane (default: "singleton-controlplane") - **helm**: Helm configuration for the multicluster-controlplane Helm chart -- **values**: Raw, YAML-formatted Helm values -- **set**: List of comma-separated Helm values (e.g., key1=val1,key2=val2) -- **setJson**: List of comma-separated Helm JSON values -- **setLiteral**: List of comma-separated Helm literal STRING values -- **setString**: List of comma-separated Helm STRING values + - **values**: Raw, YAML-formatted Helm values + - **set**: List of comma-separated Helm values (e.g., key1=val1,key2=val2) + - **setJson**: List of comma-separated Helm JSON values + - **setLiteral**: List of comma-separated Helm literal STRING values + - **setString**: List of comma-separated Helm STRING values Refer to the [Multicluster Controlplane configuration](https://github.com/open-cluster-management-io/multicluster-controlplane/blob/main/charts/multicluster-controlplane/values.yaml) for more details. diff --git a/fleetconfig-controller/charts/fleetconfig-controller/crds/fleetconfig.open-cluster-management.io-crds.yaml b/fleetconfig-controller/charts/fleetconfig-controller/crds/fleetconfig.open-cluster-management.io-crds.yaml index 91bf8c5e..0c19fc1e 100644 --- a/fleetconfig-controller/charts/fleetconfig-controller/crds/fleetconfig.open-cluster-management.io-crds.yaml +++ b/fleetconfig-controller/charts/fleetconfig-controller/crds/fleetconfig.open-cluster-management.io-crds.yaml @@ -56,7 +56,7 @@ spec: spec: description: FleetConfigSpec defines the desired state of FleetConfig. properties: - addOns: + addOnConfigs: items: description: AddOnConfig is the configuration of a custom AddOn that can be installed on spoke clusters. @@ -325,7 +325,7 @@ spec: type: object installNamespace: description: The spoke cluster namespace to install the - add-on in. If left empty, installs into "open-cluster-managedment-addon" + add-on in. If left empty, installs into the "open-cluster-management-addon" namespace. type: string name: diff --git a/fleetconfig-controller/charts/fleetconfig-controller/templates/fleetconfig.yaml b/fleetconfig-controller/charts/fleetconfig-controller/templates/fleetconfig.yaml index 7ac2d4c2..20672067 100644 --- a/fleetconfig-controller/charts/fleetconfig-controller/templates/fleetconfig.yaml +++ b/fleetconfig-controller/charts/fleetconfig-controller/templates/fleetconfig.yaml @@ -62,5 +62,5 @@ spec: registry: {{ $.Values.fleetConfig.source.registry }} addOns: {{- toYaml .addOns | nindent 8 }} {{- end }} - addOns: {{- toYaml .Values.fleetConfig.addOns | nindent 4 }} + addOnConfigs: {{- toYaml .Values.fleetConfig.addOnConfigs | nindent 4 }} {{- end }} diff --git a/fleetconfig-controller/charts/fleetconfig-controller/values.yaml b/fleetconfig-controller/charts/fleetconfig-controller/values.yaml index ef984694..338fcf8f 100644 --- a/fleetconfig-controller/charts/fleetconfig-controller/values.yaml +++ b/fleetconfig-controller/charts/fleetconfig-controller/values.yaml @@ -234,13 +234,13 @@ fleetConfig: # annotations: {} # Global add-on configuration for the hub cluster. - # ## @param fleetConfig.addOns[0].name Name of the add-on. - # ## @param fleetConfig.addOns[0].manifests Manifests to install. Can either be inline or a URL. - # ## @param fleetConfig.addOns[0].version Version of the add-on. - # ## @param fleetConfig.addOns[0].clusterRoleBinding Cluster role binding to apply to the add-on. - # ## @param fleetConfig.addOns[0].hubRegistration Enable the agent to register to the hub cluster. - # ## @param fleetConfig.addOns[0].overwrite Whether to overwrite the add-on if it already exists. - # addOns: + # ## @param fleetConfig.addOnConfigs[0].name Name of the add-on. + # ## @param fleetConfig.addOnConfigs[0].manifests Manifests to install. Can either be inline or a URL. + # ## @param fleetConfig.addOnConfigs[0].version Version of the add-on. + # ## @param fleetConfig.addOnConfigs[0].clusterRoleBinding Cluster role binding to apply to the add-on. + # ## @param fleetConfig.addOnConfigs[0].hubRegistration Enable the agent to register to the hub cluster. + # ## @param fleetConfig.addOnConfigs[0].overwrite Whether to overwrite the add-on if it already exists. + # addOnConfigs: # - name: "" # manifests: "" # version: "v0.0.1" diff --git a/fleetconfig-controller/config/crd/bases/fleetconfig.open-cluster-management.io_fleetconfigs.yaml b/fleetconfig-controller/config/crd/bases/fleetconfig.open-cluster-management.io_fleetconfigs.yaml index f5adf769..f5ec20aa 100644 --- a/fleetconfig-controller/config/crd/bases/fleetconfig.open-cluster-management.io_fleetconfigs.yaml +++ b/fleetconfig-controller/config/crd/bases/fleetconfig.open-cluster-management.io_fleetconfigs.yaml @@ -46,7 +46,7 @@ spec: spec: description: FleetConfigSpec defines the desired state of FleetConfig. properties: - addOns: + addOnConfigs: items: description: AddOnConfig is the configuration of a custom AddOn that can be installed on spoke clusters. @@ -315,7 +315,7 @@ spec: type: object installNamespace: description: The spoke cluster namespace to install the - add-on in. If left empty, installs into "open-cluster-managedment-addon" + add-on in. If left empty, installs into the "open-cluster-management-addon" namespace. type: string name: From ffe5b9f12513fc4ed2a0448bec204bc0d7d7f82b Mon Sep 17 00:00:00 2001 From: Artur Shad Nik <37195151+arturshadnik@users.noreply.github.com> Date: Mon, 14 Jul 2025 17:19:55 -0700 Subject: [PATCH 3/4] chore: Update fleetconfig-controller/api/v1alpha1/fleetconfig_types.go Co-authored-by: Ahmad Malik Ibrahim Signed-off-by: Artur Shad Nik chore: regenerate Signed-off-by: Artur Shad Nik --- .../api/v1alpha1/fleetconfig_types.go | 10 ++-- .../api/v1alpha1/zz_generated.deepcopy.go | 46 +++++++++---------- ...onfig.open-cluster-management.io-crds.yaml | 14 +++--- ...en-cluster-management.io_fleetconfigs.yaml | 14 +++--- 4 files changed, 42 insertions(+), 42 deletions(-) diff --git a/fleetconfig-controller/api/v1alpha1/fleetconfig_types.go b/fleetconfig-controller/api/v1alpha1/fleetconfig_types.go index 55948eaf..b2b8c499 100644 --- a/fleetconfig-controller/api/v1alpha1/fleetconfig_types.go +++ b/fleetconfig-controller/api/v1alpha1/fleetconfig_types.go @@ -309,13 +309,13 @@ type Spoke struct { ClusterARN string `json:"clusterARN,omitempty"` // AddOns are the add-ons to enable for the spoke cluster. - AddOns []SpokeAddOn `json:"addOns,omitempty"` + AddOns []AddOn `json:"addOns,omitempty"` } -// SpokeAddOn is the configuration for enabling add-on installation on the spoke cluster. -type SpokeAddOn struct { - // The name of the add-on. Must match one of the default or manually configured addon names. - Name string `json:"name"` +// AddOn enables add-on installation on the cluster. +type AddOn struct { + // The name of the add-on being enabled. Must match one of the default or manually configured add-on names. + ConfigName string `json:"configName"` // The spoke cluster namespace to install the add-on in. If left empty, installs into the "open-cluster-management-addon" namespace. InstallNamespace string `json:"installNamespace,omitempty"` diff --git a/fleetconfig-controller/api/v1alpha1/zz_generated.deepcopy.go b/fleetconfig-controller/api/v1alpha1/zz_generated.deepcopy.go index 976ca2f2..8cb8345d 100644 --- a/fleetconfig-controller/api/v1alpha1/zz_generated.deepcopy.go +++ b/fleetconfig-controller/api/v1alpha1/zz_generated.deepcopy.go @@ -24,6 +24,28 @@ import ( "k8s.io/apimachinery/pkg/runtime" ) +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AddOn) DeepCopyInto(out *AddOn) { + *out = *in + if in.Annotations != nil { + in, out := &in.Annotations, &out.Annotations + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AddOn. +func (in *AddOn) DeepCopy() *AddOn { + if in == nil { + return nil + } + out := new(AddOn) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *AddOnConfig) DeepCopyInto(out *AddOnConfig) { *out = *in @@ -491,7 +513,7 @@ func (in *Spoke) DeepCopyInto(out *Spoke) { in.Klusterlet.DeepCopyInto(&out.Klusterlet) if in.AddOns != nil { in, out := &in.AddOns, &out.AddOns - *out = make([]SpokeAddOn, len(*in)) + *out = make([]AddOn, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } @@ -507,25 +529,3 @@ func (in *Spoke) DeepCopy() *Spoke { in.DeepCopyInto(out) return out } - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SpokeAddOn) DeepCopyInto(out *SpokeAddOn) { - *out = *in - if in.Annotations != nil { - in, out := &in.Annotations, &out.Annotations - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SpokeAddOn. -func (in *SpokeAddOn) DeepCopy() *SpokeAddOn { - if in == nil { - return nil - } - out := new(SpokeAddOn) - in.DeepCopyInto(out) - return out -} diff --git a/fleetconfig-controller/charts/fleetconfig-controller/crds/fleetconfig.open-cluster-management.io-crds.yaml b/fleetconfig-controller/charts/fleetconfig-controller/crds/fleetconfig.open-cluster-management.io-crds.yaml index 0c19fc1e..9f8fd7e9 100644 --- a/fleetconfig-controller/charts/fleetconfig-controller/crds/fleetconfig.open-cluster-management.io-crds.yaml +++ b/fleetconfig-controller/charts/fleetconfig-controller/crds/fleetconfig.open-cluster-management.io-crds.yaml @@ -315,25 +315,25 @@ spec: description: AddOns are the add-ons to enable for the spoke cluster. items: - description: SpokeAddOn is the configuration for enabling - add-on installation on the spoke cluster. + description: AddOn enables add-on installation on the cluster. properties: annotations: additionalProperties: type: string description: Optional annotations to apply to the add-on. type: object + configName: + description: The name of the add-on being enabled. Must + match one of the default or manually configured add-on + names. + type: string installNamespace: description: The spoke cluster namespace to install the add-on in. If left empty, installs into the "open-cluster-management-addon" namespace. type: string - name: - description: The name of the add-on. Must match one of - the default or manually configured addon names. - type: string required: - - name + - configName type: object type: array ca: diff --git a/fleetconfig-controller/config/crd/bases/fleetconfig.open-cluster-management.io_fleetconfigs.yaml b/fleetconfig-controller/config/crd/bases/fleetconfig.open-cluster-management.io_fleetconfigs.yaml index f5ec20aa..8d394d35 100644 --- a/fleetconfig-controller/config/crd/bases/fleetconfig.open-cluster-management.io_fleetconfigs.yaml +++ b/fleetconfig-controller/config/crd/bases/fleetconfig.open-cluster-management.io_fleetconfigs.yaml @@ -305,25 +305,25 @@ spec: description: AddOns are the add-ons to enable for the spoke cluster. items: - description: SpokeAddOn is the configuration for enabling - add-on installation on the spoke cluster. + description: AddOn enables add-on installation on the cluster. properties: annotations: additionalProperties: type: string description: Optional annotations to apply to the add-on. type: object + configName: + description: The name of the add-on being enabled. Must + match one of the default or manually configured add-on + names. + type: string installNamespace: description: The spoke cluster namespace to install the add-on in. If left empty, installs into the "open-cluster-management-addon" namespace. type: string - name: - description: The name of the add-on. Must match one of - the default or manually configured addon names. - type: string required: - - name + - configName type: object type: array ca: From 57b976c4a21c4ea316ae796471bf65b2802feefa Mon Sep 17 00:00:00 2001 From: Artur Shad Nik <37195151+arturshadnik@users.noreply.github.com> Date: Mon, 14 Jul 2025 18:41:06 -0700 Subject: [PATCH 4/4] chore: Apply suggestions from code review Co-authored-by: Ahmad Malik Ibrahim Signed-off-by: Artur Shad Nik chore: regenerate Signed-off-by: Artur Shad Nik --- fleetconfig-controller/api/v1alpha1/fleetconfig_types.go | 4 ++-- .../crds/fleetconfig.open-cluster-management.io-crds.yaml | 6 +++--- ...fleetconfig.open-cluster-management.io_fleetconfigs.yaml | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/fleetconfig-controller/api/v1alpha1/fleetconfig_types.go b/fleetconfig-controller/api/v1alpha1/fleetconfig_types.go index b2b8c499..8584d005 100644 --- a/fleetconfig-controller/api/v1alpha1/fleetconfig_types.go +++ b/fleetconfig-controller/api/v1alpha1/fleetconfig_types.go @@ -317,7 +317,7 @@ type AddOn struct { // The name of the add-on being enabled. Must match one of the default or manually configured add-on names. ConfigName string `json:"configName"` - // The spoke cluster namespace to install the add-on in. If left empty, installs into the "open-cluster-management-addon" namespace. + // The namespace to install the add-on in. If left empty, installs into the "open-cluster-management-addon" namespace. InstallNamespace string `json:"installNamespace,omitempty"` // Optional annotations to apply to the add-on. @@ -466,7 +466,7 @@ type RegistrationAuth struct { AutoApprovedARNPatterns []string `json:"autoApprovedARNPatterns,omitempty"` } -// AddOnConfig is the configuration of a custom AddOn that can be installed on spoke clusters. +// AddOnConfig is the configuration of a custom AddOn that can be installed on a cluster. type AddOnConfig struct { // The name of the add-on. Name string `json:"name"` diff --git a/fleetconfig-controller/charts/fleetconfig-controller/crds/fleetconfig.open-cluster-management.io-crds.yaml b/fleetconfig-controller/charts/fleetconfig-controller/crds/fleetconfig.open-cluster-management.io-crds.yaml index 9f8fd7e9..30de3a5c 100644 --- a/fleetconfig-controller/charts/fleetconfig-controller/crds/fleetconfig.open-cluster-management.io-crds.yaml +++ b/fleetconfig-controller/charts/fleetconfig-controller/crds/fleetconfig.open-cluster-management.io-crds.yaml @@ -59,7 +59,7 @@ spec: addOnConfigs: items: description: AddOnConfig is the configuration of a custom AddOn - that can be installed on spoke clusters. + that can be installed on a cluster. properties: clusterRoleBinding: description: The rolebinding to the clusterrole in the cluster @@ -328,8 +328,8 @@ spec: names. type: string installNamespace: - description: The spoke cluster namespace to install the - add-on in. If left empty, installs into the "open-cluster-management-addon" + description: The namespace to install the add-on in. If + left empty, installs into the "open-cluster-management-addon" namespace. type: string required: diff --git a/fleetconfig-controller/config/crd/bases/fleetconfig.open-cluster-management.io_fleetconfigs.yaml b/fleetconfig-controller/config/crd/bases/fleetconfig.open-cluster-management.io_fleetconfigs.yaml index 8d394d35..c3292688 100644 --- a/fleetconfig-controller/config/crd/bases/fleetconfig.open-cluster-management.io_fleetconfigs.yaml +++ b/fleetconfig-controller/config/crd/bases/fleetconfig.open-cluster-management.io_fleetconfigs.yaml @@ -49,7 +49,7 @@ spec: addOnConfigs: items: description: AddOnConfig is the configuration of a custom AddOn - that can be installed on spoke clusters. + that can be installed on a cluster. properties: clusterRoleBinding: description: The rolebinding to the clusterrole in the cluster @@ -318,8 +318,8 @@ spec: names. type: string installNamespace: - description: The spoke cluster namespace to install the - add-on in. If left empty, installs into the "open-cluster-management-addon" + description: The namespace to install the add-on in. If + left empty, installs into the "open-cluster-management-addon" namespace. type: string required: