Debian Codegraph @

applyconfigurations/core/v1/podsecuritycontext.go

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