k8s.io/client-go@v0.31.1/applyconfigurations/core/v1/podsecuritycontext.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 v1 20 21 import ( 22 corev1 "k8s.io/api/core/v1" 23 ) 24 25 // PodSecurityContextApplyConfiguration represents a 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 SupplementalGroupsPolicy *corev1.SupplementalGroupsPolicy `json:"supplementalGroupsPolicy,omitempty"` 35 FSGroup *int64 `json:"fsGroup,omitempty"` 36 Sysctls []SysctlApplyConfiguration `json:"sysctls,omitempty"` 37 FSGroupChangePolicy *corev1.PodFSGroupChangePolicy `json:"fsGroupChangePolicy,omitempty"` 38 SeccompProfile *SeccompProfileApplyConfiguration `json:"seccompProfile,omitempty"` 39 AppArmorProfile *AppArmorProfileApplyConfiguration `json:"appArmorProfile,omitempty"` 40 } 41 42 // PodSecurityContextApplyConfiguration constructs a declarative configuration of the PodSecurityContext type for use with 43 // apply. 44 func PodSecurityContext() *PodSecurityContextApplyConfiguration { 45 return &PodSecurityContextApplyConfiguration{} 46 } 47 48 // WithSELinuxOptions sets the SELinuxOptions field in the declarative configuration to the given value 49 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 50 // If called multiple times, the SELinuxOptions field is set to the value of the last call. 51 func (b *PodSecurityContextApplyConfiguration) WithSELinuxOptions(value *SELinuxOptionsApplyConfiguration) *PodSecurityContextApplyConfiguration { 52 b.SELinuxOptions = value 53 return b 54 } 55 56 // WithWindowsOptions sets the WindowsOptions field in the declarative configuration to the given value 57 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 58 // If called multiple times, the WindowsOptions field is set to the value of the last call. 59 func (b *PodSecurityContextApplyConfiguration) WithWindowsOptions(value *WindowsSecurityContextOptionsApplyConfiguration) *PodSecurityContextApplyConfiguration { 60 b.WindowsOptions = value 61 return b 62 } 63 64 // WithRunAsUser sets the RunAsUser field in the declarative configuration to the given value 65 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 66 // If called multiple times, the RunAsUser field is set to the value of the last call. 67 func (b *PodSecurityContextApplyConfiguration) WithRunAsUser(value int64) *PodSecurityContextApplyConfiguration { 68 b.RunAsUser = &value 69 return b 70 } 71 72 // WithRunAsGroup sets the RunAsGroup field in the declarative configuration to the given value 73 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 74 // If called multiple times, the RunAsGroup field is set to the value of the last call. 75 func (b *PodSecurityContextApplyConfiguration) WithRunAsGroup(value int64) *PodSecurityContextApplyConfiguration { 76 b.RunAsGroup = &value 77 return b 78 } 79 80 // WithRunAsNonRoot sets the RunAsNonRoot field in the declarative configuration to the given value 81 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 82 // If called multiple times, the RunAsNonRoot field is set to the value of the last call. 83 func (b *PodSecurityContextApplyConfiguration) WithRunAsNonRoot(value bool) *PodSecurityContextApplyConfiguration { 84 b.RunAsNonRoot = &value 85 return b 86 } 87 88 // WithSupplementalGroups adds the given value to the SupplementalGroups field in the declarative configuration 89 // and returns the receiver, so that objects can be build by chaining "With" function invocations. 90 // If called multiple times, values provided by each call will be appended to the SupplementalGroups field. 91 func (b *PodSecurityContextApplyConfiguration) WithSupplementalGroups(values ...int64) *PodSecurityContextApplyConfiguration { 92 for i := range values { 93 b.SupplementalGroups = append(b.SupplementalGroups, values[i]) 94 } 95 return b 96 } 97 98 // WithSupplementalGroupsPolicy sets the SupplementalGroupsPolicy field in the declarative configuration to the given value 99 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 100 // If called multiple times, the SupplementalGroupsPolicy field is set to the value of the last call. 101 func (b *PodSecurityContextApplyConfiguration) WithSupplementalGroupsPolicy(value corev1.SupplementalGroupsPolicy) *PodSecurityContextApplyConfiguration { 102 b.SupplementalGroupsPolicy = &value 103 return b 104 } 105 106 // WithFSGroup sets the FSGroup field in the declarative configuration to the given value 107 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 108 // If called multiple times, the FSGroup field is set to the value of the last call. 109 func (b *PodSecurityContextApplyConfiguration) WithFSGroup(value int64) *PodSecurityContextApplyConfiguration { 110 b.FSGroup = &value 111 return b 112 } 113 114 // WithSysctls adds the given value to the Sysctls field in the declarative configuration 115 // and returns the receiver, so that objects can be build by chaining "With" function invocations. 116 // If called multiple times, values provided by each call will be appended to the Sysctls field. 117 func (b *PodSecurityContextApplyConfiguration) WithSysctls(values ...*SysctlApplyConfiguration) *PodSecurityContextApplyConfiguration { 118 for i := range values { 119 if values[i] == nil { 120 panic("nil value passed to WithSysctls") 121 } 122 b.Sysctls = append(b.Sysctls, *values[i]) 123 } 124 return b 125 } 126 127 // WithFSGroupChangePolicy sets the FSGroupChangePolicy field in the declarative configuration to the given value 128 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 129 // If called multiple times, the FSGroupChangePolicy field is set to the value of the last call. 130 func (b *PodSecurityContextApplyConfiguration) WithFSGroupChangePolicy(value corev1.PodFSGroupChangePolicy) *PodSecurityContextApplyConfiguration { 131 b.FSGroupChangePolicy = &value 132 return b 133 } 134 135 // WithSeccompProfile sets the SeccompProfile field in the declarative configuration to the given value 136 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 137 // If called multiple times, the SeccompProfile field is set to the value of the last call. 138 func (b *PodSecurityContextApplyConfiguration) WithSeccompProfile(value *SeccompProfileApplyConfiguration) *PodSecurityContextApplyConfiguration { 139 b.SeccompProfile = value 140 return b 141 } 142 143 // WithAppArmorProfile sets the AppArmorProfile field in the declarative configuration to the given value 144 // and returns the receiver, so that objects can be built by chaining "With" function invocations. 145 // If called multiple times, the AppArmorProfile field is set to the value of the last call. 146 func (b *PodSecurityContextApplyConfiguration) WithAppArmorProfile(value *AppArmorProfileApplyConfiguration) *PodSecurityContextApplyConfiguration { 147 b.AppArmorProfile = value 148 return b 149 }