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 should not expect workspaces to already be present #3823

Closed
asilverman opened this issue Sep 23, 2022 · 1 comment · Fixed by #3958
Closed

rad init should not expect workspaces to already be present #3823

asilverman opened this issue Sep 23, 2022 · 1 comment · Fixed by #3958

Comments

@asilverman
Copy link
Contributor

asilverman commented Sep 23, 2022

Proposed fix

rad init should not expect a workspace to already be present on the user's machine. Instead, it should create a new config.yaml if not already present, and then add a new entry for the new workspace.

Specifically https://github.com/project-radius/radius/blob/main/pkg/cli/cmd/radInit/init.go#L92 is the current bug where we try to read in the config file.

Intended behavior

  • If config.yaml does not exist, create it
  • Always create a new entry in the config file for a new workspace (rad init will not update existing workspaces)
  • If there's a collision in workspace names, append a number/random string
  • Set the new workspace as default

Flow chart

image

Bug information

Steps to reproduce (required)

Pre-requisites:

  • A clean kubernetes cluster ( no radius installed)
  • rm -r ~/.rad/config.yaml ~/.rad/config.yaml.lock

Steps:

  1. rad init

Workspace not specified

  1. rad workspace init kubernetes -w sighting

Creating Workspace...
Error: unable to create a workspace. Please install Radius control plane first: rad install kubernetes

Observed behavior (required)

I am forced to run rad install kubernetes before I can run rad init on a clean setup

Desired behavior (required)

I should not need to run any command before being able to successfully run rad init

Workaround (optional)

System information

rad Version (required)

rad version -o json                             
{
  "release": "edge",
  "version": "v0.13.0-35-g8e9021c",
  "bicep": "0.7.29",
  "commit": "8e9021cbcd5be351e40fac36d2b59040cec35138"
}

Operating system (required)

Win 10 (WSL2)

Additional context

AB#3960

@AaronCrawfis AaronCrawfis changed the title As a new Radius user, I am forced to run rad install kubernetes before I can run rad init rad init should not expect workspaces to already be present Sep 26, 2022
bjoginapally pushed a commit that referenced this issue Sep 29, 2022
- prompt user for re-install of radius and handle the scenarios
- Create or update radius workspace instead of require existing workspace
issues: #3823 , #3825
bjoginapally pushed a commit that referenced this issue Sep 29, 2022
- prompt user for re-install of radius and handle the scenarios
- Create or update radius workspace instead of require existing workspace
issues: #3823 , #3825
bjoginapally pushed a commit that referenced this issue Sep 29, 2022
- prompt user for re-install of radius and handle the scenarios
- Create or update radius workspace instead of require existing workspace
issues: #3823 , #3825
bjoginapally pushed a commit that referenced this issue Sep 29, 2022
- prompt user for re-install of radius and handle the scenarios
- Create or update radius workspace instead of require existing workspace
issues: #3823 , #3825
bjoginapally pushed a commit that referenced this issue Sep 29, 2022
- prompt user for re-install of radius and handle the scenarios
- Create or update radius workspace instead of require existing workspace
issues: #3823 , #3825
bjoginapally added a commit that referenced this issue Oct 1, 2022
- prompt user for re-install of radius and handle the scenarios
- Create or update radius workspace instead of require existing workspace
issues: #3823 , #3825
@asilverman
Copy link
Contributor Author

verified fix

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

Successfully merging a pull request may close this issue.

4 participants