Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ require (
k8s.io/client-go v0.24.2
k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9
sigs.k8s.io/controller-runtime v0.12.3
sigs.k8s.io/gateway-api v0.5.1
sigs.k8s.io/gateway-api v0.6.0-rc1
)

require (
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1017,8 +1017,8 @@ rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.30/go.mod h1:fEO7lRTdivWO2qYVCVG7dEADOMo/MLDCVr8So2g88Uw=
sigs.k8s.io/controller-runtime v0.12.3 h1:FCM8xeY/FI8hoAfh/V4XbbYMY20gElh9yh+A98usMio=
sigs.k8s.io/controller-runtime v0.12.3/go.mod h1:qKsk4WE6zW2Hfj0G4v10EnNB2jMG1C+NTb8h+DwCoU0=
sigs.k8s.io/gateway-api v0.5.1 h1:EqzgOKhChzyve9rmeXXbceBYB6xiM50vDfq0kK5qpdw=
sigs.k8s.io/gateway-api v0.5.1/go.mod h1:x0AP6gugkFV8fC/oTlnOMU0pnmuzIR8LfIPRVUjxSqA=
sigs.k8s.io/gateway-api v0.6.0-rc1 h1:ierhK6SIK8pSibB+gkr+aG8cWLez/M7iD9dQIqLALxU=
sigs.k8s.io/gateway-api v0.6.0-rc1/go.mod h1:+3QMzP775JFKArHqiwk/kzItMRXW9CKPXcO8QcuXvvk=
sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2 h1:kDi4JBNAsJWfz1aEXhO8Jg87JJaPNLh5tIzYHgStQ9Y=
sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2/go.mod h1:B+TnT182UBxE84DiCz4CVE26eOSDAeYCpfDnC2kdKMY=
sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw=
Expand Down
2 changes: 1 addition & 1 deletion internal/gatewayapi/contexts.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ func (l *ListenerContext) AllowsNamespace(namespace *v1.Namespace) bool {

func (l *ListenerContext) IsReady() bool {
for _, cond := range l.gateway.Status.Listeners[l.listenerStatusIdx].Conditions {
if cond.Type == string(v1beta1.ListenerConditionReady) && cond.Status == metav1.ConditionTrue {
if cond.Type == string(v1beta1.ListenerConditionProgrammed) && cond.Status == metav1.ConditionTrue {
return true
}
}
Expand Down
4 changes: 2 additions & 2 deletions internal/gatewayapi/contexts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ func TestContexts(t *testing.T) {
lctx := gctx.GetListenerContext("http")
require.NotNil(t, lctx)

lctx.SetCondition(v1beta1.ListenerConditionDetached, metav1.ConditionTrue, v1beta1.ListenerReasonUnsupportedProtocol, "HTTPS protocol is not supported yet")
lctx.SetCondition(v1beta1.ListenerConditionAccepted, metav1.ConditionTrue, v1beta1.ListenerReasonUnsupportedProtocol, "HTTPS protocol is not supported yet")

require.Len(t, gateway.Status.Listeners, 1)
require.EqualValues(t, gateway.Status.Listeners[0].Name, "http")
require.Len(t, gateway.Status.Listeners[0].Conditions, 1)
require.EqualValues(t, gateway.Status.Listeners[0].Conditions[0].Type, v1beta1.ListenerConditionDetached)
require.EqualValues(t, gateway.Status.Listeners[0].Conditions[0].Type, v1beta1.ListenerConditionAccepted)
require.EqualValues(t, gateway.Status.Listeners[0].Conditions[0].Status, metav1.ConditionTrue)
require.EqualValues(t, gateway.Status.Listeners[0].Conditions[0].Reason, v1beta1.ListenerReasonUnsupportedProtocol)
require.EqualValues(t, gateway.Status.Listeners[0].Conditions[0].Message, "HTTPS protocol is not supported yet")
Expand Down
12 changes: 6 additions & 6 deletions internal/gatewayapi/helpers_v1alpha2.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func UpgradeParentReference(old v1alpha2.ParentReference) v1beta1.ParentReferenc
upgraded.Namespace = NamespacePtr(string(*old.Namespace))
}

upgraded.Name = v1beta1.ObjectName(old.Name)
upgraded.Name = old.Name

if old.SectionName != nil {
upgraded.SectionName = SectionNamePtr(string(*old.SectionName))
Expand Down Expand Up @@ -96,7 +96,7 @@ func DowngradeParentReference(old v1beta1.ParentReference) v1alpha2.ParentRefere
downgraded.Namespace = NamespacePtrV1Alpha2(string(*old.Namespace))
}

downgraded.Name = v1alpha2.ObjectName(old.Name)
downgraded.Name = old.Name

if old.SectionName != nil {
downgraded.SectionName = SectionNamePtrV1Alpha2(string(*old.SectionName))
Expand All @@ -115,7 +115,7 @@ func UpgradeRouteParentStatuses(routeParentStatuses []v1alpha2.RouteParentStatus
for _, rps := range routeParentStatuses {
res = append(res, v1beta1.RouteParentStatus{
ParentRef: UpgradeParentReference(rps.ParentRef),
ControllerName: v1beta1.GatewayController(rps.ControllerName),
ControllerName: rps.ControllerName,
Conditions: rps.Conditions,
})
}
Expand All @@ -129,7 +129,7 @@ func DowngradeRouteParentStatuses(routeParentStatuses []v1beta1.RouteParentStatu
for _, rps := range routeParentStatuses {
res = append(res, v1alpha2.RouteParentStatus{
ParentRef: DowngradeParentReference(rps.ParentRef),
ControllerName: v1alpha2.GatewayController(rps.ControllerName),
ControllerName: rps.ControllerName,
Conditions: rps.Conditions,
})
}
Expand All @@ -153,7 +153,7 @@ func UpgradeBackendRef(old v1alpha2.BackendRef) v1beta1.BackendRef {
upgraded.Namespace = NamespacePtr(string(*old.Namespace))
}

upgraded.Name = v1beta1.ObjectName(old.Name)
upgraded.Name = old.Name

if old.Port != nil {
upgraded.Port = PortNumPtr(int32(*old.Port))
Expand All @@ -177,7 +177,7 @@ func DowngradeBackendRef(old v1beta1.BackendRef) v1alpha2.BackendRef {
downgraded.Namespace = NamespacePtrV1Alpha2(string(*old.Namespace))
}

downgraded.Name = v1alpha2.ObjectName(old.Name)
downgraded.Name = old.Name

if old.Port != nil {
downgraded.Port = PortNumPtrV1Alpha2(int(*old.Port))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ gateways:
kind: HTTPRoute
attachedRoutes: 1
conditions:
- type: Ready
- type: Programmed
status: "True"
reason: Ready
reason: Programmed
message: Listener is ready
httpRoutes:
- apiVersion: gateway.networking.k8s.io/v1beta1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ gateways:
kind: HTTPRoute
attachedRoutes: 0
conditions:
- type: Ready
- type: Programmed
status: "True"
reason: Ready
reason: Programmed
message: Listener is ready
httpRoutes:
- apiVersion: gateway.networking.k8s.io/v1beta1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ gateways:
kind: HTTPRoute
attachedRoutes: 0
conditions:
- type: Ready
- type: Programmed
status: "False"
reason: Invalid
message: "The allowedRoutes.namespaces.selector could not be parsed: values: Invalid value: []string{\"bar\"}: values set must be empty for exists and does not exist."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ gateways:
status: "False"
reason: InvalidRouteKinds
message: "Group is not supported, group must be gateway.networking.k8s.io"
- type: Ready
- type: Programmed
status: "False"
reason: Invalid
message: Listener is invalid, see other Conditions for details.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ gateways:
status: "False"
reason: InvalidRouteKinds
message: "Kind is not supported, kind must be HTTPRoute"
- type: Ready
- type: Programmed
status: "False"
reason: Invalid
message: Listener is invalid, see other Conditions for details.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ gateways:
status: "False"
reason: InvalidRouteKinds
message: "Kind is not supported, kind must be TLSRoute"
- type: Ready
- type: Programmed
status: "False"
reason: Invalid
message: Listener is invalid, see other Conditions for details.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ gateways:
kind: HTTPRoute
attachedRoutes: 0
conditions:
- type: Ready
- type: Programmed
status: "False"
reason: UnsupportedTLSMode
message: TLS Passthrough mode is not supported, TLS mode must be Terminate.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ gateways:
kind: HTTPRoute
attachedRoutes: 0
conditions:
- type: Ready
- type: Programmed
status: "False"
reason: Invalid
message: Listener must have exactly 1 TLS certificate ref
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ gateways:
status: "False"
reason: InvalidCertificateRef
message: Secret envoy-gateway/tls-secret-1 does not exist.
- type: Ready
- type: Programmed
status: "False"
reason: Invalid
message: Listener is invalid, see other Conditions for details.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ gateways:
status: "False"
reason: RefNotPermitted
message: Certificate ref to secret default/tls-secret-1 not permitted by any ReferenceGrant
- type: Ready
- type: Programmed
status: "False"
reason: Invalid
message: Listener is invalid, see other Conditions for details.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ gateways:
status: "False"
reason: InvalidCertificateRef
message: Secret envoy-gateway/tls-secret-1 must contain tls.crt and tls.key.
- type: Ready
- type: Programmed
status: "False"
reason: Invalid
message: Listener is invalid, see other Conditions for details.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ gateways:
kind: HTTPRoute
attachedRoutes: 0
conditions:
- type: Ready
- type: Programmed
status: "False"
reason: Invalid
message: The allowedRoutes.namespaces.selector field must be specified when allowedRoutes.namespaces.from is set to "Selector".
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ gateways:
kind: HTTPRoute
attachedRoutes: 1
conditions:
- type: Ready
- type: Programmed
status: "True"
reason: Ready
reason: Programmed
message: Listener is ready
httpRoutes:
- apiVersion: gateway.networking.k8s.io/v1beta1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,19 @@ gateways:
kind: TLSRoute
attachedRoutes: 1
conditions:
- type: Ready
- type: Programmed
status: "True"
reason: Ready
reason: Programmed
message: Listener is ready
- name: tls-terminate
supportedKinds:
- group: gateway.networking.k8s.io
kind: HTTPRoute
attachedRoutes: 1
conditions:
- type: Ready
- type: Programmed
status: "True"
reason: Ready
reason: Programmed
message: Listener is ready
tlsRoutes:
- apiVersion: gateway.networking.k8s.io/v1alpha2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ gateways:
- name: unsupported
attachedRoutes: 0
conditions:
- type: Detached
- type: Accepted
status: "True"
reason: UnsupportedProtocol
message: Protocol TCP is unsupported, must be HTTP or HTTPS.
- type: Ready
- type: Programmed
status: "False"
reason: Invalid
message: Listener is invalid, see other Conditions for details.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ gateways:
kind: HTTPRoute
attachedRoutes: 1
conditions:
- type: Ready
- type: Programmed
status: "True"
reason: Ready
reason: Programmed
message: Listener is ready
httpRoutes:
- apiVersion: gateway.networking.k8s.io/v1beta1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ gateways:
status: "True"
reason: HostnameConflict
message: All listeners for a given port must use a unique hostname
- type: Ready
- type: Programmed
status: "False"
reason: Invalid
message: Listener is invalid, see other Conditions for details.
Expand All @@ -47,7 +47,7 @@ gateways:
status: "True"
reason: HostnameConflict
message: All listeners for a given port must use a unique hostname
- type: Ready
- type: Programmed
status: "False"
reason: Invalid
message: Listener is invalid, see other Conditions for details.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ gateways:
status: "True"
reason: HostnameConflict
message: All listeners for a given port must use a unique hostname
- type: Ready
- type: Programmed
status: "False"
reason: Invalid
message: Listener is invalid, see other Conditions for details.
Expand All @@ -45,7 +45,7 @@ gateways:
status: "True"
reason: HostnameConflict
message: All listeners for a given port must use a unique hostname
- type: Ready
- type: Programmed
status: "False"
reason: Invalid
message: Listener is invalid, see other Conditions for details.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ gateways:
status: "True"
reason: ProtocolConflict
message: All listeners for a given port must use a compatible protocol
- type: Ready
- type: Programmed
status: "False"
reason: Invalid
message: Listener is invalid, see other Conditions for details.
Expand All @@ -45,7 +45,7 @@ gateways:
status: "True"
reason: ProtocolConflict
message: All listeners for a given port must use a compatible protocol
- type: Ready
- type: Programmed
status: "False"
reason: Invalid
message: Listener must have TLS set when protocol is HTTPS.
Expand Down
Loading