Skip to content

Commit 1ae0938

Browse files
committed
eksconfig: fix ECR repos
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
1 parent 347b69f commit 1ae0938

File tree

7 files changed

+33
-9
lines changed

7 files changed

+33
-9
lines changed

eksconfig/add-on-cluster-loader-remote.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ func (cfg *Config) validateAddOnClusterLoaderRemote() error {
115115
if cfg.AddOnClusterLoaderRemote.RepositoryURI == "" {
116116
return errors.New("AddOnClusterLoaderRemote.RepositoryURI empty")
117117
}
118-
if strings.Contains(cfg.AddOnClusterLoaderRemote.RepositoryURI, cfg.AddOnClusterLoaderRemote.RepositoryAccountID) {
118+
if !strings.Contains(cfg.AddOnClusterLoaderRemote.RepositoryURI, cfg.AddOnClusterLoaderRemote.RepositoryAccountID) {
119119
return fmt.Errorf("AddOnClusterLoaderRemote.RepositoryURI %q does not have AddOnClusterLoaderRemote.RepositoryAccountID %q", cfg.AddOnClusterLoaderRemote.RepositoryURI, cfg.AddOnClusterLoaderRemote.RepositoryAccountID)
120120
}
121121
if cfg.AddOnClusterLoaderRemote.RepositoryImageTag == "" {

eksconfig/add-on-fargate.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ func (cfg *Config) validateAddOnFargate() error {
145145
if cfg.AddOnFargate.RepositoryName == "" {
146146
return errors.New("AddOnFargate.RepositoryName empty")
147147
}
148-
if strings.Contains(cfg.AddOnFargate.RepositoryURI, cfg.AddOnFargate.RepositoryAccountID) {
148+
if !strings.Contains(cfg.AddOnFargate.RepositoryURI, cfg.AddOnFargate.RepositoryAccountID) {
149149
return fmt.Errorf("AddOnFargate.RepositoryURI %q does not have AddOnFargate.RepositoryAccountID %q", cfg.AddOnFargate.RepositoryURI, cfg.AddOnFargate.RepositoryAccountID)
150150
}
151151
if cfg.AddOnFargate.RepositoryImageTag == "" {

eksconfig/add-on-hollow-nodes-remote.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ type AddOnHollowNodesRemote struct {
4747
// "cmd/kubelet/app.rlimit.SetNumFiles(MaxOpenFiles)" sets this for the host.
4848
MaxOpenFiles int64 `json:"max-open-files"`
4949

50-
5150
// RepositoryAccountID is the account ID for tester ECR image.
5251
// e.g. "aws/aws-k8s-tester" for "[ACCOUNT_ID].dkr.ecr.us-west-2.amazonaws.com/aws/aws-k8s-tester"
5352
RepositoryAccountID string `json:"repository-account-id,omitempty"`
@@ -132,7 +131,7 @@ func (cfg *Config) validateAddOnHollowNodesRemote() error {
132131
if cfg.AddOnHollowNodesRemote.RepositoryURI == "" {
133132
return errors.New("AddOnHollowNodesRemote.RepositoryURI empty")
134133
}
135-
if strings.Contains(cfg.AddOnHollowNodesRemote.RepositoryURI, cfg.AddOnHollowNodesRemote.RepositoryAccountID) {
134+
if !strings.Contains(cfg.AddOnHollowNodesRemote.RepositoryURI, cfg.AddOnHollowNodesRemote.RepositoryAccountID) {
136135
return fmt.Errorf("AddOnHollowNodesRemote.RepositoryURI %q does not have AddOnHollowNodesRemote.RepositoryAccountID %q", cfg.AddOnHollowNodesRemote.RepositoryURI, cfg.AddOnHollowNodesRemote.RepositoryAccountID)
137136
}
138137
if cfg.AddOnHollowNodesRemote.RepositoryImageTag == "" {

eksconfig/add-on-irsa-fargate.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ func (cfg *Config) validateAddOnIRSAFargate() error {
118118
if cfg.AddOnIRSAFargate.RepositoryURI == "" {
119119
return errors.New("AddOnIRSAFargate.RepositoryURI empty")
120120
}
121-
if strings.Contains(cfg.AddOnIRSAFargate.RepositoryURI, cfg.AddOnIRSAFargate.RepositoryAccountID) {
121+
if !strings.Contains(cfg.AddOnIRSAFargate.RepositoryURI, cfg.AddOnIRSAFargate.RepositoryAccountID) {
122122
return fmt.Errorf("AddOnIRSAFargate.RepositoryURI %q does not have AddOnIRSAFargate.RepositoryAccountID %q", cfg.AddOnIRSAFargate.RepositoryURI, cfg.AddOnIRSAFargate.RepositoryAccountID)
123123
}
124124
if cfg.AddOnIRSAFargate.RepositoryImageTag == "" {

eksconfig/add-on-irsa.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ func (cfg *Config) validateAddOnIRSA() error {
119119
if cfg.AddOnIRSA.RepositoryURI == "" {
120120
return errors.New("AddOnIRSA.RepositoryURI empty")
121121
}
122-
if strings.Contains(cfg.AddOnIRSA.RepositoryURI, cfg.AddOnIRSA.RepositoryAccountID) {
122+
if !strings.Contains(cfg.AddOnIRSA.RepositoryURI, cfg.AddOnIRSA.RepositoryAccountID) {
123123
return fmt.Errorf("AddOnIRSA.RepositoryURI %q does not have AddOnIRSA.RepositoryAccountID %q", cfg.AddOnIRSA.RepositoryURI, cfg.AddOnIRSA.RepositoryAccountID)
124124
}
125125
if cfg.AddOnIRSA.RepositoryImageTag == "" {

eksconfig/default.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ log-level: info
2121
log-outputs:
2222
- stderr
2323
- /home/ANT.AMAZON.COM/leegyuho/go/src/github.com/aws/aws-k8s-tester/eksconfig/default.log
24-
name: eks-2020051515-icyz2siqheib
24+
name: eks-2020051516-reinventplqq
2525
on-failure-delete: true
2626
on-failure-delete-wait-seconds: 120
2727
parameters:
@@ -38,7 +38,7 @@ parameters:
3838
role-cfn-stack-id: ""
3939
role-create: true
4040
role-managed-policy-arns: null
41-
role-name: eks-2020051515-icyz2siqheib-role
41+
role-name: eks-2020051516-reinventplqq-role
4242
role-service-principals: null
4343
signing-name: eks
4444
tags: null
@@ -51,7 +51,7 @@ partition: aws
5151
region: us-west-2
5252
remote-access-commands-output-path: /home/ANT.AMAZON.COM/leegyuho/go/src/github.com/aws/aws-k8s-tester/eksconfig/default.ssh.sh
5353
remote-access-key-create: true
54-
remote-access-key-name: eks-2020051515-icyz2siqheib-key-nodes
54+
remote-access-key-name: eks-2020051516-reinventplqq-key-nodes
5555
remote-access-private-key-path: /home/ANT.AMAZON.COM/leegyuho/.ssh/kube_aws_rsa
5656
s3-bucket-create: false
5757
s3-bucket-create-keep: false

eksconfig/env_test.go

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,8 @@ func TestEnv(t *testing.T) {
266266
defer os.Unsetenv("AWS_K8S_TESTER_EKS_ADD_ON_FARGATE_ROLE_MANAGED_POLICY_ARNS")
267267
os.Setenv("AWS_K8S_TESTER_EKS_ADD_ON_FARGATE_PROFILE_NAME", "hello")
268268
defer os.Unsetenv("AWS_K8S_TESTER_EKS_ADD_ON_FARGATE_PROFILE_NAME")
269+
os.Setenv("AWS_K8S_TESTER_EKS_ADD_ON_FARGATE_REPOSITORY_ACCOUNT_ID", "uri")
270+
defer os.Unsetenv("AWS_K8S_TESTER_EKS_ADD_ON_FARGATE_REPOSITORY_ACCOUNT_ID")
269271
os.Setenv("AWS_K8S_TESTER_EKS_ADD_ON_FARGATE_REPOSITORY_NAME", "fargate-repo-name")
270272
defer os.Unsetenv("AWS_K8S_TESTER_EKS_ADD_ON_FARGATE_REPOSITORY_NAME")
271273
os.Setenv("AWS_K8S_TESTER_EKS_ADD_ON_FARGATE_REPOSITORY_URI", "fargate-repo-uri")
@@ -285,6 +287,8 @@ func TestEnv(t *testing.T) {
285287
defer os.Unsetenv("AWS_K8S_TESTER_EKS_ADD_ON_IRSA_ROLE_MANAGED_POLICY_ARNS")
286288
os.Setenv("AWS_K8S_TESTER_EKS_ADD_ON_IRSA_S3_KEY", "hello")
287289
defer os.Unsetenv("AWS_K8S_TESTER_EKS_ADD_ON_IRSA_S3_KEY")
290+
os.Setenv("AWS_K8S_TESTER_EKS_ADD_ON_IRSA_REPOSITORY_ACCOUNT_ID", "uri")
291+
defer os.Unsetenv("AWS_K8S_TESTER_EKS_ADD_ON_IRSA_REPOSITORY_ACCOUNT_ID")
288292
os.Setenv("AWS_K8S_TESTER_EKS_ADD_ON_IRSA_REPOSITORY_NAME", "irsa-repo-name")
289293
defer os.Unsetenv("AWS_K8S_TESTER_EKS_ADD_ON_IRSA_REPOSITORY_NAME")
290294
os.Setenv("AWS_K8S_TESTER_EKS_ADD_ON_IRSA_REPOSITORY_URI", "irsa-repo-uri")
@@ -308,6 +312,8 @@ func TestEnv(t *testing.T) {
308312
defer os.Unsetenv("AWS_K8S_TESTER_EKS_ADD_ON_IRSA_FARGATE_S3_KEY")
309313
os.Setenv("AWS_K8S_TESTER_EKS_ADD_ON_IRSA_FARGATE_PROFILE_NAME", "hello")
310314
defer os.Unsetenv("AWS_K8S_TESTER_EKS_ADD_ON_IRSA_FARGATE_PROFILE_NAME")
315+
os.Setenv("AWS_K8S_TESTER_EKS_ADD_ON_IRSA_FARGATE_REPOSITORY_ACCOUNT_ID", "uri")
316+
defer os.Unsetenv("AWS_K8S_TESTER_EKS_ADD_ON_IRSA_FARGATE_REPOSITORY_ACCOUNT_ID")
311317
os.Setenv("AWS_K8S_TESTER_EKS_ADD_ON_IRSA_FARGATE_REPOSITORY_NAME", "irsa-fargate-repo-name")
312318
defer os.Unsetenv("AWS_K8S_TESTER_EKS_ADD_ON_IRSA_FARGATE_REPOSITORY_NAME")
313319
os.Setenv("AWS_K8S_TESTER_EKS_ADD_ON_IRSA_FARGATE_REPOSITORY_URI", "irsa-fargate-repo-uri")
@@ -336,6 +342,8 @@ func TestEnv(t *testing.T) {
336342
defer os.Unsetenv("AWS_K8S_TESTER_EKS_ADD_ON_HOLLOW_NODES_REMOTE_NAMESPACE")
337343
os.Setenv("AWS_K8S_TESTER_EKS_ADD_ON_HOLLOW_NODES_REMOTE_NODES", "333")
338344
defer os.Unsetenv("AWS_K8S_TESTER_EKS_ADD_ON_HOLLOW_NODES_REMOTE_NODES")
345+
os.Setenv("AWS_K8S_TESTER_EKS_ADD_ON_HOLLOW_NODES_REMOTE_REPOSITORY_ACCOUNT_ID", "uri")
346+
defer os.Unsetenv("AWS_K8S_TESTER_EKS_ADD_ON_HOLLOW_NODES_REMOTE_REPOSITORY_ACCOUNT_ID")
339347
os.Setenv("AWS_K8S_TESTER_EKS_ADD_ON_HOLLOW_NODES_REMOTE_REPOSITORY_NAME", "hollow-nodes-repo-name")
340348
defer os.Unsetenv("AWS_K8S_TESTER_EKS_ADD_ON_HOLLOW_NODES_REMOTE_REPOSITORY_NAME")
341349
os.Setenv("AWS_K8S_TESTER_EKS_ADD_ON_HOLLOW_NODES_REMOTE_REPOSITORY_URI", "hollow-nodes-repo-uri")
@@ -352,6 +360,8 @@ func TestEnv(t *testing.T) {
352360
defer os.Unsetenv("AWS_K8S_TESTER_EKS_ADD_ON_CLUSTER_LOADER_REMOTE_ENABLE")
353361
os.Setenv("AWS_K8S_TESTER_EKS_ADD_ON_CLUSTER_LOADER_REMOTE_DURATION", "7m30s")
354362
defer os.Unsetenv("AWS_K8S_TESTER_EKS_ADD_ON_CLUSTER_LOADER_REMOTE_DURATION")
363+
os.Setenv("AWS_K8S_TESTER_EKS_ADD_ON_CLUSTER_LOADER_REMOTE_REPOSITORY_ACCOUNT_ID", "uri")
364+
defer os.Unsetenv("AWS_K8S_TESTER_EKS_ADD_ON_CLUSTER_LOADER_REMOTE_REPOSITORY_ACCOUNT_ID")
355365
os.Setenv("AWS_K8S_TESTER_EKS_ADD_ON_CLUSTER_LOADER_REMOTE_REPOSITORY_NAME", "cluster-loader-repo-name")
356366
defer os.Unsetenv("AWS_K8S_TESTER_EKS_ADD_ON_CLUSTER_LOADER_REMOTE_REPOSITORY_NAME")
357367
os.Setenv("AWS_K8S_TESTER_EKS_ADD_ON_CLUSTER_LOADER_REMOTE_REPOSITORY_URI", "cluster-loader-repo-uri")
@@ -829,6 +839,9 @@ func TestEnv(t *testing.T) {
829839
if cfg.AddOnFargate.ProfileName != "hello" {
830840
t.Fatalf("unexpected cfg.AddOnFargate.ProfileName %q", cfg.AddOnFargate.ProfileName)
831841
}
842+
if cfg.AddOnFargate.RepositoryAccountID != "uri" {
843+
t.Fatalf("unexpected cfg.AddOnFargate.RepositoryAccountID %v", cfg.AddOnFargate.RepositoryAccountID)
844+
}
832845
if cfg.AddOnFargate.RepositoryName != "fargate-repo-name" {
833846
t.Fatalf("unexpected cfg.AddOnFargate.RepositoryName %v", cfg.AddOnFargate.RepositoryName)
834847
}
@@ -858,6 +871,9 @@ func TestEnv(t *testing.T) {
858871
if cfg.AddOnIRSA.S3Key != "hello" {
859872
t.Fatalf("unexpected cfg.AddOnIRSA.S3Key %q", cfg.AddOnIRSA.S3Key)
860873
}
874+
if cfg.AddOnIRSA.RepositoryAccountID != "uri" {
875+
t.Fatalf("unexpected cfg.AddOnIRSA.RepositoryAccountID %v", cfg.AddOnIRSA.RepositoryAccountID)
876+
}
861877
if cfg.AddOnIRSA.RepositoryName != "irsa-repo-name" {
862878
t.Fatalf("unexpected cfg.AddOnIRSA.RepositoryName %v", cfg.AddOnIRSA.RepositoryName)
863879
}
@@ -894,6 +910,9 @@ func TestEnv(t *testing.T) {
894910
if cfg.AddOnIRSAFargate.ProfileName != "hello" {
895911
t.Fatalf("unexpected cfg.AddOnIRSAFargate.ProfileName %q", cfg.AddOnIRSAFargate.ProfileName)
896912
}
913+
if cfg.AddOnIRSAFargate.RepositoryAccountID != "uri" {
914+
t.Fatalf("unexpected cfg.AddOnIRSAFargate.RepositoryAccountID %v", cfg.AddOnIRSAFargate.RepositoryAccountID)
915+
}
897916
if cfg.AddOnIRSAFargate.RepositoryName != "irsa-fargate-repo-name" {
898917
t.Fatalf("unexpected cfg.AddOnIRSAFargate.RepositoryName %v", cfg.AddOnIRSAFargate.RepositoryName)
899918
}
@@ -933,6 +952,9 @@ func TestEnv(t *testing.T) {
933952
if cfg.AddOnHollowNodesRemote.Namespace != "test-hollow-nodes-namespace" {
934953
t.Fatalf("unexpected cfg.AddOnHollowNodesRemote.Namespace %v", cfg.AddOnHollowNodesRemote.Namespace)
935954
}
955+
if cfg.AddOnHollowNodesRemote.RepositoryAccountID != "uri" {
956+
t.Fatalf("unexpected cfg.AddOnHollowNodesRemote.RepositoryAccountID %v", cfg.AddOnHollowNodesRemote.RepositoryAccountID)
957+
}
936958
if cfg.AddOnHollowNodesRemote.RepositoryName != "hollow-nodes-repo-name" {
937959
t.Fatalf("unexpected cfg.AddOnHollowNodesRemote.RepositoryName %v", cfg.AddOnHollowNodesRemote.RepositoryName)
938960
}
@@ -956,6 +978,9 @@ func TestEnv(t *testing.T) {
956978
if cfg.AddOnClusterLoaderRemote.Duration != 7*time.Minute+30*time.Second {
957979
t.Fatalf("unexpected cfg.AddOnClusterLoaderRemote.Duration %v", cfg.AddOnClusterLoaderRemote.Duration)
958980
}
981+
if cfg.AddOnClusterLoaderRemote.RepositoryAccountID != "uri" {
982+
t.Fatalf("unexpected cfg.AddOnClusterLoaderRemote.RepositoryAccountID %v", cfg.AddOnClusterLoaderRemote.RepositoryAccountID)
983+
}
959984
if cfg.AddOnClusterLoaderRemote.RepositoryName != "cluster-loader-repo-name" {
960985
t.Fatalf("unexpected cfg.AddOnClusterLoaderRemote.RepositoryName %v", cfg.AddOnClusterLoaderRemote.RepositoryName)
961986
}

0 commit comments

Comments
 (0)