Skip to content

Commit b393a26

Browse files
feat: add gateway api support (#725)
Signed-off-by: Lukas Reining <lukas.reining@codecentric.de>
1 parent e3f1e24 commit b393a26

Some content is hidden

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

43 files changed

+12072
-516
lines changed

.github/workflows/e2e.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
description: "Tag of Kind image"
77
type: "string"
88
env:
9-
GO_VERSION: "~1.21"
9+
GO_VERSION: "~1.23"
1010
defaults:
1111
run:
1212
shell: bash
@@ -47,7 +47,7 @@ jobs:
4747
kind load docker-image open-feature-operator-local:${{ github.sha }} --name open-feature-operator-test
4848
4949
- name: Install Chainsaw
50-
uses: kyverno/action-install-chainsaw@748066cc1580718e7924c9b689a8d366bde05100 # v0.2.0
50+
uses: kyverno/action-install-chainsaw@f2b47b97dc889c12702113753d713f01ec268de5 # v0.2.12
5151

5252
- name: Install OFO
5353
run: |

.github/workflows/golangci-lint.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ on:
1717
- "!docs/**"
1818
env:
1919
# renovate: datasource=github-releases depName=golangci/golangci-lint
20-
GOLANGCI_LINT_VERSION: "v1.59.0"
21-
GO_VERSION: "~1.21"
20+
GOLANGCI_LINT_VERSION: "v1.63.4"
21+
GO_VERSION: "~1.23"
2222
jobs:
2323
golangci-lint:
2424
name: golangci-lint

.github/workflows/release-please.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77

88
env:
99
# Default minimum version of Go to support.
10-
DEFAULT_GO_VERSION: "~1.21"
10+
DEFAULT_GO_VERSION: "~1.23"
1111
REGISTRY: ghcr.io
1212
IMAGE_NAME: ${{ github.repository }}
1313
GITHUB_PAGES_BRANCH: gh-pages

.golangci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
run:
22
timeout: 5m
3-
go: '1.20'
3+
go: '1.23'
44
linters:
55
enable:
66
- gofmt # Gofmt checks whether code was gofmt-ed. By default, this tool runs with -s option to check for code simplification

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Build the manager binary
2-
FROM --platform=$BUILDPLATFORM golang:1.20.3-alpine3.16 AS builder
2+
FROM --platform=$BUILDPLATFORM golang:1.23.3-alpine3.20 AS builder
33

44
WORKDIR /workspace
55
# Copy the Go Modules manifests

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ e2e-test-validate-local:
9898
.PHONY: lint
9999
lint:
100100
go install -v github.com/golangci/golangci-lint/cmd/golangci-lint@latest
101-
${GOPATH}/bin/golangci-lint run --deadline=3m --timeout=3m --config=./.golangci.yml -v ./... # Run linters
101+
${GOPATH}/bin/golangci-lint run --timeout=3m --config=./.golangci.yml -v ./... # Run linters
102102

103103
.PHONY: generate-crdocs
104104
generate-crdocs: kustomize crdocs
@@ -211,7 +211,7 @@ CRDOC ?= $(LOCALBIN)/crdoc
211211
# renovate: datasource=github-tags depName=kubernetes-sigs/kustomize
212212
KUSTOMIZE_VERSION ?= v5.4.1
213213
# renovate: datasource=github-releases depName=kubernetes-sigs/controller-tools
214-
CONTROLLER_TOOLS_VERSION ?= v0.15.0
214+
CONTROLLER_TOOLS_VERSION ?= v0.16.5
215215
CRDOC_VERSION ?= v0.6.2
216216

217217
.PHONY: kustomize

apis/core/v1beta1/flagd_types.go

+24
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import (
2020
v1 "k8s.io/api/core/v1"
2121
networkingv1 "k8s.io/api/networking/v1"
2222
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
23+
gatewayApiv1 "sigs.k8s.io/gateway-api/apis/v1"
2324
)
2425

2526
// FlagdSpec defines the desired state of Flagd
@@ -49,6 +50,10 @@ type FlagdSpec struct {
4950
// Ingress
5051
// +optional
5152
Ingress IngressSpec `json:"ingress"`
53+
54+
// GatewayApiRoutes
55+
// +optional
56+
GatewayApiRoutes GatewayApiSpec `json:"gatewayApiRoutes"`
5257
}
5358

5459
// IngressSpec defines the options to be used when deploying the ingress for flagd
@@ -91,6 +96,25 @@ type IngressSpec struct {
9196
SyncPath string `json:"syncPath,omitempty"`
9297
}
9398

99+
// GatewayApiSpec defines the options to be used when deploying Gateway API routes for flagd
100+
type GatewayApiSpec struct {
101+
// Enabled enables/disables the Gateway API routes for flagd
102+
Enabled bool `json:"enabled,omitempty"`
103+
104+
// Annotations to be added to the Gateway API routes
105+
// +optional
106+
Annotations map[string]string `json:"annotations,omitempty"`
107+
108+
// Hosts list of hosts to be added to the ingress.
109+
// Empty string corresponds to rule with no host.
110+
// +optional
111+
Hosts []string `json:"hosts,omitempty"`
112+
113+
// ParentRefs references the resources (usually Gateways) that the Routes should
114+
// be attached to.
115+
ParentRefs []gatewayApiv1.ParentReference `json:"parentRefs"`
116+
}
117+
94118
// FlagdStatus defines the observed state of Flagd
95119
type FlagdStatus struct {
96120
}

apis/core/v1beta1/zz_generated.deepcopy.go

+36
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apis/go.mod

+41-41
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,71 @@
11
module github.com/open-feature/open-feature-operator/apis
22

3-
go 1.21
3+
go 1.23.0
4+
5+
toolchain go1.23.3
46

57
require (
68
github.com/open-feature/flagd-schemas v0.2.9-0.20240708163558-2aa89b314322
79
github.com/stretchr/testify v1.9.0
810
github.com/xeipuuv/gojsonschema v1.2.0
9-
k8s.io/api v0.28.10
10-
k8s.io/apimachinery v0.28.10
11-
sigs.k8s.io/controller-runtime v0.16.6
11+
k8s.io/api v0.31.4
12+
k8s.io/apimachinery v0.31.4
13+
sigs.k8s.io/controller-runtime v0.19.3
14+
sigs.k8s.io/gateway-api v1.2.1
1215
)
1316

1417
require (
1518
github.com/beorn7/perks v1.0.1 // indirect
16-
github.com/cespare/xxhash/v2 v2.2.0 // indirect
17-
github.com/davecgh/go-spew v1.1.1 // indirect
18-
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
19-
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
20-
github.com/fsnotify/fsnotify v1.6.0 // indirect
21-
github.com/go-logr/logr v1.2.4 // indirect
22-
github.com/go-openapi/jsonpointer v0.19.6 // indirect
23-
github.com/go-openapi/jsonreference v0.20.2 // indirect
24-
github.com/go-openapi/swag v0.22.3 // indirect
19+
github.com/cespare/xxhash/v2 v2.3.0 // indirect
20+
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
21+
github.com/emicklei/go-restful/v3 v3.12.0 // indirect
22+
github.com/evanphx/json-patch/v5 v5.9.0 // indirect
23+
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
24+
github.com/go-logr/logr v1.4.2 // indirect
25+
github.com/go-openapi/jsonpointer v0.21.0 // indirect
26+
github.com/go-openapi/jsonreference v0.21.0 // indirect
27+
github.com/go-openapi/swag v0.23.0 // indirect
2528
github.com/gogo/protobuf v1.3.2 // indirect
2629
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
2730
github.com/golang/protobuf v1.5.4 // indirect
2831
github.com/google/gnostic-models v0.6.8 // indirect
29-
github.com/google/go-cmp v0.5.9 // indirect
32+
github.com/google/go-cmp v0.6.0 // indirect
3033
github.com/google/gofuzz v1.2.0 // indirect
31-
github.com/google/uuid v1.3.0 // indirect
32-
github.com/imdario/mergo v0.3.6 // indirect
34+
github.com/google/uuid v1.6.0 // indirect
35+
github.com/imdario/mergo v0.3.16 // indirect
3336
github.com/josharian/intern v1.0.0 // indirect
3437
github.com/json-iterator/go v1.1.12 // indirect
3538
github.com/mailru/easyjson v0.7.7 // indirect
36-
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
3739
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
3840
github.com/modern-go/reflect2 v1.0.2 // indirect
3941
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
4042
github.com/pkg/errors v0.9.1 // indirect
41-
github.com/pmezard/go-difflib v1.0.0 // indirect
42-
github.com/prometheus/client_golang v1.16.0 // indirect
43-
github.com/prometheus/client_model v0.4.0 // indirect
44-
github.com/prometheus/common v0.44.0 // indirect
45-
github.com/prometheus/procfs v0.10.1 // indirect
43+
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
44+
github.com/prometheus/client_golang v1.19.1 // indirect
45+
github.com/prometheus/client_model v0.6.1 // indirect
46+
github.com/prometheus/common v0.55.0 // indirect
47+
github.com/prometheus/procfs v0.15.1 // indirect
4648
github.com/spf13/pflag v1.0.5 // indirect
49+
github.com/x448/float16 v0.8.4 // indirect
4750
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f // indirect
4851
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
49-
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect
50-
golang.org/x/net v0.23.0 // indirect
51-
golang.org/x/oauth2 v0.8.0 // indirect
52-
golang.org/x/sys v0.18.0 // indirect
53-
golang.org/x/term v0.18.0 // indirect
54-
golang.org/x/text v0.14.0 // indirect
55-
golang.org/x/time v0.3.0 // indirect
52+
golang.org/x/exp v0.0.0-20240416160154-fe59bbe5cc7f // indirect
53+
golang.org/x/net v0.30.0 // indirect
54+
golang.org/x/oauth2 v0.21.0 // indirect
55+
golang.org/x/sys v0.26.0 // indirect
56+
golang.org/x/term v0.25.0 // indirect
57+
golang.org/x/text v0.19.0 // indirect
58+
golang.org/x/time v0.7.0 // indirect
5659
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
57-
google.golang.org/appengine v1.6.7 // indirect
58-
google.golang.org/protobuf v1.33.0 // indirect
60+
google.golang.org/protobuf v1.35.1 // indirect
5961
gopkg.in/inf.v0 v0.9.1 // indirect
60-
gopkg.in/yaml.v2 v2.4.0 // indirect
6162
gopkg.in/yaml.v3 v3.0.1 // indirect
62-
k8s.io/apiextensions-apiserver v0.28.9 // indirect
63-
k8s.io/client-go v0.28.9 // indirect
64-
k8s.io/component-base v0.28.9 // indirect
65-
k8s.io/klog/v2 v2.100.1 // indirect
66-
k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 // indirect
67-
k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 // indirect
68-
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
69-
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
70-
sigs.k8s.io/yaml v1.3.0 // indirect
63+
k8s.io/apiextensions-apiserver v0.31.1 // indirect
64+
k8s.io/client-go v0.31.1 // indirect
65+
k8s.io/klog/v2 v2.130.1 // indirect
66+
k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f // indirect
67+
k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 // indirect
68+
sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 // indirect
69+
sigs.k8s.io/structured-merge-diff/v4 v4.5.0 // indirect
70+
sigs.k8s.io/yaml v1.4.0 // indirect
7171
)

0 commit comments

Comments
 (0)