Skip to content

Commit 8980492

Browse files
authored
Merge pull request #114 from marklogic/main
MLE-23621: Merge master back to develop after 1.1 release
2 parents 26295cc + c29bb17 commit 8980492

File tree

103 files changed

+1838
-18099
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

+1838
-18099
lines changed

.golangci.yml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,28 @@ issues:
1616
linters:
1717
- dupl
1818
- lll
19+
- path: "test/*"
20+
linters:
21+
- dupl
22+
- errcheck
23+
- goconst
24+
- gocyclo
25+
- lll
26+
- unused
27+
- path: "pkg/*"
28+
linters:
29+
- lll
30+
- unparam
1931
linters:
2032
disable-all: true
2133
enable:
22-
- dupl
2334
- errcheck
24-
- exportloopref
25-
- goconst
26-
- gocyclo
2735
- gofmt
2836
- goimports
2937
- gosimple
3038
- govet
3139
- ineffassign
32-
- lll
33-
- misspell
34-
- nakedret
35-
- prealloc
3640
- staticcheck
3741
- typecheck
3842
- unconvert
39-
- unparam
4043
- unused

Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
# Copyright (c) 2024-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
2+
13
# Build the manager binary
2-
FROM golang:1.23.6 AS builder
4+
FROM golang:1.24.9 AS builder
35
ARG TARGETOS
46
ARG TARGETARCH
57

Jenkinsfile

Lines changed: 84 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// Copyright (c) 2024-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
2+
13
/* groovylint-disable CompileStatic, LineLength, VariableTypeRequired */
24
// This Jenkinsfile defines internal MarkLogic build pipeline.
35

@@ -8,8 +10,12 @@ import groovy.json.JsonSlurperClassic
810
emailList = 'vitaly.korolev@progress.com, sumanth.ravipati@progress.com, peng.zhou@progress.com, barkha.choithani@progress.com, romain.winieski@progress.com'
911
emailSecList = 'Mahalakshmi.Srinivasan@progress.com'
1012
gitCredID = 'marklogic-builder-github'
13+
operatorRegistry = 'ml-marklogic-operator-dev.bed-artifactory.bedford.progress.com'
1114
JIRA_ID = ''
1215
JIRA_ID_PATTERN = /(?i)(MLE)-\d{3,6}/
16+
operatorRepo = 'marklogic-kubernetes-operator'
17+
timeStamp = new Date().format('yyyyMMdd')
18+
branchNameTag = env.BRANCH_NAME.replaceAll('/', '-')
1319

1420
// Define local funtions
1521
void preBuildCheck() {
@@ -126,15 +132,15 @@ void runTests() {
126132
}
127133

128134
void runMinikubeSetup() {
129-
sh '''
130-
make e2e-setup-minikube
131-
'''
135+
sh """
136+
make e2e-setup-minikube IMG=${operatorRepo}:${VERSION}
137+
"""
132138
}
133139

134140
void runE2eTests() {
135-
sh '''
136-
make e2e-test
137-
'''
141+
sh """
142+
make e2e-test IMG=${operatorRepo}:${VERSION}
143+
"""
138144
}
139145

140146
void runMinikubeCleanup() {
@@ -143,9 +149,43 @@ void runMinikubeCleanup() {
143149
'''
144150
}
145151

146-
void runSecurityScan() {
147-
build job: 'securityscans/Blackduck/KubeNinjas/kubernetes-operator', wait: false, parameters: [ string(name: 'branch', value: "${env.BRANCH_NAME}") ]
152+
void runBlackDuckScan() {
153+
// Trigger BlackDuck scan job with CONTAINER_IMAGES parameter when params.PUBLISH_IMAGE is true
154+
if (params.PUBLISH_IMAGE) {
155+
build job: 'securityscans/Blackduck/KubeNinjas/kubernetes-operator', wait: false, parameters: [ string(name: 'branch', value: "${env.BRANCH_NAME}"), string(name: 'CONTAINER_IMAGES', value: "${operatorRegistry}/${operatorRepo}:${VERSION}-${branchNameTag}-${timeStamp}") ]
156+
} else {
157+
build job: 'securityscans/Blackduck/KubeNinjas/kubernetes-operator', wait: false, parameters: [ string(name: 'branch', value: "${env.BRANCH_NAME}") ]
158+
}
159+
}
160+
161+
/**
162+
* Publishes the built Docker image to the internal Artifactory registry.
163+
* Tags the image with multiple tags (version-specific, branch-specific, latest).
164+
* Requires Artifactory credentials.
165+
*/
166+
void publishToInternalRegistry() {
167+
withCredentials([usernamePassword(credentialsId: 'builder-credentials-artifactory', passwordVariable: 'docker_password', usernameVariable: 'docker_user')]) {
168+
169+
sh """
170+
# make sure to logout first to avoid issues with cached credentials
171+
docker logout ${operatorRegistry}
172+
echo "${docker_password}" | docker login --username ${docker_user} --password-stdin ${operatorRegistry}
173+
174+
# Create tags
175+
docker tag ${operatorRepo}:${VERSION} ${operatorRegistry}/${operatorRepo}:${VERSION}
176+
docker tag ${operatorRepo}:${VERSION} ${operatorRegistry}/${operatorRepo}:${VERSION}-${branchNameTag}
177+
docker tag ${operatorRepo}:${VERSION} ${operatorRegistry}/${operatorRepo}:${VERSION}-${branchNameTag}-${timeStamp}
178+
docker tag ${operatorRepo}:${VERSION} ${operatorRegistry}/${operatorRepo}:latest
179+
180+
# Push images to internal registry
181+
docker push ${operatorRegistry}/${operatorRepo}:${VERSION}
182+
docker push ${operatorRegistry}/${operatorRepo}:${VERSION}-${branchNameTag}
183+
docker push ${operatorRegistry}/${operatorRepo}:${VERSION}-${branchNameTag}-${timeStamp}
184+
docker push ${operatorRegistry}/${operatorRepo}:latest
185+
"""
186+
}
148187
}
188+
149189
pipeline {
150190
agent {
151191
label {
@@ -157,16 +197,25 @@ pipeline {
157197
buildDiscarder logRotator(artifactDaysToKeepStr: '20', artifactNumToKeepStr: '', daysToKeepStr: '30', numToKeepStr: '')
158198
skipStagesAfterUnstable()
159199
}
160-
// triggers {
161-
// //TODO: add scheduled runs
162-
// }
163-
// environment {
164-
// //TODO
165-
// }
200+
201+
triggers {
202+
// Trigger nightly builds on the develop branch
203+
parameterizedCron( env.BRANCH_NAME == 'develop' ? '''00 05 * * * % E2E_MARKLOGIC_IMAGE_VERSION=ml-docker-db-dev-tierpoint.bed-artifactory.bedford.progress.com/marklogic/marklogic-server-ubi-rootless:latest-12
204+
00 05 * * * % E2E_MARKLOGIC_IMAGE_VERSION=ml-docker-db-dev-tierpoint.bed-artifactory.bedford.progress.com/marklogic/marklogic-server-ubi-rootless:latest-11; PUBLISH_IMAGE=false''' : '')
205+
}
206+
207+
environment {
208+
PATH = "/space/go/bin:${env.PATH}"
209+
MINIKUBE_HOME = "/space/minikube/"
210+
KUBECONFIG = "/space/.kube-config"
211+
GOPATH = "/space/go"
212+
}
213+
166214

167215
parameters {
168216
string(name: 'E2E_MARKLOGIC_IMAGE_VERSION', defaultValue: 'ml-docker-db-dev-tierpoint.bed-artifactory.bedford.progress.com/marklogic/marklogic-server-ubi-rootless:latest-12', description: 'Docker image to use for tests.', trim: true)
169-
string(name: 'IMG', defaultValue: 'testrepo/marklogic-operator-image-dev:internal', description: 'Docker image for Running Operator Container', trim: true)
217+
string(name: 'VERSION', defaultValue: '1.1.0', description: 'Version to tag the image with.', trim: true)
218+
booleanParam(name: 'PUBLISH_IMAGE', defaultValue: false, description: 'Publish image to internal registry')
170219
string(name: 'emailList', defaultValue: emailList, description: 'List of email for build notification', trim: true)
171220
}
172221

@@ -177,12 +226,6 @@ pipeline {
177226
}
178227
}
179228

180-
stage('Run-Security-Scan') {
181-
steps {
182-
runSecurityScan()
183-
}
184-
}
185-
186229
stage('Run-tests') {
187230
steps {
188231
runTests()
@@ -206,6 +249,26 @@ pipeline {
206249
runMinikubeCleanup()
207250
}
208251
}
252+
253+
// Publish image to internal registries (conditional)
254+
stage('Publish Image') {
255+
when {
256+
anyOf {
257+
branch 'develop'
258+
expression { return params.PUBLISH_IMAGE }
259+
}
260+
}
261+
steps {
262+
publishToInternalRegistry()
263+
}
264+
}
265+
266+
stage('Run-BlackDuck-Scan') {
267+
268+
steps {
269+
runBlackDuckScan()
270+
}
271+
}
209272

210273
}
211274

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright © 2024-2025 MarkLogic Corporation.
1+
Copyright (c) 2024-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
22

33
Apache License
44
Version 2.0, January 2004

Makefile

100644100755
Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
1+
# Copyright (c) 2024-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
2+
13
# VERSION defines the project version for the bundle.
24
# Update this value when you upgrade the version of your project.
35
# To re-generate a bundle for another specific version without changing the standard setup, you can:
46
# - use the VERSION as arg of the bundle target (e.g make bundle VERSION=0.0.2)
57
# - use environment variables to overwrite this value (e.g export VERSION=0.0.2)
6-
VERSION ?= 1.0.0
8+
VERSION ?= 1.1.0
79

810
# VERIFY_HUGE_PAGES defines if hugepages test is enabled or not for e2e test
911
VERIFY_HUGE_PAGES ?= false
1012

1113
export E2E_DOCKER_IMAGE ?= $(IMG)
1214
export E2E_KUSTOMIZE_VERSION ?= $(KUSTOMIZE_VERSION)
1315
export E2E_CONTROLLER_TOOLS_VERSION ?= $(CONTROLLER_TOOLS_VERSION)
14-
export E2E_MARKLOGIC_IMAGE_VERSION ?= progressofficial/marklogic-db:11.3.1-ubi-rootless-2.1.3
15-
export E2E_KUBERNETES_VERSION ?= v1.31.0
16+
export E2E_MARKLOGIC_IMAGE_VERSION ?= progressofficial/marklogic-db:12.0.0-ubi9-rootless-2.2.2
17+
export E2E_KUBERNETES_VERSION ?= v1.31.13
1618

1719
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
1820
ENVTEST_K8S_VERSION = 1.31.0
@@ -65,8 +67,7 @@ OPERATOR_SDK_VERSION ?= v1.34.2
6567

6668
# Image URL to use all building/pushing image targets
6769
# Image for dev: ml-marklogic-operator-dev.bed-artifactory.bedford.progress.com/marklogic-operator-kubernetes
68-
# IMG ?= progressofficial/marklogic-operator-kubernetes:$(VERSION)
69-
IMG = "testrepo/marklogic-operator-image-dev:1.0.0"
70+
IMG ?= progressofficial/marklogic-operator-kubernetes:$(VERSION)
7071

7172

7273
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
@@ -173,11 +174,11 @@ e2e-cleanup-minikube:
173174
minikube delete
174175

175176
GOLANGCI_LINT = $(shell pwd)/bin/golangci-lint
176-
GOLANGCI_LINT_VERSION ?= v1.54.2
177+
GOLANGCI_LINT_VERSION ?= v1.62.2
177178
golangci-lint:
178179
@[ -f $(GOLANGCI_LINT) ] || { \
179180
set -e ;\
180-
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell dirname $(GOLANGCI_LINT)) $(GOLANGCI_LINT_VERSION) ;\
181+
GOBIN=$(shell dirname $(GOLANGCI_LINT)) go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION) ;\
181182
}
182183

183184
.PHONY: lint
@@ -204,7 +205,7 @@ run: manifests generate fmt vet ## Run a controller from your host.
204205
# More info: https://docs.docker.com/develop/develop-images/build_enhancements/
205206
.PHONY: docker-build
206207
docker-build: ## Build docker image with the manager. to build for linux, add --platform="linux/amd64"
207-
$(CONTAINER_TOOL) buildx build -t ${IMG} .
208+
$(CONTAINER_TOOL) buildx build --platform="linux/amd64" -t ${IMG} .
208209

209210
.PHONY: docker-push
210211
docker-push: ## Push docker image with the manager.
@@ -265,7 +266,7 @@ ENVTEST ?= $(LOCALBIN)/setup-envtest
265266

266267
## Tool Versions
267268
KUSTOMIZE_VERSION ?= v5.5.0
268-
CONTROLLER_TOOLS_VERSION ?= v0.17.1
269+
CONTROLLER_TOOLS_VERSION ?= v0.19.0
269270

270271
.PHONY: kustomize
271272
kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary. If wrong version is installed, it will be removed before downloading.
@@ -368,6 +369,7 @@ $(HELMIFY): $(LOCALBIN)
368369
test -s $(LOCALBIN)/helmify || GOBIN=$(LOCALBIN) go install github.com/arttor/helmify/cmd/helmify@latest
369370

370371
helm: manifests kustomize helmify
372+
cd config/manager && $(KUSTOMIZE) edit set image controller=$(IMG)
371373
$(KUSTOMIZE) build config/default | $(HELMIFY) -image-pull-secrets -original-name charts/marklogic-operator-kubernetes
372374

373375
.PHONY: image-scan

NOTICE.txt

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MarkLogic® Operator for Kubernetes
22

3-
Copyright © 2024-2025 MarkLogic Corporation. MarkLogic and MarkLogic logo are trademarks or registered trademarks of MarkLogic Corporation in the United States and other countries. All other trademarks are the property of their respective owners.
3+
Copyright (c) 2024-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
44

55
This project is licensed under the Apache License, Version 2.0 (the "License"); you may not use this project except in compliance with the License. You may obtain a copy of the License at
66

@@ -15,12 +15,12 @@ This document provides notice information for the third-party components used by
1515
Third Party Components
1616

1717

18-
api v0.32.1 (Apache-2.0)
19-
apimachinery v0.32.1 (Apache-2.0)
20-
client-go v0.32.1 (Apache-2.0)
21-
controller-runtime v0.20.1 (Apache-2.0)
18+
api v0.34.1 (Apache-2.0)
19+
apimachinery v0.34.1 (Apache-2.0)
20+
client-go v0.34.1 (Apache-2.0)
21+
controller-runtime v0.22.3 (Apache-2.0)
2222
k8s-objectmatcher v1.10.0 (Apache-2.0)
23-
logr v1.4.2 (Apache-2.0
23+
logr v1.4.3 (Apache-2.0)
2424

2525

2626
Common Licenses
@@ -31,27 +31,27 @@ logr v1.4.2 (Apache-2.0
3131

3232
The following software may be included in this project (last updated February 11, 2025):
3333

34-
Api v0.32.1 (Apache-2.0)
34+
Api v0.34.1 (Apache-2.0)
3535

36-
https://github.com/kubernetes/api/tree/v0.32.1
36+
https://github.com/kubernetes/api/tree/v0.34.1
3737

3838
For the full text of the Apache-2.0 license, see Apache License 2.0 (Apache-2.0)
3939

40-
Apimachinery v0.32.1 (Apache-2.0)
40+
Apimachinery v0.34.1 (Apache-2.0)
4141

42-
https://github.com/kubernetes/apimachinery/tree/v0.32.1
42+
https://github.com/kubernetes/apimachinery/tree/v0.34.1
4343

4444
For the full text of the Apache-2.0 license, see Apache License 2.0 (Apache-2.0)
4545

46-
client-go v0.32.1 (Apache-2.0)
46+
client-go v0.34.1 (Apache-2.0)
4747

48-
https://github.com/kubernetes/client-go/tree/v0.32.1
48+
https://github.com/kubernetes/client-go/tree/v0.34.1
4949

5050
For the full text of the Apache-2.0 license, see Apache License 2.0 (Apache-2.0)
5151

52-
Controller-runtime v0.20.1 (Apache-2.0)
52+
Controller-runtime v0.22.3 (Apache-2.0)
5353

54-
https://github.com/kubernetes-sigs/controller-runtime/tree/v0.20.1
54+
https://github.com/kubernetes-sigs/controller-runtime/tree/v0.22.3
5555

5656
For the full text of the Apache-2.0 license, see Apache License 2.0 (Apache-2.0)
5757

@@ -70,9 +70,9 @@ The source file patch/deletenull.go is based on https://github.com/kubernetes/ku
7070

7171
For the full text of the Apache-2.0 license, see Apache License 2.0 (Apache-2.0)
7272

73-
Logr v1.4.2 (Apache-2.0)
73+
Logr v1.4.3 (Apache-2.0)
7474

75-
https://github.com/go-logr/logr/tree/v1.4.2
75+
https://github.com/go-logr/logr/tree/v1.4.3
7676

7777
For the full text of the Apache-2.0 license, see Apache License 2.0 (Apache-2.0)
7878

PROJECT

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Copyright (c) 2024-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
2+
13
# Code generated by tool. DO NOT EDIT.
24
# This file is used to track the info used to scaffold your project
35
# and allow the plugins properly work.

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ helm repo add marklogic-operator https://marklogic.github.io/marklogic-operator-
2727
helm repo update
2828
```
2929

30-
2. Install the Helm Chart for MarkLogic Operator:
30+
2. Install or upgrade the Helm Chart for MarkLogic Operator:
3131
```sh
32-
helm upgrade marklogic-operator marklogic-operator/marklogic-operator-kubernetes --version=1.0.0 --install --namespace marklogic-operator-system --create-namespace
32+
helm upgrade marklogic-operator marklogic-operator/marklogic-operator-kubernetes --version=1.1.0 --install --namespace marklogic-operator-system --create-namespace
3333
```
3434

3535
3. Make sure the Marklogic Operator pod is running:
@@ -94,6 +94,6 @@ kubectl delete namespace marklogic-operator-system
9494

9595
## Known Issues and Limitations
9696

97-
1. The latest released version of fluent/fluent-bit:3.2.5 has high and critical security vulnerabilities. If you decide to enable the log collection feature, choose and deploy the fluent-bit or an alternate image with no vulnerabilities as per your requirements.
97+
1. The latest released version of fluent/fluent-bit:4.1.1 has high security vulnerabilities. If you decide to enable the log collection feature, choose and deploy the fluent-bit or an alternate image with no vulnerabilities as per your requirements.
9898
2. Known Issues and Limitations for the MarkLogic Server Docker image can be viewed using the link: https://github.com/marklogic/marklogic-docker?tab=readme-ov-file#Known-Issues-and-Limitations.
9999
3. If you're updating the group name configuration, ensure that you delete the pod to apply the changes, as we are using the OnDelete upgrade strategy.

0 commit comments

Comments
 (0)