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

Implement coder images ls #189

Merged
merged 1 commit into from
Nov 16, 2020
Merged

Conversation

fuskovic
Copy link
Contributor

@fuskovic fuskovic commented Nov 15, 2020

What this does

Allows users to list imported images.

By default, a coder images ls will list every imported image for every organization a user belongs to.

The default output is a human-readable table that describes the default resource amounts for each image :

Repository                                               DefaultTag    DefaultCPUCores    DefaultMemoryGB    DefaultDiskGB    
ubuntu                                                   latest        1                  1                  10               
nixos/nix                                                latest        2                  2                  10               
cdecelles/sts                                            latest        1                  1                  10               
java                                                     6             1                  1                  10               
codercom/enterprise-datascience                          latest        4                  4                  10               
debian                                                   latest        1                  1                  10               
kmhcdr/coder                                             latest        1                  1                  10               
codercom/enterprise-dev                                  latest        4                  4                  11               
npotter/ubuntu-goland                                    latest        2                  2                  30               
mysql                                                    8.0.21        2                  8                  10               
coderenterprise/react                                    latest        1                  1                  10               
teffencoder/vnc                                          8.0           4                  8                  16               
vapurrmaid/coder                                         latest        1                  1                  10               
redis                                                    latest        8                  2                  11               
docker                                                   dind          1                  1                  10               
ubuntu                                                   latest        1                  1                  10               
wbobeirne/coder-react                                    latest        2                  2                  11               
ncbi/blast                                               latest        2                  4                  10               
codercom/intellij                                        latest        1                  1                  10               
victoriabernard92/notigervnc                             latest        1                  1                  10               
kylecarbs/jetbrains-goland                               latest        1                  1                  10               
marktmilligan/ds                                         latest        1                  1                  10               
codercom/enterprise-base                                 ubuntu        1                  1                  10               
codercom/enterprise-intellij                             ubuntu        1                  1                  10               
victoriabernard92/react                                  latest        1                  1                  10               
invoicerco/invoicer-chromium                             19a6aed       1                  1                  10               
commodustech/turbovnc-base                               latest        4                  16                 16               
marktmilligan/rubyonrails                                latest        1                  1                  10               
codercom/enterprise-vnc                                  ubuntu        4                  16                 32               
invoicerco/invoicer                                      19a6aed       4                  4                  10               
codercom/enterprise-golang                               ubuntu        1                  1                  10               
scsmithr/com.coder.enterprise.kubernetes.microservice    latest        1                  1                  10               
codercom/enterprise-node                                 ubuntu        1                  1                  10    

Users can filter images by organization using the --org flag.

Users may optionally choose to have the images output in a pretty-printed JSON format using --output json.

@fuskovic fuskovic requested a review from cmoog November 15, 2020 13:17
Copy link
Contributor

@cmoog cmoog left a comment

Choose a reason for hiding this comment

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

Looking solid. Just a few language and code nits and here and there.

if outputFmt == jsonOutput {
enc := json.NewEncoder(os.Stdout)
// pretty print the json
enc.SetIndent("", "\t")
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice 💯

@fuskovic
Copy link
Contributor Author

I pushed up the suggested changes and updated the PR description to reflect the new human-readable output that includes the image tag now.

If any of the command usage copy looks off or reads awkward, lmk what text you think we should have in its place.

@fuskovic fuskovic requested a review from cmoog November 16, 2020 13:31
@fuskovic fuskovic force-pushed the faris/2456/implement-coder-images-ls branch from 3b2afa4 to 30126a3 Compare November 16, 2020 16:27
@fuskovic fuskovic merged commit d14be73 into master Nov 16, 2020
@fuskovic fuskovic deleted the faris/2456/implement-coder-images-ls branch November 16, 2020 16:33
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