Skip to content

Commit

Permalink
Merge pull request #4872 from muraee/rosa-controlplane-shardid
Browse files Browse the repository at this point in the history
✨ ROSA: Add ProvisionShardID API field to ROSAControlPlane
  • Loading branch information
k8s-ci-robot authored Mar 15, 2024
2 parents 73f4011 + 8910546 commit 068aba0
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,13 @@ spec:
oidcID:
description: The ID of the OpenID Connect Provider.
type: string
provisionShardID:
description: ProvisionShardID defines the shard where rosa control
plane components will be hosted.
type: string
x-kubernetes-validations:
- message: provisionShardID is immutable
rule: self == oldSelf
region:
description: The AWS Region the cluster lives in.
type: string
Expand Down
6 changes: 6 additions & 0 deletions controlplane/rosa/api/v1beta2/rosacontrolplane_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,12 @@ type RosaControlPlaneSpec struct { //nolint: maligned
// +optional
AuditLogRoleARN string `json:"auditLogRoleARN,omitempty"`

// ProvisionShardID defines the shard where rosa control plane components will be hosted.
//
// +kubebuilder:validation:XValidation:rule="self == oldSelf", message="provisionShardID is immutable"
// +optional
ProvisionShardID string `json:"provisionShardID,omitempty"`

// CredentialsSecretRef references a secret with necessary credentials to connect to the OCM API.
// The secret should contain the following data keys:
// - ocmToken: eyJhbGciOiJIUzI1NiIsI....
Expand Down
6 changes: 6 additions & 0 deletions controlplane/rosa/controllers/rosacontrolplane_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,12 @@ func buildOCMClusterSpec(controPlaneSpec rosacontrolplanev1.RosaControlPlaneSpec
ocmClusterSpec.MinReplicas = computeAutoscaling.MinReplicas
}

if controPlaneSpec.ProvisionShardID != "" {
ocmClusterSpec.CustomProperties = map[string]string{
"provision_shard_id": controPlaneSpec.ProvisionShardID,
}
}

return ocmClusterSpec, nil
}

Expand Down

0 comments on commit 068aba0

Please sign in to comment.