mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-20 18:31:15 +00:00
Fix for build failure - viper now uses ConfigFileNotFoundError
Change-Id: I51c4fe26239c4a7bf750e0a6a66b452d9138832f
This commit is contained in:
parent
71a7be41e0
commit
011911022d
@ -78,10 +78,16 @@ func ViperizeFlags(requiredConfig, optionalConfig string) error {
|
||||
// "file not found". Unfortunately error
|
||||
// messages are sometimes hard to understand,
|
||||
// so try to help the user a bit.
|
||||
switch err.Error() {
|
||||
case viperFileNotFound:
|
||||
switch err.(type) {
|
||||
case viper.ConfigFileNotFoundError:
|
||||
if required {
|
||||
return wrapError(errors.New("not found or not using a supported file format"))
|
||||
return wrapError(errors.New("not found"))
|
||||
}
|
||||
// Proceed without config.
|
||||
return nil
|
||||
case viper.UnsupportedConfigError:
|
||||
if required {
|
||||
return wrapError(errors.New("not using a supported file format"))
|
||||
}
|
||||
// Proceed without config.
|
||||
return nil
|
||||
|
Loading…
Reference in New Issue
Block a user