Skip to content

Commit 3004ea9

Browse files
authored
Upgrade to v1.2.0 of gateway API (#680)
* Upgrade of go version, migration off v1beta1 and v1alpha2 for v1 gateway API objects, removed main 3rd party CRDs, working unit and integ tests
1 parent ad6cfc1 commit 3004ea9

File tree

86 files changed

+2301
-23178
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+2301
-23178
lines changed

.github/workflows/presubmit.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ jobs:
1919
- name: golangci-lint
2020
uses: golangci/golangci-lint-action@v3
2121
with:
22-
version: v1.54
22+
version: v1.62.2
2323
args: --verbose --timeout 30m
2424

2525
presubmit:
2626
runs-on: ubuntu-latest
2727
strategy:
2828
matrix:
29-
k8sVersion: ["1.24.x"]
29+
k8sVersion: ["1.31.1"]
3030
env:
3131
K8S_VERSION: ${{ matrix.k8sVersion }}
3232
steps:

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Build the manager binary
2-
FROM --platform=$BUILDPLATFORM golang:1.20.5 as builder
2+
FROM --platform=$BUILDPLATFORM golang:1.23.0 as builder
33

44
WORKDIR /workspace
55
# Copy the Go Modules manifests

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,9 @@ build-deploy: ## Create a deployment file that can be applied with `kubectl appl
106106

107107
.PHONY: manifest
108108
manifest: ## Generate CRD manifest
109-
go run sigs.k8s.io/controller-tools/cmd/controller-gen@v0.13.0 object paths=./pkg/apis/...
110-
go run sigs.k8s.io/controller-tools/cmd/controller-gen@v0.13.0 crd paths=./pkg/apis/... output:crd:artifacts:config=config/crds/bases
111-
go run k8s.io/code-generator/cmd/register-gen@v0.28.0 --input-dirs ./pkg/apis/applicationnetworking/v1alpha1 --output-base ./ --go-header-file hack/boilerplate.go.txt
109+
go run sigs.k8s.io/controller-tools/cmd/controller-gen@v0.16.5 object paths=./pkg/apis/...
110+
go run sigs.k8s.io/controller-tools/cmd/controller-gen@v0.16.5 crd paths=./pkg/apis/... output:crd:artifacts:config=config/crds/bases
111+
go run k8s.io/code-generator/cmd/register-gen@v0.31.1 --logtostderr ./pkg/apis/applicationnetworking/v1alpha1 --go-header-file hack/boilerplate.go.txt
112112
cp config/crds/bases/application-networking.k8s.aws* helm/crds
113113

114114
e2e-test-namespace := "e2e-test"

cmd/aws-application-networking-k8s/main.go

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package main
1919
import (
2020
"flag"
2121
"os"
22+
gwv1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2"
2223
"strings"
2324

2425
"github.com/aws/aws-application-networking-k8s/pkg/webhook"
@@ -39,14 +40,11 @@ import (
3940
ctrl "sigs.k8s.io/controller-runtime"
4041
"sigs.k8s.io/controller-runtime/pkg/healthz"
4142

43+
"github.com/aws/aws-application-networking-k8s/pkg/controllers"
4244
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
4345
"k8s.io/apimachinery/pkg/runtime/schema"
4446
"sigs.k8s.io/external-dns/endpoint"
45-
gwv1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2"
46-
gwv1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1"
47-
48-
"github.com/aws/aws-application-networking-k8s/pkg/controllers"
49-
47+
gwv1 "sigs.k8s.io/gateway-api/apis/v1"
5048
//+kubebuilder:scaffold:imports
5149
anv1alpha1 "github.com/aws/aws-application-networking-k8s/pkg/apis/applicationnetworking/v1alpha1"
5250
"github.com/aws/aws-application-networking-k8s/pkg/config"
@@ -65,9 +63,9 @@ func init() {
6563
utilruntime.Must(clientgoscheme.AddToScheme(scheme))
6664

6765
//+kubebuilder:scaffold:scheme
68-
utilruntime.Must(gwv1alpha2.AddToScheme(scheme))
69-
utilruntime.Must(gwv1beta1.AddToScheme(scheme))
70-
utilruntime.Must(anv1alpha1.AddToScheme(scheme))
66+
utilruntime.Must(gwv1alpha2.Install(scheme))
67+
utilruntime.Must(gwv1.Install(scheme))
68+
utilruntime.Must(anv1alpha1.Install(scheme))
7169
utilruntime.Must(discoveryv1.AddToScheme(scheme))
7270
addOptionalCRDs(scheme)
7371
}

config/crds/bases/application-networking.k8s.aws_accesslogpolicies.yaml

Lines changed: 55 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.13.0
6+
controller-gen.kubebuilder.io/version: v0.16.5
77
name: accesslogpolicies.application-networking.k8s.aws
88
spec:
99
group: application-networking.k8s.aws
@@ -27,32 +27,38 @@ spec:
2727
openAPIV3Schema:
2828
properties:
2929
apiVersion:
30-
description: 'APIVersion defines the versioned schema of this representation
31-
of an object. Servers should convert recognized schemas to the latest
32-
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
30+
description: |-
31+
APIVersion defines the versioned schema of this representation of an object.
32+
Servers should convert recognized schemas to the latest internal value, and
33+
may reject unrecognized values.
34+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
3335
type: string
3436
kind:
35-
description: 'Kind is a string value representing the REST resource this
36-
object represents. Servers may infer this from the endpoint the client
37-
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
37+
description: |-
38+
Kind is a string value representing the REST resource this object represents.
39+
Servers may infer this from the endpoint the client submits requests to.
40+
Cannot be updated.
41+
In CamelCase.
42+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
3843
type: string
3944
metadata:
4045
type: object
4146
spec:
4247
description: AccessLogPolicySpec defines the desired state of AccessLogPolicy.
4348
properties:
4449
destinationArn:
45-
description: "The Amazon Resource Name (ARN) of the destination that
46-
will store access logs. Supported values are S3 Bucket, CloudWatch
47-
Log Group, and Firehose Delivery Stream ARNs. \n Changes to this
48-
value results in replacement of the VPC Lattice Access Log Subscription."
50+
description: |-
51+
The Amazon Resource Name (ARN) of the destination that will store access logs.
52+
Supported values are S3 Bucket, CloudWatch Log Group, and Firehose Delivery Stream ARNs.
53+
54+
Changes to this value results in replacement of the VPC Lattice Access Log Subscription.
4955
pattern: ^arn(:[a-z0-9]+([.-][a-z0-9]+)*){2}(:([a-z0-9]+([.-][a-z0-9]+)*)?){2}:([^/].*)?
5056
type: string
5157
targetRef:
52-
description: "TargetRef points to the Kubernetes Gateway, HTTPRoute,
53-
or GRPCRoute resource that will have this policy attached. \n This
54-
field is following the guidelines of Kubernetes Gateway API policy
55-
attachment."
58+
description: |-
59+
TargetRef points to the Kubernetes Gateway, HTTPRoute, or GRPCRoute resource that will have this policy attached.
60+
61+
This field is following the guidelines of Kubernetes Gateway API policy attachment.
5662
properties:
5763
group:
5864
description: Group is the group of the target resource.
@@ -71,10 +77,11 @@ spec:
7177
minLength: 1
7278
type: string
7379
namespace:
74-
description: Namespace is the namespace of the referent. When
75-
unspecified, the local namespace is inferred. Even when policy
76-
targets a resource in a different namespace, it MUST only apply
77-
to traffic originating from the same namespace as the policy.
80+
description: |-
81+
Namespace is the namespace of the referent. When unspecified, the local
82+
namespace is inferred. Even when policy targets a resource in a different
83+
namespace, it MUST only apply to traffic originating from the same
84+
namespace as the policy.
7885
maxLength: 63
7986
minLength: 1
8087
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
@@ -110,50 +117,48 @@ spec:
110117
reason: Pending
111118
status: Unknown
112119
type: Programmed
113-
description: "Conditions describe the current conditions of the AccessLogPolicy.
114-
\n Implementations should prefer to express Policy conditions using
115-
the `PolicyConditionType` and `PolicyConditionReason` constants
116-
so that operators and tools can converge on a common vocabulary
117-
to describe AccessLogPolicy state. \n Known condition types are:
118-
\n * \"Accepted\" * \"Ready\""
120+
description: |-
121+
Conditions describe the current conditions of the AccessLogPolicy.
122+
123+
Implementations should prefer to express Policy conditions
124+
using the `PolicyConditionType` and `PolicyConditionReason`
125+
constants so that operators and tools can converge on a common
126+
vocabulary to describe AccessLogPolicy state.
127+
128+
Known condition types are:
129+
130+
* "Accepted"
131+
* "Ready"
119132
items:
120-
description: "Condition contains details for one aspect of the current
121-
state of this API Resource. --- This struct is intended for direct
122-
use as an array at the field path .status.conditions. For example,
123-
\n type FooStatus struct{ // Represents the observations of a
124-
foo's current state. // Known .status.conditions.type are: \"Available\",
125-
\"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge
126-
// +listType=map // +listMapKey=type Conditions []metav1.Condition
127-
`json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\"
128-
protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }"
133+
description: Condition contains details for one aspect of the current
134+
state of this API Resource.
129135
properties:
130136
lastTransitionTime:
131-
description: lastTransitionTime is the last time the condition
132-
transitioned from one status to another. This should be when
133-
the underlying condition changed. If that is not known, then
134-
using the time when the API field changed is acceptable.
137+
description: |-
138+
lastTransitionTime is the last time the condition transitioned from one status to another.
139+
This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
135140
format: date-time
136141
type: string
137142
message:
138-
description: message is a human readable message indicating
139-
details about the transition. This may be an empty string.
143+
description: |-
144+
message is a human readable message indicating details about the transition.
145+
This may be an empty string.
140146
maxLength: 32768
141147
type: string
142148
observedGeneration:
143-
description: observedGeneration represents the .metadata.generation
144-
that the condition was set based upon. For instance, if .metadata.generation
145-
is currently 12, but the .status.conditions[x].observedGeneration
146-
is 9, the condition is out of date with respect to the current
147-
state of the instance.
149+
description: |-
150+
observedGeneration represents the .metadata.generation that the condition was set based upon.
151+
For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
152+
with respect to the current state of the instance.
148153
format: int64
149154
minimum: 0
150155
type: integer
151156
reason:
152-
description: reason contains a programmatic identifier indicating
153-
the reason for the condition's last transition. Producers
154-
of specific condition types may define expected values and
155-
meanings for this field, and whether the values are considered
156-
a guaranteed API. The value should be a CamelCase string.
157+
description: |-
158+
reason contains a programmatic identifier indicating the reason for the condition's last transition.
159+
Producers of specific condition types may define expected values and meanings for this field,
160+
and whether the values are considered a guaranteed API.
161+
The value should be a CamelCase string.
157162
This field may not be empty.
158163
maxLength: 1024
159164
minLength: 1
@@ -168,10 +173,6 @@ spec:
168173
type: string
169174
type:
170175
description: type of condition in CamelCase or in foo.example.com/CamelCase.
171-
--- Many .condition.type values are consistent across resources
172-
like Available, but because arbitrary conditions can be useful
173-
(see .node.status.conditions), the ability to deconflict is
174-
important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt)
175176
maxLength: 316
176177
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
177178
type: string

0 commit comments

Comments
 (0)