Skip to content

Commit d7aa318

Browse files
committed
Adding a new WindowsSecurityOptions struct
As outlined in the KEP at https://github.com/kubernetes/enhancements/blob/master/keps/sig-windows/20190418-windows-security-context.md and improvements on it at kubernetes/enhancements#975 For now this struct is left empty, as discussed in the KEP (see above) and as previously discussed with Jordan Liggitt. It will allow adding GMSA and options as well as `RunAsUserName` options; both of which have already been pre-implemented respectively at kubernetes#75459 and kubernetes#73609; and both of which will need to be re-based to make use of the new struct. Signed-off-by: Jean Rouge <[email protected]>
1 parent 62219e1 commit d7aa318

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

pkg/apis/core/types.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2733,6 +2733,9 @@ type PodSecurityContext struct {
27332733
// takes precedence for that container.
27342734
// +optional
27352735
SELinuxOptions *SELinuxOptions
2736+
// Windows security options.
2737+
// +optional
2738+
WindowsOptions *WindowsSecurityContextOptions
27362739
// The UID to run the entrypoint of the container process.
27372740
// Defaults to user specified in image metadata if unspecified.
27382741
// May also be set in SecurityContext. If set in both SecurityContext and
@@ -4677,6 +4680,9 @@ type SecurityContext struct {
46774680
// PodSecurityContext, the value specified in SecurityContext takes precedence.
46784681
// +optional
46794682
SELinuxOptions *SELinuxOptions
4683+
// Windows security options.
4684+
// +optional
4685+
WindowsOptions *WindowsSecurityContextOptions
46804686
// The UID to run the entrypoint of the container process.
46814687
// Defaults to user specified in image metadata if unspecified.
46824688
// May also be set in PodSecurityContext. If set in both SecurityContext and
@@ -4743,6 +4749,11 @@ type SELinuxOptions struct {
47434749
Level string
47444750
}
47454751

4752+
// WindowsSecurityContextOptions contain Windows-specific options and credentials.
4753+
type WindowsSecurityContextOptions struct {
4754+
// intentionally left empty for now
4755+
}
4756+
47464757
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
47474758

47484759
// RangeAllocation is an opaque API object (not exposed to end users) that can be persisted to record

staging/src/k8s.io/api/core/v1/types.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3000,6 +3000,9 @@ type PodSecurityContext struct {
30003000
// takes precedence for that container.
30013001
// +optional
30023002
SELinuxOptions *SELinuxOptions `json:"seLinuxOptions,omitempty" protobuf:"bytes,1,opt,name=seLinuxOptions"`
3003+
// Windows security options.
3004+
// +optional
3005+
WindowsOptions *WindowsSecurityContextOptions `json:"windowsOptions,omitempty" protobuf:"bytes,8,opt,name=windowsOptions"`
30033006
// The UID to run the entrypoint of the container process.
30043007
// Defaults to user specified in image metadata if unspecified.
30053008
// May also be set in SecurityContext. If set in both SecurityContext and
@@ -5267,6 +5270,9 @@ type SecurityContext struct {
52675270
// PodSecurityContext, the value specified in SecurityContext takes precedence.
52685271
// +optional
52695272
SELinuxOptions *SELinuxOptions `json:"seLinuxOptions,omitempty" protobuf:"bytes,3,opt,name=seLinuxOptions"`
5273+
// Windows security options.
5274+
// +optional
5275+
WindowsOptions *WindowsSecurityContextOptions `json:"windowsOptions,omitempty" protobuf:"bytes,10,opt,name=windowsOptions"`
52705276
// The UID to run the entrypoint of the container process.
52715277
// Defaults to user specified in image metadata if unspecified.
52725278
// May also be set in PodSecurityContext. If set in both SecurityContext and
@@ -5337,6 +5343,11 @@ type SELinuxOptions struct {
53375343
Level string `json:"level,omitempty" protobuf:"bytes,4,opt,name=level"`
53385344
}
53395345

5346+
// WindowsSecurityContextOptions contain Windows-specific options and credentials.
5347+
type WindowsSecurityContextOptions struct {
5348+
// intentionally left empty for now
5349+
}
5350+
53405351
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
53415352

53425353
// RangeAllocation is not a public type.

0 commit comments

Comments
 (0)