Skip to content

Commit 9bc6d6a

Browse files
committed
move configuration to each driver struct
Signed-off-by: Alex <[email protected]>
1 parent 3639134 commit 9bc6d6a

4 files changed

+129
-38
lines changed

operator/v1/0000_01_operator.open-cluster-management.io_clustermanagers.crd.yaml

+34-21
Original file line numberDiff line numberDiff line change
@@ -269,27 +269,40 @@ spec:
269269
- csr
270270
- awsirsa
271271
type: string
272-
autoApprovedIdentities:
273-
description: |-
274-
For csr authentication type, AutoApprovedIdentities represent a list of approved users
275-
For awsirsa authentication type, AutoApprovedIdentities represent a list of approved arn patterns
276-
items:
277-
type: string
278-
type: array
279-
hubClusterArn:
280-
description: |-
281-
This represents the hub cluster ARN. Applicable to only awsirsa authentication type.
282-
Example - arn:eks:us-west-2:12345678910:cluster/hub-cluster1
283-
pattern: ^arn:aws:eks:([a-zA-Z0-9-]+):(\d{12}):cluster/([a-zA-Z0-9-]+)$
284-
type: string
285-
tags:
286-
description: |-
287-
List of tags to be added to AWS resources created by hub while processing awsirsa registration request.
288-
Applicable to only awsirsa authentication type.
289-
Example - "product:v1:tenant:app-name=My-App"
290-
items:
291-
type: string
292-
type: array
272+
awsisra:
273+
description: AwsIrsa represents the configuration for awsisra
274+
driver.
275+
properties:
276+
autoApprovedIdentities:
277+
description: AutoApprovedIdentities represent a list
278+
of approved arn patterns
279+
items:
280+
type: string
281+
type: array
282+
hubClusterArn:
283+
description: |-
284+
This represents the hub cluster ARN
285+
Example - arn:eks:us-west-2:12345678910:cluster/hub-cluster1
286+
pattern: ^arn:aws:eks:([a-zA-Z0-9-]+):(\d{12}):cluster/([a-zA-Z0-9-]+)$
287+
type: string
288+
tags:
289+
description: |-
290+
List of tags to be added to AWS resources created by hub while processing awsirsa registration request
291+
Example - "product:v1:tenant:app-name=My-App"
292+
items:
293+
type: string
294+
type: array
295+
type: object
296+
csr:
297+
description: CSR represents the configuration for csr driver.
298+
properties:
299+
autoApprovedIdentities:
300+
description: AutoApprovedIdentities represent a list
301+
of approved users
302+
items:
303+
type: string
304+
type: array
305+
type: object
293306
type: object
294307
type: array
295308
x-kubernetes-list-map-keys:

operator/v1/types_clustermanager.go

+19-5
Original file line numberDiff line numberDiff line change
@@ -125,19 +125,33 @@ type RegistrationDriverHub struct {
125125
// +kubebuilder:validation:Enum=csr;awsirsa
126126
AuthType string `json:"authType,omitempty"`
127127

128-
// This represents the hub cluster ARN. Applicable to only awsirsa authentication type.
128+
// CSR represents the configuration for csr driver.
129+
// +optional
130+
CSR *CSRDriverConfig `json:"csr,omitempty"`
131+
132+
// AwsIrsa represents the configuration for awsisra driver.
133+
// +optional
134+
AwsIrsa *AwsIrsaConfig `json:"awsisra,omitempty"`
135+
}
136+
137+
type CSRDriverConfig struct {
138+
// AutoApprovedIdentities represent a list of approved users
139+
// +optional
140+
AutoApprovedIdentities []string `json:"autoApprovedIdentities,omitempty"`
141+
}
142+
143+
type AwsIrsaConfig struct {
144+
// This represents the hub cluster ARN
129145
// Example - arn:eks:us-west-2:12345678910:cluster/hub-cluster1
130146
// +optional
131147
// +kubebuilder:validation:Pattern=`^arn:aws:eks:([a-zA-Z0-9-]+):(\d{12}):cluster/([a-zA-Z0-9-]+)$`
132148
HubClusterArn string `json:"hubClusterArn,omitempty"`
133149

134-
// For csr authentication type, AutoApprovedIdentities represent a list of approved users
135-
// For awsirsa authentication type, AutoApprovedIdentities represent a list of approved arn patterns
150+
// AutoApprovedIdentities represent a list of approved arn patterns
136151
// +optional
137152
AutoApprovedIdentities []string `json:"autoApprovedIdentities,omitempty"`
138153

139-
// List of tags to be added to AWS resources created by hub while processing awsirsa registration request.
140-
// Applicable to only awsirsa authentication type.
154+
// List of tags to be added to AWS resources created by hub while processing awsirsa registration request
141155
// Example - "product:v1:tenant:app-name=My-App"
142156
// +optional
143157
Tags []string `json:"tags,omitempty"`

operator/v1/zz_generated.deepcopy.go

+55-8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

operator/v1/zz_generated.swagger_doc_generated.go

+21-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)