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

GKE - allow user to edit master authorized network in provisioned clusters #11402

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
2 changes: 0 additions & 2 deletions pkg/gke/components/Networking.vue
Original file line number Diff line number Diff line change
Expand Up @@ -781,7 +781,6 @@ export default defineComponent({
class="col span-6"
>
<KeyValue

:label="t('gke.masterAuthorizedNetwork.cidrBlocks.label')"
:mode="mode"
:as-map="false"
Expand All @@ -794,7 +793,6 @@ export default defineComponent({
:read-allowed="false"
:add-label="t('gke.masterAuthorizedNetwork.cidrBlocks.add')"
:initial-empty-row="true"
:disabled="!isNewOrUnprovisioned"
data-testid="gke-master-authorized-network-cidr-keyvalue"
@input="$emit('update:masterAuthorizedNetworkCidrBlocks', $event)"
/>
Expand Down
33 changes: 33 additions & 0 deletions pkg/gke/components/__tests__/Networking.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
});
Loading