Skip to content

Security Context is Not Set in Init Container #1370

Closed

Description

@dan-fernandes

BlueAPI's .Values.securityContext is only applied to the main container, not the init container. (I suspect) this means that the init and main containers can run as different users, root or non root, etc.

This seems to be causing issues, such as scratch dependencies downloaded by the init container not being modifiable by the main container (see #1363). It also makes some issues unreproducible due to not being able to choose the UID of the init container (see #1308 which could only be reproduced if the init container ran as non-1000).

Propagating the security context is easy, but I'm nervous that this may have unforeseen consequences.

Acceptance Criteria

  • Init container's security context can be set via .Values

Activity

  1. abbiemery commented on Feb 26, 2026

    @abbiemery
    Contributor

    @dan-fernandes is this still an issue after #1322 and #1336?

  2. dan-fernandes commented on Mar 2, 2026

    @dan-fernandes
    ContributorAuthor

    PRs #1322 and #1336 were fixes to a problem that I suspect was caused by this (but that were a better solution than propagating the security context).

    As the lack of security context propagation is not currently causing any issues, I think this can be closed.

    If there are errors in the future that stem from this, we can revisit.

  3. dan-fernandes commented on Mar 2, 2026

    @dan-fernandes
    ContributorAuthor

    If the security context does ever get propagated, it is worth looking at #1096.

    The initContainer may not be function if it inherits readOnlyRootFilesystem

  4. added a commit that references this issue on Mar 23, 2026
    7fcd2a6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    deploymentStuff related to running in production containerneeds confirmationDoes this bug still exist?

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions