Skip to content

Commit bccefb1

Browse files
author
Piotr Andrzejewski
committedJan 19, 2024
[#582] Allow to use auto annotation with specific resource type (configmap or secret)
1 parent 6ccf555 commit bccefb1

File tree

8 files changed

+410
-135
lines changed

8 files changed

+410
-135
lines changed
 

Diff for: ‎README.md

+8-2
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ spec:
4949
5050
This will discover deploymentconfigs/deployments/daemonsets/statefulset/rollouts automatically where `foo-configmap` or `foo-secret` is being used either via environment variable or from volume mount. And it will perform rolling upgrade on related pods when `foo-configmap` or `foo-secret`are updated.
5151

52-
You can restrict this discovery to only `ConfigMap` or `Secret` objects that
52+
You can filter it by the type of monitored resource and use typed versions of `auto` annotation. If you want to discover changes only in mounted `Secret`s and ignore changes in `ConfigMap`s, add `secret.reloader.stakater.com/auto` annotation instead. Analogously, you can use `configmap.reloader.stakater.com/auto` annotation to look for changes in mounted `ConfigMap`, changes in any of mounted `Secret`s will not trigger a rolling upgrade on related pods.
53+
54+
You can also restrict this discovery to only `ConfigMap` or `Secret` objects that
5355
are tagged with a special annotation. To take advantage of that, annotate
5456
your deploymentconfigs/deployments/daemonsets/statefulset/rollouts like this:
5557

@@ -84,11 +86,13 @@ will always restart upon a change in configmaps or secrets it uses, regardless
8486
of whether they have the `reloader.stakater.com/match: "true"` annotation or
8587
not.
8688

89+
Similarly, `reloader.stakater.com/auto` and its typed version (`secret.reloader.stakater.com/auto` or `configmap.reloader.stakater.com/auto`) do not work together. If you have both annotations in your deployment, then only one of them needs to be true to trigger the restart. For example, having both `reloader.stakater.com/auto: "true"` and `secret.reloader.stakater.com/auto: "false"` or both `reloader.stakater.com/auto: "false"` and `secret.reloader.stakater.com/auto: "true"` will restart upon a change in a secret it uses.
90+
8791
We can also specify a specific configmap or secret which would trigger rolling upgrade only upon change in our specified configmap or secret, this way, it will not trigger rolling upgrade upon changes in all configmaps or secrets used in a `deploymentconfig`, `deployment`, `daemonset`, `statefulset` or `rollout`.
8892
To do this either set the auto annotation to `"false"` (`reloader.stakater.com/auto: "false"`) or remove it altogether, and use annotations for [Configmap](.#Configmap) or [Secret](.#Secret).
8993
9094
It's also possible to enable auto reloading for all resources, by setting the `--auto-reload-all` flag.
91-
In this case, all resources that do not have the auto annotation set to `"false"`, will be reloaded automatically when their ConfigMaps or Secrets are updated.
95+
In this case, all resources that do not have the auto annotation (or its typed version) set to `"false"`, will be reloaded automatically when their ConfigMaps or Secrets are updated.
9296
Notice that setting the auto annotation to an undefined value counts as false as-well.
9397

9498
### Configmap
@@ -154,6 +158,8 @@ spec:
154158
- `reloader.stakater.com/auto: "true"` will only reload the pod, if the configmap or secret is used (as a volume mount or as an env) in `DeploymentConfigs/Deployment/Daemonsets/Statefulsets`
155159
- `secret.reloader.stakater.com/reload` or `configmap.reloader.stakater.com/reload` annotation will reload the pod upon changes in specified configmap or secret, irrespective of the usage of configmap or secret.
156160
- you may override the auto annotation with the `--auto-annotation` flag
161+
- you may override the secret typed auto annotation with the `--secret-auto-annotation` flag
162+
- you may override the configmap typed auto annotation with the `--configmap-auto-annotation` flag
157163
- you may override the search annotation with the `--auto-search-annotation` flag
158164
and the match annotation with the `--search-match-annotation` flag
159165
- you may override the configmap annotation with the `--configmap-annotation` flag

Diff for: ‎deployments/kubernetes/chart/reloader/templates/deployment.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,14 @@ spec:
204204
- "--auto-annotation"
205205
- "{{ .Values.reloader.custom_annotations.auto }}"
206206
{{- end }}
207+
{{- if .Values.reloader.custom_annotations.secret_auto }}
208+
- "--secret-auto-annotation"
209+
- "{{ .Values.reloader.custom_annotations.secret_auto }}"
210+
{{- end }}
211+
{{- if .Values.reloader.custom_annotations.configmap_auto }}
212+
- "--configmap-auto-annotation"
213+
- "{{ .Values.reloader.custom_annotations.configmap_auto }}"
214+
{{- end }}
207215
{{- if .Values.reloader.custom_annotations.search }}
208216
- "--auto-search-annotation"
209217
- "{{ .Values.reloader.custom_annotations.search }}"

Diff for: ‎internal/pkg/cmd/reloader.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ func NewReloaderCommand() *cobra.Command {
3535
cmd.PersistentFlags().BoolVar(&options.AutoReloadAll, "auto-reload-all", false, "Auto reload all resources")
3636
cmd.PersistentFlags().StringVar(&options.ConfigmapUpdateOnChangeAnnotation, "configmap-annotation", "configmap.reloader.stakater.com/reload", "annotation to detect changes in configmaps, specified by name")
3737
cmd.PersistentFlags().StringVar(&options.SecretUpdateOnChangeAnnotation, "secret-annotation", "secret.reloader.stakater.com/reload", "annotation to detect changes in secrets, specified by name")
38-
cmd.PersistentFlags().StringVar(&options.ReloaderAutoAnnotation, "auto-annotation", "reloader.stakater.com/auto", "annotation to detect changes in secrets")
38+
cmd.PersistentFlags().StringVar(&options.ReloaderAutoAnnotation, "auto-annotation", "reloader.stakater.com/auto", "annotation to detect changes in secrets/configmaps")
39+
cmd.PersistentFlags().StringVar(&options.ConfigmapReloaderAutoAnnotation, "configmap-auto-annotation", "configmap.reloader.stakater.com/auto", "annotation to detect changes in configmaps")
40+
cmd.PersistentFlags().StringVar(&options.SecretReloaderAutoAnnotation, "secret-auto-annotation", "secret.reloader.stakater.com/auto", "annotation to detect changes in secrets")
3941
cmd.PersistentFlags().StringVar(&options.AutoSearchAnnotation, "auto-search-annotation", "reloader.stakater.com/search", "annotation to detect changes in configmaps or secrets tagged with special match annotation")
4042
cmd.PersistentFlags().StringVar(&options.SearchMatchAnnotation, "search-match-annotation", "reloader.stakater.com/match", "annotation to mark secrets or configmaps to match the search")
4143
cmd.PersistentFlags().StringVar(&options.LogFormat, "log-format", "", "Log format to use (empty string for text, or JSON")

Diff for: ‎internal/pkg/handler/upgrade.go

+5-2
Original file line numberDiff line numberDiff line change
@@ -197,15 +197,18 @@ func PerformRollingUpgrade(clients kube.Clients, config util.Config, upgradeFunc
197197
annotationValue, found := annotations[config.Annotation]
198198
searchAnnotationValue, foundSearchAnn := annotations[options.AutoSearchAnnotation]
199199
reloaderEnabledValue, foundAuto := annotations[options.ReloaderAutoAnnotation]
200-
if !found && !foundAuto && !foundSearchAnn {
200+
typedAutoAnnotationEnabledValue, foundTypedAuto := annotations[config.TypedAutoAnnotation]
201+
if !found && !foundAuto && !foundTypedAuto && !foundSearchAnn {
201202
annotations = upgradeFuncs.PodAnnotationsFunc(i)
202203
annotationValue = annotations[config.Annotation]
203204
searchAnnotationValue = annotations[options.AutoSearchAnnotation]
204205
reloaderEnabledValue = annotations[options.ReloaderAutoAnnotation]
206+
typedAutoAnnotationEnabledValue = annotations[config.TypedAutoAnnotation]
205207
}
206208
result := constants.NotUpdated
207209
reloaderEnabled, _ := strconv.ParseBool(reloaderEnabledValue)
208-
if reloaderEnabled || reloaderEnabledValue == "" && options.AutoReloadAll {
210+
typedAutoAnnotationEnabled, _ := strconv.ParseBool(typedAutoAnnotationEnabledValue)
211+
if reloaderEnabled || typedAutoAnnotationEnabled || reloaderEnabledValue == "" && typedAutoAnnotationEnabledValue == "" && options.AutoReloadAll {
209212
result = invokeReloadStrategy(upgradeFuncs, i, config, true)
210213
}
211214

Diff for: ‎internal/pkg/handler/upgrade_test.go

+307-106
Large diffs are not rendered by default.

Diff for: ‎internal/pkg/options/flags.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,12 @@ var (
1111
// SecretUpdateOnChangeAnnotation is an annotation to detect changes in
1212
// secrets specified by name
1313
SecretUpdateOnChangeAnnotation = "secret.reloader.stakater.com/reload"
14-
// ReloaderAutoAnnotation is an annotation to detect changes in secrets
14+
// ReloaderAutoAnnotation is an annotation to detect changes in secrets/configmaps
1515
ReloaderAutoAnnotation = "reloader.stakater.com/auto"
16+
// ConfigmapReloaderAutoAnnotation is an annotation to detect changes in configmaps
17+
ConfigmapReloaderAutoAnnotation = "configmap.reloader.stakater.com/auto"
18+
// SecretReloaderAutoAnnotation is an annotation to detect changes in secrets
19+
SecretReloaderAutoAnnotation = "secret.reloader.stakater.com/auto"
1620
// AutoSearchAnnotation is an annotation to detect changes in
1721
// configmaps or triggers with the SearchMatchAnnotation
1822
AutoSearchAnnotation = "reloader.stakater.com/search"

Diff for: ‎internal/pkg/testutil/kube.go

+71-23
Original file line numberDiff line numberDiff line change
@@ -69,24 +69,34 @@ func DeleteNamespace(namespace string, client kubernetes.Interface) {
6969
}
7070
}
7171

72-
func getObjectMeta(namespace string, name string, autoReload bool) metav1.ObjectMeta {
72+
func getObjectMeta(namespace string, name string, autoReload bool, secretAutoReload bool, configmapAutoReload bool) metav1.ObjectMeta {
7373
return metav1.ObjectMeta{
7474
Name: name,
7575
Namespace: namespace,
7676
Labels: map[string]string{"firstLabel": "temp"},
77-
Annotations: getAnnotations(name, autoReload),
77+
Annotations: getAnnotations(name, autoReload, secretAutoReload, configmapAutoReload),
7878
}
7979
}
8080

81-
func getAnnotations(name string, autoReload bool) map[string]string {
81+
func getAnnotations(name string, autoReload bool, secretAutoReload bool, configmapAutoReload bool) map[string]string {
82+
annotations := make(map[string]string)
8283
if autoReload {
83-
return map[string]string{
84-
options.ReloaderAutoAnnotation: "true"}
84+
annotations[options.ReloaderAutoAnnotation] = "true"
85+
}
86+
if secretAutoReload {
87+
annotations[options.SecretReloaderAutoAnnotation] = "true"
88+
}
89+
if configmapAutoReload {
90+
annotations[options.ConfigmapReloaderAutoAnnotation] = "true"
8591
}
8692

87-
return map[string]string{
88-
options.ConfigmapUpdateOnChangeAnnotation: name,
89-
options.SecretUpdateOnChangeAnnotation: name}
93+
if len(annotations) > 0 {
94+
return annotations
95+
} else {
96+
return map[string]string{
97+
options.ConfigmapUpdateOnChangeAnnotation: name,
98+
options.SecretUpdateOnChangeAnnotation: name}
99+
}
90100
}
91101

92102
func getEnvVarSources(name string) []v1.EnvFromSource {
@@ -332,7 +342,7 @@ func getPodTemplateSpecWithInitContainerAndEnv(name string) v1.PodTemplateSpec {
332342
func GetDeployment(namespace string, deploymentName string) *appsv1.Deployment {
333343
replicaset := int32(1)
334344
return &appsv1.Deployment{
335-
ObjectMeta: getObjectMeta(namespace, deploymentName, false),
345+
ObjectMeta: getObjectMeta(namespace, deploymentName, false, false, false),
336346
Spec: appsv1.DeploymentSpec{
337347
Selector: &metav1.LabelSelector{
338348
MatchLabels: map[string]string{"secondLabel": "temp"},
@@ -351,7 +361,7 @@ func GetDeploymentConfig(namespace string, deploymentConfigName string) *openshi
351361
replicaset := int32(1)
352362
podTemplateSpecWithVolume := getPodTemplateSpecWithVolumes(deploymentConfigName)
353363
return &openshiftv1.DeploymentConfig{
354-
ObjectMeta: getObjectMeta(namespace, deploymentConfigName, false),
364+
ObjectMeta: getObjectMeta(namespace, deploymentConfigName, false, false, false),
355365
Spec: openshiftv1.DeploymentConfigSpec{
356366
Replicas: replicaset,
357367
Strategy: openshiftv1.DeploymentStrategy{
@@ -366,7 +376,7 @@ func GetDeploymentConfig(namespace string, deploymentConfigName string) *openshi
366376
func GetDeploymentWithInitContainer(namespace string, deploymentName string) *appsv1.Deployment {
367377
replicaset := int32(1)
368378
return &appsv1.Deployment{
369-
ObjectMeta: getObjectMeta(namespace, deploymentName, false),
379+
ObjectMeta: getObjectMeta(namespace, deploymentName, false, false, false),
370380
Spec: appsv1.DeploymentSpec{
371381
Selector: &metav1.LabelSelector{
372382
MatchLabels: map[string]string{"secondLabel": "temp"},
@@ -384,7 +394,7 @@ func GetDeploymentWithInitContainer(namespace string, deploymentName string) *ap
384394
func GetDeploymentWithInitContainerAndEnv(namespace string, deploymentName string) *appsv1.Deployment {
385395
replicaset := int32(1)
386396
return &appsv1.Deployment{
387-
ObjectMeta: getObjectMeta(namespace, deploymentName, true),
397+
ObjectMeta: getObjectMeta(namespace, deploymentName, true, false, false),
388398
Spec: appsv1.DeploymentSpec{
389399
Selector: &metav1.LabelSelector{
390400
MatchLabels: map[string]string{"secondLabel": "temp"},
@@ -401,7 +411,7 @@ func GetDeploymentWithInitContainerAndEnv(namespace string, deploymentName strin
401411
func GetDeploymentWithEnvVars(namespace string, deploymentName string) *appsv1.Deployment {
402412
replicaset := int32(1)
403413
return &appsv1.Deployment{
404-
ObjectMeta: getObjectMeta(namespace, deploymentName, true),
414+
ObjectMeta: getObjectMeta(namespace, deploymentName, true, false, false),
405415
Spec: appsv1.DeploymentSpec{
406416
Selector: &metav1.LabelSelector{
407417
MatchLabels: map[string]string{"secondLabel": "temp"},
@@ -419,7 +429,7 @@ func GetDeploymentConfigWithEnvVars(namespace string, deploymentConfigName strin
419429
replicaset := int32(1)
420430
podTemplateSpecWithEnvVars := getPodTemplateSpecWithEnvVars(deploymentConfigName)
421431
return &openshiftv1.DeploymentConfig{
422-
ObjectMeta: getObjectMeta(namespace, deploymentConfigName, false),
432+
ObjectMeta: getObjectMeta(namespace, deploymentConfigName, false, false, false),
423433
Spec: openshiftv1.DeploymentConfigSpec{
424434
Replicas: replicaset,
425435
Strategy: openshiftv1.DeploymentStrategy{
@@ -433,7 +443,7 @@ func GetDeploymentConfigWithEnvVars(namespace string, deploymentConfigName strin
433443
func GetDeploymentWithEnvVarSources(namespace string, deploymentName string) *appsv1.Deployment {
434444
replicaset := int32(1)
435445
return &appsv1.Deployment{
436-
ObjectMeta: getObjectMeta(namespace, deploymentName, true),
446+
ObjectMeta: getObjectMeta(namespace, deploymentName, true, false, false),
437447
Spec: appsv1.DeploymentSpec{
438448
Selector: &metav1.LabelSelector{
439449
MatchLabels: map[string]string{"secondLabel": "temp"},
@@ -450,7 +460,7 @@ func GetDeploymentWithEnvVarSources(namespace string, deploymentName string) *ap
450460
func GetDeploymentWithPodAnnotations(namespace string, deploymentName string, both bool) *appsv1.Deployment {
451461
replicaset := int32(1)
452462
deployment := &appsv1.Deployment{
453-
ObjectMeta: getObjectMeta(namespace, deploymentName, false),
463+
ObjectMeta: getObjectMeta(namespace, deploymentName, false, false, false),
454464
Spec: appsv1.DeploymentSpec{
455465
Selector: &metav1.LabelSelector{
456466
MatchLabels: map[string]string{"secondLabel": "temp"},
@@ -465,14 +475,38 @@ func GetDeploymentWithPodAnnotations(namespace string, deploymentName string, bo
465475
if !both {
466476
deployment.ObjectMeta.Annotations = nil
467477
}
468-
deployment.Spec.Template.ObjectMeta.Annotations = getAnnotations(deploymentName, true)
478+
deployment.Spec.Template.ObjectMeta.Annotations = getAnnotations(deploymentName, true, false, false)
469479
return deployment
470480
}
471481

482+
func GetDeploymentWithTypedAutoAnnotation(namespace string, deploymentName string, resourceType string) *appsv1.Deployment {
483+
replicaset := int32(1)
484+
var objectMeta metav1.ObjectMeta
485+
if resourceType == SecretResourceType {
486+
objectMeta = getObjectMeta(namespace, deploymentName, false, true, false)
487+
} else if resourceType == ConfigmapResourceType {
488+
objectMeta = getObjectMeta(namespace, deploymentName, false, false, true)
489+
}
490+
491+
return &appsv1.Deployment{
492+
ObjectMeta: objectMeta,
493+
Spec: appsv1.DeploymentSpec{
494+
Selector: &metav1.LabelSelector{
495+
MatchLabels: map[string]string{"secondLabel": "temp"},
496+
},
497+
Replicas: &replicaset,
498+
Strategy: appsv1.DeploymentStrategy{
499+
Type: appsv1.RollingUpdateDeploymentStrategyType,
500+
},
501+
Template: getPodTemplateSpecWithVolumes(deploymentName),
502+
},
503+
}
504+
}
505+
472506
// GetDaemonSet provides daemonset for testing
473507
func GetDaemonSet(namespace string, daemonsetName string) *appsv1.DaemonSet {
474508
return &appsv1.DaemonSet{
475-
ObjectMeta: getObjectMeta(namespace, daemonsetName, false),
509+
ObjectMeta: getObjectMeta(namespace, daemonsetName, false, false, false),
476510
Spec: appsv1.DaemonSetSpec{
477511
Selector: &metav1.LabelSelector{
478512
MatchLabels: map[string]string{"secondLabel": "temp"},
@@ -487,7 +521,7 @@ func GetDaemonSet(namespace string, daemonsetName string) *appsv1.DaemonSet {
487521

488522
func GetDaemonSetWithEnvVars(namespace string, daemonSetName string) *appsv1.DaemonSet {
489523
return &appsv1.DaemonSet{
490-
ObjectMeta: getObjectMeta(namespace, daemonSetName, true),
524+
ObjectMeta: getObjectMeta(namespace, daemonSetName, true, false, false),
491525
Spec: appsv1.DaemonSetSpec{
492526
Selector: &metav1.LabelSelector{
493527
MatchLabels: map[string]string{"secondLabel": "temp"},
@@ -503,7 +537,7 @@ func GetDaemonSetWithEnvVars(namespace string, daemonSetName string) *appsv1.Dae
503537
// GetStatefulSet provides statefulset for testing
504538
func GetStatefulSet(namespace string, statefulsetName string) *appsv1.StatefulSet {
505539
return &appsv1.StatefulSet{
506-
ObjectMeta: getObjectMeta(namespace, statefulsetName, false),
540+
ObjectMeta: getObjectMeta(namespace, statefulsetName, false, false, false),
507541
Spec: appsv1.StatefulSetSpec{
508542
Selector: &metav1.LabelSelector{
509543
MatchLabels: map[string]string{"secondLabel": "temp"},
@@ -519,7 +553,7 @@ func GetStatefulSet(namespace string, statefulsetName string) *appsv1.StatefulSe
519553
// GetStatefulSet provides statefulset for testing
520554
func GetStatefulSetWithEnvVar(namespace string, statefulsetName string) *appsv1.StatefulSet {
521555
return &appsv1.StatefulSet{
522-
ObjectMeta: getObjectMeta(namespace, statefulsetName, true),
556+
ObjectMeta: getObjectMeta(namespace, statefulsetName, true, false, false),
523557
Spec: appsv1.StatefulSetSpec{
524558
Selector: &metav1.LabelSelector{
525559
MatchLabels: map[string]string{"secondLabel": "temp"},
@@ -729,6 +763,16 @@ func CreateDeploymentWithEnvVarSourceAndAnnotations(client kubernetes.Interface,
729763
return deployment, err
730764
}
731765

766+
// CreateDeploymentWithTypedAutoAnnotation creates a deployment in given namespace and returns the Deployment with typed auto annotation
767+
func CreateDeploymentWithTypedAutoAnnotation(client kubernetes.Interface, deploymentName string, namespace string, resourceType string) (*appsv1.Deployment, error) {
768+
logrus.Infof("Creating Deployment")
769+
deploymentClient := client.AppsV1().Deployments(namespace)
770+
deploymentObj := GetDeploymentWithTypedAutoAnnotation(namespace, deploymentName, resourceType)
771+
deployment, err := deploymentClient.Create(context.TODO(), deploymentObj, metav1.CreateOptions{})
772+
time.Sleep(3 * time.Second)
773+
return deployment, err
774+
}
775+
732776
// CreateDaemonSet creates a deployment in given namespace and returns the DaemonSet
733777
func CreateDaemonSet(client kubernetes.Interface, daemonsetName string, namespace string, volumeMount bool) (*appsv1.DaemonSet, error) {
734778
logrus.Infof("Creating DaemonSet")
@@ -858,9 +902,11 @@ func VerifyResourceEnvVarUpdate(clients kube.Clients, config util.Config, envVar
858902
annotationValue := annotations[config.Annotation]
859903
searchAnnotationValue := annotations[options.AutoSearchAnnotation]
860904
reloaderEnabledValue := annotations[options.ReloaderAutoAnnotation]
905+
typedAutoAnnotationEnabledValue := annotations[config.TypedAutoAnnotation]
861906
reloaderEnabled, err := strconv.ParseBool(reloaderEnabledValue)
907+
typedAutoAnnotationEnabled, errTyped := strconv.ParseBool(typedAutoAnnotationEnabledValue)
862908
matches := false
863-
if err == nil && reloaderEnabled {
909+
if err == nil && reloaderEnabled || errTyped == nil && typedAutoAnnotationEnabled {
864910
matches = true
865911
} else if annotationValue != "" {
866912
values := strings.Split(annotationValue, ",")
@@ -902,9 +948,11 @@ func VerifyResourceAnnotationUpdate(clients kube.Clients, config util.Config, up
902948
annotationValue := annotations[config.Annotation]
903949
searchAnnotationValue := annotations[options.AutoSearchAnnotation]
904950
reloaderEnabledValue := annotations[options.ReloaderAutoAnnotation]
951+
typedAutoAnnotationEnabledValue := annotations[config.TypedAutoAnnotation]
905952
reloaderEnabled, _ := strconv.ParseBool(reloaderEnabledValue)
953+
typedAutoAnnotationEnabled, _ := strconv.ParseBool(typedAutoAnnotationEnabledValue)
906954
matches := false
907-
if reloaderEnabled || reloaderEnabledValue == "" && options.AutoReloadAll {
955+
if reloaderEnabled || typedAutoAnnotationEnabled || reloaderEnabledValue == "" && options.AutoReloadAll {
908956
matches = true
909957
} else if annotationValue != "" {
910958
values := strings.Split(annotationValue, ",")

Diff for: ‎internal/pkg/util/config.go

+3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ type Config struct {
1212
ResourceName string
1313
ResourceAnnotations map[string]string
1414
Annotation string
15+
TypedAutoAnnotation string
1516
SHAValue string
1617
Type string
1718
}
@@ -23,6 +24,7 @@ func GetConfigmapConfig(configmap *v1.ConfigMap) Config {
2324
ResourceName: configmap.Name,
2425
ResourceAnnotations: configmap.Annotations,
2526
Annotation: options.ConfigmapUpdateOnChangeAnnotation,
27+
TypedAutoAnnotation: options.ConfigmapReloaderAutoAnnotation,
2628
SHAValue: GetSHAfromConfigmap(configmap),
2729
Type: constants.ConfigmapEnvVarPostfix,
2830
}
@@ -35,6 +37,7 @@ func GetSecretConfig(secret *v1.Secret) Config {
3537
ResourceName: secret.Name,
3638
ResourceAnnotations: secret.Annotations,
3739
Annotation: options.SecretUpdateOnChangeAnnotation,
40+
TypedAutoAnnotation: options.SecretReloaderAutoAnnotation,
3841
SHAValue: GetSHAfromSecret(secret.Data),
3942
Type: constants.SecretEnvVarPostfix,
4043
}

0 commit comments

Comments
 (0)
Please sign in to comment.