add hash to kubevirt objects during testing
@@ -836,11 +836,7 @@ var _ = Describe("KubeVirt Operator", func() {
},
})
for _, obj := range all {
- if resource, ok := obj.(runtime.Object); ok {
- addResource(resource, config, nil)
- } else {
- Fail("could not cast to runtime.Object")
- }
+ addResource(obj, config, nil)
}
return len(all)
}
@@ -965,6 +961,15 @@ var _ = Describe("KubeVirt Operator", func() {
}
for _, obj := range all {
+ m := obj.(metav1.Object)
+ a := m.GetAnnotations()
+ if len(a) == 0 {
+ a = map[string]string{}
+ }
+
+ a[v1.KubeVirtCustomizeComponentAnnotationHash] = c.Hash()
+ m.SetAnnotations(a)
+
addResource(obj, config, kv)
}
}
