Skip to content

Commit

Permalink
fix(container): propagate privileged flag
Browse files Browse the repository at this point in the history
The `privileged` config flag for `container` services wasn't resulting
in the `allowPrivilegeEscalation` flag being set too. This is fixed
here.
  • Loading branch information
thsig committed Nov 1, 2021
1 parent 4304c42 commit 58cb571
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion core/src/plugins/kubernetes/container/deployment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ export async function createWorkloadManifest({
resources: getResourceRequirements({ cpu, memory }, limits),
imagePullPolicy: "IfNotPresent",
securityContext: {
allowPrivilegeEscalation: false,
allowPrivilegeEscalation: spec.privileged || false,
...getSecurityContext(spec.privileged, spec.addCapabilities, spec.dropCapabilities),
},
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ describe("kubernetes container deployment handlers", () => {
})

expect(resource.spec.template?.spec?.containers[0].securityContext).to.eql({
allowPrivilegeEscalation: false,
allowPrivilegeEscalation: true,
privileged: true,
capabilities: {
add: ["SYS_TIME"],
Expand Down

0 comments on commit 58cb571

Please sign in to comment.