@@ -233,8 +233,9 @@ func TestGetTemplateInputRemovesIgnoredPaths(t *testing.T) {
233233 object := testObject {
234234 ObjectMeta : metav1.ObjectMeta {
235235 Annotations : map [string ]string {
236- "annotation" : "value" ,
237- "other/annotation" : "bar" ,
236+ "annotation" : "value" ,
237+ "quack.pusher.com/template" : "true" ,
238+ "other/annotation" : "bar" ,
238239 },
239240 },
240241 Foo : "bar" ,
@@ -253,18 +254,38 @@ func TestGetTemplateInputRemovesIgnoredPaths(t *testing.T) {
253254 if err != nil {
254255 assert .FailNowf (t , "jsonError" , "Failed to marshal input: %v" , err )
255256 }
257+ objectNoOtherRaw , err := json .Marshal (objectNoOtherAnnotation )
258+ if err != nil {
259+ assert .FailNowf (t , "jsonError" , "Failed to marshal input: %v" , err )
260+ }
256261
257262 template , err := getTemplateInput (objectRaw , ignoredPaths )
258263 if err != nil {
259264 assert .FailNowf (t , "methodError" , "Error in getTemplateInput: %v" , err )
260265 }
261266
267+ assert .NotNil (t , template , "template should not be nil" )
268+
262269 templateObject := testObject {}
263270 err = json .Unmarshal (template , & templateObject )
264271 if err != nil {
265272 assert .FailNowf (t , "jsonError" , "Error in unmarshall: %v" , err )
266273 }
267274 assert .Equal (t , objectNoOtherAnnotation , templateObject , "Object should have no ignored paths" )
275+
276+ template , err = getTemplateInput (objectNoOtherRaw , ignoredPaths )
277+ if err != nil {
278+ assert .FailNowf (t , "methodError" , "Error in getTemplateInput: %v" , err )
279+ }
280+
281+ assert .NotNil (t , template , "template should not be nil" )
282+
283+ err = json .Unmarshal (template , & templateObject )
284+ if err != nil {
285+ assert .FailNowf (t , "jsonError" , "Error in unmarshall: %v" , err )
286+ }
287+
288+ assert .Equal (t , objectNoOtherAnnotation , templateObject , "Object should have no ignored paths" )
268289}
269290
270291func TestGetTemplateInputRemovesStatus (t * testing.T ) {
0 commit comments