Skip to content

Commit 1eb95b8

Browse files
authored
Merge pull request #155 from raffaelespazzoli/version-bumps
various version bump
2 parents 02a5fad + e82e819 commit 1eb95b8

20 files changed

+789
-1071
lines changed

.github/workflows/pr.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@ on:
88
jobs:
99
shared-operator-workflow:
1010
name: shared-operator-workflow
11-
uses: redhat-cop/github-workflows-operators/.github/workflows/pr-operator.yml@v1.0.4
11+
uses: redhat-cop/github-workflows-operators/.github/workflows/pr-operator.yml@v1.0.5
1212
with:
1313
RUN_UNIT_TESTS: true
1414
RUN_INTEGRATION_TESTS: true
1515
RUN_HELMCHART_TEST: true
16+
GO_VERSION: ~1.20
17+
OPERATOR_SDK_VERSION: v1.25.3

.github/workflows/push.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
jobs:
1111
shared-operator-workflow:
1212
name: shared-operator-workflow
13-
uses: redhat-cop/github-workflows-operators/.github/workflows/release-operator.yml@v1.0.4
13+
uses: redhat-cop/github-workflows-operators/.github/workflows/release-operator.yml@v1.0.5
1414
secrets:
1515
COMMUNITY_OPERATOR_PAT: ${{ secrets.COMMUNITY_OPERATOR_PAT }}
1616
REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }}
@@ -20,3 +20,5 @@ jobs:
2020
RUN_UNIT_TESTS: true
2121
RUN_INTEGRATION_TESTS: true
2222
RUN_HELMCHART_TEST: true
23+
GO_VERSION: ~1.20
24+
OPERATOR_SDK_VERSION: v1.25.3

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 golang:1.16 as builder
2+
FROM golang:1.20 as builder
33

44
WORKDIR /workspace
55
# Copy the Go Modules manifests

Makefile

Lines changed: 68 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
CHART_REPO_URL ?= http://example.com
22
HELM_REPO_DEST ?= /tmp/gh-pages
33
OPERATOR_NAME ?=$(shell basename -z `pwd`)
4-
HELM_VERSION ?= v3.8.0
5-
KIND_VERSION ?= v0.11.1
6-
KUBECTL_VERSION ?= v1.21.1
7-
VAULT_VERSION ?= 1.9.3
4+
HELM_VERSION ?= v3.11.0
5+
KIND_VERSION ?= v0.20.0
6+
KUBECTL_VERSION ?= v1.27.3
7+
K8S_MAJOR_VERSION ?= 1.27
8+
KUSTOMIZE_VERSION ?= v3.8.7
9+
CONTROLLER_TOOLS_VERSION ?= v0.11.1
10+
# Set the Operator SDK version to use. By default, what is installed on the system is used.
11+
# This is useful for CI or a project to utilize a specific version of the operator-sdk toolkit.
12+
OPERATOR_SDK_VERSION ?= v1.31.0
13+
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
14+
ENVTEST_K8S_VERSION ?= 1.26.0
815

916
# VERSION defines the project version for the bundle.
1017
# Update this value when you upgrade the version of your project.
@@ -78,23 +85,28 @@ all: build
7885
# More info on the awk command:
7986
# http://linuxcommand.org/lc3_adv_awk.php
8087

88+
.PHONY: help
8189
help: ## Display this help.
8290
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
83-
8491
##@ Development
8592

93+
.PHONY: manifests
8694
manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
87-
$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases
95+
$(CONTROLLER_GEN) rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases
8896

97+
.PHONY: generate
8998
generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
9099
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..."
91100

101+
.PHONY: fmt
92102
fmt: ## Run go fmt against code.
93103
go fmt ./...
94104

105+
.PHONY: vet
95106
vet: ## Run go vet against code.
96107
go vet ./...
97108

109+
.PHONY: test
98110
test: manifests generate fmt vet envtest ## Run tests.
99111
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" go test ./... -coverprofile cover.out
100112

@@ -134,18 +146,35 @@ deploy: manifests kustomize kubectl ## Deploy controller to the K8s cluster spec
134146
undeploy: kustomize kubectl ## Undeploy controller from the K8s cluster specified in ~/.kube/config.
135147
$(KUSTOMIZE) build config/default | $(KUBECTL) delete -f -
136148

149+
LOCALBIN ?= $(shell pwd)/bin
150+
$(LOCALBIN):
151+
mkdir -p $(LOCALBIN)
152+
153+
## Tool Binaries
154+
KUSTOMIZE ?= $(LOCALBIN)/kustomize
155+
CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
156+
ENVTEST ?= $(LOCALBIN)/setup-envtest
137157

138-
CONTROLLER_GEN = $(shell pwd)/bin/controller-gen
139-
controller-gen: ## Download controller-gen locally if necessary.
140-
$(call go-get-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/controller-gen@v0.6.1)
141158

142-
KUSTOMIZE = $(shell pwd)/bin/kustomize
143-
kustomize: ## Download kustomize locally if necessary.
144-
$(call go-get-tool,$(KUSTOMIZE),sigs.k8s.io/kustomize/kustomize/v3@v3.8.7)
145159

146-
ENVTEST = $(shell pwd)/bin/setup-envtest
147-
envtest: ## Download envtest-setup locally if necessary.
148-
$(call go-get-tool,$(ENVTEST),sigs.k8s.io/controller-runtime/tools/setup-envtest@latest)
160+
KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"
161+
.PHONY: kustomize
162+
KUSTOMIZE ?= $(LOCALBIN)/kustomize
163+
kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary.
164+
$(KUSTOMIZE): $(LOCALBIN)
165+
test -s $(LOCALBIN)/kustomize || { curl -s $(KUSTOMIZE_INSTALL_SCRIPT) | bash -s -- $(subst v,,$(KUSTOMIZE_VERSION)) $(LOCALBIN); }
166+
167+
.PHONY: controller-gen
168+
CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
169+
controller-gen: $(CONTROLLER_GEN) ## Download controller-gen locally if necessary.
170+
$(CONTROLLER_GEN): $(LOCALBIN)
171+
test -s $(LOCALBIN)/controller-gen || echo "Downloading controller-gen to ${CONTROLLER_GEN}..." && GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_TOOLS_VERSION)
172+
173+
.PHONY: envtest
174+
ENVTEST ?= $(LOCALBIN)/setup-envtest
175+
envtest: $(ENVTEST) ## Download envtest-setup locally if necessary.
176+
$(ENVTEST): $(LOCALBIN)
177+
test -s $(LOCALBIN)/setup-envtest || echo "Downloading setup-envtest to ${ENVTEST}..." && GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest
149178

150179
# go-get-tool will 'go get' any package $2 and install it to $1.
151180
PROJECT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))
@@ -162,11 +191,11 @@ rm -rf $$TMP_DIR ;\
162191
endef
163192

164193
.PHONY: bundle
165-
bundle: manifests kustomize ## Generate bundle manifests and metadata, then validate generated files.
166-
operator-sdk generate kustomize manifests -q
194+
bundle: manifests kustomize operator-sdk ## Generate bundle manifests and metadata, then validate generated files.
195+
$(OPERATOR_SDK) generate kustomize manifests --interactive=false -q
167196
cd config/manager && $(KUSTOMIZE) edit set image controller=$(IMG)
168-
$(KUSTOMIZE) build config/manifests | operator-sdk generate bundle -q --overwrite --version $(VERSION) $(BUNDLE_METADATA_OPTS)
169-
operator-sdk bundle validate ./bundle
197+
$(KUSTOMIZE) build config/manifests | $(OPERATOR_SDK) generate bundle $(BUNDLE_GEN_FLAGS)
198+
$(OPERATOR_SDK) bundle validate ./bundle
170199

171200
.PHONY: bundle-build
172201
bundle-build: ## Build the bundle image.
@@ -177,15 +206,15 @@ bundle-push: ## Push the bundle image.
177206
$(MAKE) docker-push IMG=$(BUNDLE_IMG)
178207

179208
.PHONY: opm
180-
OPM = ./bin/opm
209+
OPM ?= $(LOCALBIN)/opm
181210
opm: ## Download opm locally if necessary.
182211
ifeq (,$(wildcard $(OPM)))
183212
ifeq (,$(shell which opm 2>/dev/null))
184213
@{ \
185214
set -e ;\
186215
mkdir -p $(dir $(OPM)) ;\
187216
OS=$(shell go env GOOS) && ARCH=$(shell go env GOARCH) && \
188-
curl -sSLo $(OPM) https://github.com/operator-framework/operator-registry/releases/download/v1.15.1/$${OS}-$${ARCH}-opm ;\
217+
curl -sSLo $(OPM) https://github.com/operator-framework/operator-registry/releases/download/v1.23.0/$${OS}-$${ARCH}-opm ;\
189218
chmod +x $(OPM) ;\
190219
}
191220
else
@@ -308,3 +337,21 @@ else
308337
HELM = $(shell which helm)
309338
endif
310339
endif
340+
341+
.PHONY: operator-sdk
342+
OPERATOR_SDK ?= $(LOCALBIN)/operator-sdk
343+
operator-sdk: ## Download operator-sdk locally if necessary.
344+
ifeq (,$(wildcard $(OPERATOR_SDK)))
345+
@{ \
346+
set -e ;\
347+
echo "Downloading operator-sdk to $(OPERATOR_SDK)..." ;\
348+
mkdir -p $(dir $(OPERATOR_SDK)) ;\
349+
OS=$(shell go env GOOS) && ARCH=$(shell go env GOARCH) && \
350+
curl -sSLo $(OPERATOR_SDK) https://github.com/operator-framework/operator-sdk/releases/download/$(OPERATOR_SDK_VERSION)/operator-sdk_$${OS}_$${ARCH} ;\
351+
chmod +x $(OPERATOR_SDK) ;\
352+
}
353+
endif
354+
355+
.PHONY: clean
356+
clean:
357+
rm -rf $(LOCALBIN) ./bundle ./bundle-* ./charts

api/v1alpha1/groupconfig_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ limitations under the License.
1717
package v1alpha1
1818

1919
import (
20-
"github.com/redhat-cop/operator-utils/pkg/util/apis"
20+
apis "github.com/redhat-cop/operator-utils/api/v1alpha1"
2121
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2222
)
2323

api/v1alpha1/namespaceconfig_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ limitations under the License.
1717
package v1alpha1
1818

1919
import (
20-
"github.com/redhat-cop/operator-utils/pkg/util/apis"
20+
apis "github.com/redhat-cop/operator-utils/api/v1alpha1"
2121
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2222
)
2323

api/v1alpha1/userconfig_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ limitations under the License.
1717
package v1alpha1
1818

1919
import (
20-
"github.com/redhat-cop/operator-utils/pkg/util/apis"
20+
apis "github.com/redhat-cop/operator-utils/api/v1alpha1"
2121
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2222
)
2323

api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 5 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)