We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 2adb2ea + 5f051c1 commit 88d9736Copy full SHA for 88d9736
cmd/containerd/command/main.go
@@ -114,8 +114,14 @@ can be used and modified as necessary as a custom configuration.`
114
config = defaultConfig()
115
)
116
117
- if err := srvconfig.LoadConfig(context.GlobalString("config"), config); err != nil && !os.IsNotExist(err) {
118
- return err
+ // Only try to load the config if it either exists, or the user explicitly
+ // told us to load this path.
119
+ configPath := context.GlobalString("config")
120
+ _, err := os.Stat(configPath)
121
+ if !os.IsNotExist(err) || context.GlobalIsSet("config") {
122
+ if err := srvconfig.LoadConfig(configPath, config); err != nil {
123
+ return err
124
+ }
125
}
126
127
// Apply flags to the config
0 commit comments