Skip to content

Commit 450c0c0

Browse files
committed
Add support for customizing additional provider deployments
1 parent ea4f195 commit 450c0c0

15 files changed

+24560
-4772
lines changed

api/v1alpha1/provider_conversion.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ func (src *BootstrapProvider) ConvertTo(dstRaw conversion.Hub) error {
4646
}
4747

4848
dst.Spec.ManifestPatches = restored.Spec.ManifestPatches
49+
dst.Spec.AdditionalDeployments = restored.Spec.AdditionalDeployments
50+
51+
if restored.Spec.Manager != nil {
52+
dst.Spec.Manager.CRDPattern = restored.Spec.Manager.CRDPattern
53+
}
4954

5055
return nil
5156
}
@@ -107,6 +112,11 @@ func (src *ControlPlaneProvider) ConvertTo(dstRaw conversion.Hub) error {
107112
}
108113

109114
dst.Spec.ManifestPatches = restored.Spec.ManifestPatches
115+
dst.Spec.AdditionalDeployments = restored.Spec.AdditionalDeployments
116+
117+
if restored.Spec.Manager != nil {
118+
dst.Spec.Manager.CRDPattern = restored.Spec.Manager.CRDPattern
119+
}
110120

111121
return nil
112122
}
@@ -168,6 +178,11 @@ func (src *CoreProvider) ConvertTo(dstRaw conversion.Hub) error {
168178
}
169179

170180
dst.Spec.ManifestPatches = restored.Spec.ManifestPatches
181+
dst.Spec.AdditionalDeployments = restored.Spec.AdditionalDeployments
182+
183+
if restored.Spec.Manager != nil {
184+
dst.Spec.Manager.CRDPattern = restored.Spec.Manager.CRDPattern
185+
}
171186

172187
return nil
173188
}
@@ -229,6 +244,11 @@ func (src *InfrastructureProvider) ConvertTo(dstRaw conversion.Hub) error {
229244
}
230245

231246
dst.Spec.ManifestPatches = restored.Spec.ManifestPatches
247+
dst.Spec.AdditionalDeployments = restored.Spec.AdditionalDeployments
248+
249+
if restored.Spec.Manager != nil {
250+
dst.Spec.Manager.CRDPattern = restored.Spec.Manager.CRDPattern
251+
}
232252

233253
return nil
234254
}

api/v1alpha1/zz_generated.conversion.go

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/v1alpha2/provider_types.go

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,24 @@ type ProviderSpec struct {
7373
// This should be an inline yaml blob-string https://datatracker.ietf.org/doc/html/rfc7396
7474
// +optional
7575
ManifestPatches []string `json:"manifestPatches,omitempty"`
76+
77+
// AdditionalDeployments is a map of additional deployments that the provider
78+
// should manage. The key is the name of the deployment and the value is the
79+
// DeploymentSpec.
80+
// +optional
81+
AdditionalDeployments map[string]AdditionalProviderCustomization `json:"additionalDeployments,omitempty"`
82+
}
83+
84+
// AdditionalProviderCustomization defines the properties that can be enabled on the controller
85+
// manager and deployment for the provider if the provider is managing additional deployments.
86+
type AdditionalProviderCustomization struct {
87+
// Manager defines the properties that can be enabled on the controller manager for the additional provider deployment.
88+
// +optional
89+
Manager *ManagerSpec `json:"manager,omitempty"`
90+
91+
// Deployment defines the properties that can be enabled on the deployment for the additional provider deployment.
92+
// +optional
93+
Deployment *DeploymentSpec `json:"deployment,omitempty"`
7694
}
7795

7896
// ConfigmapReference contains enough information to locate the configmap.
@@ -123,6 +141,11 @@ type ManagerSpec struct {
123141
// in as container args to the provider's controller manager.
124142
// Controller Manager flag is --feature-gates.
125143
FeatureGates map[string]bool `json:"featureGates,omitempty"`
144+
145+
// CRDPattern is a regular expression that matches the CRDs that the provider
146+
// is expected to manage.
147+
// +optional
148+
CRDPattern *string `json:"crdPattern,omitempty"`
126149
}
127150

128151
// DeploymentSpec defines the properties that can be enabled on the Deployment for the provider.

api/v1alpha2/zz_generated.deepcopy.go

Lines changed: 37 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)