Skip to content

Conversation

@tomleb
Copy link
Contributor

@tomleb tomleb commented Nov 27, 2025

Issue rancher/rancher#52774

Unfortunately, we cannot get rid of those columns yet for two reasons:

  1. Duration to Timestamp back to Duration is lossy, doing that for all CRDs would be a regression IMO
  2. The UI doesn't currently work very well with dates that are from CRDs and that aren't the Age column. So instead of showing a pretty printed date, we get Invalid Date column shown. Fixing that involves a bigger change (sending a timestamp instead of duration to the UI which I'm not willing to make from the little time we have before 2.13.1.

So the fix here is adding the missing default columns and calling it a day for now. This PR adds a bunch of tests to try and cover as much as possible so that next time we do make changes, we'll know about regressions and what changes.

Note: While working on this, I discovered the filtering/sorting for fields for CRDs with column is broken. UI has created the following: rancher/dashboard#16071. Since this isn't a regression introduced by this PR, we should still review and merge it.

@tomleb tomleb requested a review from a team as a code owner November 27, 2025 17:36
- [bar, foo, $skip, $duration]
- schemaID: timestamps.cattle.io.dates
expected:
- [the-date, $duration, $duration, $duration, $timestamp, $duration, $timestamp]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The $timestamp ones are because the type is a string for those columns

@tomleb tomleb marked this pull request as draft November 27, 2025 18:22
@tomleb
Copy link
Contributor Author

tomleb commented Nov 27, 2025

Seems like this also results in some issues where sorting doesn't work on fields from CRDs 🤔

return nil, err
}

fieldSet := make(map[string]struct{})
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We want to avoid duplicated fields here.

We don't support multiple columns pointing to the same json path. Adding support will require more work from both UI and backend -> We need to have an ID for a field and its json path (or get rid of the json path altogether, but that brings its own set of complications).

@tomleb
Copy link
Contributor Author

tomleb commented Nov 28, 2025

Ok, it works with the UI change here: rancher/dashboard#16073

@tomleb tomleb marked this pull request as ready for review November 28, 2025 15:45
@tomleb tomleb force-pushed the columns-fix branch 2 times, most recently from 9e1fe71 to 6a3abac Compare December 8, 2025 17:54
Name: "Name",
Type: "string",
Format: "name",
// Not setting description here because we don't set it above, might want to revisit
Copy link
Contributor

Choose a reason for hiding this comment

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

"above" doesn't really make sense here - assume this code was moved around

- --wait=true
- fleet
- /home/shell/helm/fleet-108.0.0-up0.14.0-rc.1.tgz
# conditions:
Copy link
Contributor

Choose a reason for hiding this comment

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

What's with all the commented code?

Copy link
Contributor

@ericpromislow ericpromislow left a comment

Choose a reason for hiding this comment

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

Just some minor things on comments. I ran tests, including new tests with old code (they failed as expected). There's a lot here, but I didn't find a reason not to merge it.

@crobby
Copy link
Contributor

crobby commented Dec 11, 2025

Issue rancher/rancher#52774

Unfortunately, we cannot get rid of those columns yet for two reasons:

  1. Duration to Timestamp back to Duration is lossy, doing that for all CRDs would be a regression IMO
  2. The UI doesn't currently work very well with dates that are from CRDs and that aren't the Age column. So instead of showing a pretty printed date, we get Invalid Date column shown. Fixing that involves a bigger change (sending a timestamp instead of duration to the UI which I'm not willing to make from the little time we have before 2.13.1.

So the fix here is adding the missing default columns and calling it a day for now. This PR adds a bunch of tests to try and cover as much as possible so that next time we do make changes, we'll know about regressions and what changes.

Note: While working on this, I discovered the filtering/sorting for fields for CRDs with column is broken. UI has created the following: rancher/dashboard#16071. Since this isn't a regression introduced by this PR, we should still review and merge it.

Does this issue moving out to 2.14.0 have any impact on your decision against making the "bigger change" that you reference above?

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.

3 participants