@@ -34,7 +34,7 @@ import (
3434
3535 nvapi "github.com/NVIDIA/k8s-dra-driver-gpu/api/nvidia.com/resource/v1beta1"
3636 "github.com/NVIDIA/k8s-dra-driver-gpu/pkg/featuregates"
37- "github.com/NVIDIA/k8s-dra-driver-gpu/pkg/flags"
37+ pkgflags "github.com/NVIDIA/k8s-dra-driver-gpu/pkg/flags"
3838)
3939
4040const (
@@ -55,8 +55,6 @@ type Flags struct {
5555 podName string
5656 podNamespace string
5757 maxNodesPerIMEXDomain int
58- loggingConfig * flags.LoggingConfig
59- featureGateConfig * flags.FeatureGateConfig
6058}
6159
6260type IMEXConfigTemplateData struct {
@@ -71,10 +69,9 @@ func main() {
7169}
7270
7371func newApp () * cli.App {
74- flags := Flags {
75- loggingConfig : flags .NewLoggingConfig (),
76- featureGateConfig : flags .NewFeatureGateConfig (),
77- }
72+ loggingConfig := pkgflags .NewLoggingConfig ()
73+ featureGateConfig := pkgflags .NewFeatureGateConfig ()
74+ flags := & Flags {}
7875
7976 // Create a wrapper that will be used to gracefully shut down all subcommands
8077 wrapper := func (ctx context.Context , f func (ctx context.Context , cancel context.CancelFunc , flags * Flags ) error ) error {
@@ -91,7 +88,7 @@ func newApp() *cli.App {
9188 }()
9289
9390 // Call the wrapped function
94- return f (ctx , cancel , & flags )
91+ return f (ctx , cancel , flags )
9592 }
9693
9794 cliFlags := []cli.Flag {
@@ -151,16 +148,19 @@ func newApp() *cli.App {
151148 Destination : & flags .maxNodesPerIMEXDomain ,
152149 },
153150 }
154- cliFlags = append (cliFlags , flags . featureGateConfig .Flags ()... )
155- cliFlags = append (cliFlags , flags . loggingConfig .Flags ()... )
151+ cliFlags = append (cliFlags , featureGateConfig .Flags ()... )
152+ cliFlags = append (cliFlags , loggingConfig .Flags ()... )
156153
157154 // Create the app
158155 app := & cli.App {
159156 Name : "compute-domain-daemon" ,
160157 Usage : "compute-domain-daemon manages the IMEX daemon for NVIDIA compute domains." ,
161158 Flags : cliFlags ,
162159 Before : func (c * cli.Context ) error {
163- return flags .loggingConfig .Apply ()
160+ // `loggingConfig` must be applied before doing any logging
161+ err := loggingConfig .Apply ()
162+ pkgflags .LogStartupConfig (flags , loggingConfig )
163+ return err
164164 },
165165 Commands : []* cli.Command {
166166 {
@@ -197,7 +197,6 @@ func run(ctx context.Context, cancel context.CancelFunc, flags *Flags) error {
197197 podNamespace : flags .podNamespace ,
198198 maxNodesPerIMEXDomain : flags .maxNodesPerIMEXDomain ,
199199 }
200- klog .Infof ("config: %v" , config )
201200
202201 // Support heterogeneous ComputeDomains. That means that a CD may contain
203202 // nodes that do not take part in Multi-Node NVLink communication. On such
0 commit comments