From e49c54a67993fcd011cab7c8a34d861cee5ac7b0 Mon Sep 17 00:00:00 2001 From: Suvaansh <34331549+suvaanshkumar@users.noreply.github.com> Date: Thu, 26 Sep 2024 20:18:22 -0400 Subject: [PATCH] Add managed cluster arn for the klusterlet api (#341) Signed-off-by: Suvaansh <34331549+suvaanshkumar@users.noreply.github.com> --- ...erator.open-cluster-management.io_klusterlets.crd.yaml | 5 +++++ ...erator.open-cluster-management.io_klusterlets.crd.yaml | 8 ++++++++ operator/v1/types_klusterlet.go | 7 +++++++ operator/v1/zz_generated.swagger_doc_generated.go | 3 ++- 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/crdsv1beta1/0001_00_operator.open-cluster-management.io_klusterlets.crd.yaml b/crdsv1beta1/0001_00_operator.open-cluster-management.io_klusterlets.crd.yaml index dd5cb6a8..c211a638 100644 --- a/crdsv1beta1/0001_00_operator.open-cluster-management.io_klusterlets.crd.yaml +++ b/crdsv1beta1/0001_00_operator.open-cluster-management.io_klusterlets.crd.yaml @@ -203,6 +203,11 @@ spec: hubClusterArn: description: 'The arn of the hub cluster (ie: an EKS cluster). This will be required to pass information to hub, which hub will use to create IAM identities for this klusterlet. Example - arn:eks:us-west-2:12345678910:cluster/hub-cluster1.' type: string + minLength: 1 + managedClusterArn: + description: 'The arn of the managed cluster (ie: an EKS cluster). This will be required to generate the md5hash which will be used as a suffix to create IAM role on hub as well as used by kluslerlet-agent, to assume role suffixed with the md5hash, on startup. Example - arn:eks:us-west-2:12345678910:cluster/managed-cluster1.' + type: string + minLength: 1 registrationImagePullSpec: description: RegistrationImagePullSpec represents the desired image configuration of registration agent. quay.io/open-cluster-management.io/registration:latest will be used if unspecified. type: string diff --git a/operator/v1/0000_00_operator.open-cluster-management.io_klusterlets.crd.yaml b/operator/v1/0000_00_operator.open-cluster-management.io_klusterlets.crd.yaml index 73d78280..d5e0e0ef 100644 --- a/operator/v1/0000_00_operator.open-cluster-management.io_klusterlets.crd.yaml +++ b/operator/v1/0000_00_operator.open-cluster-management.io_klusterlets.crd.yaml @@ -311,6 +311,14 @@ spec: description: |- The arn of the hub cluster (ie: an EKS cluster). This will be required to pass information to hub, which hub will use to create IAM identities for this klusterlet. Example - arn:eks:us-west-2:12345678910:cluster/hub-cluster1. + minLength: 1 + type: string + managedClusterArn: + description: |- + The arn of the managed cluster (ie: an EKS cluster). This will be required to generate the md5hash which will be used as a suffix to create IAM role on hub + as well as used by kluslerlet-agent, to assume role suffixed with the md5hash, on startup. + Example - arn:eks:us-west-2:12345678910:cluster/managed-cluster1. + minLength: 1 type: string type: object type: object diff --git a/operator/v1/types_klusterlet.go b/operator/v1/types_klusterlet.go index 97e6fa53..8e89b4bd 100644 --- a/operator/v1/types_klusterlet.go +++ b/operator/v1/types_klusterlet.go @@ -193,7 +193,14 @@ type AwsIrsa struct { // The arn of the hub cluster (ie: an EKS cluster). This will be required to pass information to hub, which hub will use to create IAM identities for this klusterlet. // Example - arn:eks:us-west-2:12345678910:cluster/hub-cluster1. // +required + // +kubebuilder:validation:MinLength=1 HubClusterArn string `json:"hubClusterArn"` + // The arn of the managed cluster (ie: an EKS cluster). This will be required to generate the md5hash which will be used as a suffix to create IAM role on hub + // as well as used by kluslerlet-agent, to assume role suffixed with the md5hash, on startup. + // Example - arn:eks:us-west-2:12345678910:cluster/managed-cluster1. + // +required + // +kubebuilder:validation:MinLength=1 + ManagedClusterArn string `json:"managedClusterArn"` } type TypeBootstrapKubeConfigs string diff --git a/operator/v1/zz_generated.swagger_doc_generated.go b/operator/v1/zz_generated.swagger_doc_generated.go index c6085cdc..5d63b919 100644 --- a/operator/v1/zz_generated.swagger_doc_generated.go +++ b/operator/v1/zz_generated.swagger_doc_generated.go @@ -164,7 +164,8 @@ func (WorkConfiguration) SwaggerDoc() map[string]string { } var map_AwsIrsa = map[string]string{ - "hubClusterArn": "The arn of the hub cluster (ie: an EKS cluster). This will be required to pass information to hub, which hub will use to create IAM identities for this klusterlet. Example - arn:eks:us-west-2:12345678910:cluster/hub-cluster1.", + "hubClusterArn": "The arn of the hub cluster (ie: an EKS cluster). This will be required to pass information to hub, which hub will use to create IAM identities for this klusterlet. Example - arn:eks:us-west-2:12345678910:cluster/hub-cluster1.", + "managedClusterArn": "The arn of the managed cluster (ie: an EKS cluster). This will be required to generate the md5hash which will be used as a suffix to create IAM role on hub as well as used by kluslerlet-agent, to assume role suffixed with the md5hash, on startup. Example - arn:eks:us-west-2:12345678910:cluster/managed-cluster1.", } func (AwsIrsa) SwaggerDoc() map[string]string {