-
Notifications
You must be signed in to change notification settings - Fork 357
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
feat: [LKEAPIFW-428] LKE clusters should have IP ACL integration on CM (part 1) #10968
base: develop
Are you sure you want to change the base?
Conversation
Thanks for the contribution @talmai. Would you please move this to Draft until it's ready to be reviewed? |
7b7310e
to
4cd457e
Compare
…s; IPACL drawer showing enabled only when enabled wip
8870af0
to
265a3ca
Compare
Can someone help me get the changeset together? I keep hitting the following error:
|
Just pushed up a changeset! (I had to run the Giving a quick glance over the files - seems like there are a few new components and flows. Will there be test coverage added later/is there a ticket for it already? |
Coverage Report: ✅ |
packages/manager/src/features/Kubernetes/CreateCluster/ControlPlaneACLPane.tsx
Outdated
Show resolved
Hide resolved
Hi @talmai! I'm seeing a test has failed repeatedly in
yarn cy:run -s "cypress/e2e/core/kubernetes/lke-create.spec.ts" (You might have to follow our Cypress first time setup docs, but feel free to reach out on Slack if you have any questions or run into any trouble) |
Thanks @talmai! I'm not familiar with the timelines for this project besides that this PR needs to make it to the next release, but I think a future ticket for API work to be done would make sense! And then we'd just be able to surface that new error for the frontend. I just pushed up some changes after meeting with Daniel:
There's still one margin/padding issue that is being a bit more finicky than I expected, so looking into that a bit more 😅 |
packages/manager/src/features/Kubernetes/KubernetesClusterDetail/KubeControlPaneACLDrawer.tsx
Outdated
Show resolved
Hide resolved
Checked with Daniel - the design should be all set now, but we will need some new copies. Hopefully they'll be in by Wednesday/in time for the release branch being cut, otherwise this might need to be pointed to the release branch. |
packages/manager/src/features/Kubernetes/KubernetesClusterDetail/KubeClusterControlPlaneACL.tsx
Outdated
Show resolved
Hide resolved
packages/manager/src/features/Kubernetes/KubernetesClusterDetail/KubeSummaryPanel.styles.tsx
Outdated
Show resolved
Hide resolved
@coliu-akamai will handle the rest of the work needed here. @talmai will leave code comments surrounding the parts where we need to ensure we're accounting for certain edge cases when creating clusters. |
@@ -46,8 +46,14 @@ import { Interception } from 'cypress/types/net-stubbing'; | |||
const expectedGranularityArray = ['Auto', '1 day', '1 hr', '5 min']; | |||
const timeDurationToSelect = 'Last 24 Hours'; | |||
|
|||
const { metrics, id, serviceType, dashboardName, region, resource } = | |||
widgetDetails.linode; | |||
const { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like this file and factories/dashboards.ts
snuck in as eslint fixes while I was resolving conflicts - gonna leave them in this PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@talmai ty for the additional comments! They've been super helpful in providing context.
@jdamore-linode took a look at lke-create.spec.ts
- I've seen it failing pretty consistently in the github checks, but then it's been passing relatively consistently for me, locally... 😕🤔 it failed for me once when some region was selected (I think Amsterdam?) that led to some checkbox not being checked above the Create button, disabling the Create button - could that have been an issue?
I'm planning to write e2e tests for the new flows (see my comment on M3-8725), will create another PR for them since this PR is already about ~900 added lines. Will be putting this up for review shortly - hopefully by tomorrow, just have a couple more things I want to look into
packages/manager/src/features/Kubernetes/KubernetesClusterDetail/KubeControlPaneACLDrawer.tsx
Outdated
Show resolved
Hide resolved
} = useForm({ | ||
values: { | ||
enabled: !!enabled, | ||
ipv4: ipv4 ?? [stringToExtendedIP('')], | ||
ipv6: ipv6 ?? [stringToExtendedIP('')], | ||
'revision-id': revisionID, | ||
}, | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to get these values to match KubernetesControlPlaneACLPayload
and do something like useForm<KubernetesControlPlaneACLPayload>
. However, we're using the ExtendedIP[]
type for the MultipleIPInput
components whereas KubernetesControlPlaneACLPayload
's IP fields are just string[]
- it's making it a bit difficult, but will test some more stuff out
update: will be keeping this for the most part - it's now in the shape of { acl: { ...those above fields}}, which is a bit closer to the shape of KubernetesControlPlaneACLPayload
🥲
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really think we should eliminate ExtendedIP
and align with KubernetesControlPlaneACLPayload
if possible. I don't find ExtendedIP
to be very maintainable because it diverges from the API's types and has error
on the type, which is bad because react-hook-form
has its own more correct way to handle errors.
How hard would the change be?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Happy to help look into this if needed. I really don't like "extended" types like this 😖
const { | ||
data: data, | ||
error: isErrorKubernetesACL, | ||
isFetching: isFetchingKubernetesACL, | ||
isLoading: isLoadingKubernetesACL, | ||
refetch: refetchKubernetesACL, | ||
} = useKubernetesControlPlaneACLQuery(clusterId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will be making another version to lift this query and the data up into the parent and pass it down to the drawer >> didn't go too deep with the other version, prefer this version more tbh (but I can return to it if needed!)
forVPCIPv4Ranges || isLinkStyled ? ( | ||
<StyledLinkButtonBox sx={{ marginTop: isLinkStyled ? '8px' : '12px' }}> | ||
<LinkButton onClick={addNewInput}>{buttonText}</LinkButton> | ||
</StyledLinkButtonBox> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
introduced a new prop, isLinkStyled
, because of the margin differences (and forVPCIPv4Ranges
does additional things) - this does feel a bit jank/not clean, but not too sure what else to do 🥲...will keep thinking but putting this up for review
Description 📝
Enables creation of LKE clusters with IP ACLS; enables updates of already migrated clusters
Changes 🔄
*** tests will be on a separate PR
Target release date 🗓️
Oct 28th release
Preview 📷
Cluster creation:
Cluster summary:
New IPACL Drawer:
How to test 🧪
Spin up this branch, update to reach alpha's apinext backend. Once all set, attempt to create new clusters with ipacls and then update them.
Prerequisites
See how to test
Verification steps
As an Author I have considered 🤔
Check all that apply