-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
installer: we don't need to check the in-cluster config
Signed-off-by: JenTing Hsiao <[email protected]>
- Loading branch information
Showing
9 changed files
with
62 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
install/installer/cmd/testdata/render/aws-setup/output.golden
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
install/installer/pkg/components/registry-credential/common_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Copyright (c) 2022 Gitpod GmbH. All rights reserved. | ||
// Licensed under the GNU Affero General Public License (AGPL). | ||
// See License-AGPL.txt in the project root for license information. | ||
|
||
package registry_credential | ||
|
||
import "testing" | ||
|
||
func TestGetAWSRegion(t *testing.T) { | ||
tests := []struct { | ||
URL string | ||
Expect string | ||
}{ | ||
{ | ||
URL: "012345678969.dkr.ecr.us-west-1.amazonaws.com", | ||
Expect: "us-west-1", | ||
}, | ||
{ | ||
URL: "https://012345678969.dkr.ecr.us-west-1.amazonaws.com", | ||
Expect: "us-west-1", | ||
}, | ||
{ | ||
URL: "https://012345678969.dkr.ecr.us-west-100.amazonaws.com", | ||
Expect: "us-west-100", | ||
}, | ||
} | ||
|
||
for _, test := range tests { | ||
t.Run(test.URL, func(t *testing.T) { | ||
got := getAWSRegion(test.URL) | ||
if got != test.Expect { | ||
t.Errorf("expect url %s, got %s", test.Expect, got) | ||
} | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters