Skip to content
This repository has been archived by the owner on Oct 10, 2023. It is now read-only.

cluster_bootstrap: Short requeue if CRD not found on remote cluster #3713

Merged
merged 1 commit into from
Oct 25, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions addons/controllers/clusterbootstrap_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
corev1 "k8s.io/api/core/v1"
rbacv1 "k8s.io/api/rbac/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/api/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime"
Expand Down Expand Up @@ -251,6 +252,11 @@ func (r *ClusterBootstrapReconciler) createOrPatchResourcesForCorePackages(clust
// packages, we return error and let the reconciler retry again.
log.Error(err, fmt.Sprintf("unable to create or patch all the required resources for %s on cluster: %s/%s",
corePackage.RefName, cluster.Namespace, cluster.Name))
if meta.IsNoMatchError(err) {
// If the remote cluster does not have the required CRDs, we will requeue the request to try again in 10s.
log.Error(err, "reconciler error - required CRDs are not yet installed, requeing request in 10s")
return ctrl.Result{RequeueAfter: constants.RequeueAfterDuration}, nil
}
return ctrl.Result{}, err
}
// set watches on provider objects in core packages if not already set
Expand Down