Skip to content

Commit c632624

Browse files
author
Maurice Faber
committed
fix: job spec
1 parent b9b4f9d commit c632624

File tree

6 files changed

+87
-40
lines changed

6 files changed

+87
-40
lines changed

package-lock.json

Lines changed: 44 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
"eslint-plugin-import": "^2.22.1",
7272
"eslint-plugin-jsx-a11y": "^6.4.1",
7373
"eslint-plugin-prettier": "^3.3.1",
74+
"git-branch-is": "^4.0.0",
7475
"husky": "^4.3.8",
7576
"jsonwebtoken": "^8.5.1",
7677
"lint-staged": "^10.5.4",
@@ -141,7 +142,7 @@
141142
"dev": "ts-node-dev --watch 'src/openapi/*.yaml' --inspect=4321 --respawn --transpile-only src/app.ts",
142143
"dev:docker": "npm ci && npm run dev",
143144
"husky:lint-staged": "lint-staged",
144-
"husky:pre-commit": "npm run build:client && npm run lint && npm run husky:lint-staged",
145+
"husky:pre-commit": "npm run husky:lint-staged && npm run lint && git-branch-is master && npm run build:client",
145146
"lint": "run-p types lint:es",
146147
"lint:es": "eslint --ext ts .",
147148
"lint:fix": "eslint --ext ts --fix .",

src/fixtures/values.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,8 +314,6 @@ export default {
314314
secretMounts: [],
315315
podSecurityContext: {
316316
runAsUser: 1001,
317-
runAsGroup: 1001,
318-
runAsNonRoot: true,
319317
},
320318
resources: {
321319
requests: {

src/openapi/api.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -693,6 +693,8 @@ components:
693693
$ref: definitions.yaml#/offChoice
694694
path:
695695
$ref: definitions.yaml#/path
696+
podSecurityContext:
697+
$ref: definitions.yaml#/podSecurityContext
696698
podSpec:
697699
$ref: definitions.yaml#/podSpec
698700
policies:
@@ -715,8 +717,6 @@ components:
715717
$ref: definitions.yaml#/script
716718
secrets:
717719
$ref: definitions.yaml#/secrets
718-
securityContext:
719-
$ref: definitions.yaml#/securityContext
720720
svcPredeployed:
721721
$ref: definitions.yaml#/svcPredeployed
722722
url:

src/openapi/definitions.yaml

Lines changed: 32 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,9 @@ containerSpecNoSec:
218218
- resources
219219
containerSpec:
220220
allOf:
221-
- $ref: '#/securityContext'
221+
- properties:
222+
securityContext:
223+
$ref: '#/securityContext'
222224
- $ref: '#/containerSpecNoSec'
223225
cpuQuantity:
224226
title: CPU quantity
@@ -599,6 +601,32 @@ path:
599601
description: An absolute path
600602
type: string
601603
pattern: '^[/].*$'
604+
podSecurityContext:
605+
properties:
606+
runAsUser:
607+
$ref: '#/runAsUser'
608+
description: The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.
609+
runAsGroup:
610+
$ref: '#/runAsGroup'
611+
description: The GID to run the entrypoint of the container process. Defaults to group specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.
612+
runAsNonRoot:
613+
$ref: '#/runAsNonRoot'
614+
description: Will prevent any container from starting with UID 0.
615+
fsGroup:
616+
description: Supplementary group ID. Volumes that support ownership management are modified to be owned and writable by this ID.
617+
type: string
618+
fsGroupChangePolicy:
619+
description:
620+
'Defines behavior for changing ownership and permission of the volume before being exposed inside a Pod. This field only applies to volume types that support fsGroup controlled ownership and permissions.
621+
This field has two possible values:
622+
OnRootMismatch: Only change permissions and ownership if permission and ownership of root directory does not match with expected permissions of the volume. This could help shorten the time it takes to change ownership and permission of a volume.
623+
Always: Always change permission and ownership of the volume when volume is mounted.'
624+
enum:
625+
# - null
626+
- Always
627+
- OnRootMismatch
628+
description: Security context for the pod.
629+
title: Pod security context
602630
podSpec:
603631
allOf:
604632
- properties:
@@ -607,31 +635,7 @@ podSpec:
607635
title: Pod annotations
608636
- properties:
609637
podSecurityContext:
610-
properties:
611-
runAsUser:
612-
$ref: '#/runAsUser'
613-
description: The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.
614-
runAsGroup:
615-
$ref: '#/runAsGroup'
616-
description: The GID to run the entrypoint of the container process. Defaults to group specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.
617-
runAsNonRoot:
618-
$ref: '#/runAsNonRoot'
619-
description: Will prevent any container from starting with UID 0.
620-
fsGroup:
621-
description: Supplementary group ID. Volumes that support ownership management are modified to be owned and writable by this ID.
622-
type: string
623-
fsGroupChangePolicy:
624-
description:
625-
'Defines behavior for changing ownership and permission of the volume before being exposed inside a Pod. This field only applies to volume types that support fsGroup controlled ownership and permissions.
626-
This field has two possible values:
627-
OnRootMismatch: Only change permissions and ownership if permission and ownership of root directory does not match with expected permissions of the volume. This could help shorten the time it takes to change ownership and permission of a volume.
628-
Always: Always change permission and ownership of the volume when volume is mounted.'
629-
enum:
630-
- null
631-
- Always
632-
- OnRootMismatch
633-
description: Security context for the pod.
634-
title: Pod security context
638+
$ref: '#/podSecurityContext'
635639
- $ref: '#/containerSpec'
636640
type: object
637641
portNumber:
@@ -714,7 +718,8 @@ script:
714718
description: May specify a non-empty string containing an executable script.
715719
type: string
716720
securityContext:
717-
additionalProperties: true
721+
additionalProperties:
722+
uniqueItems: true
718723
properties:
719724
runAsUser:
720725
$ref: '#/runAsUser'

src/openapi/job.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ Job:
22
x-acl:
33
admin: [read-any, create-any, update-any, delete-any]
44
team: [read-any, create, update, delete]
5-
properties:
6-
id:
7-
type: string
8-
readOnly: true
9-
teamId:
10-
$ref: definitions.yaml#/idName
11-
readOnly: true
125
type: object
136
allOf:
7+
- properties:
8+
id:
9+
type: string
10+
readOnly: true
11+
teamId:
12+
$ref: definitions.yaml#/idName
13+
readOnly: true
1414
- $ref: definitions.yaml#/jobSpec
1515
- $ref: definitions.yaml#/podSpec

0 commit comments

Comments
 (0)