From af42674eb2179ae2ab4022f0b39316d071a8b623 Mon Sep 17 00:00:00 2001 From: Dawid Rusnak Date: Tue, 8 Oct 2024 09:10:06 +0200 Subject: [PATCH] fix: allow passing FSGroup to PodSecurityContext --- api/v1/testkube.yaml | 2 ++ pkg/api/v1/testkube/model_pod_security_context.go | 1 + pkg/mapper/testworkflows/kube_openapi.go | 1 + pkg/mapper/testworkflows/openapi_kube.go | 1 + 4 files changed, 5 insertions(+) diff --git a/api/v1/testkube.yaml b/api/v1/testkube.yaml index 8cb1486e53f..88291fa5f42 100644 --- a/api/v1/testkube.yaml +++ b/api/v1/testkube.yaml @@ -9654,6 +9654,8 @@ components: $ref: "#/components/schemas/BoxedInteger" runAsNonRoot: $ref: "#/components/schemas/BoxedBoolean" + fsGroup: + $ref: "#/components/schemas/BoxedInteger" Toleration: type: object diff --git a/pkg/api/v1/testkube/model_pod_security_context.go b/pkg/api/v1/testkube/model_pod_security_context.go index 0387e375277..0cfb077e7df 100644 --- a/pkg/api/v1/testkube/model_pod_security_context.go +++ b/pkg/api/v1/testkube/model_pod_security_context.go @@ -13,4 +13,5 @@ type PodSecurityContext struct { RunAsUser *BoxedInteger `json:"runAsUser,omitempty"` RunAsGroup *BoxedInteger `json:"runAsGroup,omitempty"` RunAsNonRoot *BoxedBoolean `json:"runAsNonRoot,omitempty"` + FsGroup *BoxedInteger `json:"fsGroup,omitempty"` } diff --git a/pkg/mapper/testworkflows/kube_openapi.go b/pkg/mapper/testworkflows/kube_openapi.go index 76d890fca62..9f452f681b8 100644 --- a/pkg/mapper/testworkflows/kube_openapi.go +++ b/pkg/mapper/testworkflows/kube_openapi.go @@ -513,6 +513,7 @@ func MapPodSecurityContextKubeToAPI(v corev1.PodSecurityContext) testkube.PodSec RunAsUser: MapInt64ToBoxedInteger(v.RunAsUser), RunAsGroup: MapInt64ToBoxedInteger(v.RunAsGroup), RunAsNonRoot: MapBoolToBoxedBoolean(v.RunAsNonRoot), + FsGroup: MapInt64ToBoxedInteger(v.FSGroup), } } diff --git a/pkg/mapper/testworkflows/openapi_kube.go b/pkg/mapper/testworkflows/openapi_kube.go index b4f250b85c6..e7b4195b9f4 100644 --- a/pkg/mapper/testworkflows/openapi_kube.go +++ b/pkg/mapper/testworkflows/openapi_kube.go @@ -544,6 +544,7 @@ func MapPodSecurityContextAPIToKube(v testkube.PodSecurityContext) corev1.PodSec RunAsUser: MapBoxedIntegerToInt64(v.RunAsUser), RunAsGroup: MapBoxedIntegerToInt64(v.RunAsGroup), RunAsNonRoot: MapBoxedBooleanToBool(v.RunAsNonRoot), + FSGroup: MapBoxedIntegerToInt64(v.FsGroup), } }