Skip to content

Commit

Permalink
Merge pull request #149 from ulucinar/no-ext-name-in-template
Browse files Browse the repository at this point in the history
Add a test-case for config.GetExternalNameFromTemplated where the external-name template variable is not available
  • Loading branch information
ulucinar authored Jan 23, 2023
2 parents 5d0efcc + 1e90abe commit 531a995
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pkg/config/externalname_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,16 @@ func TestGetExternalNameFromTemplated(t *testing.T) {
name: "myname",
},
},
"NoExternalNameInTemplate": {
reason: "Should return the ID intact if there's no {{ .external_name }} variable in the template",
args: args{
tmpl: "olala:{{ .another }}:omama:{{ .someOther }}",
val: "olala:val1:omama:val2",
},
want: want{
name: "olala:val1:omama:val2",
},
},
}
for name, tc := range cases {
t.Run(name, func(t *testing.T) {
Expand Down

0 comments on commit 531a995

Please sign in to comment.