@@ -190,13 +190,21 @@ func TestGetTags(t *testing.T) {
190190 expectedDefinedTags map [string ]map [string ]interface {}
191191 expectedFreeformTags map [string ]string
192192 }{
193+ "no default or annotation tags" : {
194+ setup : func () {
195+ os .Setenv (defaultTagsEnvVar , "" )
196+ },
197+ annotations : map [string ]string {},
198+ expectedDefinedTags : map [string ]map [string ]interface {}{},
199+ expectedFreeformTags : map [string ]string {},
200+ },
193201 "valid tags only default" : {
194202 setup : func () {
195- os .Setenv (defaultTagsEnvVar , "namespace1 .default=test,default=test" )
203+ os .Setenv (defaultTagsEnvVar , "defaultnamespace .default=test,default=test" )
196204 },
197205 annotations : map [string ]string {},
198206 expectedDefinedTags : map [string ]map [string ]interface {}{
199- "namespace1 " : map [string ]interface {}{
207+ "defaultnamespace " : map [string ]interface {}{
200208 "default" : "test" ,
201209 },
202210 },
@@ -227,6 +235,22 @@ func TestGetTags(t *testing.T) {
227235 "default" : "test" ,
228236 },
229237 },
238+ "override defaults with annotation" : {
239+ setup : func () {
240+ os .Setenv (defaultTagsEnvVar , "namespace1.default=test,default=test" )
241+ },
242+ annotations : map [string ]string {
243+ ociTagAnnotation : "namespace1.default=foo,default=bar" ,
244+ },
245+ expectedDefinedTags : map [string ]map [string ]interface {}{
246+ "namespace1" : map [string ]interface {}{
247+ "default" : "foo" ,
248+ },
249+ },
250+ expectedFreeformTags : map [string ]string {
251+ "default" : "bar" ,
252+ },
253+ },
230254 }
231255
232256 for name , tc := range testCases {
0 commit comments