Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VAULT-14149 Don't override shareProcessNamespace unless annotation is explicitly set #445

Merged
merged 4 commits into from
Mar 20, 2023

Conversation

swenson
Copy link

@swenson swenson commented Mar 17, 2023

By having a default of false, we would automatically set shareProcessNamespace to false when injecting the agent pod, regardless of what the main manifest had set.

Instead, we should only set shareProcessNamespace if the annotation is explicitly set, and otherwise let the default from the main manifest stand.

Fixes #436 (thanks @justinas-b for reporting it).

I tested this by:

  • Before this patch:
    • Create a pod with shareProcessNamespace: true with injected agent
    • Verifying that the containers cannot see each other with ps -ax
  • After this patch:
    • Create a pod with shareProcessNamespace: true with injected agent and no annotation
    • Verifying that the containers can see each other with ps -ax
    • Create a pod with shareProcessNamespace: true with injected agent and annotation set to 'false'
    • Verifying that the containers cannot see each other with ps -ax

@swenson swenson requested review from tvoran and benashz March 17, 2023 21:35
By having a default of `false`, we would automatically set
`shareProcessNamespace` to `false` when injecting the agent pod,
regardless of what the main manifest had set.

Instead, we should only set `shareProcessNamespace` if the annotation
is explicitly set, and otherwise let the default from the main manifest
stand.

Fixes #436 (thanks @justinas-b for reporting it).

I tested this by:

* Before this patch:
  * Create a pod with `shareProcessNamespace: true` with injected agent
  * Verifying that the containers cannot see each other with `ps -ax`
* After this patch:
  * Create a pod with `shareProcessNamespace: true` with injected agent and no annotation
  * Verifying that the containers *can* see each other with `ps -ax`
  * Create a pod with `shareProcessNamespace: true` with injected agent and annotation set to `'false'`
  * Verifying that the containers *cannot* see each other with `ps -ax`
@swenson swenson force-pushed the dont-override-share-process-namespace branch from 95317ff to 0573487 Compare March 17, 2023 21:35
@swenson swenson changed the title Don't override shareProcessNamespace unless annotation is explicitly set VAULT-14149 Don't override shareProcessNamespace unless annotation is explicitly set Mar 17, 2023
Copy link
Contributor

@benashz benashz left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Member

Choose a reason for hiding this comment

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

Might be nice to add some tests in here for shareProcessNamespace?

@swenson
Copy link
Author

swenson commented Mar 20, 2023

Thanks!

@swenson swenson merged commit dac5fef into main Mar 20, 2023
@swenson swenson deleted the dont-override-share-process-namespace branch March 20, 2023 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants