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

change: LKE ACL copy and placeholder updates #11173

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 13 additions & 11 deletions packages/manager/cypress/e2e/core/kubernetes/lke-update.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1485,7 +1485,9 @@ describe('LKE ACL updates', () => {
.clear()
.type('10.0.0.0/24');
cy.findByText('IPv6 Addresses or CIDRs').should('be.visible');
cy.findByPlaceholderText('::/0').should('be.visible');
cy.findByLabelText('IPv6 Addresses or CIDRs ip-address-0').should(
'be.visible'
);
cy.findByText('Add IPv6 Address')
.should('be.visible')
.should('be.enabled');
Expand Down Expand Up @@ -1557,15 +1559,15 @@ describe('LKE ACL updates', () => {

// update IPv6 addresses
cy.findByDisplayValue('10.0.0.0/24').should('be.visible');
cy.findByPlaceholderText('::/0')
cy.findByLabelText('IPv6 Addresses or CIDRs ip-address-0')
.should('be.visible')
.click()
.type('8e61:f9e9:8d40:6e0a:cbff:c97a:2692:827e');
cy.findByText('Add IPv6 Address')
.should('be.visible')
.should('be.enabled')
.click();
cy.get('[id="domain-transfer-ip-1"]')
cy.findByLabelText('IPv6 Addresses or CIDRs ip-address-1')
.should('be.visible')
.click()
.type('f4a2:b849:4a24:d0d9:15f0:704b:f943:718f');
Expand Down Expand Up @@ -1699,7 +1701,7 @@ describe('LKE ACL updates', () => {
).should('be.visible');
cy.findByText('IPv4 Addresses or CIDRs').should('be.visible');
// update IPv4
cy.findByPlaceholderText('0.0.0.0/0')
cy.findByLabelText('IPv4 Addresses or CIDRs ip-address-0')
.should('be.visible')
.click()
.type('10.0.0.0/24');
Expand All @@ -1709,7 +1711,7 @@ describe('LKE ACL updates', () => {
.click();
cy.findByText('IPv6 Addresses or CIDRs').should('be.visible');
// update IPv6
cy.findByPlaceholderText('::/0')
cy.findByLabelText('IPv6 Addresses or CIDRs ip-address-0')
.should('be.visible')
.click()
.type('8e61:f9e9:8d40:6e0a:cbff:c97a:2692:827e');
Expand Down Expand Up @@ -1835,12 +1837,12 @@ describe('LKE ACL updates', () => {
cy.findByText('IPv4 Addresses or CIDRs').should('be.visible');
cy.findByText('IPv6 Addresses or CIDRs').should('be.visible');

cy.findByPlaceholderText('0.0.0.0/0')
cy.findByLabelText('IPv4 Addresses or CIDRs ip-address-0')
.should('be.visible')
.click()
.type('10.0.0.0/24');

cy.findByPlaceholderText('::/0')
cy.findByLabelText('IPv6 Addresses or CIDRs ip-address-0')
.should('be.visible')
.click()
.type('8e61:f9e9:8d40:6e0a:cbff:c97a:2692:827e');
Expand Down Expand Up @@ -1905,15 +1907,15 @@ describe('LKE ACL updates', () => {
.should('be.visible')
.within(() => {
// Confirm ACL IP validation works as expected for IPv4
cy.findByPlaceholderText('0.0.0.0/0')
cy.findByLabelText('IPv4 Addresses or CIDRs ip-address-0')
.should('be.visible')
.click()
.type('invalid ip');
// click out of textbox and confirm error is visible
cy.contains('Addresses').should('be.visible').click();
cy.contains('Must be a valid IPv4 address.').should('be.visible');
// enter valid IP
cy.findByPlaceholderText('0.0.0.0/0')
cy.findByLabelText('IPv4 Addresses or CIDRs ip-address-0')
.should('be.visible')
.click()
.clear()
Expand All @@ -1923,15 +1925,15 @@ describe('LKE ACL updates', () => {
cy.contains('Must be a valid IPv4 address.').should('not.exist');

// Confirm ACL IP validation works as expected for IPv6
cy.findByPlaceholderText('::/0')
cy.findByLabelText('IPv6 Addresses or CIDRs ip-address-0')
.should('be.visible')
.click()
.type('invalid ip');
// click out of textbox and confirm error is visible
cy.findByText('Addresses').should('be.visible').click();
cy.contains('Must be a valid IPv6 address.').should('be.visible');
// enter valid IP
cy.findByPlaceholderText('::/0')
cy.findByLabelText('IPv6 Addresses or CIDRs ip-address-0')
.should('be.visible')
.click()
.clear()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ export const ControlPlaneACLPane = (props: ControlPlaneACLProps) => {
<Typography mb={1} sx={{ width: '85%' }}>
Enable an access control list (ACL) on your LKE cluster to restrict
access to your cluster’s control plane. When enabled, only the IP
addresses and ranges specified by you can connect to the control
plane.
addresses and ranges you specify can connect to the control plane.
</Typography>
<FormControlLabel
control={
Expand All @@ -76,7 +75,6 @@ export const ControlPlaneACLPane = (props: ControlPlaneACLProps) => {
ips={ipV4Addr}
isLinkStyled
onChange={handleIPv4Change}
placeholder="0.0.0.0/0"
title="IPv4 Addresses or CIDRs"
/>
<Box marginTop={2}>
Expand All @@ -92,7 +90,6 @@ export const ControlPlaneACLPane = (props: ControlPlaneACLProps) => {
ips={ipV6Addr}
isLinkStyled
onChange={handleIPv6Change}
placeholder="::/0"
title="IPv6 Addresses or CIDRs"
/>
</Box>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,23 @@ export const KubeControlPlaneACLDrawer = (props: Props) => {
the ACL on your LKE cluster, update the list of allowed IP
addresses, and adjust other settings.
</StyledTypography>
{!clusterMigrated && (
<Notice spacingBottom={0} spacingTop={16} variant="warning">
<StyledTypography
sx={(theme) => ({
fontFamily: theme.font.bold,
fontSize: '15px',
})}
>
Control Plane ACL has not yet been installed on this cluster.
During installation, it may take up to 15 minutes for the
access control list to be fully enforced.
</StyledTypography>
</Notice>
)}
<Divider sx={{ marginBottom: 2, marginTop: 3 }} />
<Typography variant="h3">Activation Status</Typography>
<StyledTypography variant="body1">
<StyledTypography topMargin variant="body1">
Enable or disable the Control Plane ACL. If the ACL is not
enabled, any public IP address can be used to access your control
plane. Once enabled, all network access is denied except for the
Expand Down Expand Up @@ -202,7 +216,7 @@ export const KubeControlPlaneACLDrawer = (props: Props) => {
{clusterMigrated && (
<>
<Typography variant="h3">Revision ID</Typography>
<StyledTypography variant="body1">
<StyledTypography topMargin variant="body1">
A unique identifying string for this particular revision to
the ACL, used by clients to track events related to ACL update
requests and enforcement. This defaults to a randomly
Expand All @@ -226,7 +240,11 @@ export const KubeControlPlaneACLDrawer = (props: Props) => {
</>
)}
<Typography variant="h3">Addresses</Typography>
<StyledTypography sx={{ marginBottom: 1 }} variant="body1">
<StyledTypography
topMargin
sx={{ marginBottom: 1 }}
variant="body1"
>
A list of allowed IPv4 and IPv6 addresses and CIDR ranges. This
cluster&apos;s control plane will only be accessible from IP
addresses within this list.
Expand All @@ -246,7 +264,6 @@ export const KubeControlPlaneACLDrawer = (props: Props) => {
nonExtendedIPs={field.value ?? ['']}
onBlur={field.onBlur}
onNonExtendedIPChange={field.onChange}
placeholder="0.0.0.0/0"
title="IPv4 Addresses or CIDRs"
/>
)}
Expand All @@ -263,7 +280,6 @@ export const KubeControlPlaneACLDrawer = (props: Props) => {
nonExtendedIPs={field.value ?? ['']}
onBlur={field.onBlur}
onNonExtendedIPChange={field.onChange}
placeholder="::/0"
title="IPv6 Addresses or CIDRs"
/>
)}
Expand All @@ -282,22 +298,16 @@ export const KubeControlPlaneACLDrawer = (props: Props) => {
}}
secondaryButtonProps={{ label: 'Cancel', onClick: closeDrawer }}
/>
{!clusterMigrated && (
<Notice spacingTop={24} variant="warning">
<StyledTypography>
Control Plane ACL has not yet been installed on this cluster.
During installation, it may take up to 15 minutes for the
access control list to be fully enforced.
</StyledTypography>
</Notice>
)}
</Stack>
</form>
</DrawerContent>
</Drawer>
);
};

const StyledTypography = styled(Typography, { label: 'StyledTypography' })({
const StyledTypography = styled(Typography, {
label: 'StyledTypography',
})<{ topMargin?: boolean }>(({ theme, ...props }) => ({
...(props.topMargin ? { marginTop: theme.spacing(1) } : {}),
width: '90%',
});
}));