Skip to content

Commit

Permalink
build: support go1.22
Browse files Browse the repository at this point in the history
This fixes panic on go1.22, see kubernetes-sigs/controller-tools#880
and golang/go#65637

Since `go get sigs.k8s.io/controller-tools` updates transitive Kubernetes dependencies
this change removes it from dependencies in favor of fixed version in the Makefile.

Signed-off-by: Alexander Yastrebov <alexander.yastrebov@zalando.de>
  • Loading branch information
AlexanderYastrebov committed Mar 6, 2024
1 parent 7dea922 commit b14bfcd
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 350 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ $(GENERATED): $(CRD_TYPE_SOURCE)
bash -x ./hack/update-codegen.sh

$(GENERATED_CRD): go.mod $(GENERATED)
go run sigs.k8s.io/controller-tools/cmd/controller-gen crd:crdVersions=v1 paths=./apis/... output:crd:dir=.
go run sigs.k8s.io/controller-tools/cmd/controller-gen@v0.14.0 crd:crdVersions=v1 paths=./apis/... output:crd:dir=.
# workaround to add pattern to array items. Not supported by controller-gen
# ref: https://github.com/kubernetes-sigs/controller-tools/issues/342
perl -i -p0e 's|(\s*)(hosts:.*?items:)|$$1$$2$$1 pattern: "^[a-z0-9]([-a-z0-9]*[a-z0-9])?([.][a-z0-9]([-a-z0-9]*[a-z0-9])?)*\$$"|sg' $(GENERATED_CRD)
Expand Down
2 changes: 1 addition & 1 deletion apis/zalando.org/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ type RouteGroupRouteSpec struct {
// +k8s:deepcopy-gen=true
type RouteGroupTLSSpec struct {
// TLS hosts specify the list of hosts included in the TLS secret.
// The values in this list must match the host name(s) used for
// The values in this list must match the host name(s) used for
// the RouteGroup in order to terminate TLS for the host(s).
// +kubebuilder:validation:MinItems=1
Hosts []string `json:"hosts"`
Expand Down
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ go 1.15

require (
github.com/davecgh/go-spew v1.1.1
github.com/onsi/ginkgo v1.16.5 // indirect
k8s.io/apimachinery v0.25.16
k8s.io/client-go v0.25.16
k8s.io/code-generator v0.25.16
sigs.k8s.io/controller-tools v0.10.0
sigs.k8s.io/yaml v1.3.0 // indirect
)
Loading

0 comments on commit b14bfcd

Please sign in to comment.