Skip to content

Commit

Permalink
chore: apply suggestions from code review
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Wilcsinszky <[email protected]>
  • Loading branch information
pepov committed Oct 16, 2023
1 parent e100a7c commit 5676b1b
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions pkg/resources/model/reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,18 +227,15 @@ func NewValidationReconciler(
resources.Logging.Status.Problems = append(resources.Logging.Status.Problems, problem)
}

checkResults := resources.Logging.Status.ConfigCheckResults
if len(checkResults) > 0 {
for hash, r := range checkResults {
if !r {
problem := fmt.Sprintf("Configuration with checksum %s has failed. "+
"Config secrets: `kubectl get secret -n %s -l %s=%s`. "+
"Configcheck pod log: `kubectl logs -n %s -l %s=%s --tail -1`",
hash,
resources.Logging.Spec.ControlNamespace, configcheck.HashLabel, hash,
resources.Logging.Spec.ControlNamespace, configcheck.HashLabel, hash)
resources.Logging.Status.Problems = append(resources.Logging.Status.Problems, problem)
}
for hash, r := range resources.Logging.Status.ConfigCheckResults {
if !r {
problem := fmt.Sprintf("Configuration with checksum %s has failed. "+
"Config secrets: `kubectl get secret -n %s -l %s=%s`. "+
"Configcheck pod log: `kubectl logs -n %s -l %s=%s --tail -1`",
hash,
resources.Logging.Spec.ControlNamespace, configcheck.HashLabel, hash,
resources.Logging.Spec.ControlNamespace, configcheck.HashLabel, hash)
resources.Logging.Status.Problems = append(resources.Logging.Status.Problems, problem)
}
}

Expand Down

0 comments on commit 5676b1b

Please sign in to comment.