From 0d24d957744d1aac1f7a35e01e9635cd662562e7 Mon Sep 17 00:00:00 2001 From: Sonali Rajput Date: Tue, 4 Apr 2023 18:13:07 +0000 Subject: [PATCH 01/21] Add port name in the service --- api/v1alpha2/jenkins_types.go | 4 ++++ chart/jenkins-operator/crds/jenkins-crd.yaml | 3 +++ chart/jenkins-operator/values.yaml | 2 ++ config/crd/bases/jenkins.io_jenkins.yaml | 3 +++ 4 files changed, 12 insertions(+) diff --git a/api/v1alpha2/jenkins_types.go b/api/v1alpha2/jenkins_types.go index b806902e6..26a7c2bca 100644 --- a/api/v1alpha2/jenkins_types.go +++ b/api/v1alpha2/jenkins_types.go @@ -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/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/values.yaml b/chart/jenkins-operator/values.yaml index 11317378e..2ffc818b9 100644 --- a/chart/jenkins-operator/values.yaml +++ b/chart/jenkins-operator/values.yaml @@ -166,6 +166,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: 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, From 67ecd35462673f424240f12d052bbdd78f0132b6 Mon Sep 17 00:00:00 2001 From: Sonali Rajput Date: Sun, 23 Apr 2023 06:29:08 +0000 Subject: [PATCH 02/21] Add default port name for service --- pkg/configuration/base/resources/service.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/configuration/base/resources/service.go b/pkg/configuration/base/resources/service.go index a11fe9f1e..9249f5384 100644 --- a/pkg/configuration/base/resources/service.go +++ b/pkg/configuration/base/resources/service.go @@ -31,6 +31,7 @@ func UpdateService(actual corev1.Service, config v1alpha2.Service, targetPort in } actual.Spec.Ports[0].Port = config.Port actual.Spec.Ports[0].TargetPort = intstr.IntOrString{IntVal: targetPort, Type: intstr.Int} + actual.Spec.Ports[0].Name = config.Portname if config.NodePort != 0 { actual.Spec.Ports[0].NodePort = config.NodePort } From 4dabb6074bce754bba7cc3030bce63597240941c Mon Sep 17 00:00:00 2001 From: Sonali Rajput Date: Thu, 4 May 2023 09:56:31 +0000 Subject: [PATCH 03/21] Update service for default port name --- pkg/configuration/base/resources/service.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/configuration/base/resources/service.go b/pkg/configuration/base/resources/service.go index 9249f5384..928ddac5e 100644 --- a/pkg/configuration/base/resources/service.go +++ b/pkg/configuration/base/resources/service.go @@ -31,7 +31,11 @@ func UpdateService(actual corev1.Service, config v1alpha2.Service, targetPort in } actual.Spec.Ports[0].Port = config.Port actual.Spec.Ports[0].TargetPort = intstr.IntOrString{IntVal: targetPort, Type: intstr.Int} - actual.Spec.Ports[0].Name = config.Portname + if config.Portname == "" { + actual.Spec.Ports[0].Name = "http" + } else { + actual.Spec.Ports[0].Name = config.Portname + } if config.NodePort != 0 { actual.Spec.Ports[0].NodePort = config.NodePort } From 9f82b5e7aece315cf9c2ae4739545191508b004e Mon Sep 17 00:00:00 2001 From: Luigi Operoso <40476330+brokenpip3@users.noreply.github.com> Date: Thu, 13 Apr 2023 23:22:22 +0200 Subject: [PATCH 04/21] chore: update to 2.387.2-lts and base plugins (#811) --- api/v1alpha2/jenkins_types.go | 14 +++++++------- chart/jenkins-operator/README.md | 2 +- chart/jenkins-operator/values.yaml | 12 ++++++------ config.base.env | 2 +- pkg/plugins/base_plugins.go | 10 +++++----- test/e2e/configuration_test.go | 10 +++++----- test/e2e/test_utility.go | 2 +- test/helm/helm_test.go | 2 +- 8 files changed, 27 insertions(+), 27 deletions(-) diff --git a/api/v1alpha2/jenkins_types.go b/api/v1alpha2/jenkins_types.go index 26a7c2bca..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 diff --git a/chart/jenkins-operator/README.md b/chart/jenkins-operator/README.md index 5d3006a21..92a25755c 100644 --- a/chart/jenkins-operator/README.md +++ b/chart/jenkins-operator/README.md @@ -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.2-lts"` | | | jenkins.imagePullPolicy | string | `"Always"` | | | jenkins.imagePullSecrets | list | `[]` | | | jenkins.labels | object | `{}` | | diff --git a/chart/jenkins-operator/values.yaml b/chart/jenkins-operator/values.yaml index 2ffc818b9..5c239cde3 100644 --- a/chart/jenkins-operator/values.yaml +++ b/chart/jenkins-operator/values.yaml @@ -33,7 +33,7 @@ jenkins: # 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.387.2-lts # env contains jenkins container environment variables env: [] @@ -87,19 +87,19 @@ jenkins: # # basePlugins: # - name: kubernetes - # version: 3896.v19b_160fd9589 + # version: 3909.v1f2c633e8590 # - name: workflow-job - # version: 1284.v2fe8ed4573d4 + # version: 1289.vd1c337fd5354 # - name: workflow-aggregator # version: 596.v8c21c963d92d # - name: git # version: 5.0.0 # - name: job-dsl - # version: "1.82" + # version: "1.83" # - name: configuration-as-code - # version: 1569.vb_72405b_80249 + # version: 1625.v27444588cc3d # - name: kubernetes-credentials-provider - # version: 1.209.v862c6e5fb_1ef + # version: 1.211.vc236a_f5a_2f3c basePlugins: [] diff --git a/config.base.env b/config.base.env index b78b3937a..78c45675c 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.387.2 KIND_CLUSTER_NAME=jenkins diff --git a/pkg/plugins/base_plugins.go b/pkg/plugins/base_plugins.go index 65eaceb85..40f9948a3 100644 --- a/pkg/plugins/base_plugins.go +++ b/pkg/plugins/base_plugins.go @@ -1,13 +1,13 @@ package plugins const ( - configurationAsCodePlugin = "configuration-as-code:1569.vb_72405b_80249" + configurationAsCodePlugin = "configuration-as-code:1625.v27444588cc3d" gitPlugin = "git:5.0.0" - jobDslPlugin = "job-dsl:1.82" - kubernetesPlugin = "kubernetes:3896.v19b_160fd9589" - kubernetesCredentialsProviderPlugin = "kubernetes-credentials-provider:1.209.v862c6e5fb_1ef" + jobDslPlugin = "job-dsl:1.83" + kubernetesPlugin = "kubernetes:3909.v1f2c633e8590" + kubernetesCredentialsProviderPlugin = "kubernetes-credentials-provider:1.211.vc236a_f5a_2f3c" workflowAggregatorPlugin = "workflow-aggregator:596.v8c21c963d92d" - workflowJobPlugin = "workflow-job:1284.v2fe8ed4573d4" + workflowJobPlugin = "workflow-job:1289.vd1c337fd5354" ) // basePluginsList contains plugins to install by operator. diff --git a/test/e2e/configuration_test.go b/test/e2e/configuration_test.go index 854536509..04b5ee735 100644 --- a/test/e2e/configuration_test.go +++ b/test/e2e/configuration_test.go @@ -24,13 +24,13 @@ import ( const e2e = "e2e" var expectedBasePluginsList = []plugins.Plugin{ - plugins.Must(plugins.New("configuration-as-code:1569.vb_72405b_80249")), + plugins.Must(plugins.New("configuration-as-code:1625.v27444588cc3d")), plugins.Must(plugins.New("git:5.0.0")), - plugins.Must(plugins.New("kubernetes:3896.v19b_160fd9589")), - plugins.Must(plugins.New("kubernetes-credentials-provider:1.209.v862c6e5fb_1ef")), - plugins.Must(plugins.New("job-dsl:1.82")), + plugins.Must(plugins.New("kubernetes:3909.v1f2c633e8590")), + plugins.Must(plugins.New("kubernetes-credentials-provider:1.211.vc236a_f5a_2f3c")), + plugins.Must(plugins.New("job-dsl:1.83")), plugins.Must(plugins.New("workflow-aggregator:596.v8c21c963d92d")), - plugins.Must(plugins.New("workflow-job:1284.v2fe8ed4573d4")), + plugins.Must(plugins.New("workflow-job:1289.vd1c337fd5354")), } func createUserConfigurationSecret(namespace string, stringData map[string]string) { diff --git a/test/e2e/test_utility.go b/test/e2e/test_utility.go index b54525644..2db6fae82 100644 --- a/test/e2e/test_utility.go +++ b/test/e2e/test_utility.go @@ -21,7 +21,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/envtest" ) -const JenkinsTestImage = "jenkins/jenkins:2.387.1-lts" +const JenkinsTestImage = "jenkins/jenkins:2.387.2-lts" var ( Cfg *rest.Config diff --git a/test/helm/helm_test.go b/test/helm/helm_test.go index a8206b301..185d98b94 100644 --- a/test/helm/helm_test.go +++ b/test/helm/helm_test.go @@ -47,7 +47,7 @@ var _ = Describe("Jenkins Controller", func() { cmd := exec.Command("../../bin/helm", "upgrade", "jenkins", "../../chart/jenkins-operator", "--namespace", namespace.Name, "--debug", "--set-string", fmt.Sprintf("jenkins.namespace=%s", namespace.Name), - "--set-string", fmt.Sprintf("jenkins.image=%s", "jenkins/jenkins:2.387.1-lts"), + "--set-string", fmt.Sprintf("jenkins.image=%s", "jenkins/jenkins:2.387.2-lts"), "--set-string", fmt.Sprintf("operator.image=%s", *imageName), "--install") output, err := cmd.CombinedOutput() Expect(err).NotTo(HaveOccurred(), string(output)) From 5323e2b4e0ce258e771f99aa0ca2543bf76fb6fc Mon Sep 17 00:00:00 2001 From: Luigi Operoso <40476330+brokenpip3@users.noreply.github.com> Date: Tue, 18 Apr 2023 00:01:07 +0200 Subject: [PATCH 05/21] chore: bump version to v0.8.0-beta (#814) - add dependabot - add codespell - update operator version in helm chart --- .github/dependabot.yml | 14 + .github/workflows/auto-codespell.yml | 21 + VERSION.txt | 2 +- backup/pvc/bin/backup.sh | 4 +- backup/pvc/bin/run.sh | 2 +- chart/jenkins-operator/README.md | 2 +- chart/jenkins-operator/values.yaml | 4 +- docs/docs/developer-guide/index.html | 1346 ++++++++--------- docs/docs/getting-started/latest/index.xml | 176 +-- .../latest/installing-the-operator/index.html | 990 ++++++------ .../v0.1.x/deploy-jenkins/index.html | 962 ++++++------ docs/docs/getting-started/v0.1.x/index.xml | 100 +- docs/docs/getting-started/v0.2.x/index.xml | 126 +- .../v0.2.x/migration/index.html | 964 ++++++------ docs/docs/getting-started/v0.6.x/index.xml | 176 +-- .../v0.6.x/installing-the-operator/index.html | 988 ++++++------ docs/docs/index.xml | 618 ++++---- test/e2e/configuration_test.go | 2 +- test/e2e/logging.go | 2 +- test/e2e/port_forward_test.go | 2 +- .../latest/installing-the-operator.md | 43 +- .../Getting Started/v0.1.x/deploy-jenkins.md | 2 +- .../docs/Getting Started/v0.2.x/migration.md | 18 +- .../v0.6.x/installing-the-operator.md | 36 +- 24 files changed, 3317 insertions(+), 3283 deletions(-) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/auto-codespell.yml 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/VERSION.txt b/VERSION.txt index 63f2359f6..bd0a7375b 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -v0.7.1 +v0.8.0-beta diff --git a/backup/pvc/bin/backup.sh b/backup/pvc/bin/backup.sh index ff9c9f637..74f32f88e 100644 --- a/backup/pvc/bin/backup.sh +++ b/backup/pvc/bin/backup.sh @@ -11,8 +11,8 @@ trap "test -d "${BACKUP_TMP_DIR}" && rm -fr "${BACKUP_TMP_DIR}"" EXIT ERR SIGINT 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 && \ diff --git a/backup/pvc/bin/run.sh b/backup/pvc/bin/run.sh index 8d83d111f..d764c6965 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 + #TODO: add the list of exceeding 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}/'{}' fi done diff --git a/chart/jenkins-operator/README.md b/chart/jenkins-operator/README.md index 92a25755c..b18782966 100644 --- a/chart/jenkins-operator/README.md +++ b/chart/jenkins-operator/README.md @@ -94,7 +94,7 @@ Kubernetes native operator which fully manages Jenkins on Kubernetes | 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/values.yaml b/chart/jenkins-operator/values.yaml index 5c239cde3..bd363f113 100644 --- a/chart/jenkins-operator/values.yaml +++ b/chart/jenkins-operator/values.yaml @@ -69,7 +69,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: [] @@ -293,7 +293,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-beta # imagePullPolicy defines policy for pulling images imagePullPolicy: IfNotPresent 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 @@
- +