Repository navigation
upcoming: [M3-10377] - Add node pool firewall selection to LKE-E create flow #12712
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
mjac0bs
merged 9 commits into
linode:develop
from
mjac0bs:M3-10377-add-node-pool-firewall-selection-to-lke-e-create-flow
Aug 19, 2025
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
ee3d1f8
Add Node Pool firewall select component to config drawer
f111f5f
Update NodePoolConfigDrawer to submit firewall_id with node pools
e34f5df
Set the firewall_id correctly when editing an existing node pool
a8d2376
Improve naming for update_strategy form value
7837688
Added changeset: Add node pool firewall selection to LKE-E create flow
e079bee
Address feedback: correctly type the form with useFormContext hook
913e7ed
Merge branch 'develop' into M3-10377-add-node-pool-firewall-selectionβ¦
a4d7b3c
More types improvements
6506662
Address feedback: prefer useWatch, remove unneeded test-id
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
packages/manager/.changeset/pr-12712-upcoming-features-1755291113192.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@linode/manager": Upcoming Features | ||
| --- | ||
|
|
||
| Add node pool firewall selection to LKE-E create flow ([#12712](https://github.com/linode/manager/pull/12712)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 17 additions & 11 deletions
28
packages/manager/src/features/Kubernetes/KubernetesPlansPanel/NodePoolConfigOptions.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,21 +1,27 @@ | ||
| import * as React from 'react'; | ||
| import { Controller, useFormContext } from 'react-hook-form'; | ||
|
|
||
| import { NodePoolFirewallSelect } from '../NodePoolFirewallSelect'; | ||
| import { NodePoolUpdateStrategySelect } from '../NodePoolUpdateStrategySelect'; | ||
|
|
||
| import type { CreateNodePoolData } from '@linode/api-v4'; | ||
|
|
||
| export const NodePoolConfigOptions = () => { | ||
| const { control } = useFormContext(); | ||
| const { control } = useFormContext<CreateNodePoolData>(); | ||
|
|
||
| return ( | ||
| <Controller | ||
| control={control} | ||
| name="updateStrategy" | ||
| render={({ field }) => ( | ||
| <NodePoolUpdateStrategySelect | ||
| onChange={field.onChange} | ||
| value={field.value} | ||
| /> | ||
| )} | ||
| /> | ||
| <> | ||
| <Controller | ||
| control={control} | ||
| name="update_strategy" | ||
| render={({ field }) => ( | ||
| <NodePoolUpdateStrategySelect | ||
| onChange={field.onChange} | ||
| value={field.value} | ||
| /> | ||
| )} | ||
| /> | ||
| <NodePoolFirewallSelect /> | ||
| </> | ||
| ); | ||
| }; |
77 changes: 77 additions & 0 deletions
77
packages/manager/src/features/Kubernetes/NodePoolFirewallSelect.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| import { | ||
| FormControlLabel, | ||
| Radio, | ||
| RadioGroup, | ||
| Stack, | ||
| Typography, | ||
| } from '@linode/ui'; | ||
| import React from 'react'; | ||
| import { Controller, useFormContext, useWatch } from 'react-hook-form'; | ||
|
|
||
| import { FirewallSelect } from '../Firewalls/components/FirewallSelect'; | ||
|
|
||
| import type { CreateNodePoolData } from '@linode/api-v4'; | ||
|
|
||
| export const NodePoolFirewallSelect = () => { | ||
| const { control } = useFormContext<CreateNodePoolData>(); | ||
| const watchedFirewallId = useWatch({ control, name: 'firewall_id' }); | ||
|
|
||
| const [isUsingOwnFirewall, setIsUsingOwnFirewall] = React.useState( | ||
| Boolean(watchedFirewallId) | ||
| ); | ||
|
|
||
| return ( | ||
| <Stack marginTop={3}> | ||
| <Typography | ||
| sx={(theme) => ({ | ||
| font: theme.tokens.alias.Typography.Label.Bold.S, | ||
| })} | ||
| > | ||
| Firewall | ||
| </Typography> | ||
| <RadioGroup | ||
| aria-label="Bring your own firewall" | ||
| onChange={(e: React.ChangeEvent<HTMLInputElement>) => { | ||
| setIsUsingOwnFirewall(e.target.value === 'yes'); | ||
| }} | ||
| value={isUsingOwnFirewall} | ||
| > | ||
| <FormControlLabel | ||
| checked={!isUsingOwnFirewall} | ||
| control={<Radio />} | ||
| label="Use default firewall" | ||
| value="no" | ||
| /> | ||
| <FormControlLabel | ||
| checked={isUsingOwnFirewall} | ||
| control={<Radio />} | ||
| label="Select existing firewall" | ||
| value="yes" | ||
| /> | ||
| </RadioGroup> | ||
| {isUsingOwnFirewall && ( | ||
| <Controller | ||
| control={control} | ||
| name="firewall_id" | ||
| render={({ field, fieldState }) => ( | ||
| <FirewallSelect | ||
| errorText={fieldState.error?.message} | ||
| onBlur={field.onBlur} | ||
| onChange={(e, firewall) => field.onChange(firewall?.id ?? null)} | ||
| placeholder="Select firewall" | ||
| value={field.value} | ||
| /> | ||
| )} | ||
| rules={{ | ||
| validate: (value) => { | ||
| if (isUsingOwnFirewall && !value) { | ||
| return 'You must either select a Firewall or select the default firewall.'; | ||
| } | ||
| return true; | ||
| }, | ||
| }} | ||
| /> | ||
| )} | ||
| </Stack> | ||
| ); | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.