Skip to content

Commit

Permalink
add delete migration job && update j2 template
Browse files Browse the repository at this point in the history
Signed-off-by: Wenhao Zhou <wenhaozhou@yunify.com>
  • Loading branch information
zhou1203 committed Oct 13, 2022
1 parent 8189ccc commit 362157d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
20 changes: 17 additions & 3 deletions roles/ks-core/ks-core/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,24 @@
# register: source_state
# failed_when: "source_state.stderr and 'already exists' not in source_state.stderr"

- name: KubeSphere | Creating manifests
template:
src: "{{ item.file }}.j2"
dest: "{{ kubesphere_dir }}/{{ item.file }}"
with_items:
- { path: ks-core, file: ks-upgrade.yaml }

- name: Kubesphere | Checking Users Manger and Workspaces Manger
shell:
{{ bin_dir }}/kubectl get globalroles.iam.kubesphere.io users-manager workspaces-manager --no-header | wc -l
register: manager_result
shell: >
{{ bin_dir }}/kubectl get globalroles.iam.kubesphere.io users-manager workspaces-manager --no-headers | wc -l
register: manager_result

- name: Kubesphere | Checking migration job
shell: >
{{ bin_dir }}/kubectl delete -f {{ kubesphere_dir }}/ks-upgrade.yaml
when:
- manager_result.stdout != "0"
failed_when: false

- name: KubeSphere | Creating migration job
shell: >
Expand Down
2 changes: 1 addition & 1 deletion roles/ks-migration/templates/ks-upgrade.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
namespace: kubesphere-system
labels:
job: ks-upgrade
version: v3.0.0
version: v3.3.1
spec:
template:
spec:
Expand Down

0 comments on commit 362157d

Please sign in to comment.