upbound / up

The @upbound CLI
Apache License 2.0
51 stars 41 forks source link

Introduce support for `up ctp` (create, get, list, delete) against an Upbound Space #388

Closed tnthornton closed 10 months ago

tnthornton commented 10 months ago

Description of your changes

With Upbound Spaces having been released last month, an obvious short coming was up CLI support for working with a Space. This changeset begins moving in the direction of having consistent support for up ctp between Cloud and Spaces by enabling the following actions when using a Space profile:

Of note:

I have:

How has this code been tested

New tests added

Manual validation

In the cluster:

kubectl get ctp
No resources found

Outside of cluster:

  1. No control planes
    ./_output/bin/darwin_arm64/up ctp get one
    Control plane one not found
./_output/bin/darwin_arm64/up ctp delete one
Control plane one not found
./_output/bin/darwin_arm64/up ctp list
No control planes found
  1. Create control plane
    ./_output/bin/darwin_arm64/up ctp create one
    one created
    kubectl get ctp
    NAME   READY   MESSAGE                AGE
    one    False   Waiting for start up   3s
    ./_output/bin/darwin_arm64/up ctp get one
    NAME   ID                                     STATUS     MESSAGE                CONNECTION NAME   CONNECTION NAMESPACE
    one    cd47bda5-cf80-44da-92bf-88217e375e82   Creating   Waiting for start up   kubeconfig-one    default

Once the control plane is ready:

./_output/bin/darwin_arm64/up ctp get one
NAME   ID                                     STATUS      MESSAGE   CONNECTION NAME   CONNECTION NAMESPACE
one    cd47bda5-cf80-44da-92bf-88217e375e82   Available             kubeconfig-one    default
./_output/bin/darwin_arm64/up ctp list
NAME   ID                                     STATUS      MESSAGE   CONNECTION NAME   CONNECTION NAMESPACE
one    cd47bda5-cf80-44da-92bf-88217e375e82   Available             kubeconfig-one    default
kubectl get ctp
NAME   READY   MESSAGE   AGE
one    True              4m48s
  1. Create second control plane
    ./_output/bin/darwin_arm64/up ctp create two
    two created
    kubectl get ctp
    NAME   READY   MESSAGE                AGE
    one    True                           4m57s
    two    False   Waiting for start up   5s
    ./_output/bin/darwin_arm64/up ctp get two
    NAME   ID                                     STATUS     MESSAGE                CONNECTION NAME   CONNECTION NAMESPACE
    two    1dbef2a1-b166-4a0b-acff-2b881a5ae3f2   Creating   Waiting for start up   kubeconfig-two    default
    ./_output/bin/darwin_arm64/up ctp list
    NAME   ID                                     STATUS      MESSAGE                CONNECTION NAME   CONNECTION NAMESPACE
    one    cd47bda5-cf80-44da-92bf-88217e375e82   Available                          kubeconfig-one    default
    two    1dbef2a1-b166-4a0b-acff-2b881a5ae3f2   Creating    Waiting for start up   kubeconfig-two    default
  2. Delete control plane
    ./_output/bin/darwin_arm64/up ctp delete two
    two deleted
    ./_output/bin/darwin_arm64/up ctp list
    NAME   ID                                     STATUS      MESSAGE   CONNECTION NAME   CONNECTION NAMESPACE
    one    cd47bda5-cf80-44da-92bf-88217e375e82   Available             kubeconfig-one    default
    ./_output/bin/darwin_arm64/up ctp get two
    Control plane two not found
    kubectl get ctp
    NAME   READY   MESSAGE   AGE
    one    True              5m23s