Skip to content

Commit

Permalink
Add agent install namespace for addon deployment config (#268)
Browse files Browse the repository at this point in the history
Signed-off-by: zhujian <jiazhu@redhat.com>
  • Loading branch information
zhujian7 authored Aug 29, 2023
1 parent b39eb90 commit 61b287f
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ spec:
spec:
description: spec represents a desired configuration for an add-on.
properties:
agentInstallNamespace:
default: open-cluster-management-agent-addon
description: AgentInstallNamespace is the namespace where the add-on
agent should be installed on the managed cluster.
maxLength: 63
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
type: string
customizedVariables:
description: CustomizedVariables is a list of name-value variables
for the current add-on deployment. The add-on implementation can
Expand Down
7 changes: 7 additions & 0 deletions addon/v1alpha1/types_addondeploymentconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ type AddOnDeploymentConfigSpec struct {
// Empty means no proxy settings is available.
// +optional
ProxyConfig ProxyConfig `json:"proxyConfig,omitempty"`

// AgentInstallNamespace is the namespace where the add-on agent should be installed on the managed cluster.
// +optional
// +kubebuilder:default=open-cluster-management-agent-addon
// +kubebuilder:validation:MaxLength=63
// +kubebuilder:validation:Pattern=^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
AgentInstallNamespace string `json:"agentInstallNamespace,omitempty"`
}

// CustomizedVariable represents a customized variable for add-on deployment.
Expand Down
9 changes: 5 additions & 4 deletions addon/v1alpha1/zz_generated.swagger_doc_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion hack/update-v1beta1-crds.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,9 @@ fi

$CONTROLLER_GEN schemapatch:manifests="./crdsv1beta1" paths="./operator/v1" 'output:dir="./crdsv1beta1"'
$CONTROLLER_GEN schemapatch:manifests="./crdsv1beta1" paths="./work/v1" 'output:dir="./crdsv1beta1"'
$CONTROLLER_GEN schemapatch:manifests="./crdsv1beta1" paths="./cluster/v1alpha1" 'output:dir="./crdsv1beta1"'
# There is a generic struct related issue:
# "open-cluster-management.io/api/cluster/v1alpha1/helpers.go:238:120: missing ',' in parameter list"
# Because the ClusterClaim CRD is stable now, we can comment out the following line.
# Uncomment to generate ClusterClaim CRD when cluster/v1alpha1/types.go is changed
# $CONTROLLER_GEN schemapatch:manifests="./crdsv1beta1" paths="./cluster/v1alpha1" 'output:dir="./crdsv1beta1"'

0 comments on commit 61b287f

Please sign in to comment.