Skip to content

Commit 2eeebfe

Browse files
committed
Add Policy parameter to PodTemplateParams
Signed-off-by: Philippe Martin <[email protected]>
1 parent faef587 commit 2eeebfe

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

go.mod

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ require (
2626
k8s.io/apimachinery v0.26.1
2727
k8s.io/client-go v0.26.1
2828
k8s.io/klog v1.0.0
29+
k8s.io/pod-security-admission v0.26.1
2930
k8s.io/utils v0.0.0-20221128185143-99ec85e7a448
3031
sigs.k8s.io/controller-runtime v0.14.4
3132
sigs.k8s.io/yaml v1.3.0

go.sum

+2
Original file line numberDiff line numberDiff line change
@@ -1735,6 +1735,8 @@ k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7/go.mod h1:wXW5VT87nVfh/iL
17351735
k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 h1:+70TFaan3hfJzs+7VK2o+OGxg8HsuBr/5f6tVAjDu6E=
17361736
k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280/go.mod h1:+Axhij7bCpeqhklhUTe3xmOn6bWxolyZEeyaFpjGtl4=
17371737
k8s.io/kubernetes v1.13.0/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk=
1738+
k8s.io/pod-security-admission v0.26.1 h1:EDIxsYFeKMzNvN/JB0PgQcuwBP6fIkIG2O8ZWJhzOp4=
1739+
k8s.io/pod-security-admission v0.26.1/go.mod h1:hCbYTG5UtLlivmukkMPjAWf23PUBUHzEvR60xNVWN4c=
17381740
k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
17391741
k8s.io/utils v0.0.0-20210722164352-7f3ee0f31471/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
17401742
k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=

pkg/devfile/generator/generators.go

+4
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import (
3434
networkingv1 "k8s.io/api/networking/v1"
3535
"k8s.io/apimachinery/pkg/api/resource"
3636
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
37+
psaapi "k8s.io/pod-security-admission/api"
3738
)
3839

3940
const (
@@ -227,6 +228,9 @@ func GetDeployment(devfileObj parser.DevfileObj, deployParams DeploymentParams)
227228
// PodTemplateParams is a struct that contains the required data to create a podtemplatespec object
228229
type PodTemplateParams struct {
229230
ObjectMeta metav1.ObjectMeta
231+
// PodSecurityAdmissionPolicy is the policy to be respected by the created pod
232+
// The pod will be patched, if necessary, to respect the policies
233+
PodSecurityAdmissionPolicy psaapi.Policy
230234
}
231235

232236
func GetPodTemplateSpec(devfileObj parser.DevfileObj, podTemplateParams PodTemplateParams) (*corev1.PodTemplateSpec, error) {

0 commit comments

Comments
 (0)