Skip to content

Commit

Permalink
Fix log spam from spoke_token_controller
Browse files Browse the repository at this point in the history
Signed-off-by: Manuel Grandeit <m.grandeit@gmail.com>
  • Loading branch information
grandeit committed Oct 30, 2024
1 parent dfcbf0c commit 11349be
Showing 1 changed file with 3 additions and 18 deletions.
21 changes: 3 additions & 18 deletions pkg/controller/spoketoken/spoke_token_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -435,12 +435,7 @@ var applicationManagerSecretPredicateFunctions = predicate.Funcs{
return false
}

if newSecret.Namespace != appAddonNS {
klog.Infof("secret namespace not matched, appAddonNS= %v", appAddonNS)
return false
}

if newSecret.Type == "kubernetes.io/service-account-token" &&
if strings.EqualFold(newSecret.Namespace, appAddonNS) && newSecret.Type == "kubernetes.io/service-account-token" &&
newSecret.GetAnnotations()["kubernetes.io/service-account.name"] == appAddonName {
klog.Infof("secret updated: %v/%v", appAddonNS, appAddonName)

Expand All @@ -455,12 +450,7 @@ var applicationManagerSecretPredicateFunctions = predicate.Funcs{
return false
}

if newSecret.Namespace != appAddonNS {
klog.Infof("secret namespace not matched, appAddonNS= %v", appAddonNS)
return false
}

if newSecret.Type == "kubernetes.io/service-account-token" &&
if strings.EqualFold(newSecret.Namespace, appAddonNS) && newSecret.Type == "kubernetes.io/service-account-token" &&
newSecret.GetAnnotations()["kubernetes.io/service-account.name"] == appAddonName {
klog.Infof("secret created: %v/%v", appAddonNS, appAddonName)

Expand All @@ -475,12 +465,7 @@ var applicationManagerSecretPredicateFunctions = predicate.Funcs{
return false
}

if newSecret.Namespace != appAddonNS {
klog.Infof("secret namespace not matched, appAddonNS= %v", appAddonNS)
return false
}

if newSecret.Type == "kubernetes.io/service-account-token" &&
if strings.EqualFold(newSecret.Namespace, appAddonNS) && newSecret.Type == "kubernetes.io/service-account-token" &&
newSecret.GetAnnotations()["kubernetes.io/service-account.name"] == appAddonName {
klog.Infof("secret deleted: %v/%v", appAddonNS, appAddonName)

Expand Down

0 comments on commit 11349be

Please sign in to comment.