Bug 1961536

Summary: clusterdeployment without pull secret is crashing assisted service pod
Product: OpenShift Container Platform Reporter: Tomas Jelinek <tjelinek>
Component: assisted-installerAssignee: Michael Filanov <mfilanov>
assisted-installer sub component: assisted-service QA Contact: Yuri Obshansky <yobshans>
Status: CLOSED ERRATA Docs Contact:
Severity: high    
Priority: high CC: aos-bugs, nshidlin
Version: 4.8   
Target Milestone: ---   
Target Release: 4.8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: AI-Team-Hive
Fixed In Version: OCP-Metal-v1.0.21.1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-07-27 23:08:55 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
full logs none

Description Tomas Jelinek 2021-05-18 08:22:16 UTC
Description of problem:
Have a cluster deployment which does not have 
pullSecretRef:
    name: <secret>

in it's spec.

After this, the assisted service fails with:
E0518 08:03:53.608207       1 runtime.go:78] Observed a panic: "invalid memory address or nil pointer dereference" (runtime error: invalid memory address or nil pointer dereference)
goroutine 1066 [running]:
k8s.io/apimachinery/pkg/util/runtime.logPanic(0x2256e40, 0x3acafe0)
	/go/pkg/mod/k8s.io/apimachinery.5/pkg/util/runtime/runtime.go:74 +0x95
k8s.io/apimachinery/pkg/util/runtime.HandleCrash(0x0, 0x0, 0x0)
	/go/pkg/mod/k8s.io/apimachinery.5/pkg/util/runtime/runtime.go:48 +0x89
panic(0x2256e40, 0x3acafe0)
	/usr/local/go/src/runtime/panic.go:969 +0x1b9
github.com/openshift/assisted-service/internal/controller/controllers.(*ClusterDeploymentsReconciler).createNewCluster(0xc0018d4080, 0x2a1fa20, 0xc0016f5b00, 0xc001f26420, 0x12, 0xc001f1a584, 0x5, 0xc0029cf200, 0xc0013f5680, 0x0, ...)
	/go/src/github.com/openshift/origin/internal/controller/controllers/clusterdeployments_controller.go:575 +0x1ce

and ends up in a crashloop.

version:
      imageID: >-
        quay.io/ocpmetal/assisted-service@sha256:e05f3155dc7fde8973cb186523ece93a7af40a257fef23f19769ac2d01748134
      image: 'quay.io/ocpmetal/assisted-service:latest'

Comment 1 Tomas Jelinek 2021-05-18 08:23:05 UTC
Created attachment 1784363 [details]
full logs

Comment 2 Michael Filanov 2021-05-18 16:27:20 UTC
https://github.com/openshift/assisted-service/pull/1755

Comment 4 nshidlin 2021-06-17 18:12:43 UTC
Verified on: 2.3.0-DOWNSTREAM-2021-06-17-01-26-58

time="2021-06-17T18:06:12Z" level=info msg="Creating a new cluster sno-0-cluster-deployment rhacm" func="github.com/openshift/assisted-service/internal/controller/controller
s.(*ClusterDeploymentsReconciler).createNewCluster" file="/remote-source/app/internal/controller/controllers/clusterdeployments_controller.go:771" agent_cluster_install=sno-
0-agent-cluster-install agent_cluster_install_namespace=rhacm cluster_deployment=sno-0-cluster-deployment cluster_deployment_namespace=rhacm go-id=1176 request_id=cae63f2c-8
c0b-41cf-84db-69b124da2e73                                                                                                                                                   
time="2021-06-17T18:06:12Z" level=error msg="failed to get pull secret" func="github.com/openshift/assisted-service/internal/controller/controllers.(*ClusterDeploymentsRecon
ciler).createNewCluster" file="/remote-source/app/internal/controller/controllers/clusterdeployments_controller.go:776" agent_cluster_install=sno-0-agent-cluster-install age
nt_cluster_install_namespace=rhacm cluster_deployment=sno-0-cluster-deployment cluster_deployment_namespace=rhacm error="Missing reference to pull secret" go-id=1176 request
_id=cae63f2c-8c0b-41cf-84db-69b124da2e73

Comment 6 errata-xmlrpc 2021-07-27 23:08:55 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: OpenShift Container Platform 4.8.2 bug fix and security update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2021:2438