|
4 | 4 | pull_request: |
5 | 5 |
|
6 | 6 | jobs: |
7 | | - test-operator: |
8 | | - name: operator chart |
| 7 | + test-helm: |
| 8 | + name: helm charts |
9 | 9 | runs-on: ubuntu-latest |
10 | 10 | steps: |
11 | 11 | - name: Clone the code |
@@ -39,25 +39,55 @@ jobs: |
39 | 39 | run: | |
40 | 40 | make docker-build |
41 | 41 |
|
42 | | - - name: Install Helm |
| 42 | + - name: Install helm |
43 | 43 | run: | |
44 | 44 | curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash |
45 | 45 |
|
46 | | - - name: Verify Helm installation |
| 46 | + - name: Verify helm installation |
47 | 47 | run: helm version |
48 | 48 |
|
49 | | - - name: Lint Helm Chart |
| 49 | + - name: Lint operator helm chart |
50 | 50 | run: | |
51 | 51 | helm lint ./deploy/charts/ceph-csi-operator |
52 | 52 |
|
53 | | - - name: Install Helm chart for project |
| 53 | + - name: Install operator helm chart |
54 | 54 | run: | |
55 | | - helm install my-release ./deploy/charts/ceph-csi-operator --create-namespace --namespace ceph-csi-operator-system |
| 55 | + helm install csi-operator ./deploy/charts/ceph-csi-operator --create-namespace --namespace ceph-csi-operator-system |
56 | 56 |
|
57 | | - - name: Check Helm release status |
| 57 | + - name: Check operator helm release status |
58 | 58 | run: | |
59 | | - helm status my-release --namespace ceph-csi-operator-system |
| 59 | + helm status csi-operator --namespace ceph-csi-operator-system |
60 | 60 |
|
61 | 61 | - name: Check operator is running |
62 | 62 | run: | |
63 | 63 | for i in {1..180}; do kubectl get pods -l app.kubernetes.io/name=ceph-csi-operator -n ceph-csi-operator-system -o jsonpath='{.items[0].status.phase}' | grep -q "Running" && exit 0 || sleep 1; done; echo "Pod not running after 3 minutes"; exit 1 |
| 64 | +
|
| 65 | + - name: Patch operator to watch csi driver namespace |
| 66 | + run: | |
| 67 | + kubectl patch deployment csi-operator-ceph-csi-operator-controller-manager -nceph-csi-operator-system --type='json' -p='[{"op": "replace", "path": "/spec/template/spec/containers/0/env/2/value", "value": "csi-driver"}]' |
| 68 | +
|
| 69 | + - name: Lint csi driver helm chart |
| 70 | + run: | |
| 71 | + helm lint ./deploy/charts/ceph-csi-drivers |
| 72 | +
|
| 73 | + - name: Install csi driver helm chart |
| 74 | + run: | |
| 75 | + helm install csi-driver ./deploy/charts/ceph-csi-drivers --create-namespace --namespace csi-driver |
| 76 | +
|
| 77 | + - name: Check csi driver helm release status |
| 78 | + run: | |
| 79 | + helm status csi-driver --namespace csi-driver |
| 80 | +
|
| 81 | + - name: Check csi pods are running |
| 82 | + run: | |
| 83 | + for i in {1..180}; do |
| 84 | + if [ $(kubectl get pods -n csi-driver --field-selector=status.phase=Running --no-headers | wc -l) -eq 6 ]; then |
| 85 | + exit 0; |
| 86 | + fi |
| 87 | + sleep 1; |
| 88 | + done; |
| 89 | + kubectl get pods,deployment,daemonset,replicaset -oyaml -n csi-driver |
| 90 | + kubectl get pods,deployment,daemonset,replicaset -n csi-driver |
| 91 | + kubectl logs -l app.kubernetes.io/instance=ceph-csi-operator -nceph-csi-operator-system |
| 92 | + echo "Pod(s) not running after 3 minutes"; |
| 93 | + exit 1; |
0 commit comments