Skip to content

Commit 0bf59f5

Browse files
committed
Enable .spec.expose.ingress for backward compatibility
Signed-off-by: Sheng Lin <[email protected]>
1 parent 7cdf9e0 commit 0bf59f5

31 files changed

+4877
-529
lines changed

api/apps/v1alpha1/common_types.go

Lines changed: 1 addition & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,7 @@ const (
4242
type Expose struct {
4343
Service Service `json:"service,omitempty"`
4444
// Deprecated: Use .spec.router instead.
45-
// Ingress Ingress `json:"ingress,omitempty"`
46-
// Deprecated: Use .spec.router instead.
47-
// HTTPRoute HTTPRoute `json:"httpRoute,omitempty"`
45+
Ingress Ingress `json:"ingress,omitempty"`
4846
}
4947

5048
// +kubebuilder:validation:XValidation:rule="!(has(self.gateway) && has(self.ingressClass))", message="ingressClass and gateway cannot be specified together"
@@ -148,41 +146,6 @@ type Ingress struct {
148146
Spec networkingv1.IngressSpec `json:"spec,omitempty"`
149147
}
150148

151-
// HTTPRoute defines attributes to HTTPRoute in Gateway API.
152-
type HTTPRoute struct {
153-
Enabled *bool `json:"enabled,omitempty"`
154-
Annotations map[string]string `json:"annotations,omitempty"`
155-
Spec *HTTPRouteSpec `json:"spec,omitempty"`
156-
}
157-
158-
type HTTPRouteSpec struct {
159-
gatewayv1.CommonRouteSpec `json:",inline"`
160-
Host gatewayv1.Hostname `json:"host,omitempty"`
161-
Paths []HTTPPathMatch `json:"paths,omitempty"`
162-
}
163-
164-
type HTTPPathMatch struct {
165-
// Type specifies how to match against the path Value.
166-
// +optional
167-
// +kubebuilder:default=PathPrefix
168-
Type *gatewayv1.PathMatchType `json:"type,omitempty"`
169-
170-
// Value of the HTTP path to match against.
171-
// +optional
172-
// +kubebuilder:default="/"
173-
// +kubebuilder:validation:MaxLength=1024
174-
Value *string `json:"value,omitempty"`
175-
}
176-
177-
// IngressV1 defines attributes for ingress
178-
//
179-
// +kubebuilder:validation:XValidation:rule="(has(self.spec) && has(self.enabled) && self.enabled) || !has(self.enabled) || !self.enabled", message="spec cannot be nil when ingress is enabled"
180-
type IngressV1 struct {
181-
Enabled *bool `json:"enabled,omitempty"`
182-
Annotations map[string]string `json:"annotations,omitempty"`
183-
Spec *IngressSpec `json:"spec,omitempty"`
184-
}
185-
186149
// ResourceRequirements defines the resources required for a container.
187150
type ResourceRequirements struct {
188151
// Limits describes the maximum amount of compute resources allowed.

0 commit comments

Comments
 (0)