From 1d5e5eaf751995afa854e690fec7118ea4c24927 Mon Sep 17 00:00:00 2001 From: Nancy <42977925+mantis-toboggan-md@users.noreply.github.com> Date: Tue, 9 Jul 2024 17:06:25 -0700 Subject: [PATCH] allow master authorized network cidr blocks to be updated when editing provisioned gke cluster (#11402) --- pkg/gke/components/Networking.vue | 2 -- .../components/__tests__/Networking.test.ts | 33 +++++++++++++++++++ 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/pkg/gke/components/Networking.vue b/pkg/gke/components/Networking.vue index 0419a4644f4..effed633781 100644 --- a/pkg/gke/components/Networking.vue +++ b/pkg/gke/components/Networking.vue @@ -781,7 +781,6 @@ export default defineComponent({ class="col span-6" > diff --git a/pkg/gke/components/__tests__/Networking.test.ts b/pkg/gke/components/__tests__/Networking.test.ts index b1e5315b0d6..c6b7be325e1 100644 --- a/pkg/gke/components/__tests__/Networking.test.ts +++ b/pkg/gke/components/__tests__/Networking.test.ts @@ -361,4 +361,37 @@ describe('gke Networking', () => { masterAuthorizedNetworkCidrInput = wrapper.find('[data-testid="gke-master-authorized-network-cidr-keyvalue"]'); expect(masterAuthorizedNetworkCidrInput.isVisible()).toBe(true); }); + + it('should allow the user to edit the master authorized network cidr block list for new or existing node pools', async() => { + const setup = requiredSetup(); + + const wrapper = shallowMount(Networking, { + propsData: { + zone: 'test-zone', + region: 'test-region', + cloudCredentialId: '', + projectId: 'test-project', + enablePrivateNodes: false, + enableMasterAuthorizedNetwork: true, + isNewOrUnprovisioned: false, + }, + ...setup + }); + + wrapper.setProps({ cloudCredentialId: 'abc' }); + await flushPromises(); + + wrapper.setData({ showAdvanced: true }); + await wrapper.vm.$nextTick(); + + const masterAuthorizedNetworkCidrInput = wrapper.find('[data-testid="gke-master-authorized-network-cidr-keyvalue"]'); + + expect(masterAuthorizedNetworkCidrInput.isVisible()).toBe(true); + expect(masterAuthorizedNetworkCidrInput.props().disabled).toBe(false); + + wrapper.setProps({ isNewOrUnprovisioned: true }); + await wrapper.vm.$nextTick(); + + expect(masterAuthorizedNetworkCidrInput.props().disabled).toBe(false); + }); });