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

feature(cmx): add network column to 'vm ls' and 'cluster ls' #509

Merged
merged 2 commits into from
Feb 19, 2025

Conversation

squizzi
Copy link
Contributor

@squizzi squizzi commented Feb 19, 2025

The network column prints the short "network_id" affiliated with the VM or cluster.

Before

$  replicated vm ls
ID          NAME                           DISTRIBUTION    VERSION       STATUS          CREATED                           EXPIRES                           COST
cef438fe    affectionate_wescoff           ubuntu          24.04         running         2025-02-19 11:40 PST              2025-02-19 15:40 PST              $0.88

$  replicated vm ls --output wide
ID          NAME                           DISTRIBUTION    VERSION       STATUS          CREATED                           EXPIRES                           COST           TAGS
cef438fe    affectionate_wescoff           ubuntu          24.04         running         2025-02-19 11:40 PST              2025-02-19 15:40 PST              $0.88

$ replicated cluster ls
ID          NAME                           DISTRIBUTION    VERSION       STATUS          CREATED                           EXPIRES                           COST
79578f57    kind-test                      kind            1.32.1        running         2025-02-19 11:17 PST              2025-02-19 12:20 PST              $0.60

$ replicated cluster ls --output wide
ID          NAME                           DISTRIBUTION    VERSION       STATUS          CREATED                           EXPIRES                           COST           TOTAL NODES    NODEGROUPS    TAGS
79578f57    kind-test                      kind            1.32.1        running         2025-02-19 11:17 PST              2025-02-19 12:20 PST              $0.60          1              1

After

$ ./bin/replicated vm ls
ID          NAME                           DISTRIBUTION    VERSION       STATUS     NETWORK      CREATED                           EXPIRES                           COST
cef438fe    affectionate_wescoff           ubuntu          24.04         running    89c8e80b     2025-02-19 11:40 PST              2025-02-19 15:40 PST              $0.88

$ ./bin/replicated vm ls --output wide
ID          NAME                           DISTRIBUTION    VERSION       STATUS     NETWORK      CREATED                           EXPIRES                           COST           TAGS
cef438fe    affectionate_wescoff           ubuntu          24.04         running    89c8e80b     2025-02-19 11:40 PST              2025-02-19 15:40 PST              $0.88

$  ./bin/replicated cluster ls
ID          NAME                           DISTRIBUTION    VERSION       STATUS     NETWORK       CREATED                           EXPIRES                           COST
79578f57    kind-test                      kind            1.32.1        running    bf4e5dcc      2025-02-19 11:17 PST              2025-02-19 12:20 PST              $0.60

$ ./bin/replicated cluster ls --output wide
ID          NAME                           DISTRIBUTION    VERSION       STATUS     NETWORK       CREATED                           EXPIRES                           COST           TOTAL NODES    NODEGROUPS    TAGS
79578f57    kind-test                      kind            1.32.1        running    bf4e5dcc      2025-02-19 11:17 PST              2025-02-19 12:20 PST              $0.60          1              1

The network column prints the short "network_id"
affiliated with the VM or cluster.

Signed-off-by: Kyle Squizzato <kyle@replicated.com>
Copy link
Member

@jdewinne jdewinne left a comment

Choose a reason for hiding this comment

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

What if Network is not defined? Does the string contain -?
This is the case for cloud based clusters

@squizzi
Copy link
Contributor Author

squizzi commented Feb 19, 2025

What if Network is not defined? Does the string contain -?

I didn't think we could get into that case, I forgot about cloud based. I'll add that. I think while I'm here I should fix TAGS not being a - when unset too.

Edit:

 ./bin/replicated cluster ls
ID          NAME                           DISTRIBUTION    VERSION       STATUS       NETWORK       CREATED                           EXPIRES                           COST
0f7dbac8    compassionate_rhodes           eks             1.32          verifying    -             2025-02-19 13:00 PST              -                                 $0.62

./bin/replicated cluster ls --output wide
ID          NAME                           DISTRIBUTION    VERSION       STATUS       NETWORK       CREATED                           EXPIRES                           COST           TOTAL NODES    NODEGROUPS    TAGS
0f7dbac8    compassionate_rhodes           eks             1.32          running      -             2025-02-19 13:00 PST              2025-02-19 14:03 PST              $0.62          1              1             -

# And tags for VMs
./bin/replicated vm ls --output wide
ID          NAME                           DISTRIBUTION    VERSION       STATUS        NETWORK      CREATED                           EXPIRES                           COST           TAGS
cef438fe    affectionate_wescoff           ubuntu          24.04         running       89c8e80b     2025-02-19 11:40 PST              2025-02-19 15:40 PST              $0.88          -
cc03ddb3    nervous_khayyam                ubuntu          24.04         running       98c2887f     2025-02-19 13:18 PST              2025-02-20 13:19 PST              $2.80          key=value

Signed-off-by: Kyle Squizzato <kyle@replicated.com>
@squizzi squizzi requested a review from jdewinne February 19, 2025 21:19
@squizzi squizzi merged commit ff543f7 into main Feb 19, 2025
5 checks passed
@squizzi squizzi deleted the squizzi/sc-119886/connected-networks branch February 19, 2025 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants