cluster-api: Better handle the error case when kubeconfig does not exist

What steps did you take and what happened: If I create only a cluster object cluster-api will error-loop forever when it’s not really an error case. The error happens because during reconcileKubeconfig my infrastructure is all ready to go, we have an API endpoint (the load balancer) and at this point cluster-api expects that if the infrastructure is ready, the k8s-cluster must also be ready. However i’ve only created a Cluster object.

What did you expect to happen: I do not expect an infinite error reconcile pattern during a valid scenario.

I’m assuming creating just a Cluster is a valid scenario.

Anything else you would like to add: If we cannot find the cluster CA as a secret we should not return an error but perhaps issue a warning and maybe a re-reconcile?

E0927 15:40:50.580349       1 controller.go:218] controller-runtime/controller "msg"="Reconciler error" "error"="Secret \"my-cluster-ca\" not found"  "controller"="cluster" "request"={"Namespace":"default","Name":"my-cluster"}

/kind bug /priority longterm-important

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 15 (15 by maintainers)

Most upvoted comments

We should audit all our code paths that return errors and decide if each one is actually worth returning as an error. It’s important to remember that any error we do return is largely invisible to the end user/consumer. The error is logged in the pod’s logs, but it isn’t surfaced to the user unless we record events or update a status field on the resource in question.

/priority important-longterm