Skip to content

daemon: mount writable /tmp for mstconfig lockfiles#146

Merged
e0ne merged 1 commit intoMellanox:network-operator-26.1.xfrom
rollandf:tmpdir
Feb 2, 2026
Merged

daemon: mount writable /tmp for mstconfig lockfiles#146
e0ne merged 1 commit intoMellanox:network-operator-26.1.xfrom
rollandf:tmpdir

Conversation

@rollandf
Copy link
Member

@rollandf rollandf commented Feb 1, 2026

When running with readOnlyRootFilesystem enabled, mstconfig fails to create its lockfiles because the path /tmp/mstflint_lockfiles is hardcoded in the mstflint source code.

This patch adds an emptyDir volume mounted at /tmp to provide a writable location for these lockfiles while maintaining the security benefits of a read-only root filesystem for the rest of the container.

When running with readOnlyRootFilesystem enabled, mstconfig fails to
create its lockfiles because the path /tmp/mstflint_lockfiles is
hardcoded in the mstflint source code.

This patch adds an emptyDir volume mounted at /tmp to provide a
writable location for these lockfiles while maintaining the security
benefits of a read-only root filesystem for the rest of the container.

Signed-off-by: Fred Rolland <frolland@nvidia.com>
@github-actions
Copy link

github-actions bot commented Feb 1, 2026

Thanks for your PR,
To run vendors CIs, Maintainers can use one of:

  • /test-all: To run all tests for all vendors.
  • /test-e2e-all: To run all E2E tests for all vendors.
  • /test-e2e-nvidia-all: To run all E2E tests for NVIDIA vendor.

To skip the vendors CIs, Maintainers can use one of:

  • /skip-all: To skip all tests for all vendors.
  • /skip-e2e-all: To skip all E2E tests for all vendors.
  • /skip-e2e-nvidia-all: To skip all E2E tests for NVIDIA vendor.
    Best regards.

Copy link
Collaborator

@heyvister1 heyvister1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice and elegant. Thanks
I think that this should be also accepted by upstream

@rollandf rollandf marked this pull request as ready for review February 2, 2026 08:30
@greptile-apps
Copy link

greptile-apps bot commented Feb 2, 2026

Greptile Overview

Greptile Summary

This PR adds a writable /tmp directory to the sriov-network-config-daemon container to fix mstconfig failures when readOnlyRootFilesystem is enabled. The mstconfig tool (from mstflint) has a hardcoded path /tmp/mstflint_lockfiles for creating lockfiles during firmware configuration operations.

Changes:

  • Added emptyDir volume named tmp
  • Mounted the volume at /tmp in the daemon container

Impact:

  • Fixes runtime failures when configuring Mellanox NIC firmware with read-only root filesystem
  • Maintains security posture by keeping root filesystem read-only while providing minimal writable space
  • Uses standard Kubernetes emptyDir pattern for temporary writable storage

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The change is minimal, well-scoped, and follows Kubernetes best practices by using emptyDir for temporary writable storage. It solves a real runtime failure without compromising security.
  • No files require special attention

Important Files Changed

Filename Overview
bindata/manifests/daemon/daemonset.yaml Added emptyDir volume for /tmp to enable mstconfig lockfile creation with readOnlyRootFilesystem

Sequence Diagram

sequenceDiagram
    participant K8s as Kubernetes
    participant Pod as sriov-network-config-daemon Pod
    participant Container as Daemon Container
    participant EmptyDir as /tmp emptyDir Volume
    participant mstconfig as mstconfig Binary
    participant Lockfiles as /tmp/mstflint_lockfiles

    K8s->>Pod: Create DaemonSet Pod
    K8s->>EmptyDir: Create emptyDir volume (tmp)
    K8s->>Container: Start container with readOnlyRootFilesystem=true
    K8s->>Container: Mount emptyDir at /tmp
    
    Note over Container: Root filesystem is read-only
    Note over EmptyDir: /tmp is writable via emptyDir

    Container->>mstconfig: Execute mstconfig command
    mstconfig->>Lockfiles: Create lockfile at /tmp/mstflint_lockfiles
    Note over Lockfiles: Path hardcoded in mstflint source
    Lockfiles-->>mstconfig: Lockfile created successfully
    mstconfig->>Container: Configure NIC firmware
    mstconfig-->>Container: Operation complete
    
    Note over Container,EmptyDir: Security maintained: only /tmp is writable
Loading

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 file reviewed, no comments

Edit Code Review Agent Settings | Greptile

@e0ne e0ne merged commit 4be10b0 into Mellanox:network-operator-26.1.x Feb 2, 2026
10 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants