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

Skip reconcile for csi config template #4436

Closed
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/csi/vspherecsiconfig_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,12 @@ func (r *VSphereCSIConfigReconciler) Reconcile(ctx context.Context, req ctrl.Req
return ctrl.Result{}, err
}

annotations := vcsiConfig.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 VSphereCSIConfig to avoid issues if in the future other controllers where interacting with the same copy
vcsiConfig = vcsiConfig.DeepCopy()

Expand Down