Skip to content

Commit

Permalink
Merge pull request #11463 from mantis-toboggan-md/eks-fix-pni
Browse files Browse the repository at this point in the history
EKS - fix project network isolation checkbox
  • Loading branch information
richard-cox committed Jul 18, 2024
2 parents 21c197e + b685318 commit f794b5e
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/eks/components/CruEKS.vue
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ export default defineComponent({
>
<Config
:kubernetes-version.sync="config.kubernetesVersion"
:enable-network-policy.sync="config.enableNetworkPolicy"
:enable-network-policy.sync="normanCluster.enableNetworkPolicy"
:ebs-c-s-i-driver.sync="config.ebsCSIDriver"
:service-role.sync="config.serviceRole"
:kms-key.sync="config.kmsKey"
Expand All @@ -686,6 +686,7 @@ export default defineComponent({
:eks-roles="eksRoles"
:loading-iam="loadingIam"
:original-version="originalVersion"
data-testid="eks-config-section"
@error="e=>errors.push(e)"
/>
</Accordion>
Expand Down
26 changes: 26 additions & 0 deletions pkg/eks/components/__tests__/CruEKS.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,4 +146,30 @@ describe('eKS provisioning form', () => {

expect(wrapper.vm.nodeGroups.filter((group: EKSNodeGroup) => group.version === '1.24')).toHaveLength(1);
});

it('should configure enable network policy at the cluster level not within eksConfig', async() => {
const wrapper = shallowMount(CruEKS, {
propsData: { value: {}, mode: 'edit' },
...requiredSetup()
});

await setCredential(wrapper);

const configComponent = wrapper.find('[data-testid="eks-config-section"]');

configComponent.vm.$emit('update:enableNetworkPolicy', true);

await wrapper.vm.$nextTick();
expect(wrapper.vm.normanCluster.enableNetworkPolicy).toBe(true);

configComponent.vm.$emit('update:enableNetworkPolicy', false);

await wrapper.vm.$nextTick();
expect(wrapper.vm.normanCluster.enableNetworkPolicy).toBe(false);

wrapper.setData({ normanCluster: { ...wrapper.vm.normanCluster, enableNetworkPolicy: true } });
await wrapper.vm.$nextTick();

expect(configComponent.props().enableNetworkPolicy).toBe(true);
});
});

0 comments on commit f794b5e

Please sign in to comment.