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

skip reconciliation for awsebscsi template #4438

Closed
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
8 changes: 8 additions & 0 deletions addons/controllers/awsebscsi/awsebscsiconfig_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package controllers

import (
"context"
"fmt"

"github.com/go-logr/logr"
"gopkg.in/yaml.v2"
Expand Down Expand Up @@ -56,6 +57,13 @@ func (r *AwsEbsCSIConfigReconciler) Reconcile(ctx context.Context, req ctrl.Requ
return ctrl.Result{}, err
}

annotations := awsebsCSIConfig.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 awsebsCSIConfig to avoid issues if in the future other controllers where interacting with the same copy
awsebsCSIConfig = awsebsCSIConfig.DeepCopy()
cluster, err := r.getOwnerCluster(ctx, awsebsCSIConfig)
Expand Down