Skip to content
This repository was archived by the owner on Sep 9, 2020. It is now read-only.
This repository was archived by the owner on Sep 9, 2020. It is now read-only.

ks registry add should not add invalid path or URI #591

@GuessWhoSamFoo

Description

@GuessWhoSamFoo

/kind bug

What happened:
If adding a registry with an invalid path or URI, the registry will still be added despite an error message.

$ ks registry add test ~/not/a/real/path
ERROR cache registry: open /home/sfoo/not/a/real/path/registry.yaml: no such file or directory

$ ks registry add another github.com/ksonnet/parts/tree/master/fake
ERROR cache registry: Could not find valid registry at uri 'ksonnet/ksonnet/fake/registry.yaml' and refspec 'master' (resolves to sha '40285d8a14f1ac5787e405e1023cf0c07f6aa28c')

$ ks registry list
NAME      OVERRIDE PROTOCOL URI
====      ======== ======== ===
another            github   github.com/ksonnet/parts/tree/master/fake
incubator          github   github.com/ksonnet/parts/tree/master/incubator
test               fs       /home/sfoo/not/a/real/path

What you expected to happen:
The registry should not be added if errors.

How to reproduce it (as minimally and precisely as possible):
See above.

Anything else we need to know?:

Environment:

  • ksonnet version (use ks version):
    ksonnet version: 0.11.0

  • Kubernetes version (use kubectl version):
    Client Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.3", GitCommit:"2bba0127d85d5a46ab4b778548be28623b32d0b0", GitTreeState:"clean", BuildDate:"2018-05-21T09:17:39Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"linux/amd64"}
    Server Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.0", GitCommit:"fc32d2f3698e36b93322a3465f63a14e9f0eaead", GitTreeState:"clean", BuildDate:"2018-03-26T16:44:10Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"linux/amd64"}

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions