Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
Signed-off-by: Joe Nathan Abellard <[email protected]>
  • Loading branch information
jabellard committed Jul 17, 2024
1 parent 249b4a4 commit 2a1ab1b
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1733,7 +1733,7 @@ spec:
crdDownloadPolicy:
default: IfNotPresent
description: |-
Policy that should be used by the Karmada operator to retrieve the Karmada CRDs when provisioning this Karmada instance.
CRDDownloadPolicy specifies a policy that should be used by the Karmada operator to retrieve the Karmada CRDs when provisioning this Karmada instance.
Valid values are "Always" and "IfNotPresent".
Defaults to "IfNotPresent".
enum:
Expand All @@ -1742,7 +1742,7 @@ spec:
type: string
crdRemoteURL:
description: |-
Custom URL that should be used to download required CRDs for this Karmada instance.
CRDRemoteURL specifies the URL that should be used to download required CRDs for this Karmada instance.
Omit if the intent is to provision a new Karmada instance with control plane components of the same version as the operator's release version.
In that scenario, the CRDs tarball will be downloaded from a release artifact on GitHub that's of the same version as the operator's release version.
When that is not the intent, this field should be explicitly set to ensure the right version of the CRDs is installed for this Karmada instance.
Expand Down
4 changes: 2 additions & 2 deletions operator/config/crds/operator.karmada.io_karmadas.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1733,7 +1733,7 @@ spec:
crdDownloadPolicy:
default: IfNotPresent
description: |-
Policy that should be used by the Karmada operator to retrieve the Karmada CRDs when provisioning this Karmada instance.
CRDDownloadPolicy specifies a policy that should be used by the Karmada operator to retrieve the Karmada CRDs when provisioning this Karmada instance.
Valid values are "Always" and "IfNotPresent".
Defaults to "IfNotPresent".
enum:
Expand All @@ -1742,7 +1742,7 @@ spec:
type: string
crdRemoteURL:
description: |-
Custom URL that should be used to download required CRDs for this Karmada instance.
CRDRemoteURL specifies the URL that should be used to download required CRDs for this Karmada instance.
Omit if the intent is to provision a new Karmada instance with control plane components of the same version as the operator's release version.
In that scenario, the CRDs tarball will be downloaded from a release artifact on GitHub that's of the same version as the operator's release version.
When that is not the intent, this field should be explicitly set to ensure the right version of the CRDs is installed for this Karmada instance.
Expand Down
8 changes: 4 additions & 4 deletions operator/pkg/apis/operator/v1alpha1/type.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,20 +83,20 @@ type KarmadaSpec struct {
// +optional
FeatureGates map[string]bool `json:"featureGates,omitempty"`

// Custom URL that should be used to download required CRDs for this Karmada instance.
// CRDRemoteURL specifies the URL that should be used to download required CRDs for this Karmada instance.
// Omit if the intent is to provision a new Karmada instance with control plane components of the same version as the operator's release version.
// In that scenario, the CRDs tarball will be downloaded from a release artifact on GitHub that's of the same version as the operator's release version.
// When that is not the intent, this field should be explicitly set to ensure the right version of the CRDs is installed for this Karmada instance.
// +optional
CRDRemoteURL string `json:"crdRemoteURL,omitempty"`
CRDRemoteURL *string `json:"crdRemoteURL,omitempty"`

// Policy that should be used by the Karmada operator to retrieve the Karmada CRDs when provisioning this Karmada instance.
// CRDDownloadPolicy specifies a policy that should be used by the Karmada operator to retrieve the Karmada CRDs when provisioning this Karmada instance.
// Valid values are "Always" and "IfNotPresent".
// Defaults to "IfNotPresent".
// +kubebuilder:validation:Enum=Always;IfNotPresent
// +kubebuilder:default=IfNotPresent
// +optional
CRDDownloadPolicy CRDDownloadPolicy `json:"crdDownloadPolicy,omitempty"`
CRDDownloadPolicy *CRDDownloadPolicy `json:"crdDownloadPolicy,omitempty"`
}

// ImageRegistry represents an image registry as well as the
Expand Down
10 changes: 10 additions & 0 deletions operator/pkg/apis/operator/v1alpha1/zz_generated.deepcopy.go

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

8 changes: 5 additions & 3 deletions operator/pkg/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,10 +290,12 @@ func NewInitOptWithKarmada(karmada *operatorv1alpha1.Karmada) InitOpt {
o.Karmada = karmada
o.Name = karmada.GetName()
o.Namespace = karmada.GetNamespace()
if len(karmada.Spec.CRDRemoteURL) > 0 {
o.CRDRemoteURL = karmada.Spec.CRDRemoteURL
if karmada.Spec.CRDRemoteURL != nil && len(*karmada.Spec.CRDRemoteURL) > 0 {
o.CRDRemoteURL = *karmada.Spec.CRDRemoteURL
}
if karmada.Spec.CRDDownloadPolicy != nil {
o.CRDDownloadPolicy = *karmada.Spec.CRDDownloadPolicy
}
o.CRDDownloadPolicy = karmada.Spec.CRDDownloadPolicy
}
}

Expand Down

0 comments on commit 2a1ab1b

Please sign in to comment.