Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1969416

Summary: Misleading error message when creating AgentClusterInstall before ClusterDeployment
Product: OpenShift Container Platform Reporter: Daniel Erez <derez>
Component: assisted-installerAssignee: Michael Filanov <mfilanov>
assisted-installer sub component: assisted-service QA Contact: Yuri Obshansky <yobshans>
Status: CLOSED DUPLICATE Docs Contact:
Severity: low    
Priority: low CC: aos-bugs, frolland
Version: 4.8Keywords: Triaged
Target Milestone: ---Flags: frolland: needinfo-
frolland: needinfo-
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: AI-Team-Hive KNI-EDGE-JUKE-4.8
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-06-16 06:55:41 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:

Description Daniel Erez 2021-06-08 12:01:38 UTC
Description of problem:
When creating an AgentClusterInstall CRD before the ClusterDeployment CRD is applied,
the following error is logged: 'level=error msg="failed to get ClusterDeployment...'[*].
Since any creation order should be supported, the message should be more informative.
I.e. maybe reduce the log level to warning, and explain in the message that the ClusterDeployment CRD should be created by the user.


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


How reproducible:
100%

Steps to Reproduce:
1. Apply AgentClusterInstall CRD
2. Apply ClusterDeployment CRD
3.

Actual results:
'level=error msg="failed to get ClusterDeployment...' error message is logged

Expected results:
E.g. change to:
level=warning msg="failed to get ClusterDeployment... the CRD might not been applied yet"

Additional info:

[*]
time="2021-06-08T11:35:25Z" level=info msg="ClusterDeployment Reconcile started" func="github.com/openshift/assisted-service/internal/controller/controllers.(*ClusterDeploymentsReconciler).Reconcile" file="/go/src/github.com/openshift/origin/internal/controller/controllers/clusterdeployments_controller.go:113" cluster_deployment=test-cluster cluster_deployment_namespace=assisted-installer go-id=442 request_id=e9752dbc-8e56-4008-ae25-3b788a9d6145
time="2021-06-08T11:35:25Z" level=error msg="failed to get ClusterDeployment name=test-cluster namespace=assisted-installer" func="github.com/openshift/assisted-service/internal/controller/controllers.(*ClusterDeploymentsReconciler).Reconcile" file="/go/src/github.com/openshift/origin/internal/controller/controllers/clusterdeployments_controller.go:119" cluster_deployment=test-cluster cluster_deployment_namespace=assisted-installer error="ClusterDeployment.hive.openshift.io \"test-cluster\" not found" go-id=442 request_id=e9752dbc-8e56-4008-ae25-3b788a9d6145

Comment 1 Michael Filanov 2021-06-08 12:06:09 UTC
Maybe need to update the synced condtion, @adam what do you think?

Comment 2 Michael Filanov 2021-06-08 15:51:35 UTC
@frolland

Comment 3 Fred Rolland 2021-06-14 05:31:18 UTC
Yes we should update the Sync condition with a good message.
Also move all others to Unknown.

Comment 4 Michael Filanov 2021-06-14 06:00:36 UTC
the description is a bit misleading, in case we have only agent cluster install we will reconcile over it. 
If user creates only agent cluster install with invalid link to cluster deployment then when reconcile is called then we will fail to get cluster deployment and you may see this error, but the error is correct, we failed to get cluster deployment. the error can be improved if we check the error and see if it's not found and not just generic error, using `apierrors.IsNotFound(err)` 

So the only thing to do here is to improve the error logs

Comment 5 Michael Filanov 2021-06-16 06:55:41 UTC

*** This bug has been marked as a duplicate of bug 1969494 ***