Merge "Improve error messages for bootstrap info"
This commit is contained in:
@@ -697,6 +697,12 @@ func (c *Config) CurrentContextBootstrapInfo() (*Bootstrap, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if currentCluster.Bootstrap == "" {
|
||||
return nil, ErrMissingConfig{
|
||||
What: fmt.Sprintf("No bootstrap-info defined for context %q", c.CurrentContext),
|
||||
}
|
||||
}
|
||||
|
||||
bootstrap, exists := c.ModulesConfig.BootstrapInfo[currentCluster.Bootstrap]
|
||||
if !exists {
|
||||
return nil, ErrBootstrapInfoNotFound{Name: currentCluster.Bootstrap}
|
||||
|
||||
@@ -57,7 +57,7 @@ type ErrBootstrapInfoNotFound struct {
|
||||
}
|
||||
|
||||
func (e ErrBootstrapInfoNotFound) Error() string {
|
||||
return fmt.Sprintf("Bootstrap info %s not found", e.Name)
|
||||
return fmt.Sprintf("Bootstrap info %q not found", e.Name)
|
||||
}
|
||||
|
||||
// ErrWrongConfig returned in case of incorrect configuration
|
||||
|
||||
Reference in New Issue
Block a user