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
Maybe need to update the synced condtion, @adam what do you think?
@frolland
Yes we should update the Sync condition with a good message. Also move all others to Unknown.
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
*** This bug has been marked as a duplicate of bug 1969494 ***