Skip to content

Commit fe91f56

Browse files
TiberiuGCidanshoham
authored andcommitted
[Pod Identity Associations] Don't allow --create-service-account flag when --config-file is set (eksctl-io#7789)
don't allow --create-service-account flag when --config-file is set
1 parent e7e5f20 commit fe91f56

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

pkg/ctl/cmdutils/pod_identity_association.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ var (
1919
"permission-boundary-arn",
2020
"permission-policy-arn",
2121
"well-known-policies",
22+
"create-service-account",
2223
}
2324
)
2425

pkg/ctl/create/pod_identity_association_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ var _ = Describe("create pod identity association", func() {
4949
args: []string{"--service-account-name", "test-sa-name", "--config-file", configFile},
5050
expectedErr: "cannot use --service-account-name when --config-file/-f is set",
5151
}),
52+
Entry("setting --create-service-account and --config-file at the same time", createPodIdentityAssociationEntry{
53+
args: []string{"--create-service-account", "--config-file", configFile},
54+
expectedErr: "cannot use --create-service-account when --config-file/-f is set",
55+
}),
5256
Entry("missing all --role-arn, --permission-policy-arns and --well-known-policies", createPodIdentityAssociationEntry{
5357
args: defaultArgs,
5458
expectedErr: "at least one of the following flags must be specified: --role-arn, --permission-policy-arns, --well-known-policies",

0 commit comments

Comments
 (0)