...

Source file src/k8s.io/client-go/applyconfigurations/core/v1/securitycontext.go

Documentation: k8s.io/client-go/applyconfigurations/core/v1

     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  	AppArmorProfile          *AppArmorProfileApplyConfiguration               `json:"appArmorProfile,omitempty"`
    40  }
    41  
    42  // SecurityContextApplyConfiguration constructs an declarative configuration of the SecurityContext type for use with
    43  // apply.
    44  func SecurityContext() *SecurityContextApplyConfiguration {
    45  	return &SecurityContextApplyConfiguration{}
    46  }
    47  
    48  // WithCapabilities sets the Capabilities 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 Capabilities field is set to the value of the last call.
    51  func (b *SecurityContextApplyConfiguration) WithCapabilities(value *CapabilitiesApplyConfiguration) *SecurityContextApplyConfiguration {
    52  	b.Capabilities = value
    53  	return b
    54  }
    55  
    56  // WithPrivileged sets the Privileged 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 Privileged field is set to the value of the last call.
    59  func (b *SecurityContextApplyConfiguration) WithPrivileged(value bool) *SecurityContextApplyConfiguration {
    60  	b.Privileged = &value
    61  	return b
    62  }
    63  
    64  // WithSELinuxOptions sets the SELinuxOptions 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 SELinuxOptions field is set to the value of the last call.
    67  func (b *SecurityContextApplyConfiguration) WithSELinuxOptions(value *SELinuxOptionsApplyConfiguration) *SecurityContextApplyConfiguration {
    68  	b.SELinuxOptions = value
    69  	return b
    70  }
    71  
    72  // WithWindowsOptions sets the WindowsOptions 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 WindowsOptions field is set to the value of the last call.
    75  func (b *SecurityContextApplyConfiguration) WithWindowsOptions(value *WindowsSecurityContextOptionsApplyConfiguration) *SecurityContextApplyConfiguration {
    76  	b.WindowsOptions = value
    77  	return b
    78  }
    79  
    80  // WithRunAsUser sets the RunAsUser 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 RunAsUser field is set to the value of the last call.
    83  func (b *SecurityContextApplyConfiguration) WithRunAsUser(value int64) *SecurityContextApplyConfiguration {
    84  	b.RunAsUser = &value
    85  	return b
    86  }
    87  
    88  // WithRunAsGroup sets the RunAsGroup field in the declarative configuration to the given value
    89  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
    90  // If called multiple times, the RunAsGroup field is set to the value of the last call.
    91  func (b *SecurityContextApplyConfiguration) WithRunAsGroup(value int64) *SecurityContextApplyConfiguration {
    92  	b.RunAsGroup = &value
    93  	return b
    94  }
    95  
    96  // WithRunAsNonRoot sets the RunAsNonRoot field in the declarative configuration to the given value
    97  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
    98  // If called multiple times, the RunAsNonRoot field is set to the value of the last call.
    99  func (b *SecurityContextApplyConfiguration) WithRunAsNonRoot(value bool) *SecurityContextApplyConfiguration {
   100  	b.RunAsNonRoot = &value
   101  	return b
   102  }
   103  
   104  // WithReadOnlyRootFilesystem sets the ReadOnlyRootFilesystem field in the declarative configuration to the given value
   105  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
   106  // If called multiple times, the ReadOnlyRootFilesystem field is set to the value of the last call.
   107  func (b *SecurityContextApplyConfiguration) WithReadOnlyRootFilesystem(value bool) *SecurityContextApplyConfiguration {
   108  	b.ReadOnlyRootFilesystem = &value
   109  	return b
   110  }
   111  
   112  // WithAllowPrivilegeEscalation sets the AllowPrivilegeEscalation field in the declarative configuration to the given value
   113  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
   114  // If called multiple times, the AllowPrivilegeEscalation field is set to the value of the last call.
   115  func (b *SecurityContextApplyConfiguration) WithAllowPrivilegeEscalation(value bool) *SecurityContextApplyConfiguration {
   116  	b.AllowPrivilegeEscalation = &value
   117  	return b
   118  }
   119  
   120  // WithProcMount sets the ProcMount field in the declarative configuration to the given value
   121  // and returns the receiver, so that objects can be built by chaining "With" function invocations.
   122  // If called multiple times, the ProcMount field is set to the value of the last call.
   123  func (b *SecurityContextApplyConfiguration) WithProcMount(value corev1.ProcMountType) *SecurityContextApplyConfiguration {
   124  	b.ProcMount = &value
   125  	return b
   126  }
   127  
   128  // WithSeccompProfile sets the SeccompProfile 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 SeccompProfile field is set to the value of the last call.
   131  func (b *SecurityContextApplyConfiguration) WithSeccompProfile(value *SeccompProfileApplyConfiguration) *SecurityContextApplyConfiguration {
   132  	b.SeccompProfile = value
   133  	return b
   134  }
   135  
   136  // WithAppArmorProfile sets the AppArmorProfile 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 AppArmorProfile field is set to the value of the last call.
   139  func (b *SecurityContextApplyConfiguration) WithAppArmorProfile(value *AppArmorProfileApplyConfiguration) *SecurityContextApplyConfiguration {
   140  	b.AppArmorProfile = value
   141  	return b
   142  }
   143  

View as plain text