Skip to content

Commit 8910546

Browse files
committed
Add ProvisionShardID API field to ROSAControlPlane
1 parent b2bebfb commit 8910546

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

config/crd/bases/controlplane.cluster.x-k8s.io_rosacontrolplanes.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,13 @@ spec:
214214
oidcID:
215215
description: The ID of the OpenID Connect Provider.
216216
type: string
217+
provisionShardID:
218+
description: ProvisionShardID defines the shard where rosa control
219+
plane components will be hosted.
220+
type: string
221+
x-kubernetes-validations:
222+
- message: provisionShardID is immutable
223+
rule: self == oldSelf
217224
region:
218225
description: The AWS Region the cluster lives in.
219226
type: string

controlplane/rosa/api/v1beta2/rosacontrolplane_types.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,12 @@ type RosaControlPlaneSpec struct { //nolint: maligned
139139
// +optional
140140
AuditLogRoleARN string `json:"auditLogRoleARN,omitempty"`
141141

142+
// ProvisionShardID defines the shard where rosa control plane components will be hosted.
143+
//
144+
// +kubebuilder:validation:XValidation:rule="self == oldSelf", message="provisionShardID is immutable"
145+
// +optional
146+
ProvisionShardID string `json:"provisionShardID,omitempty"`
147+
142148
// CredentialsSecretRef references a secret with necessary credentials to connect to the OCM API.
143149
// The secret should contain the following data keys:
144150
// - ocmToken: eyJhbGciOiJIUzI1NiIsI....

controlplane/rosa/controllers/rosacontrolplane_controller.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -615,6 +615,12 @@ func buildOCMClusterSpec(controPlaneSpec rosacontrolplanev1.RosaControlPlaneSpec
615615
ocmClusterSpec.MinReplicas = computeAutoscaling.MinReplicas
616616
}
617617

618+
if controPlaneSpec.ProvisionShardID != "" {
619+
ocmClusterSpec.CustomProperties = map[string]string{
620+
"provision_shard_id": controPlaneSpec.ProvisionShardID,
621+
}
622+
}
623+
618624
return ocmClusterSpec, nil
619625
}
620626

0 commit comments

Comments
 (0)