Bug 1969391

Summary: [master] infra-env condition message isn't informative in case of missing pull secret
Product: OpenShift Container Platform Reporter: Eran Cohen <ercohen>
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: aos-bugs, mfilanov
Version: 4.8Keywords: Triaged
Target Milestone: ---   
Target Release: 4.9.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:
: 1972690 (view as bug list) Environment:
Last Closed: 2021-10-18 17:33:16 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:
Bug Depends On:    
Bug Blocks: 1972690    

Description Eran Cohen 2021-06-08 10:46:22 UTC
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 1 Nir Magnezi 2021-06-27 13:14:25 UTC
This seems to be handled by https://github.com/openshift/assisted-service/pull/2027

Creating all resources and inspecting:

1. infraEnv conditions:

  conditions:
  - lastTransitionTime: "2021-06-27T12:21:30Z"
    message: 'Failed to create image: cluster does not exist: single-node, check AgentClusterInstall
      conditions: &{Group:extensions.hive.openshift.io Version:v1beta1 Kind:AgentClusterInstall
      Name:test-agent-cluster-install}'
    reason: ImageCreationError
    status: Unknown
    type: ImageCreated

2. agentClusterInstall conditions:

    conditions:
    - lastProbeTime: "2021-06-27T12:20:53Z"
      lastTransitionTime: "2021-06-27T12:20:53Z"
      message: 'The Spec could not be synced due to backend error: failed to get pull
        secret assisted-installer/pull-secret: Secret "pull-secret" not found'


However, I did notice a minor formatting issue with InfraEnv, as shown above. Fixed it here: https://github.com/openshift/assisted-service/pull/2109

Both https://github.com/openshift/assisted-service/pull/2027 and https://github.com/openshift/assisted-service/pull/2109 will get backported to ocm-2.3

Comment 6 errata-xmlrpc 2021-10-18 17:33:16 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.9.0 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:3759