@@ -21,6 +21,7 @@ import (
21
21
22
22
"emperror.dev/errors"
23
23
"github.com/cisco-open/operator-tools/pkg/reconciler"
24
+ "github.com/cisco-open/operator-tools/pkg/utils"
24
25
"github.com/spf13/cast"
25
26
corev1 "k8s.io/api/core/v1"
26
27
apierrors "k8s.io/apimachinery/pkg/api/errors"
@@ -49,9 +50,11 @@ func (r *Reconciler) appConfigSecret() (runtime.Object, reconciler.DesiredState,
49
50
} else {
50
51
data [AppConfigKey ] = []byte (* r .config )
51
52
}
53
+ meta := r .FluentdObjectMeta (AppSecretConfigName , ComponentFluentd )
54
+ meta .Labels = utils .MergeLabels (meta .Labels , map [string ]string {"logging.banzaicloud.io/watch" : "enabled" })
52
55
53
56
return & corev1.Secret {
54
- ObjectMeta : r . FluentdObjectMeta ( AppSecretConfigName , ComponentFluentd ) ,
57
+ ObjectMeta : meta ,
55
58
Data : data ,
56
59
}, reconciler .StatePresent , nil
57
60
}
@@ -214,8 +217,11 @@ func (r *Reconciler) newCheckSecret(hashKey string, fluentdSpec v1beta1.FluentdS
214
217
data [ConfigCheckKey ] = []byte (* r .config )
215
218
}
216
219
data ["fluent.conf" ] = []byte (fluentdConfigCheckTemplate )
220
+ meta := r .FluentdObjectMeta (fmt .Sprintf ("fluentd-configcheck-%s" , hashKey ), ComponentConfigCheck )
221
+ meta .Labels = utils .MergeLabels (meta .Labels , map [string ]string {"logging.banzaicloud.io/watch" : "enabled" })
222
+
217
223
return & corev1.Secret {
218
- ObjectMeta : r . FluentdObjectMeta ( fmt . Sprintf ( "fluentd-configcheck-%s" , hashKey ), ComponentConfigCheck ) ,
224
+ ObjectMeta : meta ,
219
225
Data : data ,
220
226
}, nil
221
227
}
@@ -229,8 +235,11 @@ func (r *Reconciler) newCheckSecretAppConfig(hashKey string, fluentdSpec v1beta1
229
235
} else {
230
236
data [ConfigCheckKey ] = []byte (* r .config )
231
237
}
238
+ meta := r .FluentdObjectMeta (fmt .Sprintf ("fluentd-configcheck-app-%s" , hashKey ), ComponentConfigCheck )
239
+ meta .Labels = utils .MergeLabels (meta .Labels , map [string ]string {"logging.banzaicloud.io/watch" : "enabled" })
240
+
232
241
return & corev1.Secret {
233
- ObjectMeta : r . FluentdObjectMeta ( fmt . Sprintf ( "fluentd-configcheck-app-%s" , hashKey ), ComponentConfigCheck ) ,
242
+ ObjectMeta : meta ,
234
243
Data : data ,
235
244
}, nil
236
245
}
@@ -242,6 +251,10 @@ func (r *Reconciler) newCheckOutputSecret(hashKey string) (*corev1.Secret, error
242
251
}
243
252
if secret , ok := obj .(* corev1.Secret ); ok {
244
253
secret .ObjectMeta = r .FluentdObjectMeta (fmt .Sprintf ("fluentd-configcheck-output-%s" , hashKey ), ComponentConfigCheck )
254
+ secret .ObjectMeta .Labels = utils .MergeLabels (
255
+ secret .ObjectMeta .Labels ,
256
+ map [string ]string {"logging.banzaicloud.io/watch" : "enabled" },
257
+ )
245
258
return secret , nil
246
259
}
247
260
return nil , errors .New ("output secret is invalid, unable to create output secret for config check" )
0 commit comments