|
| 1 | +package v1alpha2 |
| 2 | + |
| 3 | +import ( |
| 4 | + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" |
| 5 | + "k8s.io/apimachinery/pkg/runtime" |
| 6 | + "k8s.io/apimachinery/pkg/runtime/schema" |
| 7 | + "k8s.io/apiserver/pkg/registry/rest" |
| 8 | + "sigs.k8s.io/apiserver-runtime/pkg/builder/resource" |
| 9 | + gwapiv1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2" |
| 10 | +) |
| 11 | + |
| 12 | +// +kubebuilder:object:root=true |
| 13 | +// +kubebuilder:subresource:status |
| 14 | + |
| 15 | +// +genclient |
| 16 | +// +genclient:nonNamespaced |
| 17 | +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object |
| 18 | +type TLSRoute struct { |
| 19 | + metav1.TypeMeta `json:",inline"` |
| 20 | + metav1.ObjectMeta `json:"metadata,omitempty"` |
| 21 | + |
| 22 | + Spec gwapiv1alpha2.TLSRouteSpec `json:"spec,omitempty"` |
| 23 | + |
| 24 | + Status TLSRouteStatus `json:"status,omitempty"` |
| 25 | +} |
| 26 | + |
| 27 | +var ( |
| 28 | + _ runtime.Object = &TLSRoute{} |
| 29 | + _ resource.Object = &TLSRoute{} |
| 30 | + _ resource.ObjectWithStatusSubResource = &TLSRoute{} |
| 31 | + _ rest.SingularNameProvider = &TLSRoute{} |
| 32 | +) |
| 33 | + |
| 34 | +func (p *TLSRoute) GetObjectMeta() *metav1.ObjectMeta { |
| 35 | + return &p.ObjectMeta |
| 36 | +} |
| 37 | + |
| 38 | +func (p *TLSRoute) NamespaceScoped() bool { |
| 39 | + return false |
| 40 | +} |
| 41 | + |
| 42 | +func (p *TLSRoute) New() runtime.Object { |
| 43 | + return &TLSRoute{} |
| 44 | +} |
| 45 | + |
| 46 | +func (p *TLSRoute) NewList() runtime.Object { |
| 47 | + return &TLSRouteList{} |
| 48 | +} |
| 49 | + |
| 50 | +func (p *TLSRoute) GetGroupVersionResource() schema.GroupVersionResource { |
| 51 | + return schema.GroupVersionResource{ |
| 52 | + Group: SchemeGroupVersion.Group, |
| 53 | + Version: SchemeGroupVersion.Version, |
| 54 | + Resource: "tlsroutes", |
| 55 | + } |
| 56 | +} |
| 57 | + |
| 58 | +func (p *TLSRoute) IsStorageVersion() bool { |
| 59 | + return true |
| 60 | +} |
| 61 | + |
| 62 | +func (p *TLSRoute) GetSingularName() string { |
| 63 | + return "tlsroute" |
| 64 | +} |
| 65 | + |
| 66 | +func (p *TLSRoute) GetStatus() resource.StatusSubResource { |
| 67 | + return &p.Status |
| 68 | +} |
| 69 | + |
| 70 | +type TLSRouteStatus struct { |
| 71 | + gwapiv1alpha2.TLSRouteStatus |
| 72 | +} |
| 73 | + |
| 74 | +var _ resource.StatusSubResource = &TLSRouteStatus{} |
| 75 | + |
| 76 | +func (s *TLSRouteStatus) SubResourceName() string { |
| 77 | + return "status" |
| 78 | +} |
| 79 | + |
| 80 | +func (s *TLSRouteStatus) CopyTo(obj resource.ObjectWithStatusSubResource) { |
| 81 | + parent, ok := obj.(*TLSRoute) |
| 82 | + if ok { |
| 83 | + parent.Status = *s |
| 84 | + } |
| 85 | +} |
| 86 | + |
| 87 | +// +kubebuilder:object:root=true |
| 88 | +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object |
| 89 | + |
| 90 | +type TLSRouteList struct { |
| 91 | + metav1.TypeMeta `json:",inline"` |
| 92 | + metav1.ListMeta `json:"metadata,omitempty"` |
| 93 | + Items []TLSRoute `json:"items"` |
| 94 | +} |
| 95 | + |
| 96 | +var _ resource.ObjectList = &TLSRouteList{} |
| 97 | + |
| 98 | +func (pl *TLSRouteList) GetListMeta() *metav1.ListMeta { |
| 99 | + return &pl.ListMeta |
| 100 | +} |
| 101 | + |
| 102 | +// +kubebuilder:object:root=true |
| 103 | + |
| 104 | +// +genclient |
| 105 | +// +genclient:nonNamespaced |
| 106 | +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object |
| 107 | +type TCPRoute struct { |
| 108 | + metav1.TypeMeta `json:",inline"` |
| 109 | + metav1.ObjectMeta `json:"metadata,omitempty"` |
| 110 | + |
| 111 | + Spec gwapiv1alpha2.TCPRouteSpec `json:"spec,omitempty"` |
| 112 | + |
| 113 | + Status TCPRouteStatus `json:"status,omitempty"` |
| 114 | +} |
| 115 | + |
| 116 | +var ( |
| 117 | + _ runtime.Object = &TCPRoute{} |
| 118 | + _ resource.Object = &TCPRoute{} |
| 119 | + _ resource.ObjectWithStatusSubResource = &TCPRoute{} |
| 120 | + _ rest.SingularNameProvider = &TCPRoute{} |
| 121 | +) |
| 122 | + |
| 123 | +func (p *TCPRoute) GetObjectMeta() *metav1.ObjectMeta { |
| 124 | + return &p.ObjectMeta |
| 125 | +} |
| 126 | + |
| 127 | +func (p *TCPRoute) NamespaceScoped() bool { |
| 128 | + return false |
| 129 | +} |
| 130 | + |
| 131 | +func (p *TCPRoute) New() runtime.Object { |
| 132 | + return &TCPRoute{} |
| 133 | +} |
| 134 | + |
| 135 | +func (p *TCPRoute) NewList() runtime.Object { |
| 136 | + return &TCPRouteList{} |
| 137 | +} |
| 138 | + |
| 139 | +func (p *TCPRoute) GetGroupVersionResource() schema.GroupVersionResource { |
| 140 | + return schema.GroupVersionResource{ |
| 141 | + Group: SchemeGroupVersion.Group, |
| 142 | + Version: SchemeGroupVersion.Version, |
| 143 | + Resource: "tcproutes", |
| 144 | + } |
| 145 | +} |
| 146 | + |
| 147 | +func (p *TCPRoute) IsStorageVersion() bool { |
| 148 | + return true |
| 149 | +} |
| 150 | + |
| 151 | +func (p *TCPRoute) GetSingularName() string { |
| 152 | + return "tcproute" |
| 153 | +} |
| 154 | + |
| 155 | +func (p *TCPRoute) GetStatus() resource.StatusSubResource { |
| 156 | + return &p.Status |
| 157 | +} |
| 158 | + |
| 159 | +type TCPRouteStatus struct { |
| 160 | + gwapiv1alpha2.TCPRouteStatus |
| 161 | +} |
| 162 | + |
| 163 | +var _ resource.StatusSubResource = &TCPRouteStatus{} |
| 164 | + |
| 165 | +func (s *TCPRouteStatus) SubResourceName() string { |
| 166 | + return "status" |
| 167 | +} |
| 168 | + |
| 169 | +func (s *TCPRouteStatus) CopyTo(obj resource.ObjectWithStatusSubResource) { |
| 170 | + parent, ok := obj.(*TCPRoute) |
| 171 | + if ok { |
| 172 | + parent.Status = *s |
| 173 | + } |
| 174 | +} |
| 175 | + |
| 176 | +// +kubebuilder:object:root=true |
| 177 | +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object |
| 178 | + |
| 179 | +type TCPRouteList struct { |
| 180 | + metav1.TypeMeta `json:",inline"` |
| 181 | + metav1.ListMeta `json:"metadata,omitempty"` |
| 182 | + Items []TCPRoute `json:"items"` |
| 183 | +} |
| 184 | + |
| 185 | +var _ resource.ObjectList = &TCPRouteList{} |
| 186 | + |
| 187 | +func (pl *TCPRouteList) GetListMeta() *metav1.ListMeta { |
| 188 | + return &pl.ListMeta |
| 189 | +} |
| 190 | + |
| 191 | +// +kubebuilder:object:root=true |
| 192 | + |
| 193 | +// +genclient |
| 194 | +// +genclient:nonNamespaced |
| 195 | +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object |
| 196 | +type UDPRoute struct { |
| 197 | + metav1.TypeMeta `json:",inline"` |
| 198 | + metav1.ObjectMeta `json:"metadata,omitempty"` |
| 199 | + |
| 200 | + Spec gwapiv1alpha2.UDPRouteSpec `json:"spec,omitempty"` |
| 201 | + |
| 202 | + Status UDPRouteStatus `json:"status,omitempty"` |
| 203 | +} |
| 204 | + |
| 205 | +var ( |
| 206 | + _ runtime.Object = &UDPRoute{} |
| 207 | + _ resource.Object = &UDPRoute{} |
| 208 | + _ resource.ObjectWithStatusSubResource = &UDPRoute{} |
| 209 | + _ rest.SingularNameProvider = &UDPRoute{} |
| 210 | +) |
| 211 | + |
| 212 | +func (p *UDPRoute) GetObjectMeta() *metav1.ObjectMeta { |
| 213 | + return &p.ObjectMeta |
| 214 | +} |
| 215 | + |
| 216 | +func (p *UDPRoute) NamespaceScoped() bool { |
| 217 | + return false |
| 218 | +} |
| 219 | + |
| 220 | +func (p *UDPRoute) New() runtime.Object { |
| 221 | + return &UDPRoute{} |
| 222 | +} |
| 223 | + |
| 224 | +func (p *UDPRoute) NewList() runtime.Object { |
| 225 | + return &UDPRouteList{} |
| 226 | +} |
| 227 | + |
| 228 | +func (p *UDPRoute) GetGroupVersionResource() schema.GroupVersionResource { |
| 229 | + return schema.GroupVersionResource{ |
| 230 | + Group: SchemeGroupVersion.Group, |
| 231 | + Version: SchemeGroupVersion.Version, |
| 232 | + Resource: "udproutes", |
| 233 | + } |
| 234 | +} |
| 235 | + |
| 236 | +func (p *UDPRoute) IsStorageVersion() bool { |
| 237 | + return true |
| 238 | +} |
| 239 | + |
| 240 | +func (p *UDPRoute) GetSingularName() string { |
| 241 | + return "udproute" |
| 242 | +} |
| 243 | + |
| 244 | +func (p *UDPRoute) GetStatus() resource.StatusSubResource { |
| 245 | + return &p.Status |
| 246 | +} |
| 247 | + |
| 248 | +type UDPRouteStatus struct { |
| 249 | + gwapiv1alpha2.UDPRouteStatus |
| 250 | +} |
| 251 | + |
| 252 | +var _ resource.StatusSubResource = &UDPRouteStatus{} |
| 253 | + |
| 254 | +func (s *UDPRouteStatus) SubResourceName() string { |
| 255 | + return "status" |
| 256 | +} |
| 257 | + |
| 258 | +func (s *UDPRouteStatus) CopyTo(obj resource.ObjectWithStatusSubResource) { |
| 259 | + parent, ok := obj.(*UDPRoute) |
| 260 | + if ok { |
| 261 | + parent.Status = *s |
| 262 | + } |
| 263 | +} |
| 264 | + |
| 265 | +// +kubebuilder:object:root=true |
| 266 | +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object |
| 267 | + |
| 268 | +type UDPRouteList struct { |
| 269 | + metav1.TypeMeta `json:",inline"` |
| 270 | + metav1.ListMeta `json:"metadata,omitempty"` |
| 271 | + Items []UDPRoute `json:"items"` |
| 272 | +} |
| 273 | + |
| 274 | +var _ resource.ObjectList = &UDPRouteList{} |
| 275 | + |
| 276 | +func (pl *UDPRouteList) GetListMeta() *metav1.ListMeta { |
| 277 | + return &pl.ListMeta |
| 278 | +} |
0 commit comments