Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: bump Gateway API to 0.6.0 #3496

Merged
merged 8 commits into from
Feb 7, 2023
Merged
Show file tree
Hide file tree
Changes from 5 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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ Adding a new version? You'll need three changes:
be used to deploy a DB-less variant of KIC that will also synchronise its
data-plane configuration with Konnect cloud.
[#3448](https://github.com/Kong/kubernetes-ingress-controller/pull/3448)
- The Gateway API has been bumped to 0.6.0. The GatewayConditionScheduled has
been replaced by the GatewayConditionAccepted, and the ListenerConditionDetached
condition has been replaced by the ListenerConditionAccepted.
mlavacca marked this conversation as resolved.
Show resolved Hide resolved
[#3496](https://github.com/Kong/kubernetes-ingress-controller/pull/3496)

### Fixed

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ require (
knative.dev/networking v0.0.0-20220302134042-e8b2eb995165
knative.dev/pkg v0.0.0-20220301181942-2fdd5f232e77
sigs.k8s.io/controller-runtime v0.14.4
sigs.k8s.io/gateway-api v0.5.1
sigs.k8s.io/gateway-api v0.6.0
sigs.k8s.io/kustomize/api v0.12.1
sigs.k8s.io/kustomize/kyaml v0.13.9
sigs.k8s.io/yaml v1.3.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1557,8 +1557,8 @@ rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.22/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg=
sigs.k8s.io/controller-runtime v0.14.4 h1:Kd/Qgx5pd2XUL08eOV2vwIq3L9GhIbJ5Nxengbd4/0M=
sigs.k8s.io/controller-runtime v0.14.4/go.mod h1:WqIdsAY6JBsjfc/CqO0CORmNtoCtE4S6qbPc9s68h+0=
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 h1:v2FqrN2ROWZLrSnI2o91taHR8Sj3s+Eh3QU7gLNWIqA=
sigs.k8s.io/gateway-api v0.6.0/go.mod h1:EYJT+jlPWTeNskjV0JTki/03WX1cyAnBhwBJfYHpV/0=
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 h1:iXTIw73aPyC+oRdyqqvVJuloN1p0AC/kzH07hu3NE+k=
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0=
sigs.k8s.io/kind v0.17.0 h1:CScmGz/wX66puA06Gj8OZb76Wmk7JIjgWf5JDvY7msM=
Expand Down
6 changes: 3 additions & 3 deletions internal/controllers/gateway/gateway_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -410,13 +410,13 @@ func (r *GatewayReconciler) reconcileUnmanagedGateway(ctx context.Context, log l
// set the Gateway as scheduled to indicate that validation is complete and reconciliation work
// on the object is ready to begin.
if !isGatewayScheduled(gateway) {
info(log, gateway, "marking gateway as scheduled")
info(log, gateway, "marking gateway as accepted")
scheduledCondition := metav1.Condition{
Type: string(gatewayv1beta1.GatewayConditionScheduled),
Type: string(gatewayv1beta1.GatewayConditionAccepted),
Status: metav1.ConditionTrue,
ObservedGeneration: gateway.Generation,
LastTransitionTime: metav1.Now(),
Reason: string(gatewayv1beta1.GatewayReasonScheduled),
Reason: string(gatewayv1beta1.GatewayReasonAccepted),
Message: "this unmanaged gateway has been picked up by the controller and will be processed",
}
setGatewayCondition(gateway, scheduledCondition)
Expand Down
26 changes: 13 additions & 13 deletions internal/controllers/gateway/gateway_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,17 +164,17 @@ func TestSetGatewayCondtion(t *testing.T) {
}
}

func TestIsGatewayMarkedAsScheduled(t *testing.T) {
t.Log("verifying scheduled check for gateway object which has been scheduled")
func TestIsGatewayMarkedAsAccepted(t *testing.T) {
t.Log("verifying scheduled check for gateway object which has been accepted")
scheduledGateway := &gatewayv1beta1.Gateway{
ObjectMeta: metav1.ObjectMeta{Generation: 1},
Status: gatewayv1beta1.GatewayStatus{
Conditions: []metav1.Condition{{
Type: string(gatewayv1beta1.GatewayConditionScheduled),
Type: string(gatewayv1beta1.GatewayConditionAccepted),
Status: metav1.ConditionTrue,
ObservedGeneration: 1,
LastTransitionTime: metav1.Now(),
Reason: string(gatewayv1beta1.GatewayReasonScheduled),
Reason: string(gatewayv1beta1.GatewayReasonAccepted),
}},
},
}
Expand Down Expand Up @@ -409,7 +409,7 @@ func TestGetReferenceGrantConditionReason(t *testing.T) {
{
name: "empty reference",
certRef: gatewayv1beta1.SecretObjectReference{},
expectedReason: string(gatewayv1alpha2.ListenerReasonResolvedRefs),
expectedReason: string(gatewayv1beta1.ListenerReasonResolvedRefs),
},
{
name: "no need for reference",
Expand All @@ -418,7 +418,7 @@ func TestGetReferenceGrantConditionReason(t *testing.T) {
Kind: util.StringToGatewayAPIKindPtr("Secret"),
Name: "testSecret",
},
expectedReason: string(gatewayv1alpha2.ListenerReasonResolvedRefs),
expectedReason: string(gatewayv1beta1.ListenerReasonResolvedRefs),
},
{
name: "reference not granted - secret name not matching",
Expand All @@ -436,7 +436,7 @@ func TestGetReferenceGrantConditionReason(t *testing.T) {
Spec: gatewayv1alpha2.ReferenceGrantSpec{
From: []gatewayv1alpha2.ReferenceGrantFrom{
{
Group: (gatewayv1alpha2.Group)(gatewayV1beta1Group),
Group: gatewayV1beta1Group,
Kind: "Gateway",
Namespace: "test",
},
Expand All @@ -451,7 +451,7 @@ func TestGetReferenceGrantConditionReason(t *testing.T) {
},
},
},
expectedReason: string(gatewayv1alpha2.ListenerReasonRefNotPermitted),
expectedReason: string(gatewayv1beta1.ListenerReasonRefNotPermitted),
},
{
name: "reference not granted - no grants specified",
Expand All @@ -461,7 +461,7 @@ func TestGetReferenceGrantConditionReason(t *testing.T) {
Name: "testSecret",
Namespace: lo.ToPtr(Namespace("otherNamespace")),
},
expectedReason: string(gatewayv1alpha2.ListenerReasonRefNotPermitted),
expectedReason: string(gatewayv1beta1.ListenerReasonRefNotPermitted),
},
{
name: "reference granted, secret name not specified",
Expand All @@ -486,7 +486,7 @@ func TestGetReferenceGrantConditionReason(t *testing.T) {
},
// good entry
{
Group: (gatewayv1alpha2.Group)(gatewayV1beta1Group),
Group: gatewayV1beta1Group,
Kind: "Gateway",
Namespace: "test",
},
Expand All @@ -500,7 +500,7 @@ func TestGetReferenceGrantConditionReason(t *testing.T) {
},
},
},
expectedReason: string(gatewayv1alpha2.ListenerReasonResolvedRefs),
expectedReason: string(gatewayv1beta1.ListenerReasonResolvedRefs),
},
{
name: "reference granted, secret name specified",
Expand All @@ -518,7 +518,7 @@ func TestGetReferenceGrantConditionReason(t *testing.T) {
Spec: gatewayv1alpha2.ReferenceGrantSpec{
From: []gatewayv1alpha2.ReferenceGrantFrom{
{
Group: (gatewayv1alpha2.Group)(gatewayV1beta1Group),
Group: gatewayV1beta1Group,
Kind: "Gateway",
Namespace: "test",
},
Expand All @@ -533,7 +533,7 @@ func TestGetReferenceGrantConditionReason(t *testing.T) {
},
},
},
expectedReason: string(gatewayv1alpha2.ListenerReasonResolvedRefs),
expectedReason: string(gatewayv1beta1.ListenerReasonResolvedRefs),
},
}

Expand Down
Loading