Skip to content

Commit

Permalink
Remove CRDPattern field
Browse files Browse the repository at this point in the history
  • Loading branch information
willie-yao committed Jun 10, 2024
1 parent 728860c commit e05bcc0
Show file tree
Hide file tree
Showing 13 changed files with 27 additions and 119 deletions.
16 changes: 0 additions & 16 deletions api/v1alpha1/provider_conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,6 @@ func (src *BootstrapProvider) ConvertTo(dstRaw conversion.Hub) error {
dst.Spec.ManifestPatches = restored.Spec.ManifestPatches
dst.Spec.AdditionalDeployments = restored.Spec.AdditionalDeployments

if restored.Spec.Manager != nil {
dst.Spec.Manager.CRDPattern = restored.Spec.Manager.CRDPattern
}

return nil
}

Expand Down Expand Up @@ -114,10 +110,6 @@ func (src *ControlPlaneProvider) ConvertTo(dstRaw conversion.Hub) error {
dst.Spec.ManifestPatches = restored.Spec.ManifestPatches
dst.Spec.AdditionalDeployments = restored.Spec.AdditionalDeployments

if restored.Spec.Manager != nil {
dst.Spec.Manager.CRDPattern = restored.Spec.Manager.CRDPattern
}

return nil
}

Expand Down Expand Up @@ -180,10 +172,6 @@ func (src *CoreProvider) ConvertTo(dstRaw conversion.Hub) error {
dst.Spec.ManifestPatches = restored.Spec.ManifestPatches
dst.Spec.AdditionalDeployments = restored.Spec.AdditionalDeployments

if restored.Spec.Manager != nil {
dst.Spec.Manager.CRDPattern = restored.Spec.Manager.CRDPattern
}

return nil
}

Expand Down Expand Up @@ -246,10 +234,6 @@ func (src *InfrastructureProvider) ConvertTo(dstRaw conversion.Hub) error {
dst.Spec.ManifestPatches = restored.Spec.ManifestPatches
dst.Spec.AdditionalDeployments = restored.Spec.AdditionalDeployments

if restored.Spec.Manager != nil {
dst.Spec.Manager.CRDPattern = restored.Spec.Manager.CRDPattern
}

return nil
}

Expand Down
1 change: 0 additions & 1 deletion api/v1alpha1/zz_generated.conversion.go

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

11 changes: 3 additions & 8 deletions api/v1alpha2/provider_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,12 @@ type ProviderSpec struct {
// should manage. The key is the name of the deployment and the value is the
// DeploymentSpec.
// +optional
AdditionalDeployments map[string]AdditionalProviderCustomization `json:"additionalDeployments,omitempty"`
AdditionalDeployments map[string]AdditionalDeployments `json:"additionalDeployments,omitempty"`
}

// AdditionalProviderCustomization defines the properties that can be enabled on the controller
// AdditionalDeployments defines the properties that can be enabled on the controller
// manager and deployment for the provider if the provider is managing additional deployments.
type AdditionalProviderCustomization struct {
type AdditionalDeployments struct {
// Manager defines the properties that can be enabled on the controller manager for the additional provider deployment.
// +optional
Manager *ManagerSpec `json:"manager,omitempty"`
Expand Down Expand Up @@ -141,11 +141,6 @@ type ManagerSpec struct {
// in as container args to the provider's controller manager.
// Controller Manager flag is --feature-gates.
FeatureGates map[string]bool `json:"featureGates,omitempty"`

// CRDPattern is a regular expression that matches the CRDs that the provider
// is expected to manage.
// +optional
CRDPattern *string `json:"crdPattern,omitempty"`
}

// DeploymentSpec defines the properties that can be enabled on the Deployment for the provider.
Expand Down
15 changes: 5 additions & 10 deletions api/v1alpha2/zz_generated.deepcopy.go

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

12 changes: 1 addition & 11 deletions config/crd/bases/operator.cluster.x-k8s.io_addonproviders.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ spec:
additionalDeployments:
additionalProperties:
description: |-
AdditionalProviderCustomization defines the properties that can be enabled on the controller
AdditionalDeployments defines the properties that can be enabled on the controller
manager and deployment for the provider if the provider is managing additional deployments.
properties:
deployment:
Expand Down Expand Up @@ -1287,11 +1287,6 @@ spec:
be recovered.
type: boolean
type: object
crdPattern:
description: |-
CRDPattern is a regular expression that matches the CRDs that the provider
is expected to manage.
type: string
featureGates:
additionalProperties:
type: boolean
Expand Down Expand Up @@ -2767,11 +2762,6 @@ spec:
description: RecoverPanic indicates if panics should be recovered.
type: boolean
type: object
crdPattern:
description: |-
CRDPattern is a regular expression that matches the CRDs that the provider
is expected to manage.
type: string
featureGates:
additionalProperties:
type: boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1636,7 +1636,7 @@ spec:
additionalDeployments:
additionalProperties:
description: |-
AdditionalProviderCustomization defines the properties that can be enabled on the controller
AdditionalDeployments defines the properties that can be enabled on the controller
manager and deployment for the provider if the provider is managing additional deployments.
properties:
deployment:
Expand Down Expand Up @@ -2872,11 +2872,6 @@ spec:
be recovered.
type: boolean
type: object
crdPattern:
description: |-
CRDPattern is a regular expression that matches the CRDs that the provider
is expected to manage.
type: string
featureGates:
additionalProperties:
type: boolean
Expand Down Expand Up @@ -4352,11 +4347,6 @@ spec:
description: RecoverPanic indicates if panics should be recovered.
type: boolean
type: object
crdPattern:
description: |-
CRDPattern is a regular expression that matches the CRDs that the provider
is expected to manage.
type: string
featureGates:
additionalProperties:
type: boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1638,7 +1638,7 @@ spec:
additionalDeployments:
additionalProperties:
description: |-
AdditionalProviderCustomization defines the properties that can be enabled on the controller
AdditionalDeployments defines the properties that can be enabled on the controller
manager and deployment for the provider if the provider is managing additional deployments.
properties:
deployment:
Expand Down Expand Up @@ -2874,11 +2874,6 @@ spec:
be recovered.
type: boolean
type: object
crdPattern:
description: |-
CRDPattern is a regular expression that matches the CRDs that the provider
is expected to manage.
type: string
featureGates:
additionalProperties:
type: boolean
Expand Down Expand Up @@ -4354,11 +4349,6 @@ spec:
description: RecoverPanic indicates if panics should be recovered.
type: boolean
type: object
crdPattern:
description: |-
CRDPattern is a regular expression that matches the CRDs that the provider
is expected to manage.
type: string
featureGates:
additionalProperties:
type: boolean
Expand Down
12 changes: 1 addition & 11 deletions config/crd/bases/operator.cluster.x-k8s.io_coreproviders.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1636,7 +1636,7 @@ spec:
additionalDeployments:
additionalProperties:
description: |-
AdditionalProviderCustomization defines the properties that can be enabled on the controller
AdditionalDeployments defines the properties that can be enabled on the controller
manager and deployment for the provider if the provider is managing additional deployments.
properties:
deployment:
Expand Down Expand Up @@ -2872,11 +2872,6 @@ spec:
be recovered.
type: boolean
type: object
crdPattern:
description: |-
CRDPattern is a regular expression that matches the CRDs that the provider
is expected to manage.
type: string
featureGates:
additionalProperties:
type: boolean
Expand Down Expand Up @@ -4352,11 +4347,6 @@ spec:
description: RecoverPanic indicates if panics should be recovered.
type: boolean
type: object
crdPattern:
description: |-
CRDPattern is a regular expression that matches the CRDs that the provider
is expected to manage.
type: string
featureGates:
additionalProperties:
type: boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1638,7 +1638,7 @@ spec:
additionalDeployments:
additionalProperties:
description: |-
AdditionalProviderCustomization defines the properties that can be enabled on the controller
AdditionalDeployments defines the properties that can be enabled on the controller
manager and deployment for the provider if the provider is managing additional deployments.
properties:
deployment:
Expand Down Expand Up @@ -2874,11 +2874,6 @@ spec:
be recovered.
type: boolean
type: object
crdPattern:
description: |-
CRDPattern is a regular expression that matches the CRDs that the provider
is expected to manage.
type: string
featureGates:
additionalProperties:
type: boolean
Expand Down Expand Up @@ -4354,11 +4349,6 @@ spec:
description: RecoverPanic indicates if panics should be recovered.
type: boolean
type: object
crdPattern:
description: |-
CRDPattern is a regular expression that matches the CRDs that the provider
is expected to manage.
type: string
featureGates:
additionalProperties:
type: boolean
Expand Down
12 changes: 1 addition & 11 deletions config/crd/bases/operator.cluster.x-k8s.io_ipamproviders.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ spec:
additionalDeployments:
additionalProperties:
description: |-
AdditionalProviderCustomization defines the properties that can be enabled on the controller
AdditionalDeployments defines the properties that can be enabled on the controller
manager and deployment for the provider if the provider is managing additional deployments.
properties:
deployment:
Expand Down Expand Up @@ -1287,11 +1287,6 @@ spec:
be recovered.
type: boolean
type: object
crdPattern:
description: |-
CRDPattern is a regular expression that matches the CRDs that the provider
is expected to manage.
type: string
featureGates:
additionalProperties:
type: boolean
Expand Down Expand Up @@ -2767,11 +2762,6 @@ spec:
description: RecoverPanic indicates if panics should be recovered.
type: boolean
type: object
crdPattern:
description: |-
CRDPattern is a regular expression that matches the CRDs that the provider
is expected to manage.
type: string
featureGates:
additionalProperties:
type: boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ spec:
additionalDeployments:
additionalProperties:
description: |-
AdditionalProviderCustomization defines the properties that can be enabled on the controller
AdditionalDeployments defines the properties that can be enabled on the controller
manager and deployment for the provider if the provider is managing additional deployments.
properties:
deployment:
Expand Down Expand Up @@ -1289,11 +1289,6 @@ spec:
be recovered.
type: boolean
type: object
crdPattern:
description: |-
CRDPattern is a regular expression that matches the CRDs that the provider
is expected to manage.
type: string
featureGates:
additionalProperties:
type: boolean
Expand Down Expand Up @@ -2769,11 +2764,6 @@ spec:
description: RecoverPanic indicates if panics should be recovered.
type: boolean
type: object
crdPattern:
description: |-
CRDPattern is a regular expression that matches the CRDs that the provider
is expected to manage.
type: string
featureGates:
additionalProperties:
type: boolean
Expand Down
4 changes: 0 additions & 4 deletions internal/controller/component_customizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,10 +255,6 @@ func customizeManagerContainer(mSpec *operatorv1.ManagerSpec, c *corev1.Containe
c.Args = setArgs(c.Args, "--v", fmt.Sprint(mSpec.Verbosity))
}

if mSpec.CRDPattern != nil {
c.Args = setArgs(c.Args, "--crd-pattern", *mSpec.CRDPattern)
}

if len(mSpec.FeatureGates) > 0 {
fgValue := []string{}

Expand Down
15 changes: 12 additions & 3 deletions internal/controller/component_customizer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -643,11 +643,20 @@ func TestCustomizeMultipleDeployment(t *testing.T) {
Deployment: &operatorv1.DeploymentSpec{
Replicas: ptr.To(10),
},
AdditionalDeployments: map[string]operatorv1.AdditionalProviderCustomization{
AdditionalDeployments: map[string]operatorv1.AdditionalDeployments{
"azureserviceoperator-controller-manager": {
Deployment: &operatorv1.DeploymentSpec{
Containers: []operatorv1.ContainerSpec{
{
Name: "manager",
Args: map[string]string{
"--crd-pattern": ".*",
},
},
},
},
Manager: &operatorv1.ManagerSpec{
Verbosity: 1,
CRDPattern: ptr.To(".*"),
Verbosity: 1,
},
},
},
Expand Down

0 comments on commit e05bcc0

Please sign in to comment.