Skip to content
This repository was archived by the owner on Jun 25, 2025. It is now read-only.

Commit b27ac75

Browse files
ahalimx86rpieczonMichalGuzieniukikyrychokamilpoleszczuk
committed
release v22.04
Co-Authored-By: rpieczon <rpieczon@users.noreply.github.com> Co-Authored-By: MichalGuzieniuk <MichalGuzieniuk@users.noreply.github.com> Co-Authored-By: ikyrycho <ikyrycho@users.noreply.github.com> Co-Authored-By: kamilpoleszczuk <kamilpoleszczuk@users.noreply.github.com> Co-Authored-By: ktaube26 <ktaube26@users.noreply.github.com> Co-Authored-By: mrymsza <mrymsza@users.noreply.github.com> Co-Authored-By: emmakenny <emmakenny@users.noreply.github.com> Co-Authored-By: tmatenko <tmatenko@users.noreply.github.com> Co-Authored-By: gfurkiotis <gfurkiotis@users.noreply.github.com> Co-Authored-By: konradja <konradja@users.noreply.github.com> Co-Authored-By: l-a-day <l-a-day@users.noreply.github.com> Co-Authored-By: alponiatowski <alponiatowski@users.noreply.github.com> Co-Authored-By: damiankopyto <damiankopyto@users.noreply.github.com> Co-Authored-By: sbelhaik <sbelhaik@users.noreply.github.com> Co-Authored-By: stephenjameson <stephenjameson@users.noreply.github.com>
0 parents  commit b27ac75

File tree

170 files changed

+32776
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

170 files changed

+32776
-0
lines changed

.dockerignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# More info: https://docs.docker.com/engine/reference/builder/#dockerignore-file
2+
# Ignore all files which are not go type
3+
!**/*.go
4+
!**/*.mod
5+
!**/*.sum

.gitignore

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
2+
# Binaries for programs and plugins
3+
*.exe
4+
*.exe~
5+
*.dll
6+
*.so
7+
*.dylib
8+
bin
9+
testbin/*
10+
11+
# Test binary, build with `go test -c`
12+
*.test
13+
14+
# Output of the go coverage tool, specifically when used with LiteIDE
15+
*.out
16+
17+
# Kubernetes Generated files - skip generated files, except for vendored files
18+
19+
!vendor/**/zz_generated.*
20+
21+
# editor and IDE paraphernalia
22+
.idea
23+
*.swp
24+
*.swo
25+
*~
26+
27+
# operator-sdk generated files
28+
config/crd/bases/
29+
bundle/
30+
bundle.Dockerfile
31+
32+
# ignore kustomize generated files
33+
assets/flowconfig-daemon/daemon.yaml

.golangci.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
# Copyright (c) 2021 Intel Corporation
3+
---
4+
run:
5+
timeout: 5m
6+
issues:
7+
exclude-rules:
8+
- linters:
9+
- staticcheck
10+
text: "SA1019:"

COPYRIGHT

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
# Copyright (c) 2021-2022 Intel Corporation
3+

Dockerfile

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
# Copyright (c) 2021 Intel Corporation
3+
4+
# Build the manager binary
5+
FROM golang:alpine3.13 as builder
6+
7+
WORKDIR /workspace
8+
9+
COPY go.mod go.mod
10+
COPY go.sum go.sum
11+
# cache deps before building and copying source so that we don't need to re-download as much
12+
# and so that source changes don't invalidate our downloaded layer
13+
RUN go mod download
14+
15+
COPY main.go main.go
16+
COPY apis/ apis/
17+
18+
COPY controllers/ controllers/
19+
COPY pkg/ pkg/
20+
21+
22+
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o manager main.go
23+
24+
FROM registry.access.redhat.com/ubi8:8.5-214
25+
26+
ARG VERSION
27+
### Required OpenShift Labels
28+
LABEL name="Intel Ethernet Operator" \
29+
vendor="Intel Corporation" \
30+
version=$VERSION \
31+
release="1" \
32+
summary="Intel Ethernet Operator for E810 NICs" \
33+
description="The role of the Intel Ethernet Operator is to orchestrate and manage the configuration of the capabilities exposed by the Intel E810 Series network interface cards (NICs)"
34+
35+
USER 1001
36+
WORKDIR /
37+
COPY --from=builder /workspace/manager .
38+
COPY assets/ assets/
39+
40+
ENTRYPOINT ["/manager"]

Dockerfile.daemon

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
# Copyright (c) 2020-2021 Intel Corporation
3+
4+
FROM golang:alpine3.13 as builder
5+
6+
WORKDIR /workspace
7+
8+
COPY go.mod go.sum ./
9+
10+
RUN go mod download
11+
12+
COPY cmd cmd/
13+
COPY pkg pkg/
14+
COPY apis apis/
15+
16+
# Build
17+
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o fwddp_daemon cmd/fwddp-daemon/main.go
18+
19+
FROM registry.access.redhat.com/ubi8:8.5-214
20+
21+
RUN yum install -y ethtool iproute kmod pciutils && yum clean all
22+
23+
ARG VERSION
24+
### Required OpenShift Labels
25+
LABEL name="Intel Ethernet Operator - daemonset" \
26+
vendor="Intel Corporation" \
27+
version=$VERSION \
28+
release="1" \
29+
summary="Manages the FW and DPP updates of E810 NICs" \
30+
description="The daemonset container is responsible for building the nodes inventory and configuring the FW and DDP updates on E810 series NICs"
31+
32+
WORKDIR /
33+
COPY --from=builder /workspace/fwddp_daemon .
34+
35+
ENTRYPOINT ["/fwddp_daemon"]

Dockerfile.labeler

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
# Copyright (c) 2021 Intel Corporation
3+
4+
FROM golang:alpine3.13 as builder
5+
6+
WORKDIR /workspace
7+
COPY go.mod go.sum ./
8+
RUN go mod download
9+
10+
COPY cmd cmd/
11+
COPY pkg pkg/
12+
COPY apis apis/
13+
14+
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o node_labeler cmd/labeler/main.go
15+
16+
FROM registry.access.redhat.com/ubi8:8.5-214
17+
18+
ARG VERSION
19+
### Required OpenShift Labels
20+
LABEL name="Intel® Ethernet Operator discovery container" \
21+
vendor="Intel Corporation" \
22+
version=$VERSION \
23+
release="1" \
24+
summary="Intel® Ethernet Operator discovery container labels kubernetes nodes that contain the PCI \
25+
devices as set in the config file (typically Intel Ethernet E810)" \
26+
description="The container detects the relevant PCI devices, labels the nodes that contain them \
27+
and removes the label for the nodes that do not."
28+
29+
WORKDIR /usr/share/misc/
30+
31+
RUN curl https://pci-ids.ucw.cz/v2.2/pci.ids.gz -o pci.ids.gz && \
32+
gunzip pci.ids.gz
33+
34+
USER 1001
35+
WORKDIR /labeler-workspace
36+
COPY --from=builder /workspace/node_labeler .
37+
38+
ENTRYPOINT ["bash", "-c", "/labeler-workspace/node_labeler && sleep infinity"]

Jenkinsfile

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
# Copyright (c) 2021 Intel Corporation
3+
pipeline {
4+
agent {
5+
kubernetes {
6+
label 'go'
7+
}
8+
}
9+
10+
stages {
11+
12+
stage('Prerequisites') {
13+
steps {
14+
container('go') {
15+
dir("$WORKSPACE") {
16+
sh '''
17+
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $(go env GOPATH)/bin
18+
curl -fsSL https://deb.nodesource.com/setup_12.x | bash -
19+
apt-get install -y yamllint pciutils
20+
mkdir /usr/share/hwdata
21+
ln -s /usr/share/misc/pci.ids /usr/share/hwdata/pci.ids
22+
update-pciids
23+
'''
24+
}
25+
}
26+
}
27+
}
28+
29+
30+
stage('Build') {
31+
steps {
32+
container('go') {
33+
sh '''
34+
echo "BUILD STEP: Build code"
35+
rm -rf bin
36+
if ! make all; then
37+
echo "ERROR: Failed to build the intel-ethernet-operator code"
38+
exit 1
39+
fi
40+
'''
41+
}
42+
}
43+
}
44+
45+
stage('test') {
46+
steps {
47+
container('go') {
48+
sh '''
49+
echo "Run unit tests and gather code coverage"
50+
rm -rf testbin
51+
if ! make test; then
52+
echo "ERROR: Failed to run unit tests"
53+
exit 1
54+
fi
55+
go tool cover -func cover.out
56+
'''
57+
}
58+
}
59+
}
60+
61+
stage('code_style'){
62+
steps{
63+
container('go') {
64+
sh '''
65+
DIFFCHECK=$(gofmt)
66+
if [ -n "$DIFFCHECK" ]; then
67+
echo "WARNING: code style issues found"
68+
fi
69+
'''
70+
}
71+
}
72+
}
73+
74+
stage('go lint'){
75+
steps{
76+
container('go') {
77+
sh '''
78+
echo "Run Go linter tools"
79+
set -x
80+
golangci-lint version
81+
set +x
82+
if ! golangci-lint run -c ${WORKSPACE}/.golangci.yml; then
83+
echo "ERROR: Go lint check found errors"
84+
exit 1
85+
fi
86+
'''
87+
}
88+
}
89+
}
90+
91+
stage('yaml lint'){
92+
steps{
93+
container('go') {
94+
sh '''
95+
echo "Run yaml linter tools"
96+
set -x
97+
yamllint --version
98+
set +x
99+
yamllint .
100+
if [ $? -ne 0 ]; then
101+
exit 1
102+
fi
103+
'''
104+
}
105+
}
106+
}
107+
}
108+
}
109+

0 commit comments

Comments
 (0)