Skip to content

Commit

Permalink
Merge pull request #1845 from kube-logging/fix-configcheck-cleaner
Browse files Browse the repository at this point in the history
fix: configcheck cleaner label selector
  • Loading branch information
pepov authored Nov 8, 2024
2 parents c0ce20f + a65cae8 commit 14b7276
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions pkg/resources/configcheck/configcheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,12 @@ type ConfigCheckCleaner struct {
labels client.MatchingLabels
}

func NewConfigCheckCleaner(c client.Client, component string) *ConfigCheckCleaner {
func NewConfigCheckCleaner(c client.Client, component string, logging string) *ConfigCheckCleaner {
return &ConfigCheckCleaner{
client: c,
labels: client.MatchingLabels{
"app.kubernetes.io/component": component,
"app.kubernetes.io/component": component,
"app.kubernetes.io/managed-by": logging,
},
}
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/resources/fluentd/fluentd.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ func (r *Reconciler) Reconcile(ctx context.Context) (*reconcile.Result, error) {
}

if result, ok := r.Logging.Status.ConfigCheckResults[hash]; ok {
cleaner := configcheck.NewConfigCheckCleaner(r.Client, ComponentConfigCheck)
cleaner := configcheck.NewConfigCheckCleaner(r.Client, ComponentConfigCheck, r.Logging.GetName())

var cleanupErrs error
cleanupErrs = errors.Append(cleanupErrs, cleaner.SecretCleanup(ctx, hash))
Expand Down
2 changes: 1 addition & 1 deletion pkg/resources/syslogng/syslogng.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ func (r *Reconciler) Reconcile(ctx context.Context) (*reconcile.Result, error) {

// Cleanup previous configcheck results
if result, ok := r.Logging.Status.ConfigCheckResults[hash]; ok {
cleaner := configcheck.NewConfigCheckCleaner(r.Client, ComponentConfigCheck)
cleaner := configcheck.NewConfigCheckCleaner(r.Client, ComponentConfigCheck, r.Logging.GetName())

var cleanupErrs error
cleanupErrs = errors.Append(cleanupErrs, cleaner.SecretCleanup(ctx, hash))
Expand Down

0 comments on commit 14b7276

Please sign in to comment.