@@ -24,10 +24,6 @@ import (
24
24
"github.com/cisco-open/operator-tools/pkg/secret"
25
25
"github.com/cisco-open/operator-tools/pkg/utils"
26
26
"github.com/go-logr/logr"
27
- "github.com/kube-logging/logging-operator/pkg/resources"
28
- "github.com/kube-logging/logging-operator/pkg/resources/configcheck"
29
- "github.com/kube-logging/logging-operator/pkg/resources/kubetool"
30
- "github.com/kube-logging/logging-operator/pkg/sdk/logging/api/v1beta1"
31
27
appsv1 "k8s.io/api/apps/v1"
32
28
batchv1 "k8s.io/api/batch/v1"
33
29
corev1 "k8s.io/api/core/v1"
@@ -39,6 +35,11 @@ import (
39
35
"sigs.k8s.io/controller-runtime/pkg/builder"
40
36
"sigs.k8s.io/controller-runtime/pkg/client"
41
37
"sigs.k8s.io/controller-runtime/pkg/reconcile"
38
+
39
+ "github.com/kube-logging/logging-operator/pkg/resources"
40
+ "github.com/kube-logging/logging-operator/pkg/resources/configcheck"
41
+ "github.com/kube-logging/logging-operator/pkg/resources/kubetool"
42
+ "github.com/kube-logging/logging-operator/pkg/sdk/logging/api/v1beta1"
42
43
)
43
44
44
45
const (
@@ -132,6 +133,12 @@ func (r *Reconciler) Reconcile() (*reconcile.Result, error) {
132
133
if err != nil {
133
134
return nil , err
134
135
}
136
+
137
+ // Fail when the current config is invalid
138
+ if result , ok := r .Logging .Status .ConfigCheckResults [hash ]; ok && ! result {
139
+ return nil , errors .Errorf ("current config is invalid" )
140
+ }
141
+
135
142
if result , ok := r .Logging .Status .ConfigCheckResults [hash ]; ok {
136
143
cleaner := configcheck .NewConfigCheckCleaner (r .Client , ComponentConfigCheck )
137
144
0 commit comments