Skip to content

Commit 40f3afe

Browse files
authored
Merge pull request #76 from marklogic/release/1.0.0
Release Operator 1.0.0 GA
2 parents 369f311 + 815102b commit 40f3afe

File tree

108 files changed

+49295
-35370
lines changed

Some content is hidden

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

108 files changed

+49295
-35370
lines changed

.github/workflows/release.yaml

Lines changed: 7 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
name: Release Charts
2-
3-
concurrency: release-helm
4-
52
on:
63
push:
74
branches:
85
- main
9-
106
jobs:
117
release:
128
permissions:
@@ -16,41 +12,15 @@ jobs:
1612
- name: Checkout
1713
uses: actions/checkout@v3
1814
with:
19-
path: 'src'
20-
ref: 'main'
2115
fetch-depth: 0
22-
23-
- name: Checkout
24-
uses: actions/checkout@v3
25-
with:
26-
path: 'dest'
27-
ref: 'gh-pages'
28-
fetch-depth: 0
29-
3016
- name: Configure Git
3117
run: |
32-
cd dest
3318
git config user.name "$GITHUB_ACTOR"
3419
git config user.email "[email protected]"
35-
36-
- name: Install Helm
37-
uses: azure/setup-helm@v4
38-
39-
- name: Package Helm Charts
40-
shell: bash
41-
run: |
42-
find src/charts/ -type f -name 'Chart.yaml' | sed -r 's|/[^/]+$||' | sort | uniq | xargs -L 1 helm dep up
43-
for d in src/charts/*/ ; do
44-
echo "$d"
45-
helm package "$d" -u -d dest
46-
done
47-
48-
- name: Push New Files
49-
shell: bash
50-
working-directory: dest
51-
run: |
52-
helm repo index . --url https://raw.githubusercontent.com/marklogic/marklogic-kubernetes-operator/gh-pages/
53-
git add $(git ls-files -o --exclude-standard)
54-
git add index.yaml
55-
git commit -m "Updated from ref: $GITHUB_SHA"
56-
git push
20+
- name: Run chart-releaser
21+
uses: helm/[email protected]
22+
with:
23+
charts_dir: 'charts'
24+
env:
25+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26+
CR_TOKEN: ${{ secrets.GITHUB_TOKEN }}

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Contributing to MarkLogic-kubernetes-operator
1+
# Contributing to marklogic-operator-kubernetes
22

33
Thank you for your interest in contributing to this project! We welcome contributions from the community to make this project better.
44

@@ -38,4 +38,4 @@ The MarkLogic kubernetes operator team will use the PRs for "inspiration" but no
3838

3939
**Important:** Please open an issue in the [Issue Tracker][] and get your proposed changes pre-approved by at least one of the project maintainers before you start coding. Nothing is more frustrating than seeing your hard work go to waste because your vision does not align with that of the project maintainers.
4040

41-
[Issue Tracker]: https://github.com/marklogic/marklogic-kubernetes-operator/issues
41+
[Issue Tracker]: https://github.com/marklogic/marklogic-operator-kubernetes/issues

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.22 AS builder
2+
FROM golang:1.23.6 AS builder
33
ARG TARGETOS
44
ARG TARGETARCH
55

Jenkinsfile

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,22 @@ void runTests() {
124124
sh "make test"
125125
}
126126

127+
void runMinikubeSetup() {
128+
sh '''
129+
make e2e-setup-minikube
130+
'''
131+
}
132+
127133
void runE2eTests() {
128-
//TODO: this is just a place holder as kuttl needs a proper environment
129-
sh "echo make e2e-tests dockerImage=${params.dockerImage}"
134+
sh '''
135+
make e2e-test
136+
'''
137+
}
138+
139+
void runMinikubeCleanup() {
140+
sh '''
141+
make e2e-cleanup-minikube
142+
'''
130143
}
131144

132145
pipeline {
@@ -165,11 +178,23 @@ pipeline {
165178
}
166179
}
167180

168-
stage('Run-e2e-tests') {
181+
stage('Run-Minikube-Setup') {
182+
steps {
183+
runMinikubeSetup()
184+
}
185+
}
186+
187+
stage('Run-e2e-Tests') {
169188
steps {
170189
runE2eTests()
171190
}
172191
}
192+
193+
stage('Cleanup Environment') {
194+
steps {
195+
runMinikubeCleanup()
196+
}
197+
}
173198

174199
}
175200

LICENSE

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
Copyright © 2024-2025 MarkLogic Corporation.
2+
13
Apache License
24
Version 2.0, January 2004
35
http://www.apache.org/licenses/

Makefile

Lines changed: 63 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,20 @@
33
# To re-generate a bundle for another specific version without changing the standard setup, you can:
44
# - use the VERSION as arg of the bundle target (e.g make bundle VERSION=0.0.2)
55
# - use environment variables to overwrite this value (e.g export VERSION=0.0.2)
6-
VERSION ?= 0.0.1
6+
VERSION ?= 1.0.0
7+
8+
# VERIFY_HUGE_PAGES defines if hugepages test is enabled or not for e2e test
9+
VERIFY_HUGE_PAGES ?= false
10+
11+
export E2E_DOCKER_IMAGE ?= $(IMG)
12+
export E2E_KUSTOMIZE_VERSION ?= $(KUSTOMIZE_VERSION)
13+
export E2E_CONTROLLER_TOOLS_VERSION ?= $(CONTROLLER_TOOLS_VERSION)
14+
export E2E_MARKLOGIC_IMAGE_VERSION ?= progressofficial/marklogic-db:11.3.1-ubi-rootless-2.1.0
15+
export E2E_KUBERNETES_VERSION ?= v1.31.0
16+
17+
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
18+
ENVTEST_K8S_VERSION = 1.31.0
19+
720

821
# CHANNELS define the bundle channels used in the bundle.
922
# Add a new line here if you would like to change its default config. (E.g CHANNELS = "candidate,fast,stable")
@@ -28,8 +41,8 @@ BUNDLE_METADATA_OPTS ?= $(BUNDLE_CHANNELS) $(BUNDLE_DEFAULT_CHANNEL)
2841
# This variable is used to construct full image tags for bundle and catalog images.
2942
#
3043
# For example, running 'make bundle-build bundle-push catalog-build catalog-push' will build and push both
31-
# marklogic.com/marklogic-kubernetes-operator-bundle:$VERSION and marklogic.com/marklogic-kubernetes-operator-catalog:$VERSION.
32-
IMAGE_TAG_BASE ?= ml-docker-db-dev-tierpoint.bed-artifactory.bedford.progress.com/ml-marklogic-operator-dev/marklogic-kubernetes-operator
44+
# marklogic.com/marklogic-operator-kubernetes-bundle:$VERSION and marklogic.com/marklogic-operator-kubernetes-catalog:$VERSION.
45+
IMAGE_TAG_BASE ?= ml-docker-db-dev-tierpoint.bed-artifactory.bedford.progress.com/ml-marklogic-operator-dev/marklogic-operator-kubernetes
3346

3447
# BUNDLE_IMG defines the image:tag used for the bundle.
3548
# You can use it as an arg. (E.g make bundle-build BUNDLE_IMG=<some-registry>/<project-name-bundle>:<tag>)
@@ -51,9 +64,9 @@ endif
5164
OPERATOR_SDK_VERSION ?= v1.34.2
5265

5366
# Image URL to use all building/pushing image targets
54-
IMG ?= ml-marklogic-operator-dev.bed-artifactory.bedford.progress.com/marklogic-kubernetes-operator:1.0.0-ea2
55-
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
56-
ENVTEST_K8S_VERSION = 1.28.3
67+
# Image for dev: ml-marklogic-operator-dev.bed-artifactory.bedford.progress.com/marklogic-operator-kubernetes
68+
IMG ?= progressofficial/marklogic-operator-kubernetes:$(VERSION)
69+
5770

5871
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
5972
ifeq (,$(shell go env GOBIN))
@@ -97,7 +110,7 @@ help: ## Display this help.
97110

98111
.PHONY: manifests
99112
manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
100-
$(CONTROLLER_GEN) rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases
113+
$(CONTROLLER_GEN) rbac:roleName=manager-role crd:generateEmbeddedObjectMeta=true webhook paths="./..." output:crd:artifacts:config=config/crd/bases
101114

102115
.PHONY: generate
103116
generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
@@ -115,10 +128,44 @@ vet: ## Run go vet against code.
115128
test: manifests generate fmt vet envtest ## Run tests.
116129
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test -v $$(go list ./... | grep -v /e2e) -coverprofile cover.out
117130

118-
# Utilize Kind or modify the e2e tests to load the image locally, enabling compatibility with other vendors.
119-
.PHONY: e2e-test # Run the e2e tests against a Kind k8s instance that is spun up.
120-
e2e-test:
121-
go test -v ./test/e2e
131+
# Utilize minikube or modify the e2e tests to load the image locally, enabling compatibility with other vendors.
132+
# To run specific e2e test with label, try go test -v ./test/e2e -count=1 -args --labels="type=tls-multi-node"
133+
.PHONY: e2e-test # Run the e2e tests against a minikube k8s instance that is spun up.
134+
e2e-test:
135+
@echo "=====Check Huges pages test is enabled or not for e2e test"
136+
ifeq ($(VERIFY_HUGE_PAGES), true)
137+
@echo "=====Setting hugepages value to 1280 for hugepages-e2e test"
138+
sudo sysctl -w vm.nr_hugepages=1280
139+
140+
@echo "=====Restart minikube cluster to apply hugepages value"
141+
minikube stop
142+
minikube start
143+
144+
@echo "=====Running e2e test including hugepages test"
145+
go test -v -count=1 -timeout 30m ./test/e2e -verifyHugePages
146+
147+
@echo "=====Resetting hugepages value to 0"
148+
sudo sysctl -w vm.nr_hugepages=0
149+
150+
@echo "=====Restart minikube cluster"
151+
minikube stop
152+
minikube start
153+
else
154+
@echo "=====Running e2e test without hugepages test"
155+
go test -v -count=1 -timeout 30m ./test/e2e
156+
endif
157+
158+
.PHONY: e2e-setup-minikube
159+
e2e-setup-minikube: kustomize controller-gen build docker-build
160+
minikube delete || true
161+
minikube start --driver=docker --kubernetes-version=$(E2E_KUBERNETES_VERSION) --memory=8192 --cpus=2
162+
minikube addons enable ingress
163+
minikube image load $(IMG)
164+
165+
.PHONY: e2e-cleanup-minikube
166+
e2e-cleanup-minikube:
167+
@echo "=====Delete minikube cluster"
168+
minikube delete
122169

123170
GOLANGCI_LINT = $(shell pwd)/bin/golangci-lint
124171
GOLANGCI_LINT_VERSION ?= v1.54.2
@@ -151,8 +198,8 @@ run: manifests generate fmt vet ## Run a controller from your host.
151198
# (i.e. docker build --platform linux/arm64). However, you must enable docker buildKit for it.
152199
# More info: https://docs.docker.com/develop/develop-images/build_enhancements/
153200
.PHONY: docker-build
154-
docker-build: ## Build docker image with the manager.
155-
$(CONTAINER_TOOL) build --platform="linux/amd64" -t ${IMG} .
201+
docker-build: ## Build docker image with the manager. to build for linux, add --platform="linux/amd64"
202+
$(CONTAINER_TOOL) buildx build -t ${IMG} .
156203

157204
.PHONY: docker-push
158205
docker-push: ## Push docker image with the manager.
@@ -212,8 +259,8 @@ CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
212259
ENVTEST ?= $(LOCALBIN)/setup-envtest
213260

214261
## Tool Versions
215-
KUSTOMIZE_VERSION ?= v5.2.1
216-
CONTROLLER_TOOLS_VERSION ?= v0.14.0
262+
KUSTOMIZE_VERSION ?= v5.5.0
263+
CONTROLLER_TOOLS_VERSION ?= v0.17.1
217264

218265
.PHONY: kustomize
219266
kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary. If wrong version is installed, it will be removed before downloading.
@@ -316,7 +363,7 @@ $(HELMIFY): $(LOCALBIN)
316363
test -s $(LOCALBIN)/helmify || GOBIN=$(LOCALBIN) go install github.com/arttor/helmify/cmd/helmify@latest
317364

318365
helm: manifests kustomize helmify
319-
$(KUSTOMIZE) build config/default | $(HELMIFY) charts/marklogic-operator
366+
$(KUSTOMIZE) build config/default | $(HELMIFY) -image-pull-secrets -original-name charts/marklogic-operator-kubernetes
320367

321368
.PHONY: image-scan
322369
image-scan: docker-build

0 commit comments

Comments
 (0)