Skip to content

Commit afd1364

Browse files
committed
chore: add hadolint action
add hadolint check action Signed-off-by: adrianc <[email protected]>
1 parent 338ecb0 commit afd1364

File tree

3 files changed

+22
-4
lines changed

3 files changed

+22
-4
lines changed

.github/workflows/test.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,24 @@ jobs:
116116
with:
117117
severity: error
118118

119+
hadolint:
120+
name: hadolint
121+
runs-on: ubuntu-24.04
122+
steps:
123+
- name: checkout PR
124+
uses: actions/checkout@v5
125+
- name: run hadolint on operator dockerfile
126+
uses: hadolint/[email protected]
127+
with:
128+
dockerfile: Dockerfile
129+
- name: run hadolint on config daemon dockerfile
130+
uses: hadolint/[email protected]
131+
with:
132+
dockerfile: Dockerfile.sriov-network-config-daemon
133+
- name: run hadolint on webhook dockerfile
134+
uses: hadolint/[email protected]
135+
with:
136+
dockerfile: Dockerfile.webhook
119137
test-coverage:
120138
name: test-coverage
121139
runs-on: ubuntu-24.04

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
FROM golang:1.25 AS builder
22
WORKDIR /go/src/github.com/k8snetworkplumbingwg/sriov-network-operator
33
COPY . .
4-
RUN make _build-manager BIN_PATH=build/_output/cmd
5-
RUN make _build-sriov-network-operator-config-cleanup BIN_PATH=build/_output/cmd
4+
RUN make _build-manager BIN_PATH=build/_output/cmd && \
5+
make _build-sriov-network-operator-config-cleanup BIN_PATH=build/_output/cmd
66

77
FROM quay.io/centos/centos:stream9
88
COPY --from=builder /go/src/github.com/k8snetworkplumbingwg/sriov-network-operator/build/_output/cmd/manager /usr/bin/sriov-network-operator

Dockerfile.sriov-network-config-daemon

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ COPY . .
44
RUN make _build-sriov-network-config-daemon BIN_PATH=build/_output/cmd
55

66
FROM quay.io/centos/centos:stream9
7-
ARG MSTFLINT=mstflint
7+
ARG MSTFLINT=mstflint-4.32.0
88
# We have to ensure that pciutils is installed. This package is needed for mstfwreset to succeed.
99
# xref pkg/vendors/mellanox/mellanox.go#L150
10-
RUN ARCH_DEP_PKGS=$(if [ "$(uname -m)" != "s390x" ]; then echo -n ${MSTFLINT} ; fi) && yum -y install hwdata pciutils $ARCH_DEP_PKGS && yum clean all
10+
RUN ARCH_DEP_PKGS=$(if [ "$(uname -m)" != "s390x" ]; then echo -n "${MSTFLINT}" ; fi) && yum -y install hwdata pciutils "${ARCH_DEP_PKGS}" && yum clean all
1111
LABEL io.k8s.display-name="sriov-network-config-daemon" \
1212
io.k8s.description="This is a daemon that manage and config sriov network devices in Kubernetes cluster"
1313
COPY --from=builder /go/src/github.com/k8snetworkplumbingwg/sriov-network-operator/build/_output/cmd/sriov-network-config-daemon /usr/bin/

0 commit comments

Comments
 (0)