Skip to content

Commit 5358d1e

Browse files
chore: replace deprecated gcr.io/kubebuilder/kube-rbac-proxy (#733)
Signed-off-by: Lukas Reining <[email protected]>
1 parent ee48ee4 commit 5358d1e

File tree

103 files changed

+1060
-504
lines changed

Some content is hidden

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

103 files changed

+1060
-504
lines changed

.github/scripts/strip-kustomize-helm.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
echo 'Running strip-kustomize-helm.sh script'
1010
CHARTS_DIR='./chart/open-feature-operator/templates'
11+
1112
# Careful! Ordering of these expressions matter!
1213
sed_expressions=(
1314
"s/___newline___/\\n/g"
@@ -17,9 +18,16 @@ sed_expressions=(
1718
"/___delete_me___/d"
1819
"s/___//g"
1920
)
21+
2022
find $CHARTS_DIR -name "*.yaml" | while read file; do
2123
for expr in "${sed_expressions[@]}"; do
22-
sed -i "$expr" "$file"
24+
if [[ "$OSTYPE" == "darwin"* ]]; then
25+
# macOS (BSD) version
26+
sed -i '' "$expr" "$file"
27+
else
28+
# Linux (GNU) version
29+
sed -i "$expr" "$file"
30+
fi
2331
done
2432
done
2533

.github/workflows/e2e.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ jobs:
6464

6565
- name: Upload cluster logs
6666
if: failure()
67-
uses: actions/upload-artifact@v3
67+
uses: actions/upload-artifact@v4
6868
with:
6969
name: e2e-tests
7070
path: .github/scripts/logs

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,5 @@ testbin/*
3434

3535
go.work
3636
go.work.sum
37+
38+
dist

Dockerfile

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,23 @@ COPY go.mod go.mod
77
COPY go.sum go.sum
88

99
# Copy the go source
10-
COPY main.go main.go
11-
COPY apis/ apis/
12-
COPY webhooks/ webhooks/
13-
COPY controllers/ controllers/
14-
COPY common/ common/
10+
COPY cmd/ cmd/
11+
COPY api/ api/
12+
COPY internal/ internal/
1513

1614
# cache deps before building and copying source so that we don't need to re-download as much
1715
# and so that source changes don't invalidate our downloaded layer
18-
RUN go work init . ./apis && go mod download
16+
RUN go work init . ./api && go mod download
1917

2018
ARG TARGETOS
2119
ARG TARGETARCH
2220

2321
# Build
24-
RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -a -o manager main.go
22+
# the GOARCH has not a default value to allow the binary be built according to the host where the command
23+
# was called. For example, if we call make docker-build in a local env which has the Apple Silicon M1 SO
24+
# the docker BUILDPLATFORM arg will be linux/arm64 when for Apple x86 it will be linux/amd64. Therefore,
25+
# by leaving it empty we can ensure that the container and binary shipped on it will have the same platform.
26+
RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o manager cmd/main.go
2527

2628
# Use distroless as minimal base image to package the manager binary
2729
# Refer to https://github.com/GoogleContainerTools/distroless for more details

Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ vet: ## Run go vet against code.
6565
go vet ./...
6666

6767
.PHONY: unit-test
68-
unit-test: manifests fmt vet generate envtest ## Run tests.
69-
cd apis && go test ./... -v -coverprofile ../cover-apis.out cover-main.out cover-pkg.out
68+
unit-test: manifests generate envtest fmt vet ## Run tests.
69+
cd api && go test ./... -v -coverprofile ../cover-apis.out cover-main.out cover-pkg.out
7070
go test ./... -v -coverprofile cover-operator.out
7171
sed -i '/mode: set/d' "cover-operator.out"
7272
sed -i '/mode: set/d' "cover-apis.out"
@@ -112,12 +112,12 @@ generate-crdocs: kustomize crdocs
112112
##@ Build
113113

114114
.PHONY: build
115-
build: generate fmt vet ## Build manager binary.
116-
go build -o bin/manager main.go
115+
build: manifests generate fmt vet ## Build manager binary.
116+
go build -o bin/manager cmd/main.go
117117

118118
.PHONY: run
119119
run: manifests generate fmt vet ## Run a controller from your host.
120-
go run ./main.go
120+
go run ./cmd/main.go
121121

122122
.PHONY: docker-build
123123
docker-build: clean ## Build docker image with the manager.

PROJECT

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@
44
# More info: https://book.kubebuilder.io/reference/project-config.html
55
domain: openfeature.dev
66
layout:
7-
- go.kubebuilder.io/v3
7+
- go.kubebuilder.io/v4
88
multigroup: true
9+
plugins:
10+
helm.kubebuilder.io/v1-alpha: {}
911
projectName: open-feature-operator
1012
repo: github.com/open-feature/open-feature-operator
1113
resources:
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)