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

Droplet resource additional printer columns #61

Conversation

v-ctiutiu
Copy link
Contributor

Signed-off-by: Cristian Marius Tiutiu v-ctiutiu@digitalocean.com

Description of your changes

This PR adds the ability to print additional columns for droplet resources. It helps visually to have droplet metadata displayed whenever you issue kubectl get droplet commands. On the other hand, it is useful when doing automations (via scripting), because you can fetch droplet information via the CLI.

Examples:

  1. Fetch droplet resources with additional details:

    $ kubectl get droplets
    
    NAME          PRIVATE IPV4   PUBLIC IPV4      READY   REGION   SIZE          SYNCED
    nat-gw-nyc1   10.116.0.4     142.93.205.215   True    nyc1     s-1vcpu-1gb   True
  2. Extract various fields using kubectl:

  • Droplet private IP:

    $ kubectl get droplet nat-gw-nyc1 -o jsonpath="{.status.atProvider.privateIPv4}"
    
    # Outputs - 10.116.0.4
  • Droplet public IP:

    $ kubectl get droplet nat-gw-nyc1 -o jsonpath="{.status.atProvider.publicIPv4}"
    
    # Outputs - 142.93.205.215
  • Droplet region slug:

    $ kubectl get droplet nat-gw-nyc1 -o jsonpath="{.status.atProvider.region}"
    
    # Outputs - nyc1
  • Droplet size slug:

    $ kubectl get droplet nat-gw-nyc1 -o jsonpath="{.status.atProvider.size}"
    
    # Outputs - s-1vcpu-1gb 

I have:

  • Read and followed Crossplane's [contribution process].
  • Run make reviewable test to ensure this PR is ready for review.

How has this code been tested

Ran locally using a kind cluster.

Signed-off-by: Cristian Marius Tiutiu <v-ctiutiu@digitalocean.com>
Copy link
Contributor

@ADustyOldMuffin ADustyOldMuffin left a comment

Choose a reason for hiding this comment

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

Very cool update!

@ADustyOldMuffin ADustyOldMuffin merged commit 0932045 into crossplane-contrib:main Sep 9, 2022
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 this pull request may close these issues.

None yet

2 participants