Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions apis/v1alpha1/config_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 0 additions & 4 deletions bundle/manifests/bpfman.io_configs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions config/crd/bases/bpfman.io_configs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 0 additions & 7 deletions controllers/bpfman-operator/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
42 changes: 5 additions & 37 deletions controllers/bpfman-operator/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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,
},
},
Expand All @@ -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 {
Expand Down
Loading