fix(cmd): log the actual build version on startup

The startup log hardcoded version="dev", so release builds always reported dev. Use the ldflags-set Version variable. Also modernise interface{} to any.
This commit is contained in:
2026-06-21 13:26:41 +01:00
parent 330666336f
commit 6d27d7dfe7
+2 -2
View File
@@ -134,7 +134,7 @@ func main() {
ctrl.SetLogger(zap.New(zap.UseFlagOptions(&opts)))
setupLog.Info("starting kubemirror controller",
"version", "dev",
"version", Version,
"maxTargets", maxTargets,
"workers", workerThreads,
)
@@ -207,7 +207,7 @@ func main() {
// This can reduce memory consumption by 50-70% by removing:
// - managedFields (often several KB per resource)
// - large annotations like kubectl.kubernetes.io/last-applied-configuration
transformFunc := func(obj interface{}) (interface{}, error) {
transformFunc := func(obj any) (any, error) {
// Type assert to unstructured
u, ok := obj.(*unstructured.Unstructured)
if !ok {