diff --git a/addons/controllers/cpi/vspherecpiconfig_controller.go b/addons/controllers/cpi/vspherecpiconfig_controller.go index 0b5af32a2a..4eb01b327b 100644 --- a/addons/controllers/cpi/vspherecpiconfig_controller.go +++ b/addons/controllers/cpi/vspherecpiconfig_controller.go @@ -95,6 +95,12 @@ func (r *VSphereCPIConfigReconciler) Reconcile(ctx context.Context, req ctrl.Req return ctrl.Result{}, err } + annotations := cpiConfig.GetAnnotations() + if _, ok := annotations[constants.TKGAnnotationTemplateConfig]; ok { + logger.Info(fmt.Sprintf("resource '%v' is a config template. Skipping reconciling", req.NamespacedName)) + return ctrl.Result{}, nil + } + // deep copy VSphereCPIConfig to avoid issues if in the future other controllers where interacting with the same copy cpiConfig = cpiConfig.DeepCopy()