Skip to content

Commit 00da749

Browse files
committed
Log full component config on startup (go-render)
Signed-off-by: Dr. Jan-Philip Gehrcke <[email protected]>
1 parent 2b7e899 commit 00da749

File tree

9 files changed

+547
-3
lines changed

9 files changed

+547
-3
lines changed

cmd/compute-domain-controller/main.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ import (
3838
_ "k8s.io/component-base/metrics/prometheus/version" // for version metric registration
3939
_ "k8s.io/component-base/metrics/prometheus/workqueue" // register work queues in the default legacy registry
4040

41+
"github.com/gdexlab/go-render/render"
42+
4143
"github.com/NVIDIA/k8s-dra-driver-gpu/internal/info"
4244
"github.com/NVIDIA/k8s-dra-driver-gpu/pkg/flags"
4345
)
@@ -164,6 +166,8 @@ func newApp() *cli.App {
164166
return flags.loggingConfig.Apply()
165167
},
166168
Action: func(c *cli.Context) error {
169+
klog.Infof("config: %v", render.Render(flags))
170+
167171
mux := http.NewServeMux()
168172

169173
clientsets, err := flags.kubeClientConfig.NewClientSets()

cmd/compute-domain-daemon/main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,8 @@ func newApp() *cli.App {
185185

186186
// Run invokes the IMEX daemon and manages its lifecycle.
187187
func run(ctx context.Context, cancel context.CancelFunc, flags *Flags) error {
188+
klog.Infof("config: %v", flags)
189+
188190
// Support heterogeneous compute domain
189191
if flags.cliqueID == "" {
190192
fmt.Println("ClusterUUID and CliqueId are NOT set for GPUs on this node.")
@@ -205,7 +207,6 @@ func run(ctx context.Context, cancel context.CancelFunc, flags *Flags) error {
205207
podNamespace: flags.podNamespace,
206208
maxNodesPerIMEXDomain: flags.maxNodesPerIMEXDomain,
207209
}
208-
klog.Infof("config: %v", config)
209210

210211
// Write the IMEX config with the current pod IP before starting the daemon
211212
if err := writeIMEXConfig(flags.podIP); err != nil {

cmd/compute-domain-kubelet-plugin/main.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ import (
2727

2828
"github.com/urfave/cli/v2"
2929

30+
"github.com/gdexlab/go-render/render"
31+
3032
"k8s.io/dynamic-resource-allocation/kubeletplugin"
3133
"k8s.io/klog/v2"
3234

@@ -159,7 +161,7 @@ func newApp() *cli.App {
159161
return flags.loggingConfig.Apply()
160162
},
161163
Action: func(c *cli.Context) error {
162-
ctx := c.Context
164+
klog.Infof("config: %v", render.Render(flags))
163165

164166
clientSets, err := flags.kubeClientConfig.NewClientSets()
165167
if err != nil {
@@ -171,7 +173,7 @@ func newApp() *cli.App {
171173
clientsets: clientSets,
172174
}
173175

174-
return RunPlugin(ctx, config)
176+
return RunPlugin(c.Context, config)
175177
},
176178
Version: info.GetVersionString(),
177179
}

cmd/gpu-kubelet-plugin/main.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,9 @@ func newApp() *cli.App {
166166
return flags.loggingConfig.Apply()
167167
},
168168
Action: func(c *cli.Context) error {
169+
170+
klog.Infof("config: %v", flags)
171+
169172
ctx := c.Context
170173

171174
clientSets, err := flags.kubeClientConfig.NewClientSets()

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ require (
3939
github.com/emicklei/go-restful/v3 v3.12.2 // indirect
4040
github.com/fsnotify/fsnotify v1.9.0 // indirect
4141
github.com/fxamacker/cbor/v2 v2.9.0 // indirect
42+
github.com/gdexlab/go-render v1.0.1 // indirect
4243
github.com/go-logr/logr v1.4.3 // indirect
4344
github.com/go-logr/zapr v1.3.0 // indirect
4445
github.com/go-openapi/jsonpointer v0.21.0 // indirect

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S
2727
github.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=
2828
github.com/fxamacker/cbor/v2 v2.9.0 h1:NpKPmjDBgUfBms6tr6JZkTHtfFGcMKsw3eGcmD/sapM=
2929
github.com/fxamacker/cbor/v2 v2.9.0/go.mod h1:vM4b+DJCtHn+zz7h3FFp/hDAI9WNWCsZj23V5ytsSxQ=
30+
github.com/gdexlab/go-render v1.0.1 h1:rxqB3vo5s4n1kF0ySmoNeSPRYkEsyHgln4jFIQY7v0U=
31+
github.com/gdexlab/go-render v1.0.1/go.mod h1:wRi5nW2qfjiGj4mPukH4UV0IknS1cHD4VgFTmJX5JzM=
3032
github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=
3133
github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
3234
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=

vendor/github.com/gdexlab/go-render/LICENSE

Lines changed: 27 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)