Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,28 @@ issues:
linters:
- dupl
- lll
- path: "test/*"
linters:
- dupl
- errcheck
- goconst
- gocyclo
- lll
- unused
- path: "pkg/*"
linters:
- lll
- unparam
linters:
disable-all: true
enable:
- dupl
- errcheck
- exportloopref
- goconst
- gocyclo
- gofmt
- goimports
- gosimple
- govet
- ineffassign
- lll
- misspell
- nakedret
- prealloc
- staticcheck
- typecheck
- unconvert
- unparam
- unused
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Copyright (c) 2024-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.

# Build the manager binary
FROM golang:1.23.6 AS builder
FROM golang:1.24.9 AS builder
ARG TARGETOS
ARG TARGETARCH

Expand Down
105 changes: 84 additions & 21 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Copyright (c) 2024-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.

/* groovylint-disable CompileStatic, LineLength, VariableTypeRequired */
// This Jenkinsfile defines internal MarkLogic build pipeline.

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

// Define local funtions
void preBuildCheck() {
Expand Down Expand Up @@ -126,15 +132,15 @@ void runTests() {
}

void runMinikubeSetup() {
sh '''
make e2e-setup-minikube
'''
sh """
make e2e-setup-minikube IMG=${operatorRepo}:${VERSION}
"""
}

void runE2eTests() {
sh '''
make e2e-test
'''
sh """
make e2e-test IMG=${operatorRepo}:${VERSION}
"""
}

void runMinikubeCleanup() {
Expand All @@ -143,9 +149,43 @@ void runMinikubeCleanup() {
'''
}

void runSecurityScan() {
build job: 'securityscans/Blackduck/KubeNinjas/kubernetes-operator', wait: false, parameters: [ string(name: 'branch', value: "${env.BRANCH_NAME}") ]
void runBlackDuckScan() {
// Trigger BlackDuck scan job with CONTAINER_IMAGES parameter when params.PUBLISH_IMAGE is true
if (params.PUBLISH_IMAGE) {
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}") ]
} else {
build job: 'securityscans/Blackduck/KubeNinjas/kubernetes-operator', wait: false, parameters: [ string(name: 'branch', value: "${env.BRANCH_NAME}") ]
}
}

/**
* Publishes the built Docker image to the internal Artifactory registry.
* Tags the image with multiple tags (version-specific, branch-specific, latest).
* Requires Artifactory credentials.
*/
void publishToInternalRegistry() {
withCredentials([usernamePassword(credentialsId: 'builder-credentials-artifactory', passwordVariable: 'docker_password', usernameVariable: 'docker_user')]) {

sh """
# make sure to logout first to avoid issues with cached credentials
docker logout ${operatorRegistry}
echo "${docker_password}" | docker login --username ${docker_user} --password-stdin ${operatorRegistry}

# Create tags
docker tag ${operatorRepo}:${VERSION} ${operatorRegistry}/${operatorRepo}:${VERSION}
docker tag ${operatorRepo}:${VERSION} ${operatorRegistry}/${operatorRepo}:${VERSION}-${branchNameTag}
docker tag ${operatorRepo}:${VERSION} ${operatorRegistry}/${operatorRepo}:${VERSION}-${branchNameTag}-${timeStamp}
docker tag ${operatorRepo}:${VERSION} ${operatorRegistry}/${operatorRepo}:latest

# Push images to internal registry
docker push ${operatorRegistry}/${operatorRepo}:${VERSION}
docker push ${operatorRegistry}/${operatorRepo}:${VERSION}-${branchNameTag}
docker push ${operatorRegistry}/${operatorRepo}:${VERSION}-${branchNameTag}-${timeStamp}
docker push ${operatorRegistry}/${operatorRepo}:latest
"""
}
}

pipeline {
agent {
label {
Expand All @@ -157,16 +197,25 @@ pipeline {
buildDiscarder logRotator(artifactDaysToKeepStr: '20', artifactNumToKeepStr: '', daysToKeepStr: '30', numToKeepStr: '')
skipStagesAfterUnstable()
}
// triggers {
// //TODO: add scheduled runs
// }
// environment {
// //TODO
// }

triggers {
// Trigger nightly builds on the develop branch
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
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''' : '')
}

environment {
PATH = "/space/go/bin:${env.PATH}"
MINIKUBE_HOME = "/space/minikube/"
KUBECONFIG = "/space/.kube-config"
GOPATH = "/space/go"
}


parameters {
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)
string(name: 'IMG', defaultValue: 'testrepo/marklogic-operator-image-dev:internal', description: 'Docker image for Running Operator Container', trim: true)
string(name: 'VERSION', defaultValue: '1.1.0', description: 'Version to tag the image with.', trim: true)
booleanParam(name: 'PUBLISH_IMAGE', defaultValue: false, description: 'Publish image to internal registry')
string(name: 'emailList', defaultValue: emailList, description: 'List of email for build notification', trim: true)
}

Expand All @@ -177,12 +226,6 @@ pipeline {
}
}

stage('Run-Security-Scan') {
steps {
runSecurityScan()
}
}

stage('Run-tests') {
steps {
runTests()
Expand All @@ -206,6 +249,26 @@ pipeline {
runMinikubeCleanup()
}
}

// Publish image to internal registries (conditional)
stage('Publish Image') {
when {
anyOf {
branch 'develop'
expression { return params.PUBLISH_IMAGE }
}
}
steps {
publishToInternalRegistry()
}
}

stage('Run-BlackDuck-Scan') {

steps {
runBlackDuckScan()
}
}

}

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright © 2024-2025 MarkLogic Corporation.
Copyright (c) 2024-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.

Apache License
Version 2.0, January 2004
Expand Down
20 changes: 11 additions & 9 deletions Makefile
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
# Copyright (c) 2024-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.

# VERSION defines the project version for the bundle.
# Update this value when you upgrade the version of your project.
# To re-generate a bundle for another specific version without changing the standard setup, you can:
# - use the VERSION as arg of the bundle target (e.g make bundle VERSION=0.0.2)
# - use environment variables to overwrite this value (e.g export VERSION=0.0.2)
VERSION ?= 1.0.0
VERSION ?= 1.1.0

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

export E2E_DOCKER_IMAGE ?= $(IMG)
export E2E_KUSTOMIZE_VERSION ?= $(KUSTOMIZE_VERSION)
export E2E_CONTROLLER_TOOLS_VERSION ?= $(CONTROLLER_TOOLS_VERSION)
export E2E_MARKLOGIC_IMAGE_VERSION ?= progressofficial/marklogic-db:11.3.1-ubi-rootless-2.1.3
export E2E_KUBERNETES_VERSION ?= v1.31.0
export E2E_MARKLOGIC_IMAGE_VERSION ?= progressofficial/marklogic-db:12.0.0-ubi9-rootless-2.2.2
export E2E_KUBERNETES_VERSION ?= v1.31.13

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

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


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

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

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

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

## Tool Versions
KUSTOMIZE_VERSION ?= v5.5.0
CONTROLLER_TOOLS_VERSION ?= v0.17.1
CONTROLLER_TOOLS_VERSION ?= v0.19.0

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

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

.PHONY: image-scan
Expand Down
32 changes: 16 additions & 16 deletions NOTICE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MarkLogic® Operator for Kubernetes

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.
Copyright (c) 2024-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.

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

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


api v0.32.1 (Apache-2.0)
apimachinery v0.32.1 (Apache-2.0)
client-go v0.32.1 (Apache-2.0)
controller-runtime v0.20.1 (Apache-2.0)
api v0.34.1 (Apache-2.0)
apimachinery v0.34.1 (Apache-2.0)
client-go v0.34.1 (Apache-2.0)
controller-runtime v0.22.3 (Apache-2.0)
k8s-objectmatcher v1.10.0 (Apache-2.0)
logr v1.4.2 (Apache-2.0
logr v1.4.3 (Apache-2.0)


Common Licenses
Expand All @@ -31,27 +31,27 @@ logr v1.4.2 (Apache-2.0

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

Api v0.32.1 (Apache-2.0)
Api v0.34.1 (Apache-2.0)

https://github.com/kubernetes/api/tree/v0.32.1
https://github.com/kubernetes/api/tree/v0.34.1

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

Apimachinery v0.32.1 (Apache-2.0)
Apimachinery v0.34.1 (Apache-2.0)

https://github.com/kubernetes/apimachinery/tree/v0.32.1
https://github.com/kubernetes/apimachinery/tree/v0.34.1

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

client-go v0.32.1 (Apache-2.0)
client-go v0.34.1 (Apache-2.0)

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

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

Controller-runtime v0.20.1 (Apache-2.0)
Controller-runtime v0.22.3 (Apache-2.0)

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

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

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

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

Logr v1.4.2 (Apache-2.0)
Logr v1.4.3 (Apache-2.0)

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

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

Expand Down
2 changes: 2 additions & 0 deletions PROJECT
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright (c) 2024-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.

# Code generated by tool. DO NOT EDIT.
# This file is used to track the info used to scaffold your project
# and allow the plugins properly work.
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ helm repo add marklogic-operator https://marklogic.github.io/marklogic-operator-
helm repo update
```

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

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

## Known Issues and Limitations

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.
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.
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.
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.
Loading
Loading