Description of problem: If image precaching enabled in CGU with ClusterVersion policies, TALO pod will crash with following trace in talo manager container logs: 2022-02-24T20:38:08.269Z INFO controllers.ClusterGroupUpgrade [getClustersBySelectors] {"clusterNames": ["helix21-0"]} 2022-02-24T20:38:08.269Z INFO controllers.ClusterGroupUpgrade [getClustersNonCompliantWithPolicy] {"policy: ": "du-upgrade-cluster-version-policy2", "clusters: ": ["helix21-0", "helix21-1", "helix21-2", "helix21-3"]} panic: interface conversion: interface {} is nil, not map[string]interface {} goroutine 661 [running]: github.com/openshift-kni/cluster-group-upgrades-operator/controllers.(*ClusterGroupUpgradeReconciler).extractPrecachingSpecFromPolicies(0xc0007398c0, {0xc000517c00, 0x11}, 0xc000517c00, {0xc001132ba0, 0x2, 0x24a1ea0}) /workspace/controllers/precache.go:348 +0xfea github.com/openshift-kni/cluster-group-upgrades-operator/controllers.(*ClusterGroupUpgradeReconciler).precachingFsm(0xc0007398c0, {0x18c06b8, 0xc001131410}, 0xc000517c00) /workspace/controllers/precacheFsm.go:81 +0x14f github.com/openshift-kni/cluster-group-upgrades-operator/controllers.(*ClusterGroupUpgradeReconciler).reconcilePrecaching(0xc0007398c0, {0x18c06b8, 0xc001131410}, 0xc000517c00) /workspace/controllers/precache.go:43 +0x12e github.com/openshift-kni/cluster-group-upgrades-operator/controllers.(*ClusterGroupUpgradeReconciler).Reconcile(0xc0007398c0, {0x18c06b8, 0xc001131410}, {{{0xc00072a469, 0x7}, {0xc00072a434, 0xc}}}) /workspace/controllers/clustergroupupgrade_controller.go:98 +0x26d sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler(0xc0001e1f40, {0x18c0610, 0xc000adfa80}, {0x1541e40, 0xc0003df9e0}) /go/pkg/mod/sigs.k8s.io/controller-runtime.3-0.20210709165254-650ea59f19cc/pkg/internal/controller/controller.go:298 +0x303 sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem(0xc0001e1f40, {0x18c0610, 0xc000adfa80}) /go/pkg/mod/sigs.k8s.io/controller-runtime.3-0.20210709165254-650ea59f19cc/pkg/internal/controller/controller.go:253 +0x205 sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2() /go/pkg/mod/sigs.k8s.io/controller-runtime.3-0.20210709165254-650ea59f19cc/pkg/internal/controller/controller.go:214 +0x85 created by sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2 /go/pkg/mod/sigs.k8s.io/controller-runtime.3-0.20210709165254-650ea59f19cc/pkg/internal/controller/controller.go:210 +0x354 Version-Release number of selected component (if applicable): 4.10 How reproducible: Always Steps to Reproduce: 1. Apply a CGU with clusterversion policies and precaching enabled. 2. Monitor CGU and TALO logs 3. Actual results: Precaching did not start. TALO pod in CrashLoopBackOff Expected results: Precaching ocp image started on selected spoke cluster Additional info: # CGU: apiVersion: v1 items: - apiVersion: ran.openshift.io/v1alpha1 kind: ClusterGroupUpgrade metadata: annotations: kubectl.kubernetes.io/last-applied-configuration: | {"apiVersion":"ran.openshift.io/v1alpha1","kind":"ClusterGroupUpgrade","metadata":{"annotations":{},"name":"precache-ocp","namespace":"default"},"spec":{"clusters":["helix21-0"],"deleteObjectsOnCompletion":true,"enable":true,"managedPolicies":["du-upgrade-cluster-version-policy1","du-upgrade-cluster-version-policy2"],"preCaching":true,"remediationStrategy":{"maxConcurrency":2,"timeout":240}}} creationTimestamp: "2022-02-24T20:30:20Z" generation: 1 name: precache-ocp namespace: default resourceVersion: "5178101" uid: 9fcdd2a5-a9a6-4686-86c2-b690200ef73d spec: clusters: - helix21-0 enable: true managedPolicies: - du-upgrade-cluster-version-policy1 - du-upgrade-cluster-version-policy2 preCaching: true remediationStrategy: maxConcurrency: 2 timeout: 240 status: computedMaxConcurrency: 1 precaching: spec: {} status: {} kind: List metadata: resourceVersion: "" selfLink: "" # clusterversion PGT can be found here: http://registry.kni-qe-0.lab.eng.rdu2.redhat.com:3000/kni-qe/ztp-site-configs/src/87cd39a0e517f137ecaaf437a785a7d91985b326/policygentemplates/upgrade.yaml
Verified with TALO master.