Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions api/.svace-dir/shared/snapshots/gitrepo
Submodule gitrepo added at 135814
2 changes: 1 addition & 1 deletion api/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require k8s.io/apimachinery v0.33.0
require (
github.com/fatih/color v1.18.0 // indirect
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/logr v1.4.3 // indirect
github.com/go-openapi/jsonpointer v0.21.0 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/swag v0.23.0 // indirect
Expand Down
4 changes: 2 additions & 2 deletions api/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nos
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E=
github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ=
github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=
github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs=
github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ=
github.com/go-openapi/jsonpointer v0.21.0/go.mod h1:IUyH9l/+uyhIYQ/PXVA41Rexl+kOkAPDdXEYns6fzUY=
Expand Down
2 changes: 1 addition & 1 deletion hooks/go/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ require (
github.com/evanphx/json-patch/v5 v5.9.11 // indirect
github.com/fsnotify/fsnotify v1.8.0 // indirect
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/logr v1.4.3 // indirect
github.com/go-openapi/jsonpointer v0.21.0 // indirect
github.com/go-openapi/jsonreference v0.21.0 // indirect
github.com/go-openapi/swag v0.23.0 // indirect
Expand Down
4 changes: 2 additions & 2 deletions hooks/go/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/
github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=
github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E=
github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ=
github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=
github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/zapr v1.3.0 h1:XGdV8XW8zdwFiwOA2Dryh1gj2KRQyOOoNmBy4EplIcQ=
github.com/go-logr/zapr v1.3.0/go.mod h1:YKepepNBd1u/oyhd/yQmtjVXmm9uML4IXUgMOwR8/Gg=
github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ=
Expand Down
7 changes: 4 additions & 3 deletions images/agent/cmd/llvs_ee.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,13 @@ func addLLVSReconciler(
commands utils.Commands,
cfgParams *config.Config,
) {
log = log.WithName("addLLVSReconciler")
if !feature.SnapshotsEnabled() {
log.Info("[addLLVSReconciler] Snapshot feature is disabled")
log.Info("Snapshot feature is disabled")
return
}

log.Info("[addLLVSReconciler] Snapshot feature is enabled. Adding LLVS reconciler")
log.Info("Snapshot feature is enabled. Adding LLVS reconciler")

err := controller.AddReconciler(
mgr,
Expand All @@ -55,7 +56,7 @@ func addLLVSReconciler(
),
)
if err != nil {
log.Error(err, "[main] unable to start llvs.NewReconciler")
log.Error(err, "unable to start llvs.NewReconciler")
os.Exit(1)
}
}
66 changes: 34 additions & 32 deletions images/agent/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,35 +72,37 @@ func main() {
os.Exit(1)
}

log.Info(fmt.Sprintf("[main] Go Version:%s ", goruntime.Version()))
log.Info(fmt.Sprintf("[main] OS/Arch:Go OS/Arch:%s/%s ", goruntime.GOOS, goruntime.GOARCH))
mainLog := log.WithName("main")

log.Info(fmt.Sprintf("[main] Feature SnapshotsEnabled: %t", feature.SnapshotsEnabled()))
log.Info(fmt.Sprintf("[main] Feature VolumeCleanupEnabled: %t", feature.VolumeCleanupEnabled()))
mainLog.Info(fmt.Sprintf("Go Version:%s ", goruntime.Version()))
mainLog.Info(fmt.Sprintf("OS/Arch:Go OS/Arch:%s/%s ", goruntime.GOOS, goruntime.GOARCH))

log.Info("[main] CfgParams has been successfully created")
log.Info(fmt.Sprintf("[main] %s = %s", config.LogLevel, cfgParams.Loglevel))
log.Info(fmt.Sprintf("[main] %s = %s", config.NodeName, cfgParams.NodeName))
log.Info(fmt.Sprintf("[main] %s = %s", config.MachineID, cfgParams.MachineID))
log.Info(fmt.Sprintf("[main] %s = %s", config.ScanInterval, cfgParams.BlockDeviceScanInterval.String()))
log.Info(fmt.Sprintf("[main] %s = %s", config.ThrottleInterval, cfgParams.ThrottleInterval.String()))
log.Info(fmt.Sprintf("[main] %s = %s", config.CmdDeadlineDuration, cfgParams.CmdDeadlineDuration.String()))
mainLog.Info(fmt.Sprintf("Feature SnapshotsEnabled: %t", feature.SnapshotsEnabled()))
mainLog.Info(fmt.Sprintf("Feature VolumeCleanupEnabled: %t", feature.VolumeCleanupEnabled()))

mainLog.Info("CfgParams has been successfully created")
mainLog.Info(fmt.Sprintf("%s = %s", config.LogLevel, cfgParams.Loglevel))
mainLog.Info(fmt.Sprintf("%s = %s", config.NodeName, cfgParams.NodeName))
mainLog.Info(fmt.Sprintf("%s = %s", config.MachineID, cfgParams.MachineID))
mainLog.Info(fmt.Sprintf("%s = %s", config.ScanInterval, cfgParams.BlockDeviceScanInterval.String()))
mainLog.Info(fmt.Sprintf("%s = %s", config.ThrottleInterval, cfgParams.ThrottleInterval.String()))
mainLog.Info(fmt.Sprintf("%s = %s", config.CmdDeadlineDuration, cfgParams.CmdDeadlineDuration.String()))

kConfig, err := kubutils.KubernetesDefaultConfigCreate()
if err != nil {
log.Error(err, "[main] unable to KubernetesDefaultConfigCreate")
mainLog.Error(err, "unable to KubernetesDefaultConfigCreate")
}
log.Info("[main] kubernetes config has been successfully created.")
mainLog.Info("kubernetes config has been successfully created.")

scheme := runtime.NewScheme()
for _, f := range resourcesSchemeFuncs {
err := f(scheme)
if err != nil {
log.Error(err, "[main] unable to add scheme to func")
mainLog.Error(err, "unable to add scheme to func")
os.Exit(1)
}
}
log.Info("[main] successfully read scheme CR")
mainLog.Info("successfully read scheme CR")

managerOpts := manager.Options{
Scheme: scheme,
Expand All @@ -111,17 +113,17 @@ func main() {

mgr, err := manager.New(kConfig, managerOpts)
if err != nil {
log.Error(err, "[main] unable to manager.New")
mainLog.Error(err, "unable to manager.New")
os.Exit(1)
}
log.Info("[main] successfully created kubernetes manager")
mainLog.Info("successfully created kubernetes manager")

metrics := monitoring.GetMetrics(cfgParams.NodeName)
commands := utils.NewCommands()

log.Info("[main] ReTag starts")
mainLog.Info("ReTag starts")
if err := commands.ReTag(ctx, log, metrics, bd.DiscovererName); err != nil {
log.Error(err, "[main] unable to run ReTag")
mainLog.Error(err, "unable to run ReTag")
}

sdsCache := cache.New()
Expand All @@ -142,7 +144,7 @@ func main() {
),
)
if err != nil {
log.Error(err, "[main] unable to controller.RunBlockDeviceController")
mainLog.Error(err, "unable to controller.RunBlockDeviceController")
os.Exit(1)
}

Expand All @@ -162,7 +164,7 @@ func main() {
),
)
if err != nil {
log.Error(err, "[main] unable to controller.RunLVMVolumeGroupDiscoverController")
mainLog.Error(err, "unable to controller.RunLVMVolumeGroupDiscoverController")
os.Exit(1)
}

Expand All @@ -181,7 +183,7 @@ func main() {
),
)
if err != nil {
log.Error(err, "[main] unable to run BlockDeviceFilter controller")
mainLog.Error(err, "unable to run BlockDeviceFilter controller")
os.Exit(1)
}

Expand All @@ -202,7 +204,7 @@ func main() {
),
)
if err != nil {
log.Error(err, "[main] unable to controller.RunLVMVolumeGroupWatcherController")
mainLog.Error(err, "unable to controller.RunLVMVolumeGroupWatcherController")
os.Exit(1)
}

Expand All @@ -215,7 +217,7 @@ func main() {
rediscoverBlockDevices,
rediscoverLVGs,
); err != nil {
log.Error(err, "[main] unable to run scanner")
mainLog.Error(err, "unable to run scanner")
os.Exit(1)
}
}()
Expand All @@ -238,7 +240,7 @@ func main() {
),
)
if err != nil {
log.Error(err, "[main] unable to controller.RunLVMVolumeGroupWatcherController")
mainLog.Error(err, "unable to controller.RunLVMVolumeGroupWatcherController")
os.Exit(1)
}

Expand All @@ -258,29 +260,29 @@ func main() {
),
)
if err != nil {
log.Error(err, "[main] unable to controller.RunLVMLogicalVolumeExtenderWatcherController")
mainLog.Error(err, "unable to controller.RunLVMLogicalVolumeExtenderWatcherController")
os.Exit(1)
}

addLLVSReconciler(mgr, log, metrics, sdsCache, commands, cfgParams)

if err = mgr.AddHealthzCheck("healthz", healthz.Ping); err != nil {
log.Error(err, "[main] unable to mgr.AddHealthzCheck")
mainLog.Error(err, "unable to mgr.AddHealthzCheck")
os.Exit(1)
}
log.Info("[main] successfully AddHealthzCheck")
mainLog.Info("successfully AddHealthzCheck")

if err = mgr.AddReadyzCheck("readyz", healthz.Ping); err != nil {
log.Error(err, "[main] unable to mgr.AddReadyzCheck")
mainLog.Error(err, "unable to mgr.AddReadyzCheck")
os.Exit(1)
}
log.Info("[main] successfully AddReadyzCheck")
mainLog.Info("successfully AddReadyzCheck")

err = mgr.Start(ctx)
if err != nil {
log.Error(err, "[main] unable to mgr.Start")
mainLog.Error(err, "unable to mgr.Start")
os.Exit(1)
}

log.Info("[main] successfully starts the manager")
mainLog.Info("successfully starts the manager")
}
2 changes: 1 addition & 1 deletion images/agent/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.24.9
require (
github.com/deckhouse/sds-node-configurator/api v0.0.0-20250130211935-b68366dfd0f8
github.com/deckhouse/sds-node-configurator/lib/go/common v0.0.0-00010101000000-000000000000
github.com/go-logr/logr v1.4.2
github.com/go-logr/logr v1.4.3
github.com/google/go-cmp v0.7.0
github.com/gosimple/slug v1.14.0
github.com/onsi/ginkgo/v2 v2.21.0
Expand Down
4 changes: 2 additions & 2 deletions images/agent/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nos
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E=
github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ=
github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=
github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/zapr v1.3.0 h1:XGdV8XW8zdwFiwOA2Dryh1gj2KRQyOOoNmBy4EplIcQ=
github.com/go-logr/zapr v1.3.0/go.mod h1:YKepepNBd1u/oyhd/yQmtjVXmm9uML4IXUgMOwR8/Gg=
github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ=
Expand Down
Loading
Loading