Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

Add commands for workspace providers #238

Merged
merged 1 commit into from
Feb 5, 2021
Merged

Add commands for workspace providers #238

merged 1 commit into from
Feb 5, 2021

Conversation

f0ssel
Copy link
Contributor

@f0ssel f0ssel commented Feb 5, 2021

This adds create, list, and delete functionality of workspace providers to coder-cli. The functionality is bare bones in this iteration and will be augmented with more documentation, especially around the provider creation flow, in a future pr.

➜  coder git:(cli-wp) ✗ go run main.go providers create test-2
ID                                   Name      Status    EnvproxyToken                        
601dc1e2-be83c6116b11dc4507db5f21    test-2              601dc1e2-be4362804a91d8cb4450ec21  

➜  coder git:(cli-wp) ✗ go run main.go providers ls           
Name      Status     Cluster Address                                     Namespace    Storage Class    Cluster Domain Suffix    Access URL                Devurl Host    SSH Enabled    Namespace Allowlist    
local     ready      https://kubernetes.default.svc.cluster.local:443    f0ssel                        .svc.cluster.local       http://104.154.100.117                   true           []                     
test-1    pending                                                                                                                                                        false          []                     

➜  coder-cli git:(cli-wp) ✗ go run cmd/coder/main.go providers rm test-1 test-2
error: failed to remove workspace provider "test-2"
  | cause: no workspace provider found by name "test-2"

success: removed workspace provider with name "test-1"
fatal: 1 failure emitted

exit status 1

Status field is empty on the create command until I push my changes in m to add that to the create response.

These commands are hidden for now.

@f0ssel f0ssel force-pushed the cli-wp branch 3 times, most recently from 4ecb68f to 489be87 Compare February 5, 2021 22:03
@f0ssel f0ssel requested a review from cmoog February 5, 2021 22:12
@f0ssel f0ssel force-pushed the cli-wp branch 3 times, most recently from 50a42dc to 562619b Compare February 5, 2021 23:18
@f0ssel f0ssel requested a review from cmoog February 5, 2021 23:21
}

// DeleteWorkspaceProviderByName deletes a workspace provider entity from the Coder control plane.
func (c *Client) DeleteWorkspaceProviderByName(ctx context.Context, name string) error {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so for coder-sdk we should only be using the unique identifiers for our base methods like this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

something like this belongs in coderutil in my view.

return xerrors.Errorf("listing workspace providers: %w", err)
}

egroup := clog.LoggedErrGroup()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

@f0ssel f0ssel merged commit b039b93 into master Feb 5, 2021
@f0ssel f0ssel deleted the cli-wp branch February 5, 2021 23:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants