Merge pull request #123435 from tallclair/apparmor-ga

AppArmor fields API

Kubernetes-commit: bd25605619cbfb46b075002a6db58b4e489fc8cb
This commit is contained in:
Kubernetes Publisher 2024-03-06 15:35:14 -08:00
commit 47abbe0251
7 changed files with 101 additions and 8 deletions

View File

@ -0,0 +1,52 @@
/*
Copyright The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by applyconfiguration-gen. DO NOT EDIT.
package v1
import (
v1 "k8s.io/api/core/v1"
)
// AppArmorProfileApplyConfiguration represents an declarative configuration of the AppArmorProfile type for use
// with apply.
type AppArmorProfileApplyConfiguration struct {
Type *v1.AppArmorProfileType `json:"type,omitempty"`
LocalhostProfile *string `json:"localhostProfile,omitempty"`
}
// AppArmorProfileApplyConfiguration constructs an declarative configuration of the AppArmorProfile type for use with
// apply.
func AppArmorProfile() *AppArmorProfileApplyConfiguration {
return &AppArmorProfileApplyConfiguration{}
}
// WithType sets the Type field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Type field is set to the value of the last call.
func (b *AppArmorProfileApplyConfiguration) WithType(value v1.AppArmorProfileType) *AppArmorProfileApplyConfiguration {
b.Type = &value
return b
}
// WithLocalhostProfile sets the LocalhostProfile field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the LocalhostProfile field is set to the value of the last call.
func (b *AppArmorProfileApplyConfiguration) WithLocalhostProfile(value string) *AppArmorProfileApplyConfiguration {
b.LocalhostProfile = &value
return b
}

View File

@ -35,6 +35,7 @@ type PodSecurityContextApplyConfiguration struct {
Sysctls []SysctlApplyConfiguration `json:"sysctls,omitempty"` Sysctls []SysctlApplyConfiguration `json:"sysctls,omitempty"`
FSGroupChangePolicy *corev1.PodFSGroupChangePolicy `json:"fsGroupChangePolicy,omitempty"` FSGroupChangePolicy *corev1.PodFSGroupChangePolicy `json:"fsGroupChangePolicy,omitempty"`
SeccompProfile *SeccompProfileApplyConfiguration `json:"seccompProfile,omitempty"` SeccompProfile *SeccompProfileApplyConfiguration `json:"seccompProfile,omitempty"`
AppArmorProfile *AppArmorProfileApplyConfiguration `json:"appArmorProfile,omitempty"`
} }
// PodSecurityContextApplyConfiguration constructs an declarative configuration of the PodSecurityContext type for use with // PodSecurityContextApplyConfiguration constructs an declarative configuration of the PodSecurityContext type for use with
@ -129,3 +130,11 @@ func (b *PodSecurityContextApplyConfiguration) WithSeccompProfile(value *Seccomp
b.SeccompProfile = value b.SeccompProfile = value
return b return b
} }
// WithAppArmorProfile sets the AppArmorProfile field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the AppArmorProfile field is set to the value of the last call.
func (b *PodSecurityContextApplyConfiguration) WithAppArmorProfile(value *AppArmorProfileApplyConfiguration) *PodSecurityContextApplyConfiguration {
b.AppArmorProfile = value
return b
}

View File

@ -36,6 +36,7 @@ type SecurityContextApplyConfiguration struct {
AllowPrivilegeEscalation *bool `json:"allowPrivilegeEscalation,omitempty"` AllowPrivilegeEscalation *bool `json:"allowPrivilegeEscalation,omitempty"`
ProcMount *corev1.ProcMountType `json:"procMount,omitempty"` ProcMount *corev1.ProcMountType `json:"procMount,omitempty"`
SeccompProfile *SeccompProfileApplyConfiguration `json:"seccompProfile,omitempty"` SeccompProfile *SeccompProfileApplyConfiguration `json:"seccompProfile,omitempty"`
AppArmorProfile *AppArmorProfileApplyConfiguration `json:"appArmorProfile,omitempty"`
} }
// SecurityContextApplyConfiguration constructs an declarative configuration of the SecurityContext type for use with // SecurityContextApplyConfiguration constructs an declarative configuration of the SecurityContext type for use with
@ -131,3 +132,11 @@ func (b *SecurityContextApplyConfiguration) WithSeccompProfile(value *SeccompPro
b.SeccompProfile = value b.SeccompProfile = value
return b return b
} }
// WithAppArmorProfile sets the AppArmorProfile field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the AppArmorProfile field is set to the value of the last call.
func (b *SecurityContextApplyConfiguration) WithAppArmorProfile(value *AppArmorProfileApplyConfiguration) *SecurityContextApplyConfiguration {
b.AppArmorProfile = value
return b
}

View File

@ -4401,6 +4401,21 @@ var schemaYAML = typed.YAMLObject(`types:
- name: podAntiAffinity - name: podAntiAffinity
type: type:
namedType: io.k8s.api.core.v1.PodAntiAffinity namedType: io.k8s.api.core.v1.PodAntiAffinity
- name: io.k8s.api.core.v1.AppArmorProfile
map:
fields:
- name: localhostProfile
type:
scalar: string
- name: type
type:
scalar: string
default: ""
unions:
- discriminator: type
fields:
- fieldName: localhostProfile
discriminatorValue: LocalhostProfile
- name: io.k8s.api.core.v1.AttachedVolume - name: io.k8s.api.core.v1.AttachedVolume
map: map:
fields: fields:
@ -6720,6 +6735,9 @@ var schemaYAML = typed.YAMLObject(`types:
- name: io.k8s.api.core.v1.PodSecurityContext - name: io.k8s.api.core.v1.PodSecurityContext
map: map:
fields: fields:
- name: appArmorProfile
type:
namedType: io.k8s.api.core.v1.AppArmorProfile
- name: fsGroup - name: fsGroup
type: type:
scalar: numeric scalar: numeric
@ -7614,6 +7632,9 @@ var schemaYAML = typed.YAMLObject(`types:
- name: allowPrivilegeEscalation - name: allowPrivilegeEscalation
type: type:
scalar: boolean scalar: boolean
- name: appArmorProfile
type:
namedType: io.k8s.api.core.v1.AppArmorProfile
- name: capabilities - name: capabilities
type: type:
namedType: io.k8s.api.core.v1.Capabilities namedType: io.k8s.api.core.v1.Capabilities

View File

@ -613,6 +613,8 @@ func ForKind(kind schema.GroupVersionKind) interface{} {
// Group=core, Version=v1 // Group=core, Version=v1
case corev1.SchemeGroupVersion.WithKind("Affinity"): case corev1.SchemeGroupVersion.WithKind("Affinity"):
return &applyconfigurationscorev1.AffinityApplyConfiguration{} return &applyconfigurationscorev1.AffinityApplyConfiguration{}
case corev1.SchemeGroupVersion.WithKind("AppArmorProfile"):
return &applyconfigurationscorev1.AppArmorProfileApplyConfiguration{}
case corev1.SchemeGroupVersion.WithKind("AttachedVolume"): case corev1.SchemeGroupVersion.WithKind("AttachedVolume"):
return &applyconfigurationscorev1.AttachedVolumeApplyConfiguration{} return &applyconfigurationscorev1.AttachedVolumeApplyConfiguration{}
case corev1.SchemeGroupVersion.WithKind("AWSElasticBlockStoreVolumeSource"): case corev1.SchemeGroupVersion.WithKind("AWSElasticBlockStoreVolumeSource"):

8
go.mod
View File

@ -24,8 +24,8 @@ require (
golang.org/x/term v0.17.0 golang.org/x/term v0.17.0
golang.org/x/time v0.3.0 golang.org/x/time v0.3.0
google.golang.org/protobuf v1.33.0 google.golang.org/protobuf v1.33.0
k8s.io/api v0.0.0-20240306165540-05aa4bceed70 k8s.io/api v0.0.0-20240307045517-1d33fcde6f3f
k8s.io/apimachinery v0.0.0-20240306164812-cbfe0a1feaa5 k8s.io/apimachinery v0.0.0-20240307044802-25164f774551
k8s.io/klog/v2 v2.120.1 k8s.io/klog/v2 v2.120.1
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340
k8s.io/utils v0.0.0-20230726121419-3b25d923346b k8s.io/utils v0.0.0-20230726121419-3b25d923346b
@ -61,6 +61,6 @@ require (
) )
replace ( replace (
k8s.io/api => k8s.io/api v0.0.0-20240306165540-05aa4bceed70 k8s.io/api => k8s.io/api v0.0.0-20240307045517-1d33fcde6f3f
k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20240306164812-cbfe0a1feaa5 k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20240307044802-25164f774551
) )

8
go.sum
View File

@ -153,10 +153,10 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
k8s.io/api v0.0.0-20240306165540-05aa4bceed70 h1:Kw6GufAvqr668v56lckDWoGHFG5wwjQRjYuf+PMt1us= k8s.io/api v0.0.0-20240307045517-1d33fcde6f3f h1:AZBD10PF/cNxYJJgh8fMrENM3UItvPkMO18LB0dTrV8=
k8s.io/api v0.0.0-20240306165540-05aa4bceed70/go.mod h1:S69aw/5045kbDeBVmy89EQxSM7v5kHdLNzO4wt3OZ2o= k8s.io/api v0.0.0-20240307045517-1d33fcde6f3f/go.mod h1:qUUt5cHNc6u/2o6gcfyGSFTAK8Ca4QD40QqESHedUoc=
k8s.io/apimachinery v0.0.0-20240306164812-cbfe0a1feaa5 h1:YRP8FbAab9hlobsEfyUG7P6dC6hbVTLw0eFY/AnewmY= k8s.io/apimachinery v0.0.0-20240307044802-25164f774551 h1:uzmc7GC/4uB5xeS8MaTO/UgsFRt2eepWEh0EIg1Og5c=
k8s.io/apimachinery v0.0.0-20240306164812-cbfe0a1feaa5/go.mod h1:wEJvNDlfxMRaMhyv38SIHIEC9hah/xuzqUUhxIyUv7Y= k8s.io/apimachinery v0.0.0-20240307044802-25164f774551/go.mod h1:wEJvNDlfxMRaMhyv38SIHIEC9hah/xuzqUUhxIyUv7Y=
k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw= k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw=
k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag= k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag=