Skip to content

Commit

Permalink
move configuration to each driver struct
Browse files Browse the repository at this point in the history
Signed-off-by: Alex <[email protected]>
  • Loading branch information
alex0chan committed Feb 25, 2025
1 parent 3639134 commit 9bc6d6a
Show file tree
Hide file tree
Showing 4 changed files with 129 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -269,27 +269,40 @@ spec:
- csr
- awsirsa
type: string
autoApprovedIdentities:
description: |-
For csr authentication type, AutoApprovedIdentities represent a list of approved users
For awsirsa authentication type, AutoApprovedIdentities represent a list of approved arn patterns
items:
type: string
type: array
hubClusterArn:
description: |-
This represents the hub cluster ARN. Applicable to only awsirsa authentication type.
Example - arn:eks:us-west-2:12345678910:cluster/hub-cluster1
pattern: ^arn:aws:eks:([a-zA-Z0-9-]+):(\d{12}):cluster/([a-zA-Z0-9-]+)$
type: string
tags:
description: |-
List of tags to be added to AWS resources created by hub while processing awsirsa registration request.
Applicable to only awsirsa authentication type.
Example - "product:v1:tenant:app-name=My-App"
items:
type: string
type: array
awsisra:
description: AwsIrsa represents the configuration for awsisra
driver.
properties:
autoApprovedIdentities:
description: AutoApprovedIdentities represent a list
of approved arn patterns
items:
type: string
type: array
hubClusterArn:
description: |-
This represents the hub cluster ARN
Example - arn:eks:us-west-2:12345678910:cluster/hub-cluster1
pattern: ^arn:aws:eks:([a-zA-Z0-9-]+):(\d{12}):cluster/([a-zA-Z0-9-]+)$
type: string
tags:
description: |-
List of tags to be added to AWS resources created by hub while processing awsirsa registration request
Example - "product:v1:tenant:app-name=My-App"
items:
type: string
type: array
type: object
csr:
description: CSR represents the configuration for csr driver.
properties:
autoApprovedIdentities:
description: AutoApprovedIdentities represent a list
of approved users
items:
type: string
type: array
type: object
type: object
type: array
x-kubernetes-list-map-keys:
Expand Down
24 changes: 19 additions & 5 deletions operator/v1/types_clustermanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,19 +125,33 @@ type RegistrationDriverHub struct {
// +kubebuilder:validation:Enum=csr;awsirsa
AuthType string `json:"authType,omitempty"`

// This represents the hub cluster ARN. Applicable to only awsirsa authentication type.
// CSR represents the configuration for csr driver.
// +optional
CSR *CSRDriverConfig `json:"csr,omitempty"`

// AwsIrsa represents the configuration for awsisra driver.
// +optional
AwsIrsa *AwsIrsaConfig `json:"awsisra,omitempty"`
}

type CSRDriverConfig struct {
// AutoApprovedIdentities represent a list of approved users
// +optional
AutoApprovedIdentities []string `json:"autoApprovedIdentities,omitempty"`
}

type AwsIrsaConfig struct {
// This represents the hub cluster ARN
// Example - arn:eks:us-west-2:12345678910:cluster/hub-cluster1
// +optional
// +kubebuilder:validation:Pattern=`^arn:aws:eks:([a-zA-Z0-9-]+):(\d{12}):cluster/([a-zA-Z0-9-]+)$`
HubClusterArn string `json:"hubClusterArn,omitempty"`

// For csr authentication type, AutoApprovedIdentities represent a list of approved users
// For awsirsa authentication type, AutoApprovedIdentities represent a list of approved arn patterns
// AutoApprovedIdentities represent a list of approved arn patterns
// +optional
AutoApprovedIdentities []string `json:"autoApprovedIdentities,omitempty"`

// List of tags to be added to AWS resources created by hub while processing awsirsa registration request.
// Applicable to only awsirsa authentication type.
// List of tags to be added to AWS resources created by hub while processing awsirsa registration request
// Example - "product:v1:tenant:app-name=My-App"
// +optional
Tags []string `json:"tags,omitempty"`
Expand Down
63 changes: 55 additions & 8 deletions operator/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 21 additions & 4 deletions operator/v1/zz_generated.swagger_doc_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9bc6d6a

Please sign in to comment.