Azure / draft-classic

A tool for developers to create cloud-native applications on Kubernetes.
https://draft.sh
MIT License
3.93k stars 397 forks source link

draft config set registry command usage is unclear #729

Closed arun-gupta closed 6 years ago

arun-gupta commented 6 years ago

draft config set registry command prints the output:

draft config set registry
Error: This command needs 2 argument(s): [key value]

What should the key and the value be? The usage is not clear and not specified at https://github.com/Azure/draft/blob/master/docs/getting-started.md.

Ideally, it should prompt the user on the needed inputs.

Identified during hacking with @michelleN at #KubeCon

bacongobbler commented 6 years ago

Good point. We can probably add more context to validateArgs. How about

$ draft config set registry
Error: This command needs 2 argument(s):
    $ draft config set [key] [value]

We'll need to inject some context into validateArgs to provide that experience, but that could make it more clear on the positional arguments the command wants.

arun-gupta commented 6 years ago

What should the [key] and [value] be?

bacongobbler commented 6 years ago

The key is registry and the value is the name of your container registry. In docker terms, it's the image prefix, e.g. for bacongobbler/example-go it's bacongobbler, and for myacr.azurecr.io/example-go it's myacr.azurecr.io. Does that help? :)

bacongobbler commented 6 years ago

However we use draft config set for more than just the name of the container registry, which is why I'd like to solve this in a more generic way. :)

bacongobbler commented 6 years ago

Example usage: https://github.com/Azure/draft/blob/master/docs/install-cloud.md#drafting-with-acr-and-aks

arun-gupta commented 6 years ago

Given this is a multipurpose command, [key] and [value] are reasonable.

michelleN commented 6 years ago

I think we may want to consider changing up the way config works at the moment. When I run draft config, I should be able to see a set of things I can configure. In other words, I think we should see a set of nouns. Right now, there are verbs but I don't know how to apply those verbs and what I should apply them to. After deleting draft home and running a fresh draft init, I don't even have registry as an option. We may want to re-think this experience.

rangapv commented 5 years ago

command comment: For instance the docker repo settings is ...

$ draft config set registry $docker_username

In the $HOME/.draft a file config.toml is created.

Which is populated with the name of the registry which refers to the docker hub.

registry = "$docker_username"

I am assuming this is for the draft for automatic docker pulls.

Now what are the other parameters that the KEY:VALUE can take and their use cases will be helpful

Ranga