diff --git a/package.json b/package.json index e58187a5..8a2e0fa6 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "cache-loader": "^4.1.0", "color": "4.2.3", "ip": "2.0.1", + "ipaddr.js": "2.4.0", "@xterm/xterm": "6.0.0", "@xterm/addon-fit": "0.11.0", "@xterm/addon-search": "0.16.0", diff --git a/pkg/harvester/config/harvester-cluster.js b/pkg/harvester/config/harvester-cluster.js index d04fc63c..ee273b5d 100644 --- a/pkg/harvester/config/harvester-cluster.js +++ b/pkg/harvester/config/harvester-cluster.js @@ -662,7 +662,7 @@ export function init($plugin, store) { ); basicType( - [HCI.VPC_NAT_GATEWAY], + [HCI.VPC_NAT_GATEWAY, HCI.VPC_EGRESS_GATEWAY], GATEWAYS_GROUP ); @@ -853,6 +853,52 @@ export function init($plugin, store) { ifHaveType: HCI.VPC_NAT_GATEWAY, }); + configureType(HCI.VPC_EGRESS_GATEWAY, { hiddenNamespaceGroupButton: true, canYaml: false }); + + headers(HCI.VPC_EGRESS_GATEWAY, [ + STATE, + NAME_COL, + NAMESPACE_COL, + { + name: 'vpc', + labelKey: 'harvester.egressGateway.vpc.label', + value: 'spec.vpc', + sort: ['spec.vpc'], + }, + { + name: 'replicas', + labelKey: 'harvester.egressGateway.replicas.label', + value: 'spec.replicas', + sort: ['spec.replicas'], + }, + { + name: 'externalSubnet', + labelKey: 'harvester.egressGateway.externalSubnet.label', + value: 'spec.externalSubnet', + sort: ['spec.externalSubnet'], + }, + { + name: 'externalIPs', + labelKey: 'harvester.egressGateway.ips.external.label', + value: 'status.externalIPs', + formatter: 'List', + }, + AGE + ]); + + virtualType({ + labelKey: 'harvester.egressGateway.label', + name: HCI.VPC_EGRESS_GATEWAY, + namespaced: true, + weight: 193, + route: { + name: `${ PRODUCT_NAME }-c-cluster-resource`, + params: { resource: HCI.VPC_EGRESS_GATEWAY } + }, + exact: false, + ifHaveType: HCI.VPC_EGRESS_GATEWAY, + }); + configureType(HCI.IPTABLES_EIP, { hiddenNamespaceGroupButton: true, canYaml: false }); virtualType({ diff --git a/pkg/harvester/edit/__tests__/kubeovn.io.vpc.test.js b/pkg/harvester/edit/__tests__/kubeovn.io.vpc.test.js new file mode 100644 index 00000000..19cc6527 --- /dev/null +++ b/pkg/harvester/edit/__tests__/kubeovn.io.vpc.test.js @@ -0,0 +1,99 @@ +import EditVPC from '../kubeovn.io.vpc/index.vue'; + +const { validateBfdPort, bfdPortIPError, applyBfdPort } = EditVPC.methods; +const { validationPassed, gatewaysNeedingBfdPort } = EditVPC.computed; + +const t = (key) => key; + +function createContext(form = {}, spec = {}, model = {}) { + const value = { + metadata: { name: 'commonvpc' }, spec, subnetResources: [], bfdEgressGateways: [], ...model + }; + + return { + t, + value, + ...EditVPC.data.call({ value }), + bfdPortIPError, + ...form, + }; +} + +describe('edit: kubeovn.io.vpc', () => { + it('should load the BFD port of an existing VPC', () => { + const context = createContext({}, { bfdPort: { enabled: true, ip: '10.255.255.255' } }); + + expect(context.bfdPortEnabled).toBe(true); + expect(context.bfdPortIP).toBe('10.255.255.255'); + }); + + it('should not add a BFD port to a VPC that has none while it stays disabled', () => { + const context = createContext({}, { staticRoutes: [] }); + + expect(validateBfdPort.call(context)).toStrictEqual([]); + applyBfdPort.call(context); + + expect(context.value.spec).toStrictEqual({ staticRoutes: [] }); + }); + + it('should enable the BFD port with its IP and keep its node selector', () => { + const nodeSelector = { matchLabels: { 'kubernetes.io/os': 'linux' } }; + const context = createContext({ bfdPortEnabled: true, bfdPortIP: ' 10.255.255.255 , fd00::ffff ' }, { bfdPort: { enabled: false, nodeSelector } }); + + expect(validateBfdPort.call(context)).toStrictEqual([]); + applyBfdPort.call(context); + + expect(context.value.spec.bfdPort).toStrictEqual({ + enabled: true, ip: '10.255.255.255,fd00::ffff', nodeSelector + }); + }); + + it('should keep the IP when the BFD port is disabled', () => { + const context = createContext({ bfdPortEnabled: false }, { bfdPort: { enabled: true, ip: '10.255.255.255' } }); + + applyBfdPort.call(context); + + expect(context.value.spec.bfdPort).toStrictEqual({ enabled: false, ip: '10.255.255.255' }); + }); + + it('should reject a BFD port IP inside one of the VPC subnets', () => { + const subnet = { + id: 'subnetinternal', spec: { cidrBlock: '172.20.10.0/24' }, containsIP: (ip) => ip.startsWith('172.20.10.') + }; + const context = createContext({ bfdPortEnabled: true, bfdPortIP: '172.20.10.200' }, {}, { subnetResources: [subnet] }); + const errors = validateBfdPort.call(context); + + expect(errors).toHaveLength(1); + expect(errors[0]).toContain('harvester.vpc.bfdPort.validation.subnet'); + }); + + it.each([ + ['a name and a valid BFD port', {}, true], + ['no name', { value: { metadata: {} } }, false], + ['an invalid BFD port', { bfdPortErrors: ['error'] }, false], + ])('should allow the save with %s', (_, form, passed) => { + expect(validationPassed.call({ + value: { metadata: { name: 'commonvpc' } }, bfdPortErrors: [], ...form + })).toBe(passed); + }); + + it('should list the gateways that need the BFD port only while it is disabled', () => { + const bfdEgressGateways = [{ id: 'default/gateway1' }]; + + expect(gatewaysNeedingBfdPort.call({ bfdPortEnabled: false, value: { bfdEgressGateways } })).toStrictEqual(bfdEgressGateways); + expect(gatewaysNeedingBfdPort.call({ bfdPortEnabled: true, value: { bfdEgressGateways } })).toStrictEqual([]); + }); + + it.each([ + ['no IP', '', 'validation.required'], + ['an invalid IP', '10.255.255.256', 'harvester.vpc.bfdPort.validation.ip'], + ['a CIDR', '10.255.255.255/32', 'harvester.vpc.bfdPort.validation.ip'], + ['two IPv4 addresses', '10.255.255.254,10.255.255.255', 'harvester.vpc.bfdPort.validation.ip'], + ['three addresses', '10.255.255.255,fd00::1,fd00::2', 'harvester.vpc.bfdPort.validation.ip'], + ])('should reject an enabled BFD port with %s', (_, bfdPortIP, errorKey) => { + const errors = validateBfdPort.call(createContext({ bfdPortEnabled: true, bfdPortIP })); + + expect(errors).toHaveLength(1); + expect(errors[0]).toContain(errorKey); + }); +}); diff --git a/pkg/harvester/edit/__tests__/kubeovn.io.vpcegressgateway.test.js b/pkg/harvester/edit/__tests__/kubeovn.io.vpcegressgateway.test.js new file mode 100644 index 00000000..2b287f98 --- /dev/null +++ b/pkg/harvester/edit/__tests__/kubeovn.io.vpcegressgateway.test.js @@ -0,0 +1,452 @@ +import EditVpcEgressGateway from '../kubeovn.io.vpcegressgateway.vue'; + +const { + validate, validateTabs, ipError, ipCountError, policyError, policiesSpec, toSpec, bfdSpec, saveGateway +} = EditVpcEgressGateway.methods; +const { vpc: onVpcChange, externalNetworkMode: onExternalNetworkModeChange } = EditVpcEgressGateway.watch; +const { + showExternalNetworkMode, vpcBfdPortDisabled, vpcEditLocation, internalSubnetOptions, externalSubnetOptions, externalSubnetRules, internalSubnetPlaceholder, snatSubnetOptions, noSnatSubnetOptions, policySubnetsPlaceholder +} = EditVpcEgressGateway.computed; +const { requiredError } = EditVpcEgressGateway.methods; + +const t = (key, args) => (args ? `${ key } ${ JSON.stringify(args) }` : key); + +function createContext(form = {}, spec = {}) { + const value = { metadata: { name: 'gateway1', namespace: 'default' }, spec }; + + const context = { + t, + value, + ...EditVpcEgressGateway.data.call({ value }), + vpc: 'commonvpc', + replicas: 2, + internalSubnet: 'subnetinternal', + externalSubnet: 'subnetexternal', + snatSubnets: ['subnetinternal'], + ...form, + }; + + Object.assign(context, { + bfdSpec, validateTabs, ipError, ipCountError, policyError, policiesSpec + }); + + return context; +} + +// A subnet as the store returns it, with the model getters the form reads +function subnet(id, spec, model = {}) { + return { + id, spec, isOverlayAttachment: false, networkAttachment: null, canAssignIP: () => true, ...model + }; +} + +describe('edit: kubeovn.io.vpcegressgateway', () => { + it('should start a new gateway with one replica, no subnets and BFD off', () => { + const data = EditVpcEgressGateway.data.call({ value: { metadata: {} } }); + + expect(data.replicas).toBe(1); + expect([data.snatSubnets, data.noSnatSubnets, data.ipBlockPolicies]).toStrictEqual([[], [], []]); + expect(data.bfd).toStrictEqual({ + enabled: false, minRX: 1000, minTX: 1000, multiplier: 3 + }); + }); + + it('should build the spec from the form and leave out empty optional fields', () => { + const spec = toSpec.call(createContext()); + + expect(spec).toStrictEqual({ + vpc: 'commonvpc', + replicas: 2, + internalSubnet: 'subnetinternal', + externalSubnet: 'subnetexternal', + policies: [{ snat: true, subnets: ['subnetinternal'] }], + bfd: { + enabled: false, minRX: 1000, minTX: 1000, multiplier: 3 + }, + }); + }); + + it('should build the spec with IPs, BFD and bandwidth', () => { + const spec = toSpec.call(createContext({ + internalIPs: ['172.20.10.41', ' 172.20.10.51 ', ''], + externalIPs: ['10.115.48.220', '10.115.48.221'], + bfd: { + enabled: true, minRX: '50', minTX: 50, multiplier: 3 + }, + bandwidthIngress: 10, + bandwidthEgress: null, + })); + + expect(spec.internalIPs).toStrictEqual(['172.20.10.41', '172.20.10.51']); + expect(spec.externalIPs).toStrictEqual(['10.115.48.220', '10.115.48.221']); + expect(spec.bfd).toStrictEqual({ + enabled: true, minRX: 50, minTX: 50, multiplier: 3 + }); + expect(spec.bandwidth).toStrictEqual({ ingress: 10 }); + }); + + it('should keep a bandwidth quantity as a string and a whole number as Mbps', () => { + const context = createContext({ bandwidthIngress: ' 1Gi ', bandwidthEgress: '100' }); + + expect(validate.call(context)).toStrictEqual([]); + expect(toSpec.call(context).bandwidth).toStrictEqual({ ingress: '1Gi', egress: 100 }); + }); + + it('should send the BFD defaults for intervals cleared while BFD is off', () => { + const context = createContext({ + bfd: { + enabled: false, minRX: '', minTX: 50, multiplier: null + } + }); + + expect(validate.call(context)).toStrictEqual([]); + expect(toSpec.call(context).bfd).toStrictEqual({ + enabled: false, minRX: 1000, minTX: 50, multiplier: 3 + }); + }); + + it('should list only the subnets of the VPC that sit on a virtual machine network as internal subnets', () => { + const vpcSubnets = [ + subnet('ovn-default', { vpc: 'ovn-cluster', provider: 'ovn' }), + subnet('subnetinternal', { vpc: 'commonvpc', provider: 'vmnet.default.ovn' }, { isOverlayAttachment: true }), + ]; + + expect(internalSubnetOptions.call({ vpcSubnets })).toStrictEqual([{ label: 'subnetinternal', value: 'subnetinternal' }]); + }); + + it('should list only the subnets attached to a network as external subnets', () => { + const allSubnets = [ + subnet('join', { vpc: 'ovn-cluster', provider: 'ovn' }), + subnet('subnetexternal', { vpc: 'commonvpc', provider: 'extnet.default' }, { networkAttachment: { name: 'extnet', namespace: 'default' } }), + ]; + + expect(externalSubnetOptions.call({ allSubnets })).toStrictEqual([{ label: 'subnetexternal', value: 'subnetexternal' }]); + }); + + it('should check the IPs against the subnet they belong to', () => { + const internalSubnetResource = subnet('subnetinternal', { cidrBlock: '172.20.10.0/24' }, { canAssignIP: (ip) => ip.startsWith('172.20.10.') }); + const errors = validate.call(createContext({ internalSubnetResource, internalIPs: ['172.20.10.41', '10.0.0.1'] })); + + expect(errors).toHaveLength(1); + expect(errors[0]).toContain('harvester.egressGateway.validation.ipSubnet'); + expect(errors[0]).toContain('172.20.10.0/24'); + }); + + it('should put each error on the tab that holds the field', () => { + const errors = validateTabs.call(createContext({ + replicas: 11, + snatSubnets: [], + externalIPs: ['10.115.48.300'], + bfd: { + enabled: true, minRX: 0, minTX: 50, multiplier: 3 + }, + bandwidthIngress: '10Mbps', + })); + + expect(Object.fromEntries(Object.entries(errors).map(([tab, messages]) => [tab, messages.length]))).toStrictEqual({ + basic: 1, policies: 1, ips: 1, bfd: 1, bandwidth: 1 + }); + expect(errors.policies[0]).toContain('harvester.egressGateway.validation.policyRequired'); + }); + + it.each([ + ['empty', '', 'validation.required'], + ['the internal subnet', 'subnetinternal', 'harvester.egressGateway.validation.sameSubnet'], + ])('should explain an external subnet that is %s', (_, value, errorKey) => { + const [rule] = externalSubnetRules.call(createContext({ requiredError })); + + expect(rule(value)).toContain(errorKey); + }); + + it('should accept an external subnet other than the internal one', () => { + const [rule] = externalSubnetRules.call(createContext({ requiredError })); + + expect(rule('subnetexternal')).toBeUndefined(); + }); + + it('should ask for a VPC before the internal subnet', () => { + expect(internalSubnetPlaceholder.call({ + t: (key) => key, vpc: '', internalSubnetOptions: [] + })).toBe('harvester.egressGateway.internalSubnet.noVpc'); + }); + + it('should say when the VPC has no subnet on a virtual machine network', () => { + const t = (key, args) => (args ? `${ key } ${ args.vpc }` : key); + + expect(internalSubnetPlaceholder.call({ + t, vpc: 'ovn-cluster', internalSubnetOptions: [] + })).toBe('harvester.egressGateway.internalSubnet.none ovn-cluster'); + expect(internalSubnetPlaceholder.call({ + t, vpc: 'commonvpc', internalSubnetOptions: [{ value: 'subnetinternal' }] + })).toBe('harvester.egressGateway.internalSubnet.placeholder'); + }); + + it('should leave an empty IP row to the save, which drops it', () => { + expect(ipError.call(createContext(), 'internalIPs', ' ')).toBeUndefined(); + }); + + it('should read the policies as Kube-OVN applies them', () => { + const data = EditVpcEgressGateway.data.call({ + value: { + spec: { + policies: [ + { snat: true, subnets: ['a', 'b'] }, + { snat: true, subnets: ['c', 'a'] }, + { snat: false, subnets: ['b', 'd'] }, + { snat: false, ipBlocks: ['10.0.0.0/24'] }, + ] + } + } + }); + + expect(data.snatSubnets).toStrictEqual(['a', 'c']); + expect(data.noSnatSubnets).toStrictEqual(['b', 'd']); + expect(data.ipBlockPolicies).toStrictEqual([{ snat: false, ipBlocks: ['10.0.0.0/24'] }]); + }); + + it('should write one policy for each group and keep the IP block policies', () => { + const context = createContext({ + snatSubnets: ['a', 'c'], noSnatSubnets: ['b'], ipBlockPolicies: [{ snat: true, ipBlocks: ['10.0.0.0/24'] }] + }); + + expect(policiesSpec.call(context)).toStrictEqual([ + { snat: true, subnets: ['a', 'c'] }, + { snat: false, subnets: ['b'] }, + { snat: true, ipBlocks: ['10.0.0.0/24'] }, + ]); + }); + + it('should leave out a group without subnets', () => { + expect(policiesSpec.call(createContext({ snatSubnets: [], noSnatSubnets: ['b'] }))).toStrictEqual([{ snat: false, subnets: ['b'] }]); + }); + + it.each([ + ['no VPC is chosen', '', [], 'harvester.egressGateway.policies.noVpc'], + ['the VPC has no subnets', 'emptyvpc', [], 'harvester.egressGateway.policies.noSubnets emptyvpc'], + ['the VPC has subnets', 'commonvpc', [{ value: 'a' }], 'harvester.egressGateway.policies.placeholder'], + ])('should explain the policy lists when %s', (_, vpc, vpcSubnetOptions, placeholder) => { + const t = (key, args) => (args ? `${ key } ${ args.vpc }` : key); + + expect(policySubnetsPlaceholder.call({ + t, vpc, vpcSubnetOptions + })).toBe(placeholder); + }); + + it('should not offer a subnet of one group in the other, nor the external subnet', () => { + const vpcSubnetOptions = ['a', 'b', 'c', 'ext'].map((value) => ({ label: value, value })); + const context = { + vpcSubnetOptions, snatSubnets: ['a'], noSnatSubnets: ['b'], externalSubnet: 'ext' + }; + + expect(snatSubnetOptions.call(context).map((option) => option.value)).toStrictEqual(['a', 'c']); + expect(noSnatSubnetOptions.call(context).map((option) => option.value)).toStrictEqual(['b', 'c']); + }); + + it('should reject the external subnet as a policy source', () => { + const error = policyError.call(createContext({ snatSubnets: ['subnetexternal'] })); + + expect(error).toContain('harvester.egressGateway.validation.policyExternalSubnet'); + expect(error).toContain('subnetexternal'); + }); + + it.each([ + ['subnets with SNAT', { snatSubnets: ['a'] }], + ['subnets without SNAT', { snatSubnets: [], noSnatSubnets: ['b'] }], + ['only IP blocks', { snatSubnets: [], ipBlockPolicies: [{ snat: false, ipBlocks: ['10.0.0.0/24'] }] }], + ])('should accept a gateway with %s', (_, form) => { + expect(policyError.call(createContext(form))).toBeUndefined(); + }); + + it('should stop the save when the form has errors', async() => { + const buttonCb = jest.fn(); + const context = createContext({ + vpc: '', validate, save: jest.fn() + }); + + await saveGateway.call(context, buttonCb); + + expect(buttonCb).toHaveBeenCalledWith(false); + expect(context.save).not.toHaveBeenCalled(); + expect(context.errors).toHaveLength(1); + }); + + it('should save the spec built from the form', async() => { + const buttonCb = jest.fn(); + const context = createContext({ + validate, toSpec, save: jest.fn() + }); + + await saveGateway.call(context, buttonCb); + + expect(context.save).toHaveBeenCalledWith(buttonCb); + expect(context.value.spec.vpc).toBe('commonvpc'); + expect(context.value.spec.policies).toStrictEqual([{ snat: true, subnets: ['subnetinternal'] }]); + }); + + it('should keep the fields the form does not show', () => { + const existing = { + trafficPolicy: 'Local', + selectors: [{ namespaceSelector: { matchLabels: { app: 'web' } } }], + policies: [{ snat: false, ipBlocks: ['10.0.0.0/24'] }], + }; + const context = createContext({ snatSubnets: [] }, existing); + const { snatSubnets, noSnatSubnets, ipBlockPolicies } = EditVpcEgressGateway.data.call({ value: context.value }); + + Object.assign(context, { + snatSubnets, noSnatSubnets, ipBlockPolicies + }); + + const spec = toSpec.call(context); + + expect(spec.trafficPolicy).toBe('Local'); + expect(spec.selectors).toStrictEqual(existing.selectors); + expect(spec.policies).toStrictEqual([{ snat: false, ipBlocks: ['10.0.0.0/24'] }]); + expect(validate.call(context)).toStrictEqual([]); + }); + + it.each([ + ['has', true], + ['does not have', false], + ])('should offer Primary CNI when the CRD %s externalNetworkMode', async(_, hasField) => { + const schema = { fetchResourceFields: jest.fn().mockResolvedValue({}) }; + const getters = { + currentProduct: { inStore: 'harvester' }, + 'harvester/schemaFor': () => schema, + 'harvester/pathExistsInSchema': jest.fn(() => hasField), + }; + const context = { $store: { getters, dispatch: jest.fn().mockResolvedValue([]) }, supportsPrimaryCNI: false }; + + await EditVpcEgressGateway.fetch.call(context); + + expect(schema.fetchResourceFields).toHaveBeenCalledWith(); + expect(getters['harvester/pathExistsInSchema']).toHaveBeenCalledWith('kubeovn.io.vpcegressgateway', 'spec.externalNetworkMode'); + expect(context.supportsPrimaryCNI).toBe(hasField); + }); + + it.each([ + ['a CRD with the mode', { supportsPrimaryCNI: true, usesPrimaryCNI: false }, true], + ['a CRD without the mode', { supportsPrimaryCNI: false, usesPrimaryCNI: false }, false], + ['an existing Primary CNI gateway', { supportsPrimaryCNI: false, usesPrimaryCNI: true }, true], + ])('should show the external network choice for %s', (_, context, shown) => { + expect(showExternalNetworkMode.call(context)).toBe(shown); + }); + + it('should start a new gateway on an external subnet and leave the mode to the CRD default', () => { + const context = createContext(); + + expect(context.externalNetworkMode).toBe('Attachment'); + expect(toSpec.call(context)).not.toHaveProperty('externalNetworkMode'); + }); + + it('should write a PrimaryCNI gateway without an external subnet', () => { + const spec = toSpec.call(createContext({ externalNetworkMode: 'PrimaryCNI', externalSubnet: '' })); + + expect(spec.externalNetworkMode).toBe('PrimaryCNI'); + expect(spec).not.toHaveProperty('externalSubnet'); + expect(spec).not.toHaveProperty('externalIPs'); + expect(spec).not.toHaveProperty('bandwidth'); + }); + + it('should clear the external fields when PrimaryCNI is chosen', () => { + const context = createContext({ + externalIPs: ['10.115.48.220'], bandwidthIngress: 10, bandwidthEgress: '1Gi' + }); + + onExternalNetworkModeChange.call(context, 'PrimaryCNI'); + + expect([context.externalSubnet, context.externalIPs, context.bandwidthIngress, context.bandwidthEgress]).toStrictEqual(['', [], '', '']); + }); + + it('should save a PrimaryCNI gateway made outside the form', () => { + const existing = { + vpc: 'commonvpc', + replicas: 1, + externalNetworkMode: 'PrimaryCNI', + internalSubnet: 'subnetinternal', + policies: [{ snat: true, subnets: ['subnetinternal'] }], + }; + const value = { metadata: { name: 'gateway1', namespace: 'default' }, spec: existing }; + const context = createContext(EditVpcEgressGateway.data.call({ value }), existing); + + expect(context.externalNetworkMode).toBe('PrimaryCNI'); + expect(validate.call(context)).toStrictEqual([]); + expect(toSpec.call(context)).toStrictEqual({ + ...existing, + bfd: { + enabled: false, minRX: 1000, minTX: 1000, multiplier: 3 + }, + }); + }); + + it('should accept a complete form', () => { + expect(validate.call(createContext())).toStrictEqual([]); + }); + + it.each([ + ['no VPC', { vpc: '' }, 'validation.required'], + ['no internal subnet', { internalSubnet: '' }, 'validation.required'], + ['no external subnet', { externalSubnet: '' }, 'validation.required'], + ['the same internal and external subnet', { externalSubnet: 'subnetinternal', snatSubnets: ['subnetother'] }, 'harvester.egressGateway.validation.sameSubnet'], + ['too many replicas', { replicas: 11 }, 'harvester.egressGateway.validation.replicas'], + ['no subnet with or without SNAT', { snatSubnets: [] }, 'harvester.egressGateway.validation.policyRequired'], + ['an invalid IP', { externalIPs: ['10.115.48.300', '10.115.48.221'] }, 'harvester.egressGateway.validation.ipList'], + ['fewer IPs than replicas', { internalIPs: ['172.20.10.41'] }, 'harvester.egressGateway.validation.ipCount'], + ['a repeated IP', { externalIPs: ['10.115.48.220', ' 10.115.48.220'] }, 'harvester.egressGateway.validation.ipDuplicate'], + ['a BFD interval of 0', { + bfd: { + enabled: true, minRX: 0, minTX: 50, multiplier: 3 + } + }, 'harvester.egressGateway.validation.bfd'], + ['a BFD multiplier of 0', { + bfd: { + enabled: true, minRX: 50, minTX: 50, multiplier: 0 + } + }, 'harvester.egressGateway.validation.bfdMultiplier'], + ['a negative bandwidth', { bandwidthEgress: -1 }, 'harvester.egressGateway.validation.bandwidth'], + ['a bandwidth with an unknown unit', { bandwidthEgress: '10Mbps' }, 'harvester.egressGateway.validation.bandwidth'], + ])('should reject %s', (_, form, errorKey) => { + const errors = validate.call(createContext(form)); + + expect(errors).toHaveLength(1); + expect(errors[0]).toContain(errorKey); + }); + + it('should drop the subnets of the previous VPC when the VPC changes', () => { + const context = createContext({ + vpc: 'othervpc', + internalSubnet: 'subnetinternal', + snatSubnets: ['subnetinternal', 'othersubnet'], + noSnatSubnets: ['subnetinternal'], + vpcSubnetOptions: [{ label: 'othersubnet', value: 'othersubnet' }], + internalSubnetOptions: [{ label: 'othersubnet', value: 'othersubnet' }], + }); + + onVpcChange.call(context, 'othervpc', 'commonvpc'); + + expect(context.internalSubnet).toBe(''); + expect(context.snatSubnets).toStrictEqual(['othersubnet']); + expect(context.noSnatSubnets).toStrictEqual([]); + }); + + it.each([ + ['has no BFD port', { bfdPortEnabled: false }, true], + ['has a BFD port', { bfdPortEnabled: true }, false], + ])('should warn about BFD when the selected VPC %s', (_, selectedVpc, warning) => { + expect(vpcBfdPortDisabled.call({ selectedVpc })).toBe(warning); + }); + + it('should not warn about BFD before a VPC is selected', () => { + expect(vpcBfdPortDisabled.call({ selectedVpc: null })).toBe(false); + }); + + it('should link the BFD warning to the BFD Port tab of the selected VPC', () => { + const selectedVpc = { detailLocation: { name: 'harvester-c-cluster-resource-id', params: { resource: 'kubeovn.io.vpc', id: 'commonvpc' } } }; + + expect(vpcEditLocation.call({ selectedVpc })).toStrictEqual({ + name: 'harvester-c-cluster-resource-id', + params: { resource: 'kubeovn.io.vpc', id: 'commonvpc' }, + query: { mode: 'edit' }, + hash: '#bfdPort', + }); + }); +}); diff --git a/pkg/harvester/edit/kubeovn.io.vpc/index.vue b/pkg/harvester/edit/kubeovn.io.vpc/index.vue index a7027bb7..e07d0b8d 100644 --- a/pkg/harvester/edit/kubeovn.io.vpc/index.vue +++ b/pkg/harvester/edit/kubeovn.io.vpc/index.vue @@ -5,9 +5,17 @@ import Tab from '@shell/components/Tabbed/Tab'; import Loading from '@shell/components/Loading'; import CreateEditView from '@shell/mixins/create-edit-view'; import ResourceTabs from '@shell/components/form/ResourceTabs/index'; +import { LabeledInput } from '@components/Form/LabeledInput'; +import { RadioGroup } from '@components/Form/Radio'; +import { Banner } from '@components/Banner'; import StaticRoutes from './StaticRoutes'; import VpcPeerings from './VpcPeerings'; import { set } from '@shell/utils/object'; +import { allHash } from '@shell/utils/promise'; +import { isValidIP } from '@shell/utils/validators/cidr'; +import { HCI } from '../../types'; + +const splitIPs = (value) => `${ value || '' }`.split(',').map((ip) => ip.trim()).filter(Boolean); export default { name: 'EditVPC', @@ -15,8 +23,11 @@ export default { emits: ['update:value'], components: { + Banner, CruResource, + LabeledInput, NameNsDescription, + RadioGroup, Tab, StaticRoutes, ResourceTabs, @@ -28,16 +39,106 @@ export default { inheritAttrs: false, + async fetch() { + const inStore = this.$store.getters['currentProduct'].inStore; + const hasEgressGateways = !!this.$store.getters[`${ inStore }/schemaFor`](HCI.VPC_EGRESS_GATEWAY); + + await allHash({ + subnets: this.$store.dispatch(`${ inStore }/findAll`, { type: HCI.SUBNET }), + gateways: hasEgressGateways ? this.$store.dispatch(`${ inStore }/findAll`, { type: HCI.VPC_EGRESS_GATEWAY }) : [], + }); + }, + data() { set(this.value, 'spec', this.value.spec || { staticRoutes: [], vpcPeerings: [], }); - return { staticRoutes: [] }; + const bfdPort = this.value.spec.bfdPort || {}; + + return { + staticRoutes: [], + bfdPortEnabled: bfdPort.enabled === true, + bfdPortIP: bfdPort.ip || '', + }; + }, + + computed: { + bfdPortErrors() { + return this.isView ? [] : this.validateBfdPort(); + }, + + validationPassed() { + return !!this.value?.metadata?.name && this.bfdPortErrors.length === 0; + }, + + // Each field shows its own error once touched, so a disabled Save always has a visible reason + nameRules() { + return { + name: [(value) => (value ? undefined : this.t('validation.required', { key: this.t('generic.name') }, true))], namespace: [], description: [] + }; + }, + + bfdPortIPRules() { + return [(value) => this.bfdPortIPError(value)]; + }, + + gatewaysNeedingBfdPort() { + return this.bfdPortEnabled ? [] : this.value.bfdEgressGateways || []; + }, }, methods: { + bfdPortIPError(value) { + if (!this.bfdPortEnabled) { + return undefined; + } + + const ips = splitIPs(value); + const ipv6Count = ips.filter((ip) => ip.includes(':')).length; + + if (!ips.length) { + return this.t('validation.required', { key: this.t('harvester.vpc.bfdPort.ip.label') }, true); + } + + if (ips.length > 2 || ips.some((ip) => !isValidIP(ip)) || (ips.length === 2 && ipv6Count !== 1)) { + return this.t('harvester.vpc.bfdPort.validation.ip', null, true); + } + + const subnet = (this.value.subnetResources || []).find((item) => ips.some((ip) => item.containsIP(ip))); + + if (subnet) { + return this.t('harvester.vpc.bfdPort.validation.subnet', { subnet: subnet.id, cidr: subnet.spec?.cidrBlock }, true); + } + + return undefined; + }, + + validateBfdPort() { + return [this.bfdPortIPError(this.bfdPortIP)].filter(Boolean); + }, + + applyBfdPort() { + const current = this.value.spec.bfdPort; + + if (!this.bfdPortEnabled && !current) { + return; + } + + const bfdPort = { + ...(current || {}), + enabled: this.bfdPortEnabled, + ip: splitIPs(this.bfdPortIP).join(','), + }; + + if (!bfdPort.ip) { + delete bfdPort.ip; + } + + this.value.spec.bfdPort = bfdPort; + }, + async saveVpc(buttonCb) { const errors = []; @@ -48,12 +149,15 @@ export default { errors.push(this.t('validation.required', { key: this.t('generic.name') }, true)); } + errors.push(...this.validateBfdPort()); + if (errors.length > 0) { buttonCb(false); this.errors = errors; return false; } + this.applyBfdPort(); await this.value.save(); buttonCb(true); this.done(); @@ -76,6 +180,7 @@ export default { :mode="mode" :apply-hooks="applyHooks" :errors="errors" + :validation-passed="validationPassed" @finish="saveVpc" @error="e=>errors=e" > @@ -83,6 +188,7 @@ export default { :value="value" :mode="mode" :namespaced="false" + :rules="nameRules" @update:value="$emit('update:value', $event)" /> + + + + +
+
+ +
+
+
diff --git a/pkg/harvester/edit/kubeovn.io.vpcegressgateway.vue b/pkg/harvester/edit/kubeovn.io.vpcegressgateway.vue new file mode 100644 index 00000000..bb86cfa0 --- /dev/null +++ b/pkg/harvester/edit/kubeovn.io.vpcegressgateway.vue @@ -0,0 +1,864 @@ + + + diff --git a/pkg/harvester/l10n/en-us.yaml b/pkg/harvester/l10n/en-us.yaml index 19b439cf..ff9d76d6 100644 --- a/pkg/harvester/l10n/en-us.yaml +++ b/pkg/harvester/l10n/en-us.yaml @@ -1504,8 +1504,19 @@ harvester: remoteVpc: label: Remote VPC infoBanner: The static route destination CIDR must cover all subnets CIDR from remote VPC Peer. Read VPC Peering Configuration Examples for more information. + bfdPort: + label: BFD Port + banner: The Egress Gateways of this VPC that have BFD enabled use the BFD port to detect a failed gateway instance quickly. + ip: + label: IP Address + placeholder: e.g. 10.255.255.255 + tooltip: An IP address that doesn't conflict with any other address. For dual-stack, enter an IPv4 and an IPv6 address, separated by a comma. + gatewaysNeedPort: 'Egress Gateways of this VPC that have BFD enabled stop working without its BFD port: {gateways}.' + validation: + ip: '"IP Address" must be an IPv4 address, an IPv6 address, or one of each separated by a comma.' + subnet: '"IP Address" must not be in subnet {subnet} ({cidr}) of this VPC.' natGateway: - label: Gateways + label: NAT Gateways internalTenantNetwork: label: Internal Tenant Network placeholder: Select a Virtual Machine Network @@ -1522,6 +1533,95 @@ harvester: label: External Subnets addLabel: Add placeholder: Select a subnet + egressGateway: + label: Egress Gateways + vpc: + label: VPC + placeholder: Select a VPC + replicas: + label: Replicas + tooltip: The number of gateway instances. Traffic is spread across all instances. + internalSubnet: + label: Internal Subnet + placeholder: Select a subnet of the VPC + noVpc: Select a VPC first + none: VPC {vpc} has no subnet on a virtual machine network + tooltip: The subnet of the VPC that the gateway instances are attached to. Only subnets of a virtual machine network are listed. + externalNetworkMode: + label: External Network + tooltip: How the gateway instances reach the external network. Primary CNI uses the pod network of the cluster, so it needs no external subnet and has no external IPs or bandwidth limits. This can't be changed after the gateway is created. + attachment: External subnet + primaryCNI: Primary CNI + externalSubnet: + label: External Subnet + placeholder: Select a subnet + tooltip: The subnet that connects the gateway instances to the external network. Only subnets of a virtual machine network are listed. + policies: + label: Policies + description: Traffic from these subnets of the VPC goes out through the gateway. Each subnet can be in one list only. + placeholder: Select subnets of the VPC + noVpc: Select a VPC on the Basic tab first + noSubnets: VPC {vpc} has no subnets + snatSubnets: + label: Subnets with SNAT + tooltip: Traffic from these subnets leaves with the gateway's external IP. + noSnatSubnets: + label: Subnets without SNAT + tooltip: Traffic from these subnets keeps its source IP, so the external network needs a route back to them. + ipBlocks: + snat: IP Blocks with SNAT + noSnat: IP Blocks without SNAT + tooltip: Set outside this form, which keeps them as they are. + ips: + label: IP Addresses + banner: Optional. When you set IP addresses, set at least one for each replica. Internal IPs must be in the internal subnet and external IPs in the external subnet. + bannerPrimaryCNI: Optional. When you set internal IPs, set at least one for each replica, in the internal subnet. The external IPs come from the pod network. + internal: + label: Internal IPs + add: Add Internal IP + placeholder: e.g. 172.20.10.41 + external: + label: External IPs + add: Add External IP + placeholder: e.g. 10.115.48.220 + bfd: + label: BFD + enabled: Bidirectional Forwarding Detection (BFD) + tooltip: Detect a failed gateway instance quickly and move its traffic to the other instances. + vpcBfdPort: + prefix: BFD also needs the BFD port of VPC {vpc}, which isn't enabled. + middle: Edit the VPC + suffix: to enable it. + minRX: + label: Receive Interval + tooltip: The shortest interval at which the gateway accepts BFD packets. + minTX: + label: Transmit Interval + tooltip: The shortest interval at which the gateway sends BFD packets. + multiplier: + label: Multiplier + tooltip: The number of missed packets after which a gateway instance is considered down. + milliseconds: ms + bandwidth: + label: Bandwidth + banner: Optional. Limits the bandwidth of each gateway instance. Enter a whole number in Mbps, such as 10, or a quantity in bits per second, such as 100M or 1Gi. + placeholder: e.g. 10 + ingress: + label: Ingress + egress: + label: Egress + validation: + replicas: '"Replicas" must be a whole number from 0 to 10.' + policyRequired: Select at least one subnet, in either list. + policyExternalSubnet: Subnet {subnet} is the external subnet of the gateway, so it can't be in a policy. + sameSubnet: The internal and external subnets must be different. + ipList: '"{key}" must contain valid IP addresses.' + ipDuplicate: '"{key}" must not repeat an address.' + ipSubnet: '"{key}" must be usable addresses of subnet {subnet} ({cidr}), not its network, broadcast or gateway address.' + ipCount: '"{key}" must have at least one address for each replica ({replicas}).' + bfd: The BFD intervals must be whole numbers from 1 to 3600000. + bfdMultiplier: The BFD multiplier must be a whole number from 1 to 3600000. + bandwidth: The bandwidth must be a whole number in Mbps or a quantity such as 100M or 1Gi. externalIP: label: External IPs natGateway: @@ -2768,6 +2868,11 @@ typeLabel: one { NAT Gateway } other { NAT Gateways } } + kubeovn.io.vpcegressgateway: |- + {count, plural, + one { Egress Gateway } + other { Egress Gateways } + } kubeovn.io.iptablessnatrule: |- {count, plural, one { Source Rule } diff --git a/pkg/harvester/models/__tests__/kubeovn.io.subnet.test.js b/pkg/harvester/models/__tests__/kubeovn.io.subnet.test.js new file mode 100644 index 00000000..21a0b423 --- /dev/null +++ b/pkg/harvester/models/__tests__/kubeovn.io.subnet.test.js @@ -0,0 +1,57 @@ +import HciSubnet from '../kubeovn.io.subnet'; + +jest.mock('../harvester', () => ({ __esModule: true, default: class {} })); + +function createSubnet(spec) { + return Object.assign(Object.create(HciSubnet.prototype), { spec }); +} + +describe('class HciSubnet', () => { + it.each([ + ['ovn', null, false], + ['', null, false], + ['vmnet.default.ovn', { name: 'vmnet', namespace: 'default' }, true], + ['extnet.default', { name: 'extnet', namespace: 'default' }, false], + ['extnet.default.other', null, false], + ['a.b.ovn.extra', null, false], + ])('should read the network attachment of provider "%s"', (provider, attachment, overlay) => { + const subnet = createSubnet({ provider }); + + expect(subnet.networkAttachment).toStrictEqual(attachment); + expect(subnet.isOverlayAttachment).toBe(overlay); + }); + + it.each([ + ['172.20.10.41', true], + ['172.20.10.1', false], + ['172.20.10.0', false], + ['172.20.10.255', false], + ['172.20.10.254', true], + ['172.20.11.1', false], + ['fd00::10', true], + ['fd00::1', false], + ['fd00::', false], + ['fd00::ff', false], + ['fd01::10', false], + ['not-an-ip', false], + ])('should tell whether %s can be assigned in a dual-stack subnet', (ip, assignable) => { + const subnet = createSubnet({ cidrBlock: '172.20.10.0/24,fd00::/120', gateway: '172.20.10.1,fd00::1' }); + + expect(subnet.canAssignIP(ip)).toBe(assignable); + }); + + it('should tell whether the subnet contains an IP, its gateway included', () => { + const subnet = createSubnet({ cidrBlock: '172.20.10.0/24', gateway: '172.20.10.1' }); + + expect(subnet.containsIP('172.20.10.1')).toBe(true); + expect(subnet.containsIP('10.255.255.255')).toBe(false); + }); + + it.each([ + ['10.0.0.0/31', '10.0.0.0', true], + ['10.0.0.0/31', '10.0.0.1', true], + ['10.0.0.5/32', '10.0.0.5', true], + ])('should use every address of a point-to-point subnet %s', (cidrBlock, ip, assignable) => { + expect(createSubnet({ cidrBlock }).canAssignIP(ip)).toBe(assignable); + }); +}); diff --git a/pkg/harvester/models/__tests__/kubeovn.io.vpc.test.js b/pkg/harvester/models/__tests__/kubeovn.io.vpc.test.js new file mode 100644 index 00000000..de3b183a --- /dev/null +++ b/pkg/harvester/models/__tests__/kubeovn.io.vpc.test.js @@ -0,0 +1,56 @@ +import HciVPC from '../kubeovn.io.vpc'; + +jest.mock('../harvester', () => ({ __esModule: true, default: class {} })); + +function createVpc(spec, { subnets = [], gateways = [], hasGatewayType = true } = {}) { + const $getters = { + all: (type) => (type === 'kubeovn.io.subnet' ? subnets : gateways), + schemaFor: () => hasGatewayType, + }; + + return Object.assign(Object.create(HciVPC.prototype), { + metadata: { name: 'commonvpc' }, spec, $getters + }); +} + +describe('class HciVPC', () => { + it.each([ + ['no BFD port', {}, false], + ['a disabled BFD port', { bfdPort: { enabled: false, ip: '10.255.255.255' } }, false], + ['an enabled BFD port without an IP', { bfdPort: { enabled: true, ip: ' ' } }, false], + ['an enabled BFD port with an IP', { bfdPort: { enabled: true, ip: '10.255.255.255' } }, true], + ])('should report a VPC with %s', (_, spec, enabled) => { + expect(createVpc(spec).bfdPortEnabled).toBe(enabled); + }); + + it('should list the subnets of the VPC', () => { + const subnets = [{ id: 'subnetinternal', spec: { vpc: 'commonvpc' } }, { id: 'ovn-default', spec: { vpc: 'ovn-cluster' } }]; + + expect(createVpc({}, { subnets }).subnetResources.map((subnet) => subnet.id)).toStrictEqual(['subnetinternal']); + }); + + it('should list the gateways of the VPC that have BFD on', () => { + const gateways = [ + { id: 'default/bfd-on', spec: { vpc: 'commonvpc', bfd: { enabled: true } } }, + { id: 'default/bfd-off', spec: { vpc: 'commonvpc', bfd: { enabled: false } } }, + { id: 'default/other-vpc', spec: { vpc: 'othervpc', bfd: { enabled: true } } }, + ]; + + expect(createVpc({}, { gateways }).bfdEgressGateways.map((gateway) => gateway.id)).toStrictEqual(['default/bfd-on']); + }); + + it('should count a gateway without a VPC as one of the default VPC', () => { + const gateways = [{ id: 'default/no-vpc', spec: { bfd: { enabled: true } } }]; + const vpc = createVpc({}, { gateways }); + + vpc.metadata.name = 'ovn-cluster'; + + expect(vpc.bfdEgressGateways.map((gateway) => gateway.id)).toStrictEqual(['default/no-vpc']); + }); + + it('should list no gateways when the cluster has no Egress Gateway type', () => { + const gateways = [{ id: 'default/bfd-on', spec: { vpc: 'commonvpc', bfd: { enabled: true } } }]; + + expect(createVpc({}, { gateways, hasGatewayType: false }).bfdEgressGateways).toStrictEqual([]); + }); +}); diff --git a/pkg/harvester/models/kubeovn.io.subnet.js b/pkg/harvester/models/kubeovn.io.subnet.js index b7462f7e..fe717781 100644 --- a/pkg/harvester/models/kubeovn.io.subnet.js +++ b/pkg/harvester/models/kubeovn.io.subnet.js @@ -1,12 +1,72 @@ +import ipaddr from 'ipaddr.js'; import { clone } from '@shell/utils/object'; import { HCI } from '../types'; import HarvesterResource from './harvester'; +const splitList = (value) => `${ value || '' }`.split(',').map((item) => item.trim()).filter(Boolean); +const parseIP = (ip) => { + try { + return ipaddr.parse(ip); + } catch (e) { + return null; + } +}; +const parseCIDR = (cidr) => { + try { + return ipaddr.parseCIDR(cidr); + } catch (e) { + return null; + } +}; + export default class HciSubnet extends HarvesterResource { get groupByVpc() { return this.spec?.vpc || ''; } + // The provider names the NetworkAttachmentDefinition the subnet is attached to, as . + // or ..ovn. Kube-OVN's own subnets (join, ovn-default) use "ovn" and have none. + get networkAttachment() { + const [name, namespace, type, ...rest] = `${ this.spec?.provider || '' }`.split('.'); + + if (!name || !namespace || rest.length || (type !== undefined && type !== 'ovn')) { + return null; + } + + return { name, namespace }; + } + + // Kube-OVN, as Harvester runs it (a secondary CNI), only puts a gateway's internal network on a + // subnet whose provider is ..ovn + get isOverlayAttachment() { + return !!this.networkAttachment && `${ this.spec?.provider }`.endsWith('.ovn'); + } + + containsIP(ip) { + const address = parseIP(ip); + + return !!address && splitList(this.spec?.cidrBlock).map(parseCIDR).some((range) => range?.[0].kind() === address.kind() && address.match(range)); + } + + // Kube-OVN assigns static IPs from the network address + 1 to the broadcast address - 1 of the subnet's + // CIDR (a /31 or /127 uses both), and never the gateway + canAssignIP(ip) { + const address = parseIP(ip); + const range = address && splitList(this.spec?.cidrBlock).map(parseCIDR).find((item) => item?.[0].kind() === address.kind() && address.match(item)); + + if (!range) { + return false; + } + + const [base, prefix] = range; + const family = address.kind() === 'ipv4' ? ipaddr.IPv4 : ipaddr.IPv6; + const cidr = `${ base.toString() }/${ prefix }`; + const edges = prefix < (address.kind() === 'ipv4' ? 31 : 127) ? [family.networkAddressFromCIDR(cidr), family.broadcastAddressFromCIDR(cidr)] : []; + const gateways = splitList(this.spec?.gateway).map(parseIP).filter((gateway) => gateway?.kind() === address.kind()); + + return ![...edges, ...gateways].some((other) => other.toNormalizedString() === address.toNormalizedString()); + } + get doneOverride() { const detailLocation = clone(this.listLocation); diff --git a/pkg/harvester/models/kubeovn.io.vpc.js b/pkg/harvester/models/kubeovn.io.vpc.js index bcc9891f..c45c6dd2 100644 --- a/pkg/harvester/models/kubeovn.io.vpc.js +++ b/pkg/harvester/models/kubeovn.io.vpc.js @@ -2,6 +2,9 @@ import { clone } from '@shell/utils/object'; import { HCI } from '../types'; import HarvesterResource from './harvester'; +// Kube-OVN's cluster router, which a gateway without spec.vpc uses +const DEFAULT_VPC = 'ovn-cluster'; + export default class HciVPC extends HarvesterResource { get parentNameOverride() { return this.$rootGetters['i18n/t'](`typeLabel."${ HCI.VPC }"`, { count: 1 })?.trim(); @@ -15,6 +18,26 @@ export default class HciVPC extends HarvesterResource { return detailLocation; } + get subnetResources() { + return (this.$getters['all'](HCI.SUBNET) || []).filter((subnet) => subnet.spec?.vpc === this.metadata?.name); + } + + // The Egress Gateways of this VPC that have BFD on, which need its BFD port + get bfdEgressGateways() { + if (!this.$getters['schemaFor'](HCI.VPC_EGRESS_GATEWAY)) { + return []; + } + + return (this.$getters['all'](HCI.VPC_EGRESS_GATEWAY) || []) + .filter((gateway) => (gateway.spec?.vpc || DEFAULT_VPC) === this.metadata?.name && gateway.spec?.bfd?.enabled); + } + + get bfdPortEnabled() { + const bfdPort = this.spec?.bfdPort; + + return bfdPort?.enabled === true && !!`${ bfdPort.ip || '' }`.trim(); + } + get parentLocationOverride() { return { ...this.listLocation, diff --git a/pkg/harvester/types.ts b/pkg/harvester/types.ts index 45e4f807..9cfc94e0 100644 --- a/pkg/harvester/types.ts +++ b/pkg/harvester/types.ts @@ -32,6 +32,7 @@ export const HCI = { IPTABLES_DNAT_RULE: 'kubeovn.io.iptablesdnatrule', PROVIDER_NETWORK: 'kubeovn.io.providernetwork', VPC_NAT_GATEWAY: 'kubeovn.io.vpcnatgateway', + VPC_EGRESS_GATEWAY: 'kubeovn.io.vpcegressgateway', VM_IMAGE_DOWNLOADER: 'harvesterhci.io.virtualmachineimagedownloader', SUPPORT_BUNDLE: 'harvesterhci.io.supportbundle', NETWORK_ATTACHMENT: 'harvesterhci.io.networkattachmentdefinition', diff --git a/yarn.lock b/yarn.lock index 44d37206..3aa4d345 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8926,7 +8926,7 @@ ipaddr.js@1.9.1: resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.9.1.tgz#bff38543eeb8984825079ff3a2a8e6cbd46781b3" integrity sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g== -ipaddr.js@^2.1.0: +ipaddr.js@2.4.0, ipaddr.js@^2.1.0: version "2.4.0" resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-2.4.0.tgz#038e9ceaf8219efc5bb76347b7eb787875d5095b" integrity sha512-9VGk3HGanVE6JoZXHiCpnGy5X0jYDnN4EA4lntFPj+1vIWlFhIylq2CrrCOJH9EAhc5CYhq18F2Av2tgoAPsYQ==