Skip to content

Commit 537a0bb

Browse files
authored
Merge pull request #311 from snyk/fix/openshift-uid
chore: relax checks on runAsUser and runAsGroup
2 parents 6238c67 + 98cc36f commit 537a0bb

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

test/helpers/deployment.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,16 @@ export function validateSecureConfiguration(test: tap, deployment: V1Deployment)
4242
tap.ok(securityContext.allowPrivilegeEscalation === false, 'must explicitly set allowPrivilegeEscalation to false');
4343
tap.ok(securityContext.privileged === false, 'must explicitly set privileged to false');
4444
tap.ok(securityContext.runAsNonRoot === true, 'must explicitly set runAsNonRoot to true');
45-
tap.ok(securityContext.runAsUser === 10001, 'must explicitly set runAsUser to 10001');
46-
tap.ok(securityContext.runAsGroup === 10001, 'must explicitly set runAsGroup to 10001');
45+
tap.ok(
46+
securityContext.runAsUser !== undefined &&
47+
securityContext.runAsUser >= 10001,
48+
'must explicitly set runAsUser to be 10001 or greater',
49+
);
50+
tap.ok(
51+
securityContext.runAsGroup !== undefined &&
52+
securityContext.runAsGroup >= 10001,
53+
'must explicitly set runAsGroup to be 10001 or greater',
54+
);
4755
}
4856

4957
export function validateVolumeMounts(test: tap, deployment: V1Deployment) {

0 commit comments

Comments
 (0)