Skip to content

Fix Job migrate upgrade failed

What this PR dose?

  • Delete Job migrate before executing command helm upgrade. Because 'helm upgrade' will try to update immutable fields of Job, which is not allowed.
  • Refine existing PVC named ks-jenkins check. If PVC named ks-jenkins exists, we will use it for devops-jenkins deployment. If not, we will use devops-jenkins as name of PVC by default.

Which issue dose this PR fix?

Fix #1701 (closed)

Steps to test

I built a docker image for test:

  • johnniang/ks-installer:bug-helm-upgrade-after-v3.2-dev
  1. Install KubeSphere with version nightly-latest by using ks.

    ks install kk --components devops --version nightly-latest --zone=""
  2. Remove status of DevOps in ClusterConfiguration ks-installer

    kubectl patch -nkubesphere-system cc ks-installer --type=json -p='[{"op": "remove", "path": "/status/devops"}]'
  3. Replace image of ks-installer

    kubectl patch -nkubesphere-system deployment ks-installer --type=merge -p='[{"op": "replace", "path": "/spec/template/spec/containers/0/image"}, "value": "johnniang/ks-installer:bug-helm-upgrade-after-v3.2-dev"]'
  4. Wait for upgrading

    kubectl logs -n kubesphere-system deploy/ks-installer -f

/kind bug /area devops /cc @kubesphere/sig-installation /cc @kubesphere/sig-devops /cc @zryfish

合并请求报告