Skip to content

Commit 50422dc

Browse files
authored
[Multitenancy]: Add PodNetwork field to MTPNC spec (#2151)
* Add PN to MTPNC spec * add annotation * remove omitempty tag
1 parent 4aecfd6 commit 50422dc

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

crd/multitenantpodnetworkconfig/api/v1alpha1/multitenantpodnetworkconfig.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import (
1818
// +kubebuilder:metadata:labels=managed=
1919
// +kubebuilder:metadata:labels=owner=
2020
// +kubebuilder:printcolumn:name="PodNetworkInstance",type=string,JSONPath=`.spec.podNetworkInstance`
21+
// +kubebuilder:printcolumn:name="PodNetwork",type=string,JSONPath=`.spec.podNetwork`
2122
// +kubebuilder:printcolumn:name="PodName",type=string,JSONPath=`.spec.podName`
2223
// +kubebuilder:printcolumn:name="NCID",type=string,JSONPath=`.status.ncID`
2324
// +kubebuilder:printcolumn:name="PrimaryIP",type=string,JSONPath=`.status.primaryIP`
@@ -43,9 +44,12 @@ type MultitenantPodNetworkConfigList struct {
4344
// MultitenantPodNetworkConfigSpec defines the desired state of PodNetworkConfig
4445
type MultitenantPodNetworkConfigSpec struct {
4546
// name of PNI object from requesting cx pod
47+
// +kubebuilder:validation:Optional
4648
PodNetworkInstance string `json:"podNetworkInstance,omitempty"`
49+
// name of PN object from requesting cx pod
50+
PodNetwork string `json:"podNetwork"`
4751
// name of the requesting cx pod
48-
PodName string `json:"podName,omitempty"`
52+
PodName string `json:"podName"`
4953
}
5054

5155
// MultitenantPodNetworkConfigStatus defines the observed state of PodNetworkConfig

crd/multitenantpodnetworkconfig/manifests/acn.azure.com_multitenantpodnetworkconfigs.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ spec:
2323
- jsonPath: .spec.podNetworkInstance
2424
name: PodNetworkInstance
2525
type: string
26+
- jsonPath: .spec.podNetwork
27+
name: PodNetwork
28+
type: string
2629
- jsonPath: .spec.podName
2730
name: PodName
2831
type: string
@@ -63,9 +66,15 @@ spec:
6366
podName:
6467
description: name of the requesting cx pod
6568
type: string
69+
podNetwork:
70+
description: name of PN object from requesting cx pod
71+
type: string
6672
podNetworkInstance:
6773
description: name of PNI object from requesting cx pod
6874
type: string
75+
required:
76+
- podName
77+
- podNetwork
6978
type: object
7079
status:
7180
description: MultitenantPodNetworkConfigStatus defines the observed state

0 commit comments

Comments
 (0)