From 0b655a922c155479884702b004c0e1a94c93db73 Mon Sep 17 00:00:00 2001 From: Balendu Mouli Burla Date: Mon, 10 Feb 2025 19:05:23 +0000 Subject: [PATCH] SRIOV-FEC Operator Release v2.11.0 Signed-off-by: Balendu Mouli Burla --- CONTRIBUTING.md | 2 +- COPYRIGHT | 2 +- DEVELOPING.md | 2 +- Dockerfile | 6 +- Dockerfile.daemon | 6 +- Dockerfile.labeler | 6 +- Dockerfile.sriov-fec-index | 2 +- Makefile | 4 +- Security.md | 2 +- api/sriovfec/v1/groupversion_info.go | 2 +- .../v1/sriovfecclusterconfig_types.go | 2 +- api/sriovfec/v1/sriovfecnodeconfig_types.go | 2 +- api/sriovfec/v1/zz_generated.deepcopy.go | 2 +- api/sriovfec/v2/deepcopy_test.go | 2 +- api/sriovfec/v2/groupversion_info.go | 2 +- api/sriovfec/v2/helper.go | 2 +- api/sriovfec/v2/helper_test.go | 2 +- .../v2/sriovfecclusterconfig_types.go | 2 +- .../v2/sriovfecclusterconfig_types_test.go | 2 +- .../v2/sriovfecclusterconfig_webhook.go | 2 +- api/sriovfec/v2/sriovfecnodeconfig_types.go | 2 +- api/sriovfec/v2/webhook_suite_test.go | 2 +- api/sriovfec/v2/zz_generated.deepcopy.go | 2 +- api/sriovvrb/v1/groupversion_info.go | 2 +- api/sriovvrb/v1/helper.go | 2 +- .../v1/sriovvrbclusterconfig_types.go | 10 +- .../v1/sriovvrbclusterconfig_webhook.go | 2 +- api/sriovvrb/v1/sriovvrbnodeconfig_types.go | 2 +- api/sriovvrb/v1/webhook_suite_test.go | 2 +- api/sriovvrb/v1/zz_generated.deepcopy.go | 2 +- assets/100-labeler.yaml | 2 +- assets/200-device-plugin.yaml | 12 +- assets/300-daemon.yaml | 289 ----------- cmd/daemon/main.go | 2 +- cmd/labeler/main.go | 2 +- cmd/labeler/main_test.go | 2 +- config/certmanager/certificate.yaml | 2 +- config/certmanager/kustomization.yaml | 2 +- config/certmanager/kustomizeconfig.yaml | 2 +- config/crd/kustomization.yaml | 2 +- config/crd/kustomizeconfig.yaml | 2 +- ...cainjection_in_sriovfecclusterconfigs.yaml | 2 +- .../cainjection_in_sriovfecnodeconfigs.yaml | 2 +- ...on_in_sriovvrb_sriovvrbclusterconfigs.yaml | 2 +- ...ction_in_sriovvrb_sriovvrbnodeconfigs.yaml | 2 +- .../webhook_in_sriovfecclusterconfigs.yaml | 2 +- .../webhook_in_sriovfecnodeconfigs.yaml | 2 +- ...ok_in_sriovvrb_sriovvrbclusterconfigs.yaml | 2 +- ...bhook_in_sriovvrb_sriovvrbnodeconfigs.yaml | 2 +- config/default/kustomization.yaml | 2 +- config/default/manager_auth_proxy_patch.yaml | 2 +- config/default/manager_config_patch.yaml | 2 +- config/default/manager_webhook_patch.yaml | 2 +- config/default/webhookcainjection_patch.yaml | 2 +- config/manager/controller_manager_config.yaml | 2 +- config/manager/kustomization.yaml | 2 +- config/manager/manager.yaml | 348 +++++++++++++- .../sriov-fec.clusterserviceversion.yaml | 2 +- config/manifests/kustomization.yaml | 2 +- config/prometheus/kustomization.yaml | 2 +- config/prometheus/monitor.yaml | 2 +- .../rbac/auth_proxy_client_clusterrole.yaml | 2 +- config/rbac/auth_proxy_role.yaml | 2 +- config/rbac/auth_proxy_role_binding.yaml | 2 +- config/rbac/auth_proxy_service.yaml | 2 +- config/rbac/kustomization.yaml | 2 +- config/rbac/leader_election_role.yaml | 2 +- config/rbac/leader_election_role_binding.yaml | 2 +- config/rbac/role.yaml | 2 +- config/rbac/role_binding.yaml | 2 +- .../sriovfecclusterconfig_editor_role.yaml | 2 +- .../sriovfecclusterconfig_viewer_role.yaml | 2 +- .../rbac/sriovfecnodeconfig_editor_role.yaml | 2 +- .../rbac/sriovfecnodeconfig_viewer_role.yaml | 2 +- ...vrb_sriovvrbclusterconfig_editor_role.yaml | 2 +- ...vrb_sriovvrbclusterconfig_viewer_role.yaml | 2 +- ...iovvrb_sriovvrbnodeconfig_editor_role.yaml | 2 +- ...iovvrb_sriovvrbnodeconfig_viewer_role.yaml | 2 +- config/samples/kustomization.yaml | 2 +- ...ovfec_v2_sriovfecclusterconfig_acc100.yaml | 2 +- ...iovfec_v2_sriovfecclusterconfig_n3000.yaml | 2 +- ...sriovfec_v2_sriovfecnodeconfig_acc100.yaml | 2 +- .../sriovfec_v2_sriovfecnodeconfig_n3000.yaml | 2 +- .../sriovvrb_v1_sriovvrbclusterconfig.yaml | 2 +- .../sriovvrb_v1_sriovvrbnodeconfig.yaml | 2 +- config/scorecard/bases/config.yaml | 2 +- config/scorecard/kustomization.yaml | 2 +- config/scorecard/patches/basic.config.yaml | 2 +- config/scorecard/patches/olm.config.yaml | 2 +- config/webhook/kustomization.yaml | 2 +- config/webhook/kustomizeconfig.yaml | 2 +- config/webhook/manifests.yaml | 2 +- config/webhook/service.yaml | 2 +- .../sriovfecclusterconfig_controller.go | 2 +- .../sriovfecclusterconfig_controller_test.go | 2 +- controllers/sriovfec/suite_test.go | 2 +- .../correct/acc100_no_maxqueuesize.yaml | 2 +- .../correct/acc100_no_pfmode.yaml | 2 +- .../correct/acc100_pfmode_equals_false.yaml | 2 +- .../correct/label_and_device_id.yaml | 2 +- .../correct/labels_and_device_id.yaml | 2 +- .../correct/labels_no_accelerator.yaml | 2 +- .../correct/missing_priority.yaml | 2 +- .../correct/n3000_no_pfmode.yaml | 2 +- .../correct/n3000_pfmode_equals_false.yaml | 2 +- .../correct/no_labels_and_no_accelerator.yaml | 2 +- .../correct/no_labels_and_only_device_id.yaml | 2 +- .../correct/no_labels_and_only_driver.yaml | 2 +- .../correct/no_labels_and_only_max_vfs.yaml | 2 +- .../correct/no_labels_and_only_pci_addr.yaml | 2 +- .../no_labels_and_only_vendor_id#1.yaml | 2 +- .../no_labels_and_only_vendor_id#2.yaml | 2 +- .../acc100_drainSkip_wrong_value.yaml | 2 +- .../incorrect/acc100_pfmode_equals_true.yaml | 2 +- .../incorrect/n3000_pfmode_equals_true.yaml | 2 +- .../sriovvrbclusterconfig_controller.go | 13 +- .../sriovvrbclusterconfig_controller_test.go | 2 +- controllers/sriovvrb/suite_test.go | 2 +- .../correct/label_and_device_id.yaml | 2 +- .../correct/labels_and_device_id.yaml | 2 +- .../correct/labels_no_accelerator.yaml | 2 +- .../correct/missing_priority.yaml | 2 +- .../correct/no_labels_and_no_accelerator.yaml | 2 +- .../correct/no_labels_and_only_device_id.yaml | 2 +- .../correct/no_labels_and_only_driver.yaml | 2 +- .../correct/no_labels_and_only_max_vfs.yaml | 2 +- .../correct/no_labels_and_only_pci_addr.yaml | 2 +- .../no_labels_and_only_vendor_id#1.yaml | 2 +- .../no_labels_and_only_vendor_id#2.yaml | 2 +- .../correct/vrb1_no_maxqueuesize.yaml | 2 +- .../clusterconfig/correct/vrb1_no_pfmode.yaml | 2 +- .../correct/vrb1_pfmode_equals_false.yaml | 2 +- .../correct/vrb2_no_maxqueuesize.yaml | 2 +- .../clusterconfig/correct/vrb2_no_pfmode.yaml | 2 +- .../correct/vrb2_pfmode_equals_false.yaml | 2 +- .../incorrect/vrb1_drainSkip_wrong_value.yaml | 2 +- .../incorrect/vrb1_pfmode_equals_true.yaml | 2 +- .../incorrect/vrb2_pfmode_equals_true.yaml | 2 +- copyright.sh | 2 +- gather_sriovfec_logs.sh | 2 +- hack/boilerplate.go.txt | 2 +- main.go | 2 +- misc/src/README.md | 2 +- pkg/common/assets/asset.go | 2 +- pkg/common/assets/manager.go | 4 +- pkg/common/assets/manager_test.go | 2 +- pkg/common/assets/suite_test.go | 2 +- pkg/common/assets/test/101-fake-labeler.yaml | 2 +- pkg/common/drainhelper/drainhelper.go | 2 +- pkg/common/drainhelper/drainhelper_test.go | 2 +- pkg/common/drainhelper/suite_test.go | 2 +- pkg/common/utils/logger_wrapper.go | 2 +- pkg/common/utils/slices.go | 2 +- pkg/common/utils/utils.go | 43 +- pkg/common/utils/utils_test.go | 2 +- pkg/daemon/bbdevconfig.go | 2 +- pkg/daemon/bbdevconfig_ini_generator.go | 2 +- pkg/daemon/bbdevconfig_test.go | 2 +- pkg/daemon/common.go | 2 +- pkg/daemon/common_test.go | 2 +- pkg/daemon/daemon.go | 2 +- pkg/daemon/daemon_fec.go | 68 ++- pkg/daemon/daemon_reconcile_test.go | 332 ++++++++++++- pkg/daemon/daemon_test.go | 2 +- pkg/daemon/daemon_vrb.go | 452 +++++++++++++++++- pkg/daemon/device_plugin_controller.go | 2 +- pkg/daemon/inventory.go | 2 +- pkg/daemon/inventory_test.go | 2 +- pkg/daemon/node_management.go | 17 +- pkg/daemon/package_config.go | 2 +- pkg/daemon/pf_bb_config_cli.go | 2 +- pkg/daemon/pf_bb_config_cli_test.go | 2 +- pkg/daemon/suite_test.go | 2 +- pkg/daemon/telemetry.go | 2 +- pkg/daemon/telemetry_test.go | 2 +- .../sample-archive/inner-dir/inner-file-1 | 2 +- .../archives/sample-archive/outer-file-1 | 2 +- .../archives/sample-archive/outer-file-2 | 2 +- pkg/daemon/testdata/centos_os_release | 2 +- pkg/daemon/testdata/cmdline_test | 2 +- .../testdata/cmdline_test_missing_param | 2 +- pkg/daemon/testdata/rhcos_os_release | 2 +- pkg/daemon/testdata/rhel_os_release | 2 +- pkg/daemon/testdata/unknown_os_release | 2 +- pkg/daemon/utils.go | 2 +- pkg/daemon/utils_test.go | 2 +- spec/kubernetes-deployment.md | 2 +- spec/openshift-deployment.md | 2 +- spec/sriov-fec-operator-release-notes.md | 26 +- spec/sriov-fec-operator.md | 70 ++- spec/sriov-fec-selector-based-api.puml | 2 +- ...vran-accelerators-supported-by-operator.md | 2 +- 192 files changed, 1525 insertions(+), 531 deletions(-) delete mode 100644 assets/300-daemon.yaml diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 28dcd87..81da7dc 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ ```text SPDX-License-Identifier: Apache-2.0 -Copyright (c) 2020-2024 Intel Corporation +Copyright (c) 2020-2025 Intel Corporation ``` # Contribution Guide diff --git a/COPYRIGHT b/COPYRIGHT index 257ad77..97e0d13 100644 --- a/COPYRIGHT +++ b/COPYRIGHT @@ -1,2 +1,2 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation diff --git a/DEVELOPING.md b/DEVELOPING.md index 3fb1dce..2abdafc 100644 --- a/DEVELOPING.md +++ b/DEVELOPING.md @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation # Development Guide diff --git a/Dockerfile b/Dockerfile index aac7b03..c230fc0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,8 @@ ## SPDX-License-Identifier: Apache-2.0 -## Copyright (c) 2020-2024 Intel Corporation +## Copyright (c) 2020-2025 Intel Corporation # Build the manager binary -FROM golang:1.23.4 as builder +FROM golang:1.23.4 AS builder WORKDIR /workspace # Copy the Go Modules manifests @@ -22,7 +22,7 @@ COPY controllers/ controllers/ # Build RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o manager main.go -FROM registry.access.redhat.com/ubi9/ubi-micro:9.5-1733126338 +FROM registry.access.redhat.com/ubi9/ubi-micro:9.5-1736426761 ARG VERSION ### Required OpenShift Labels diff --git a/Dockerfile.daemon b/Dockerfile.daemon index bafcd74..8ad129c 100644 --- a/Dockerfile.daemon +++ b/Dockerfile.daemon @@ -1,11 +1,11 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation FROM golang:1.23.4 AS builder WORKDIR /workspace-pf -RUN git clone --depth 1 --branch v24.11 https://github.com/intel/pf-bb-config /workspace-pf/pf-bb-config +RUN git clone --depth 1 --branch v25.01 https://github.com/intel/pf-bb-config /workspace-pf/pf-bb-config WORKDIR /workspace-pf/pf-bb-config @@ -23,7 +23,7 @@ COPY api api/ RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o sriov_fec_daemon cmd/daemon/main.go -FROM registry.access.redhat.com/ubi9/ubi:9.5-1732804088 AS package_installer +FROM registry.access.redhat.com/ubi9/ubi:9.5-1736404036 AS package_installer RUN yum install \ kmod-28-10.el9 \ diff --git a/Dockerfile.labeler b/Dockerfile.labeler index a7badd7..3e80f2a 100644 --- a/Dockerfile.labeler +++ b/Dockerfile.labeler @@ -1,7 +1,7 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation -FROM golang:1.23.4 as builder +FROM golang:1.23.4 AS builder WORKDIR /workspace COPY go.mod go.sum ./ @@ -15,7 +15,7 @@ RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o node_lab RUN wget --progress=dot:giga https://pci-ids.ucw.cz/v2.2/pci.ids.gz -O pci.ids.gz && gunzip pci.ids.gz -FROM registry.access.redhat.com/ubi9/ubi-micro:9.5-1733126338 +FROM registry.access.redhat.com/ubi9/ubi-micro:9.5-1736426761 ARG VERSION ### Required OpenShift Labels diff --git a/Dockerfile.sriov-fec-index b/Dockerfile.sriov-fec-index index 34c50e5..cf546cf 100644 --- a/Dockerfile.sriov-fec-index +++ b/Dockerfile.sriov-fec-index @@ -1,5 +1,5 @@ ## SPDX-License-Identifier: Apache-2.0 -## Copyright (c) 2020-2024 Intel Corporation +## Copyright (c) 2020-2025 Intel Corporation # The base image is expected to contain # /bin/opm (with a serve subcommand) and /bin/grpc_health_probe diff --git a/Makefile b/Makefile index dfa53d5..4fd037f 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,12 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation # Default k8s command-line tool exec export CLI_EXEC?=oc # Container format for podman. Required to build containers with "ManifestType": "application/vnd.oci.image.manifest.v2+json", export BUILDAH_FORMAT=docker # Current Operator version -VERSION ?= 2.10.0 +VERSION ?= 2.11.0 # Supported channels CHANNELS ?= stable # Default channel diff --git a/Security.md b/Security.md index 4acd68c..8b433de 100644 --- a/Security.md +++ b/Security.md @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation # Security Policy Intel is committed to rapidly addressing security vulnerabilities affecting our customers and providing clear guidance on the solution, impact, severity and mitigation. diff --git a/api/sriovfec/v1/groupversion_info.go b/api/sriovfec/v1/groupversion_info.go index c415f9d..bb57600 100644 --- a/api/sriovfec/v1/groupversion_info.go +++ b/api/sriovfec/v1/groupversion_info.go @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright (c) 2020-2024 Intel Corporation +// Copyright (c) 2020-2025 Intel Corporation /* diff --git a/api/sriovfec/v1/sriovfecclusterconfig_types.go b/api/sriovfec/v1/sriovfecclusterconfig_types.go index 90bbc21..a564119 100644 --- a/api/sriovfec/v1/sriovfecclusterconfig_types.go +++ b/api/sriovfec/v1/sriovfecclusterconfig_types.go @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright (c) 2020-2024 Intel Corporation +// Copyright (c) 2020-2025 Intel Corporation package v1 diff --git a/api/sriovfec/v1/sriovfecnodeconfig_types.go b/api/sriovfec/v1/sriovfecnodeconfig_types.go index b6b3b3a..cedc467 100644 --- a/api/sriovfec/v1/sriovfecnodeconfig_types.go +++ b/api/sriovfec/v1/sriovfecnodeconfig_types.go @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright (c) 2020-2024 Intel Corporation +// Copyright (c) 2020-2025 Intel Corporation package v1 diff --git a/api/sriovfec/v1/zz_generated.deepcopy.go b/api/sriovfec/v1/zz_generated.deepcopy.go index 9b45dde..6297ff5 100644 --- a/api/sriovfec/v1/zz_generated.deepcopy.go +++ b/api/sriovfec/v1/zz_generated.deepcopy.go @@ -1,7 +1,7 @@ //go:build !ignore_autogenerated // SPDX-License-Identifier: Apache-2.0 -// Copyright (c) 2020-2024 Intel Corporation +// Copyright (c) 2020-2025 Intel Corporation // Code generated by controller-gen. DO NOT EDIT. diff --git a/api/sriovfec/v2/deepcopy_test.go b/api/sriovfec/v2/deepcopy_test.go index 78fd96f..c5d8b88 100644 --- a/api/sriovfec/v2/deepcopy_test.go +++ b/api/sriovfec/v2/deepcopy_test.go @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright (c) 2020-2024 Intel Corporation +// Copyright (c) 2020-2025 Intel Corporation package v2 diff --git a/api/sriovfec/v2/groupversion_info.go b/api/sriovfec/v2/groupversion_info.go index 1a522b6..92bc5d6 100644 --- a/api/sriovfec/v2/groupversion_info.go +++ b/api/sriovfec/v2/groupversion_info.go @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright (c) 2020-2024 Intel Corporation +// Copyright (c) 2020-2025 Intel Corporation // Package v2 contains API Schema definitions for the sriovfec v2 API group // +kubebuilder:object:generate=true diff --git a/api/sriovfec/v2/helper.go b/api/sriovfec/v2/helper.go index 359072b..19be574 100644 --- a/api/sriovfec/v2/helper.go +++ b/api/sriovfec/v2/helper.go @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright (c) 2020-2024 Intel Corporation +// Copyright (c) 2020-2025 Intel Corporation package v2 diff --git a/api/sriovfec/v2/helper_test.go b/api/sriovfec/v2/helper_test.go index 794d346..9bde5d4 100644 --- a/api/sriovfec/v2/helper_test.go +++ b/api/sriovfec/v2/helper_test.go @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright (c) 2020-2024 Intel Corporation +// Copyright (c) 2020-2025 Intel Corporation package v2 diff --git a/api/sriovfec/v2/sriovfecclusterconfig_types.go b/api/sriovfec/v2/sriovfecclusterconfig_types.go index 1b61541..5be613f 100644 --- a/api/sriovfec/v2/sriovfecclusterconfig_types.go +++ b/api/sriovfec/v2/sriovfecclusterconfig_types.go @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright (c) 2020-2024 Intel Corporation +// Copyright (c) 2020-2025 Intel Corporation package v2 diff --git a/api/sriovfec/v2/sriovfecclusterconfig_types_test.go b/api/sriovfec/v2/sriovfecclusterconfig_types_test.go index cc636a5..1694e7c 100644 --- a/api/sriovfec/v2/sriovfecclusterconfig_types_test.go +++ b/api/sriovfec/v2/sriovfecclusterconfig_types_test.go @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright (c) 2020-2024 Intel Corporation +// Copyright (c) 2020-2025 Intel Corporation package v2 diff --git a/api/sriovfec/v2/sriovfecclusterconfig_webhook.go b/api/sriovfec/v2/sriovfecclusterconfig_webhook.go index 01f35bd..4845f55 100644 --- a/api/sriovfec/v2/sriovfecclusterconfig_webhook.go +++ b/api/sriovfec/v2/sriovfecclusterconfig_webhook.go @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright (c) 2020-2024 Intel Corporation +// Copyright (c) 2020-2025 Intel Corporation package v2 diff --git a/api/sriovfec/v2/sriovfecnodeconfig_types.go b/api/sriovfec/v2/sriovfecnodeconfig_types.go index 211a90d..c2377cb 100644 --- a/api/sriovfec/v2/sriovfecnodeconfig_types.go +++ b/api/sriovfec/v2/sriovfecnodeconfig_types.go @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright (c) 2020-2024 Intel Corporation +// Copyright (c) 2020-2025 Intel Corporation package v2 diff --git a/api/sriovfec/v2/webhook_suite_test.go b/api/sriovfec/v2/webhook_suite_test.go index 7a4f25e..b0149dc 100644 --- a/api/sriovfec/v2/webhook_suite_test.go +++ b/api/sriovfec/v2/webhook_suite_test.go @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright (c) 2020-2024 Intel Corporation +// Copyright (c) 2020-2025 Intel Corporation package v2 diff --git a/api/sriovfec/v2/zz_generated.deepcopy.go b/api/sriovfec/v2/zz_generated.deepcopy.go index a772772..c1fefea 100644 --- a/api/sriovfec/v2/zz_generated.deepcopy.go +++ b/api/sriovfec/v2/zz_generated.deepcopy.go @@ -1,7 +1,7 @@ //go:build !ignore_autogenerated // SPDX-License-Identifier: Apache-2.0 -// Copyright (c) 2020-2024 Intel Corporation +// Copyright (c) 2020-2025 Intel Corporation // Code generated by controller-gen. DO NOT EDIT. diff --git a/api/sriovvrb/v1/groupversion_info.go b/api/sriovvrb/v1/groupversion_info.go index 01da991..e3cb74d 100644 --- a/api/sriovvrb/v1/groupversion_info.go +++ b/api/sriovvrb/v1/groupversion_info.go @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright (c) 2020-2024 Intel Corporation +// Copyright (c) 2020-2025 Intel Corporation // Package v1 contains API Schema definitions for the vrb v1 API group // +kubebuilder:object:generate=true diff --git a/api/sriovvrb/v1/helper.go b/api/sriovvrb/v1/helper.go index d128d32..ee6e3bd 100644 --- a/api/sriovvrb/v1/helper.go +++ b/api/sriovvrb/v1/helper.go @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright (c) 2020-2024 Intel Corporation +// Copyright (c) 2020-2025 Intel Corporation package v1 diff --git a/api/sriovvrb/v1/sriovvrbclusterconfig_types.go b/api/sriovvrb/v1/sriovvrbclusterconfig_types.go index 8b1de02..9857557 100644 --- a/api/sriovvrb/v1/sriovvrbclusterconfig_types.go +++ b/api/sriovvrb/v1/sriovvrbclusterconfig_types.go @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright (c) 2020-2024 Intel Corporation +// Copyright (c) 2020-2025 Intel Corporation package v1 @@ -160,6 +160,9 @@ type PhysicalFunctionConfigExt struct { // BBDevConfig is a config for PF's queues BBDevConfig BBDevConfig `json:"bbDevConfig"` + + // VrbResourceName is optional for custom resource name for sriov-device-plugin + VrbResourceName string `json:"vrbResourceName"` } // EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! @@ -187,6 +190,11 @@ type SriovVrbClusterConfigSpec struct { // +operator-sdk:csv:customresourcedefinitions:type=spec // Skips drain process when true; default false. Should be true if operator is running on SNO DrainSkip *bool `json:"drainSkip,omitempty"` + + // Indicates custom resource name for sriov-device-plugin + // +kubebuilder:validation:Optional + // +kubebuilder:validation:Pattern=`^[a-zA-Z0-9-_]+$` + VrbResourceName string `json:"vrbResourceName,omitempty"` } type AcceleratorSelector struct { diff --git a/api/sriovvrb/v1/sriovvrbclusterconfig_webhook.go b/api/sriovvrb/v1/sriovvrbclusterconfig_webhook.go index bb94468..633ffbd 100644 --- a/api/sriovvrb/v1/sriovvrbclusterconfig_webhook.go +++ b/api/sriovvrb/v1/sriovvrbclusterconfig_webhook.go @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright (c) 2020-2024 Intel Corporation +// Copyright (c) 2020-2025 Intel Corporation package v1 diff --git a/api/sriovvrb/v1/sriovvrbnodeconfig_types.go b/api/sriovvrb/v1/sriovvrbnodeconfig_types.go index d7d563d..fcf6666 100644 --- a/api/sriovvrb/v1/sriovvrbnodeconfig_types.go +++ b/api/sriovvrb/v1/sriovvrbnodeconfig_types.go @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright (c) 2020-2024 Intel Corporation +// Copyright (c) 2020-2025 Intel Corporation package v1 diff --git a/api/sriovvrb/v1/webhook_suite_test.go b/api/sriovvrb/v1/webhook_suite_test.go index f4e5600..26b9302 100644 --- a/api/sriovvrb/v1/webhook_suite_test.go +++ b/api/sriovvrb/v1/webhook_suite_test.go @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright (c) 2020-2024 Intel Corporation +// Copyright (c) 2020-2025 Intel Corporation package v1 diff --git a/api/sriovvrb/v1/zz_generated.deepcopy.go b/api/sriovvrb/v1/zz_generated.deepcopy.go index a594150..e5656e5 100644 --- a/api/sriovvrb/v1/zz_generated.deepcopy.go +++ b/api/sriovvrb/v1/zz_generated.deepcopy.go @@ -1,7 +1,7 @@ //go:build !ignore_autogenerated // SPDX-License-Identifier: Apache-2.0 -// Copyright (c) 2020-2024 Intel Corporation +// Copyright (c) 2020-2025 Intel Corporation // Code generated by controller-gen. DO NOT EDIT. diff --git a/assets/100-labeler.yaml b/assets/100-labeler.yaml index 4dcd00f..58d7cf6 100644 --- a/assets/100-labeler.yaml +++ b/assets/100-labeler.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation apiVersion: v1 kind: ConfigMap diff --git a/assets/200-device-plugin.yaml b/assets/200-device-plugin.yaml index c42c37d..1de213d 100644 --- a/assets/200-device-plugin.yaml +++ b/assets/200-device-plugin.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation apiVersion: v1 kind: ConfigMap @@ -55,7 +55,7 @@ data: { "resourceList": [ { - "resourceName": "{{ .SRIOV_FEC_LTE_RESOURCE_NAME}}", + "resourceName": "{{ .SRIOV_FEC_LTE_RESOURCE_NAME }}", "deviceType": "accelerator", "selectors": { "vendors": ["1172"], @@ -69,7 +69,7 @@ data: } }, { - "resourceName": "{{ .SRIOV_FEC_5G_RESOURCE_NAME}}", + "resourceName": "{{ .SRIOV_FEC_5G_RESOURCE_NAME }}", "deviceType": "accelerator", "selectors": { "vendors": ["8086"], @@ -83,7 +83,7 @@ data: } }, { - "resourceName": "{{ .SRIOV_FEC_ACC100_RESOURCE_NAME}}", + "resourceName": "{{ .SRIOV_FEC_ACC100_RESOURCE_NAME }}", "deviceType": "accelerator", "selectors": { "vendors": ["8086"], @@ -97,7 +97,7 @@ data: } }, { - "resourceName": "{{ .SRIOV_FEC_ACC200_RESOURCE_NAME}}", + "resourceName": "{{ .SRIOV_FEC_ACC200_RESOURCE_NAME }}", "deviceType": "accelerator", "selectors": { "vendors": ["8086"], @@ -111,7 +111,7 @@ data: } }, { - "resourceName": "{{ .SRIOV_VRB_VRB2_RESOURCE_NAME}}", + "resourceName": "{{ .SRIOV_FEC_VRB2_RESOURCE_NAME }}", "deviceType": "accelerator", "selectors": { "vendors": ["8086"], diff --git a/assets/300-daemon.yaml b/assets/300-daemon.yaml deleted file mode 100644 index 9bf2d85..0000000 --- a/assets/300-daemon.yaml +++ /dev/null @@ -1,289 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation - -apiVersion: v1 -kind: ConfigMap -metadata: - name: daemon-config - namespace: {{ .SRIOV_FEC_NAMESPACE }} -immutable: false -data: - serviceAccount: | - apiVersion: v1 - kind: ServiceAccount - metadata: - name: sriov-fec-daemon - namespace: {{ .SRIOV_FEC_NAMESPACE }} - role: | - apiVersion: rbac.authorization.k8s.io/v1 - kind: Role - metadata: - name: sriov-fec-daemon - namespace: {{ .SRIOV_FEC_NAMESPACE }} - rules: - - apiGroups: - - sriovfec.intel.com - resources: - - sriovfecclusterconfigs - - sriovfecnodeconfigs - verbs: - - get - - list - - watch - - create - - update - - patch - - delete - - apiGroups: - - sriovfec.intel.com - resources: - - sriovfecclusterconfigs/status - - sriovfecnodeconfigs/status - verbs: - - get - - update - - patch - - apiGroups: - - sriovvrb.intel.com - resources: - - sriovvrbclusterconfigs - - sriovvrbnodeconfigs - verbs: - - get - - list - - watch - - create - - update - - patch - - delete - - apiGroups: - - sriovvrb.intel.com - resources: - - sriovvrbclusterconfigs/status - - sriovvrbnodeconfigs/status - verbs: - - get - - update - - patch - - apiGroups: - - security.openshift.io - resources: - - securitycontextconstraints - verbs: - - use - resourceNames: - - privileged - - apiGroups: - - coordination.k8s.io - resources: - - leases - verbs: - - get - - list - - watch - - create - - update - - patch - - delete - roleBinding: | - apiVersion: rbac.authorization.k8s.io/v1 - kind: RoleBinding - metadata: - name: sriov-fec-daemon - namespace: {{ .SRIOV_FEC_NAMESPACE }} - roleRef: - apiGroup: rbac.authorization.k8s.io - kind: Role - name: sriov-fec-daemon - {{ if eq (.SRIOV_FEC_GENERIC_K8S|ToLower) `false` }} - namespace: {{ .SRIOV_FEC_NAMESPACE }} - {{ end }} - subjects: - - kind: ServiceAccount - name: sriov-fec-daemon - namespace: {{ .SRIOV_FEC_NAMESPACE }} - {{ if eq (.SRIOV_FEC_GENERIC_K8S|ToLower) `false` }} - userNames: - - system:serviceaccount:{{ .SRIOV_FEC_NAMESPACE }}:sriov-fec-daemon - {{ end }} - clusterRole: | - apiVersion: rbac.authorization.k8s.io/v1 - kind: ClusterRole - metadata: - name: sriov-fec-daemon - rules: - - apiGroups: [""] - resources: ["pods"] - verbs: ["get","list","watch","create","update", "patch", "delete"] - - apiGroups: [""] - resources: ["nodes"] - verbs: ["get", "list", "watch", "patch", "update"] - - apiGroups: ["apps"] - resources: ["daemonsets"] - verbs: ["get"] - - apiGroups: [""] - resources: ["pods/eviction"] - verbs: ["create"] - clusterRoleBinding: | - apiVersion: rbac.authorization.k8s.io/v1 - kind: ClusterRoleBinding - metadata: - name: sriov-fec-daemon - subjects: - - kind: ServiceAccount - name: sriov-fec-daemon - namespace: {{ .SRIOV_FEC_NAMESPACE }} - roleRef: - kind: ClusterRole - name: sriov-fec-daemon - apiGroup: rbac.authorization.k8s.io - namespace: {{ .SRIOV_FEC_NAMESPACE }} - secret: | - apiVersion: v1 - kind: Secret - metadata: - name: vfio-token - namespace: {{ .SRIOV_FEC_NAMESPACE }} - type: Opaque - stringData: - VFIO_TOKEN: {{ .SRIOV_FEC_VFIO_TOKEN }} - immutable: true - daemonSet: | - apiVersion: apps/v1 - kind: DaemonSet - metadata: - labels: - app: sriov-fec-daemonset - name: sriov-fec-daemonset - namespace: {{ .SRIOV_FEC_NAMESPACE }} - annotations: - openshift.io/scc: sriov-fec-daemon - spec: - selector: - matchLabels: - app: sriov-fec-daemonset - template: - metadata: - # Mark this pod as a critical add-on; when enabled, the critical add-on scheduler - # reserves resources for critical add-on pods so that they can be rescheduled after - # a failure. This annotation works in tandem with the toleration below. - annotations: - scheduler.alpha.kubernetes.io/critical-pod: "" - labels: - app: sriov-fec-daemonset - spec: - nodeSelector: - fpga.intel.com/intel-accelerator-present: "" - {{ if eq (.SRIOV_FEC_GENERIC_K8S|ToLower) `true` }} - shareProcessNamespace: true - {{ end }} - tolerations: - - key: intel.com/sriovfec - operator: Exists - effect: NoSchedule - serviceAccount: sriov-fec-daemon - serviceAccountName: sriov-fec-daemon - hostPID: false - hostNetwork: false - dnsPolicy: Default - containers: - - name: sriov-fec-daemon - image: {{ .SRIOV_FEC_DAEMON_IMAGE }} - imagePullPolicy: IfNotPresent - livenessProbe: - httpGet: - path: /healthz - port: 8081 - initialDelaySeconds: 15 - periodSeconds: 20 - readinessProbe: - httpGet: - path: /readyz - port: 8081 - initialDelaySeconds: 5 - periodSeconds: 10 - ports: - - containerPort: 8080 - name: bbdevconfig - volumeMounts: - - name: tlscert - mountPath: "/etc/certificate" - readOnly: true - - name: devvfio - mountPath: /dev/vfio - readOnly: true - - name: vfiotoken - mountPath: /sriov_config/ - readOnly: true - - name: libmodules - mountPath: /lib/modules - readOnly: true - - mountPath: /sriov_config/config - name: config-volume - readOnly: true - - name: logs - mountPath: /var/log - - name: tmp - mountPath: /tmp - - name: lockdown - mountPath: /sys/kernel/security - readOnly: true - env: - - name: SRIOV_FEC_NAMESPACE - valueFrom: - fieldRef: - fieldPath: metadata.namespace - - name: NODENAME - valueFrom: - fieldRef: - fieldPath: spec.nodeName - - name: DRAIN_TIMEOUT_SECONDS - value: "90" - - name: LEASE_DURATION_SECONDS - value: "600" - - name: SRIOV_FEC_METRIC_GATHER_INTERVAL - value: {{ .SRIOV_FEC_METRIC_GATHER_INTERVAL }} - securityContext: - readOnlyRootFilesystem: true - privileged: true - {{ if eq (.SRIOV_FEC_GENERIC_K8S|ToLower) `true` }} - runAsUser: 0 - capabilities: - add: - - "ALL" - {{ end }} - volumes: - - name: tlscert - secret: - secretName: tls-cert - optional: true - - configMap: - defaultMode: 420 - items: - - key: accelerators.json - path: accelerators.json - - key: accelerators_vrb.json - path: accelerators_vrb.json - name: supported-accelerators - name: config-volume - - name: vfiotoken - secret: - secretName: vfio-token - optional: false - items: - - key: VFIO_TOKEN - path: vfiotoken - - name: devvfio - hostPath: - path: /dev/vfio - - name: libmodules - hostPath: - path: /lib/modules - - name: logs - emptyDir: {} - - name: tmp - emptyDir: {} - - name: lockdown - hostPath: - path: /sys/kernel/security - diff --git a/cmd/daemon/main.go b/cmd/daemon/main.go index 408c68f..8385498 100644 --- a/cmd/daemon/main.go +++ b/cmd/daemon/main.go @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright (c) 2020-2024 Intel Corporation +// Copyright (c) 2020-2025 Intel Corporation package main diff --git a/cmd/labeler/main.go b/cmd/labeler/main.go index d62bcea..71a3d16 100644 --- a/cmd/labeler/main.go +++ b/cmd/labeler/main.go @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright (c) 2020-2024 Intel Corporation +// Copyright (c) 2020-2025 Intel Corporation package main diff --git a/cmd/labeler/main_test.go b/cmd/labeler/main_test.go index 6577666..862e0e7 100644 --- a/cmd/labeler/main_test.go +++ b/cmd/labeler/main_test.go @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright (c) 2020-2024 Intel Corporation +// Copyright (c) 2020-2025 Intel Corporation package main diff --git a/config/certmanager/certificate.yaml b/config/certmanager/certificate.yaml index 5703a9d..f6f723e 100644 --- a/config/certmanager/certificate.yaml +++ b/config/certmanager/certificate.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation # The following manifests contain a self-signed issuer CR and a certificate CR. # More document can be found at https://docs.cert-manager.io diff --git a/config/certmanager/kustomization.yaml b/config/certmanager/kustomization.yaml index b2bc243..508ef2d 100644 --- a/config/certmanager/kustomization.yaml +++ b/config/certmanager/kustomization.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation resources: - certificate.yaml diff --git a/config/certmanager/kustomizeconfig.yaml b/config/certmanager/kustomizeconfig.yaml index c2207ca..e7b3a98 100644 --- a/config/certmanager/kustomizeconfig.yaml +++ b/config/certmanager/kustomizeconfig.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation # This configuration is for teaching kustomize how to update name ref and var substitution nameReference: diff --git a/config/crd/kustomization.yaml b/config/crd/kustomization.yaml index a329c92..2d09d61 100644 --- a/config/crd/kustomization.yaml +++ b/config/crd/kustomization.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation # This kustomization.yaml is not intended to be run by itself, # since it depends on service name and namespace that are out of this kustomize package. diff --git a/config/crd/kustomizeconfig.yaml b/config/crd/kustomizeconfig.yaml index dc9c961..d08b751 100644 --- a/config/crd/kustomizeconfig.yaml +++ b/config/crd/kustomizeconfig.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation # This file is for teaching kustomize how to substitute name and namespace reference in CRD nameReference: diff --git a/config/crd/patches/cainjection_in_sriovfecclusterconfigs.yaml b/config/crd/patches/cainjection_in_sriovfecclusterconfigs.yaml index 8639164..3bc9c3b 100644 --- a/config/crd/patches/cainjection_in_sriovfecclusterconfigs.yaml +++ b/config/crd/patches/cainjection_in_sriovfecclusterconfigs.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation # The following patch adds a directive for certmanager to inject CA into the CRD apiVersion: apiextensions.k8s.io/v1 diff --git a/config/crd/patches/cainjection_in_sriovfecnodeconfigs.yaml b/config/crd/patches/cainjection_in_sriovfecnodeconfigs.yaml index 4c4f6c2..f6d0d02 100644 --- a/config/crd/patches/cainjection_in_sriovfecnodeconfigs.yaml +++ b/config/crd/patches/cainjection_in_sriovfecnodeconfigs.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation # The following patch adds a directive for certmanager to inject CA into the CRD apiVersion: apiextensions.k8s.io/v1 diff --git a/config/crd/patches/cainjection_in_sriovvrb_sriovvrbclusterconfigs.yaml b/config/crd/patches/cainjection_in_sriovvrb_sriovvrbclusterconfigs.yaml index 2dce69e..c3245c6 100644 --- a/config/crd/patches/cainjection_in_sriovvrb_sriovvrbclusterconfigs.yaml +++ b/config/crd/patches/cainjection_in_sriovvrb_sriovvrbclusterconfigs.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation # The following patch adds a directive for certmanager to inject CA into the CRD apiVersion: apiextensions.k8s.io/v1 diff --git a/config/crd/patches/cainjection_in_sriovvrb_sriovvrbnodeconfigs.yaml b/config/crd/patches/cainjection_in_sriovvrb_sriovvrbnodeconfigs.yaml index 7b11a3f..8533555 100644 --- a/config/crd/patches/cainjection_in_sriovvrb_sriovvrbnodeconfigs.yaml +++ b/config/crd/patches/cainjection_in_sriovvrb_sriovvrbnodeconfigs.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation # The following patch adds a directive for certmanager to inject CA into the CRD apiVersion: apiextensions.k8s.io/v1 diff --git a/config/crd/patches/webhook_in_sriovfecclusterconfigs.yaml b/config/crd/patches/webhook_in_sriovfecclusterconfigs.yaml index ba73181..6a43af5 100644 --- a/config/crd/patches/webhook_in_sriovfecclusterconfigs.yaml +++ b/config/crd/patches/webhook_in_sriovfecclusterconfigs.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation # The following patch enables a conversion webhook for the CRD apiVersion: apiextensions.k8s.io/v1 diff --git a/config/crd/patches/webhook_in_sriovfecnodeconfigs.yaml b/config/crd/patches/webhook_in_sriovfecnodeconfigs.yaml index c74e445..cd69bb8 100644 --- a/config/crd/patches/webhook_in_sriovfecnodeconfigs.yaml +++ b/config/crd/patches/webhook_in_sriovfecnodeconfigs.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation # The following patch enables a conversion webhook for the CRD apiVersion: apiextensions.k8s.io/v1 diff --git a/config/crd/patches/webhook_in_sriovvrb_sriovvrbclusterconfigs.yaml b/config/crd/patches/webhook_in_sriovvrb_sriovvrbclusterconfigs.yaml index 663061f..7b92bb2 100644 --- a/config/crd/patches/webhook_in_sriovvrb_sriovvrbclusterconfigs.yaml +++ b/config/crd/patches/webhook_in_sriovvrb_sriovvrbclusterconfigs.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation # The following patch enables a conversion webhook for the CRD apiVersion: apiextensions.k8s.io/v1 diff --git a/config/crd/patches/webhook_in_sriovvrb_sriovvrbnodeconfigs.yaml b/config/crd/patches/webhook_in_sriovvrb_sriovvrbnodeconfigs.yaml index 8cd58d5..d3ca273 100644 --- a/config/crd/patches/webhook_in_sriovvrb_sriovvrbnodeconfigs.yaml +++ b/config/crd/patches/webhook_in_sriovvrb_sriovvrbnodeconfigs.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation # The following patch enables a conversion webhook for the CRD apiVersion: apiextensions.k8s.io/v1 diff --git a/config/default/kustomization.yaml b/config/default/kustomization.yaml index dc4a996..6301733 100644 --- a/config/default/kustomization.yaml +++ b/config/default/kustomization.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation # Adds namespace to all resources. namespace: sriov-fec-system diff --git a/config/default/manager_auth_proxy_patch.yaml b/config/default/manager_auth_proxy_patch.yaml index 123b326..1f29ede 100644 --- a/config/default/manager_auth_proxy_patch.yaml +++ b/config/default/manager_auth_proxy_patch.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation # This patch inject a sidecar container which is a HTTP proxy for the # controller manager, it performs RBAC authorization against the Kubernetes API using SubjectAccessReviews. diff --git a/config/default/manager_config_patch.yaml b/config/default/manager_config_patch.yaml index 31ae7ec..eac393d 100644 --- a/config/default/manager_config_patch.yaml +++ b/config/default/manager_config_patch.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation apiVersion: apps/v1 kind: Deployment diff --git a/config/default/manager_webhook_patch.yaml b/config/default/manager_webhook_patch.yaml index 2dcad53..78f6a68 100644 --- a/config/default/manager_webhook_patch.yaml +++ b/config/default/manager_webhook_patch.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation apiVersion: apps/v1 kind: Deployment diff --git a/config/default/webhookcainjection_patch.yaml b/config/default/webhookcainjection_patch.yaml index 4e75852..1533a1f 100644 --- a/config/default/webhookcainjection_patch.yaml +++ b/config/default/webhookcainjection_patch.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation # This patch add annotation to admission webhook config and # the variables $(CERTIFICATE_NAMESPACE) and $(CERTIFICATE_NAME) will be substituted by kustomize. diff --git a/config/manager/controller_manager_config.yaml b/config/manager/controller_manager_config.yaml index d05af66..786cee5 100644 --- a/config/manager/controller_manager_config.yaml +++ b/config/manager/controller_manager_config.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation apiVersion: controller-runtime.sigs.k8s.io/v1alpha1 kind: ControllerManagerConfig diff --git a/config/manager/kustomization.yaml b/config/manager/kustomization.yaml index 958d6f1..e0ae5e6 100644 --- a/config/manager/kustomization.yaml +++ b/config/manager/kustomization.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation resources: - manager.yaml diff --git a/config/manager/manager.yaml b/config/manager/manager.yaml index f171ead..03b0479 100644 --- a/config/manager/manager.yaml +++ b/config/manager/manager.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation apiVersion: v1 kind: Namespace @@ -8,6 +8,319 @@ metadata: control-plane: controller-manager name: system --- +apiVersion: v1 +kind: ConfigMap +metadata: + name: daemon-assets + namespace: system +immutable: false +data: + daemon-assets.yaml: | + # SPDX-License-Identifier: Apache-2.0 + # Copyright (c) 2020-2025 Intel Corporation + + apiVersion: v1 + kind: ConfigMap + metadata: + name: daemon-config + namespace: {{ .SRIOV_FEC_NAMESPACE }} + immutable: false + data: + serviceAccount: | + apiVersion: v1 + kind: ServiceAccount + metadata: + name: sriov-fec-daemon + namespace: {{ .SRIOV_FEC_NAMESPACE }} + role: | + apiVersion: rbac.authorization.k8s.io/v1 + kind: Role + metadata: + name: sriov-fec-daemon + namespace: {{ .SRIOV_FEC_NAMESPACE }} + rules: + - apiGroups: + - sriovfec.intel.com + resources: + - sriovfecclusterconfigs + - sriovfecnodeconfigs + verbs: + - get + - list + - watch + - create + - update + - patch + - delete + - apiGroups: + - sriovfec.intel.com + resources: + - sriovfecclusterconfigs/status + - sriovfecnodeconfigs/status + verbs: + - get + - update + - patch + - apiGroups: + - sriovvrb.intel.com + resources: + - sriovvrbclusterconfigs + - sriovvrbnodeconfigs + verbs: + - get + - list + - watch + - create + - update + - patch + - delete + - apiGroups: + - sriovvrb.intel.com + resources: + - sriovvrbclusterconfigs/status + - sriovvrbnodeconfigs/status + verbs: + - get + - update + - patch + - apiGroups: + - security.openshift.io + resources: + - securitycontextconstraints + verbs: + - use + resourceNames: + - privileged + - apiGroups: + - coordination.k8s.io + resources: + - leases + verbs: + - get + - list + - watch + - create + - update + - patch + - delete + - apiGroups: [""] + resources: ["configmaps"] + verbs: + - get + - list + - watch + - create + - update + - patch + - delete + roleBinding: | + apiVersion: rbac.authorization.k8s.io/v1 + kind: RoleBinding + metadata: + name: sriov-fec-daemon + namespace: {{ .SRIOV_FEC_NAMESPACE }} + roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: sriov-fec-daemon + {{ if eq (.SRIOV_FEC_GENERIC_K8S|ToLower) `false` }} + namespace: {{ .SRIOV_FEC_NAMESPACE }} + {{ end }} + subjects: + - kind: ServiceAccount + name: sriov-fec-daemon + namespace: {{ .SRIOV_FEC_NAMESPACE }} + {{ if eq (.SRIOV_FEC_GENERIC_K8S|ToLower) `false` }} + userNames: + - system:serviceaccount:{{ .SRIOV_FEC_NAMESPACE }}:sriov-fec-daemon + {{ end }} + clusterRole: | + apiVersion: rbac.authorization.k8s.io/v1 + kind: ClusterRole + metadata: + name: sriov-fec-daemon + rules: + - apiGroups: [""] + resources: ["pods"] + verbs: ["get","list","watch","create","update", "patch", "delete"] + - apiGroups: [""] + resources: ["nodes"] + verbs: ["get", "list", "watch", "patch", "update"] + - apiGroups: ["apps"] + resources: ["daemonsets"] + verbs: ["get"] + - apiGroups: [""] + resources: ["pods/eviction"] + verbs: ["create"] + clusterRoleBinding: | + apiVersion: rbac.authorization.k8s.io/v1 + kind: ClusterRoleBinding + metadata: + name: sriov-fec-daemon + subjects: + - kind: ServiceAccount + name: sriov-fec-daemon + namespace: {{ .SRIOV_FEC_NAMESPACE }} + roleRef: + kind: ClusterRole + name: sriov-fec-daemon + apiGroup: rbac.authorization.k8s.io + namespace: {{ .SRIOV_FEC_NAMESPACE }} + secret: | + apiVersion: v1 + kind: Secret + metadata: + name: vfio-token + namespace: {{ .SRIOV_FEC_NAMESPACE }} + type: Opaque + stringData: + VFIO_TOKEN: {{ .SRIOV_FEC_VFIO_TOKEN }} + immutable: true + daemonSet: | + apiVersion: apps/v1 + kind: DaemonSet + metadata: + labels: + app: sriov-fec-daemonset + name: sriov-fec-daemonset + namespace: {{ .SRIOV_FEC_NAMESPACE }} + annotations: + openshift.io/scc: sriov-fec-daemon + spec: + selector: + matchLabels: + app: sriov-fec-daemonset + template: + metadata: + # Mark this pod as a critical add-on; when enabled, the critical add-on scheduler + # reserves resources for critical add-on pods so that they can be rescheduled after + # a failure. This annotation works in tandem with the toleration below. + annotations: + scheduler.alpha.kubernetes.io/critical-pod: "" + labels: + app: sriov-fec-daemonset + spec: + nodeSelector: + fpga.intel.com/intel-accelerator-present: "" + {{ if eq (.SRIOV_FEC_GENERIC_K8S|ToLower) `true` }} + shareProcessNamespace: true + {{ end }} + tolerations: + - key: intel.com/sriovfec + operator: Exists + effect: NoSchedule + serviceAccount: sriov-fec-daemon + serviceAccountName: sriov-fec-daemon + hostPID: false + hostNetwork: false + dnsPolicy: Default + containers: + - name: sriov-fec-daemon + image: {{ .SRIOV_FEC_DAEMON_IMAGE }} + imagePullPolicy: IfNotPresent + livenessProbe: + httpGet: + path: /healthz + port: 8081 + initialDelaySeconds: {{ .SRIOV_FEC_DAEMON_LIVENESS_INITIAL_DELAY_SECONDS }} + periodSeconds: {{ .SRIOV_FEC_DAEMON_LIVENESS_PERIOD_SECONDS }} + failureThreshold: {{ .SRIOV_FEC_DAEMON_LIVENESS_FAILURE_THRESHOLD }} + successThreshold: {{ .SRIOV_FEC_DAEMON_LIVENESS_SUCCESS_THRESHOLD }} + timeoutSeconds: {{ .SRIOV_FEC_DAEMON_LIVENESS_TIMEOUT_SECONDS }} + readinessProbe: + httpGet: + path: /readyz + port: 8081 + initialDelaySeconds: {{ .SRIOV_FEC_DAEMON_READINESS_INITIAL_DELAY_SECONDS }} + periodSeconds: {{ .SRIOV_FEC_DAEMON_READINESS_PERIOD_SECONDS }} + failureThreshold: {{ .SRIOV_FEC_DAEMON_READINESS_FAILURE_THRESHOLD }} + successThreshold: {{ .SRIOV_FEC_DAEMON_READINESS_SUCCESS_THRESHOLD }} + timeoutSeconds: {{ .SRIOV_FEC_DAEMON_READINESS_TIMEOUT_SECONDS }} + ports: + - containerPort: 8080 + name: bbdevconfig + volumeMounts: + - name: tlscert + mountPath: "/etc/certificate" + readOnly: true + - name: devvfio + mountPath: /dev/vfio + readOnly: true + - name: vfiotoken + mountPath: /sriov_config/ + readOnly: true + - name: libmodules + mountPath: /lib/modules + readOnly: true + - mountPath: /sriov_config/config + name: config-volume + readOnly: true + - name: logs + mountPath: /var/log + - name: tmp + mountPath: /tmp + - name: lockdown + mountPath: /sys/kernel/security + readOnly: true + env: + - name: SRIOV_FEC_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + - name: NODENAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName + - name: DRAIN_TIMEOUT_SECONDS + value: "90" + - name: LEASE_DURATION_SECONDS + value: "600" + - name: SRIOV_FEC_METRIC_GATHER_INTERVAL + value: {{ .SRIOV_FEC_METRIC_GATHER_INTERVAL }} + securityContext: + readOnlyRootFilesystem: true + privileged: true + {{ if eq (.SRIOV_FEC_GENERIC_K8S|ToLower) `true` }} + runAsUser: 0 + capabilities: + add: + - "ALL" + {{ end }} + volumes: + - name: tlscert + secret: + secretName: tls-cert + optional: true + - configMap: + defaultMode: 420 + items: + - key: accelerators.json + path: accelerators.json + - key: accelerators_vrb.json + path: accelerators_vrb.json + name: supported-accelerators + name: config-volume + - name: vfiotoken + secret: + secretName: vfio-token + optional: false + items: + - key: VFIO_TOKEN + path: vfiotoken + - name: devvfio + hostPath: + path: /dev/vfio + - name: libmodules + hostPath: + path: /lib/modules + - name: logs + emptyDir: {} + - name: tmp + emptyDir: {} + - name: lockdown + hostPath: + path: /sys/kernel/security +--- apiVersion: apps/v1 kind: Deployment metadata: @@ -51,12 +364,14 @@ spec: port: 8081 initialDelaySeconds: 15 periodSeconds: 20 + timeoutSeconds: 5 readinessProbe: httpGet: path: /readyz port: 8081 - initialDelaySeconds: 5 + initialDelaySeconds: 10 periodSeconds: 10 + timeoutSeconds: 5 resources: limits: cpu: 200m @@ -64,6 +379,10 @@ spec: requests: cpu: 100m memory: 20Mi + volumeMounts: + - name: daemon-assets + mountPath: /assets/300-daemon.yaml + subPath: daemon-assets.yaml env: - name: SRIOV_FEC_DAEMON_IMAGE value: $SRIOV_FEC_DAEMON_IMAGE @@ -81,5 +400,30 @@ spec: fieldPath: metadata.name - name: SRIOV_FEC_METRIC_GATHER_INTERVAL value: 0s + - name: SRIOV_FEC_DAEMON_LIVENESS_INITIAL_DELAY_SECONDS + value: 15 + - name: SRIOV_FEC_DAEMON_LIVENESS_PERIOD_SECONDS + value: 20 + - name: SRIOV_FEC_DAEMON_LIVENESS_FAILURE_THRESHOLD + value: 3 + - name: SRIOV_FEC_DAEMON_LIVENESS_SUCCESS_THRESHOLD + value: 1 + - name: SRIOV_FEC_DAEMON_LIVENESS_TIMEOUT_SECONDS + value: 5 + - name: SRIOV_FEC_DAEMON_READINESS_INITIAL_DELAY_SECONDS + value: 5 + - name: SRIOV_FEC_DAEMON_READINESS_PERIOD_SECONDS + value: 10 + - name: SRIOV_FEC_DAEMON_READINESS_FAILURE_THRESHOLD + value: 3 + - name: SRIOV_FEC_DAEMON_READINESS_SUCCESS_THRESHOLD + value: 1 + - name: SRIOV_FEC_DAEMON_READINESS_TIMEOUT_SECONDS + value: 5 + volumes: + - name: daemon-assets + configMap: + defaultMode: 420 + name: sriov-fec-daemon-assets serviceAccountName: controller-manager terminationGracePeriodSeconds: 10 diff --git a/config/manifests/bases/sriov-fec.clusterserviceversion.yaml b/config/manifests/bases/sriov-fec.clusterserviceversion.yaml index 770f3ae..26e5af0 100644 --- a/config/manifests/bases/sriov-fec.clusterserviceversion.yaml +++ b/config/manifests/bases/sriov-fec.clusterserviceversion.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation apiVersion: operators.coreos.com/v1alpha1 kind: ClusterServiceVersion metadata: diff --git a/config/manifests/kustomization.yaml b/config/manifests/kustomization.yaml index ba620bf..f3f35e4 100644 --- a/config/manifests/kustomization.yaml +++ b/config/manifests/kustomization.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation resources: - ../default diff --git a/config/prometheus/kustomization.yaml b/config/prometheus/kustomization.yaml index 9dfcafd..eda7e33 100644 --- a/config/prometheus/kustomization.yaml +++ b/config/prometheus/kustomization.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation resources: - monitor.yaml diff --git a/config/prometheus/monitor.yaml b/config/prometheus/monitor.yaml index b6546bc..b0e1466 100644 --- a/config/prometheus/monitor.yaml +++ b/config/prometheus/monitor.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation # Prometheus Monitor Service (Metrics) diff --git a/config/rbac/auth_proxy_client_clusterrole.yaml b/config/rbac/auth_proxy_client_clusterrole.yaml index 6c95f57..aff113d 100644 --- a/config/rbac/auth_proxy_client_clusterrole.yaml +++ b/config/rbac/auth_proxy_client_clusterrole.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole diff --git a/config/rbac/auth_proxy_role.yaml b/config/rbac/auth_proxy_role.yaml index acd1bb6..d6a67e4 100644 --- a/config/rbac/auth_proxy_role.yaml +++ b/config/rbac/auth_proxy_role.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole diff --git a/config/rbac/auth_proxy_role_binding.yaml b/config/rbac/auth_proxy_role_binding.yaml index 45a1252..253b983 100644 --- a/config/rbac/auth_proxy_role_binding.yaml +++ b/config/rbac/auth_proxy_role_binding.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding diff --git a/config/rbac/auth_proxy_service.yaml b/config/rbac/auth_proxy_service.yaml index 7377f02..a2daa8c 100644 --- a/config/rbac/auth_proxy_service.yaml +++ b/config/rbac/auth_proxy_service.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation apiVersion: v1 kind: Service diff --git a/config/rbac/kustomization.yaml b/config/rbac/kustomization.yaml index 4cb5888..7a455ef 100644 --- a/config/rbac/kustomization.yaml +++ b/config/rbac/kustomization.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation resources: - role.yaml diff --git a/config/rbac/leader_election_role.yaml b/config/rbac/leader_election_role.yaml index 331040d..def2cfe 100644 --- a/config/rbac/leader_election_role.yaml +++ b/config/rbac/leader_election_role.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation # permissions to do leader election. apiVersion: rbac.authorization.k8s.io/v1 diff --git a/config/rbac/leader_election_role_binding.yaml b/config/rbac/leader_election_role_binding.yaml index c9a23b3..0916160 100644 --- a/config/rbac/leader_election_role_binding.yaml +++ b/config/rbac/leader_election_role_binding.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding diff --git a/config/rbac/role.yaml b/config/rbac/role.yaml index e948bea..3598ae5 100644 --- a/config/rbac/role.yaml +++ b/config/rbac/role.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole diff --git a/config/rbac/role_binding.yaml b/config/rbac/role_binding.yaml index c65e18f..192708f 100644 --- a/config/rbac/role_binding.yaml +++ b/config/rbac/role_binding.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding diff --git a/config/rbac/sriovfecclusterconfig_editor_role.yaml b/config/rbac/sriovfecclusterconfig_editor_role.yaml index 5b6e3f6..78124a6 100644 --- a/config/rbac/sriovfecclusterconfig_editor_role.yaml +++ b/config/rbac/sriovfecclusterconfig_editor_role.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation # permissions for end users to edit sriovfecclusterconfigs. apiVersion: rbac.authorization.k8s.io/v1 diff --git a/config/rbac/sriovfecclusterconfig_viewer_role.yaml b/config/rbac/sriovfecclusterconfig_viewer_role.yaml index f36f856..b2a43f3 100644 --- a/config/rbac/sriovfecclusterconfig_viewer_role.yaml +++ b/config/rbac/sriovfecclusterconfig_viewer_role.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation # permissions for end users to view sriovfecclusterconfigs. apiVersion: rbac.authorization.k8s.io/v1 diff --git a/config/rbac/sriovfecnodeconfig_editor_role.yaml b/config/rbac/sriovfecnodeconfig_editor_role.yaml index a9e5dc8..b85869c 100644 --- a/config/rbac/sriovfecnodeconfig_editor_role.yaml +++ b/config/rbac/sriovfecnodeconfig_editor_role.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation # permissions for end users to edit sriovfecnodeconfigs. apiVersion: rbac.authorization.k8s.io/v1 diff --git a/config/rbac/sriovfecnodeconfig_viewer_role.yaml b/config/rbac/sriovfecnodeconfig_viewer_role.yaml index 04e3a41..736076f 100644 --- a/config/rbac/sriovfecnodeconfig_viewer_role.yaml +++ b/config/rbac/sriovfecnodeconfig_viewer_role.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation # permissions for end users to view sriovfecnodeconfigs. apiVersion: rbac.authorization.k8s.io/v1 diff --git a/config/rbac/sriovvrb_sriovvrbclusterconfig_editor_role.yaml b/config/rbac/sriovvrb_sriovvrbclusterconfig_editor_role.yaml index 3a2f309..1f4325e 100644 --- a/config/rbac/sriovvrb_sriovvrbclusterconfig_editor_role.yaml +++ b/config/rbac/sriovvrb_sriovvrbclusterconfig_editor_role.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation # permissions for end users to edit sriovvrbclusterconfigs. apiVersion: rbac.authorization.k8s.io/v1 diff --git a/config/rbac/sriovvrb_sriovvrbclusterconfig_viewer_role.yaml b/config/rbac/sriovvrb_sriovvrbclusterconfig_viewer_role.yaml index 79738f8..b857b7e 100644 --- a/config/rbac/sriovvrb_sriovvrbclusterconfig_viewer_role.yaml +++ b/config/rbac/sriovvrb_sriovvrbclusterconfig_viewer_role.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation # permissions for end users to view sriovvrbclusterconfigs. apiVersion: rbac.authorization.k8s.io/v1 diff --git a/config/rbac/sriovvrb_sriovvrbnodeconfig_editor_role.yaml b/config/rbac/sriovvrb_sriovvrbnodeconfig_editor_role.yaml index fc7feab..cf2845f 100644 --- a/config/rbac/sriovvrb_sriovvrbnodeconfig_editor_role.yaml +++ b/config/rbac/sriovvrb_sriovvrbnodeconfig_editor_role.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation # permissions for end users to edit sriovvrbnodeconfigs. apiVersion: rbac.authorization.k8s.io/v1 diff --git a/config/rbac/sriovvrb_sriovvrbnodeconfig_viewer_role.yaml b/config/rbac/sriovvrb_sriovvrbnodeconfig_viewer_role.yaml index 5c7b8df..d217b27 100644 --- a/config/rbac/sriovvrb_sriovvrbnodeconfig_viewer_role.yaml +++ b/config/rbac/sriovvrb_sriovvrbnodeconfig_viewer_role.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation # permissions for end users to view sriovvrbnodeconfigs. apiVersion: rbac.authorization.k8s.io/v1 diff --git a/config/samples/kustomization.yaml b/config/samples/kustomization.yaml index f050935..f694b13 100644 --- a/config/samples/kustomization.yaml +++ b/config/samples/kustomization.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation ## Append samples you want in your CSV to this file as resources ## resources: diff --git a/config/samples/sriovfec_v2_sriovfecclusterconfig_acc100.yaml b/config/samples/sriovfec_v2_sriovfecclusterconfig_acc100.yaml index 5a9b8c7..641dfc6 100644 --- a/config/samples/sriovfec_v2_sriovfecclusterconfig_acc100.yaml +++ b/config/samples/sriovfec_v2_sriovfecclusterconfig_acc100.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation apiVersion: sriovfec.intel.com/v2 kind: SriovFecClusterConfig diff --git a/config/samples/sriovfec_v2_sriovfecclusterconfig_n3000.yaml b/config/samples/sriovfec_v2_sriovfecclusterconfig_n3000.yaml index 1c79cc8..127e8bc 100644 --- a/config/samples/sriovfec_v2_sriovfecclusterconfig_n3000.yaml +++ b/config/samples/sriovfec_v2_sriovfecclusterconfig_n3000.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation apiVersion: sriovfec.intel.com/v2 kind: SriovFecClusterConfig diff --git a/config/samples/sriovfec_v2_sriovfecnodeconfig_acc100.yaml b/config/samples/sriovfec_v2_sriovfecnodeconfig_acc100.yaml index 63af01f..937ed2a 100644 --- a/config/samples/sriovfec_v2_sriovfecnodeconfig_acc100.yaml +++ b/config/samples/sriovfec_v2_sriovfecnodeconfig_acc100.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation apiVersion: sriovfec.intel.com/v2 kind: SriovFecNodeConfig diff --git a/config/samples/sriovfec_v2_sriovfecnodeconfig_n3000.yaml b/config/samples/sriovfec_v2_sriovfecnodeconfig_n3000.yaml index 98f308e..43fbb92 100644 --- a/config/samples/sriovfec_v2_sriovfecnodeconfig_n3000.yaml +++ b/config/samples/sriovfec_v2_sriovfecnodeconfig_n3000.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation apiVersion: sriovfec.intel.com/v2 kind: SriovFecNodeConfig diff --git a/config/samples/sriovvrb_v1_sriovvrbclusterconfig.yaml b/config/samples/sriovvrb_v1_sriovvrbclusterconfig.yaml index 5b0b2c4..f71bce5 100644 --- a/config/samples/sriovvrb_v1_sriovvrbclusterconfig.yaml +++ b/config/samples/sriovvrb_v1_sriovvrbclusterconfig.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation apiVersion: sriovvrb.intel.com/v1 kind: SriovVrbclusterconfig diff --git a/config/samples/sriovvrb_v1_sriovvrbnodeconfig.yaml b/config/samples/sriovvrb_v1_sriovvrbnodeconfig.yaml index 57093cc..f582db3 100644 --- a/config/samples/sriovvrb_v1_sriovvrbnodeconfig.yaml +++ b/config/samples/sriovvrb_v1_sriovvrbnodeconfig.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation apiVersion: sriovvrb.intel.com/v1 kind: SriovVrbnodeconfig diff --git a/config/scorecard/bases/config.yaml b/config/scorecard/bases/config.yaml index 9608ffa..688189a 100644 --- a/config/scorecard/bases/config.yaml +++ b/config/scorecard/bases/config.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation apiVersion: scorecard.operatorframework.io/v1alpha3 kind: Configuration diff --git a/config/scorecard/kustomization.yaml b/config/scorecard/kustomization.yaml index 38649e7..4e74a17 100644 --- a/config/scorecard/kustomization.yaml +++ b/config/scorecard/kustomization.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation resources: - bases/config.yaml diff --git a/config/scorecard/patches/basic.config.yaml b/config/scorecard/patches/basic.config.yaml index 82f09fc..59a02a8 100644 --- a/config/scorecard/patches/basic.config.yaml +++ b/config/scorecard/patches/basic.config.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation - op: add path: /stages/0/tests/- diff --git a/config/scorecard/patches/olm.config.yaml b/config/scorecard/patches/olm.config.yaml index 66e4a4b..58702bb 100644 --- a/config/scorecard/patches/olm.config.yaml +++ b/config/scorecard/patches/olm.config.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation - op: add path: /stages/0/tests/- diff --git a/config/webhook/kustomization.yaml b/config/webhook/kustomization.yaml index 46d3759..649bc46 100644 --- a/config/webhook/kustomization.yaml +++ b/config/webhook/kustomization.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation resources: - manifests.yaml diff --git a/config/webhook/kustomizeconfig.yaml b/config/webhook/kustomizeconfig.yaml index 7fd64da..8473a2b 100644 --- a/config/webhook/kustomizeconfig.yaml +++ b/config/webhook/kustomizeconfig.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation # the following config is for teaching kustomize where to look at when substituting vars. # It requires kustomize v2.1.0 or newer to work properly. diff --git a/config/webhook/manifests.yaml b/config/webhook/manifests.yaml index 37a1a1c..4fc6dda 100644 --- a/config/webhook/manifests.yaml +++ b/config/webhook/manifests.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation --- apiVersion: admissionregistration.k8s.io/v1 kind: ValidatingWebhookConfiguration diff --git a/config/webhook/service.yaml b/config/webhook/service.yaml index 8e9462c..510a435 100644 --- a/config/webhook/service.yaml +++ b/config/webhook/service.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation apiVersion: v1 diff --git a/controllers/sriovfec/sriovfecclusterconfig_controller.go b/controllers/sriovfec/sriovfecclusterconfig_controller.go index 0dfe564..ab48192 100644 --- a/controllers/sriovfec/sriovfecclusterconfig_controller.go +++ b/controllers/sriovfec/sriovfecclusterconfig_controller.go @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright (c) 2020-2024 Intel Corporation +// Copyright (c) 2020-2025 Intel Corporation /* diff --git a/controllers/sriovfec/sriovfecclusterconfig_controller_test.go b/controllers/sriovfec/sriovfecclusterconfig_controller_test.go index 531ffbe..2ed4384 100644 --- a/controllers/sriovfec/sriovfecclusterconfig_controller_test.go +++ b/controllers/sriovfec/sriovfecclusterconfig_controller_test.go @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright (c) 2020-2024 Intel Corporation +// Copyright (c) 2020-2025 Intel Corporation /* diff --git a/controllers/sriovfec/suite_test.go b/controllers/sriovfec/suite_test.go index dea8920..005c1b2 100644 --- a/controllers/sriovfec/suite_test.go +++ b/controllers/sriovfec/suite_test.go @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright (c) 2020-2024 Intel Corporation +// Copyright (c) 2020-2025 Intel Corporation /* diff --git a/controllers/sriovfec/testdata/clusterconfig/correct/acc100_no_maxqueuesize.yaml b/controllers/sriovfec/testdata/clusterconfig/correct/acc100_no_maxqueuesize.yaml index 30d0fce..649f872 100644 --- a/controllers/sriovfec/testdata/clusterconfig/correct/acc100_no_maxqueuesize.yaml +++ b/controllers/sriovfec/testdata/clusterconfig/correct/acc100_no_maxqueuesize.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation apiVersion: sriovfec.intel.com/v2 kind: SriovFecClusterConfig diff --git a/controllers/sriovfec/testdata/clusterconfig/correct/acc100_no_pfmode.yaml b/controllers/sriovfec/testdata/clusterconfig/correct/acc100_no_pfmode.yaml index 916c6d8..7bfa0cb 100644 --- a/controllers/sriovfec/testdata/clusterconfig/correct/acc100_no_pfmode.yaml +++ b/controllers/sriovfec/testdata/clusterconfig/correct/acc100_no_pfmode.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation apiVersion: sriovfec.intel.com/v2 kind: SriovFecClusterConfig diff --git a/controllers/sriovfec/testdata/clusterconfig/correct/acc100_pfmode_equals_false.yaml b/controllers/sriovfec/testdata/clusterconfig/correct/acc100_pfmode_equals_false.yaml index a2d578e..c9ca6b3 100644 --- a/controllers/sriovfec/testdata/clusterconfig/correct/acc100_pfmode_equals_false.yaml +++ b/controllers/sriovfec/testdata/clusterconfig/correct/acc100_pfmode_equals_false.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation apiVersion: sriovfec.intel.com/v2 kind: SriovFecClusterConfig diff --git a/controllers/sriovfec/testdata/clusterconfig/correct/label_and_device_id.yaml b/controllers/sriovfec/testdata/clusterconfig/correct/label_and_device_id.yaml index 8ef71b9..729a27e 100644 --- a/controllers/sriovfec/testdata/clusterconfig/correct/label_and_device_id.yaml +++ b/controllers/sriovfec/testdata/clusterconfig/correct/label_and_device_id.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation apiVersion: sriovfec.intel.com/v2 kind: SriovFecClusterConfig diff --git a/controllers/sriovfec/testdata/clusterconfig/correct/labels_and_device_id.yaml b/controllers/sriovfec/testdata/clusterconfig/correct/labels_and_device_id.yaml index dbdf9cb..5c2ae0a 100644 --- a/controllers/sriovfec/testdata/clusterconfig/correct/labels_and_device_id.yaml +++ b/controllers/sriovfec/testdata/clusterconfig/correct/labels_and_device_id.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation apiVersion: sriovfec.intel.com/v2 kind: SriovFecClusterConfig diff --git a/controllers/sriovfec/testdata/clusterconfig/correct/labels_no_accelerator.yaml b/controllers/sriovfec/testdata/clusterconfig/correct/labels_no_accelerator.yaml index ff68a3d..129ab9a 100644 --- a/controllers/sriovfec/testdata/clusterconfig/correct/labels_no_accelerator.yaml +++ b/controllers/sriovfec/testdata/clusterconfig/correct/labels_no_accelerator.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation apiVersion: sriovfec.intel.com/v2 kind: SriovFecClusterConfig diff --git a/controllers/sriovfec/testdata/clusterconfig/correct/missing_priority.yaml b/controllers/sriovfec/testdata/clusterconfig/correct/missing_priority.yaml index 04e9df3..c95b2c0 100644 --- a/controllers/sriovfec/testdata/clusterconfig/correct/missing_priority.yaml +++ b/controllers/sriovfec/testdata/clusterconfig/correct/missing_priority.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation apiVersion: sriovfec.intel.com/v2 kind: SriovFecClusterConfig diff --git a/controllers/sriovfec/testdata/clusterconfig/correct/n3000_no_pfmode.yaml b/controllers/sriovfec/testdata/clusterconfig/correct/n3000_no_pfmode.yaml index a25614a..ef5d0e4 100644 --- a/controllers/sriovfec/testdata/clusterconfig/correct/n3000_no_pfmode.yaml +++ b/controllers/sriovfec/testdata/clusterconfig/correct/n3000_no_pfmode.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation apiVersion: sriovfec.intel.com/v2 kind: SriovFecClusterConfig diff --git a/controllers/sriovfec/testdata/clusterconfig/correct/n3000_pfmode_equals_false.yaml b/controllers/sriovfec/testdata/clusterconfig/correct/n3000_pfmode_equals_false.yaml index be71bb0..1e8cf74 100644 --- a/controllers/sriovfec/testdata/clusterconfig/correct/n3000_pfmode_equals_false.yaml +++ b/controllers/sriovfec/testdata/clusterconfig/correct/n3000_pfmode_equals_false.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation apiVersion: sriovfec.intel.com/v2 kind: SriovFecClusterConfig diff --git a/controllers/sriovfec/testdata/clusterconfig/correct/no_labels_and_no_accelerator.yaml b/controllers/sriovfec/testdata/clusterconfig/correct/no_labels_and_no_accelerator.yaml index abda450..6a61e8f 100644 --- a/controllers/sriovfec/testdata/clusterconfig/correct/no_labels_and_no_accelerator.yaml +++ b/controllers/sriovfec/testdata/clusterconfig/correct/no_labels_and_no_accelerator.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation apiVersion: sriovfec.intel.com/v2 kind: SriovFecClusterConfig diff --git a/controllers/sriovfec/testdata/clusterconfig/correct/no_labels_and_only_device_id.yaml b/controllers/sriovfec/testdata/clusterconfig/correct/no_labels_and_only_device_id.yaml index 1d24380..31d3df3 100644 --- a/controllers/sriovfec/testdata/clusterconfig/correct/no_labels_and_only_device_id.yaml +++ b/controllers/sriovfec/testdata/clusterconfig/correct/no_labels_and_only_device_id.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation apiVersion: sriovfec.intel.com/v2 kind: SriovFecClusterConfig diff --git a/controllers/sriovfec/testdata/clusterconfig/correct/no_labels_and_only_driver.yaml b/controllers/sriovfec/testdata/clusterconfig/correct/no_labels_and_only_driver.yaml index 627a331..f3de791 100644 --- a/controllers/sriovfec/testdata/clusterconfig/correct/no_labels_and_only_driver.yaml +++ b/controllers/sriovfec/testdata/clusterconfig/correct/no_labels_and_only_driver.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation apiVersion: sriovfec.intel.com/v2 kind: SriovFecClusterConfig diff --git a/controllers/sriovfec/testdata/clusterconfig/correct/no_labels_and_only_max_vfs.yaml b/controllers/sriovfec/testdata/clusterconfig/correct/no_labels_and_only_max_vfs.yaml index 2c6e868..0789c5c 100644 --- a/controllers/sriovfec/testdata/clusterconfig/correct/no_labels_and_only_max_vfs.yaml +++ b/controllers/sriovfec/testdata/clusterconfig/correct/no_labels_and_only_max_vfs.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation apiVersion: sriovfec.intel.com/v2 kind: SriovFecClusterConfig diff --git a/controllers/sriovfec/testdata/clusterconfig/correct/no_labels_and_only_pci_addr.yaml b/controllers/sriovfec/testdata/clusterconfig/correct/no_labels_and_only_pci_addr.yaml index 654615b..48dc996 100644 --- a/controllers/sriovfec/testdata/clusterconfig/correct/no_labels_and_only_pci_addr.yaml +++ b/controllers/sriovfec/testdata/clusterconfig/correct/no_labels_and_only_pci_addr.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation apiVersion: sriovfec.intel.com/v2 kind: SriovFecClusterConfig diff --git a/controllers/sriovfec/testdata/clusterconfig/correct/no_labels_and_only_vendor_id#1.yaml b/controllers/sriovfec/testdata/clusterconfig/correct/no_labels_and_only_vendor_id#1.yaml index 1d24380..31d3df3 100644 --- a/controllers/sriovfec/testdata/clusterconfig/correct/no_labels_and_only_vendor_id#1.yaml +++ b/controllers/sriovfec/testdata/clusterconfig/correct/no_labels_and_only_vendor_id#1.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation apiVersion: sriovfec.intel.com/v2 kind: SriovFecClusterConfig diff --git a/controllers/sriovfec/testdata/clusterconfig/correct/no_labels_and_only_vendor_id#2.yaml b/controllers/sriovfec/testdata/clusterconfig/correct/no_labels_and_only_vendor_id#2.yaml index 7912f59..7ddc02e 100644 --- a/controllers/sriovfec/testdata/clusterconfig/correct/no_labels_and_only_vendor_id#2.yaml +++ b/controllers/sriovfec/testdata/clusterconfig/correct/no_labels_and_only_vendor_id#2.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation apiVersion: sriovfec.intel.com/v2 kind: SriovFecClusterConfig diff --git a/controllers/sriovfec/testdata/clusterconfig/incorrect/acc100_drainSkip_wrong_value.yaml b/controllers/sriovfec/testdata/clusterconfig/incorrect/acc100_drainSkip_wrong_value.yaml index f3c2a09..8ed995e 100644 --- a/controllers/sriovfec/testdata/clusterconfig/incorrect/acc100_drainSkip_wrong_value.yaml +++ b/controllers/sriovfec/testdata/clusterconfig/incorrect/acc100_drainSkip_wrong_value.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation apiVersion: sriovfec.intel.com/v2 kind: SriovFecClusterConfig diff --git a/controllers/sriovfec/testdata/clusterconfig/incorrect/acc100_pfmode_equals_true.yaml b/controllers/sriovfec/testdata/clusterconfig/incorrect/acc100_pfmode_equals_true.yaml index e79efea..eda42ff 100644 --- a/controllers/sriovfec/testdata/clusterconfig/incorrect/acc100_pfmode_equals_true.yaml +++ b/controllers/sriovfec/testdata/clusterconfig/incorrect/acc100_pfmode_equals_true.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation apiVersion: sriovfec.intel.com/v2 kind: SriovFecClusterConfig diff --git a/controllers/sriovfec/testdata/clusterconfig/incorrect/n3000_pfmode_equals_true.yaml b/controllers/sriovfec/testdata/clusterconfig/incorrect/n3000_pfmode_equals_true.yaml index 1efa5da..62ba0ff 100644 --- a/controllers/sriovfec/testdata/clusterconfig/incorrect/n3000_pfmode_equals_true.yaml +++ b/controllers/sriovfec/testdata/clusterconfig/incorrect/n3000_pfmode_equals_true.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation apiVersion: sriovfec.intel.com/v2 kind: SriovFecClusterConfig diff --git a/controllers/sriovvrb/sriovvrbclusterconfig_controller.go b/controllers/sriovvrb/sriovvrbclusterconfig_controller.go index 8d7992e..e32d605 100644 --- a/controllers/sriovvrb/sriovvrbclusterconfig_controller.go +++ b/controllers/sriovvrb/sriovvrbclusterconfig_controller.go @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright (c) 2020-2024 Intel Corporation +// Copyright (c) 2020-2025 Intel Corporation package sriovvrb @@ -131,11 +131,12 @@ func (r *SriovVrbClusterConfigReconciler) synchronizeNodeConfigSpec(ncc NodeConf for _, pciAddress := range acceleratorConfigContext.Keys() { cc, _ := acceleratorConfigContext.Get(pciAddress) pf := vrbv1.PhysicalFunctionConfigExt{ - PCIAddress: pciAddress, - PFDriver: cc.Spec.PhysicalFunction.PFDriver, - VFDriver: cc.Spec.PhysicalFunction.VFDriver, - VFAmount: cc.Spec.PhysicalFunction.VFAmount, - BBDevConfig: cc.Spec.PhysicalFunction.BBDevConfig, + PCIAddress: pciAddress, + PFDriver: cc.Spec.PhysicalFunction.PFDriver, + VFDriver: cc.Spec.PhysicalFunction.VFDriver, + VFAmount: cc.Spec.PhysicalFunction.VFAmount, + BBDevConfig: cc.Spec.PhysicalFunction.BBDevConfig, + VrbResourceName: cc.Spec.VrbResourceName, } if cc.Spec.DrainSkip == nil { newNodeConfig.Spec.DrainSkip = true diff --git a/controllers/sriovvrb/sriovvrbclusterconfig_controller_test.go b/controllers/sriovvrb/sriovvrbclusterconfig_controller_test.go index 9dcb7d0..6a88b87 100644 --- a/controllers/sriovvrb/sriovvrbclusterconfig_controller_test.go +++ b/controllers/sriovvrb/sriovvrbclusterconfig_controller_test.go @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright (c) 2020-2024 Intel Corporation +// Copyright (c) 2020-2025 Intel Corporation /* diff --git a/controllers/sriovvrb/suite_test.go b/controllers/sriovvrb/suite_test.go index 6994e79..bfaecb9 100644 --- a/controllers/sriovvrb/suite_test.go +++ b/controllers/sriovvrb/suite_test.go @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright (c) 2020-2024 Intel Corporation +// Copyright (c) 2020-2025 Intel Corporation /* diff --git a/controllers/sriovvrb/testdata/clusterconfig/correct/label_and_device_id.yaml b/controllers/sriovvrb/testdata/clusterconfig/correct/label_and_device_id.yaml index fdc1ec0..d491e5f 100644 --- a/controllers/sriovvrb/testdata/clusterconfig/correct/label_and_device_id.yaml +++ b/controllers/sriovvrb/testdata/clusterconfig/correct/label_and_device_id.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation apiVersion: sriovvrb.intel.com/v1 kind: SriovVrbClusterConfig diff --git a/controllers/sriovvrb/testdata/clusterconfig/correct/labels_and_device_id.yaml b/controllers/sriovvrb/testdata/clusterconfig/correct/labels_and_device_id.yaml index a36a886..aa0f77f 100644 --- a/controllers/sriovvrb/testdata/clusterconfig/correct/labels_and_device_id.yaml +++ b/controllers/sriovvrb/testdata/clusterconfig/correct/labels_and_device_id.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation apiVersion: sriovvrb.intel.com/v1 kind: SriovVrbClusterConfig diff --git a/controllers/sriovvrb/testdata/clusterconfig/correct/labels_no_accelerator.yaml b/controllers/sriovvrb/testdata/clusterconfig/correct/labels_no_accelerator.yaml index 43a403a..1be816d 100644 --- a/controllers/sriovvrb/testdata/clusterconfig/correct/labels_no_accelerator.yaml +++ b/controllers/sriovvrb/testdata/clusterconfig/correct/labels_no_accelerator.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation apiVersion: sriovvrb.intel.com/v1 kind: SriovVrbClusterConfig diff --git a/controllers/sriovvrb/testdata/clusterconfig/correct/missing_priority.yaml b/controllers/sriovvrb/testdata/clusterconfig/correct/missing_priority.yaml index 2b137b8..c41feef 100644 --- a/controllers/sriovvrb/testdata/clusterconfig/correct/missing_priority.yaml +++ b/controllers/sriovvrb/testdata/clusterconfig/correct/missing_priority.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation apiVersion: sriovvrb.intel.com/v1 kind: SriovVrbClusterConfig diff --git a/controllers/sriovvrb/testdata/clusterconfig/correct/no_labels_and_no_accelerator.yaml b/controllers/sriovvrb/testdata/clusterconfig/correct/no_labels_and_no_accelerator.yaml index 255db96..fdec51a 100644 --- a/controllers/sriovvrb/testdata/clusterconfig/correct/no_labels_and_no_accelerator.yaml +++ b/controllers/sriovvrb/testdata/clusterconfig/correct/no_labels_and_no_accelerator.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation apiVersion: sriovvrb.intel.com/v1 kind: SriovVrbClusterConfig diff --git a/controllers/sriovvrb/testdata/clusterconfig/correct/no_labels_and_only_device_id.yaml b/controllers/sriovvrb/testdata/clusterconfig/correct/no_labels_and_only_device_id.yaml index 38bd02f..160c31b 100644 --- a/controllers/sriovvrb/testdata/clusterconfig/correct/no_labels_and_only_device_id.yaml +++ b/controllers/sriovvrb/testdata/clusterconfig/correct/no_labels_and_only_device_id.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation apiVersion: sriovvrb.intel.com/v1 kind: SriovVrbClusterConfig diff --git a/controllers/sriovvrb/testdata/clusterconfig/correct/no_labels_and_only_driver.yaml b/controllers/sriovvrb/testdata/clusterconfig/correct/no_labels_and_only_driver.yaml index 29df690..7ccf02f 100644 --- a/controllers/sriovvrb/testdata/clusterconfig/correct/no_labels_and_only_driver.yaml +++ b/controllers/sriovvrb/testdata/clusterconfig/correct/no_labels_and_only_driver.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation apiVersion: sriovvrb.intel.com/v1 kind: SriovVrbClusterConfig diff --git a/controllers/sriovvrb/testdata/clusterconfig/correct/no_labels_and_only_max_vfs.yaml b/controllers/sriovvrb/testdata/clusterconfig/correct/no_labels_and_only_max_vfs.yaml index 9e9d207..294b514 100644 --- a/controllers/sriovvrb/testdata/clusterconfig/correct/no_labels_and_only_max_vfs.yaml +++ b/controllers/sriovvrb/testdata/clusterconfig/correct/no_labels_and_only_max_vfs.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation apiVersion: sriovvrb.intel.com/v1 kind: SriovVrbClusterConfig diff --git a/controllers/sriovvrb/testdata/clusterconfig/correct/no_labels_and_only_pci_addr.yaml b/controllers/sriovvrb/testdata/clusterconfig/correct/no_labels_and_only_pci_addr.yaml index dcb5741..9ab35f0 100644 --- a/controllers/sriovvrb/testdata/clusterconfig/correct/no_labels_and_only_pci_addr.yaml +++ b/controllers/sriovvrb/testdata/clusterconfig/correct/no_labels_and_only_pci_addr.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation apiVersion: sriovvrb.intel.com/v1 kind: SriovVrbClusterConfig diff --git a/controllers/sriovvrb/testdata/clusterconfig/correct/no_labels_and_only_vendor_id#1.yaml b/controllers/sriovvrb/testdata/clusterconfig/correct/no_labels_and_only_vendor_id#1.yaml index 38bd02f..160c31b 100644 --- a/controllers/sriovvrb/testdata/clusterconfig/correct/no_labels_and_only_vendor_id#1.yaml +++ b/controllers/sriovvrb/testdata/clusterconfig/correct/no_labels_and_only_vendor_id#1.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation apiVersion: sriovvrb.intel.com/v1 kind: SriovVrbClusterConfig diff --git a/controllers/sriovvrb/testdata/clusterconfig/correct/no_labels_and_only_vendor_id#2.yaml b/controllers/sriovvrb/testdata/clusterconfig/correct/no_labels_and_only_vendor_id#2.yaml index cbaa40d..aa658ef 100644 --- a/controllers/sriovvrb/testdata/clusterconfig/correct/no_labels_and_only_vendor_id#2.yaml +++ b/controllers/sriovvrb/testdata/clusterconfig/correct/no_labels_and_only_vendor_id#2.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation apiVersion: sriovvrb.intel.com/v1 kind: SriovVrbClusterConfig diff --git a/controllers/sriovvrb/testdata/clusterconfig/correct/vrb1_no_maxqueuesize.yaml b/controllers/sriovvrb/testdata/clusterconfig/correct/vrb1_no_maxqueuesize.yaml index e35482a..06f04af 100644 --- a/controllers/sriovvrb/testdata/clusterconfig/correct/vrb1_no_maxqueuesize.yaml +++ b/controllers/sriovvrb/testdata/clusterconfig/correct/vrb1_no_maxqueuesize.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation apiVersion: sriovvrb.intel.com/v1 kind: SriovVrbClusterConfig diff --git a/controllers/sriovvrb/testdata/clusterconfig/correct/vrb1_no_pfmode.yaml b/controllers/sriovvrb/testdata/clusterconfig/correct/vrb1_no_pfmode.yaml index bc00ef8..117312b 100644 --- a/controllers/sriovvrb/testdata/clusterconfig/correct/vrb1_no_pfmode.yaml +++ b/controllers/sriovvrb/testdata/clusterconfig/correct/vrb1_no_pfmode.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation apiVersion: sriovvrb.intel.com/v1 kind: SriovVrbClusterConfig diff --git a/controllers/sriovvrb/testdata/clusterconfig/correct/vrb1_pfmode_equals_false.yaml b/controllers/sriovvrb/testdata/clusterconfig/correct/vrb1_pfmode_equals_false.yaml index 91e678e..a63458f 100644 --- a/controllers/sriovvrb/testdata/clusterconfig/correct/vrb1_pfmode_equals_false.yaml +++ b/controllers/sriovvrb/testdata/clusterconfig/correct/vrb1_pfmode_equals_false.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation apiVersion: sriovvrb.intel.com/v1 kind: SriovVrbClusterConfig diff --git a/controllers/sriovvrb/testdata/clusterconfig/correct/vrb2_no_maxqueuesize.yaml b/controllers/sriovvrb/testdata/clusterconfig/correct/vrb2_no_maxqueuesize.yaml index f33f0d8..0405aac 100644 --- a/controllers/sriovvrb/testdata/clusterconfig/correct/vrb2_no_maxqueuesize.yaml +++ b/controllers/sriovvrb/testdata/clusterconfig/correct/vrb2_no_maxqueuesize.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation apiVersion: sriovvrb.intel.com/v1 kind: SriovVrbClusterConfig diff --git a/controllers/sriovvrb/testdata/clusterconfig/correct/vrb2_no_pfmode.yaml b/controllers/sriovvrb/testdata/clusterconfig/correct/vrb2_no_pfmode.yaml index 7009784..bcd0b41 100644 --- a/controllers/sriovvrb/testdata/clusterconfig/correct/vrb2_no_pfmode.yaml +++ b/controllers/sriovvrb/testdata/clusterconfig/correct/vrb2_no_pfmode.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation apiVersion: sriovvrb.intel.com/v1 kind: SriovVrbClusterConfig diff --git a/controllers/sriovvrb/testdata/clusterconfig/correct/vrb2_pfmode_equals_false.yaml b/controllers/sriovvrb/testdata/clusterconfig/correct/vrb2_pfmode_equals_false.yaml index 92efc76..74ee305 100644 --- a/controllers/sriovvrb/testdata/clusterconfig/correct/vrb2_pfmode_equals_false.yaml +++ b/controllers/sriovvrb/testdata/clusterconfig/correct/vrb2_pfmode_equals_false.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation apiVersion: sriovvrb.intel.com/v1 kind: SriovVrbClusterConfig diff --git a/controllers/sriovvrb/testdata/clusterconfig/incorrect/vrb1_drainSkip_wrong_value.yaml b/controllers/sriovvrb/testdata/clusterconfig/incorrect/vrb1_drainSkip_wrong_value.yaml index 8ca4158..cdda6b0 100644 --- a/controllers/sriovvrb/testdata/clusterconfig/incorrect/vrb1_drainSkip_wrong_value.yaml +++ b/controllers/sriovvrb/testdata/clusterconfig/incorrect/vrb1_drainSkip_wrong_value.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation apiVersion: sriovvrb.intel.com/v1 kind: SriovVrbClusterConfig diff --git a/controllers/sriovvrb/testdata/clusterconfig/incorrect/vrb1_pfmode_equals_true.yaml b/controllers/sriovvrb/testdata/clusterconfig/incorrect/vrb1_pfmode_equals_true.yaml index 496e072..89ce82b 100644 --- a/controllers/sriovvrb/testdata/clusterconfig/incorrect/vrb1_pfmode_equals_true.yaml +++ b/controllers/sriovvrb/testdata/clusterconfig/incorrect/vrb1_pfmode_equals_true.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation apiVersion: sriovvrb.intel.com/v1 kind: SriovVrbClusterConfig diff --git a/controllers/sriovvrb/testdata/clusterconfig/incorrect/vrb2_pfmode_equals_true.yaml b/controllers/sriovvrb/testdata/clusterconfig/incorrect/vrb2_pfmode_equals_true.yaml index 2cba3a7..04b56e6 100644 --- a/controllers/sriovvrb/testdata/clusterconfig/incorrect/vrb2_pfmode_equals_true.yaml +++ b/controllers/sriovvrb/testdata/clusterconfig/incorrect/vrb2_pfmode_equals_true.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation apiVersion: sriovvrb.intel.com/v1 kind: SriovVrbClusterConfig diff --git a/copyright.sh b/copyright.sh index 5d079ea..a9eb181 100755 --- a/copyright.sh +++ b/copyright.sh @@ -1,6 +1,6 @@ #!/bin/bash # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation FOLDER=${FOLDER:-.} COPYRIGHT_FILE=${COPYRIGHT_FILE:-COPYRIGHT} diff --git a/gather_sriovfec_logs.sh b/gather_sriovfec_logs.sh index ba87beb..9686e07 100755 --- a/gather_sriovfec_logs.sh +++ b/gather_sriovfec_logs.sh @@ -1,6 +1,6 @@ #!/bin/bash # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation K8S_BIN="${1:-oc}" NAMESPACE="${2:-vran-acceleration-operators}" diff --git a/hack/boilerplate.go.txt b/hack/boilerplate.go.txt index b38b4ae..3417ffc 100644 --- a/hack/boilerplate.go.txt +++ b/hack/boilerplate.go.txt @@ -1,2 +1,2 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright (c) 2020-2024 Intel Corporation +// Copyright (c) 2020-2025 Intel Corporation diff --git a/main.go b/main.go index a2b7ae6..56099b5 100644 --- a/main.go +++ b/main.go @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright (c) 2020-2024 Intel Corporation +// Copyright (c) 2020-2025 Intel Corporation /* diff --git a/misc/src/README.md b/misc/src/README.md index a0ecc41..8a17be8 100644 --- a/misc/src/README.md +++ b/misc/src/README.md @@ -1,6 +1,6 @@ # List of 3rd party source code packages used in SRIOV-FEC Operator: diff --git a/pkg/common/assets/asset.go b/pkg/common/assets/asset.go index e29e4fb..181cd0c 100644 --- a/pkg/common/assets/asset.go +++ b/pkg/common/assets/asset.go @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright (c) 2020-2024 Intel Corporation +// Copyright (c) 2020-2025 Intel Corporation package assets diff --git a/pkg/common/assets/manager.go b/pkg/common/assets/manager.go index b80c024..de3dae0 100644 --- a/pkg/common/assets/manager.go +++ b/pkg/common/assets/manager.go @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright (c) 2020-2024 Intel Corporation +// Copyright (c) 2020-2025 Intel Corporation package assets @@ -91,7 +91,7 @@ func (m *Manager) setDefaultValues(tp *map[string]string) { m.EnvPrefix + "5G_RESOURCE_NAME": "intel_fec_5g", m.EnvPrefix + "ACC100_RESOURCE_NAME": "intel_fec_acc100", m.EnvPrefix + "ACC200_RESOURCE_NAME": "intel_fec_acc200", - "SRIOV_VRB_VRB2_RESOURCE_NAME": "intel_vrb_vrb2", + m.EnvPrefix + "VRB2_RESOURCE_NAME": "intel_vrb_vrb2", } for key, value := range defaults { diff --git a/pkg/common/assets/manager_test.go b/pkg/common/assets/manager_test.go index 89ea5fa..2bd10bd 100644 --- a/pkg/common/assets/manager_test.go +++ b/pkg/common/assets/manager_test.go @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright (c) 2020-2024 Intel Corporation +// Copyright (c) 2020-2025 Intel Corporation package assets diff --git a/pkg/common/assets/suite_test.go b/pkg/common/assets/suite_test.go index b4ce608..5b0a4b3 100644 --- a/pkg/common/assets/suite_test.go +++ b/pkg/common/assets/suite_test.go @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright (c) 2020-2024 Intel Corporation +// Copyright (c) 2020-2025 Intel Corporation package assets diff --git a/pkg/common/assets/test/101-fake-labeler.yaml b/pkg/common/assets/test/101-fake-labeler.yaml index 1d10018..aae5ad0 100644 --- a/pkg/common/assets/test/101-fake-labeler.yaml +++ b/pkg/common/assets/test/101-fake-labeler.yaml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation apiVersion: v1 kind: ConfigMap diff --git a/pkg/common/drainhelper/drainhelper.go b/pkg/common/drainhelper/drainhelper.go index 583e573..560a5b5 100644 --- a/pkg/common/drainhelper/drainhelper.go +++ b/pkg/common/drainhelper/drainhelper.go @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright (c) 2020-2024 Intel Corporation +// Copyright (c) 2020-2025 Intel Corporation package drainhelper diff --git a/pkg/common/drainhelper/drainhelper_test.go b/pkg/common/drainhelper/drainhelper_test.go index a029244..ef8302e 100644 --- a/pkg/common/drainhelper/drainhelper_test.go +++ b/pkg/common/drainhelper/drainhelper_test.go @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright (c) 2020-2024 Intel Corporation +// Copyright (c) 2020-2025 Intel Corporation package drainhelper diff --git a/pkg/common/drainhelper/suite_test.go b/pkg/common/drainhelper/suite_test.go index e6229b7..a1295dc 100644 --- a/pkg/common/drainhelper/suite_test.go +++ b/pkg/common/drainhelper/suite_test.go @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright (c) 2020-2024 Intel Corporation +// Copyright (c) 2020-2025 Intel Corporation package drainhelper diff --git a/pkg/common/utils/logger_wrapper.go b/pkg/common/utils/logger_wrapper.go index abed0d5..6adcbf4 100644 --- a/pkg/common/utils/logger_wrapper.go +++ b/pkg/common/utils/logger_wrapper.go @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright (c) 2020-2024 Intel Corporation +// Copyright (c) 2020-2025 Intel Corporation package utils diff --git a/pkg/common/utils/slices.go b/pkg/common/utils/slices.go index ba9e26c..49cbae5 100644 --- a/pkg/common/utils/slices.go +++ b/pkg/common/utils/slices.go @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright (c) 2020-2024 Intel Corporation +// Copyright (c) 2020-2025 Intel Corporation package utils diff --git a/pkg/common/utils/utils.go b/pkg/common/utils/utils.go index b509177..0eb32ed 100644 --- a/pkg/common/utils/utils.go +++ b/pkg/common/utils/utils.go @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright (c) 2020-2024 Intel Corporation +// Copyright (c) 2020-2025 Intel Corporation package utils @@ -9,6 +9,7 @@ import ( "fmt" "os" "path/filepath" + "strings" "github.com/go-logr/logr" "github.com/jaypipes/ghw" @@ -127,3 +128,43 @@ func FindAccelerator(cfgPath string) (bool, string, error) { } return false, "", nil } + +// Function to find all VFs associated with a given PF PCI address +func FindVFs(pfPCIAddress string) ([]string, error) { + // Path to the PF's SR-IOV directory in sysfs + sriovPath := fmt.Sprintf("/sys/bus/pci/devices/%s/virtfn*", pfPCIAddress) + + // Find all symbolic links matching the virtfn* pattern + vfLinks, err := filepath.Glob(sriovPath) + if err != nil { + return nil, err + } + + vfAddresses := make([]string, 0, len(vfLinks)) + for _, vfLink := range vfLinks { + // Read the target of the symbolic link to get the VF PCI address + vfTarget, err := os.Readlink(vfLink) + if err != nil { + return nil, err + } + + // Extract the VF PCI address from the target path + vfAddress := filepath.Base(vfTarget) + vfAddresses = append(vfAddresses, vfAddress) + } + + return vfAddresses, nil +} + +func GetVFDeviceID(pfPCIAddress string) (string, error) { + // Path to the PF's SR-IOV VF device ID file in sysfs + deviceIDPath := fmt.Sprintf("/sys/bus/pci/devices/%s/sriov_vf_device", pfPCIAddress) + + // Read the device ID from the file + deviceID, err := os.ReadFile(deviceIDPath) + if err != nil { + return "", err + } + + return strings.ToLower(strings.TrimSpace(string(deviceID))), nil +} diff --git a/pkg/common/utils/utils_test.go b/pkg/common/utils/utils_test.go index c60e975..17fd12d 100644 --- a/pkg/common/utils/utils_test.go +++ b/pkg/common/utils/utils_test.go @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright (c) 2020-2024 Intel Corporation +// Copyright (c) 2020-2025 Intel Corporation package utils import ( diff --git a/pkg/daemon/bbdevconfig.go b/pkg/daemon/bbdevconfig.go index 4f59923..ea107bf 100644 --- a/pkg/daemon/bbdevconfig.go +++ b/pkg/daemon/bbdevconfig.go @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright (c) 2020-2024 Intel Corporation +// Copyright (c) 2020-2025 Intel Corporation package daemon diff --git a/pkg/daemon/bbdevconfig_ini_generator.go b/pkg/daemon/bbdevconfig_ini_generator.go index de04ae7..32112ec 100644 --- a/pkg/daemon/bbdevconfig_ini_generator.go +++ b/pkg/daemon/bbdevconfig_ini_generator.go @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright (c) 2020-2024 Intel Corporation +// Copyright (c) 2020-2025 Intel Corporation package daemon diff --git a/pkg/daemon/bbdevconfig_test.go b/pkg/daemon/bbdevconfig_test.go index 4ce24e3..2095401 100644 --- a/pkg/daemon/bbdevconfig_test.go +++ b/pkg/daemon/bbdevconfig_test.go @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright (c) 2020-2024 Intel Corporation +// Copyright (c) 2020-2025 Intel Corporation package daemon diff --git a/pkg/daemon/common.go b/pkg/daemon/common.go index 383534f..1fc7cef 100644 --- a/pkg/daemon/common.go +++ b/pkg/daemon/common.go @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright (c) 2020-2024 Intel Corporation +// Copyright (c) 2020-2025 Intel Corporation package daemon diff --git a/pkg/daemon/common_test.go b/pkg/daemon/common_test.go index ab15078..f1f46d6 100644 --- a/pkg/daemon/common_test.go +++ b/pkg/daemon/common_test.go @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright (c) 2020-2024 Intel Corporation +// Copyright (c) 2020-2025 Intel Corporation package daemon diff --git a/pkg/daemon/daemon.go b/pkg/daemon/daemon.go index ab5d557..57d8d90 100644 --- a/pkg/daemon/daemon.go +++ b/pkg/daemon/daemon.go @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright (c) 2020-2024 Intel Corporation +// Copyright (c) 2020-2025 Intel Corporation package daemon diff --git a/pkg/daemon/daemon_fec.go b/pkg/daemon/daemon_fec.go index 5b95126..c92a39b 100644 --- a/pkg/daemon/daemon_fec.go +++ b/pkg/daemon/daemon_fec.go @@ -16,6 +16,7 @@ import ( "k8s.io/apimachinery/pkg/types" fec "github.com/intel/sriov-fec-operator/api/sriovfec/v2" + "k8s.io/apimachinery/pkg/api/equality" k8serrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -25,9 +26,12 @@ import ( ) var ( - FecConfigPath = "/sriov_config/config/accelerators.json" - getSriovInventory = GetSriovInventory - supportedAccelerators utils.AcceleratorDiscoveryConfig + FecConfigPath = "/sriov_config/config/accelerators.json" + getSriovInventory = GetSriovInventory + supportedAccelerators utils.AcceleratorDiscoveryConfig + fecPreviousConfig = make(map[string]fec.PhysicalFunctionConfigExt) + fecCurrentConfig = make(map[string]fec.PhysicalFunctionConfigExt) + fecDeviceUpdateRequired = make(map[string]bool) ) type FecNodeConfigReconciler struct { @@ -40,7 +44,7 @@ type FecNodeConfigReconciler struct { } type Configurer interface { - ApplySpec(nodeConfig fec.SriovFecNodeConfigSpec) error + ApplySpec(nodeConfig fec.SriovFecNodeConfigSpec, fecDeviceUpdateRequired map[string]bool) error } /***************************************************************************** @@ -70,6 +74,10 @@ func (r *FecNodeConfigReconciler) Reconcile(_ context.Context, req ctrl.Request) return requeueLaterOrNowIfError(r.updateStatus(sfnc, metav1.ConditionFalse, ConfigurationFailed, "requested configuration refers to not existing accelerator")) } + for _, accelerator := range detectedInventory.SriovAccelerators { + fecDeviceUpdateRequired[accelerator.PCIAddress] = true + } + if !r.isCardUpdateRequired(sfnc, detectedInventory) { r.log.Debug("SriovFec: Nothing to do") return requeueLater() @@ -175,13 +183,34 @@ func (r *FecNodeConfigReconciler) SetupWithManager(mgr ctrl.Manager) error { } /***************************************************************************** - * Method: FecNodeConfigReconciler:: - * Description: - * + * Method: FecNodeConfigReconciler::updateStatus + * Description: Updates the status of the SriovFecNodeConfig resource. + * Returns error if the status update fails ****************************************************************************/ func (r *FecNodeConfigReconciler) updateStatus(nc *fec.SriovFecNodeConfig, status metav1.ConditionStatus, reason ConfigurationConditionReason, msg string) error { previousCondition := findOrCreateConfigurationStatusCondition(nc) + if reason == ConfigurationInProgress { + // Clear the current configuration map + for key := range fecCurrentConfig { + delete(fecCurrentConfig, key) + } + // Update the current configuration map with the new configuration + for _, pf := range nc.Spec.PhysicalFunctions { + fecCurrentConfig[pf.PCIAddress] = pf + } + r.checkIfDeviceUpdateNeeded(fecPreviousConfig, fecCurrentConfig) + } else if reason == ConfigurationSucceeded { + // Clear the previous configuration map + for key := range fecPreviousConfig { + delete(fecPreviousConfig, key) + } + // Update the previous configuration with the current configuration + for _, pf := range nc.Spec.PhysicalFunctions { + fecPreviousConfig[pf.PCIAddress] = pf + } + } + // SriovFecNodeConfig.generation is under K8S management // metav1.Condition.observedGeneration is under this reconciler management. // observedGeneration would be incremented then and only then when spec which comes with updated generation would be processed without any error. @@ -278,7 +307,7 @@ func (r *FecNodeConfigReconciler) configureNode(nodeConfig *fec.SriovFecNodeConf var configurationError error drainFunc := func(ctx context.Context) bool { - if err := r.sriovfecconfigurer.ApplySpec(nodeConfig.Spec); err != nil { + if err := r.sriovfecconfigurer.ApplySpec(nodeConfig.Spec, fecDeviceUpdateRequired); err != nil { r.log.WithError(err).Error("failed applying new PF/VF configuration") configurationError = err return true @@ -482,3 +511,26 @@ func (r *FecNodeConfigReconciler) getPfBbConfVersion() string { return out.String() } } + +/***************************************************************************** + * Method: FecNodeConfigReconciler::checkIfDeviceUpdateNeeded + * Description: Determines if a device update is required based on the current + * and requested configurations + ****************************************************************************/ +func (r *FecNodeConfigReconciler) checkIfDeviceUpdateNeeded(previousConf, currentConf map[string]fec.PhysicalFunctionConfigExt) { + // Check for updates in previous configuration + for k, prevConfig := range previousConf { + if currConfig, exists := currentConf[k]; !exists || !equality.Semantic.DeepEqual(prevConfig, currConfig) { + fecDeviceUpdateRequired[k] = true + } else { + fecDeviceUpdateRequired[k] = false + } + } + + // Check for new entries in current configuration + for k := range currentConf { + if _, exists := previousConf[k]; !exists { + fecDeviceUpdateRequired[k] = true + } + } +} diff --git a/pkg/daemon/daemon_reconcile_test.go b/pkg/daemon/daemon_reconcile_test.go index 88247aa..826c2c4 100644 --- a/pkg/daemon/daemon_reconcile_test.go +++ b/pkg/daemon/daemon_reconcile_test.go @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright (c) 2020-2024 Intel Corporation +// Copyright (c) 2020-2025 Intel Corporation package daemon @@ -13,6 +13,8 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" "github.com/sirupsen/logrus" + v1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/types" ctrl "sigs.k8s.io/controller-runtime" @@ -144,9 +146,333 @@ var _ = Describe("FecNodeConfigReconciler.Reconcile", func() { }) type testConfigurerProto struct { - configureNodeFunction func(nodeConfig sriovv2.SriovFecNodeConfigSpec) error + configureNodeFunction func(nodeConfig sriovv2.SriovFecNodeConfigSpec) error + vrbConfigureNodeFunction func(nodeConfig vrbv1.SriovVrbNodeConfigSpec) error } -func (t testConfigurerProto) ApplySpec(nodeConfig sriovv2.SriovFecNodeConfigSpec) error { +func (t testConfigurerProto) ApplySpec(nodeConfig sriovv2.SriovFecNodeConfigSpec, fecDeviceUpdateRequired map[string]bool) error { return t.configureNodeFunction(nodeConfig) } + +func (t testConfigurerProto) VrbApplySpec(nodeConfig vrbv1.SriovVrbNodeConfigSpec, vrbDeviceUpdateRequired map[string]bool) error { + return t.vrbConfigureNodeFunction(nodeConfig) +} + +var _ = Describe("VrbNodeConfigReconciler.Reconcile", func() { + var scheme *runtime.Scheme + + BeforeEach(func() { + scheme = runtime.NewScheme() + Expect(vrbv1.AddToScheme(scheme)).ToNot(HaveOccurred()) + }) + + _ = Describe("", func() { + var ( + fakeClient client.Client + nodeNameRef types.NamespacedName + reconciler VrbNodeConfigReconciler + reconcileRequestes ctrl.Request + nodeInventory *vrbv1.NodeInventory + ) + BeforeEach(func() { + procCmdlineFilePath = "testdata/cmdline_test" + fakeClient = fake.NewClientBuilder().WithScheme(scheme).Build() + nodeNameRef = types.NamespacedName{Name: "worker", Namespace: "testNamespace"} + nodeInventory = &vrbv1.NodeInventory{ + SriovAccelerators: []vrbv1.SriovAccelerator{ + { + VendorID: "vid", + DeviceID: "did", + PCIAddress: pciAddress, + PFDriver: "pfdriver", + MaxVFs: 10, + }, + }, + } + configurer := testConfigurerProto{ + vrbConfigureNodeFunction: func(nodeConfig vrbv1.SriovVrbNodeConfigSpec) (err error) { + for _, pf := range nodeConfig.PhysicalFunctions { + for i, accelerator := range nodeInventory.SriovAccelerators { + if accelerator.PCIAddress != pf.PCIAddress { + continue + } + nodeInventory.SriovAccelerators[i].VFs = []vrbv1.VF{} + for i := 0; i < pf.VFAmount; i++ { + nodeInventory.SriovAccelerators[i].VFs = append(nodeInventory.SriovAccelerators[i].VFs, vrbv1.VF{ + PCIAddress: fmt.Sprintf("%s%d", pf.PCIAddress[0:len(pf.PCIAddress)-1], i+1), + Driver: "vfDriver", + DeviceID: "deviceId", + }) + } + } + } + return err + }, + } + + VrbgetSriovInventory = func(log *logrus.Logger) (*vrbv1.NodeInventory, error) { + return nodeInventory, nil + } + + reconciler = VrbNodeConfigReconciler{ + Client: fakeClient, + log: utils.NewLogger(), + nodeNameRef: nodeNameRef, + vrbconfigurer: configurer, + drainerAndExecute: func(configurer func(ctx context.Context) bool, drain bool) error { + _ = configurer(context.TODO()) + return nil + }, restartDevicePlugin: func() error { + return nil + }} + reconcileRequestes = ctrl.Request{NamespacedName: nodeNameRef} + }) + + It("restores/recreates VFs removed after node reboot", func() { + // SVNC does not exist yet + svnc := new(vrbv1.SriovVrbNodeConfig) + Expect(fakeClient.Get(context.TODO(), nodeNameRef, svnc)).To(MatchError(ContainSubstring("not found"))) + + // First reconcile creates missing svnc + // Created svnc exposes node inventory: status.NodeInventory + _, err := reconciler.Reconcile(context.TODO(), reconcileRequestes) + Expect(err).ToNot(HaveOccurred()) + svnc = new(vrbv1.SriovVrbNodeConfig) + Expect(fakeClient.Get(context.TODO(), nodeNameRef, svnc)).ToNot(HaveOccurred()) + Expect(svnc.Status.Inventory).To(Equal(*nodeInventory)) + + // Define new spec + // Fake client doesn't handle generation field so take care about incrementing it + svnc.Generation++ + svnc.Spec = vrbv1.SriovVrbNodeConfigSpec{ + PhysicalFunctions: []vrbv1.PhysicalFunctionConfigExt{ + { + PCIAddress: pciAddress, + PFDriver: "pfdriver", + VFDriver: "vfdriver", + VFAmount: 1, + BBDevConfig: vrbv1.BBDevConfig{}, + }, + }, + } + err = fakeClient.Patch(context.TODO(), svnc, client.Merge) + Expect(err).ToNot(HaveOccurred()) + + // Second reconcile should configure inventory to be aligned with requested spec + _, err = reconciler.Reconcile(context.TODO(), reconcileRequestes) + Expect(err).ToNot(HaveOccurred()) + svnc = new(vrbv1.SriovVrbNodeConfig) + Expect(fakeClient.Get(context.TODO(), nodeNameRef, svnc)).ToNot(HaveOccurred()) + Expect(svnc.Status.Inventory).ToNot(Equal(nodeInventory)) + + // Simulate node reboot - remove all existing VFs + for accidx := range nodeInventory.SriovAccelerators { + nodeInventory.SriovAccelerators[accidx].VFs = []vrbv1.VF{} + } + + // Third reconcile should reconfigure VFs + _, err = reconciler.Reconcile(context.TODO(), reconcileRequestes) + Expect(err).ToNot(HaveOccurred()) + svnc = new(vrbv1.SriovVrbNodeConfig) + Expect(fakeClient.Get(context.TODO(), nodeNameRef, svnc)).ToNot(HaveOccurred()) + Expect(svnc.Status.Inventory).ToNot(Equal(nodeInventory)) + }) + }) +}) + +var _ = Describe("VrbResourceName", func() { + var ( + reconciler *VrbNodeConfigReconciler + vrbnc *vrbv1.SriovVrbNodeConfig + acc vrbv1.PhysicalFunctionConfigExt + currentConfig map[string]interface{} + resourceList []interface{} + scheme *runtime.Scheme + ) + + BeforeEach(func() { + scheme = runtime.NewScheme() + Expect(vrbv1.AddToScheme(scheme)).ToNot(HaveOccurred()) + Expect(v1.AddToScheme(scheme)).ToNot(HaveOccurred()) // Register the core v1 types + + reconciler = &VrbNodeConfigReconciler{ + log: utils.NewLogger(), + Client: fake.NewClientBuilder().WithScheme(scheme).Build(), + drainerAndExecute: func(configurer func(ctx context.Context) bool, drain bool) error { + _ = configurer(context.TODO()) + return nil + }, + restartDevicePlugin: func() error { + return nil + }, + } + + vrbnc = &vrbv1.SriovVrbNodeConfig{ + ObjectMeta: metav1.ObjectMeta{ + Name: "test-vrbnc", + Namespace: "default", + }, + } + acc = vrbv1.PhysicalFunctionConfigExt{ + PCIAddress: "0000:00:00.0", + VrbResourceName: "test-resource", + } + currentConfig = make(map[string]interface{}) + resourceList = []interface{}{} + }) + + Describe("loadAndModifyDevicePluginConfig", func() { + It("should modify the ConfigMap if needed", func() { + // Create the SriovVrbNodeConfig object in the fake client + err := reconciler.Client.Create(context.TODO(), vrbnc) + Expect(err).NotTo(HaveOccurred()) + + err = reconciler.loadAndModifyDevicePluginConfig(vrbnc, acc) + Expect(err).NotTo(HaveOccurred()) + }) + }) + + Describe("matchPFPCIAddress", func() { + It("should return true if the PF_PCI_ADDR stored in additional information matches", func() { + resourceMap := map[string]interface{}{ + "additionalInfo": map[string]interface{}{ + "*": map[string]interface{}{ + "PF_PCI_ADDR": "0000:00:00.0", + }, + }, + } + matches := reconciler.matchPFPCIAddress(resourceMap, "0000:00:00.0") + Expect(matches).To(BeTrue()) + }) + }) + + Describe("matchVFDeviceID", func() { + It("should return true if selectors[\"devices\"] match the VF device ID", func() { + resourceMap := map[string]interface{}{ + "additionalInfo": map[string]interface{}{ + "*": map[string]interface{}{ + "PF_PCI_ADDR": "0000:00:00.0", + }, + }, + "selectors": map[string]interface{}{ + "devices": []interface{}{"57c3"}, + }, + } + matches := reconciler.matchVFDeviceID(resourceMap, "57c3") + Expect(matches).To(BeTrue()) + }) + }) + + Describe("handleResourceNotFound", func() { + It("should handle the case where a resource was not found", func() { + // Create a fake ConfigMap + configMap := &v1.ConfigMap{ + ObjectMeta: metav1.ObjectMeta{ + Name: "sriovdp-config", + Namespace: "default", + }, + Data: map[string]string{ + "config.json": "{}", + }, + } + err := reconciler.Client.Create(context.TODO(), configMap) + Expect(err).NotTo(HaveOccurred()) + + // Set the nodeNameRef.Namespace to "default" to match the ConfigMap namespace + reconciler.nodeNameRef.Namespace = "default" + + vfAddresses := []string{"0000:00:00.1"} + err = reconciler.handleResourceNotFound(currentConfig, resourceList, "57c3", acc, vfAddresses) + Expect(err).NotTo(HaveOccurred()) + }) + }) + + Describe("updateConfigMap", func() { + It("should update the ConfigMap", func() { + // Create a fake ConfigMap + configMap := &v1.ConfigMap{ + ObjectMeta: metav1.ObjectMeta{ + Name: "sriovdp-config", + Namespace: "default", + }, + Data: map[string]string{ + "config.json": "{}", + }, + } + err := reconciler.Client.Create(context.TODO(), configMap) + Expect(err).NotTo(HaveOccurred()) + + // Prepare the new config + newConfig := make(map[string]interface{}) + newConfig["resourceList"] = []interface{}{ + map[string]interface{}{ + "resourceName": "new-resource", + "selectors": map[string]interface{}{ + "devices": []interface{}{"57c3"}, + }, + }, + } + + // Set the nodeNameRef.Namespace to "default" to match the ConfigMap namespace + reconciler.nodeNameRef.Namespace = "default" + + // Run the updateConfigMap function + err = reconciler.updateConfigMap(newConfig, "new-resource") + Expect(err).NotTo(HaveOccurred()) + + // Verify the ConfigMap was updated + updatedConfigMap := &v1.ConfigMap{} + err = reconciler.Client.Get(context.TODO(), types.NamespacedName{Name: "sriovdp-config", Namespace: "default"}, updatedConfigMap) + Expect(err).NotTo(HaveOccurred()) + Expect(updatedConfigMap.Data["config.json"]).To(ContainSubstring("new-resource")) + }) + }) + + Describe("modifyResource", func() { + It("should modify the resource", func() { + resourceMap := map[string]interface{}{ + "additionalInfo": map[string]interface{}{ + "*": map[string]interface{}{ + "PF_PCI_ADDR": "0000:00:00.0", + }, + }, + "selectors": map[string]interface{}{ + "devices": []interface{}{"57c3"}, + }, + } + vfAddresses := []string{"0000:00:00.1"} + modified := reconciler.modifyResource(resourceMap, "new-resource", "0000:00:00.0", vfAddresses) + Expect(modified).To(BeTrue()) + }) + }) + + Describe("loadCurrentDevicePluginConfig", func() { + It("should load the current device plugin config", func() { + // Create a fake ConfigMap + configMap := &v1.ConfigMap{ + ObjectMeta: metav1.ObjectMeta{ + Name: "sriovdp-config", + Namespace: "default", + }, + Data: map[string]string{ + "config.json": `{"resourceList": [{"resourceName": "test-resource"}]}`, + }, + } + err := reconciler.Client.Create(context.TODO(), configMap) + Expect(err).NotTo(HaveOccurred()) + + // Set the nodeNameRef.Namespace to "default" to match the ConfigMap namespace + reconciler.nodeNameRef.Namespace = "default" + + // Run the loadCurrentDevicePluginConfig function + ctx := context.TODO() + config, err := reconciler.loadCurrentDevicePluginConfig(ctx) + Expect(err).NotTo(HaveOccurred()) + Expect(config).NotTo(BeNil()) + Expect(config["resourceList"]).To(HaveLen(1)) + resourceList := config["resourceList"].([]interface{}) + resourceMap := resourceList[0].(map[string]interface{}) + Expect(resourceMap["resourceName"]).To(Equal("test-resource")) + }) + }) +}) diff --git a/pkg/daemon/daemon_test.go b/pkg/daemon/daemon_test.go index 6f6948f..5c7a951 100644 --- a/pkg/daemon/daemon_test.go +++ b/pkg/daemon/daemon_test.go @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright (c) 2020-2024 Intel Corporation +// Copyright (c) 2020-2025 Intel Corporation package daemon diff --git a/pkg/daemon/daemon_vrb.go b/pkg/daemon/daemon_vrb.go index 8bcc7f5..7d47363 100644 --- a/pkg/daemon/daemon_vrb.go +++ b/pkg/daemon/daemon_vrb.go @@ -6,16 +6,20 @@ package daemon import ( "bytes" "context" + "encoding/json" "fmt" "os" "os/exec" "strings" + "sync" "github.com/intel/sriov-fec-operator/pkg/common/utils" "github.com/sirupsen/logrus" + v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/types" vrbv1 "github.com/intel/sriov-fec-operator/api/sriovvrb/v1" + "k8s.io/apimachinery/pkg/api/equality" k8serrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -28,6 +32,10 @@ var ( VrbConfigPath = "/sriov_config/config/accelerators_vrb.json" VrbgetSriovInventory = VrbGetSriovInventory VrbsupportedAccelerators utils.AcceleratorDiscoveryConfig + configMapResource sync.Map + vrbPreviousConfig = make(map[string]vrbv1.PhysicalFunctionConfigExt) + vrbCurrentConfig = make(map[string]vrbv1.PhysicalFunctionConfigExt) + vrbDeviceUpdateRequired = make(map[string]bool) ) type VrbNodeConfigReconciler struct { @@ -40,13 +48,26 @@ type VrbNodeConfigReconciler struct { } type VrbConfigurer interface { - VrbApplySpec(nodeConfig vrbv1.SriovVrbNodeConfigSpec) error + VrbApplySpec(nodeConfig vrbv1.SriovVrbNodeConfigSpec, vrbDeviceUpdateRequired map[string]bool) error } /***************************************************************************** * Method: VrbNodeConfigReconciler::Reconcile - * Description: - * + * Description: This function is the main reconciliation loop for the VrbNodeConfig + * custom resource. It is triggered by changes to the resource and + * performs the following steps: + * 1. Reads the VrbNodeConfig resource. + * 2. Reads the existing inventory of the node. + * 3. Validates the VrbNodeConfig specification. + * 4. Checks if the requested configuration refers to non-existing + * accelerators and updates the status accordingly. + * 5. Determines if a card update is required based on the current + * and requested configurations. + * 6. If an update is required, it updates the status to indicate + * that the configuration is in progress. + * 7. Configures the node based on the VrbNodeConfig specification. + * 8. Updates the status to indicate whether the configuration + * succeeded or failed. ****************************************************************************/ func (r *VrbNodeConfigReconciler) Reconcile(_ context.Context, req ctrl.Request) (ctrl.Result, error) { r.log.Debugf("VrbReconcile(...) triggered by %s", req.NamespacedName.String()) @@ -71,27 +92,45 @@ func (r *VrbNodeConfigReconciler) Reconcile(_ context.Context, req ctrl.Request) return requeueLaterOrNowIfError(r.updateStatus(vrbnc, metav1.ConditionFalse, ConfigurationFailed, "requested configuration refers to not existing accelerator")) } + for _, accelerator := range vrbdetectedInventory.SriovAccelerators { + vrbDeviceUpdateRequired[accelerator.PCIAddress] = true + } + if !r.isCardUpdateRequired(vrbnc, vrbdetectedInventory) { r.log.Debug("SriovVrb: Nothing to do") return requeueLater() } - if r.isCardUpdateRequired(vrbnc, vrbdetectedInventory) { + if err := r.updateStatus(vrbnc, metav1.ConditionFalse, ConfigurationInProgress, "Configuration started"); err != nil { + return requeueNowWithError(err) + } - if err := r.updateStatus(vrbnc, metav1.ConditionFalse, ConfigurationInProgress, "Configuration started"); err != nil { - return requeueNowWithError(err) - } + if err := r.configureNode(vrbnc); err != nil { + r.log.WithError(err).Error("error occurred during configuring node") + return requeueNowWithError(r.updateStatus(vrbnc, metav1.ConditionFalse, ConfigurationFailed, err.Error())) + } - if err := r.configureNode(vrbnc); err != nil { - r.log.WithError(err).Error("error occurred during configuring node") - return requeueNowWithError(r.updateStatus(vrbnc, metav1.ConditionFalse, ConfigurationFailed, err.Error())) - } else { - return requeueLaterOrNowIfError(r.updateStatus(vrbnc, metav1.ConditionTrue, ConfigurationSucceeded, "Configured successfully")) - } + return requeueLaterOrNowIfError(r.updateStatus(vrbnc, metav1.ConditionTrue, ConfigurationSucceeded, "Configured successfully")) +} +/***************************************************************************** + * Method: VrbNodeConfigReconciler::handleSriovDevicePluginConfigMap + * Description: Handles the SR-IOV device plugin ConfigMap configuration, + * including loading, modifying and updating it if needed. + * Returns an error if the device plugin configuration could not be handled. + ****************************************************************************/ +func (r *VrbNodeConfigReconciler) handleSriovDevicePluginConfigMap(vrbnc *vrbv1.SriovVrbNodeConfig) error { + // Process each physical function + for _, acc := range vrbnc.Spec.PhysicalFunctions { + if acc.VrbResourceName == "" { + continue + } + if err := r.loadAndModifyDevicePluginConfig(vrbnc, acc); err != nil { + return err + } } - return requeueLater() + return nil } /***************************************************************************** @@ -175,8 +214,8 @@ func (r *VrbNodeConfigReconciler) SetupWithManager(mgr ctrl.Manager) error { /***************************************************************************** * Method: VrbNodeConfigReconciler::UpdateStatus - * Description: - * + * Description: Updates the status of the VrbNodeConfig resource. + * Returns an error if the status could not be updated. ****************************************************************************/ func (r *VrbNodeConfigReconciler) updateStatus(nc *vrbv1.SriovVrbNodeConfig, status metav1.ConditionStatus, @@ -184,6 +223,27 @@ func (r *VrbNodeConfigReconciler) updateStatus(nc *vrbv1.SriovVrbNodeConfig, previousCondition := VrbfindOrCreateConfigurationStatusCondition(nc) + if reason == ConfigurationInProgress { + // Clear the current configuration map + for key := range vrbCurrentConfig { + delete(vrbCurrentConfig, key) + } + // Update the current configuration map with the new configuration + for _, pf := range nc.Spec.PhysicalFunctions { + vrbCurrentConfig[pf.PCIAddress] = pf + } + r.checkIfDeviceUpdateNeeded(vrbPreviousConfig, vrbCurrentConfig) + } else if reason == ConfigurationSucceeded { + // Clear the previous configuration + for key := range vrbPreviousConfig { + delete(vrbPreviousConfig, key) + } + // Update the previous configuration with the current configuration + for _, pf := range nc.Spec.PhysicalFunctions { + vrbPreviousConfig[pf.PCIAddress] = pf + } + } + // SriovFecNodeConfig.generation is under K8S management // metav1.Condition.observedGeneration is under this reconciler management. // observedGeneration would be incremented then and only then when spec which comes with updated generation would be processed without any error. @@ -273,19 +333,24 @@ func (r *VrbNodeConfigReconciler) readNodeConfig(nn types.NamespacedName) (nc *v /***************************************************************************** * Method: VrbNodeConfigReconciler::configureNode - * Description: - * + * Description: Configures the node based on the VrbNodeConfig specification. + * Applies the new PF/VF configuration and updates the sriov device plugin ConfigMap. + * Returns an error if the configuration failed. ****************************************************************************/ func (r *VrbNodeConfigReconciler) configureNode(nodeConfig *vrbv1.SriovVrbNodeConfig) error { var configurationError error drainFunc := func(ctx context.Context) bool { - if err := r.vrbconfigurer.VrbApplySpec(nodeConfig.Spec); err != nil { + if err := r.vrbconfigurer.VrbApplySpec(nodeConfig.Spec, vrbDeviceUpdateRequired); err != nil { r.log.WithError(err).Error("failed applying new PF/VF configuration") configurationError = err return true } - + if err := r.handleSriovDevicePluginConfigMap(nodeConfig); err != nil { + r.log.WithError(err).Error("failed updating the sriov device plugin ConfigMap") + configurationError = err + return true + } configurationError = r.restartDevicePlugin() return true } @@ -476,3 +541,350 @@ func (r *VrbNodeConfigReconciler) getVrbPfBbConfVersion() string { return out.String() } } + +/***************************************************************************** + * Method: VrbNodeConfigReconciler::loadAndModifyDevicePluginConfig + * Description: Loads the sriovdp-config ConfigMap and modifies the resourceName + * and PF_PCI_ADDR for the requested pfPciAddress + * Returns an error if the ConfigMap could not be loaded or modified + ****************************************************************************/ +func (r *VrbNodeConfigReconciler) loadAndModifyDevicePluginConfig(vrbnc *vrbv1.SriovVrbNodeConfig, acc vrbv1.PhysicalFunctionConfigExt) error { + // Load the current sriovdp-config ConfigMap + currentConfig, err := r.loadCurrentDevicePluginConfig(context.TODO()) + if err != nil { + return r.updateStatus(vrbnc, metav1.ConditionFalse, ConfigurationFailed, err.Error()) + } + + // Check if currentConfig["resourceList"] is a non-empty slice + resourceList, ok := currentConfig["resourceList"].([]interface{}) + if !ok || len(resourceList) == 0 { + r.log.Info("currentConfig does not contain a valid resourceList") + return r.updateStatus(vrbnc, metav1.ConditionFalse, ConfigurationFailed, "currentConfig does not contain a valid resourceList") + } + + // Get the VF device ID + vfDeviceID, err := utils.GetVFDeviceID(acc.PCIAddress) + if err != nil { + r.log.WithError(err).Error("failed to get VF device ID") + } + r.log.Infof("VF device ID: %s for PCIAddress: %s", vfDeviceID, acc.PCIAddress) + + // Find all VFs configured for the PF + vfAddresses, err := utils.FindVFs(acc.PCIAddress) + r.log.WithField("pfPciAddress", acc.PCIAddress).Infof("Found VFs: %v", vfAddresses) + if err != nil { + r.log.WithError(err).Error("failed to find VFs") + } + + // Check if the ConfigMap resource exists and needs to be updated + if r.resourceFoundAndUpdated(currentConfig, resourceList, vfDeviceID, acc, vfAddresses) { + return nil + } + + // Handle the case where a resource matching vfDeviceID and pfPciAddress was not found in the ConfigMap + return r.handleResourceNotFound(currentConfig, resourceList, vfDeviceID, acc, vfAddresses) +} + +/***************************************************************************** + * Method: VrbNodeConfigReconciler::resourceFoundAndUpdated + * Description: Checks if the ConfigMap resource needs to be updated + * Returns true if the resource was modified or + * if the number of pciAddresses in the resourceMap match the VFs found and the resourceName is the same as the newResourceName + * false otherwise + ****************************************************************************/ +func (r *VrbNodeConfigReconciler) resourceFoundAndUpdated(currentConfig map[string]interface{}, resourceList []interface{}, vfDeviceID string, acc vrbv1.PhysicalFunctionConfigExt, vfAddresses []string) bool { + for i := 0; i < len(resourceList); i++ { + resourceMap, ok := resourceList[i].(map[string]interface{}) + if !ok { + continue + } + if !r.matchVFDeviceID(resourceMap, vfDeviceID) { + continue + } + if !r.matchPFPCIAddress(resourceMap, acc.PCIAddress) { + continue + } + if r.matchVFsAndResourceName(resourceMap, acc.VrbResourceName, vfAddresses) { + // VFs and resourceName match, no need to update the resource + return true + } + if r.modifyResource(resourceMap, acc.VrbResourceName, acc.PCIAddress, vfAddresses) { + if r.updateConfigMap(currentConfig, acc.VrbResourceName) == nil { + return true + } + } + } + return false +} + +/***************************************************************************** + * Method: VrbNodeConfigReconciler::matchVFsAndResourceName + * Description: Checks if the amount of pciAddresses in the resourceMap match the VFs found and + * if the resourceName is the same as the newResourceName + * Returns true if number of pciAddresses in the resourceMap match the VFs found and + * the resourceName is the same as the newResourceName, false otherwise + ****************************************************************************/ +func (r *VrbNodeConfigReconciler) matchVFsAndResourceName(resourceMap map[string]interface{}, newResourceName string, vfAddresses []string) bool { + resourceName, ok := resourceMap["resourceName"].(string) + if !ok { + return false + } + selectors, ok := resourceMap["selectors"].(map[string]interface{}) + if !ok { + return false + } + pciAddresses, ok := selectors["pciAddresses"].([]interface{}) + if !ok { + r.log.WithField("selectors", selectors).Info("pciAddresses not found in resourceMap") + return false + } + r.log.WithField("pciAddresses", pciAddresses).WithField("vfAddresses", vfAddresses).Infof("current vfAddresses amount: %d requested vfAddresses: %d", len(pciAddresses), len(vfAddresses)) + r.log.WithField("resourceName", resourceName).WithField("newResourceName", newResourceName).Info("resourceName") + return resourceName == newResourceName && len(pciAddresses) == len(vfAddresses) +} + +/***************************************************************************** + * Method: VrbNodeConfigReconciler::matchPFPCIAddress + * Description: Checks the additional information in the resource map to see if + * PF_PCI_ADDR matches the requested PF PCI address. + * Returns: true if the PF_PCI_ADDR stored in additional information matches or if not set + * false otherwise. + ****************************************************************************/ +func (r *VrbNodeConfigReconciler) matchPFPCIAddress(resourceMap map[string]interface{}, pfPciAddress string) bool { + additionalInfoMap, ok := resourceMap["additionalInfo"].(map[string]interface{}) + if !ok { + r.log.Infof("additionalInfo not found in resourceMap") + return false + } + + starInfo, ok := additionalInfoMap["*"].(map[string]interface{}) + if !ok { + r.log.Infof("additionalInfo[*] not found in resourceMap") + return false + } + + pfPciAddr, ok := starInfo["PF_PCI_ADDR"].(string) + if ok { + // If the PF_PCI_ADDR is already set and it is different from the new PF_PCI_ADDR, return false + if strings.TrimSpace(pfPciAddr) != pfPciAddress { + r.log.Infof("PF_PCI_ADDR=%s in resourceMap does not match requested pfPciAddress=%s", pfPciAddr, pfPciAddress) + return false + } + } + return true +} + +/***************************************************************************** + * Method: VrbNodeConfigReconciler::matchVFDeviceID + * Description: Checks the selectors["devices"] in the resource map to see if + * they match the VF device ID. If they do, it saves the original + * ConfigMap resource if it hasn't been saved already. + * Returns true if selectors["devices"] equals vfDeviceID, false otherwise. + ****************************************************************************/ +func (r *VrbNodeConfigReconciler) matchVFDeviceID(resourceMap map[string]interface{}, vfDeviceID string) bool { + selectors, ok := resourceMap["selectors"].(map[string]interface{}) + if !ok { + return false + } + devices, ok := selectors["devices"].([]interface{}) + if !ok || len(devices) == 0 { + return false + } + if deviceID, ok := devices[0].(string); ok && deviceID == vfDeviceID { + // Save original ConfigMap resource + if _, loaded := configMapResource.LoadOrStore(vfDeviceID, copyResource(resourceMap)); !loaded { + r.log.WithField("vfDeviceID", vfDeviceID).Info("original ConfigMap resource saved") + } + return true + } + return false +} + +/***************************************************************************** + * Method: VrbNodeConfigReconciler::handleResourceNotFound + * Description: Handles the case where a resource matching vfDeviceID and + * pfPciAddress was not found in the ConfigMap + * Returns an error if the resource could not be modified + ****************************************************************************/ +func (r *VrbNodeConfigReconciler) handleResourceNotFound(config map[string]interface{}, resourceList []interface{}, vfDeviceID string, acc vrbv1.PhysicalFunctionConfigExt, vfAddresses []string) error { + // Check if the configMapResource map contains the original resource for the vfDeviceID + if originalResource, exists := configMapResource.Load(vfDeviceID); exists { + r.log.WithFields(logrus.Fields{ + "vfDeviceID": vfDeviceID, + "pfPciAddress": acc.PCIAddress, + "newResourceName": acc.VrbResourceName, + "originalResource": originalResource, + }).Info("modifying original resource") + + // Create a new resource based on the original resource + newResource := copyResource(originalResource) + newResourceMap, ok := newResource.(map[string]interface{}) + if !ok { + r.log.Infof("resourceMap not found in new resource") + return nil + } + + // Modify the new resource + if r.modifyResource(newResourceMap, acc.VrbResourceName, acc.PCIAddress, vfAddresses) { + // Append the new resource to the resourceList + r.log.WithField("originalConfig", config).Info("original sriov-device-plugin config") + resourceList = append(resourceList, newResource) + config["resourceList"] = resourceList + r.log.WithField("newConfig", config).Info("updated sriov-device-plugin config") + return r.updateConfigMap(config, acc.VrbResourceName) + } else { + r.log.WithField("pfPciAddress", acc.PCIAddress).WithField("resourceName", acc.VrbResourceName).Info("ConfigMap resource not modified") + return nil + } + } else { + r.log.WithField("vfDeviceID", vfDeviceID).WithField("pfPciAddress", acc.PCIAddress).Info("resource not found in ConfigMap") + return nil + } +} + +/***************************************************************************** + * Method: VrbNodeConfigReconciler::updateConfigMap + * Description: Updates the sriovdp-config ConfigMap with the modified data + * Returns an error if the ConfigMap could not be updated + ****************************************************************************/ +func (r *VrbNodeConfigReconciler) updateConfigMap(newConfig map[string]interface{}, newResourceName string) error { + modifiedData, err := json.MarshalIndent(newConfig, "", " ") + if err != nil { + r.log.WithError(err).Error("failed to marshal modified config.json") + return err + } + ctx := context.TODO() + configMapName := "sriovdp-config" + r.log.WithField("configMapName", configMapName).Debug("loading current sriovdp-config") + + // Load the ConfigMap + configMap := &v1.ConfigMap{} + if err := r.Client.Get(ctx, types.NamespacedName{Name: configMapName, Namespace: r.nodeNameRef.Namespace}, configMap); err != nil { + r.log.WithError(err).WithField("ConfigMap name", configMapName).Error("failed to load ConfigMap") + return err + } + configMap.Data["config.json"] = string(modifiedData) + + // Update the ConfigMap in the cluster + if err := r.Client.Update(ctx, configMap); err != nil { + r.log.WithError(err).WithField("ConfigMap name", configMapName).Error("failed to update ConfigMap") + return err + } + + r.log.WithFields(logrus.Fields{ + "ConfigMap name": configMapName, + "resourceName": newResourceName, + }).Info("sriovdp-config modified successfully") + + return nil +} + +/***************************************************************************** + * Method: VrbNodeConfigReconciler::modifyResource + * Description: Modifies the resource with the new resourceName and pfPciAddress + * Returns true if the resource was modified, false otherwise + ****************************************************************************/ +func (r *VrbNodeConfigReconciler) modifyResource(resourceMap map[string]interface{}, newResourceName string, pfPciAddress string, vfAddresses []string) bool { + selectors, ok := resourceMap["selectors"].(map[string]interface{}) + if !ok { + return false + } + + additionalInfoMap, ok := resourceMap["additionalInfo"].(map[string]interface{}) + if !ok { + r.log.Infof("additionalInfo not found in resourceMap") + return false + } + + starInfo, ok := additionalInfoMap["*"].(map[string]interface{}) + if !ok { + r.log.Infof("additionalInfo[*] not found in resourceMap") + return false + } + + r.log.WithFields(logrus.Fields{ + "selectors": selectors, + "resourceName": resourceMap["resourceName"], + }).Info("original resource map selectors and resourceName") + + // Modify selectors["pciAddresses"], resourceName and additionalInfo["*"]["PF_PCI_ADDR"] + selectors["pciAddresses"] = vfAddresses + resourceMap["resourceName"] = newResourceName + starInfo["PF_PCI_ADDR"] = pfPciAddress + + r.log.WithFields(logrus.Fields{ + "selectors": selectors, + "resourceName": resourceMap["resourceName"], + }).Info("new resource map selectors and resourceName") + + return true +} + +// copyResource creates a deep copy of the given resource +func copyResource(resource interface{}) interface{} { + resourceBytes, err := json.Marshal(resource) + if err != nil { + log.Fatalf("failed to marshal resource: %v", err) + } + var newResource interface{} + if err := json.Unmarshal(resourceBytes, &newResource); err != nil { + log.Fatalf("failed to unmarshal resource: %v", err) + } + return newResource +} + +/***************************************************************************** + * Method: VrbNodeConfigReconciler::loadCurrentDevicePluginConfig + * Description: Loads the current sriovdp-config ConfigMap + * Returns the config.json data as a map[string]interface{} or an error + ****************************************************************************/ +func (r *VrbNodeConfigReconciler) loadCurrentDevicePluginConfig(ctx context.Context) (map[string]interface{}, error) { + configMapName := "sriovdp-config" + r.log.WithField("configMapName", configMapName).Debug("loading current sriovdp-config") + + // Load the ConfigMap + configMap := &v1.ConfigMap{} + if err := r.Client.Get(ctx, types.NamespacedName{Name: configMapName, Namespace: r.nodeNameRef.Namespace}, configMap); err != nil { + r.log.WithError(err).WithField("ConfigMap name", configMapName).Error("failed to load ConfigMap") + return nil, err + } + + // Parse the config.json data + data, ok := configMap.Data["config.json"] + if !ok { + err := fmt.Errorf("config.json not found in ConfigMap %s", configMapName) + r.log.WithError(err).Error("failed to find config.json in ConfigMap") + return nil, err + } + + var config map[string]interface{} + if err := json.Unmarshal([]byte(data), &config); err != nil { + r.log.WithError(err).Error("failed to unmarshal config.json") + return nil, err + } + + return config, nil +} + +/***************************************************************************** + * Method: VrbNodeConfigReconciler::checkIfDeviceUpdateNeeded + * Description: Determines if a device update is required based on the current + * and requested configurations + ****************************************************************************/ +func (r *VrbNodeConfigReconciler) checkIfDeviceUpdateNeeded(previousConf, currentConf map[string]vrbv1.PhysicalFunctionConfigExt) { + // Check for updates in previous configuration + for k, prevConfig := range previousConf { + if currConfig, exists := currentConf[k]; !exists || !equality.Semantic.DeepEqual(prevConfig, currConfig) { + vrbDeviceUpdateRequired[k] = true + } else { + vrbDeviceUpdateRequired[k] = false + } + } + + // Check for new entries in current configuration + for k := range currentConf { + if _, exists := previousConf[k]; !exists { + vrbDeviceUpdateRequired[k] = true + } + } +} diff --git a/pkg/daemon/device_plugin_controller.go b/pkg/daemon/device_plugin_controller.go index 716aff9..0f0edff 100644 --- a/pkg/daemon/device_plugin_controller.go +++ b/pkg/daemon/device_plugin_controller.go @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright (c) 2020-2024 Intel Corporation +// Copyright (c) 2020-2025 Intel Corporation package daemon diff --git a/pkg/daemon/inventory.go b/pkg/daemon/inventory.go index b63a7ed..0bfd72d 100644 --- a/pkg/daemon/inventory.go +++ b/pkg/daemon/inventory.go @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright (c) 2020-2024 Intel Corporation +// Copyright (c) 2020-2025 Intel Corporation package daemon diff --git a/pkg/daemon/inventory_test.go b/pkg/daemon/inventory_test.go index 88c6a56..78477ff 100644 --- a/pkg/daemon/inventory_test.go +++ b/pkg/daemon/inventory_test.go @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright (c) 2020-2024 Intel Corporation +// Copyright (c) 2020-2025 Intel Corporation package daemon diff --git a/pkg/daemon/node_management.go b/pkg/daemon/node_management.go index 3e8e785..ee2dcc0 100644 --- a/pkg/daemon/node_management.go +++ b/pkg/daemon/node_management.go @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright (c) 2020-2024 Intel Corporation +// Copyright (c) 2020-2025 Intel Corporation package daemon @@ -9,6 +9,7 @@ import ( "path/filepath" "strconv" "strings" + "time" sriovv2 "github.com/intel/sriov-fec-operator/api/sriovfec/v2" vrbv1 "github.com/intel/sriov-fec-operator/api/sriovvrb/v1" @@ -189,6 +190,10 @@ func (n *NodeConfigurator) flrReset(pfPCIAddress string) error { return fmt.Errorf("failed to execute Function Level Reset for PF (%s): %s", pfPCIAddress, err) } + // Add a 1-second delay between PF FLR and starting pf_bb_config + // to ensure that the PF is fully reset + time.Sleep(1 * time.Second) + return nil } @@ -297,7 +302,7 @@ func loadDrivers(nc *NodeConfigurator, pfDriver string, vfDriver string) error { return nil } -func (n *NodeConfigurator) ApplySpec(nodeConfig sriovv2.SriovFecNodeConfigSpec) error { +func (n *NodeConfigurator) ApplySpec(nodeConfig sriovv2.SriovFecNodeConfigSpec, fecDeviceUpdateRequired map[string]bool) error { inv, err := getSriovInventory(n.Log) if err != nil { n.Log.WithError(err).Error("failed to obtain current sriov inventory") @@ -307,6 +312,9 @@ func (n *NodeConfigurator) ApplySpec(nodeConfig sriovv2.SriovFecNodeConfigSpec) n.Log.WithField("inventory", inv).Info("current node status") for _, acc := range inv.SriovAccelerators { + if !fecDeviceUpdateRequired[acc.PCIAddress] { + continue + } requestedConfig := getMatchingConfiguration(acc.PCIAddress, nodeConfig.PhysicalFunctions) if requestedConfig == nil { if len(acc.VFs) > 0 { @@ -326,7 +334,7 @@ func (n *NodeConfigurator) ApplySpec(nodeConfig sriovv2.SriovFecNodeConfigSpec) return nil } -func (n *NodeConfigurator) VrbApplySpec(nodeConfig vrbv1.SriovVrbNodeConfigSpec) error { +func (n *NodeConfigurator) VrbApplySpec(nodeConfig vrbv1.SriovVrbNodeConfigSpec, vrbDeviceUpdateRequired map[string]bool) error { inv, err := VrbgetSriovInventory(n.Log) if err != nil { n.Log.WithError(err).Error("failed to obtain current sriov inventory") @@ -336,6 +344,9 @@ func (n *NodeConfigurator) VrbApplySpec(nodeConfig vrbv1.SriovVrbNodeConfigSpec) n.Log.WithField("inventory", inv).Info("current node status") for _, acc := range inv.SriovAccelerators { + if !vrbDeviceUpdateRequired[acc.PCIAddress] { + continue + } requestedConfig := VrbgetMatchingConfiguration(acc.PCIAddress, nodeConfig.PhysicalFunctions) if requestedConfig == nil { if len(acc.VFs) > 0 { diff --git a/pkg/daemon/package_config.go b/pkg/daemon/package_config.go index b51b1fa..db5cdbb 100644 --- a/pkg/daemon/package_config.go +++ b/pkg/daemon/package_config.go @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright (c) 2020-2024 Intel Corporation +// Copyright (c) 2020-2025 Intel Corporation package daemon diff --git a/pkg/daemon/pf_bb_config_cli.go b/pkg/daemon/pf_bb_config_cli.go index 24cbc4f..945fd85 100644 --- a/pkg/daemon/pf_bb_config_cli.go +++ b/pkg/daemon/pf_bb_config_cli.go @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright (c) 2020-2024 Intel Corporation +// Copyright (c) 2020-2025 Intel Corporation package daemon diff --git a/pkg/daemon/pf_bb_config_cli_test.go b/pkg/daemon/pf_bb_config_cli_test.go index 9eee4ab..9016f55 100644 --- a/pkg/daemon/pf_bb_config_cli_test.go +++ b/pkg/daemon/pf_bb_config_cli_test.go @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright (c) 2020-2024 Intel Corporation +// Copyright (c) 2020-2025 Intel Corporation package daemon diff --git a/pkg/daemon/suite_test.go b/pkg/daemon/suite_test.go index 488300b..1b44932 100644 --- a/pkg/daemon/suite_test.go +++ b/pkg/daemon/suite_test.go @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright (c) 2020-2024 Intel Corporation +// Copyright (c) 2020-2025 Intel Corporation package daemon diff --git a/pkg/daemon/telemetry.go b/pkg/daemon/telemetry.go index bed3d72..2299e16 100644 --- a/pkg/daemon/telemetry.go +++ b/pkg/daemon/telemetry.go @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright (c) 2020-2024 Intel Corporation +// Copyright (c) 2020-2025 Intel Corporation package daemon diff --git a/pkg/daemon/telemetry_test.go b/pkg/daemon/telemetry_test.go index 6f299d5..68897bd 100644 --- a/pkg/daemon/telemetry_test.go +++ b/pkg/daemon/telemetry_test.go @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright (c) 2020-2024 Intel Corporation +// Copyright (c) 2020-2025 Intel Corporation package daemon diff --git a/pkg/daemon/testdata/archives/sample-archive/inner-dir/inner-file-1 b/pkg/daemon/testdata/archives/sample-archive/inner-dir/inner-file-1 index 257ad77..97e0d13 100644 --- a/pkg/daemon/testdata/archives/sample-archive/inner-dir/inner-file-1 +++ b/pkg/daemon/testdata/archives/sample-archive/inner-dir/inner-file-1 @@ -1,2 +1,2 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation diff --git a/pkg/daemon/testdata/archives/sample-archive/outer-file-1 b/pkg/daemon/testdata/archives/sample-archive/outer-file-1 index 257ad77..97e0d13 100644 --- a/pkg/daemon/testdata/archives/sample-archive/outer-file-1 +++ b/pkg/daemon/testdata/archives/sample-archive/outer-file-1 @@ -1,2 +1,2 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation diff --git a/pkg/daemon/testdata/archives/sample-archive/outer-file-2 b/pkg/daemon/testdata/archives/sample-archive/outer-file-2 index 257ad77..97e0d13 100644 --- a/pkg/daemon/testdata/archives/sample-archive/outer-file-2 +++ b/pkg/daemon/testdata/archives/sample-archive/outer-file-2 @@ -1,2 +1,2 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation diff --git a/pkg/daemon/testdata/centos_os_release b/pkg/daemon/testdata/centos_os_release index 573483c..30b8bbf 100644 --- a/pkg/daemon/testdata/centos_os_release +++ b/pkg/daemon/testdata/centos_os_release @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation NAME="CentOS Linux" VERSION="7 (Core)" ID="centos" diff --git a/pkg/daemon/testdata/cmdline_test b/pkg/daemon/testdata/cmdline_test index 829b49f..c3963f7 100644 --- a/pkg/daemon/testdata/cmdline_test +++ b/pkg/daemon/testdata/cmdline_test @@ -1,4 +1,4 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation intel_iommu=on iommu=pt diff --git a/pkg/daemon/testdata/cmdline_test_missing_param b/pkg/daemon/testdata/cmdline_test_missing_param index 6250da1..a97b011 100644 --- a/pkg/daemon/testdata/cmdline_test_missing_param +++ b/pkg/daemon/testdata/cmdline_test_missing_param @@ -1,4 +1,4 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation intel_iommu=off iommu=pt diff --git a/pkg/daemon/testdata/rhcos_os_release b/pkg/daemon/testdata/rhcos_os_release index 881fbd0..b9095bb 100644 --- a/pkg/daemon/testdata/rhcos_os_release +++ b/pkg/daemon/testdata/rhcos_os_release @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation NAME="Red Hat Enterprise Linux CoreOS" VERSION="4.5" VERSION_ID="4.5" diff --git a/pkg/daemon/testdata/rhel_os_release b/pkg/daemon/testdata/rhel_os_release index 208ddd3..4574601 100644 --- a/pkg/daemon/testdata/rhel_os_release +++ b/pkg/daemon/testdata/rhel_os_release @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation NAME="Red Hat Enterprise Linux" VERSION="8.2 (Ootpa)" ID="rhel" diff --git a/pkg/daemon/testdata/unknown_os_release b/pkg/daemon/testdata/unknown_os_release index 36e2162..f193aaf 100644 --- a/pkg/daemon/testdata/unknown_os_release +++ b/pkg/daemon/testdata/unknown_os_release @@ -1,3 +1,3 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation ID="unknown" diff --git a/pkg/daemon/utils.go b/pkg/daemon/utils.go index ef24d5a..187ee2d 100644 --- a/pkg/daemon/utils.go +++ b/pkg/daemon/utils.go @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright (c) 2020-2024 Intel Corporation +// Copyright (c) 2020-2025 Intel Corporation package daemon diff --git a/pkg/daemon/utils_test.go b/pkg/daemon/utils_test.go index c0657e5..bce0748 100644 --- a/pkg/daemon/utils_test.go +++ b/pkg/daemon/utils_test.go @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// Copyright (c) 2020-2024 Intel Corporation +// Copyright (c) 2020-2025 Intel Corporation package daemon diff --git a/spec/kubernetes-deployment.md b/spec/kubernetes-deployment.md index 16b7af1..92ddc7b 100644 --- a/spec/kubernetes-deployment.md +++ b/spec/kubernetes-deployment.md @@ -1,5 +1,5 @@ ## SPDX-License-Identifier: Apache-2.0 -## Copyright (c) 2020-2024 Intel Corporation +## Copyright (c) 2020-2025 Intel Corporation ## Technical Requirements and Dependencies diff --git a/spec/openshift-deployment.md b/spec/openshift-deployment.md index 5f79239..4a2918d 100644 --- a/spec/openshift-deployment.md +++ b/spec/openshift-deployment.md @@ -1,5 +1,5 @@ ## SPDX-License-Identifier: Apache-2.0 -## Copyright (c) 2020-2024 Intel Corporation +## Copyright (c) 2020-2025 Intel Corporation ## Technical Requirements and Dependencies diff --git a/spec/sriov-fec-operator-release-notes.md b/spec/sriov-fec-operator-release-notes.md index c31ced7..4847028 100644 --- a/spec/sriov-fec-operator-release-notes.md +++ b/spec/sriov-fec-operator-release-notes.md @@ -1,6 +1,6 @@ ```text SPDX-License-Identifier: Apache-2.0 -Copyright (c) 2020-2024 Intel Corporation +Copyright (c) 2020-2025 Intel Corporation ``` # Release Notes @@ -52,9 +52,14 @@ This document provides high-level system features, issues, and limitations infor | 2.8.0 | Dec 2023 | 4.11, 4.12, 4.13, 4.14 | 4.11.54, 4.12.45, 4.13.27, 4.14.7 | | 2.9.0 | May 2024 | 4.11, 4.12, 4.13, 4.14, 4.15 | 4.11.54, 4.12.57, 4.13.27, 4.14.25, 4.15.13 | | 2.10.0 | Dec 2024 | 4.12 and higher versions | 4.12 and higher (latest stable versions) | +| 2.11.0 | Dec 2024 | 4.12 and higher versions | 4.12 and higher (latest stable versions) | # Features for Release +***v2.11.0*** +- Updated pf-bb-config version to 25.01 to support VRB2 on GNR-D +- Bug fixes + ***v2.10.0*** - Update pf-bb-config version to 24.11 to support VRB2 on GRN-D B0 ES2 Device. - Reduce periodic log messages for controller-manager and daemonset @@ -153,6 +158,11 @@ This document provides high-level system features, issues, and limitations infor # Changes to Existing Features +***v2.11.0*** +- Update UBI base image to latest version +- daemonset deployment configuration moved to configMaps to enable configuration changes +- golan/glog version update to 1.2.4 + ***v2.10.0*** - Telemetry functionality enhancements - Telemetry disabled by default @@ -262,6 +272,14 @@ This document provides high-level system features, issues, and limitations infor # Fixed Issues +***2.11.0*** +- Enhancement for dual VRB2 accelerator to map VF resource by explicit + mention to the underlying PF. +- Fix for the first accelerator is reconfigured when second accelerator is configured + in case of dual accelerators present on same worker node. +- Fix for CR apply failure on ACC100 in HP DL110 platforms (issue #322) +- Set the protobuf version (1.33.0) properly in go.mod file + ***2.10.0*** - Fix for golang linter errors - Fix for OCP meta data annotations @@ -315,6 +333,10 @@ This document provides high-level system features, issues, and limitations infor # Known issues +***v2.11.0*** +- GNR-D with two VRB2 accelerator instances, in case of multiple worker nodes deployment + user defined resource naming is not supported. + ***v2.10.0*** - Limitation on two accelerator devices on same node - Request to a specific accelerator resource is not supported @@ -507,4 +529,4 @@ This document provides high-level system features, issues, and limitations infor # Package Versions Package: - Golang: 1.23.4 -- pf-bb-config-app: v24.11 +- pf-bb-config-app: v25.01 diff --git a/spec/sriov-fec-operator.md b/spec/sriov-fec-operator.md index d73632a..486eafa 100644 --- a/spec/sriov-fec-operator.md +++ b/spec/sriov-fec-operator.md @@ -1,6 +1,6 @@ ```text SPDX-License-Identifier: Apache-2.0 -Copyright (c) 2020-2024 Intel Corporation +Copyright (c) 2020-2025 Intel Corporation ``` # SRIOV-FEC Operator for Wireless FEC Accelerators @@ -21,6 +21,7 @@ Copyright (c) 2020-2024 Intel Corporation - [Summary](#summary) - [Appendix 1 - Developer Notes](#appendix-1---developer-notes) - [Drain skip option](#drain-skip-option) + - [VrbResourceName (Optional)](#vrbresourcename-optional) - [Appendix 2 - Reference CR configurations for support accelerators in SRIOV-FEC Operator](#appendix-2---reference-cr-configurations-for-support-accelerators-in-sriov-fec-operator) - [ACC100](#acc100) - [vRAN Boost Accelerator V1 (VRB1)](#vran-boost-accelerator-v1-vrb1) @@ -509,6 +510,20 @@ The operator handles all the necessary actions from creation of FEC resources to Using the option `spec.drainSkip: false` in CR will perform the [node drain](https://kubernetes.io/docs/reference/kubectl/generated/kubectl_drain/) while applying the configuration. If you do not want to drain the node during the CR apply, set this option to `true` which is the default behavior. +### VrbResourceName (Optional) + +Using the `sriovvrbclusterconfig.spec.vrbResourceName` allows you to specify a custom resource name for the sriov-device-plugin specific to VRB2 with multiple accelerators. If not provided, the default resource name `intel_vrb_vrb2` will be used. Using this option will link the custom vrbResourceName to a specific VRB2 physical function. + +- **Description**: Indicates a custom resource name for the sriov-device-plugin specific to VRB2. +- **Type**: `string` +- **Optional**: Yes +- **Pattern**: `^[a-zA-Z0-9-_]+$` + +**Limitations:** +- In the case of dual VRB2 devices in one node, if `vrbResourceName` is used in one device CR, then it is mandatory to use it in the CR for the second device. +- Once `vrbResourceName` is set, it cannot be removed from the CR; it can only be renamed. +- It is mandatory to have different `vrbResourceName` values across different sriovvrbclusterconfig. If the same `vrbResourceName` is used in multiple CRs, the sriov-device-plugin will crash. This can be fixed by updating one of the CRs to use a different `vrbResourceName` and re-applying the configuration. + ## Appendix 2 - Reference CR configurations for support accelerators in SRIOV-FEC Operator ### ACC100 @@ -663,7 +678,57 @@ spec: nodeSelector: kubernetes.io/hostname: worker-node acceleratorSelector: - pciAddress: 0000:f7:00.0 + pciAddress: 0000:07:00.0 + drainSkip: true + physicalFunction: + pfDriver: vfio-pci + vfDriver: vfio-pci + vfAmount: 2 + bbDevConfig: + vrb2: + pfMode: false + numVfBundles: 2 + maxQueueSize: 1024 + downlink4G: + aqDepthLog2: 4 + numAqsPerGroups: 16 + numQueueGroups: 0 + uplink4G: + aqDepthLog2: 4 + numAqsPerGroups: 16 + numQueueGroups: 0 + downlink5G: + aqDepthLog2: 4 + numAqsPerGroups: 16 + numQueueGroups: 4 + uplink5G: + aqDepthLog2: 4 + numAqsPerGroups: 16 + numQueueGroups: 4 + qfft: + aqDepthLog2: 4 + numAqsPerGroups: 16 + numQueueGroups: 4 + qmld: + aqDepthLog2: 4 + numAqsPerGroups: 64 + numQueueGroups: 4 +``` + +- Reference CR for VRB2 using optional VrbResourceName + +```yaml +apiVersion: sriovvrb.intel.com/v1 +kind: SriovVrbClusterConfig +metadata: + name: config + namespace: vran-acceleration-operators +spec: + priority: 1 + nodeSelector: + kubernetes.io/hostname: worker-node + acceleratorSelector: + pciAddress: 0000:07:00.0 drainSkip: true physicalFunction: pfDriver: vfio-pci @@ -698,6 +763,7 @@ spec: aqDepthLog2: 4 numAqsPerGroups: 64 numQueueGroups: 4 + vrbResourceName: "intel_vrb_vrb2_1" ``` ## Appendix 3 - Gathering logs for bug report diff --git a/spec/sriov-fec-selector-based-api.puml b/spec/sriov-fec-selector-based-api.puml index d08b246..a00c393 100644 --- a/spec/sriov-fec-selector-based-api.puml +++ b/spec/sriov-fec-selector-based-api.puml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright (c) 2020-2024 Intel Corporation +# Copyright (c) 2020-2025 Intel Corporation @startuml 'https://plantuml.com/class-diagram diff --git a/spec/vran-accelerators-supported-by-operator.md b/spec/vran-accelerators-supported-by-operator.md index e6199ba..dbf156c 100644 --- a/spec/vran-accelerators-supported-by-operator.md +++ b/spec/vran-accelerators-supported-by-operator.md @@ -1,6 +1,6 @@ ```text SPDX-License-Identifier: Apache-2.0 -Copyright (c) 2020-2024 Intel Corporation +Copyright (c) 2020-2025 Intel Corporation ``` # Intel's vRAN accelerators supported by SRIOV-FEC Operator on OpenShift