From 8ec6fc1d8a8523c4f15da51f8b703986a8f995fd Mon Sep 17 00:00:00 2001 From: Andrew McDermott Date: Mon, 12 Jan 2026 09:22:16 +0000 Subject: [PATCH 1/2] Remove BpffsInitImage configuration option from Config API The BpffsInitImage field in DaemonSpec allowed overriding the init container image that mounts bpffs. This configurability is no longer required as the init container will use the agent image directly in subsequent changes. Remove the field from the API, the corresponding override logic from the controller, and update the tests to only cover CSI registrar image overrides. Signed-off-by: Andrew McDermott --- apis/v1alpha1/config_types.go | 3 -- controllers/bpfman-operator/config.go | 7 ---- controllers/bpfman-operator/config_test.go | 42 +++------------------- 3 files changed, 5 insertions(+), 47 deletions(-) diff --git a/apis/v1alpha1/config_types.go b/apis/v1alpha1/config_types.go index 4ed3e8364..cd585caf3 100644 --- a/apis/v1alpha1/config_types.go +++ b/apis/v1alpha1/config_types.go @@ -56,9 +56,6 @@ type ConfigSpec struct { // DaemonSpec defines the desired state of the bpfman daemon. type DaemonSpec struct { - // BpffsInitImage holds the image for the init container that mounts bpffs. - // +optional - BpffsInitImage string `json:"bpffsInitImage,omitempty"` // CsiRegistrarImage holds the image for the CSI node driver registrar // sidecar container. // +optional diff --git a/controllers/bpfman-operator/config.go b/controllers/bpfman-operator/config.go index 35931f7b2..fd2a97062 100644 --- a/controllers/bpfman-operator/config.go +++ b/controllers/bpfman-operator/config.go @@ -288,13 +288,6 @@ func configureBpfmanDs(staticBpfmanDS *appsv1.DaemonSet, config *v1alpha1.Config // Do nothing } } - - // Configure init containers - for cindex, container := range staticBpfmanDS.Spec.Template.Spec.InitContainers { - if container.Name == internal.BpfmanInitContainerName && config.Spec.Daemon.BpffsInitImage != "" { - staticBpfmanDS.Spec.Template.Spec.InitContainers[cindex].Image = config.Spec.Daemon.BpffsInitImage - } - } } // configureMetricsProxyDs configures the metrics-proxy DaemonSet with runtime values. diff --git a/controllers/bpfman-operator/config_test.go b/controllers/bpfman-operator/config_test.go index f0c1cf36d..4d11c9dc8 100644 --- a/controllers/bpfman-operator/config_test.go +++ b/controllers/bpfman-operator/config_test.go @@ -581,45 +581,25 @@ func verifyCM(cm *corev1.ConfigMap, requiredFields map[string]*string) error { return nil } -// TestConfigureBpfmanDsImageOverrides verifies that optional image -// fields in the Config CR correctly override container images in the -// DaemonSet. -func TestConfigureBpfmanDsImageOverrides(t *testing.T) { +// TestConfigureBpfmanDsCsiRegistrarImageOverride verifies that the optional +// CsiRegistrarImage field in the Config CR correctly overrides the CSI node +// driver registrar container image in the DaemonSet. +func TestConfigureBpfmanDsCsiRegistrarImageOverride(t *testing.T) { tests := []struct { name string - bpffsInitImage string csiRegistrarImage string - expectedInitImage string expectedCsiRegistrarImage string }{ { - name: "defaults preserved when fields empty", - bpffsInitImage: "", + name: "default preserved when field empty", csiRegistrarImage: "", - expectedInitImage: "quay.io/fedora/fedora-minimal:39", - expectedCsiRegistrarImage: "quay.io/bpfman/csi-node-driver-registrar:v2.13.0", - }, - { - name: "init image overridden when set", - bpffsInitImage: "registry.example.com/custom-init:v1", - csiRegistrarImage: "", - expectedInitImage: "registry.example.com/custom-init:v1", expectedCsiRegistrarImage: "quay.io/bpfman/csi-node-driver-registrar:v2.13.0", }, { name: "csi registrar image overridden when set", - bpffsInitImage: "", csiRegistrarImage: "registry.example.com/custom-csi:v1", - expectedInitImage: "quay.io/fedora/fedora-minimal:39", expectedCsiRegistrarImage: "registry.example.com/custom-csi:v1", }, - { - name: "both images overridden when set", - bpffsInitImage: "registry.example.com/custom-init:v2", - csiRegistrarImage: "registry.example.com/custom-csi:v2", - expectedInitImage: "registry.example.com/custom-init:v2", - expectedCsiRegistrarImage: "registry.example.com/custom-csi:v2", - }, } for _, tc := range tests { @@ -645,7 +625,6 @@ func TestConfigureBpfmanDsImageOverrides(t *testing.T) { Daemon: v1alpha1.DaemonSpec{ Image: "quay.io/bpfman/bpfman:latest", LogLevel: "info", - BpffsInitImage: tc.bpffsInitImage, CsiRegistrarImage: tc.csiRegistrarImage, }, }, @@ -654,17 +633,6 @@ func TestConfigureBpfmanDsImageOverrides(t *testing.T) { // Apply configuration to the DaemonSet. configureBpfmanDs(ds, config) - // Verify init container image. - var initImage string - for _, c := range ds.Spec.Template.Spec.InitContainers { - if c.Name == internal.BpfmanInitContainerName { - initImage = c.Image - break - } - } - require.Equal(t, tc.expectedInitImage, initImage, - "init container image mismatch") - // Verify CSI registrar container image. var csiImage string for _, c := range ds.Spec.Template.Spec.Containers { From f64349ec2cc6a8465fe38dffcaf28ba6273ca659 Mon Sep 17 00:00:00 2001 From: Andrew McDermott Date: Mon, 12 Jan 2026 09:22:29 +0000 Subject: [PATCH 2/2] Regenerate CRD manifests and OLM bundle Regenerate the Config CRD and OLM bundle manifests following the removal of the BpffsInitImage field from the DaemonSpec API. Signed-off-by: Andrew McDermott --- bundle/manifests/bpfman-operator.clusterserviceversion.yaml | 2 +- bundle/manifests/bpfman.io_configs.yaml | 4 ---- config/crd/bases/bpfman.io_configs.yaml | 4 ---- 3 files changed, 1 insertion(+), 9 deletions(-) diff --git a/bundle/manifests/bpfman-operator.clusterserviceversion.yaml b/bundle/manifests/bpfman-operator.clusterserviceversion.yaml index eb47c260e..e8806cb26 100644 --- a/bundle/manifests/bpfman-operator.clusterserviceversion.yaml +++ b/bundle/manifests/bpfman-operator.clusterserviceversion.yaml @@ -1014,7 +1014,7 @@ metadata: capabilities: Basic Install categories: OpenShift Optional containerImage: quay.io/bpfman/bpfman-operator:latest - createdAt: "2025-12-23T10:13:33Z" + createdAt: "2026-01-12T09:20:12Z" description: The bpfman Operator is designed to manage eBPF programs for applications. features.operators.openshift.io/cnf: "false" features.operators.openshift.io/cni: "false" diff --git a/bundle/manifests/bpfman.io_configs.yaml b/bundle/manifests/bpfman.io_configs.yaml index 316047a97..0576be23b 100644 --- a/bundle/manifests/bpfman.io_configs.yaml +++ b/bundle/manifests/bpfman.io_configs.yaml @@ -70,10 +70,6 @@ spec: daemon: description: Daemon holds the configuration for the bpfman daemon. properties: - bpffsInitImage: - description: BpffsInitImage holds the image for the init container - that mounts bpffs. - type: string csiRegistrarImage: description: |- CsiRegistrarImage holds the image for the CSI node driver registrar diff --git a/config/crd/bases/bpfman.io_configs.yaml b/config/crd/bases/bpfman.io_configs.yaml index b701988a4..0ac5a7beb 100644 --- a/config/crd/bases/bpfman.io_configs.yaml +++ b/config/crd/bases/bpfman.io_configs.yaml @@ -70,10 +70,6 @@ spec: daemon: description: Daemon holds the configuration for the bpfman daemon. properties: - bpffsInitImage: - description: BpffsInitImage holds the image for the init container - that mounts bpffs. - type: string csiRegistrarImage: description: |- CsiRegistrarImage holds the image for the CSI node driver registrar