@@ -190,13 +190,21 @@ func TestGetTags(t *testing.T) {
190
190
expectedDefinedTags map [string ]map [string ]interface {}
191
191
expectedFreeformTags map [string ]string
192
192
}{
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
+ },
193
201
"valid tags only default" : {
194
202
setup : func () {
195
- os .Setenv (defaultTagsEnvVar , "namespace1 .default=test,default=test" )
203
+ os .Setenv (defaultTagsEnvVar , "defaultnamespace .default=test,default=test" )
196
204
},
197
205
annotations : map [string ]string {},
198
206
expectedDefinedTags : map [string ]map [string ]interface {}{
199
- "namespace1 " : map [string ]interface {}{
207
+ "defaultnamespace " : map [string ]interface {}{
200
208
"default" : "test" ,
201
209
},
202
210
},
@@ -227,6 +235,22 @@ func TestGetTags(t *testing.T) {
227
235
"default" : "test" ,
228
236
},
229
237
},
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
+ },
230
254
}
231
255
232
256
for name , tc := range testCases {
0 commit comments