k8s.io/client-go@v0.22.2/applyconfigurations/extensions/v1beta1/podsecuritypolicyspec.go (about) 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 v1beta1 20 21 import ( 22 v1 "k8s.io/api/core/v1" 23 v1beta1 "k8s.io/api/extensions/v1beta1" 24 ) 25 26 // PodSecurityPolicySpecApplyConfiguration represents an declarative configuration of the PodSecurityPolicySpec type for use 27 // with apply. 28 type PodSecurityPolicySpecApplyConfiguration struct { 29 Privileged *bool `json:"privileged,omitempty"` 30 DefaultAddCapabilities []v1.Capability `json:"defaultAddCapabilities,omitempty"` 31 RequiredDropCapabilities []v1.Capability `json:"requiredDropCapabilities,omitempty"` 32 AllowedCapabilities []v1.Capability `json:"allowedCapabilities,omitempty"` 33 Volumes []v1beta1.FSType `json:"volumes,omitempty"` 34 HostNetwork *bool `json:"hostNetwork,omitempty"` 35 HostPorts []HostPortRangeApplyConfiguration `json:"hostPorts,omitempty"` 36 HostPID *bool `json:"hostPID,omitempty"` 37 HostIPC *bool `json:"hostIPC,omitempty"` 38 SELinux *SELinuxStrategyOptionsApplyConfiguration `json:"seLinux,omitempty"` 39 RunAsUser *RunAsUserStrategyOptionsApplyConfiguration `json:"runAsUser,omitempty"` 40 RunAsGroup *RunAsGroupStrategyOptionsApplyConfiguration `json:"runAsGroup,omitempty"` 41 SupplementalGroups *SupplementalGroupsStrategyOptionsApplyConfiguration `json:"supplementalGroups,omitempty"` 42 FSGroup *FSGroupStrategyOptionsApplyConfiguration `json:"fsGroup,omitempty"` 43 ReadOnlyRootFilesystem *bool `json:"readOnlyRootFilesystem,omitempty"` 44 DefaultAllowPrivilegeEscalation *bool `json:"defaultAllowPrivilegeEscalation,omitempty"` 45 AllowPrivilegeEscalation *bool `json:"allowPrivilegeEscalation,omitempty"` 46 AllowedHostPaths []AllowedHostPathApplyConfiguration `json:"allowedHostPaths,omitempty"` 47 AllowedFlexVolumes []AllowedFlexVolumeApplyConfiguration `json:"allowedFlexVolumes,omitempty"` 48 AllowedCSIDrivers []AllowedCSIDriverApplyConfiguration `json:"allowedCSIDrivers,omitempty"` 49 AllowedUnsafeSysctls []string `json:"allowedUnsafeSysctls,omitempty"` 50 ForbiddenSysctls []string `json:"forbiddenSysctls,omitempty"` 51 AllowedProcMountTypes []v1.ProcMountType `json:"allowedProcMountTypes,omitempty"` 52 RuntimeClass *RuntimeClassStrategyOptionsApplyConfiguration `json:"runtimeClass,omitempty"` 53 } 54 55 // PodSecurityPolicySpecApplyConfiguration constructs an declarative configuration of the PodSecurityPolicySpec type for use with 56 // apply. 57 func PodSecurityPolicySpec() *PodSecurityPolicySpecApplyConfiguration { 58 return &PodSecurityPolicySpecApplyConfiguration{} 59 } 60 61 // WithPrivileged sets the Privileged field in the declarative configuration to the given value 62 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 63 // If called multiple times, the Privileged field is set to the value of the last call. 64 func (b *PodSecurityPolicySpecApplyConfiguration) WithPrivileged(value bool) *PodSecurityPolicySpecApplyConfiguration { 65 b.Privileged = &value 66 return b 67 } 68 69 // WithDefaultAddCapabilities adds the given value to the DefaultAddCapabilities field in the declarative configuration 70 // and returns the receiver, so that objects can be build by chaining "With" function invocations. 71 // If called multiple times, values provided by each call will be appended to the DefaultAddCapabilities field. 72 func (b *PodSecurityPolicySpecApplyConfiguration) WithDefaultAddCapabilities(values ...v1.Capability) *PodSecurityPolicySpecApplyConfiguration { 73 for i := range values { 74 b.DefaultAddCapabilities = append(b.DefaultAddCapabilities, values[i]) 75 } 76 return b 77 } 78 79 // WithRequiredDropCapabilities adds the given value to the RequiredDropCapabilities field in the declarative configuration 80 // and returns the receiver, so that objects can be build by chaining "With" function invocations. 81 // If called multiple times, values provided by each call will be appended to the RequiredDropCapabilities field. 82 func (b *PodSecurityPolicySpecApplyConfiguration) WithRequiredDropCapabilities(values ...v1.Capability) *PodSecurityPolicySpecApplyConfiguration { 83 for i := range values { 84 b.RequiredDropCapabilities = append(b.RequiredDropCapabilities, values[i]) 85 } 86 return b 87 } 88 89 // WithAllowedCapabilities adds the given value to the AllowedCapabilities field in the declarative configuration 90 // and returns the receiver, so that objects can be build by chaining "With" function invocations. 91 // If called multiple times, values provided by each call will be appended to the AllowedCapabilities field. 92 func (b *PodSecurityPolicySpecApplyConfiguration) WithAllowedCapabilities(values ...v1.Capability) *PodSecurityPolicySpecApplyConfiguration { 93 for i := range values { 94 b.AllowedCapabilities = append(b.AllowedCapabilities, values[i]) 95 } 96 return b 97 } 98 99 // WithVolumes adds the given value to the Volumes field in the declarative configuration 100 // and returns the receiver, so that objects can be build by chaining "With" function invocations. 101 // If called multiple times, values provided by each call will be appended to the Volumes field. 102 func (b *PodSecurityPolicySpecApplyConfiguration) WithVolumes(values ...v1beta1.FSType) *PodSecurityPolicySpecApplyConfiguration { 103 for i := range values { 104 b.Volumes = append(b.Volumes, values[i]) 105 } 106 return b 107 } 108 109 // WithHostNetwork sets the HostNetwork field in the declarative configuration to the given value 110 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 111 // If called multiple times, the HostNetwork field is set to the value of the last call. 112 func (b *PodSecurityPolicySpecApplyConfiguration) WithHostNetwork(value bool) *PodSecurityPolicySpecApplyConfiguration { 113 b.HostNetwork = &value 114 return b 115 } 116 117 // WithHostPorts adds the given value to the HostPorts field in the declarative configuration 118 // and returns the receiver, so that objects can be build by chaining "With" function invocations. 119 // If called multiple times, values provided by each call will be appended to the HostPorts field. 120 func (b *PodSecurityPolicySpecApplyConfiguration) WithHostPorts(values ...*HostPortRangeApplyConfiguration) *PodSecurityPolicySpecApplyConfiguration { 121 for i := range values { 122 if values[i] == nil { 123 panic("nil value passed to WithHostPorts") 124 } 125 b.HostPorts = append(b.HostPorts, *values[i]) 126 } 127 return b 128 } 129 130 // WithHostPID sets the HostPID field in the declarative configuration to the given value 131 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 132 // If called multiple times, the HostPID field is set to the value of the last call. 133 func (b *PodSecurityPolicySpecApplyConfiguration) WithHostPID(value bool) *PodSecurityPolicySpecApplyConfiguration { 134 b.HostPID = &value 135 return b 136 } 137 138 // WithHostIPC sets the HostIPC field in the declarative configuration to the given value 139 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 140 // If called multiple times, the HostIPC field is set to the value of the last call. 141 func (b *PodSecurityPolicySpecApplyConfiguration) WithHostIPC(value bool) *PodSecurityPolicySpecApplyConfiguration { 142 b.HostIPC = &value 143 return b 144 } 145 146 // WithSELinux sets the SELinux field in the declarative configuration to the given value 147 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 148 // If called multiple times, the SELinux field is set to the value of the last call. 149 func (b *PodSecurityPolicySpecApplyConfiguration) WithSELinux(value *SELinuxStrategyOptionsApplyConfiguration) *PodSecurityPolicySpecApplyConfiguration { 150 b.SELinux = value 151 return b 152 } 153 154 // WithRunAsUser sets the RunAsUser field in the declarative configuration to the given value 155 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 156 // If called multiple times, the RunAsUser field is set to the value of the last call. 157 func (b *PodSecurityPolicySpecApplyConfiguration) WithRunAsUser(value *RunAsUserStrategyOptionsApplyConfiguration) *PodSecurityPolicySpecApplyConfiguration { 158 b.RunAsUser = value 159 return b 160 } 161 162 // WithRunAsGroup sets the RunAsGroup field in the declarative configuration to the given value 163 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 164 // If called multiple times, the RunAsGroup field is set to the value of the last call. 165 func (b *PodSecurityPolicySpecApplyConfiguration) WithRunAsGroup(value *RunAsGroupStrategyOptionsApplyConfiguration) *PodSecurityPolicySpecApplyConfiguration { 166 b.RunAsGroup = value 167 return b 168 } 169 170 // WithSupplementalGroups sets the SupplementalGroups field in the declarative configuration to the given value 171 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 172 // If called multiple times, the SupplementalGroups field is set to the value of the last call. 173 func (b *PodSecurityPolicySpecApplyConfiguration) WithSupplementalGroups(value *SupplementalGroupsStrategyOptionsApplyConfiguration) *PodSecurityPolicySpecApplyConfiguration { 174 b.SupplementalGroups = value 175 return b 176 } 177 178 // WithFSGroup sets the FSGroup field in the declarative configuration to the given value 179 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 180 // If called multiple times, the FSGroup field is set to the value of the last call. 181 func (b *PodSecurityPolicySpecApplyConfiguration) WithFSGroup(value *FSGroupStrategyOptionsApplyConfiguration) *PodSecurityPolicySpecApplyConfiguration { 182 b.FSGroup = value 183 return b 184 } 185 186 // WithReadOnlyRootFilesystem sets the ReadOnlyRootFilesystem field in the declarative configuration to the given value 187 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 188 // If called multiple times, the ReadOnlyRootFilesystem field is set to the value of the last call. 189 func (b *PodSecurityPolicySpecApplyConfiguration) WithReadOnlyRootFilesystem(value bool) *PodSecurityPolicySpecApplyConfiguration { 190 b.ReadOnlyRootFilesystem = &value 191 return b 192 } 193 194 // WithDefaultAllowPrivilegeEscalation sets the DefaultAllowPrivilegeEscalation field in the declarative configuration to the given value 195 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 196 // If called multiple times, the DefaultAllowPrivilegeEscalation field is set to the value of the last call. 197 func (b *PodSecurityPolicySpecApplyConfiguration) WithDefaultAllowPrivilegeEscalation(value bool) *PodSecurityPolicySpecApplyConfiguration { 198 b.DefaultAllowPrivilegeEscalation = &value 199 return b 200 } 201 202 // WithAllowPrivilegeEscalation sets the AllowPrivilegeEscalation field in the declarative configuration to the given value 203 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 204 // If called multiple times, the AllowPrivilegeEscalation field is set to the value of the last call. 205 func (b *PodSecurityPolicySpecApplyConfiguration) WithAllowPrivilegeEscalation(value bool) *PodSecurityPolicySpecApplyConfiguration { 206 b.AllowPrivilegeEscalation = &value 207 return b 208 } 209 210 // WithAllowedHostPaths adds the given value to the AllowedHostPaths field in the declarative configuration 211 // and returns the receiver, so that objects can be build by chaining "With" function invocations. 212 // If called multiple times, values provided by each call will be appended to the AllowedHostPaths field. 213 func (b *PodSecurityPolicySpecApplyConfiguration) WithAllowedHostPaths(values ...*AllowedHostPathApplyConfiguration) *PodSecurityPolicySpecApplyConfiguration { 214 for i := range values { 215 if values[i] == nil { 216 panic("nil value passed to WithAllowedHostPaths") 217 } 218 b.AllowedHostPaths = append(b.AllowedHostPaths, *values[i]) 219 } 220 return b 221 } 222 223 // WithAllowedFlexVolumes adds the given value to the AllowedFlexVolumes field in the declarative configuration 224 // and returns the receiver, so that objects can be build by chaining "With" function invocations. 225 // If called multiple times, values provided by each call will be appended to the AllowedFlexVolumes field. 226 func (b *PodSecurityPolicySpecApplyConfiguration) WithAllowedFlexVolumes(values ...*AllowedFlexVolumeApplyConfiguration) *PodSecurityPolicySpecApplyConfiguration { 227 for i := range values { 228 if values[i] == nil { 229 panic("nil value passed to WithAllowedFlexVolumes") 230 } 231 b.AllowedFlexVolumes = append(b.AllowedFlexVolumes, *values[i]) 232 } 233 return b 234 } 235 236 // WithAllowedCSIDrivers adds the given value to the AllowedCSIDrivers field in the declarative configuration 237 // and returns the receiver, so that objects can be build by chaining "With" function invocations. 238 // If called multiple times, values provided by each call will be appended to the AllowedCSIDrivers field. 239 func (b *PodSecurityPolicySpecApplyConfiguration) WithAllowedCSIDrivers(values ...*AllowedCSIDriverApplyConfiguration) *PodSecurityPolicySpecApplyConfiguration { 240 for i := range values { 241 if values[i] == nil { 242 panic("nil value passed to WithAllowedCSIDrivers") 243 } 244 b.AllowedCSIDrivers = append(b.AllowedCSIDrivers, *values[i]) 245 } 246 return b 247 } 248 249 // WithAllowedUnsafeSysctls adds the given value to the AllowedUnsafeSysctls field in the declarative configuration 250 // and returns the receiver, so that objects can be build by chaining "With" function invocations. 251 // If called multiple times, values provided by each call will be appended to the AllowedUnsafeSysctls field. 252 func (b *PodSecurityPolicySpecApplyConfiguration) WithAllowedUnsafeSysctls(values ...string) *PodSecurityPolicySpecApplyConfiguration { 253 for i := range values { 254 b.AllowedUnsafeSysctls = append(b.AllowedUnsafeSysctls, values[i]) 255 } 256 return b 257 } 258 259 // WithForbiddenSysctls adds the given value to the ForbiddenSysctls field in the declarative configuration 260 // and returns the receiver, so that objects can be build by chaining "With" function invocations. 261 // If called multiple times, values provided by each call will be appended to the ForbiddenSysctls field. 262 func (b *PodSecurityPolicySpecApplyConfiguration) WithForbiddenSysctls(values ...string) *PodSecurityPolicySpecApplyConfiguration { 263 for i := range values { 264 b.ForbiddenSysctls = append(b.ForbiddenSysctls, values[i]) 265 } 266 return b 267 } 268 269 // WithAllowedProcMountTypes adds the given value to the AllowedProcMountTypes field in the declarative configuration 270 // and returns the receiver, so that objects can be build by chaining "With" function invocations. 271 // If called multiple times, values provided by each call will be appended to the AllowedProcMountTypes field. 272 func (b *PodSecurityPolicySpecApplyConfiguration) WithAllowedProcMountTypes(values ...v1.ProcMountType) *PodSecurityPolicySpecApplyConfiguration { 273 for i := range values { 274 b.AllowedProcMountTypes = append(b.AllowedProcMountTypes, values[i]) 275 } 276 return b 277 } 278 279 // WithRuntimeClass sets the RuntimeClass field in the declarative configuration to the given value 280 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 281 // If called multiple times, the RuntimeClass field is set to the value of the last call. 282 func (b *PodSecurityPolicySpecApplyConfiguration) WithRuntimeClass(value *RuntimeClassStrategyOptionsApplyConfiguration) *PodSecurityPolicySpecApplyConfiguration { 283 b.RuntimeClass = value 284 return b 285 }