mirror of https://github.com/kubernetes/kops.git
Merge pull request #808 from justinsb/issue_615
Better error message when KOPS_STATE_STORE not set
This commit is contained in:
commit
5b05a9ccbc
|
|
@ -43,7 +43,7 @@ func (f *Factory) Clientset() (simple.Clientset, error) {
|
||||||
if f.clientset == nil {
|
if f.clientset == nil {
|
||||||
registryPath := f.options.RegistryPath
|
registryPath := f.options.RegistryPath
|
||||||
if registryPath == "" {
|
if registryPath == "" {
|
||||||
return nil, field.Required(field.NewPath("RegistryPath"), "")
|
return nil, field.Required(field.NewPath("RegistryPath"), "Please set the --state flag, or `export KOPS_STATE_STORE=s3://<bucket>`")
|
||||||
}
|
}
|
||||||
basePath, err := vfs.Context.BuildVfsPath(registryPath)
|
basePath, err := vfs.Context.BuildVfsPath(registryPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
@ -51,7 +51,7 @@ func (f *Factory) Clientset() (simple.Clientset, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if !vfs.IsClusterReadable(basePath) {
|
if !vfs.IsClusterReadable(basePath) {
|
||||||
return nil, field.Invalid(field.NewPath("RegistryPath"), registryPath, "Not cloud-reachable - please use an S3 bucket")
|
return nil, field.Invalid(field.NewPath("RegistryPath"), registryPath, "Not cloud-reachable - please use an S3 bucket when setting --state or KOPS_STATE_STORE")
|
||||||
}
|
}
|
||||||
|
|
||||||
f.clientset = vfsclientset.NewVFSClientset(basePath)
|
f.clientset = vfsclientset.NewVFSClientset(basePath)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue