1 /* 2 Copyright The Kubernetes Authors. 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 See the License for the specific language governing permissions and 14 limitations under the License. 15 */ 16 17 // Code generated by applyconfiguration-gen. DO NOT EDIT. 18 19 package v1 20 21 import ( 22 corev1 "k8s.io/api/core/v1" 23 ) 24 25 // PodSecurityContextApplyConfiguration represents an declarative configuration of the PodSecurityContext type for use 26 // with apply. 27 type PodSecurityContextApplyConfiguration struct { 28 SELinuxOptions *SELinuxOptionsApplyConfiguration `json:"seLinuxOptions,omitempty"` 29 WindowsOptions *WindowsSecurityContextOptionsApplyConfiguration `json:"windowsOptions,omitempty"` 30 RunAsUser *int64 `json:"runAsUser,omitempty"` 31 RunAsGroup *int64 `json:"runAsGroup,omitempty"` 32 RunAsNonRoot *bool `json:"runAsNonRoot,omitempty"` 33 SupplementalGroups []int64 `json:"supplementalGroups,omitempty"` 34 FSGroup *int64 `json:"fsGroup,omitempty"` 35 Sysctls []SysctlApplyConfiguration `json:"sysctls,omitempty"` 36 FSGroupChangePolicy *corev1.PodFSGroupChangePolicy `json:"fsGroupChangePolicy,omitempty"` 37 SeccompProfile *SeccompProfileApplyConfiguration `json:"seccompProfile,omitempty"` 38 AppArmorProfile *AppArmorProfileApplyConfiguration `json:"appArmorProfile,omitempty"` 39 } 40 41 // PodSecurityContextApplyConfiguration constructs an declarative configuration of the PodSecurityContext type for use with 42 // apply. 43 func PodSecurityContext() *PodSecurityContextApplyConfiguration { 44 return &PodSecurityContextApplyConfiguration{} 45 } 46 47 // WithSELinuxOptions sets the SELinuxOptions field in the declarative configuration to the given value 48 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 49 // If called multiple times, the SELinuxOptions field is set to the value of the last call. 50 func (b *PodSecurityContextApplyConfiguration) WithSELinuxOptions(value *SELinuxOptionsApplyConfiguration) *PodSecurityContextApplyConfiguration { 51 b.SELinuxOptions = value 52 return b 53 } 54 55 // WithWindowsOptions sets the WindowsOptions field in the declarative configuration to the given value 56 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 57 // If called multiple times, the WindowsOptions field is set to the value of the last call. 58 func (b *PodSecurityContextApplyConfiguration) WithWindowsOptions(value *WindowsSecurityContextOptionsApplyConfiguration) *PodSecurityContextApplyConfiguration { 59 b.WindowsOptions = value 60 return b 61 } 62 63 // WithRunAsUser sets the RunAsUser field in the declarative configuration to the given value 64 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 65 // If called multiple times, the RunAsUser field is set to the value of the last call. 66 func (b *PodSecurityContextApplyConfiguration) WithRunAsUser(value int64) *PodSecurityContextApplyConfiguration { 67 b.RunAsUser = &value 68 return b 69 } 70 71 // WithRunAsGroup sets the RunAsGroup field in the declarative configuration to the given value 72 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 73 // If called multiple times, the RunAsGroup field is set to the value of the last call. 74 func (b *PodSecurityContextApplyConfiguration) WithRunAsGroup(value int64) *PodSecurityContextApplyConfiguration { 75 b.RunAsGroup = &value 76 return b 77 } 78 79 // WithRunAsNonRoot sets the RunAsNonRoot field in the declarative configuration to the given value 80 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 81 // If called multiple times, the RunAsNonRoot field is set to the value of the last call. 82 func (b *PodSecurityContextApplyConfiguration) WithRunAsNonRoot(value bool) *PodSecurityContextApplyConfiguration { 83 b.RunAsNonRoot = &value 84 return b 85 } 86 87 // WithSupplementalGroups adds the given value to the SupplementalGroups field in the declarative configuration 88 // and returns the receiver, so that objects can be build by chaining "With" function invocations. 89 // If called multiple times, values provided by each call will be appended to the SupplementalGroups field. 90 func (b *PodSecurityContextApplyConfiguration) WithSupplementalGroups(values ...int64) *PodSecurityContextApplyConfiguration { 91 for i := range values { 92 b.SupplementalGroups = append(b.SupplementalGroups, values[i]) 93 } 94 return b 95 } 96 97 // WithFSGroup sets the FSGroup field in the declarative configuration to the given value 98 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 99 // If called multiple times, the FSGroup field is set to the value of the last call. 100 func (b *PodSecurityContextApplyConfiguration) WithFSGroup(value int64) *PodSecurityContextApplyConfiguration { 101 b.FSGroup = &value 102 return b 103 } 104 105 // WithSysctls adds the given value to the Sysctls field in the declarative configuration 106 // and returns the receiver, so that objects can be build by chaining "With" function invocations. 107 // If called multiple times, values provided by each call will be appended to the Sysctls field. 108 func (b *PodSecurityContextApplyConfiguration) WithSysctls(values ...*SysctlApplyConfiguration) *PodSecurityContextApplyConfiguration { 109 for i := range values { 110 if values[i] == nil { 111 panic("nil value passed to WithSysctls") 112 } 113 b.Sysctls = append(b.Sysctls, *values[i]) 114 } 115 return b 116 } 117 118 // WithFSGroupChangePolicy sets the FSGroupChangePolicy field in the declarative configuration to the given value 119 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 120 // If called multiple times, the FSGroupChangePolicy field is set to the value of the last call. 121 func (b *PodSecurityContextApplyConfiguration) WithFSGroupChangePolicy(value corev1.PodFSGroupChangePolicy) *PodSecurityContextApplyConfiguration { 122 b.FSGroupChangePolicy = &value 123 return b 124 } 125 126 // WithSeccompProfile sets the SeccompProfile field in the declarative configuration to the given value 127 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 128 // If called multiple times, the SeccompProfile field is set to the value of the last call. 129 func (b *PodSecurityContextApplyConfiguration) WithSeccompProfile(value *SeccompProfileApplyConfiguration) *PodSecurityContextApplyConfiguration { 130 b.SeccompProfile = value 131 return b 132 } 133 134 // WithAppArmorProfile sets the AppArmorProfile field in the declarative configuration to the given value 135 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 136 // If called multiple times, the AppArmorProfile field is set to the value of the last call. 137 func (b *PodSecurityContextApplyConfiguration) WithAppArmorProfile(value *AppArmorProfileApplyConfiguration) *PodSecurityContextApplyConfiguration { 138 b.AppArmorProfile = value 139 return b 140 } 141