Skip to content

Commit af0a862

Browse files
Merge pull request #99023 from verb/1.21-securitycontext
Allow setting securityContext in ephemeral containers Kubernetes-commit: e799d7b1912b57ae0e898cb79f93066c0c8f0142
2 parents 0ff29d3 + f608fb0 commit af0a862

File tree

5 files changed

+9
-7
lines changed

5 files changed

+9
-7
lines changed

core/v1/generated.proto

+2-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

core/v1/types.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -3546,7 +3546,8 @@ type EphemeralContainerCommon struct {
35463546
// More info: https://kubernetes.io/docs/concepts/containers/images#updating-images
35473547
// +optional
35483548
ImagePullPolicy PullPolicy `json:"imagePullPolicy,omitempty" protobuf:"bytes,14,opt,name=imagePullPolicy,casttype=PullPolicy"`
3549-
// SecurityContext is not allowed for ephemeral containers.
3549+
// Optional: SecurityContext defines the security options the ephemeral container should be run with.
3550+
// If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext.
35503551
// +optional
35513552
SecurityContext *SecurityContext `json:"securityContext,omitempty" protobuf:"bytes,15,opt,name=securityContext"`
35523553

core/v1/types_swagger_doc_generated.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,7 @@ var map_EphemeralContainerCommon = map[string]string{
607607
"terminationMessagePath": "Optional: Path at which the file to which the container's termination message will be written is mounted into the container's filesystem. Message written is intended to be brief final status, such as an assertion failure message. Will be truncated by the node if greater than 4096 bytes. The total message length across all containers will be limited to 12kb. Defaults to /dev/termination-log. Cannot be updated.",
608608
"terminationMessagePolicy": "Indicate how the termination message should be populated. File will use the contents of terminationMessagePath to populate the container status message on both success and failure. FallbackToLogsOnError will use the last chunk of container log output if the termination message file is empty and the container exited with an error. The log output is limited to 2048 bytes or 80 lines, whichever is smaller. Defaults to File. Cannot be updated.",
609609
"imagePullPolicy": "Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images",
610-
"securityContext": "SecurityContext is not allowed for ephemeral containers.",
610+
"securityContext": "Optional: SecurityContext defines the security options the ephemeral container should be run with. If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext.",
611611
"stdin": "Whether this container should allocate a buffer for stdin in the container runtime. If this is not set, reads from stdin in the container will always result in EOF. Default is false.",
612612
"stdinOnce": "Whether the container runtime should close the stdin channel after it has been opened by a single attach. When stdin is true the stdin stream will remain open across multiple attach sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the first client attaches to stdin, and then remains open and accepts data until the client disconnects, at which time stdin is closed and remains closed until the container is restarted. If this flag is false, a container processes that reads from stdin will never receive an EOF. Default is false",
613613
"tty": "Whether this container should allocate a TTY for itself, also requires 'stdin' to be true. Default is false.",

go.mod

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ go 1.16
77
require (
88
github.com/gogo/protobuf v1.3.2
99
github.com/stretchr/testify v1.7.0
10-
k8s.io/apimachinery v0.0.0-20210708214246-ff522ab81c74
10+
k8s.io/apimachinery v0.0.0-20210712060818-a644435e2c13
1111
)
1212

13-
replace k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20210708214246-ff522ab81c74
13+
replace k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20210712060818-a644435e2c13

go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,8 @@ gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v
207207
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
208208
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
209209
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
210-
k8s.io/apimachinery v0.0.0-20210708214246-ff522ab81c74 h1:Daxg4VCqUpkKuMJjia7XcVVDHnPjH6IeKb7jcZDcQUM=
211-
k8s.io/apimachinery v0.0.0-20210708214246-ff522ab81c74/go.mod h1:O3oNtNadZdeOMxHFVxOreoznohCpy0z6mocxbZr7oJ0=
210+
k8s.io/apimachinery v0.0.0-20210712060818-a644435e2c13 h1:Y40e5ho6n8KOvBCqdz/jm7ssKQyQLQdbZbC3lR9TaCU=
211+
k8s.io/apimachinery v0.0.0-20210712060818-a644435e2c13/go.mod h1:O3oNtNadZdeOMxHFVxOreoznohCpy0z6mocxbZr7oJ0=
212212
k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0=
213213
k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE=
214214
k8s.io/klog/v2 v2.9.0 h1:D7HV+n1V57XeZ0m6tdRkfknthUaM06VFbWldOFh8kzM=

0 commit comments

Comments
 (0)