Skip to content

Commit

Permalink
Merge pull request #3925 from ty-dc/fix/uninstall-with-sriov
Browse files Browse the repository at this point in the history
fix: cannot uninstall spiderpool when sriovOperatorConfig is installed
  • Loading branch information
ty-dc authored Sep 5, 2024
2 parents d40560b + 973dafe commit b64851c
Show file tree
Hide file tree
Showing 11 changed files with 269 additions and 161 deletions.
50 changes: 37 additions & 13 deletions .github/workflows/e2e-init.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -205,22 +205,10 @@ jobs:
path: e2ereport.json
retention-days: 1

- name: uninstalls spiderpool
id: clean
if: ${{ inputs.run_e2e == 'true' }}
run: |
RESULT=0
make clean_e2e_spiderpool || RESULT=1
if ((RESULT==0)) ; then
echo "CLEAN_E2E_PASS=true" >> $GITHUB_ENV
else
echo "CLEAN_E2E_PASS=false" >> $GITHUB_ENV
fi
- name: Show e2e Result
if: ${{ inputs.run_e2e == 'true' }}
run: |
if ${{ env.RUN_E2E_PASS == 'true' && env.CLEAN_E2E_PASS == 'true' }} ;then
if ${{ env.RUN_E2E_PASS == 'true' }} ;then
exit 0
else
exit 1
Expand Down Expand Up @@ -249,3 +237,39 @@ jobs:
label: performance
message: ${{ env.PERFORMANCE_RESULT }}
color: lightgrey

- name: Uninstall Spiderpool
if: ${{ inputs.run_e2e == 'true' }}
run: |
RESULT=0
make clean_e2e_spiderpool || RESULT=1
if ((RESULT==0)) ; then
echo "UNINSTALL_E2E_PASS=true" >> $GITHUB_ENV
echo "succeeded to uninstall spiderpool"
else
echo "UNINSTALL_E2E_PASS=false" >> $GITHUB_ENV
echo "failed to uninstall spiderpool"
fi
if [ -f "test/e2e-uninstall-debugLog.txt" ] ; then
echo "UPLOAD_UNINSTALL_E2E_LOG=true" >> $GITHUB_ENV
else
echo "UPLOAD_UNINSTALL_E2E_LOG=false" >> $GITHUB_ENV
fi
- name: Upload Uninstall Spiderpool e2e log
if: ${{ env.UNINSTALL_E2E_PASS == 'false' && env.UPLOAD_UNINSTALL_E2E_LOG == 'true' }}
uses: actions/upload-artifact@v3.1.3
with:
name: ${{ inputs.os }}-${{ inputs.ip_family }}-${{ matrix.e2e_test_mode }}-${{ inputs.k8s_version }}-uninstall-debugLog.txt
path: test/e2e-uninstall-debugLog.txt
retention-days: 7

- name: Show uninstall e2e Result
if: ${{ inputs.run_e2e == 'true' }}
run: |
if ${{ env.UNINSTALL_E2E_PASS == 'true' }} ;then
exit 0
else
exit 1
fi
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -430,11 +430,11 @@ clean: clean_e2e

.PHONY: clean_e2e_spiderpool
clean_e2e_spiderpool:
-$(QUIET) make -C test uninstall_spiderpool
$(QUIET) make -C test uninstall_spiderpool

.PHONY: upgrade_e2e_spiderpool
upgrade_e2e_spiderpool:
-$(QUIET) make -C test upgrade_spiderpool
$(QUIET) make -C test upgrade_spiderpool

.PHONY: codegen
codegen:
Expand Down
6 changes: 5 additions & 1 deletion charts/spiderpool/templates/deleteHook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
name: {{ .Values.spiderpoolController.name | trunc 48 | trimSuffix "-" }}-hook-pre-delete
annotations:
"helm.sh/hook": pre-delete
"helm.sh/hook-delete-policy": hook-succeeded,hook-failed
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
spec:
template:
spec:
Expand All @@ -22,6 +22,10 @@ spec:
- --mutating
- {{ .Values.spiderpoolController.name | trunc 63 | trimSuffix "-" }}
env:
- name: SPIDERPOOL_POD_NAMESPACE
value: {{ .Release.Namespace | quote }}
- name: SPIDERPOOL_INIT_NAME
value: {{ .Values.spiderpoolInit.name | trunc 63 | trimSuffix "-" | quote }}
- name: SPIDERPOOL_POD_NAME
valueFrom:
fieldRef:
Expand Down
2 changes: 2 additions & 0 deletions charts/spiderpool/templates/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ rules:
- mutatingwebhookconfigurations
- validatingwebhookconfigurations
verbs:
- delete
- get
- list
- watch
Expand Down Expand Up @@ -88,6 +89,7 @@ rules:
- cronjobs
- jobs
verbs:
- delete
- get
- list
- update
Expand Down
Loading

0 comments on commit b64851c

Please sign in to comment.