Skip to content

Commit d8b2b9a

Browse files
authored
feat(yaml): make csi-controller a deployment and disable hostNetwork (#286)
* feat(yaml): make csi-controller a deployment and disable hostNetwork Signed-off-by: Niladri Halder <[email protected]> * refactor(tests): replace StatefulSet with Deployment Signed-off-by: Niladri Halder <[email protected]> * ci: update GitHub Actions workflows Signed-off-by: Niladri Halder <[email protected]> * ci: update golang-ci to v1.56.2 Signed-off-by: Niladri Halder <[email protected]> * ci: update codecov action Signed-off-by: Niladri Halder <[email protected]> --------- Signed-off-by: Niladri Halder <[email protected]>
1 parent f3e9cd0 commit d8b2b9a

File tree

8 files changed

+76
-73
lines changed

8 files changed

+76
-73
lines changed

.github/workflows/build.yml

Lines changed: 33 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
runs-on: ubuntu-latest
3636
steps:
3737
- name: Checkout
38-
uses: actions/checkout@v2
38+
uses: actions/checkout@v4
3939

4040
- name: Shellcheck
4141
uses: reviewdog/action-shellcheck@v1
@@ -46,22 +46,28 @@ jobs:
4646
pattern: '*.sh'
4747
exclude: './.git/*'
4848

49-
- name: install golangci-lint
50-
run: make install-golangci-lint
49+
- name: Set up Go 1.19
50+
uses: actions/setup-go@v5
51+
with:
52+
go-version: 1.19.9
53+
cache: false
5154

52-
- name: Lint checks
53-
run: make golint
55+
- name: Lint Check
56+
uses: golangci/golangci-lint-action@v4
57+
with:
58+
version: v1.56.2
59+
args: -E exportloopref,dupl,revive,bodyclose,goconst,misspell -D structcheck --timeout 5m0s
5460

5561
unit-test:
5662
# to ignore builds on release
5763
if: ${{ (github.event.ref_type != 'tag') }}
5864
runs-on: ubuntu-latest
5965
steps:
6066
- name: Checkout
61-
uses: actions/checkout@v2
67+
uses: actions/checkout@v4
6268

6369
- name: Set up Go 1.19
64-
uses: actions/setup-go@v4
70+
uses: actions/setup-go@v5
6571
with:
6672
go-version: 1.19.9
6773
cache: false
@@ -70,7 +76,7 @@ jobs:
7076
run: make test
7177

7278
- name: Upload Coverage Report
73-
uses: codecov/codecov-action@v3
79+
uses: codecov/codecov-action@v4
7480
with:
7581
token: ${{ secrets.CODECOV_TOKEN }}
7682
file: ./coverage.txt
@@ -86,10 +92,10 @@ jobs:
8692
kubernetes: [v1.27.3]
8793
steps:
8894
- name: Checkout
89-
uses: actions/checkout@v2
95+
uses: actions/checkout@v4
9096

9197
- name: Set up Go 1.19
92-
uses: actions/setup-go@v4
98+
uses: actions/setup-go@v5
9399
with:
94100
go-version: 1.19.9
95101
cache: false
@@ -114,7 +120,7 @@ jobs:
114120
run: ./ci/ci-test.sh
115121

116122
- name: Upload Coverage Report
117-
uses: codecov/codecov-action@v3
123+
uses: codecov/codecov-action@v4
118124
with:
119125
token: ${{ secrets.CODECOV_TOKEN }}
120126
file: ./tests/bdd_coverage.txt
@@ -126,7 +132,7 @@ jobs:
126132
needs: ['lint', 'unit-test', 'bdd-test']
127133
steps:
128134
- name: Checkout
129-
uses: actions/checkout@v2
135+
uses: actions/checkout@v4
130136

131137
- name: Set Image Org
132138
# sets the default IMAGE_ORG to openebs
@@ -135,13 +141,13 @@ jobs:
135141
echo "IMAGE_ORG=${IMAGE_ORG}" >> $GITHUB_ENV
136142
137143
- name: Login to Docker Hub
138-
uses: docker/login-action@v2
144+
uses: docker/login-action@v3
139145
with:
140146
username: ${{ secrets.DOCKERHUB_USERNAME }}
141147
password: ${{ secrets.DOCKERHUB_TOKEN }}
142148

143149
- name: Build and push the ansible image
144-
uses: docker/build-push-action@v2
150+
uses: docker/build-push-action@v5
145151
with:
146152
file: ./e2e-tests/Dockerfile
147153
push: true
@@ -155,7 +161,7 @@ jobs:
155161
needs: ['lint', 'unit-test', 'bdd-test']
156162
steps:
157163
- name: Checkout
158-
uses: actions/checkout@v2
164+
uses: actions/checkout@v4
159165

160166
- name: Set Image Org
161167
# sets the default IMAGE_ORG to openebs
@@ -166,7 +172,7 @@ jobs:
166172
- name: Set Build Date
167173
id: date
168174
run: |
169-
echo "::set-output name=DATE::$(date -u +'%Y-%m-%dT%H:%M:%S%Z')"
175+
echo "DATE=$(date -u +'%Y-%m-%dT%H:%M:%S%Z')" >> $GITHUB_OUTPUT
170176
171177
- name: Set Tag
172178
run: |
@@ -180,56 +186,55 @@ jobs:
180186
181187
- name: Docker meta
182188
id: docker_meta
183-
uses: crazy-max/ghaction-docker-meta@v1
189+
uses: docker/metadata-action@v4
184190
with:
185191
# add each registry to which the image needs to be pushed here
186192
images: |
187193
${{ env.IMAGE_ORG }}/lvm-driver
188194
quay.io/${{ env.IMAGE_ORG }}/lvm-driver
189195
ghcr.io/${{ env.IMAGE_ORG }}/lvm-driver
190-
tag-latest: false
191-
tag-custom-only: true
192-
tag-custom: |
193-
${{ env.TAG }}
196+
tags: |
197+
type=raw,value=latest,enable=false
198+
type=raw,value=${{ env.TAG }}
194199
195200
- name: Print Tag info
196201
run: |
197202
echo "BRANCH: ${BRANCH}"
198203
echo "${{ steps.docker_meta.outputs.tags }}"
199204
200205
- name: Set up QEMU
201-
uses: docker/setup-qemu-action@v1
206+
uses: docker/setup-qemu-action@v3
202207
with:
203208
platforms: all
204209

205210
- name: Set up Docker Buildx
206211
id: buildx
207-
uses: docker/setup-buildx-action@v1
212+
uses: docker/setup-buildx-action@v3
208213
with:
209-
version: v0.5.1
214+
version: v0.13.1
210215

211216
- name: Login to Docker Hub
212-
uses: docker/login-action@v2
217+
uses: docker/login-action@v3
213218
with:
214219
username: ${{ secrets.DOCKERHUB_USERNAME }}
215220
password: ${{ secrets.DOCKERHUB_TOKEN }}
216221

217222
- name: Login to Quay
218-
uses: docker/login-action@v2
223+
uses: docker/login-action@v3
219224
with:
220225
registry: quay.io
221226
username: ${{ secrets.QUAY_USERNAME }}
222227
password: ${{ secrets.QUAY_TOKEN }}
223228

224229
- name: Login to GHCR
225-
uses: docker/login-action@v2
230+
uses: docker/login-action@v3
226231
with:
227232
registry: ghcr.io
228233
username: ${{ github.actor }}
229234
password: ${{ secrets.GITHUB_TOKEN }}
230235

231236
- name: Build & Push Image
232-
uses: docker/build-push-action@v2
237+
uses: docker/build-push-action@v5
233238
with:
234239
context: .
235240
file: ./buildscripts/lvm-driver/Dockerfile.buildx

.github/workflows/pull_request.yml

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ jobs:
3434
runs-on: ubuntu-latest
3535
steps:
3636
- name: Checkout
37-
uses: actions/checkout@v2
37+
uses: actions/checkout@v4
3838

3939
- name: Set up Go 1.19
40-
uses: actions/setup-go@v4
40+
uses: actions/setup-go@v5
4141
with:
4242
go-version: 1.19.9
4343
cache: false
@@ -52,7 +52,10 @@ jobs:
5252
run: make bootstrap
5353

5454
- name: Lint Check
55-
run: make golint
55+
uses: golangci/golangci-lint-action@v4
56+
with:
57+
version: v1.56.2
58+
args: -E exportloopref,dupl,revive,bodyclose,goconst,misspell -D structcheck --timeout 5m0s
5659

5760
- name: Shellcheck
5861
uses: reviewdog/action-shellcheck@v1
@@ -66,10 +69,10 @@ jobs:
6669
runs-on: ubuntu-latest
6770
steps:
6871
- name: Checkout
69-
uses: actions/checkout@v2
72+
uses: actions/checkout@v4
7073

7174
- name: Set up Go 1.19
72-
uses: actions/setup-go@v4
75+
uses: actions/setup-go@v5
7376
with:
7477
go-version: 1.19.9
7578
cache: false
@@ -78,7 +81,7 @@ jobs:
7881
run: make test
7982

8083
- name: Upload Coverage Report
81-
uses: codecov/codecov-action@v3
84+
uses: codecov/codecov-action@v4
8285
with:
8386
token: ${{ secrets.CODECOV_TOKEN }}
8487
file: ./coverage.txt
@@ -94,10 +97,10 @@ jobs:
9497
kubernetes: [v1.27.3]
9598
steps:
9699
- name: Checkout
97-
uses: actions/checkout@v2
100+
uses: actions/checkout@v4
98101

99102
- name: Set up Go 1.19
100-
uses: actions/setup-go@v4
103+
uses: actions/setup-go@v5
101104
with:
102105
go-version: 1.19.9
103106
cache: false
@@ -122,7 +125,7 @@ jobs:
122125
run: ./ci/ci-test.sh
123126

124127
- name: Upload Coverage Report
125-
uses: codecov/codecov-action@v3
128+
uses: codecov/codecov-action@v4
126129
with:
127130
token: ${{ secrets.CODECOV_TOKEN }}
128131
file: ./tests/bdd_coverage.txt
@@ -134,21 +137,21 @@ jobs:
134137
needs: ['lint', 'unit-test', 'bdd-test']
135138
steps:
136139
- name: Checkout
137-
uses: actions/checkout@v2
140+
uses: actions/checkout@v4
138141

139142
- name: Set up QEMU
140-
uses: docker/setup-qemu-action@v1
143+
uses: docker/setup-qemu-action@v3
141144
with:
142145
platforms: all
143146

144147
- name: Set up Docker Buildx
145148
id: buildx
146-
uses: docker/setup-buildx-action@v1
149+
uses: docker/setup-buildx-action@v3
147150
with:
148-
version: v0.5.1
151+
version: v0.13.1
149152

150153
- name: Build
151-
uses: docker/build-push-action@v2
154+
uses: docker/build-push-action@v5
152155
with:
153156
context: .
154157
file: ./buildscripts/lvm-driver/Dockerfile.buildx

.github/workflows/release.yml

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
runs-on: ubuntu-latest
2525
steps:
2626
- name: Checkout
27-
uses: actions/checkout@v1
27+
uses: actions/checkout@v4
2828

2929
- name: Set Image Org
3030
# sets the default IMAGE_ORG to openebs
@@ -35,7 +35,7 @@ jobs:
3535
- name: Set Build Date
3636
id: date
3737
run: |
38-
echo "::set-output name=DATE::$(date -u +'%Y-%m-%dT%H:%M:%S%Z')"
38+
echo "DATE=$(date -u +'%Y-%m-%dT%H:%M:%S%Z')" >> $GITHUB_OUTPUT
3939
4040
- name: Set Tag
4141
run: |
@@ -45,55 +45,54 @@ jobs:
4545
4646
- name: Docker meta
4747
id: docker_meta
48-
uses: crazy-max/ghaction-docker-meta@v1
48+
uses: docker/metadata-action@v4
4949
with:
5050
# add each registry to which the image needs to be pushed here
5151
images: |
5252
${{ env.IMAGE_ORG }}/lvm-driver
5353
quay.io/${{ env.IMAGE_ORG }}/lvm-driver
5454
ghcr.io/${{ env.IMAGE_ORG }}/lvm-driver
55-
tag-latest: true
56-
tag-semver: |
57-
{{version}}
55+
tags: |
56+
type=semver,pattern={{version}}
5857
5958
- name: Print Tag info
6059
run: |
6160
echo "${{ steps.docker_meta.outputs.tags }}"
6261
echo "RELEASE TAG: ${RELEASE_TAG}"
6362
6463
- name: Set up QEMU
65-
uses: docker/setup-qemu-action@v1
64+
uses: docker/setup-qemu-action@v3
6665
with:
6766
platforms: all
6867

6968
- name: Set up Docker Buildx
7069
id: buildx
71-
uses: docker/setup-buildx-action@v1
70+
uses: docker/setup-buildx-action@v3
7271
with:
73-
version: v0.5.1
72+
version: v0.13.1
7473

7574
- name: Login to Docker Hub
76-
uses: docker/login-action@v2
75+
uses: docker/login-action@v3
7776
with:
7877
username: ${{ secrets.DOCKERHUB_USERNAME }}
7978
password: ${{ secrets.DOCKERHUB_TOKEN }}
8079

8180
- name: Login to Quay
82-
uses: docker/login-action@v2
81+
uses: docker/login-action@v3
8382
with:
8483
registry: quay.io
8584
username: ${{ secrets.QUAY_USERNAME }}
8685
password: ${{ secrets.QUAY_TOKEN }}
8786

8887
- name: Login to GHCR
89-
uses: docker/login-action@v2
88+
uses: docker/login-action@v3
9089
with:
9190
registry: ghcr.io
9291
username: ${{ github.actor }}
9392
password: ${{ secrets.GITHUB_TOKEN }}
9493

9594
- name: Build & Push Image
96-
uses: docker/build-push-action@v2
95+
uses: docker/build-push-action@v5
9796
with:
9897
context: .
9998
file: ./buildscripts/lvm-driver/Dockerfile.buildx

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ bootstrap: controller-gen install-golangci-lint
141141
## Install golangci-lint only if tool doesn't exist in system
142142
.PHONY: install-golangci-lint
143143
install-golangci-lint:
144-
$(if $(shell which golangci-lint), echo "golangci-lint already exist in system", (curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sudo sh -s -- -b "${GOPATH}/bin" v1.52.2))
144+
$(if $(shell which golangci-lint), echo "golangci-lint already exist in system", (curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sudo sh -s -- -b "${GOPATH}/bin" v1.56.2))
145145

146146
.PHONY: controller-gen
147147
controller-gen:

deploy/lvm-operator.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1376,7 +1376,7 @@ description: "This priority class should be used for the OpenEBS LVM localPV CSI
13761376

13771377
---
13781378

1379-
kind: StatefulSet
1379+
kind: Deployment
13801380
apiVersion: apps/v1
13811381
metadata:
13821382
name: openebs-lvm-controller
@@ -1389,7 +1389,6 @@ spec:
13891389
matchLabels:
13901390
app: openebs-lvm-controller
13911391
role: openebs-lvm
1392-
serviceName: "openebs-lvm"
13931392
replicas: 1
13941393
template:
13951394
metadata:
@@ -1633,7 +1632,6 @@ spec:
16331632
spec:
16341633
priorityClassName: openebs-lvm-localpv-csi-node-critical
16351634
serviceAccountName: openebs-lvm-node-sa
1636-
hostNetwork: true
16371635
containers:
16381636
- name: csi-node-driver-registrar
16391637
image: registry.k8s.io/sig-storage/csi-node-driver-registrar:v2.8.0

0 commit comments

Comments
 (0)