Skip to content

Commit a3a4970

Browse files
committed
fix: default region required for IAM service endpoint resolution
1 parent 5e44102 commit a3a4970

4 files changed

Lines changed: 8 additions & 1 deletion

File tree

api/v1alpha1/awsvalidator_types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import (
2626
// AwsValidatorSpec defines the desired state of AwsValidator
2727
type AwsValidatorSpec struct {
2828
Auth AwsAuth `json:"auth"`
29+
DefaultRegion string `json:"defaultRegion"`
2930
IamRoleRules []IamRoleRule `json:"iamRoleRules,omitempty"`
3031
IamUserRules []IamUserRule `json:"iamUserRules,omitempty"`
3132
IamGroupRules []IamGroupRule `json:"iamGroupRules,omitempty"`

chart/valid8or-plugin-aws/crds/awsvalidator-crd.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ spec:
4242
description: 'Option 2: specify a service account (EKS)'
4343
type: string
4444
type: object
45+
defaultRegion:
46+
type: string
4547
iamGroupRules:
4648
items:
4749
properties:
@@ -320,6 +322,7 @@ spec:
320322
type: array
321323
required:
322324
- auth
325+
- defaultRegion
323326
type: object
324327
status:
325328
description: AwsValidatorStatus defines the observed state of AwsValidator

config/crd/bases/validation.spectrocloud.labs_awsvalidators.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ spec:
4343
description: 'Option 2: specify a service account (EKS)'
4444
type: string
4545
type: object
46+
defaultRegion:
47+
type: string
4648
iamGroupRules:
4749
items:
4850
properties:
@@ -321,6 +323,7 @@ spec:
321323
type: array
322324
required:
323325
- auth
326+
- defaultRegion
324327
type: object
325328
status:
326329
description: AwsValidatorStatus defines the observed state of AwsValidator

internal/controller/awsvalidator_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ func (r *AwsValidatorReconciler) Reconcile(ctx context.Context, req ctrl.Request
8888
failed := &types.MonotonicBool{}
8989

9090
// IAM rules
91-
awsApi, err := aws_utils.NewAwsApi("")
91+
awsApi, err := aws_utils.NewAwsApi(validator.Spec.DefaultRegion)
9292
if err != nil {
9393
r.Log.V(0).Error(err, "failed to get AWS client")
9494
} else {

0 commit comments

Comments
 (0)