diff --git a/.devbots/needs-triage.yml b/.devbots/needs-triage.yml deleted file mode 100644 index d71c67825..000000000 --- a/.devbots/needs-triage.yml +++ /dev/null @@ -1,4 +0,0 @@ -# Configuration for devbots-needs-triage - https://devbots.xyz/documentation/needs-triage/ - -enabled: true -label: "needs triage" \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 000000000..c726b0b5d --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,43 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/kubernetes-helm-minikube +{ + "name": "Kubernetes - Minikube-in-Docker", + // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile + "image": "mcr.microsoft.com/devcontainers/base:bullseye", + + "features": { + "ghcr.io/devcontainers/features/docker-in-docker:2": { + "enableNonRootDocker": "true", + "moby": "true" + }, + "ghcr.io/devcontainers/features/kubectl-helm-minikube:1": { + "version": "latest", + "helm": "latest", + "minikube": "latest" + }, + "ghcr.io/devcontainers/features/go:1": { + "version": "1.15", + "golangciLintVersion": "1.26.0" + }, + "ghcr.io/mpriscella/features/kind:1": { + "version": "latest" + }, + "ghcr.io/edouard-lopez/devcontainer-features/bats:0": { + "version": "latest" + } + } + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + + // Use 'postCreateCommand' to run commands after the container is created. + // "postCreateCommand": "kubectl version", + + // Use 'postStartCommand' to run commands after the container is created like starting minikube. + // "postStartCommand": "nohup bash -c 'minikube start &' > minikube.log 2>&1", + + // Configure tool-specific properties. + // "customizations": {}, + + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" +} diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 000000000..fa6081d3f --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,14 @@ +version: 2 +updates: + - package-ecosystem: "gomod" + directory: "/" + schedule: + interval: "daily" + - package-ecosystem: "npm" + directory: "/" + schedule: + interval: "daily" + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" diff --git a/.github/workflows/auto-codespell.yml b/.github/workflows/auto-codespell.yml new file mode 100644 index 000000000..843cd2d37 --- /dev/null +++ b/.github/workflows/auto-codespell.yml @@ -0,0 +1,21 @@ +name: codespell +on: + push: + branches: + - master + - main + pull_request: + types: [opened, synchronize, ready_for_review, reopened] +jobs: + codespell: + name: codespell + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Codespell + uses: codespell-project/actions-codespell@v1 + with: + check_filenames: true + ignore_words_list: aks,ags,startin + skip: "*.js,package-lock.json,*.lock,*/Font-Awesome/*,*.toml,*.svg,*assets/vendor/bootstrap*" diff --git a/.github/workflows/auto-gen-docs.yaml b/.github/workflows/auto-gen-docs.yaml index 5e246276e..f446e72f4 100644 --- a/.github/workflows/auto-gen-docs.yaml +++ b/.github/workflows/auto-gen-docs.yaml @@ -23,7 +23,7 @@ jobs: steps: # Checks out a copy of your repository on the ubuntu-latest machine - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: submodules: recursive # Fetch the Docsy theme fetch-depth: 0 @@ -39,7 +39,7 @@ jobs: if: env.IS_CHANGED == 'true' uses: peaceiris/actions-hugo@v2 with: - hugo-version: '0.62.2' + hugo-version: '0.113.0' extended: true # Sets up node - required by Hugo @@ -77,7 +77,7 @@ jobs: # Creates pull request with generated docs - name: Create Pull Request if: env.IS_CHANGED == 'true' - uses: peter-evans/create-pull-request@v3 + uses: peter-evans/create-pull-request@v5 with: commit-message: Auto-updated docs branch: docs-generator diff --git a/.github/workflows/auto-stale-issue.yaml b/.github/workflows/auto-stale-issue.yaml new file mode 100644 index 000000000..fbed56269 --- /dev/null +++ b/.github/workflows/auto-stale-issue.yaml @@ -0,0 +1,22 @@ +name: "Stale issue automation" +on: + workflow_dispatch: + schedule: + - cron: "0 9 * * *" + +permissions: + issues: write + pull-requests: write + +jobs: + stale: + runs-on: ubuntu-latest + steps: + - uses: actions/stale@v8 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + operations-per-run: 200 + days-before-issue-stale: 60 + days-before-issue-close: 10 + exempt-pr-labels: "not-stale" + exempt-issue-labels: "not-stale" diff --git a/.github/workflows/auto-tests-e2e.yaml b/.github/workflows/auto-tests-e2e.yaml index a51e198ec..0e8138dc8 100644 --- a/.github/workflows/auto-tests-e2e.yaml +++ b/.github/workflows/auto-tests-e2e.yaml @@ -30,7 +30,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Set up env vars run: | diff --git a/.github/workflows/auto-tests-helm.yaml b/.github/workflows/auto-tests-helm.yaml index 2a827d186..86c6c8676 100644 --- a/.github/workflows/auto-tests-helm.yaml +++ b/.github/workflows/auto-tests-helm.yaml @@ -30,7 +30,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Set up env vars run: | diff --git a/.github/workflows/release-backup.yaml b/.github/workflows/release-backup.yaml index 97461c93a..983efc705 100644 --- a/.github/workflows/release-backup.yaml +++ b/.github/workflows/release-backup.yaml @@ -20,7 +20,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Check envs run: make -C backup/pvc check-env @@ -44,7 +44,7 @@ jobs: - name: Login to Quay.io if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request' - uses: docker/login-action@v1 + uses: docker/login-action@v2 with: registry: quay.io username: ${{ secrets.QUAYIO_USERNAME }} @@ -54,5 +54,6 @@ jobs: if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request' run: | git reset --hard + rm bin/sembump make -C backup/pvc docker-build make -C backup/pvc docker-release diff --git a/.github/workflows/release-helm-chart.yaml b/.github/workflows/release-helm-chart.yaml index dbb4d75ca..36bf84e17 100644 --- a/.github/workflows/release-helm-chart.yaml +++ b/.github/workflows/release-helm-chart.yaml @@ -17,7 +17,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Deploy Helm chart run: | @@ -31,7 +31,7 @@ jobs: # Creates pull request with new chart version - name: Create Pull Request - uses: peter-evans/create-pull-request@v3 + uses: peter-evans/create-pull-request@v5 with: commit-message: Release Helm chart ${{ github.event.inputs.chartVersion }} branch: helm-chart-release-${{ github.event.inputs.chartVersion }} diff --git a/.github/workflows/release-nightly.yaml b/.github/workflows/release-nightly.yaml index f4f3a7098..5a2fb1ac1 100644 --- a/.github/workflows/release-nightly.yaml +++ b/.github/workflows/release-nightly.yaml @@ -18,7 +18,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Prep - check out code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Prep - Set up env vars run: | @@ -92,7 +92,7 @@ jobs: run: make bats-tests - name: Post - Login to Quay.io - uses: docker/login-action@v1 + uses: docker/login-action@v2 with: registry: quay.io username: ${{ secrets.QUAYIO_USERNAME }} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 2fc9194b2..44dfd0863 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -9,7 +9,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 @@ -45,7 +45,7 @@ jobs: tag_name: ${{ env.VERSION }} - name: Login to Quay.io - uses: docker/login-action@v1 + uses: docker/login-action@v2 with: registry: quay.io username: ${{ secrets.QUAYIO_USERNAME }} diff --git a/Makefile b/Makefile index a3e8f279f..744d10c0a 100644 --- a/Makefile +++ b/Makefile @@ -478,7 +478,7 @@ helm-release-latest: helm # Download and build hugo extended locally if necessary HUGO_PATH = $(shell pwd)/bin/hugo -HUGO_VERSION = v0.62.2 +HUGO_VERSION = v0.113.0 HAS_HUGO := $(shell $(HUGO_PATH)/hugo version 2>&- | grep $(HUGO_VERSION)) hugo: ifeq ($(HAS_HUGO), ) diff --git a/README.md b/README.md index d0f1cc7f1..382f4f409 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ Jenkins uses [plugins](https://plugins.jenkins.io/) like CasC to extend it's sol - Integration with Kubernetes ([Jenkins kubernetes-plugin](https://github.com/jenkinsci/kubernetes-plugin)) - Pipelines as Code ([Jenkins pipelines](https://jenkins.io/doc/book/pipeline/)) - Extensibility via Groovy Scripts (similar to [Jenkins script console](https://wiki.jenkins.io/display/JENKINS/Jenkins+Script+Console)) or ([configuration as code plugin](https://github.com/jenkinsci/configuration-as-code-plugin)) -- Secure Defaults and Hardening (see [the security section](https://jenkinsci.github.io/kubernetes-operator/docs/getting-started/latest/security/) of the documentation) +- Secure Defaults and Hardening (see [the security section](https://jenkinsci.github.io/kubernetes-operator/docs/security/) of the documentation) ## Problem statement and goals @@ -38,7 +38,7 @@ We want to make Jenkins more robust, suitable for dynamic and multi-tenant envir Some of the problems we want to solve: - [installing plugins with incompatible versions or security vulnerabilities](https://jenkinsci.github.io/kubernetes-operator/docs/getting-started/latest/customizing-jenkins/#install-plugins/) - [better configuration as code](https://jenkinsci.github.io/kubernetes-operator/docs/getting-started/latest/customizing-jenkins/) -- [security and hardening out of the box](https://jenkinsci.github.io/kubernetes-operator/docs/getting-started/latest/security/) +- [security and hardening out of the box](https://jenkinsci.github.io/kubernetes-operator/docs/security/) - [make errors more visible for end users](https://jenkinsci.github.io/kubernetes-operator/docs/troubleshooting/) - orphaned jobs with no JNLP connection - handle graceful shutdown properly @@ -51,7 +51,7 @@ Go to [**our documentation website**](https://jenkinsci.github.io/kubernetes-ope Selected content: 1. [How it works](https://jenkinsci.github.io/kubernetes-operator/docs/how-it-works/) 2. [Getting Started](https://jenkinsci.github.io/kubernetes-operator/docs/getting-started/) -3. [Security](https://jenkinsci.github.io/kubernetes-operator/docs/getting-started/latest/security/) +3. [Security](https://jenkinsci.github.io/kubernetes-operator/docs/security/) 4. [Troubleshooting](https://jenkinsci.github.io/kubernetes-operator/docs/troubleshooting/) 5. [Developer Guide](https://jenkinsci.github.io/kubernetes-operator/docs/developer-guide/) 6. [FAQ](https://jenkinsci.github.io/kubernetes-operator/docs/faq/) diff --git a/VERSION.txt b/VERSION.txt index 63f2359f6..ff2a3fbfe 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -v0.7.1 +v0.8.0-beta2 diff --git a/api/v1alpha2/jenkins_types.go b/api/v1alpha2/jenkins_types.go index b806902e6..0341e4211 100644 --- a/api/v1alpha2/jenkins_types.go +++ b/api/v1alpha2/jenkins_types.go @@ -351,19 +351,19 @@ type JenkinsMaster struct { // +optional // Defaults to : // - name: configuration-as-code - // version: "1346.ve8cfa_3473c94" + // version: "1625.v27444588cc3d" // - name: git - // version: "4.11.3" + // version: "5.0.0" // - name: job-dsl - // version: "1.78.1" + // version: "1.83" // - name: kubernetes - // version: "1.31.3" + // version: "3909.v1f2c633e8590" // - name: kubernetes-credentials-provider - // version: "0.20" + // version: "1.211.vc236a_f5a_2f3c" // - name: workflow-aggregator - // version: "2.6" + // version: "596.v8c21c963d92d" // - name: workflow-job - // version: "1145.v7f2433caa07f" + // version: "1289.vd1c337fd5354" BasePlugins []Plugin `json:"basePlugins,omitempty"` // Plugins contains plugins required by user @@ -448,6 +448,10 @@ type Service struct { // This field will be ignored if the cloud-provider does not support the feature. // +optional LoadBalancerIP string `json:"loadBalancerIP,omitempty"` + + // The port name which is provided to the service. + // More info: https://kubernetes.io/docs/concepts/services-networking/service/#defining-a-service + Portname string `json:"Portname,omitempty"` } // JenkinsStatus defines the observed state of Jenkins diff --git a/backup/pvc/Dockerfile b/backup/pvc/Dockerfile index 834c8c925..3b283e166 100644 --- a/backup/pvc/Dockerfile +++ b/backup/pvc/Dockerfile @@ -13,7 +13,10 @@ ARG GID ENV USER=user -RUN addgroup --gid "$GID" "$USER" && \ +RUN apt update \ + && apt install -y procps zstd \ + && rm -rf /var/lib/apt/lists/* \ + && addgroup --gid "$GID" "$USER" && \ adduser \ --disabled-password \ --gecos "" \ diff --git a/backup/pvc/Makefile b/backup/pvc/Makefile index d8ec544fb..3587d57d0 100644 --- a/backup/pvc/Makefile +++ b/backup/pvc/Makefile @@ -151,6 +151,7 @@ bump-version: sembump ## Bump the version in the version file. Set BUMP to [ pat echo $(NEW_VERSION) > VERSION.txt git add VERSION.txt git commit -avm "Bump backup PVC version to $(NEW_VERSION)" + rm $(PROJECT_DIR)/bin/sembump .PHONY: tag tag: ## Create a new git tag to prepare to build a release diff --git a/backup/pvc/VERSION.txt b/backup/pvc/VERSION.txt index f0cfd3bb6..f82e0685d 100644 --- a/backup/pvc/VERSION.txt +++ b/backup/pvc/VERSION.txt @@ -1 +1 @@ -v0.2.2 +v0.2.4 diff --git a/backup/pvc/bin/backup.sh b/backup/pvc/bin/backup.sh index ff9c9f637..fad869dac 100644 --- a/backup/pvc/bin/backup.sh +++ b/backup/pvc/bin/backup.sh @@ -6,21 +6,31 @@ set -eo pipefail [[ -z "${BACKUP_DIR}" ]] && echo "Required 'BACKUP_DIR' env not set" && exit 1; [[ -z "${JENKINS_HOME}" ]] && echo "Required 'JENKINS_HOME' env not set" && exit 1; BACKUP_TMP_DIR=$(mktemp -d) -trap "test -d "${BACKUP_TMP_DIR}" && rm -fr "${BACKUP_TMP_DIR}"" EXIT ERR SIGINT SIGTERM +trap "test -d "${BACKUP_TMP_DIR}" && rm -fr "${BACKUP_TMP_DIR}"" EXIT SIGINT SIGTERM backup_number=$1 echo "Running backup" -# config.xml in a job directory is a config file that shouldnt be backed up -# config.xml in child directores is state that should. For example- +# config.xml in a job directory is a config file that shouldn't be backed up +# config.xml in child directories is state that should. For example- # branches/myorg/branches/myrepo/branches/master/config.xml should be retained while # branches/myorg/config.xml should not -tar -C "${JENKINS_HOME}" -czf "${BACKUP_TMP_DIR}/${backup_number}.tar.gz" --exclude jobs/*/workspace* --no-wildcards-match-slash --anchored --exclude jobs/*/config.xml -c jobs && \ -mv "${BACKUP_TMP_DIR}/${backup_number}.tar.gz" "${BACKUP_DIR}/${backup_number}.tar.gz" +tar --zstd -C "${JENKINS_HOME}" -cf "${BACKUP_TMP_DIR}/${backup_number}.tar.zstd" \ + --exclude jobs/*/workspace* \ + --no-wildcards-match-slash --anchored \ + --ignore-failed-read \ + --exclude jobs/*/config.xml -c jobs || ret=$? -rm -rf "${BACKUP_TMP_DIR}" +if [[ "$ret" -eq 0 ]]; then + echo "Backup was completed without warnings" + mv "${BACKUP_TMP_DIR}/${backup_number}.tar.zstd" "${BACKUP_DIR}/${backup_number}.tar.zstd" +elif [[ "$ret" -eq 1 ]]; then + echo "Backup was completed with some warnings" + mv "${BACKUP_TMP_DIR}/${backup_number}.tar.zstd" "${BACKUP_DIR}/${backup_number}.tar.zstd" +fi -[[ ! -s ${BACKUP_DIR}/${backup_number}.tar.gz ]] && echo "backup file '${BACKUP_DIR}/${backup_number}.tar.gz' is empty" && exit 1; +rm -rf "${BACKUP_TMP_DIR}" +[[ ! -s ${BACKUP_DIR}/${backup_number}.tar.zstd ]] && echo "backup file '${BACKUP_DIR}/${backup_number}.tar.zstd' is empty" && exit 1; echo Done exit 0 diff --git a/backup/pvc/bin/get-latest.sh b/backup/pvc/bin/get-latest.sh index 2f418a5fc..5deba0633 100644 --- a/backup/pvc/bin/get-latest.sh +++ b/backup/pvc/bin/get-latest.sh @@ -4,7 +4,7 @@ set -eo pipefail [[ -z "${BACKUP_DIR}" ]] && echo "Required 'BACKUP_DIR' env not set" && exit 1 -latest=$(find ${BACKUP_DIR} -name '*.tar.gz' -exec basename {} \; | sort -g | tail -n 1) +latest=$(find ${BACKUP_DIR} -name '*.tar.zstd' -exec basename {} \; | sort -g | tail -n 1) if [[ "${latest}" == "" ]]; then echo "-1" diff --git a/backup/pvc/bin/restore.sh b/backup/pvc/bin/restore.sh index 5b6f504bc..994208d33 100644 --- a/backup/pvc/bin/restore.sh +++ b/backup/pvc/bin/restore.sh @@ -7,9 +7,23 @@ set -eo pipefail [[ -z "${JENKINS_HOME}" ]] && echo "Required 'JENKINS_HOME' env not set" && exit 1; backup_number=$1 +backup_file="${BACKUP_DIR}/${backup_number}" echo "Running restore backup with backup number #${backup_number}" -tar -C ${JENKINS_HOME} -zxf "${BACKUP_DIR}/${backup_number}.tar.gz" +if [[ -f "$backup_file.tar.gz" ]]; then + echo "Old format tar.gz found, restoring it" + OPTS="" + EXT="tar.gz" +elif [[ -f "$backup_file.tar.zstd" ]]; then + echo "Backup file found, proceeding" + OPTS="--zstd" + EXT="tar.zstd" +else + echo "ERR: Backup file not found: $backup_file" + exit 1 +fi + +tar $OPTS -C "${JENKINS_HOME}" -xf "${BACKUP_DIR}/${backup_number}.${EXT}" echo Done exit 0 diff --git a/backup/pvc/bin/run.sh b/backup/pvc/bin/run.sh index 8d83d111f..50123d5e2 100644 --- a/backup/pvc/bin/run.sh +++ b/backup/pvc/bin/run.sh @@ -10,7 +10,7 @@ do sleep 10 if [[ ! -z "${BACKUP_COUNT}" ]]; then echo "Trimming to only ${BACKUP_COUNT} recent backups in preparation for new backup" - #TODO: add the list of exceding backup before delete - find ${BACKUP_DIR} -maxdepth 1 -name '*.tar.gz' -exec basename {} \; | sort -gr | tail -n +$((BACKUP_COUNT +1)) | xargs -I '{}' rm ${BACKUP_DIR}/'{}' + #TODO: add the list of exceeding backup before delete + find ${BACKUP_DIR} -maxdepth 1 -name '*.tar.zstd' -exec basename {} \; | sort -gr | tail -n +$((BACKUP_COUNT +1)) | xargs -I '{}' rm ${BACKUP_DIR}/'{}' fi done diff --git a/backup/pvc/e2e/backup_and_restore/test.sh b/backup/pvc/e2e/backup_and_restore/test.sh index df5d1519e..e69901c5b 100755 --- a/backup/pvc/e2e/backup_and_restore/test.sh +++ b/backup/pvc/e2e/backup_and_restore/test.sh @@ -30,7 +30,7 @@ trap "docker rm -vf $cid > /dev/null;rm -rf ${BACKUP_DIR};rm -rf ${RESTORE_FOLDE backup_number=1 docker exec ${cid} /home/user/bin/backup.sh ${backup_number} -backup_file="${BACKUP_DIR}/${backup_number}.tar.gz" +backup_file="${BACKUP_DIR}/${backup_number}.tar.zstd" [[ ! -f ${backup_file} ]] && echo "Backup file ${backup_file} not found" && exit 1; docker exec ${cid} /bin/bash -c "JENKINS_HOME=${RESTORE_FOLDER};/home/user/bin/restore.sh ${backup_number}" @@ -38,4 +38,4 @@ docker exec ${cid} /bin/bash -c "JENKINS_HOME=${RESTORE_FOLDER};/home/user/bin/r echo "Compare directories" diff --brief --recursive "${RESTORE_FOLDER}" "${JENKINS_HOME_AFTER_RESTORE}" echo "Directories are the same" -echo PASS \ No newline at end of file +echo PASS diff --git a/backup/pvc/e2e/get-latest/test.sh b/backup/pvc/e2e/get-latest/test.sh index b9b228d48..a0aabe9a2 100755 --- a/backup/pvc/e2e/get-latest/test.sh +++ b/backup/pvc/e2e/get-latest/test.sh @@ -19,17 +19,17 @@ mkdir -p ${BACKUP_DIR} mkdir -p ${JENKINS_HOME} mkdir -p ${BACKUP_DIR}/lost+found -touch ${BACKUP_DIR}/1.tar.gz -touch ${BACKUP_DIR}/2.tar.gz -touch ${BACKUP_DIR}/3.tar.gz -touch ${BACKUP_DIR}/4.tar.gz -touch ${BACKUP_DIR}/5.tar.gz -touch ${BACKUP_DIR}/6.tar.gz -touch ${BACKUP_DIR}/7.tar.gz -touch ${BACKUP_DIR}/8.tar.gz -touch ${BACKUP_DIR}/9.tar.gz -touch ${BACKUP_DIR}/10.tar.gz -touch ${BACKUP_DIR}/11.tar.gz +touch ${BACKUP_DIR}/1.tar.zstd +touch ${BACKUP_DIR}/2.tar.zstd +touch ${BACKUP_DIR}/3.tar.zstd +touch ${BACKUP_DIR}/4.tar.zstd +touch ${BACKUP_DIR}/5.tar.zstd +touch ${BACKUP_DIR}/6.tar.zstd +touch ${BACKUP_DIR}/7.tar.zstd +touch ${BACKUP_DIR}/8.tar.zstd +touch ${BACKUP_DIR}/9.tar.zstd +touch ${BACKUP_DIR}/10.tar.zstd +touch ${BACKUP_DIR}/11.tar.zstd # Create an instance of the container under testing cid="$(docker run -e JENKINS_HOME=${JENKINS_HOME} -v ${JENKINS_HOME}:${JENKINS_HOME}:ro -e BACKUP_DIR=${BACKUP_DIR} -v ${BACKUP_DIR}:${BACKUP_DIR}:rw -d ${docker_image})" @@ -39,7 +39,7 @@ echo "Docker container ID '${cid}'" trap "docker rm -vf $cid > /dev/null;rm -rf ${BACKUP_DIR};rm -rf ${JENKINS_HOME}" EXIT latest=$(docker exec ${cid} /bin/bash -c "JENKINS_HOME=${RESTORE_FOLDER};/home/user/bin/get-latest.sh") -rm ${BACKUP_DIR}/*.tar.gz +rm ${BACKUP_DIR}/*.tar.zstd empty_latest=$(docker exec ${cid} /bin/bash -c "JENKINS_HOME=${RESTORE_FOLDER};/home/user/bin/get-latest.sh") if [[ "${DEBUG}" ]]; then diff --git a/backup/pvc/e2e/limit_backup_count/test.sh b/backup/pvc/e2e/limit_backup_count/test.sh index 7c4c66ee0..469b3e44c 100755 --- a/backup/pvc/e2e/limit_backup_count/test.sh +++ b/backup/pvc/e2e/limit_backup_count/test.sh @@ -19,17 +19,17 @@ mkdir -p ${BACKUP_DIR} mkdir -p ${JENKINS_HOME} mkdir -p ${BACKUP_DIR}/lost+found -touch ${BACKUP_DIR}/1.tar.gz -touch ${BACKUP_DIR}/2.tar.gz -touch ${BACKUP_DIR}/3.tar.gz -touch ${BACKUP_DIR}/4.tar.gz -touch ${BACKUP_DIR}/5.tar.gz -touch ${BACKUP_DIR}/6.tar.gz -touch ${BACKUP_DIR}/7.tar.gz -touch ${BACKUP_DIR}/8.tar.gz -touch ${BACKUP_DIR}/9.tar.gz -touch ${BACKUP_DIR}/10.tar.gz -touch ${BACKUP_DIR}/11.tar.gz +touch ${BACKUP_DIR}/1.tar.zstd +touch ${BACKUP_DIR}/2.tar.zstd +touch ${BACKUP_DIR}/3.tar.zstd +touch ${BACKUP_DIR}/4.tar.zstd +touch ${BACKUP_DIR}/5.tar.zstd +touch ${BACKUP_DIR}/6.tar.zstd +touch ${BACKUP_DIR}/7.tar.zstd +touch ${BACKUP_DIR}/8.tar.zstd +touch ${BACKUP_DIR}/9.tar.zstd +touch ${BACKUP_DIR}/10.tar.zstd +touch ${BACKUP_DIR}/11.tar.zstd # Create an instance of the container under testing cid="$(docker run -e BACKUP_COUNT=2 -e JENKINS_HOME=${JENKINS_HOME} -v ${JENKINS_HOME}:${JENKINS_HOME}:ro -e BACKUP_DIR=${BACKUP_DIR} -v ${BACKUP_DIR}:${BACKUP_DIR}:rw -d ${docker_image})" @@ -39,7 +39,7 @@ echo "Docker container ID '${cid}'" trap "docker rm -vf $cid > /dev/null;rm -rf ${BACKUP_DIR};rm -rf ${JENKINS_HOME}" EXIT sleep 11 -touch ${BACKUP_DIR}/12.tar.gz +touch ${BACKUP_DIR}/12.tar.zstd sleep 11 if [[ "${DEBUG}" ]]; then @@ -48,7 +48,7 @@ if [[ "${DEBUG}" ]]; then fi # only two latest backup should exists -[[ $(ls -1 ${BACKUP_DIR} | grep 'tar.gz' | wc -l) -eq 2 ]] || exit 1 -[[ -f ${BACKUP_DIR}/11.tar.gz ]] || exit 2 -[[ -f ${BACKUP_DIR}/12.tar.gz ]] || exit 3 +[[ $(ls -1 ${BACKUP_DIR} | grep 'tar.zstd' | wc -l) -eq 2 ]] || exit 1 +[[ -f ${BACKUP_DIR}/11.tar.zstd ]] || exit 2 +[[ -f ${BACKUP_DIR}/12.tar.zstd ]] || exit 3 echo PASS diff --git a/backup/pvc/e2e/tmp_dir_clean_after_backup_creation/test.sh b/backup/pvc/e2e/tmp_dir_clean_after_backup_creation/test.sh index 7b963357e..662809c89 100755 --- a/backup/pvc/e2e/tmp_dir_clean_after_backup_creation/test.sh +++ b/backup/pvc/e2e/tmp_dir_clean_after_backup_creation/test.sh @@ -29,8 +29,8 @@ docker exec ${cid} /home/user/bin/backup.sh ${backup_number} [ "$(docker exec ${cid} ls /tmp | grep 'tmp')" ] && echo "tmp directory not empty" && exit 1; -backup_file="${BACKUP_DIR}/${backup_number}.tar.gz" +backup_file="${BACKUP_DIR}/${backup_number}.tar.zstd" [[ ! -f ${backup_file} ]] && echo "Backup file ${backup_file} not found" && exit 1; echo "tmp directory empty, backup in backup directory present" -echo PASS \ No newline at end of file +echo PASS diff --git a/chart/index.yaml b/chart/index.yaml index 803837f18..8d08b0efd 100644 --- a/chart/index.yaml +++ b/chart/index.yaml @@ -1,6 +1,21 @@ apiVersion: v1 entries: jenkins-operator: + - apiVersion: v2 + appVersion: v0.8.0-beta + created: "2023-04-17T22:11:04.706959723Z" + dependencies: + - condition: webhook.enabled + name: cert-manager + repository: https://charts.jetstack.io + version: 1.5.1 + description: Kubernetes native operator which fully manages Jenkins on Kubernetes + digest: 4855dc0c673a1b3b4cd7ee502029c3d995f243a9a7051ad03d29def7c48a7c11 + icon: https://raw.githubusercontent.com/jenkinsci/kubernetes-operator/master/assets/jenkins-operator-icon.png + name: jenkins-operator + urls: + - https://raw.githubusercontent.com/jenkinsci/kubernetes-operator/master/chart/jenkins-operator/jenkins-operator-v0.8.0-beta.tgz + version: v0.8.0-beta - apiVersion: v2 appVersion: 0.7.1 created: "2022-06-22T15:47:45.014723169Z" @@ -333,4 +348,4 @@ entries: urls: - https://raw.githubusercontent.com/jenkinsci/kubernetes-operator/master/chart/jenkins-operator/jenkins-operator-0.0.1.tgz version: 0.0.1 -generated: "2022-06-22T15:47:44.995217822Z" +generated: "2023-04-17T22:11:04.68789848Z" diff --git a/chart/jenkins-operator/Chart.yaml b/chart/jenkins-operator/Chart.yaml index 706bad608..da1138653 100644 --- a/chart/jenkins-operator/Chart.yaml +++ b/chart/jenkins-operator/Chart.yaml @@ -1,8 +1,8 @@ apiVersion: v2 -appVersion: "0.7.1" +appVersion: "v0.8.0-beta" description: Kubernetes native operator which fully manages Jenkins on Kubernetes name: jenkins-operator -version: 0.6.2 +version: v0.8.0-beta icon: https://raw.githubusercontent.com/jenkinsci/kubernetes-operator/master/assets/jenkins-operator-icon.png dependencies: - name: cert-manager diff --git a/chart/jenkins-operator/README.md b/chart/jenkins-operator/README.md index 5d3006a21..857b8b529 100644 --- a/chart/jenkins-operator/README.md +++ b/chart/jenkins-operator/README.md @@ -1,6 +1,6 @@ # jenkins-operator -![Version: 0.6.2](https://img.shields.io/badge/Version-0.6.2-informational?style=flat-square) ![AppVersion: 0.7.1](https://img.shields.io/badge/AppVersion-0.7.1-informational?style=flat-square) +![Version: v0.8.0-beta](https://img.shields.io/badge/Version-v0.8.0--beta-informational?style=flat-square) ![AppVersion: v0.8.0-beta](https://img.shields.io/badge/AppVersion-v0.8.0--beta-informational?style=flat-square) Kubernetes native operator which fully manages Jenkins on Kubernetes @@ -52,7 +52,7 @@ Kubernetes native operator which fully manages Jenkins on Kubernetes | jenkins.enabled | bool | `true` | | | jenkins.env | list | `[]` | | | jenkins.hostAliases | object | `{}` | | -| jenkins.image | string | `"jenkins/jenkins:2.387.1-lts"` | | +| jenkins.image | string | `"jenkins/jenkins:2.387.3-lts"` | | | jenkins.imagePullPolicy | string | `"Always"` | | | jenkins.imagePullSecrets | list | `[]` | | | jenkins.labels | object | `{}` | | @@ -88,13 +88,14 @@ Kubernetes native operator which fully manages Jenkins on Kubernetes | jenkins.seedJobAgentImage | string | `""` | | | jenkins.seedJobs | list | `[]` | | | jenkins.serviceAccount.annotations | object | `{}` | | +| jenkins.tolerations | list | `[]` | | | jenkins.validateSecurityWarnings | bool | `false` | | | jenkins.volumeMounts | list | `[]` | | | jenkins.volumes[0].name | string | `"backup"` | | | jenkins.volumes[0].persistentVolumeClaim.claimName | string | `"jenkins-backup"` | | | operator.affinity | object | `{}` | | | operator.fullnameOverride | string | `""` | | -| operator.image | string | `"quay.io/jenkins-kubernetes-operator/operator:9fd053b"` | | +| operator.image | string | `"quay.io/jenkins-kubernetes-operator/operator:v0.8.0-beta"` | | | operator.imagePullPolicy | string | `"IfNotPresent"` | | | operator.imagePullSecrets | list | `[]` | | | operator.nameOverride | string | `""` | | diff --git a/chart/jenkins-operator/crds/jenkins-crd.yaml b/chart/jenkins-operator/crds/jenkins-crd.yaml index b00bb4f47..84b0dff4a 100644 --- a/chart/jenkins-operator/crds/jenkins-crd.yaml +++ b/chart/jenkins-operator/crds/jenkins-crd.yaml @@ -3243,6 +3243,9 @@ spec: info: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies' format: int32 type: integer + portName: + description: 'The port name which is provided to the service. More info: https://kubernetes.io/docs/concepts/services-networking/service/#defining-a-service' + type: string type: description: 'Type determines how the Service is exposed. Defaults to ClusterIP. Valid options are ExternalName, ClusterIP, NodePort, diff --git a/chart/jenkins-operator/jenkins-operator-v0.8.0-beta.tgz b/chart/jenkins-operator/jenkins-operator-v0.8.0-beta.tgz new file mode 100644 index 000000000..f2ecf11a8 Binary files /dev/null and b/chart/jenkins-operator/jenkins-operator-v0.8.0-beta.tgz differ diff --git a/chart/jenkins-operator/templates/jenkins.yaml b/chart/jenkins-operator/templates/jenkins.yaml index 1ce3b0cc4..c4d39b765 100644 --- a/chart/jenkins-operator/templates/jenkins.yaml +++ b/chart/jenkins-operator/templates/jenkins.yaml @@ -95,6 +95,9 @@ spec: {{- with .Values.jenkins.nodeSelector }} nodeSelector: {{ toYaml . | nindent 6 }} {{- end }} + {{- with .Values.jenkins.tolerations }} + tolerations: {{ toYaml . | nindent 6 }} + {{- end }} {{- with .Values.jenkins.annotations }} annotations: {{ toYaml . | nindent 6 }} {{- end }} diff --git a/chart/jenkins-operator/values.yaml b/chart/jenkins-operator/values.yaml index 11317378e..1a13e6ead 100644 --- a/chart/jenkins-operator/values.yaml +++ b/chart/jenkins-operator/values.yaml @@ -27,13 +27,16 @@ jenkins: # nodeSelector are injected into metadata nodeSelector field nodeSelector: {} + # tolerations are injected into metadata tolerations field + tolerations: [] + # annotations are injected into metadata annotations field annotations: {} # image is the name (and tag) of the Jenkins instance # Default: jenkins/jenkins:lts # It's recommended to use LTS (tag: "lts") version - image: jenkins/jenkins:2.387.1-lts + image: jenkins/jenkins:2.401.1-lts # env contains jenkins container environment variables env: [] @@ -69,7 +72,7 @@ jenkins: # See https://jenkinsci.github.io/kubernetes-operator/docs/getting-started/latest/configuration/#pulling-docker-images-from-private-repositories for more info imagePullSecrets: [] - # notifications is feature that notify user about Jenkins reconcilation status + # notifications is feature that notify user about Jenkins reconciliation status # See https://jenkinsci.github.io/kubernetes-operator/docs/getting-started/latest/notifications/ for more info notifications: [] @@ -87,19 +90,19 @@ jenkins: # # basePlugins: # - name: kubernetes - # version: 3896.v19b_160fd9589 + # version: 3937.vd7b_82db_e347b_ # - name: workflow-job - # version: 1284.v2fe8ed4573d4 + # version: 1308.v58d48a_763b_31 # - name: workflow-aggregator # version: 596.v8c21c963d92d # - name: git - # version: 5.0.0 + # version: 5.0.2 # - name: job-dsl - # version: "1.82" + # version: "1.84" # - name: configuration-as-code - # version: 1569.vb_72405b_80249 + # version: 1647.ve39ca_b_829b_42 # - name: kubernetes-credentials-provider - # version: 1.209.v862c6e5fb_1ef + # version: 1.211.vc236a_f5a_2f3c basePlugins: [] @@ -166,6 +169,8 @@ jenkins: runAsUser: 1000 fsGroup: 1000 + service: + portName: 'http' # http Jenkins service # See https://jenkinsci.github.io/kubernetes-operator/docs/getting-started/latest/schema/#github.com/jenkinsci/kubernetes-operator/pkg/apis/jenkins/v1alpha2.Service for details #service: @@ -207,7 +212,7 @@ jenkins: # image used by backup feature # By default using prebuilt backup PVC image - image: quay.io/jenkins-kubernetes-operator/backup-pvc:v0.2.1 + image: quay.io/jenkins-kubernetes-operator/backup-pvc:v0.2.5 # containerName is backup container name containerName: backup @@ -291,7 +296,7 @@ operator: replicaCount: 1 # image is the name (and tag) of the Jenkins Operator image - image: quay.io/jenkins-kubernetes-operator/operator:9fd053b + image: quay.io/jenkins-kubernetes-operator/operator:v0.8.0-beta2 # imagePullPolicy defines policy for pulling images imagePullPolicy: IfNotPresent diff --git a/config.base.env b/config.base.env index b78b3937a..9c4ef8a3f 100644 --- a/config.base.env +++ b/config.base.env @@ -13,5 +13,5 @@ GEN_CRD_API=gen-crd-api-reference-docs IMAGE_PULL_MODE=local HELM_VERSION=3.1.2 CLUSTER_DOMAIN=cluster.local -LATEST_LTS_VERSION=2.387.1 +LATEST_LTS_VERSION=2.401.1 KIND_CLUSTER_NAME=jenkins diff --git a/config/crd/bases/jenkins.io_jenkins.yaml b/config/crd/bases/jenkins.io_jenkins.yaml index b00bb4f47..84b0dff4a 100644 --- a/config/crd/bases/jenkins.io_jenkins.yaml +++ b/config/crd/bases/jenkins.io_jenkins.yaml @@ -3243,6 +3243,9 @@ spec: info: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies' format: int32 type: integer + portName: + description: 'The port name which is provided to the service. More info: https://kubernetes.io/docs/concepts/services-networking/service/#defining-a-service' + type: string type: description: 'Type determines how the Service is exposed. Defaults to ClusterIP. Valid options are ExternalName, ClusterIP, NodePort, diff --git a/docs/docs/developer-guide/index.html b/docs/docs/developer-guide/index.html index 7a5948223..4cc8bcdf0 100644 --- a/docs/docs/developer-guide/index.html +++ b/docs/docs/developer-guide/index.html @@ -51,7 +51,7 @@