Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ $(call add-crd-gen,workv1,./work/v1,./work/v1,./work/v1)
$(call add-crd-gen,workv1alpha1,./work/v1alpha1,./work/v1alpha1,./work/v1alpha1)
$(call add-crd-gen,operator,./operator/v1,./operator/v1,./operator/v1)
$(call add-crd-gen,addonv1alpha1,./addon/v1alpha1,./addon/v1alpha1,./addon/v1alpha1)
$(call add-crd-gen,addonv1beta1,./addon/v1alpha1 ./addon/v1beta1,./addon/v1beta1,./addon/v1beta1)

RUNTIME ?= podman
RUNTIME_IMAGE_NAME ?= openshift-api-generator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,7 @@ spec:
type: object
supportedConfigs:
description: |-
Deprecated: Will be removed and replaced with DefaultConfigs in v1beta1.
supportedConfigs is a list of configuration types supported by add-on.
An empty list means the add-on does not require configurations.
The default is an empty list
Expand Down Expand Up @@ -422,7 +423,7 @@ spec:
add-on.
properties:
defaultconfigReferences:
description: defaultconfigReferences is a list of current add-on default
description: DefaultconfigReferences is a list of current add-on default
configuration references.
items:
description: |-
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,8 @@ spec:
- name
type: object
lastObservedGeneration:
description: |-
Deprecated: Use LastAppliedConfig instead
lastObservedGeneration is the observed generation of the add-on configuration.
description: lastObservedGeneration is the observed generation
of the add-on configuration.
format: int64
type: integer
name:
Expand Down Expand Up @@ -302,14 +301,16 @@ spec:
create a csr for the addon agent with the registrationConfig.
properties:
signerName:
description: signerName is the name of signer that addon agent
will use to create csr.
description: |-
Deprecated: Will be replaced with type: kubeClient and type: csr in v1beta1.
signerName is the name of signer that addon agent will use to create csr.
maxLength: 571
minLength: 5
pattern: ^([a-z0-9][a-z0-9-]*[a-z0-9]\.)+[a-z]+\/[a-z0-9-\.]+$
type: string
subject:
description: |-
Deprecated: Will be replaced with type: kubeClient and type: csr in v1beta1.
subject is the user subject of the addon agent to be registered to the hub.
If it is not set, the addon agent will have the default subject
"subject": {
Expand Down
13 changes: 7 additions & 6 deletions addon/v1alpha1/types_clustermanagementaddon.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ type ClusterManagementAddOnSpec struct {
// +optional
AddOnConfiguration ConfigCoordinates `json:"addOnConfiguration,omitempty"`

// Deprecated: Will be removed and replaced with DefaultConfigs in v1beta1.
// supportedConfigs is a list of configuration types supported by add-on.
// An empty list means the add-on does not require configurations.
// The default is an empty list
Expand Down Expand Up @@ -110,7 +111,7 @@ type ConfigGroupResource struct {
// resource of the add-on configuration.
// +required
// +kubebuilder:validation:Required
// +kubebuilder:validation:MinLength:=1
// +kubebuilder:validation:MinLength=1
Resource string `json:"resource"`
}

Expand All @@ -124,7 +125,7 @@ type ConfigReferent struct {
// name of the add-on configuration.
// +required
// +kubebuilder:validation:Required
// +kubebuilder:validation:MinLength:=1
// +kubebuilder:validation:MinLength=1
Name string `json:"name"`
}

Expand Down Expand Up @@ -170,12 +171,12 @@ type PlacementRef struct {
// Namespace is the namespace of the placement
// +required
// +kubebuilder:validation:Required
// +kubebuilder:validation:MinLength:=1
// +kubebuilder:validation:MinLength=1
Namespace string `json:"namespace"`
// Name is the name of the placement
// +required
// +kubebuilder:validation:Required
// +kubebuilder:validation:MinLength:=1
// +kubebuilder:validation:MinLength=1
Name string `json:"name"`
}

Expand All @@ -194,7 +195,7 @@ type PlacementStrategy struct {

// ClusterManagementAddOnStatus represents the current status of cluster management add-on.
type ClusterManagementAddOnStatus struct {
// defaultconfigReferences is a list of current add-on default configuration references.
// DefaultconfigReferences is a list of current add-on default configuration references.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fix typo in comment: lowercase 'c' should be capitalized.

The comment has "DefaultconfigReferences" but should be "DefaultConfigReferences" to match Go naming conventions (PascalCase).

Apply this diff to fix the typo:

-	// DefaultconfigReferences is a list of current add-on default configuration references.
+	// DefaultConfigReferences is a list of current add-on default configuration references.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// DefaultconfigReferences is a list of current add-on default configuration references.
// DefaultConfigReferences is a list of current add-on default configuration references.
🤖 Prompt for AI Agents
In addon/v1alpha1/types_clustermanagementaddon.go around line 198, the comment
for the field uses "DefaultconfigReferences" with a lowercase "c"; update the
comment to "DefaultConfigReferences" (PascalCase) so it matches the exported
identifier naming and Go conventions by capitalizing the 'C' in "Config".

// +optional
DefaultConfigReferences []DefaultConfigReference `json:"defaultconfigReferences,omitempty"`
// installProgression is a list of current add-on configuration references per placement.
Expand Down Expand Up @@ -267,7 +268,7 @@ const (
AddonLifecycleAnnotationKey = "addon.open-cluster-management.io/lifecycle"
// AddonLifecycleAddonManagerAnnotationValue is the value of annotation AddonLifecycleAnnotationKey indicating
// that the addon installation and upgrade is handled by the general addon manager. This should be set only
// when featugate AddonManager on hub is enabled
// when featuregate AddonManager on hub is enabled
AddonLifecycleAddonManagerAnnotationValue = "addon-manager"
// AddonLifecycleSelfManageAnnotationValue is the value of annotation AddonLifecycleAnnotationKey indicating
// that the addon installation and upgrade is handled the addon itself. The general addon manager will ignore
Expand Down
3 changes: 2 additions & 1 deletion addon/v1alpha1/types_managedclusteraddon.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,15 @@ type ManagedClusterAddOnSpec struct {
// RegistrationConfig defines the configuration of the addon agent to register to hub. The Klusterlet agent will
// create a csr for the addon agent with the registrationConfig.
type RegistrationConfig struct {
// Deprecated: Will be replaced with type: kubeClient and type: csr in v1beta1.
// signerName is the name of signer that addon agent will use to create csr.
// +required
// +kubebuilder:validation:MaxLength=571
// +kubebuilder:validation:MinLength=5
// +kubebuilder:validation:Pattern=^([a-z0-9][a-z0-9-]*[a-z0-9]\.)+[a-z]+\/[a-z0-9-\.]+$
SignerName string `json:"signerName"`

// Deprecated: Will be replaced with type: kubeClient and type: csr in v1beta1.
// subject is the user subject of the addon agent to be registered to the hub.
// If it is not set, the addon agent will have the default subject
// "subject": {
Expand Down Expand Up @@ -191,7 +193,6 @@ type ConfigReference struct {
// defaultConfigs.
ConfigReferent `json:",inline"`

// Deprecated: Use LastAppliedConfig instead
// lastObservedGeneration is the observed generation of the add-on configuration.
LastObservedGeneration int64 `json:"lastObservedGeneration"`

Expand Down
Loading