Skip to content

Commit 3dbda1d

Browse files
authored
fix: add roll-out log to track config change history (#574)
Signed-off-by: Aylei <[email protected]>
1 parent d0c0b80 commit 3dbda1d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pkg/controllers/common/configmap.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import (
2727
"github.com/matrixorigin/matrixone-operator/api/core/v1alpha1"
2828
corev1 "k8s.io/api/core/v1"
2929
apierrors "k8s.io/apimachinery/pkg/api/errors"
30+
"k8s.io/klog"
3031
"sigs.k8s.io/controller-runtime/pkg/client"
3132
)
3233

@@ -93,6 +94,10 @@ func ensureConfigMap(kubeCli recon.KubeClient, desired *corev1.ConfigMap) (strin
9394
if withDigest(key, v) && configInUse(key, podList.Items) {
9495
// append item that is still in use
9596
c.Data[key] = v
97+
} else {
98+
// log roll-out event to track configmap changes
99+
klog.Infof("config key %s is not in use, will be deleted. configmap %s/%s, value: %s",
100+
key, c.Namespace, c.Name, v)
96101
}
97102
}
98103
err = kubeCli.Update(c)

0 commit comments

Comments
 (0)