mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2026-02-04 06:51:44 +00:00
feat: add network policy page (#536)
* feat: add Network Policiies page Signed-off-by: Andy Lee <andy.lee@suse.com> * ci: add build Signed-off-by: Andy Lee <andy.lee@suse.com> * ci: ensure FROM and TO exist Signed-off-by: Andy Lee <andy.lee@suse.com> * ci: skip commitlint if FROM and TO emtpy Signed-off-by: Andy Lee <andy.lee@suse.com> * revert: unnecessary change * feat: add banner Signed-off-by: Andy Lee <andy.lee@suse.com> --------- Signed-off-by: Andy Lee <andy.lee@suse.com>
This commit is contained in:
parent
4bb67153ce
commit
bd28ba6f71
1
.github/workflows/run-lint.yaml
vendored
1
.github/workflows/run-lint.yaml
vendored
@ -50,6 +50,7 @@ jobs:
|
|||||||
|
|
||||||
echo "FROM=$FROM"
|
echo "FROM=$FROM"
|
||||||
echo "TO=$TO"
|
echo "TO=$TO"
|
||||||
|
|
||||||
npx commitlint --from "$FROM" --to "$TO" --verbose
|
npx commitlint --from "$FROM" --to "$TO" --verbose
|
||||||
env:
|
env:
|
||||||
GITHUB_EVENT_NAME: ${{ github.event_name }}
|
GITHUB_EVENT_NAME: ${{ github.event_name }}
|
||||||
|
|||||||
@ -8,4 +8,5 @@ export const DOC = {
|
|||||||
STORAGE_NETWORK_EXAMPLE: `/advanced/storagenetwork#configuration-example`,
|
STORAGE_NETWORK_EXAMPLE: `/advanced/storagenetwork#configuration-example`,
|
||||||
SUPPORT_BUNDLE_NAMESPACES: `/advanced/index/#support-bundle-namespaces`,
|
SUPPORT_BUNDLE_NAMESPACES: `/advanced/index/#support-bundle-namespaces`,
|
||||||
VPC_CONFIGURATION_EXAMPLES: `/networking/kubeovn-vpc#vpc-peering-configuration-examples`,
|
VPC_CONFIGURATION_EXAMPLES: `/networking/kubeovn-vpc#vpc-peering-configuration-examples`,
|
||||||
|
NETWORK_POLICY: `/networking/kubeovn-vm-isolation/#network-policies`,
|
||||||
};
|
};
|
||||||
|
|||||||
@ -10,6 +10,7 @@ import {
|
|||||||
LOGGING,
|
LOGGING,
|
||||||
STORAGE_CLASS,
|
STORAGE_CLASS,
|
||||||
SECRET,
|
SECRET,
|
||||||
|
NETWORK_POLICY
|
||||||
} from '@shell/config/types';
|
} from '@shell/config/types';
|
||||||
import { HCI, VOLUME_SNAPSHOT } from '../types';
|
import { HCI, VOLUME_SNAPSHOT } from '../types';
|
||||||
import {
|
import {
|
||||||
@ -425,6 +426,7 @@ export function init($plugin, store) {
|
|||||||
HCI.CLUSTER_NETWORK,
|
HCI.CLUSTER_NETWORK,
|
||||||
HCI.NETWORK_ATTACHMENT,
|
HCI.NETWORK_ATTACHMENT,
|
||||||
HCI.VPC,
|
HCI.VPC,
|
||||||
|
NETWORK_POLICY,
|
||||||
HCI.LB,
|
HCI.LB,
|
||||||
HCI.IP_POOL,
|
HCI.IP_POOL,
|
||||||
],
|
],
|
||||||
@ -566,6 +568,21 @@ export function init($plugin, store) {
|
|||||||
ifHaveType: HCI.VPC,
|
ifHaveType: HCI.VPC,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
configureType(NETWORK_POLICY, { hiddenNamespaceGroupButton: true, canYaml: false });
|
||||||
|
|
||||||
|
virtualType({
|
||||||
|
labelKey: 'harvester.networkPolicy.label',
|
||||||
|
name: NETWORK_POLICY,
|
||||||
|
namespaced: true,
|
||||||
|
weight: 186,
|
||||||
|
route: {
|
||||||
|
name: `${ PRODUCT_NAME }-c-cluster-resource`,
|
||||||
|
params: { resource: NETWORK_POLICY }
|
||||||
|
},
|
||||||
|
exact: false,
|
||||||
|
ifHaveType: NETWORK_POLICY,
|
||||||
|
});
|
||||||
|
|
||||||
configureType(HCI.SNAPSHOT, {
|
configureType(HCI.SNAPSHOT, {
|
||||||
isCreatable: false,
|
isCreatable: false,
|
||||||
location: {
|
location: {
|
||||||
|
|||||||
42
pkg/harvester/edit/networking.k8s.io.networkpolicy.vue
Normal file
42
pkg/harvester/edit/networking.k8s.io.networkpolicy.vue
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
<script>
|
||||||
|
import NetworkPolicy from '@shell/edit/networking.k8s.io.networkpolicy';
|
||||||
|
import { Banner } from '@components/Banner';
|
||||||
|
import { DOC } from '../config/doc-links';
|
||||||
|
import { docLink } from '../utils/feature-flags';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
NetworkPolicy,
|
||||||
|
Banner
|
||||||
|
},
|
||||||
|
|
||||||
|
computed: {
|
||||||
|
networkPolicyDocLink() {
|
||||||
|
const version = this.$store.getters['harvester-common/getServerVersion']();
|
||||||
|
|
||||||
|
return docLink(DOC.NETWORK_POLICY, version);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="network-policy-edit">
|
||||||
|
<Banner color="info">
|
||||||
|
<t
|
||||||
|
k="harvester.networkPolicy.banner"
|
||||||
|
:url="networkPolicyDocLink"
|
||||||
|
:raw="true"
|
||||||
|
/>
|
||||||
|
</Banner>
|
||||||
|
<NetworkPolicy v-bind="$attrs" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.network-policy-edit {
|
||||||
|
flex: auto;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@ -1106,6 +1106,9 @@ harvester:
|
|||||||
remoteVpc:
|
remoteVpc:
|
||||||
label: Remote VPC
|
label: Remote VPC
|
||||||
infoBanner: The static route destination CIDR must cover all subnets CIDR from remote VPC Peer. Read <a href="{url}" target="_blank">VPC Peering Configuration Examples</a> for more information.
|
infoBanner: The static route destination CIDR must cover all subnets CIDR from remote VPC Peer. Read <a href="{url}" target="_blank">VPC Peering Configuration Examples</a> for more information.
|
||||||
|
networkPolicy:
|
||||||
|
label: Network Policies
|
||||||
|
banner: The network policies must be used for VMs attached to overlay networks. Please read the <a href="{url}" target="_blank">harvester document</a> how the network policy works.
|
||||||
network:
|
network:
|
||||||
label: Virtual Machine Networks
|
label: Virtual Machine Networks
|
||||||
tabs:
|
tabs:
|
||||||
@ -1832,6 +1835,11 @@ typeLabel:
|
|||||||
one { Virtual Private Cloud }
|
one { Virtual Private Cloud }
|
||||||
other { Virtual Private Clouds }
|
other { Virtual Private Clouds }
|
||||||
}
|
}
|
||||||
|
networking.k8s.io.networkpolicy: |-
|
||||||
|
{count, plural,
|
||||||
|
one { Network Policy }
|
||||||
|
other { Network Policies }
|
||||||
|
}
|
||||||
harvesterhci.io.cloudtemplate: |-
|
harvesterhci.io.cloudtemplate: |-
|
||||||
{count, plural,
|
{count, plural,
|
||||||
one { Cloud Configuration Template }
|
one { Cloud Configuration Template }
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user