Bug 1969416 - Misleading error message when creating AgentClusterInstall before ClusterDeployment
Summary: Misleading error message when creating AgentClusterInstall before ClusterDepl...
Keywords:
Status: CLOSED DUPLICATE of bug 1969494
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: assisted-installer
Version: 4.8
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ---
: ---
Assignee: Michael Filanov
QA Contact: Yuri Obshansky
URL:
Whiteboard: AI-Team-Hive KNI-EDGE-JUKE-4.8
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-06-08 12:01 UTC by Daniel Erez
Modified: 2021-06-16 06:55 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-06-16 06:55:41 UTC
Target Upstream Version:
Embargoed:
frolland: needinfo-
frolland: needinfo-


Attachments (Terms of Use)

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 ***


Note You need to log in before you can comment on or make changes to this bug.