Skip to content

Commit 267dc90

Browse files
authored
Merge branch 'main' into release-1.19.1
2 parents 5670cbf + 66f6a51 commit 267dc90

Some content is hidden

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

46 files changed

+1188
-206
lines changed

.e2eignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ README.md
77
LICENSE
88
operator.png
99
kubernetes.svg
10-
release_versions
10+
release_versions
11+
.github/**

.github/CODEOWNERS

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
* @hors @egegunes @inelpandzic @pooknull
2-
/e2e-tests/ @nmarukovich @ptankov @jvpasinatto @eleo007
3-
Jenkinsfile @nmarukovich @ptankov @jvpasinatto @eleo007
1+
* @hors @egegunes @pooknull @nmarukovich @gkech
2+
/e2e-tests/ @ptankov @jvpasinatto @eleo007
3+
Jenkinsfile @ptankov @jvpasinatto @eleo007
4+

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ updates:
2323
time: "01:00"
2424
reviewers:
2525
- hors
26-
- tplavcic
26+
- nmarukovich
2727
ignore:
2828
# ignore patch updates for all dependencies
2929
- dependency-name: "*"

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ anaconda-mode/
9292
# Output of the go coverage tool, specifically when used with LiteIDE
9393
*.out
9494

95+
# vendor
96+
/vendor/
97+
9598
### Vim ###
9699
# swap
97100
.sw[a-p]
@@ -182,3 +185,7 @@ bin/
182185
### VisualStudioCode ###
183186
.vscode/*
184187
.history
188+
189+
projects/
190+
installers/olm/operator_*.yaml
191+
installers/olm/bundles

Jenkinsfile

Lines changed: 49 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ void createCluster(String CLUSTER_SUFFIX) {
1313
gcloud auth activate-service-account --key-file $CLIENT_SECRET_FILE
1414
gcloud config set project $GCP_PROJECT
1515
gcloud container clusters list --filter $CLUSTER_NAME-${CLUSTER_SUFFIX} --zone $region --format='csv[no-heading](name)' | xargs gcloud container clusters delete --zone $region --quiet || true
16-
gcloud container clusters create --zone $region $CLUSTER_NAME-${CLUSTER_SUFFIX} --cluster-version=1.28 --machine-type=n1-standard-4 --preemptible --disk-size 30 --num-nodes=\$NODES_NUM --network=jenkins-vpc --subnetwork=jenkins-${CLUSTER_SUFFIX} --no-enable-autoupgrade --cluster-ipv4-cidr=/21 --labels delete-cluster-after-hours=6 --enable-ip-alias --workload-pool=cloud-dev-112233.svc.id.goog && \
16+
gcloud container clusters create --zone $region $CLUSTER_NAME-${CLUSTER_SUFFIX} --cluster-version=1.29 --machine-type=n1-standard-4 --preemptible --disk-size 30 --num-nodes=\$NODES_NUM --network=jenkins-vpc --subnetwork=jenkins-${CLUSTER_SUFFIX} --no-enable-autoupgrade --cluster-ipv4-cidr=/21 --labels delete-cluster-after-hours=6 --enable-ip-alias --workload-pool=cloud-dev-112233.svc.id.goog && \
1717
kubectl create clusterrolebinding cluster-admin-binding --clusterrole cluster-admin --user jenkins@"$GCP_PROJECT".iam.gserviceaccount.com || ret_val=\$?
1818
if [ \${ret_val} -eq 0 ]; then break; fi
1919
ret_num=\$((ret_num + 1))
@@ -280,58 +280,65 @@ void checkE2EIgnoreFiles() {
280280
}
281281

282282
def e2eignoreFile = ".e2eignore"
283-
if (fileExists(e2eignoreFile)) {
284-
def excludedFiles = readFile(e2eignoreFile).split('\n').collect{it.trim()}
285-
def lastProcessedCommitFile="last-processed-commit.txt"
286-
def lastProcessedCommitHash = ""
287-
288-
def build = currentBuild.previousBuild
289-
while (build != null) {
290-
try {
291-
echo "Checking previous build: #$build.number"
292-
copyArtifacts(projectName: env.JOB_NAME, selector: specific("$build.number"), filter: lastProcessedCommitFile)
293-
lastProcessedCommitHash = readFile(lastProcessedCommitFile).trim()
294-
echo "Last processed commit hash: $lastProcessedCommitHash"
295-
break
296-
} catch (Exception e) {
297-
echo "No $lastProcessedCommitFile found in build $build.number. Checking earlier builds."
298-
}
299-
build = build.previousBuild
283+
if ( ! fileExists(e2eignoreFile) ) {
284+
echo "No $e2eignoreFile file found. Proceeding with execution."
285+
return
286+
}
287+
288+
def excludedFiles = readFile(e2eignoreFile).split('\n').collect{it.trim()}
289+
def lastProcessedCommitFile = "last-processed-commit.txt"
290+
def lastProcessedCommitHash = ""
291+
292+
def build = currentBuild.previousBuild
293+
while (build != null) {
294+
try {
295+
echo "Checking previous build: #$build.number"
296+
copyArtifacts(projectName: env.JOB_NAME, selector: specific("$build.number"), filter: lastProcessedCommitFile)
297+
lastProcessedCommitHash = readFile(lastProcessedCommitFile).trim()
298+
echo "Last processed commit hash: $lastProcessedCommitHash"
299+
break
300+
} catch (Exception e) {
301+
echo "No $lastProcessedCommitFile found in build $build.number. Checking earlier builds."
300302
}
303+
build = build.previousBuild
304+
}
301305

302-
if (lastProcessedCommitHash == "") {
303-
echo "This is the first run. Using merge base as the starting point for the diff."
304-
changedFiles = sh(script: "git diff --name-only \$(git merge-base HEAD origin/$CHANGE_TARGET)", returnStdout: true).trim().split('\n').findAll{it}
305-
} else {
306+
if (lastProcessedCommitHash == "") {
307+
echo "This is the first run. Using merge base as the starting point for the diff."
308+
changedFiles = sh(script: "git diff --name-only \$(git merge-base HEAD origin/$CHANGE_TARGET)", returnStdout: true).trim().split('\n').findAll{it}
309+
} else {
310+
def commitExists = sh(script: "git cat-file -e $lastProcessedCommitHash 2>/dev/null", returnStatus: true) == 0
311+
if (commitExists) {
306312
echo "Processing changes since last processed commit: $lastProcessedCommitHash"
307313
changedFiles = sh(script: "git diff --name-only $lastProcessedCommitHash HEAD", returnStdout: true).trim().split('\n').findAll{it}
314+
} else {
315+
echo "Commit hash $lastProcessedCommitHash does not exist in the current repository. Using merge base as the starting point for the diff."
316+
changedFiles = sh(script: "git diff --name-only \$(git merge-base HEAD origin/$CHANGE_TARGET)", returnStdout: true).trim().split('\n').findAll{it}
308317
}
318+
}
309319

310-
echo "Excluded files: $excludedFiles"
311-
echo "Changed files: $changedFiles"
320+
echo "Excluded files: $excludedFiles"
321+
echo "Changed files: $changedFiles"
312322

313-
def excludedFilesRegex = excludedFiles.collect{it.replace("**", ".*").replace("*", "[^/]*")}
314-
needToRunTests = !changedFiles.every{changed -> excludedFilesRegex.any{regex -> changed ==~ regex}}
323+
def excludedFilesRegex = excludedFiles.collect{it.replace("**", ".*").replace("*", "[^/]*")}
324+
needToRunTests = !changedFiles.every{changed -> excludedFilesRegex.any{regex -> changed ==~ regex}}
315325

316-
if (needToRunTests) {
317-
echo "Some changed files are outside of the e2eignore list. Proceeding with execution."
326+
if (needToRunTests) {
327+
echo "Some changed files are outside of the e2eignore list. Proceeding with execution."
328+
} else {
329+
if (currentBuild.previousBuild?.result != 'SUCCESS') {
330+
echo "All changed files are e2eignore files, and previous build was unsuccessful. Propagating previous state."
331+
currentBuild.result = currentBuild.previousBuild?.result
332+
error "Skipping execution as non-significant changes detected and previous build was unsuccessful."
318333
} else {
319-
if (currentBuild.previousBuild?.result in ['FAILURE', 'ABORTED', 'UNSTABLE']) {
320-
echo "All changed files are e2eignore files, and previous build was unsuccessful. Propagating previous state."
321-
currentBuild.result = currentBuild.previousBuild?.result
322-
error "Skipping execution as non-significant changes detected and previous build was unsuccessful."
323-
} else {
324-
echo "All changed files are e2eignore files. Aborting pipeline execution."
325-
}
334+
echo "All changed files are e2eignore files. Aborting pipeline execution."
326335
}
327-
328-
sh """
329-
echo \$(git rev-parse HEAD) > $lastProcessedCommitFile
330-
"""
331-
archiveArtifacts "$lastProcessedCommitFile"
332-
} else {
333-
echo "No $e2eignoreFile file found. Proceeding with execution."
334336
}
337+
338+
sh """
339+
echo \$(git rev-parse HEAD) > $lastProcessedCommitFile
340+
"""
341+
archiveArtifacts "$lastProcessedCommitFile"
335342
}
336343

337344
def isPRJob = false

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Below is one of the ways to deploy the Operator using `kubectl`.
4444
kubectl apply --server-side -f https://raw.githubusercontent.com/percona/percona-server-mongodb-operator/main/deploy/bundle.yaml
4545
```
4646

47-
2. Deploy the database cluster itself from `deploy/cr.yaml
47+
2. Deploy the database cluster itself from `deploy/cr.yaml`
4848

4949
```sh
5050
kubectl apply -f https://raw.githubusercontent.com/percona/percona-server-mongodb-operator/main/deploy/cr-minimal.yaml

config/bundle/kustomization.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
resources:
4+
- ../crd
5+
- ../rbac/namespace
6+
- ../manager/namespace
7+
images:
8+
- name: percona-server-mongodb-operator
9+
newName: perconalab/percona-server-mongodb-operator
10+
newTag: main

config/community/kustomization.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
4+
resources:
5+
- ../operator

config/crd/kustomization.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ resources:
77
- bases/psmdb.percona.com_perconaservermongodbs.yaml
88
#+kubebuilder:scaffold:crdkustomizeresource
99

10-
patchesJson6902:
10+
patches:
1111
- path: patches/deprecated-1.2.json
1212
target:
1313
name: perconaservermongodbs.psmdb.percona.com
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
resources:
4+
- cw-operator.yaml
5+
images:
6+
- name: psmdb-operator
7+
newName: perconalab/percona-server-mongodb-operator
8+
newTag: main

0 commit comments

Comments
 (0)