Skip to content

Commit

Permalink
fix: add roll-out log to track config change history (#574)
Browse files Browse the repository at this point in the history
Signed-off-by: Aylei <[email protected]>
  • Loading branch information
aylei authored Dec 25, 2024
1 parent d0c0b80 commit 3dbda1d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/controllers/common/configmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
"github.com/matrixorigin/matrixone-operator/api/core/v1alpha1"
corev1 "k8s.io/api/core/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/klog"
"sigs.k8s.io/controller-runtime/pkg/client"
)

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

0 comments on commit 3dbda1d

Please sign in to comment.