Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rad init prompts for a kube context but doesn't offer a --context cli arg #4058

Closed
asilverman opened this issue Oct 7, 2022 · 5 comments
Closed

Comments

@asilverman
Copy link
Contributor

asilverman commented Oct 7, 2022

Bug information

When you run rad init it will prompt for a kube context selection, this blocks you from scripting with the rad cli since there is no way for you to answer this prompt with current cli flags. Adding a --context flag may help unblock

Steps to reproduce (required)

  1. rad init
  2. Notice how the first question is to choose a context, inspect rad init --help to find a flag you can use to override this prompt

Observed behavior (required)

No such flag exists

Desired behavior (required)

add a --context flag

Workaround (optional)

System information

rad Version (required)

{
  "release": "edge",
  "version": "v0.13.0-58-g1ddfb0b",
  "bicep": "0.7.29",
  "commit": "1ddfb0b41ac1f80df410d780ad84fccedad49bf2"
}

Operating system (required)

Additional context

AB#4243

@AaronCrawfis
Copy link
Contributor

Thanks for the bug report!

rad env init is being deprecated next sprint in favor of rad install and rad workspace create, which both support a context flag.

Also if you're referring to the new rad init command, that is meant to be interactive only and not scriptable (use rad install and rad workspace create instead).

@AaronCrawfis AaronCrawfis closed this as not planned Won't fix, can't repro, duplicate, stale Oct 7, 2022
@asilverman asilverman changed the title rad env init prompts for a kube context but doesn't offer a --context cli arg rad init prompts for a kube context but doesn't offer a --context cli arg Oct 7, 2022
@asilverman
Copy link
Contributor Author

I think that here we need to consider that this commands behavior is inconsistent with the rest of the rad commands. I am not sure I agree with the premise of having commands that are not script-friendly. In any case the current state is a mix of flags and no flags so if we want to remove support for flags on rad init then we should either remove all flags or support all options with flags but not the current state which is a partial support for flags

@asilverman asilverman reopened this Oct 10, 2022
@AaronCrawfis
Copy link
Contributor

This Feature tracks the removal of flags from rad init: #4067

Closing this Bug as duplicate.

@AaronCrawfis AaronCrawfis closed this as not planned Won't fix, can't repro, duplicate, stale Oct 10, 2022
@GaTechThomas
Copy link

Thanks for the bug report!

rad env init is being deprecated next sprint in favor of rad install and rad workspace create, which both support a context flag.

Also if you're referring to the new rad init command, that is meant to be interactive only and not scriptable (use rad install and rad workspace create instead).

I just spent more than half an hour trying to understand how to call rad init with no user input. Your comment is helpful, though it is not clear for users who are starting new with radius that rad init is not what we should use in scripts - I did a fair bit of searching before finding this thread.

Long story short, it would be helpful to mention this in the getting-started guide and in the CLI reference page for rad init. Please and thank you. :-)

@AaronCrawfis
Copy link
Contributor

Thanks for the bug report!
rad env init is being deprecated next sprint in favor of rad install and rad workspace create, which both support a context flag.
Also if you're referring to the new rad init command, that is meant to be interactive only and not scriptable (use rad install and rad workspace create instead).

I just spent more than half an hour trying to understand how to call rad init with no user input. Your comment is helpful, though it is not clear for users who are starting new with radius that rad init is not what we should use in scripts - I did a fair bit of searching before finding this thread.

Long story short, it would be helpful to mention this in the getting-started guide and in the CLI reference page for rad init. Please and thank you. :-)

Great point, thanks for the recommendation @GaTechThomas! Created an issue to track: radius-project/docs#1017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants