Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion provisioner/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,8 @@ func list(args ...interface{}) []interface{} {
}

func eksID(id string) string {
return strings.Replace(id, ":", "--", -1)
parts := strings.Split(id, ":")
return parts[len(parts)-1]
}

// accountID returns just the ID part of an account
Expand Down
2 changes: 1 addition & 1 deletion provisioner/template_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ func TestEKSID(t *testing.T) {
`{{ eksID "aws:000000:eu-north-1:kube-1" }}`,
"")
require.NoError(t, err)
require.EqualValues(t, "aws--000000--eu-north-1--kube-1", result)
require.EqualValues(t, "kube-1", result)
}

func TestParsePortRanges(t *testing.T) {
Expand Down