k8s.io/client-go@v0.22.2/applyconfigurations/core/v1/securitycontext.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  // SecurityContextApplyConfiguration represents an declarative configuration of the SecurityContext type for use
    26  // with apply.
    27  type SecurityContextApplyConfiguration struct {
    28  	Capabilities             *CapabilitiesApplyConfiguration                  `json:"capabilities,omitempty"`
    29  	Privileged               *bool                                            `json:"privileged,omitempty"`
    30  	SELinuxOptions           *SELinuxOptionsApplyConfiguration                `json:"seLinuxOptions,omitempty"`
    31  	WindowsOptions           *WindowsSecurityContextOptionsApplyConfiguration `json:"windowsOptions,omitempty"`
    32  	RunAsUser                *int64                                           `json:"runAsUser,omitempty"`
    33  	RunAsGroup               *int64                                           `json:"runAsGroup,omitempty"`
    34  	RunAsNonRoot             *bool                                            `json:"runAsNonRoot,omitempty"`
    35  	ReadOnlyRootFilesystem   *bool                                            `json:"readOnlyRootFilesystem,omitempty"`
    36  	AllowPrivilegeEscalation *bool                                            `json:"allowPrivilegeEscalation,omitempty"`
    37  	ProcMount                *corev1.ProcMountType                            `json:"procMount,omitempty"`
    38  	SeccompProfile           *SeccompProfileApplyConfiguration                `json:"seccompProfile,omitempty"`
    39  }
    40  
    41  // SecurityContextApplyConfiguration constructs an declarative configuration of the SecurityContext type for use with
    42  // apply.
    43  func SecurityContext() *SecurityContextApplyConfiguration {
    44  	return &SecurityContextApplyConfiguration{}
    45  }
    46  
    47  // WithCapabilities sets the Capabilities 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 Capabilities field is set to the value of the last call.
    50  func (b *SecurityContextApplyConfiguration) WithCapabilities(value *CapabilitiesApplyConfiguration) *SecurityContextApplyConfiguration {
    51  	b.Capabilities = value
    52  	return b
    53  }
    54  
    55  // WithPrivileged sets the Privileged 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 Privileged field is set to the value of the last call.
    58  func (b *SecurityContextApplyConfiguration) WithPrivileged(value bool) *SecurityContextApplyConfiguration {
    59  	b.Privileged = &value
    60  	return b
    61  }
    62  
    63  // WithSELinuxOptions sets the SELinuxOptions 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 SELinuxOptions field is set to the value of the last call.
    66  func (b *SecurityContextApplyConfiguration) WithSELinuxOptions(value *SELinuxOptionsApplyConfiguration) *SecurityContextApplyConfiguration {
    67  	b.SELinuxOptions = value
    68  	return b
    69  }
    70  
    71  // WithWindowsOptions sets the WindowsOptions 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 WindowsOptions field is set to the value of the last call.
    74  func (b *SecurityContextApplyConfiguration) WithWindowsOptions(value *WindowsSecurityContextOptionsApplyConfiguration) *SecurityContextApplyConfiguration {
    75  	b.WindowsOptions = value
    76  	return b
    77  }
    78  
    79  // WithRunAsUser sets the RunAsUser 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 RunAsUser field is set to the value of the last call.
    82  func (b *SecurityContextApplyConfiguration) WithRunAsUser(value int64) *SecurityContextApplyConfiguration {
    83  	b.RunAsUser = &value
    84  	return b
    85  }
    86  
    87  // WithRunAsGroup sets the RunAsGroup field in the declarative configuration to the given value
    88  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
    89  // If called multiple times, the RunAsGroup field is set to the value of the last call.
    90  func (b *SecurityContextApplyConfiguration) WithRunAsGroup(value int64) *SecurityContextApplyConfiguration {
    91  	b.RunAsGroup = &value
    92  	return b
    93  }
    94  
    95  // WithRunAsNonRoot sets the RunAsNonRoot field in the declarative configuration to the given value
    96  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
    97  // If called multiple times, the RunAsNonRoot field is set to the value of the last call.
    98  func (b *SecurityContextApplyConfiguration) WithRunAsNonRoot(value bool) *SecurityContextApplyConfiguration {
    99  	b.RunAsNonRoot = &value
   100  	return b
   101  }
   102  
   103  // WithReadOnlyRootFilesystem sets the ReadOnlyRootFilesystem field in the declarative configuration to the given value
   104  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
   105  // If called multiple times, the ReadOnlyRootFilesystem field is set to the value of the last call.
   106  func (b *SecurityContextApplyConfiguration) WithReadOnlyRootFilesystem(value bool) *SecurityContextApplyConfiguration {
   107  	b.ReadOnlyRootFilesystem = &value
   108  	return b
   109  }
   110  
   111  // WithAllowPrivilegeEscalation sets the AllowPrivilegeEscalation field in the declarative configuration to the given value
   112  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
   113  // If called multiple times, the AllowPrivilegeEscalation field is set to the value of the last call.
   114  func (b *SecurityContextApplyConfiguration) WithAllowPrivilegeEscalation(value bool) *SecurityContextApplyConfiguration {
   115  	b.AllowPrivilegeEscalation = &value
   116  	return b
   117  }
   118  
   119  // WithProcMount sets the ProcMount field in the declarative configuration to the given value
   120  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
   121  // If called multiple times, the ProcMount field is set to the value of the last call.
   122  func (b *SecurityContextApplyConfiguration) WithProcMount(value corev1.ProcMountType) *SecurityContextApplyConfiguration {
   123  	b.ProcMount = &value
   124  	return b
   125  }
   126  
   127  // WithSeccompProfile sets the SeccompProfile 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 SeccompProfile field is set to the value of the last call.
   130  func (b *SecurityContextApplyConfiguration) WithSeccompProfile(value *SeccompProfileApplyConfiguration) *SecurityContextApplyConfiguration {
   131  	b.SeccompProfile = value
   132  	return b
   133  }