@@ -51,15 +51,47 @@ type SubnetStatus struct {
5151 Conditions []metav1.Condition `json:"conditions,omitempty"`
5252}
5353
54+ const (
55+ // SubnetAllocated indicates that the subnet has been allocated a prefix
56+ SubnetAllocated = "Allocated"
57+
58+ // SubnetProgrammed indicates that the subnet has been programmed
59+ SubnetProgrammed = "Programmed"
60+
61+ // SubnetReady indicates that the subnet is ready to use
62+ SubnetReady = "Ready"
63+ )
64+
65+ const (
66+ // SubnetProgrammedReasonNotProgrammed indicates that the subnet has not been programmed
67+ SubnetProgrammedReasonNotProgrammed = "NotProgrammed"
68+
69+ // SubnetProgrammedReasonProgrammingInProgress indicates that the subnet is being programmed.
70+ SubnetProgrammedReasonProgrammingInProgress = "ProgrammingInProgress"
71+
72+ // SubnetProgrammedReasonProgrammed indicates that the subnet has been programmed
73+ SubnetProgrammedReasonProgrammed = "Programmed"
74+
75+ // SubnetReadyReasonReady indicates that the subnet is ready to use
76+ SubnetReadyReasonReady = "Ready"
77+ )
78+
5479// +kubebuilder:object:root=true
5580// +kubebuilder:subresource:status
5681
5782// Subnet is the Schema for the subnets API
83+ // +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"
84+ // +kubebuilder:printcolumn:name="Ready",type=string,JSONPath=`.status.conditions[?(@.type=="Ready")].status`
85+ // +kubebuilder:printcolumn:name="Reason",type=string,JSONPath=`.status.conditions[?(@.type=="Ready")].reason`
86+ // +kubebuilder:printcolumn:name="Start Address",type=string,JSONPath=`.status.startAddress`
87+ // +kubebuilder:printcolumn:name="Prefix Length",type=string,JSONPath=`.status.prefixLength`
5888type Subnet struct {
5989 metav1.TypeMeta `json:",inline"`
6090 metav1.ObjectMeta `json:"metadata,omitempty"`
6191
62- Spec SubnetSpec `json:"spec,omitempty"`
92+ Spec SubnetSpec `json:"spec,omitempty"`
93+
94+ // +kubebuilder:default={conditions:{{type:"Allocated",status:"Unknown",reason:"Pending", message:"Waiting for controller", lastTransitionTime: "1970-01-01T00:00:00Z"},{type:"Programmed",status:"Unknown",reason:"Pending", message:"Waiting for controller", lastTransitionTime: "1970-01-01T00:00:00Z"},{type:"Ready",status:"Unknown",reason:"Pending", message:"Waiting for controller", lastTransitionTime: "1970-01-01T00:00:00Z"}}}
6395 Status SubnetStatus `json:"status,omitempty"`
6496}
6597
0 commit comments