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

✨ [WIP] Add support for kubectl printer columns #1019

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kevinrizza
Copy link
Member

@kevinrizza kevinrizza commented Jul 8, 2024

Adds installed version, resolved version and age printer columns

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)

Adds installed version, resolved version and age printer columns

Signed-off-by: kevinrizza <krizza@redhat.com>
@kevinrizza kevinrizza requested a review from a team as a code owner July 8, 2024 19:32
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 8, 2024
@kevinrizza
Copy link
Member Author

These seem like reasonable printer columns to me, but we should have some agreement that these make the most sense before committing to them. Leaving this as a WIP pr for now.

Copy link

netlify bot commented Jul 8, 2024

Deploy Preview for olmv1 ready!

Name Link
🔨 Latest commit 2fd9441
🔍 Latest deploy log https://app.netlify.com/sites/olmv1/deploys/668c3ec963ac8f0008d7595a
😎 Deploy Preview https://deploy-preview-1019--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 Jul 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.05%. Comparing base (235e3d4) to head (2fd9441).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1019   +/-   ##
=======================================
  Coverage   78.05%   78.05%           
=======================================
  Files          18       18           
  Lines        1253     1253           
=======================================
  Hits          978      978           
  Misses        193      193           
  Partials       82       82           
Flag Coverage Δ
e2e 56.65% <ø> (ø)
unit 53.47% <ø> (ø)

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.

Copy link
Member

@joelanford joelanford left a comment

Choose a reason for hiding this comment

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

Do you know if there's a way to set a default value in the printer column if the json path evaluates to null or empty string?

Related: I'm wondering if there's a nice way to get useful information to show up if there are issues resolving or installing a bundle.

I found this kubernetes/enhancements#4602, but obviously not usable yet.

@kevinrizza
Copy link
Member Author

@joelanford I looked around and didn't find anything. Imo we should keep this pr held until we make some improvements to the availability of this metadata. I'm also interested in any other thoughts on other columns we might want to have.

@kevinrizza kevinrizza changed the title [WIP] Add support for kubectl printer columns ✨ [WIP] Add support for kubectl printer columns Jul 12, 2024
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 12, 2024
@@ -183,6 +183,9 @@ type ClusterExtensionStatus struct {
//+kubebuilder:object:root=true
//+kubebuilder:resource:scope=Cluster
//+kubebuilder:subresource:status
//+kubebuilder:printcolumn:name="Installed Version",type=string,JSONPath=`.status.installedBundle.version`
Copy link
Contributor

Choose a reason for hiding this comment

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

is it possible to float up any of the conditions or errors? As a user it would be good to understand: where the CR is in its progression, version state (as above), and some kind of sense of where it stopped (and possibly why?)

Copy link
Member

Choose a reason for hiding this comment

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

I think it is possible to write JSON path to do something like "find condition with type "Installed" and tell me it's reason", but that might not be all that helpful because:

  1. Showing details of every condition type would get pretty verbose
  2. Only showing details of some condition types could be misleading.

I wonder if, after @bentito's work to wrangle condition updates to reflect reality better, we could do something where right before we send out the status update we pass the conditions into a function that returns $something that somewhat summarizes the state of the conditions. For example:

  • Installed=False, Progressing=False => "Failed"
  • Installed=False, Progressing=True => "Installing"
  • Installed=True, Progressing=False, Healthy=False => "Unhealthy"
  • Installed=True, Progressing=False, Healthy=True => "Ready"
  • Installed=True, Progressing=True => "Upgrading"
  • etc.

Copy link
Contributor

Choose a reason for hiding this comment

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

That could be cool. It would just be nice to get some signal without having to inspect the whole status.

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
3 participants