Skip to content

Commit e1c39af

Browse files
committed
chore(deps): Upgrade operator-sdk to v1.39.1 (#139)
1 parent 8561d0b commit e1c39af

File tree

276 files changed

+2173
-1731
lines changed

Some content is hidden

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

276 files changed

+2173
-1731
lines changed

.github/workflows/codecov.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
branches: [ master ]
66

77
env:
8-
GOLANG_VERSION: '1.22'
8+
GOLANG_VERSION: '1.24'
99

1010
jobs:
1111

@@ -15,7 +15,7 @@ jobs:
1515
- uses: actions/checkout@v4
1616

1717
- name: Set up Go
18-
uses: actions/setup-go@v4
18+
uses: actions/setup-go@v5
1919
with:
2020
go-version: ${{ env.GOLANG_VERSION }}
2121

.github/workflows/e2e.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ concurrency:
99
cancel-in-progress: true
1010

1111
env:
12-
GOLANG_VERSION: '1.22'
12+
GOLANG_VERSION: '1.24'
1313

1414
jobs:
1515
e2e-tests:
@@ -22,8 +22,8 @@ jobs:
2222
# All Kubernetes version in between expose the same APIs, hence the operator
2323
# should be compatible with them.
2424
kube-version:
25-
- "1.27"
26-
- "1.28"
25+
- "1.30"
26+
- "1.31"
2727

2828
steps:
2929
- name: Check out code into the Go module directory

.github/workflows/pr.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ concurrency:
1010
cancel-in-progress: true
1111

1212
env:
13-
GOLANG_VERSION: '1.22'
13+
GOLANG_VERSION: '1.24'
1414

1515
jobs:
1616

@@ -132,8 +132,8 @@ jobs:
132132
# All Kubernetes version in between expose the same APIs, hence the operator
133133
# should be compatible with them.
134134
kube-version:
135-
- "1.27"
136-
- "1.28"
135+
- "1.30"
136+
- "1.31"
137137

138138
steps:
139139
- name: Check out code into the Go module directory
@@ -175,8 +175,8 @@ jobs:
175175
strategy:
176176
matrix:
177177
kube-version:
178-
- "1.27"
179-
- "1.28"
178+
- "1.30"
179+
- "1.31"
180180
steps:
181181
- name: Checkout code
182182
uses: actions/checkout@v4
@@ -191,7 +191,7 @@ jobs:
191191
YAML_CONFIG: ${{ format('hack/kind-{0}.yaml', matrix.kube-version) }}
192192
run: |
193193
# Install kind
194-
curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.22.0/kind-$(uname)-amd64
194+
curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.27.0/kind-$(uname)-amd64
195195
chmod +x ./kind
196196
sudo mv ./kind /usr/local/bin/kind
197197
# Create cluster from specific config

.github/workflows/release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
- 'v*'
66

77
env:
8-
GOLANG_VERSION: '1.22'
8+
GOLANG_VERSION: '1.24'
99

1010
jobs:
1111
prepare-release:

.golangci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
run:
22
timeout: 5m
3-
go: "1.22"
3+
go: "1.24"
44
issues-exit-code: 1
55
build-tags:
66
- mytag

.mockery.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ dir: "{{.InterfaceDir}}/mocks"
44
mockname: "Mock{{.InterfaceName}}"
55
outpkg: "mocks"
66
filename: "{{.InterfaceName | lower}}_mock.go"
7+
issue-845-fix: True
78
packages:
89
github.com/epam/edp-keycloak-operator/pkg/client/keycloak:
910
interfaces:

Makefile

Lines changed: 84 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,13 @@ KUBECTL_VERSION=$(shell go list -m all | grep k8s.io/client-go| cut -d' ' -f2)
1515
LOCALBIN ?= ${CURRENT_DIR}/bin
1616
$(LOCALBIN):
1717
mkdir -p $(LOCALBIN)
18-
ENVTEST ?= $(LOCALBIN)/setup-envtest
19-
ENVTEST_K8S_VERSION = 1.23.5
2018

2119
# Use kind cluster for testing
2220
CONTAINER_REGISTRY_URL?="repo"
2321
CONTAINER_REGISTRY_SPACE?="edp"
2422
START_KIND_CLUSTER?=true
2523
KIND_CLUSTER_NAME?="keycloak-operator"
26-
KUBE_VERSION?=1.26
24+
KUBE_VERSION?=1.31
2725
KIND_CONFIG?=./hack/kind-$(KUBE_VERSION).yaml
2826

2927
E2E_IMAGE_REPOSITORY?="keycloak-image"
@@ -44,7 +42,18 @@ endif
4442
override GCFLAGS +=all=-trimpath=${CURRENT_DIR}
4543

4644
# Image URL to use all building/pushing image targets
47-
IMG?=docker.io/epamedp/keycloak-operator:$(VERSION)
45+
IMG ?= docker.io/epamedp/keycloak-operator:$(VERSION)
46+
47+
# IMAGE_TAG_BASE defines the docker.io namespace and part of the image name for remote images.
48+
# This variable is used to construct full image tags for bundle and catalog images.
49+
#
50+
# For example, running 'make bundle-build bundle-push catalog-build catalog-push' will build and push both
51+
# epamedp/keycloak-operator-bundle:$VERSION and epamedp/keycloak-operator-operator-catalog:$VERSION.
52+
IMAGE_TAG_BASE ?= epamedp/keycloak-operator
53+
54+
# BUNDLE_IMG defines the image:tag used for the bundle.
55+
# You can use it as an arg. (E.g make bundle-build BUNDLE_IMG=<some-registry>/<project-name-bundle>:<tag>)
56+
BUNDLE_IMG ?= $(IMAGE_TAG_BASE)-bundle:v$(VERSION)
4857

4958
# BUNDLE_GEN_FLAGS are the flags passed to the operator-sdk generate bundle command
5059
BUNDLE_GEN_FLAGS ?= -q --overwrite --version $(VERSION) $(BUNDLE_METADATA_OPTS)
@@ -108,12 +117,13 @@ fmt: ## Run go fmt
108117
vet: ## Run go vet
109118
go vet ./...
110119

120+
.PHONY: lint
111121
lint: golangci-lint ## Run go lint
112-
${GOLANGCILINT} run
122+
${GOLANGCI_LINT} run -v -c .golangci.yaml ./...
113123

114124
.PHONY: build
115125
build: clean ## build operator's binary
116-
CGO_ENABLED=0 GOOS=${HOST_OS} GOARCH=${HOST_ARCH} go build -v -ldflags '${LDFLAGS}' -o ${DIST_DIR}/${BIN_NAME} -gcflags '${GCFLAGS}' .
126+
CGO_ENABLED=0 GOOS=${HOST_OS} GOARCH=${HOST_ARCH} go build -v -ldflags '${LDFLAGS}' -o ${DIST_DIR}/${BIN_NAME} -gcflags '${GCFLAGS}' ./cmd
117127

118128
.PHONY: clean
119129
clean: ## clean up
@@ -136,75 +146,83 @@ api-docs: crdoc ## generate CRD docs
136146
helm-docs: helmdocs ## generate helm docs
137147
$(HELMDOCS)
138148

139-
GOLANGCILINT = ${CURRENT_DIR}/bin/golangci-lint
149+
GOLANGCI_LINT = ${CURRENT_DIR}/bin/golangci-lint
140150
.PHONY: golangci-lint
141151
golangci-lint: ## Download golangci-lint locally if necessary.
142-
$(call go-get-tool,$(GOLANGCILINT),github.com/golangci/golangci-lint/cmd/golangci-lint,v1.62.0)
152+
$(call go-install-tool,$(GOLANGCI_LINT),github.com/golangci/golangci-lint/cmd/golangci-lint,$(GOLANGCI_LINT_VERSION))
143153

144154
.PHONY: install
145155
install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config.
146156
$(KUSTOMIZE) build config/crd | kubectl apply -f -
147157

148158
##@ Build Dependencies
149159

150-
## Tool Binaries
151-
KUSTOMIZE ?= $(LOCALBIN)/kustomize
152-
153160
## Tool Versions
154-
KUSTOMIZE_VERSION ?= v4.5.5
161+
KUSTOMIZE_VERSION ?= v5.4.3
162+
CONTROLLER_TOOLS_VERSION ?= v0.16.5
163+
ENVTEST_VERSION ?= release-0.19
164+
GOLANGCI_LINT_VERSION ?= v1.64.7
165+
MOCKERY_VERSION ?= v2.53.2
166+
HELMDOCS_VERSION ?= v1.14.2
167+
GITCHGLOG_VERSION ?= v0.15.4
168+
CRDOC_VERSION ?= v0.6.4
169+
ENVTEST_K8S_VERSION = 1.31.0
170+
OPERATOR_SDK_VERSION ?= v1.39.2
155171

156-
KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"
172+
KUSTOMIZE ?= $(LOCALBIN)/kustomize
157173
.PHONY: kustomize
158174
kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary.
159175
$(KUSTOMIZE): $(LOCALBIN)
160-
curl -s $(KUSTOMIZE_INSTALL_SCRIPT) | bash -s -- $(subst v,,$(KUSTOMIZE_VERSION)) $(LOCALBIN)
176+
$(call go-install-tool,$(KUSTOMIZE),sigs.k8s.io/kustomize/kustomize/v5,$(KUSTOMIZE_VERSION))
161177

162178
HELMDOCS = $(LOCALBIN)/helm-docs
163179
.PHONY: helmdocs
164180
helmdocs: ## Download helm-docs locally if necessary.
165-
$(call go-get-tool,$(HELMDOCS),github.com/norwoodj/helm-docs/cmd/helm-docs,v1.11.0)
181+
$(call go-install-tool,$(HELMDOCS),github.com/norwoodj/helm-docs/cmd/helm-docs,$(HELMDOCS_VERSION))
166182

167183
GITCHGLOG = $(LOCALBIN)/git-chglog
168184
.PHONY: git-chglog
169185
git-chglog: ## Download git-chglog locally if necessary.
170-
$(call go-get-tool,$(GITCHGLOG),github.com/git-chglog/git-chglog/cmd/git-chglog,v0.15.4)
186+
$(call go-install-tool,$(GITCHGLOG),github.com/git-chglog/git-chglog/cmd/git-chglog,$(GITCHGLOG_VERSION))
171187

172188
CRDOC = $(LOCALBIN)/crdoc
173189
.PHONY: crdoc
174190
crdoc: ## Download crdoc locally if necessary.
175-
$(call go-get-tool,$(CRDOC),fybrik.io/crdoc,v0.6.4)
191+
$(call go-install-tool,$(CRDOC),fybrik.io/crdoc,$(CRDOC_VERSION))
176192

177193
CONTROLLER_GEN = $(LOCALBIN)/controller-gen
178194
.PHONY: controller-gen
179195
controller-gen: ## Download controller-gen locally if necessary.
180-
$(call go-get-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/controller-gen,v0.15.0)
181-
# go-get-tool will 'go get' any package $2 and install it to $1.
182-
PROJECT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))
183-
define go-get-tool
184-
@[ -f $(1) ] || { \
185-
set -e ;\
186-
TMP_DIR=$$(mktemp -d) ;\
187-
cd $$TMP_DIR ;\
188-
go mod init tmp ;\
189-
echo "Downloading $(2)" ;\
190-
go get -d $(2)@$(3) ;\
191-
GOBIN=$(PROJECT_DIR)/bin go install $(2) ;\
192-
rm -rf $$TMP_DIR ;\
193-
}
196+
$(call go-install-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/controller-gen,$(CONTROLLER_TOOLS_VERSION))
197+
198+
# go-install-tool will 'go install' any package with custom target and name of binary, if it doesn't exist
199+
# $1 - target path with name of binary
200+
# $2 - package url which can be installed
201+
# $3 - specific version of package
202+
define go-install-tool
203+
@[ -f "$(1)-$(3)" ] || { \
204+
set -e; \
205+
package=$(2)@$(3) ;\
206+
echo "Downloading $${package}" ;\
207+
rm -f $(1) || true ;\
208+
GOBIN=$(LOCALBIN) go install $${package} ;\
209+
mv $(1) $(1)-$(3) ;\
210+
} ;\
211+
ln -sf $(1)-$(3) $(1)
194212
endef
195213

196214
.PHONY: bundle
197-
bundle: manifests kustomize ## Generate bundle manifests and metadata, then validate generated files.
198-
operator-sdk generate kustomize manifests -q
215+
bundle: manifests kustomize operator-sdk ## Generate bundle manifests and metadata, then validate generated files.
216+
$(OPERATOR_SDK) generate kustomize manifests -q
199217
cd config/manager && $(KUSTOMIZE) edit set image controller=$(IMG)
200-
$(KUSTOMIZE) build config/manifests | operator-sdk generate bundle $(BUNDLE_GEN_FLAGS)
201-
operator-sdk bundle validate ./bundle
218+
$(KUSTOMIZE) build config/manifests | $(OPERATOR_SDK) generate bundle $(BUNDLE_GEN_FLAGS)
219+
$(OPERATOR_SDK) bundle validate ./bundle
202220

203221
ENVTEST=$(LOCALBIN)/setup-envtest
204222
.PHONY: envtest
205223
envtest: $(ENVTEST) ## Download envtest-setup locally if necessary.
206224
$(ENVTEST): $(LOCALBIN)
207-
$(call go-get-tool,$(ENVTEST),sigs.k8s.io/controller-runtime/tools/setup-envtest,release-0.16)
225+
$(call go-install-tool,$(ENVTEST),sigs.k8s.io/controller-runtime/tools/setup-envtest,$(ENVTEST_VERSION))
208226

209227
.PHONY: start-kind
210228
start-kind: ## Start kind cluster
@@ -218,4 +236,33 @@ mocks: mockery
218236
MOCKERY = $(LOCALBIN)/mockery
219237
.PHONY: mockery
220238
mockery: ## Download mockery locally if necessary.
221-
$(call go-get-tool,$(MOCKERY),github.com/vektra/mockery/v2,v2.46.3)
239+
$(call go-install-tool,$(MOCKERY),github.com/vektra/mockery/v2,$(MOCKERY_VERSION))
240+
241+
.PHONY: operator-sdk
242+
OPERATOR_SDK ?= $(LOCALBIN)/operator-sdk
243+
operator-sdk: ## Download operator-sdk locally if necessary.
244+
ifeq (,$(wildcard $(OPERATOR_SDK)))
245+
ifeq (, $(shell which operator-sdk 2>/dev/null))
246+
@{ \
247+
set -e ;\
248+
mkdir -p $(dir $(OPERATOR_SDK)) ;\
249+
OS=$(shell go env GOOS) && ARCH=$(shell go env GOARCH) && \
250+
curl -sSLo $(OPERATOR_SDK) https://github.com/operator-framework/operator-sdk/releases/download/$(OPERATOR_SDK_VERSION)/operator-sdk_$${OS}_$${ARCH} ;\
251+
chmod +x $(OPERATOR_SDK) ;\
252+
}
253+
else
254+
OPERATOR_SDK = $(shell which operator-sdk)
255+
endif
256+
endif
257+
258+
.PHONY: bundle-build
259+
bundle-build: ## Build the bundle image.
260+
docker build -f bundle.Dockerfile -t $(BUNDLE_IMG) .
261+
262+
.PHONY: bundle-push
263+
bundle-push: ## Push the bundle image.
264+
$(MAKE) docker-push IMG=$(BUNDLE_IMG)
265+
266+
.PHONY: docker-push
267+
docker-push: ## Push docker image with the manager.
268+
docker push ${IMG}

bundle.Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/
66
LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/
77
LABEL operators.operatorframework.io.bundle.package.v1=edp-keycloak-operator
88
LABEL operators.operatorframework.io.bundle.channels.v1=stable
9-
LABEL operators.operatorframework.io.bundle.channel.default.v1=stable
10-
LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.39.1
9+
LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.39.2
1110
LABEL operators.operatorframework.io.metrics.mediatype.v1=metrics+v1
1211
LABEL operators.operatorframework.io.metrics.project_layout=go.kubebuilder.io/v4
1312

bundle/manifests/client-secret-authorization-sample_v1_secret.yaml

Lines changed: 0 additions & 6 deletions
This file was deleted.

bundle/manifests/client-secret-policy-sample_v1_secret.yaml

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)