Skip to content

Commit b9cfd53

Browse files
CSPL-3964: Upgrading operator sdk.
1 parent 3042251 commit b9cfd53

32 files changed

+851
-716
lines changed

.env

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
OPERATOR_SDK_VERSION=v1.39.0
2-
REVIEWERS=vivekr-splunk,rlieberman-splunk,patrykw-splunk,Igor-splunk,kasiakoziol,kubabuczak
1+
OPERATOR_SDK_VERSION=v1.42.0
2+
REVIEWERS=vivekr-splunk,rlieberman-splunk,patrykw-splunk,Igor-splunk,kasiakoziol,kubabuczak,gabrielm-splunk
33
GO_VERSION=1.25.5
44
AWSCLI_URL=https://awscli.amazonaws.com/awscli-exe-linux-x86_64-2.8.6.zip
55
KUBECTL_VERSION=v1.29.1

.github/workflows/build-test-push-workflow.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ jobs:
6464
SPLUNK_OPERATOR_IMAGE_NAME: splunk/splunk-operator
6565
ECR_REPOSITORY: ${{ secrets.ECR_REPOSITORY }}
6666
S3_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
67+
SPLUNK_GENERAL_TERMS: --accept-sgt-current-at-splunk-com
6768
steps:
6869
- name: Set up cosign
6970
uses: sigstore/cosign-installer@main
@@ -122,6 +123,7 @@ jobs:
122123
ECR_REPOSITORY: ${{ secrets.ECR_REPOSITORY }}
123124
S3_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
124125
IMAGE_NAME: ${{ secrets.ECR_REPOSITORY }}/splunk/splunk-operator:${{ github.sha }}
126+
SPLUNK_GENERAL_TERMS: --accept-sgt-current-at-splunk-com
125127
steps:
126128
- name: Set up cosign
127129
uses: sigstore/cosign-installer@main
@@ -197,6 +199,7 @@ jobs:
197199
EKS_SSH_PUBLIC_KEY: ${{ secrets.EKS_SSH_PUBLIC_KEY }}
198200
CLUSTER_WIDE: "true"
199201
DEPLOYMENT_TYPE: ""
202+
SPLUNK_GENERAL_TERMS: --accept-sgt-current-at-splunk-com
200203
steps:
201204
- name: Chekcout code
202205
uses: actions/checkout@v2

.github/workflows/int-test-workflow.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ on:
1010
- develop
1111
- main
1212
- feature**
13+
- CSPL-3964_Upgrade-operator-sdk
1314
jobs:
1415
build-operator-image:
1516
runs-on: ubuntu-latest

Makefile

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ BUNDLE_IMG ?= ${IMAGE_TAG_BASE}-bundle:v${VERSION}
5959
# Image URL to use all building/pushing image targets
6060
IMG ?= controller:latest
6161
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
62-
ENVTEST_K8S_VERSION = 1.34.0
62+
# Automatically derive the version from go.mod
63+
ENVTEST_VERSION := $(shell go list -m -f "{{ .Version }}" sigs.k8s.io/controller-runtime | awk -F'[v.]' '{printf "release-%d.%d", $$2, $$3}')
64+
ENVTEST_K8S_VERSION := $(shell go list -m -f "{{ .Version }}" k8s.io/api | awk -F'[v.]' '{printf "1.%d", $$3}')
6365

6466
ignore-not-found ?= True
6567

@@ -135,7 +137,7 @@ scheck: ## Run static check against code
135137
vet: setup/ginkgo ## Run go vet against code.
136138
go vet ./...
137139

138-
test: manifests generate fmt vet envtest ## Run tests.
140+
test: manifests generate fmt vet setup-envtest ## Run tests.
139141
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use ${ENVTEST_K8S_VERSION} --bin-dir $(LOCALBIN) -p path)" ginkgo --junit-report=unit_test.xml --output-dir=`pwd` -vv --trace --keep-going --timeout=3h --cover --covermode=count --coverprofile=coverage.out ./pkg/splunk/common ./pkg/splunk/enterprise ./pkg/splunk/client ./pkg/splunk/util ./internal/controller ./pkg/splunk/splkcontroller
140142

141143

@@ -241,6 +243,11 @@ envtest: $(ENVTEST) ## Download envtest-setup locally if necessary.
241243
$(ENVTEST): $(LOCALBIN)
242244
test -s $(LOCALBIN)/setup-envtest || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest
243245

246+
.PHONY: setup-envtest
247+
setup-envtest: envtest ## Set up ENVTEST binaries for the correct version
248+
@$(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path || { \
249+
echo "Error setting up envtest"; exit 1; }
250+
244251
## Generate bundle manifests and metadata, then validate generated files.
245252
## In addition, copy the newly generated crd files to helm crds.
246253
.PHONY: bundle
@@ -272,7 +279,7 @@ ifeq (,$(shell which opm 2>/dev/null))
272279
set -e ;\
273280
mkdir -p $(dir $(OPM)) ;\
274281
OS=$(shell go env GOOS) && ARCH=$(shell go env GOARCH) && \
275-
curl -sSLo $(OPM) https://github.com/operator-framework/operator-registry/releases/download/v1.24.2/$${OS}-$${ARCH}-opm ;\
282+
curl -sSLo $(OPM) https://github.com/operator-framework/operator-registry/releases/download/v1.55.0/$${OS}-$${ARCH}-opm ;\
276283
chmod +x $(OPM) ;\
277284
}
278285
else

bundle/manifests/enterprise.splunk.com_clustermanagers.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ metadata:
66
creationTimestamp: null
77
labels:
88
name: splunk-operator
9+
app.kubernetes.io/name: splunk-operator
910
name: clustermanagers.enterprise.splunk.com
1011
spec:
1112
group: enterprise.splunk.com

bundle/manifests/enterprise.splunk.com_clustermasters.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ metadata:
66
creationTimestamp: null
77
labels:
88
name: splunk-operator
9+
app.kubernetes.io/name: splunk-operator
910
name: clustermasters.enterprise.splunk.com
1011
spec:
1112
group: enterprise.splunk.com

bundle/manifests/enterprise.splunk.com_indexerclusters.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ metadata:
66
creationTimestamp: null
77
labels:
88
name: splunk-operator
9+
app.kubernetes.io/name: splunk-operator
910
name: indexerclusters.enterprise.splunk.com
1011
spec:
1112
group: enterprise.splunk.com

bundle/manifests/enterprise.splunk.com_licensemanagers.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ metadata:
66
creationTimestamp: null
77
labels:
88
name: splunk-operator
9+
app.kubernetes.io/name: splunk-operator
910
name: licensemanagers.enterprise.splunk.com
1011
spec:
1112
group: enterprise.splunk.com

bundle/manifests/enterprise.splunk.com_licensemasters.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ metadata:
66
creationTimestamp: null
77
labels:
88
name: splunk-operator
9+
app.kubernetes.io/name: splunk-operator
910
name: licensemasters.enterprise.splunk.com
1011
spec:
1112
group: enterprise.splunk.com

bundle/manifests/enterprise.splunk.com_monitoringconsoles.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ metadata:
66
creationTimestamp: null
77
labels:
88
name: splunk-operator
9+
app.kubernetes.io/name: splunk-operator
910
name: monitoringconsoles.enterprise.splunk.com
1011
spec:
1112
group: enterprise.splunk.com

0 commit comments

Comments
 (0)