feat: Add tolerations to WorkspaceKind Form#1044
feat: Add tolerations to WorkspaceKind Form#1044thaorell wants to merge 7 commits intokubeflow:notebooks-v2from
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
cf490af to
74ef428
Compare
|
/ok-to-test |
83f6d47 to
4fdc88e
Compare
d2d6d5a to
f2fbb62
Compare
caponetto
left a comment
There was a problem hiding this comment.
Left a few comments, please check if they make sense.
Only one UI observation (not blocker): The Toleration modal has a state where Toleration Seconds is not shown, for instance:
When the item is added, the column is displayed, though:
This could confuse users about where that comes from. I would rather disable Toleration Seconds with a helper reason than hide it.
| const tolerationSettersCache = useRef( | ||
| new Map<number, React.Dispatch<React.SetStateAction<TolerationEntry[]>>>(), | ||
| ); | ||
| const modalSettersCache = useRef( | ||
| new Map<number, React.Dispatch<React.SetStateAction<boolean>>>(), | ||
| ); |
There was a problem hiding this comment.
tolerationSettersCache and modalSettersCache are Map<number, ...> refs that grow monotonically; entries are never removed when pod configs are deleted. While functionally correct (the useMemo re-maps fresh indices), the caches accumulate stale closures over time. For a form with frequent add/remove cycles, consider clearing the caches when podConfig.values.length changes, or switching to a useMemo-based approach without manual caching.
There was a problem hiding this comment.
I'm applying a fix to delete stale cache entries in handleDelete, so when a config is deleted, the config's tolerations will be deleted as well
| } | ||
|
|
||
| export enum TolerationOperator { | ||
| None = '', |
There was a problem hiding this comment.
TolerationOperator.None = '' and TolerationEffect.None = '' use empty strings as enum values. When these are serialized and sent to the backend (or eventually to the Kubernetes API), empty strings may behave differently from an omitted field. Please confirm that the backend handles empty-string operator/effect correctly, or consider using undefined/omission to represent "no selection" and making the field optional in TolerationEntry.
There was a problem hiding this comment.
After reading the Kubernetes docs in depth, I am setting the default Operator to Equal
There was a problem hiding this comment.
I also added a description for a None effect, which will be coerced to undefined upon submission
| )} | ||
| {podConfig.values.length > 0 && ( | ||
| <> | ||
| <div className="pf-v6-u-pl-xl pf-v6-u-pt-sm pf-v6-u-pb-sm"> |
There was a problem hiding this comment.
The descriptive text block uses raw <div> elements with PatternFly utility classes. Since Content is already imported, prefer <Content component="p"> for the description paragraph. This ensures consistent typography and spacing from PatternFly's design system rather than relying on utility classes alone.
d40e9b2 to
6e099c5
Compare
|
/lgtm |
Signed-off-by: Charles Thao <cthao@redhat.com>
Signed-off-by: Charles Thao <cthao@redhat.com>
Signed-off-by: Charles Thao <cthao@redhat.com>
Signed-off-by: Charles Thao <cthao@redhat.com>
Signed-off-by: Charles Thao <cthao@redhat.com>
Signed-off-by: Charles Thao <cthao@redhat.com>
6e099c5 to
5cc657d
Compare
|
/lgtm |
closes: #1019
Added:
Valueinput if the operator isExistsand only render Toleration seconds field if the effect isNoExecuteBefore:

After:

