Skip to content

Commit

Permalink
fix: add status field to PodNetworkInterface to identify if the PNI i…
Browse files Browse the repository at this point in the history
…s in a ready or error state (#2555)

update statuses

Co-authored-by: Chloe Chen <chlochen@microsoft.com>
  • Loading branch information
jc2543 and Chloe Chen authored Feb 7, 2024
1 parent d262b71 commit 1c440c2
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
14 changes: 13 additions & 1 deletion crd/multitenancy/api/v1alpha1/podnetworkinstance.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,21 @@ type PodNetworkInstanceSpec struct {

// PodNetworkInstanceStatus defines the observed state of PodNetworkInstance
type PodNetworkInstanceStatus struct {
PodIPAddresses []string `json:"podIPAddresses,omitempty"`
PodIPAddresses []string `json:"podIPAddresses,omitempty"`
Status PNIStatus `json:"status,omitempty"`
}

// PNIStatus indicates the status of PNI
// +kubebuilder:validation:Enum=Ready;CreateReservationSetError;PodNetworkNotReady;InsufficientIPAddressesOnSubnet
type PNIStatus string

const (
PNIStatusReady PNIStatus = "Ready"
PNIStatusCreateReservationSetError PNIStatus = "CreateReservationSetError"
PNIStatusPodNetworkNotReady PNIStatus = "PodNetworkNotReady"
PNIStatusInsufficientIPAddressesOnSubnet PNIStatus = "InsufficientIPAddressesOnSubnet"
)

func init() {
SchemeBuilder.Register(&PodNetworkInstance{}, &PodNetworkInstanceList{})
}
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,14 @@ spec:
items:
type: string
type: array
status:
description: PNIStatus indicates the status of PNI
enum:
- Ready
- CreateReservationSetError
- PodNetworkNotReady
- InsufficientIPAddressesOnSubnet
type: string
type: object
type: object
served: true
Expand Down

0 comments on commit 1c440c2

Please sign in to comment.