Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OCPBUGS-28248: Downstream Sync 2024-02-01 #882

Merged
merged 120 commits into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
120 commits
Select commit Hold shift + click to select a range
65bb984
Change behavior when deleting default config
vasrem Dec 27, 2023
39d6aef
Update chart README.md to reflect webhook changes
vasrem Jan 2, 2024
60a68d4
configure global variables and consts for the all system
SchSeba Jan 7, 2024
0dd496f
create a platform folder to contain different platforms
SchSeba Jan 7, 2024
4f93f9f
create vendor package to hold all the vendor specific functions
SchSeba Jan 7, 2024
387679b
move all the functions from utils to a right place under the host pac…
SchSeba Jan 7, 2024
e428647
Update Chart.yaml - kubeVersion check
ianb-mp Jan 8, 2024
51946b0
Merge pull request #566 from vasrem/feature/change-default-config-del…
adrianchiris Jan 8, 2024
9c8c223
Merge pull request #570 from vasrem/chore/update-chart-readme
Jan 8, 2024
b393f30
Merge pull request #576 from ianb-mp/patch-2
adrianchiris Jan 8, 2024
5887e75
update all the needed packages with the new global imports and interf…
SchSeba Jan 7, 2024
d5eb696
nit: small fix to a test and git ignore update
SchSeba Jan 7, 2024
443a301
Merge pull request #553 from SchSeba/interface_redesign
adrianchiris Jan 9, 2024
6eb63a9
Use go-install-tool instead of go-get-tool for gomock
ykulazhenkov Jan 9, 2024
9c0e0bf
Merge pull request #578 from ykulazhenkov/fix-gomock-install
adrianchiris Jan 9, 2024
dc5c9d2
Do not reset Firmware config in Mellanox plugin
adrianchiris Dec 27, 2023
2af158f
block mtu change on pf when externally managed
adrianchiris Dec 27, 2023
5752f32
Merge pull request #567 from adrianchiris/externally-managed-fixes
adrianchiris Jan 10, 2024
6508c69
add design doc for switchdev mode refactoring
ykulazhenkov Dec 14, 2023
30d6790
Add vdpaType field to the node SriovNetworkNodeState CRD
ykulazhenkov Jan 10, 2024
3620e1a
Refactor mtuFilePath to clean up and reduce duplicate code
bn222 Jan 11, 2024
e2b45f4
Ignore goconst in conformance tests
bn222 Jan 11, 2024
0c15551
Fix goconst errors
bn222 Jan 11, 2024
9c2a7d3
Update to golang 1.21
bn222 Jan 10, 2024
dad8ddc
bump golang version in GitHub actions
bn222 Dec 27, 2023
98ee66c
bump golang version in Dockerfile
bn222 Dec 27, 2023
c5245b9
Bump golangci-lint to latest version as of today
bn222 Dec 28, 2023
708f0d5
Update golangci to use new config format for depguard
bn222 Jan 11, 2024
7162082
Merge pull request #565 from bn222/master
SchSeba Jan 15, 2024
6e8a861
Merge pull request #559 from ykulazhenkov/switchdev-refactoring-design
zeeke Jan 16, 2024
12e3306
Add additional methods to host/kernel.go
ykulazhenkov Jan 9, 2024
09c987a
Merge pull request #582 from ykulazhenkov/refactor-host-kernel
zeeke Jan 17, 2024
f22ea70
Bump google.golang.org/grpc from 1.54.0 to 1.56.3
dependabot[bot] Jan 17, 2024
9d789d7
Bump golang.org/x/crypto from 0.14.0 to 0.17.0
dependabot[bot] Jan 17, 2024
7c73437
Change layout of the pkg/host to simplify testing
ykulazhenkov Jan 16, 2024
51c2e69
Use named args in interface definitions in host pkg
ykulazhenkov Jan 17, 2024
bdb6d90
Generate mock for host.HostManagerInterface interface
ykulazhenkov Jan 16, 2024
b3d96dc
Merge pull request #580 from k8snetworkplumbingwg/dependabot/go_modul…
zeeke Jan 18, 2024
a9a61c9
Merge pull request #579 from k8snetworkplumbingwg/dependabot/go_modul…
zeeke Jan 18, 2024
527c473
Merge pull request #586 from ykulazhenkov/host-pkg-layout
zeeke Jan 18, 2024
a63e2ef
CI: remove images after we push to cluster
SchSeba Jan 22, 2024
3eefdd8
Merge pull request #583 from ykulazhenkov/vdpa-type-field
zeeke Jan 23, 2024
c59dc72
Create a separate pkg for test helper functions
ykulazhenkov Jan 19, 2024
4b46a85
Add wrapper for govdpa lib
ykulazhenkov Jan 11, 2024
31b5e51
Add VdpaInterface to host package
ykulazhenkov Jan 16, 2024
37cb2db
Add wrapper for netlink library to host pkg
ykulazhenkov Jan 16, 2024
995373c
Merge pull request #589 from SchSeba/clean_ci_images
SchSeba Jan 23, 2024
21a2ad3
Use netlink lib wrapper in implementation of host.SriovInterface
ykulazhenkov Jan 16, 2024
0c79197
Optimize SetSriovNumVfs for use-case when we need to ser numVfs to 0
ykulazhenkov Jan 16, 2024
5410c12
Add sriov.SetNicSriovMode function
ykulazhenkov Jan 16, 2024
2b49a6a
Add tests for some functions in SriovInterface
ykulazhenkov Jan 16, 2024
6f2ccaa
Extend Udev interface to support switchdev rule
ykulazhenkov Jan 18, 2024
bb34ac9
Merge pull request #588 from ykulazhenkov/pr-add-funcs-to-host-pkg
adrianchiris Jan 25, 2024
b6de854
fix k8s cluster script
SchSeba Jan 25, 2024
b6cc5f6
Merge pull request #593 from SchSeba/fix_k8s_ci
SchSeba Jan 25, 2024
dc29987
Fix LogLevel functional test
SchSeba Jan 9, 2024
ede5182
Merge pull request #591 from SchSeba/fix_log_test
SchSeba Jan 25, 2024
a16a0d7
fix ocp CI lane
SchSeba Jan 25, 2024
82ef267
Merge pull request #595 from SchSeba/fix_ocp_ci
Jan 26, 2024
48808ae
re-enable mtu test on virtual cluster
SchSeba Jan 25, 2024
eaa81ce
add NET_RAW to allow pods to ping
SchSeba Jan 28, 2024
d5d0273
e2e: Allow testing custom cni and dp image
zeeke Oct 10, 2023
4663412
e2e: Gather `cluster-info` on test failure
zeeke Nov 3, 2023
5f52597
Remove sriov-cni daemonset-related code
e0ne Nov 15, 2023
9026a2d
e2e: Skip tests when no VF-IO devices are available
zeeke Jan 29, 2024
b2e875b
Merge pull request #518 from zeeke/e2e-inject-images
zeeke Jan 29, 2024
4923121
Merge pull request #594 from SchSeba/enable_mtu_test
adrianchiris Jan 29, 2024
cfbfd2e
Makefile enhancements
adrianchiris Jan 29, 2024
3c15708
run controllers test with kubernetes cluster type
adrianchiris Jan 29, 2024
4107581
Remove envtest from webhook tests
adrianchiris Jan 29, 2024
78fabc8
Controllers test enhancements
adrianchiris Jan 29, 2024
6867541
e2e tests enhancements
adrianchiris Jan 29, 2024
ddf5eb8
Refactor render of SR-IOV Device plugin
e0ne Nov 17, 2023
5b5e468
Merge pull request #597 from adrianchiris/test-fixes
adrianchiris Jan 29, 2024
d739284
Add wrapper for dputils package
ykulazhenkov Jan 23, 2024
a7a885a
Use dputils wrapper in network and sriov packages
ykulazhenkov Jan 23, 2024
54b342c
Merge pull request #546 from e0ne/sriov-dp-ds-fixes
zeeke Jan 30, 2024
4d080de
Use APITimeout and RetryInterval constant in tests
e0ne Jan 30, 2024
da7011a
move namespace to vars pkg
adrianchiris Jan 30, 2024
8b36f09
Merge pull request #600 from e0ne/api-timeout
zeeke Jan 31, 2024
ea0e327
Merge pull request #601 from adrianchiris/move-namespace-to-vars
adrianchiris Jan 31, 2024
fe7d6bd
Fix log messages in ReloadDriver & GetOSPrettyName
cgoncalves Jan 31, 2024
48dbe6f
Merge pull request #603 from cgoncalves/ReloadDriver
adrianchiris Jan 31, 2024
224f2c0
Move default policy creation in controller tests to BeforeSuite.
ykulazhenkov Jan 31, 2024
36394ac
Merge pull request #604 from ykulazhenkov/pr-fix-tests
e0ne Jan 31, 2024
0258c5a
Cleanup Created object in controller tests
adrianchiris Feb 1, 2024
7c2029f
Start manager at end of BeforeSuite
adrianchiris Feb 1, 2024
9648745
Merge pull request #598 from ykulazhenkov/pr-dputis-wrapper
zeeke Feb 1, 2024
0eb0a14
Merge pull request #606 from adrianchiris/additional-controller-fixes
zeeke Feb 1, 2024
b164b0e
Reduce timeout period in controller tests
adrianchiris Feb 1, 2024
a3a5ba9
Merge pull request #596 from zeeke/us-28248
adrianchiris Feb 1, 2024
d0cebac
Merge remote-tracking branch 'upstream/master' into sync-20240201
zeeke Feb 1, 2024
e1d5400
dsonly: `make -f Makefile.bundle bundle`
zeeke Feb 1, 2024
98f1b77
Optimize a request to find device plugin pods.
alan-kut Jan 30, 2024
dd5fe96
Merge pull request #607 from adrianchiris/reduce-timeout-in-controlle…
adrianchiris Feb 1, 2024
1a3019e
Merge pull request #599 from alan-kut/master
adrianchiris Feb 1, 2024
9162bf5
Rename plugin names
adrianchiris Dec 27, 2023
c4e4daa
rename enabledPlugins to loadedPlugins in daemon
adrianchiris Dec 27, 2023
45884f7
Add disable plugins to config daemon
adrianchiris Dec 28, 2023
65530fe
Add unit-tests for daemon plugin
adrianchiris Dec 28, 2023
f543dea
Set disable plugins in daemonset via controller
adrianchiris Dec 28, 2023
baa18d0
doc updates
adrianchiris Dec 31, 2023
e30414b
add w/a for multus bug in CI
SchSeba Feb 1, 2024
20c08f5
e2e: Fix `Debug logging should be visible in multus pod` flake
zeeke Feb 1, 2024
e409337
Merge pull request #569 from adrianchiris/add-disable-plugins
zeeke Feb 2, 2024
1c76c13
openstack: Fix `nil` HostManager in `openstackContext`
zeeke Feb 1, 2024
6974152
Fix mellanox plugin name in logs
ykulazhenkov Feb 2, 2024
01e5922
Refactor controller tests
adrianchiris Feb 1, 2024
1e58de4
Merge pull request #611 from zeeke/e2e-debug-loggin-flake
adrianchiris Feb 4, 2024
5aeb154
Merge pull request #612 from SchSeba/fix_k8s_ci_multus
SchSeba Feb 4, 2024
c0bf46c
Merge pull request #615 from ykulazhenkov/pr-fix-plugin-name
zeeke Feb 5, 2024
d131e98
Merge pull request #609 from adrianchiris/init-manager-in-each-test
adrianchiris Feb 5, 2024
a0d9132
minor improvements in sriovOpeatorConfig controller
adrianchiris Feb 5, 2024
252c959
Merge pull request #618 from adrianchiris/minor-improvement-operator-…
zeeke Feb 6, 2024
a67817f
e2e: dump multus namespace
zeeke Feb 5, 2024
49dde87
Merge pull request #616 from zeeke/e2e-fix-multus-log
e0ne Feb 6, 2024
c7aba1e
Set OwnerReference to sriov-device-plugin configmap
adrianchiris Feb 6, 2024
a7d40a7
Merge pull request #623 from adrianchiris/set-owner-ref-to-cm
zeeke Feb 8, 2024
f8405cf
Merge pull request #610 from zeeke/openstack-panic-fix
adrianchiris Feb 8, 2024
3db20ae
Merge remote-tracking branch 'upstream/master' into sync-20240201
zeeke Feb 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
29 changes: 16 additions & 13 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
runs-on: ubuntu-latest
steps:

- name: Set up Go 1.20
- name: Set up Go 1.21
uses: actions/setup-go@v3
with:
go-version: 1.20.x
go-version: 1.21.x

- name: Check out code into the Go module directory
uses: actions/checkout@v2
Expand All @@ -32,10 +32,10 @@ jobs:
runs-on: ubuntu-latest
steps:

- name: Set up Go 1.20
- name: Set up Go 1.21
uses: actions/setup-go@v2
with:
go-version: 1.20.x
go-version: 1.21.x

- name: Check out code into the Go module directory
uses: actions/checkout@v2
Expand All @@ -46,34 +46,37 @@ jobs:
- name: test controllers on opensfhit
run: CLUSTER_TYPE=openshift make test-controllers

- name: test controllers on kubernetes
run: CLUSTER_TYPE=kubernetes make test-controllers

- name: test bindata/scripts
run: make test-bindata-scripts

golangci:
name: Golangci-lint
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.20
- name: Set up Go 1.21
uses: actions/setup-go@v2
with:
go-version: 1.20.x
go-version: 1.21.x
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.51.0
version: v1.55.2

test-coverage:
name: test-coverage
runs-on: ubuntu-latest
steps:

- name: Set up Go 1.20
- name: Set up Go 1.21
uses: actions/setup-go@v2
with:
go-version: 1.20.x
go-version: 1.21.x

- name: Check out code into the Go module directory
uses: actions/checkout@v2
Expand Down Expand Up @@ -107,10 +110,10 @@ jobs:
- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Set up Go 1.20
- name: Set up Go 1.21
uses: actions/setup-go@v3
with:
go-version: 1.20.x
go-version: 1.21.x

- name: run test
run: make test-e2e-conformance-virtual-k8s-cluster-ci
Expand Down Expand Up @@ -141,10 +144,10 @@ jobs:
- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Set up Go 1.20
- name: Set up Go 1.21
uses: actions/setup-go@v3
with:
go-version: 1.20.x
go-version: 1.21.x

- name: run test
run: make test-e2e-conformance-virtual-ocp-cluster-ci
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,5 @@ tags
# End of https://www.gitignore.io/api/go,vim,emacs,visualstudiocode
#IDE (GoLand) specific
.idea/

# test-environment files
registry-login.conf
16 changes: 9 additions & 7 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,11 @@ run:
- pkg/client
linters-settings:
depguard:
list-type: blacklist
packages:
# logging is allowed only by logutils.Log, logrus
# is allowed to use only in logutils package
- github.com/sirupsen/logrus
packages-with-error-message:
- github.com/sirupsen/logrus: "logging is allowed only by logutils.Log"
rules:
main:
deny:
- pkg: github.com/sirupsen/logrus
desc: "logging is allowed only by logutils.Log"
dupl:
threshold: 100
funlen:
Expand All @@ -25,6 +23,7 @@ linters-settings:
goconst:
min-len: 2
min-occurrences: 2
ignore-tests: true
gocritic:
enabled-tags:
- diagnostic
Expand Down Expand Up @@ -118,4 +117,7 @@ issues:
- lll
- stylecheck
- goconst
- path: test/conformance/tests
linters:
- goconst

2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.20 AS builder
FROM golang:1.21 AS builder
WORKDIR /go/src/github.com/k8snetworkplumbingwg/sriov-network-operator
COPY . .
RUN make _build-manager BIN_PATH=build/_output/cmd
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.sriov-network-config-daemon
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.20 AS builder
FROM golang:1.21 AS builder
WORKDIR /go/src/github.com/k8snetworkplumbingwg/sriov-network-operator
COPY . .
RUN make _build-sriov-network-config-daemon BIN_PATH=build/_output/cmd
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.webhook
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.20 AS builder
FROM golang:1.21 AS builder
WORKDIR /go/src/github.com/k8snetworkplumbingwg/sriov-network-operator
COPY . .
RUN make _build-webhook BIN_PATH=build/_output/cmd
Expand Down
28 changes: 10 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export WATCH_NAMESPACE?=openshift-sriov-network-operator
export GOFLAGS+=-mod=vendor
export GO111MODULE=on
PKGS=$(shell go list ./... | grep -v -E '/vendor/|/test|/examples')
TESTPKGS?=./...

# go source files, ignore vendor directory
SRC = $(shell find . -type f -name '*.go' -not -path "./vendor/*")
Expand All @@ -51,7 +52,7 @@ GOLANGCI_LINT = $(BIN_DIR)/golangci-lint
# golangci-lint version should be updated periodically
# we keep it fixed to avoid it from unexpectedly failing on the project
# in case of a version bump
GOLANGCI_LINT_VER = v1.51.0
GOLANGCI_LINT_VER = v1.55.2

GOLANGCI_LINT = $(BIN_DIR)/golangci-lint
# golangci-lint version should be updated periodically
Expand All @@ -62,7 +63,7 @@ GOLANGCI_LINT_VER = v1.46.1

.PHONY: all build clean gendeepcopy test test-e2e test-e2e-k8s run image fmt sync-manifests test-e2e-conformance manifests update-codegen

all: generate vet build
all: generate lint build

build: manager _build-sriov-network-config-daemon _build-webhook

Expand All @@ -82,14 +83,14 @@ image: ; $(info Building images...)
$(IMAGE_BUILDER) build -f $(DOCKERFILE_WEBHOOK) -t $(WEBHOOK_IMAGE_TAG) $(CURPATH) $(IMAGE_BUILD_OPTS)

# Run tests
test: generate vet manifests envtest
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir=/tmp -p path)" HOME="$(shell pwd)" go test ./... -coverprofile cover.out -v
test: generate lint manifests envtest
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir=/tmp -p path)" HOME="$(shell pwd)" go test -coverprofile cover.out -v ${TESTPKGS}

# Build manager binary
manager: generate vet _build-manager
manager: generate _build-manager

# Run against the configured Kubernetes cluster in ~/.kube/config
run: vet skopeo install
run: skopeo install
hack/run-locally.sh

# Install CRDs into a cluster
Expand Down Expand Up @@ -137,10 +138,6 @@ fmt: ## Go fmt your code
fmt-code:
go fmt ./...

# Run go vet against code
vet:
go vet ./...

# Generate code
generate: controller-gen
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..."
Expand All @@ -162,7 +159,7 @@ envtest: ## Download envtest-setup locally if necessary.

GOMOCK = $(shell pwd)/bin/mockgen
gomock:
$(call go-get-tool,$(GOMOCK),github.com/golang/mock/[email protected])
$(call go-install-tool,$(GOMOCK),github.com/golang/mock/[email protected])

# go-install-tool will 'go install' any package $2 and install it to $1.
define go-install-tool
Expand Down Expand Up @@ -210,7 +207,7 @@ redeploy-operator-virtual-cluster:
test-e2e-validation-only:
SUITE=./test/validation ./hack/run-e2e-conformance.sh

test-e2e: generate vet manifests skopeo envtest
test-e2e: generate manifests skopeo envtest
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir=/tmp -p path)"; source hack/env.sh; HOME="$(shell pwd)" go test ./test/e2e/... -timeout 60m -coverprofile cover.out -v

test-e2e-k8s: export NAMESPACE=sriov-network-operator
Expand All @@ -219,14 +216,9 @@ test-e2e-k8s: test-e2e
test-bindata-scripts: fakechroot
fakechroot ./test/scripts/enable-kargs_test.sh

test-%: generate vet manifests envtest
test-%: generate manifests envtest
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir=/tmp -p path)" HOME="$(shell pwd)" go test ./$*/... -coverprofile cover-$*.out -coverpkg ./... -v

# deploy-setup-k8s: export NAMESPACE=sriov-network-operator
# deploy-setup-k8s: export ADMISSION_CONTROLLERS_ENABLED=false
# deploy-setup-k8s: export CNI_BIN_PATH=/opt/cni/bin
# test-e2e-k8s: test-e2e

GOCOVMERGE = $(BIN_DIR)/gocovmerge
gocovmerge: ## Download gocovmerge locally if necessary.
$(call go-install-tool,$(GOCOVMERGE),github.com/shabbyrobe/gocovmerge/cmd/gocovmerge@latest)
Expand Down
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,37 @@ This feature was created to support deployments where the user want to use some
communication like storage network or out of band managment and the virtual functions must exist on boot and not only
after the operator and config-daemon are running.

#### Disabling SR-IOV Config Daemon plugins

It is possible to disable SR-IOV network operator config daemon plugins in case their operation
is not needed or un-desirable.

As an example, some plugins perform vendor specific firmware configuration
to enable SR-IOV (e.g `mellanox` plugin). certain deployment environments may prefer to perform such configuration
once during node provisioning, while ensuring the configuration will be compatible with any sriov network node policy
defined for the particular environment. This will reduce or completely eliminate the need for reboot of nodes during SR-IOV
configurations by the operator.

This can be done by setting SriovOperatorConfig `default` CR `spec.disablePlugins` with the list of desired plugins
to disable.

**Example**:

```yaml
apiVersion: sriovnetwork.openshift.io/v1
kind: SriovOperatorConfig
metadata:
name: default
namespace: sriov-network-operator
spec:
...
disablePlugins:
- mellanox
...
```

> **NOTE**: Currently only `mellanox` plugin can be disabled.

## Components and design

This operator is split into 2 components:
Expand Down
Loading