Skip to content

✨ Add support for kubectl printer columns #1421

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

Merged
merged 1 commit into from
Nov 5, 2024

Conversation

tmshort
Copy link
Contributor

@tmshort tmshort commented Nov 1, 2024

Unless we add another .status field, this is what we can do. Only simple queries starting with . can be used.

Alternative to: #1019

Resolves #1018

Description

Reviewer Checklist

  • API Go Documentation
  • Tests: Unit Tests (and E2E Tests, if appropriate)
  • Comprehensive Commit Messages
  • Links to related GitHub Issue(s)

Unless we add another `.status` field, this is what we can do.
Only simple queries starting with `.` can be used.

Signed-off-by: Todd Short <[email protected]>
@tmshort tmshort requested a review from a team as a code owner November 1, 2024 14:18
Copy link

netlify bot commented Nov 1, 2024

Deploy Preview for olmv1 ready!

Name Link
🔨 Latest commit 512915d
🔍 Latest deploy log https://app.netlify.com/sites/olmv1/deploys/6724e3522add3a00082ab63b
😎 Deploy Preview https://deploy-preview-1421--olmv1.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

codecov bot commented Nov 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.45%. Comparing base (cd0b096) to head (512915d).
Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1421      +/-   ##
==========================================
+ Coverage   73.30%   73.45%   +0.15%     
==========================================
  Files          42       42              
  Lines        3057     3063       +6     
==========================================
+ Hits         2241     2250       +9     
+ Misses        643      640       -3     
  Partials      173      173              
Flag Coverage Δ
e2e 55.33% <ø> (-0.08%) ⬇️
unit 52.59% <ø> (+0.38%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

//+kubebuilder:printcolumn:name="Installed Bundle",type=string,JSONPath=`.status.install.bundle.name`
//+kubebuilder:printcolumn:name=Version,type=string,JSONPath=`.status.install.bundle.version`
//+kubebuilder:printcolumn:name="Installed",type=string,JSONPath=`.status.conditions[?(@.type=='Installed')].status`
//+kubebuilder:printcolumn:name="Progressing",type=string,JSONPath=`.status.conditions[?(@.type=='Progressing')].status`
Copy link
Contributor

Choose a reason for hiding this comment

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

Add Progressing condition reason as well?

Copy link
Contributor Author

@tmshort tmshort Nov 4, 2024

Choose a reason for hiding this comment

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

With that, it can get pretty wide, as it's a non-constrained string. That might be something they need to use the -o yaml for.

@LalatenduMohanty
Copy link
Member

@tmshort Can you give an example of the output/outputs before and after printer columns?

@tmshort
Copy link
Contributor Author

tmshort commented Nov 4, 2024

main:

$ kubectl oc get clusterextensions.olm.operatorframework.io
NAME                        AGE
clusterextension-xt6zb6dc   2s

With this PR:

$ kubectl get clusterextensions.olm.operatorframework.io
NAME                        INSTALLED BUNDLE   VERSION   INSTALLED   PROGRESSING   AGE
clusterextension-pxjvf5z6                                False       True          1s
$ kubectl get clusterextensions.olm.operatorframework.io
NAME                        INSTALLED BUNDLE            VERSION   INSTALLED   PROGRESSING   AGE
clusterextension-pxjvf5z6   prometheus-operator.1.2.0   1.2.0     True        False         3s

Copy link
Member

@m1kola m1kola left a comment

Choose a reason for hiding this comment

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

Looks good to me. Thanks for finalising it.

@LalatenduMohanty LalatenduMohanty added this pull request to the merge queue Nov 5, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 5, 2024
@tmshort tmshort added this pull request to the merge queue Nov 5, 2024
Merged via the queue into operator-framework:main with commit 6bda277 Nov 5, 2024
19 checks passed
@tmshort tmshort deleted the cli branch November 5, 2024 22:04
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.

Add default printer columns for clusterextensions
4 participants