Bug 1972690

Summary: [4.8.0] infra-env condition message isn't informative in case of missing pull secret
Product: OpenShift Container Platform Reporter: Michael Filanov <mfilanov>
Component: assisted-installerAssignee: Nir Magnezi <nmagnezi>
assisted-installer sub component: Deployment Operator QA Contact: bjacot
Status: CLOSED ERRATA Docs Contact:
Severity: medium    
Priority: medium CC: alazar, aos-bugs, ercohen, mfilanov, nshidlin
Version: 4.8Keywords: Triaged
Target Milestone: ---   
Target Release: 4.8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: KNI-EDGE-JUKE-4.8 AI-Team-Hive
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1969391 Environment:
Last Closed: 2021-07-27 23:13:09 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1969391    
Bug Blocks:    

Description Michael Filanov 2021-06-16 12:21:14 UTC
+++ This bug was initially created as a clone of Bug #1969391 +++

Description of problem:
Image creation fail in case the operator can't find the pull-secret,
The error message on infra-env isn't indicating what is the problem:
| Failed to create image: record not found

Version-Release number of selected component (if applicable):


How reproducible:

100% 
Steps to Reproduce:

1. Create the following:
BMH
pull-secret
infra-env
agent-cluster-install
cluster-deployment
2. describe infraenv

Actual results:
│ Status:                                                                                                                                                                                                         │
│   Conditions:                                                                                                                                                                                                   │
│     Last Transition Time:  2021-06-08T10:36:12Z                                                                                                                                                                 │
│     Message:               Failed to create image: record not found                                                                                                                                             │
│     Reason:                ImageCreationError                                                                                                                                                                   │
│     Status:                Unknown                                                                                                                                                                              │
│     Type:                  ImageCreated   

service logs:

time="2021-06-08T10:37:28Z" level=error msg="failed to get pull secret" func="github.com/openshift/assisted-service/internal/controller/controllers.(*ClusterDeploymentsReconciler).createNewCluster" file="/go/src/github.com/openshift/origin/internal/controller/controllers/clusterdeployments_controller.go:783" agent_cluster_install=test-agent-cluster-install agent_cluster_install_namespace=assisted-installer-not cluster_deployment=single-node cluster_deployment_namespace=assisted-installer-not error="failed to get pull secret assisted-installer-not/pull-secret: Secret \"pull-secret\" not found" go-id=593 request_id=7ded2ca2-0a3e-4d45-8008-1c87a9184454


Expected results:
A message saying that the image creation failed due to missing pull secret

Additional info:

Comment 3 nshidlin 2021-07-05 11:00:47 UTC
Verified with ACM: 2.3.0-DOWNSTREAM-2021-07-02-22-02-33

oc get agentclusterinstalls.extensions.hive.openshift.io sno-0 -n sno-0 -o json | jq '.status.conditions[0]'
{
  "lastProbeTime": "2021-07-05T10:46:24Z",
  "lastTransitionTime": "2021-07-05T10:46:24Z",
  "message": "The Spec could not be synced due to backend error: failed to get pull secret sno-0/sno-0-pull-secret: Secret \"sno-0-pull-secret\" not found",
  "reason": "BackendError",
  "status": "False",
  "type": "SpecSynced"
}

oc get infraenvs.agent-install.openshift.io sno-0 -n sno-0 -o json | jq '.status.conditions[0]'
{
  "lastTransitionTime": "2021-07-05T10:48:32Z",
  "message": "Failed to create image: cluster does not exist: sno-0, check AgentClusterInstall conditions: name sno-0 in namespace sno-0",
  "reason": "ImageCreationError",
  "status": "Unknown",
  "type": "ImageCreated"
}

Comment 5 errata-xmlrpc 2021-07-27 23:13:09 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