@@ -24,9 +24,11 @@ import (
2424 "github.com/cisco-open/operator-tools/pkg/secret"
2525 "github.com/cisco-open/operator-tools/pkg/utils"
2626 "github.com/go-logr/logr"
27+ "golang.org/x/exp/slices"
2728 "sigs.k8s.io/controller-runtime/pkg/client"
2829 "sigs.k8s.io/controller-runtime/pkg/reconcile"
2930
31+ "github.com/kube-logging/logging-operator/pkg/resources/configcheck"
3032 loggingv1beta1 "github.com/kube-logging/logging-operator/pkg/sdk/logging/api/v1beta1"
3133
3234 "github.com/kube-logging/logging-operator/pkg/mirror"
@@ -225,6 +227,18 @@ func NewValidationReconciler(
225227 resources .Logging .Status .Problems = append (resources .Logging .Status .Problems , problem )
226228 }
227229
230+ for hash , r := range resources .Logging .Status .ConfigCheckResults {
231+ if ! r {
232+ problem := fmt .Sprintf ("Configuration with checksum %s has failed. " +
233+ "Config secrets: `kubectl get secret -n %s -l %s=%s`. " +
234+ "Configcheck pod log: `kubectl logs -n %s -l %s=%s --tail -1`" ,
235+ hash ,
236+ resources .Logging .Spec .ControlNamespace , configcheck .HashLabel , hash ,
237+ resources .Logging .Spec .ControlNamespace , configcheck .HashLabel , hash )
238+ resources .Logging .Status .Problems = append (resources .Logging .Status .Problems , problem )
239+ }
240+ }
241+
228242 if len (resources .Logging .Spec .NodeAgents ) > 0 || len (resources .NodeAgents ) > 0 {
229243 // load agents from standalone NodeAgent resources and additionally with inline nodeAgents from the logging resource
230244 // for compatibility reasons
@@ -243,6 +257,7 @@ func NewValidationReconciler(
243257 }
244258 }
245259 }
260+ slices .Sort (resources .Logging .Status .Problems )
246261 resources .Logging .Status .ProblemsCount = len (resources .Logging .Status .Problems )
247262
248263 var errs error
0 commit comments