mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 19:31:44 +00:00
Merge pull request #79549 from liggitt/admission-webhooks-v1
Promote admission webhook API to v1
This commit is contained in:
commit
3dd8add5d2
1991
api/openapi-spec/swagger.json
generated
1991
api/openapi-spec/swagger.json
generated
File diff suppressed because it is too large
Load Diff
@ -39,6 +39,7 @@ tags_values_pkgs = {"openapi-gen": {
|
|||||||
"pkg/apis/abac/v1beta1",
|
"pkg/apis/abac/v1beta1",
|
||||||
"pkg/apis/auditregistration",
|
"pkg/apis/auditregistration",
|
||||||
"pkg/version",
|
"pkg/version",
|
||||||
|
"staging/src/k8s.io/api/admissionregistration/v1",
|
||||||
"staging/src/k8s.io/api/admissionregistration/v1beta1",
|
"staging/src/k8s.io/api/admissionregistration/v1beta1",
|
||||||
"staging/src/k8s.io/api/apps/v1",
|
"staging/src/k8s.io/api/apps/v1",
|
||||||
"staging/src/k8s.io/api/apps/v1beta1",
|
"staging/src/k8s.io/api/apps/v1beta1",
|
||||||
@ -112,6 +113,7 @@ tags_pkgs_values = {"openapi-gen": {
|
|||||||
"pkg/apis/auditregistration": ["true"],
|
"pkg/apis/auditregistration": ["true"],
|
||||||
"pkg/version": ["true"],
|
"pkg/version": ["true"],
|
||||||
"staging/src/k8s.io/api/admission/v1beta1": ["false"],
|
"staging/src/k8s.io/api/admission/v1beta1": ["false"],
|
||||||
|
"staging/src/k8s.io/api/admissionregistration/v1": ["true"],
|
||||||
"staging/src/k8s.io/api/admissionregistration/v1beta1": ["true"],
|
"staging/src/k8s.io/api/admissionregistration/v1beta1": ["true"],
|
||||||
"staging/src/k8s.io/api/apps/v1": ["true"],
|
"staging/src/k8s.io/api/apps/v1": ["true"],
|
||||||
"staging/src/k8s.io/api/apps/v1beta1": ["true"],
|
"staging/src/k8s.io/api/apps/v1beta1": ["true"],
|
||||||
|
1
go.mod
1
go.mod
@ -74,6 +74,7 @@ require (
|
|||||||
github.com/golangplus/testing v0.0.0-20180327235837-af21d9c3145e // indirect
|
github.com/golangplus/testing v0.0.0-20180327235837-af21d9c3145e // indirect
|
||||||
github.com/google/cadvisor v0.33.2-0.20190411163913-9db8c7dee20a
|
github.com/google/cadvisor v0.33.2-0.20190411163913-9db8c7dee20a
|
||||||
github.com/google/certificate-transparency-go v1.0.21 // indirect
|
github.com/google/certificate-transparency-go v1.0.21 // indirect
|
||||||
|
github.com/google/go-cmp v0.3.0
|
||||||
github.com/google/gofuzz v1.0.0
|
github.com/google/gofuzz v1.0.0
|
||||||
github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d
|
github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d
|
||||||
github.com/gophercloud/gophercloud v0.1.0
|
github.com/gophercloud/gophercloud v0.1.0
|
||||||
|
@ -3,6 +3,7 @@ cmd/kube-apiserver/app
|
|||||||
cmd/kubeadm/app/apis/kubeadm/v1beta1
|
cmd/kubeadm/app/apis/kubeadm/v1beta1
|
||||||
cmd/kubeadm/app/apis/kubeadm/v1beta2
|
cmd/kubeadm/app/apis/kubeadm/v1beta2
|
||||||
pkg/apis/admission
|
pkg/apis/admission
|
||||||
|
pkg/apis/admissionregistration/v1
|
||||||
pkg/apis/admissionregistration/v1beta1
|
pkg/apis/admissionregistration/v1beta1
|
||||||
pkg/apis/admissionregistration/validation
|
pkg/apis/admissionregistration/validation
|
||||||
pkg/apis/apps
|
pkg/apis/apps
|
||||||
@ -311,6 +312,7 @@ plugin/pkg/auth/authorizer/node
|
|||||||
plugin/pkg/auth/authorizer/rbac
|
plugin/pkg/auth/authorizer/rbac
|
||||||
plugin/pkg/auth/authorizer/rbac/bootstrappolicy
|
plugin/pkg/auth/authorizer/rbac/bootstrappolicy
|
||||||
staging/src/k8s.io/api/admission/v1beta1
|
staging/src/k8s.io/api/admission/v1beta1
|
||||||
|
staging/src/k8s.io/api/admissionregistration/v1
|
||||||
staging/src/k8s.io/api/admissionregistration/v1beta1
|
staging/src/k8s.io/api/admissionregistration/v1beta1
|
||||||
staging/src/k8s.io/api/apps/v1
|
staging/src/k8s.io/api/apps/v1
|
||||||
staging/src/k8s.io/api/apps/v1beta1
|
staging/src/k8s.io/api/apps/v1beta1
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
{
|
{
|
||||||
|
"k8s.io/api/admissionregistration/v1": "admissionregistrationv1",
|
||||||
"k8s.io/api/admissionregistration/v1beta1": "admissionregistrationv1beta1",
|
"k8s.io/api/admissionregistration/v1beta1": "admissionregistrationv1beta1",
|
||||||
"k8s.io/api/admission/v1beta1": "admissionv1beta1",
|
"k8s.io/api/admission/v1beta1": "admissionv1beta1",
|
||||||
"k8s.io/api/apps/v1": "appsv1",
|
"k8s.io/api/apps/v1": "appsv1",
|
||||||
|
@ -63,6 +63,7 @@ export KUBE_OUTPUT_HOSTBIN
|
|||||||
# most preferred version for a group should appear first
|
# most preferred version for a group should appear first
|
||||||
KUBE_AVAILABLE_GROUP_VERSIONS="${KUBE_AVAILABLE_GROUP_VERSIONS:-\
|
KUBE_AVAILABLE_GROUP_VERSIONS="${KUBE_AVAILABLE_GROUP_VERSIONS:-\
|
||||||
v1 \
|
v1 \
|
||||||
|
admissionregistration.k8s.io/v1 \
|
||||||
admissionregistration.k8s.io/v1beta1 \
|
admissionregistration.k8s.io/v1beta1 \
|
||||||
admission.k8s.io/v1beta1 \
|
admission.k8s.io/v1beta1 \
|
||||||
apps/v1 \
|
apps/v1 \
|
||||||
|
@ -22,7 +22,7 @@ import (
|
|||||||
"sort"
|
"sort"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/google/gofuzz"
|
fuzz "github.com/google/gofuzz"
|
||||||
|
|
||||||
apiv1 "k8s.io/api/core/v1"
|
apiv1 "k8s.io/api/core/v1"
|
||||||
extensionsv1beta1 "k8s.io/api/extensions/v1beta1"
|
extensionsv1beta1 "k8s.io/api/extensions/v1beta1"
|
||||||
@ -136,6 +136,10 @@ func TestDefaulting(t *testing.T) {
|
|||||||
{Group: "admissionregistration.k8s.io", Version: "v1beta1", Kind: "ValidatingWebhookConfigurationList"}: {},
|
{Group: "admissionregistration.k8s.io", Version: "v1beta1", Kind: "ValidatingWebhookConfigurationList"}: {},
|
||||||
{Group: "admissionregistration.k8s.io", Version: "v1beta1", Kind: "MutatingWebhookConfiguration"}: {},
|
{Group: "admissionregistration.k8s.io", Version: "v1beta1", Kind: "MutatingWebhookConfiguration"}: {},
|
||||||
{Group: "admissionregistration.k8s.io", Version: "v1beta1", Kind: "MutatingWebhookConfigurationList"}: {},
|
{Group: "admissionregistration.k8s.io", Version: "v1beta1", Kind: "MutatingWebhookConfigurationList"}: {},
|
||||||
|
{Group: "admissionregistration.k8s.io", Version: "v1", Kind: "ValidatingWebhookConfiguration"}: {},
|
||||||
|
{Group: "admissionregistration.k8s.io", Version: "v1", Kind: "ValidatingWebhookConfigurationList"}: {},
|
||||||
|
{Group: "admissionregistration.k8s.io", Version: "v1", Kind: "MutatingWebhookConfiguration"}: {},
|
||||||
|
{Group: "admissionregistration.k8s.io", Version: "v1", Kind: "MutatingWebhookConfigurationList"}: {},
|
||||||
{Group: "auditregistration.k8s.io", Version: "v1alpha1", Kind: "AuditSink"}: {},
|
{Group: "auditregistration.k8s.io", Version: "v1alpha1", Kind: "AuditSink"}: {},
|
||||||
{Group: "auditregistration.k8s.io", Version: "v1alpha1", Kind: "AuditSinkList"}: {},
|
{Group: "auditregistration.k8s.io", Version: "v1alpha1", Kind: "AuditSinkList"}: {},
|
||||||
{Group: "networking.k8s.io", Version: "v1", Kind: "NetworkPolicy"}: {},
|
{Group: "networking.k8s.io", Version: "v1", Kind: "NetworkPolicy"}: {},
|
||||||
|
@ -34,6 +34,7 @@ filegroup(
|
|||||||
":package-srcs",
|
":package-srcs",
|
||||||
"//pkg/apis/admissionregistration/fuzzer:all-srcs",
|
"//pkg/apis/admissionregistration/fuzzer:all-srcs",
|
||||||
"//pkg/apis/admissionregistration/install:all-srcs",
|
"//pkg/apis/admissionregistration/install:all-srcs",
|
||||||
|
"//pkg/apis/admissionregistration/v1:all-srcs",
|
||||||
"//pkg/apis/admissionregistration/v1beta1:all-srcs",
|
"//pkg/apis/admissionregistration/v1beta1:all-srcs",
|
||||||
"//pkg/apis/admissionregistration/validation:all-srcs",
|
"//pkg/apis/admissionregistration/validation:all-srcs",
|
||||||
],
|
],
|
||||||
|
@ -12,6 +12,7 @@ go_library(
|
|||||||
deps = [
|
deps = [
|
||||||
"//pkg/api/legacyscheme:go_default_library",
|
"//pkg/api/legacyscheme:go_default_library",
|
||||||
"//pkg/apis/admissionregistration:go_default_library",
|
"//pkg/apis/admissionregistration:go_default_library",
|
||||||
|
"//pkg/apis/admissionregistration/v1:go_default_library",
|
||||||
"//pkg/apis/admissionregistration/v1beta1:go_default_library",
|
"//pkg/apis/admissionregistration/v1beta1:go_default_library",
|
||||||
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
|
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
|
||||||
"//staging/src/k8s.io/apimachinery/pkg/util/runtime:go_default_library",
|
"//staging/src/k8s.io/apimachinery/pkg/util/runtime:go_default_library",
|
||||||
|
@ -21,6 +21,7 @@ import (
|
|||||||
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
|
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
|
||||||
"k8s.io/kubernetes/pkg/api/legacyscheme"
|
"k8s.io/kubernetes/pkg/api/legacyscheme"
|
||||||
"k8s.io/kubernetes/pkg/apis/admissionregistration"
|
"k8s.io/kubernetes/pkg/apis/admissionregistration"
|
||||||
|
"k8s.io/kubernetes/pkg/apis/admissionregistration/v1"
|
||||||
"k8s.io/kubernetes/pkg/apis/admissionregistration/v1beta1"
|
"k8s.io/kubernetes/pkg/apis/admissionregistration/v1beta1"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -32,5 +33,6 @@ func init() {
|
|||||||
func Install(scheme *runtime.Scheme) {
|
func Install(scheme *runtime.Scheme) {
|
||||||
utilruntime.Must(admissionregistration.AddToScheme(scheme))
|
utilruntime.Must(admissionregistration.AddToScheme(scheme))
|
||||||
utilruntime.Must(v1beta1.AddToScheme(scheme))
|
utilruntime.Must(v1beta1.AddToScheme(scheme))
|
||||||
utilruntime.Must(scheme.SetVersionPriority(v1beta1.SchemeGroupVersion))
|
utilruntime.Must(v1.AddToScheme(scheme))
|
||||||
|
utilruntime.Must(scheme.SetVersionPriority(v1beta1.SchemeGroupVersion, v1.SchemeGroupVersion))
|
||||||
}
|
}
|
||||||
|
53
pkg/apis/admissionregistration/v1/BUILD
Normal file
53
pkg/apis/admissionregistration/v1/BUILD
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
package(default_visibility = ["//visibility:public"])
|
||||||
|
|
||||||
|
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
|
||||||
|
|
||||||
|
go_library(
|
||||||
|
name = "go_default_library",
|
||||||
|
srcs = [
|
||||||
|
"defaults.go",
|
||||||
|
"doc.go",
|
||||||
|
"register.go",
|
||||||
|
"zz_generated.conversion.go",
|
||||||
|
"zz_generated.defaults.go",
|
||||||
|
],
|
||||||
|
importpath = "k8s.io/kubernetes/pkg/apis/admissionregistration/v1",
|
||||||
|
deps = [
|
||||||
|
"//pkg/apis/admissionregistration:go_default_library",
|
||||||
|
"//staging/src/k8s.io/api/admissionregistration/v1:go_default_library",
|
||||||
|
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
|
||||||
|
"//staging/src/k8s.io/apimachinery/pkg/conversion:go_default_library",
|
||||||
|
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
|
||||||
|
"//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library",
|
||||||
|
"//vendor/k8s.io/utils/pointer:go_default_library",
|
||||||
|
],
|
||||||
|
)
|
||||||
|
|
||||||
|
filegroup(
|
||||||
|
name = "package-srcs",
|
||||||
|
srcs = glob(["**"]),
|
||||||
|
tags = ["automanaged"],
|
||||||
|
visibility = ["//visibility:private"],
|
||||||
|
)
|
||||||
|
|
||||||
|
filegroup(
|
||||||
|
name = "all-srcs",
|
||||||
|
srcs = [":package-srcs"],
|
||||||
|
tags = ["automanaged"],
|
||||||
|
)
|
||||||
|
|
||||||
|
go_test(
|
||||||
|
name = "go_default_test",
|
||||||
|
srcs = ["defaults_test.go"],
|
||||||
|
embed = [":go_default_library"],
|
||||||
|
deps = [
|
||||||
|
"//pkg/api/legacyscheme:go_default_library",
|
||||||
|
"//pkg/apis/admissionregistration/install:go_default_library",
|
||||||
|
"//staging/src/k8s.io/api/admissionregistration/v1:go_default_library",
|
||||||
|
"//staging/src/k8s.io/apimachinery/pkg/api/equality:go_default_library",
|
||||||
|
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
|
||||||
|
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
|
||||||
|
"//vendor/github.com/google/go-cmp/cmp:go_default_library",
|
||||||
|
"//vendor/k8s.io/utils/pointer:go_default_library",
|
||||||
|
],
|
||||||
|
)
|
92
pkg/apis/admissionregistration/v1/defaults.go
Normal file
92
pkg/apis/admissionregistration/v1/defaults.go
Normal file
@ -0,0 +1,92 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2019 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package v1
|
||||||
|
|
||||||
|
import (
|
||||||
|
admissionregistrationv1 "k8s.io/api/admissionregistration/v1"
|
||||||
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
"k8s.io/apimachinery/pkg/runtime"
|
||||||
|
utilpointer "k8s.io/utils/pointer"
|
||||||
|
)
|
||||||
|
|
||||||
|
func addDefaultingFuncs(scheme *runtime.Scheme) error {
|
||||||
|
return RegisterDefaults(scheme)
|
||||||
|
}
|
||||||
|
|
||||||
|
func SetDefaults_ValidatingWebhook(obj *admissionregistrationv1.ValidatingWebhook) {
|
||||||
|
if obj.FailurePolicy == nil {
|
||||||
|
policy := admissionregistrationv1.Fail
|
||||||
|
obj.FailurePolicy = &policy
|
||||||
|
}
|
||||||
|
if obj.MatchPolicy == nil {
|
||||||
|
policy := admissionregistrationv1.Equivalent
|
||||||
|
obj.MatchPolicy = &policy
|
||||||
|
}
|
||||||
|
if obj.NamespaceSelector == nil {
|
||||||
|
selector := metav1.LabelSelector{}
|
||||||
|
obj.NamespaceSelector = &selector
|
||||||
|
}
|
||||||
|
if obj.ObjectSelector == nil {
|
||||||
|
selector := metav1.LabelSelector{}
|
||||||
|
obj.ObjectSelector = &selector
|
||||||
|
}
|
||||||
|
if obj.TimeoutSeconds == nil {
|
||||||
|
obj.TimeoutSeconds = new(int32)
|
||||||
|
*obj.TimeoutSeconds = 10
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func SetDefaults_MutatingWebhook(obj *admissionregistrationv1.MutatingWebhook) {
|
||||||
|
if obj.FailurePolicy == nil {
|
||||||
|
policy := admissionregistrationv1.Fail
|
||||||
|
obj.FailurePolicy = &policy
|
||||||
|
}
|
||||||
|
if obj.MatchPolicy == nil {
|
||||||
|
policy := admissionregistrationv1.Equivalent
|
||||||
|
obj.MatchPolicy = &policy
|
||||||
|
}
|
||||||
|
if obj.NamespaceSelector == nil {
|
||||||
|
selector := metav1.LabelSelector{}
|
||||||
|
obj.NamespaceSelector = &selector
|
||||||
|
}
|
||||||
|
if obj.ObjectSelector == nil {
|
||||||
|
selector := metav1.LabelSelector{}
|
||||||
|
obj.ObjectSelector = &selector
|
||||||
|
}
|
||||||
|
if obj.TimeoutSeconds == nil {
|
||||||
|
obj.TimeoutSeconds = new(int32)
|
||||||
|
*obj.TimeoutSeconds = 10
|
||||||
|
}
|
||||||
|
if obj.ReinvocationPolicy == nil {
|
||||||
|
never := admissionregistrationv1.NeverReinvocationPolicy
|
||||||
|
obj.ReinvocationPolicy = &never
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func SetDefaults_Rule(obj *admissionregistrationv1.Rule) {
|
||||||
|
if obj.Scope == nil {
|
||||||
|
s := admissionregistrationv1.AllScopes
|
||||||
|
obj.Scope = &s
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetDefaults_ServiceReference sets defaults for Webhook's ServiceReference
|
||||||
|
func SetDefaults_ServiceReference(obj *admissionregistrationv1.ServiceReference) {
|
||||||
|
if obj.Port == nil {
|
||||||
|
obj.Port = utilpointer.Int32Ptr(443)
|
||||||
|
}
|
||||||
|
}
|
134
pkg/apis/admissionregistration/v1/defaults_test.go
Normal file
134
pkg/apis/admissionregistration/v1/defaults_test.go
Normal file
@ -0,0 +1,134 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2019 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package v1_test
|
||||||
|
|
||||||
|
import (
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"github.com/google/go-cmp/cmp"
|
||||||
|
|
||||||
|
v1 "k8s.io/api/admissionregistration/v1"
|
||||||
|
apiequality "k8s.io/apimachinery/pkg/api/equality"
|
||||||
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
"k8s.io/apimachinery/pkg/runtime"
|
||||||
|
"k8s.io/kubernetes/pkg/api/legacyscheme"
|
||||||
|
_ "k8s.io/kubernetes/pkg/apis/admissionregistration/install"
|
||||||
|
utilpointer "k8s.io/utils/pointer"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestDefaultAdmissionWebhook(t *testing.T) {
|
||||||
|
fail := v1.Fail
|
||||||
|
equivalent := v1.Equivalent
|
||||||
|
never := v1.NeverReinvocationPolicy
|
||||||
|
ten := int32(10)
|
||||||
|
allScopes := v1.AllScopes
|
||||||
|
|
||||||
|
tests := []struct {
|
||||||
|
name string
|
||||||
|
original runtime.Object
|
||||||
|
expected runtime.Object
|
||||||
|
}{
|
||||||
|
{
|
||||||
|
name: "ValidatingWebhookConfiguration",
|
||||||
|
original: &v1.ValidatingWebhookConfiguration{
|
||||||
|
Webhooks: []v1.ValidatingWebhook{{}},
|
||||||
|
},
|
||||||
|
expected: &v1.ValidatingWebhookConfiguration{
|
||||||
|
Webhooks: []v1.ValidatingWebhook{{
|
||||||
|
FailurePolicy: &fail,
|
||||||
|
MatchPolicy: &equivalent,
|
||||||
|
TimeoutSeconds: &ten,
|
||||||
|
NamespaceSelector: &metav1.LabelSelector{},
|
||||||
|
ObjectSelector: &metav1.LabelSelector{},
|
||||||
|
}},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "MutatingWebhookConfiguration",
|
||||||
|
original: &v1.MutatingWebhookConfiguration{
|
||||||
|
Webhooks: []v1.MutatingWebhook{{}},
|
||||||
|
},
|
||||||
|
expected: &v1.MutatingWebhookConfiguration{
|
||||||
|
Webhooks: []v1.MutatingWebhook{{
|
||||||
|
FailurePolicy: &fail,
|
||||||
|
MatchPolicy: &equivalent,
|
||||||
|
ReinvocationPolicy: &never,
|
||||||
|
TimeoutSeconds: &ten,
|
||||||
|
NamespaceSelector: &metav1.LabelSelector{},
|
||||||
|
ObjectSelector: &metav1.LabelSelector{},
|
||||||
|
}},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "scope=*",
|
||||||
|
original: &v1.MutatingWebhookConfiguration{
|
||||||
|
Webhooks: []v1.MutatingWebhook{{
|
||||||
|
Rules: []v1.RuleWithOperations{{}},
|
||||||
|
}},
|
||||||
|
},
|
||||||
|
expected: &v1.MutatingWebhookConfiguration{
|
||||||
|
Webhooks: []v1.MutatingWebhook{{
|
||||||
|
Rules: []v1.RuleWithOperations{{Rule: v1.Rule{
|
||||||
|
Scope: &allScopes, // defaulted
|
||||||
|
}}},
|
||||||
|
FailurePolicy: &fail,
|
||||||
|
MatchPolicy: &equivalent,
|
||||||
|
ReinvocationPolicy: &never,
|
||||||
|
TimeoutSeconds: &ten,
|
||||||
|
NamespaceSelector: &metav1.LabelSelector{},
|
||||||
|
ObjectSelector: &metav1.LabelSelector{},
|
||||||
|
}},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "port=443",
|
||||||
|
original: &v1.MutatingWebhookConfiguration{
|
||||||
|
Webhooks: []v1.MutatingWebhook{{
|
||||||
|
ClientConfig: v1.WebhookClientConfig{
|
||||||
|
Service: &v1.ServiceReference{},
|
||||||
|
},
|
||||||
|
}},
|
||||||
|
},
|
||||||
|
expected: &v1.MutatingWebhookConfiguration{
|
||||||
|
Webhooks: []v1.MutatingWebhook{{
|
||||||
|
ClientConfig: v1.WebhookClientConfig{
|
||||||
|
Service: &v1.ServiceReference{
|
||||||
|
Port: utilpointer.Int32Ptr(443), // defaulted
|
||||||
|
},
|
||||||
|
},
|
||||||
|
FailurePolicy: &fail,
|
||||||
|
MatchPolicy: &equivalent,
|
||||||
|
ReinvocationPolicy: &never,
|
||||||
|
TimeoutSeconds: &ten,
|
||||||
|
NamespaceSelector: &metav1.LabelSelector{},
|
||||||
|
ObjectSelector: &metav1.LabelSelector{},
|
||||||
|
}},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, test := range tests {
|
||||||
|
t.Run(test.name, func(t *testing.T) {
|
||||||
|
original := test.original
|
||||||
|
expected := test.expected
|
||||||
|
legacyscheme.Scheme.Default(original)
|
||||||
|
if !apiequality.Semantic.DeepEqual(original, expected) {
|
||||||
|
t.Error(cmp.Diff(expected, original))
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
27
pkg/apis/admissionregistration/v1/doc.go
Normal file
27
pkg/apis/admissionregistration/v1/doc.go
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2019 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
// +k8s:conversion-gen=k8s.io/kubernetes/pkg/apis/admissionregistration
|
||||||
|
// +k8s:conversion-gen-external-types=k8s.io/api/admissionregistration/v1
|
||||||
|
// +k8s:defaulter-gen=TypeMeta
|
||||||
|
// +k8s:defaulter-gen-input=../../../../vendor/k8s.io/api/admissionregistration/v1
|
||||||
|
// +groupName=admissionregistration.k8s.io
|
||||||
|
|
||||||
|
// Package v1 is the v1 version of the API.
|
||||||
|
// AdmissionConfiguration and AdmissionPluginConfiguration are legacy static admission plugin configuration
|
||||||
|
// ValidatingWebhookConfiguration, and MutatingWebhookConfiguration are for the
|
||||||
|
// new dynamic admission controller configuration.
|
||||||
|
package v1 // import "k8s.io/kubernetes/pkg/apis/admissionregistration/v1"
|
44
pkg/apis/admissionregistration/v1/register.go
Normal file
44
pkg/apis/admissionregistration/v1/register.go
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2019 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package v1
|
||||||
|
|
||||||
|
import (
|
||||||
|
admissionregistrationv1 "k8s.io/api/admissionregistration/v1"
|
||||||
|
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||||
|
)
|
||||||
|
|
||||||
|
const GroupName = "admissionregistration.k8s.io"
|
||||||
|
|
||||||
|
// SchemeGroupVersion is group version used to register these objects
|
||||||
|
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1"}
|
||||||
|
|
||||||
|
// Resource takes an unqualified resource and returns a Group qualified GroupResource
|
||||||
|
func Resource(resource string) schema.GroupResource {
|
||||||
|
return SchemeGroupVersion.WithResource(resource).GroupResource()
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
localSchemeBuilder = &admissionregistrationv1.SchemeBuilder
|
||||||
|
AddToScheme = localSchemeBuilder.AddToScheme
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
// We only register manually written functions here. The registration of the
|
||||||
|
// generated functions takes place in the generated files. The separation
|
||||||
|
// makes the code compile even when the generated files are missing.
|
||||||
|
localSchemeBuilder.Register(addDefaultingFuncs)
|
||||||
|
}
|
517
pkg/apis/admissionregistration/v1/zz_generated.conversion.go
generated
Normal file
517
pkg/apis/admissionregistration/v1/zz_generated.conversion.go
generated
Normal file
@ -0,0 +1,517 @@
|
|||||||
|
// +build !ignore_autogenerated
|
||||||
|
|
||||||
|
/*
|
||||||
|
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 conversion-gen. DO NOT EDIT.
|
||||||
|
|
||||||
|
package v1
|
||||||
|
|
||||||
|
import (
|
||||||
|
unsafe "unsafe"
|
||||||
|
|
||||||
|
v1 "k8s.io/api/admissionregistration/v1"
|
||||||
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
conversion "k8s.io/apimachinery/pkg/conversion"
|
||||||
|
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||||
|
admissionregistration "k8s.io/kubernetes/pkg/apis/admissionregistration"
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
localSchemeBuilder.Register(RegisterConversions)
|
||||||
|
}
|
||||||
|
|
||||||
|
// RegisterConversions adds conversion functions to the given scheme.
|
||||||
|
// Public to allow building arbitrary schemes.
|
||||||
|
func RegisterConversions(s *runtime.Scheme) error {
|
||||||
|
if err := s.AddGeneratedConversionFunc((*v1.MutatingWebhook)(nil), (*admissionregistration.MutatingWebhook)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||||
|
return Convert_v1_MutatingWebhook_To_admissionregistration_MutatingWebhook(a.(*v1.MutatingWebhook), b.(*admissionregistration.MutatingWebhook), scope)
|
||||||
|
}); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err := s.AddGeneratedConversionFunc((*admissionregistration.MutatingWebhook)(nil), (*v1.MutatingWebhook)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||||
|
return Convert_admissionregistration_MutatingWebhook_To_v1_MutatingWebhook(a.(*admissionregistration.MutatingWebhook), b.(*v1.MutatingWebhook), scope)
|
||||||
|
}); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err := s.AddGeneratedConversionFunc((*v1.MutatingWebhookConfiguration)(nil), (*admissionregistration.MutatingWebhookConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||||
|
return Convert_v1_MutatingWebhookConfiguration_To_admissionregistration_MutatingWebhookConfiguration(a.(*v1.MutatingWebhookConfiguration), b.(*admissionregistration.MutatingWebhookConfiguration), scope)
|
||||||
|
}); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err := s.AddGeneratedConversionFunc((*admissionregistration.MutatingWebhookConfiguration)(nil), (*v1.MutatingWebhookConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||||
|
return Convert_admissionregistration_MutatingWebhookConfiguration_To_v1_MutatingWebhookConfiguration(a.(*admissionregistration.MutatingWebhookConfiguration), b.(*v1.MutatingWebhookConfiguration), scope)
|
||||||
|
}); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err := s.AddGeneratedConversionFunc((*v1.MutatingWebhookConfigurationList)(nil), (*admissionregistration.MutatingWebhookConfigurationList)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||||
|
return Convert_v1_MutatingWebhookConfigurationList_To_admissionregistration_MutatingWebhookConfigurationList(a.(*v1.MutatingWebhookConfigurationList), b.(*admissionregistration.MutatingWebhookConfigurationList), scope)
|
||||||
|
}); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err := s.AddGeneratedConversionFunc((*admissionregistration.MutatingWebhookConfigurationList)(nil), (*v1.MutatingWebhookConfigurationList)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||||
|
return Convert_admissionregistration_MutatingWebhookConfigurationList_To_v1_MutatingWebhookConfigurationList(a.(*admissionregistration.MutatingWebhookConfigurationList), b.(*v1.MutatingWebhookConfigurationList), scope)
|
||||||
|
}); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err := s.AddGeneratedConversionFunc((*v1.Rule)(nil), (*admissionregistration.Rule)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||||
|
return Convert_v1_Rule_To_admissionregistration_Rule(a.(*v1.Rule), b.(*admissionregistration.Rule), scope)
|
||||||
|
}); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err := s.AddGeneratedConversionFunc((*admissionregistration.Rule)(nil), (*v1.Rule)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||||
|
return Convert_admissionregistration_Rule_To_v1_Rule(a.(*admissionregistration.Rule), b.(*v1.Rule), scope)
|
||||||
|
}); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err := s.AddGeneratedConversionFunc((*v1.RuleWithOperations)(nil), (*admissionregistration.RuleWithOperations)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||||
|
return Convert_v1_RuleWithOperations_To_admissionregistration_RuleWithOperations(a.(*v1.RuleWithOperations), b.(*admissionregistration.RuleWithOperations), scope)
|
||||||
|
}); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err := s.AddGeneratedConversionFunc((*admissionregistration.RuleWithOperations)(nil), (*v1.RuleWithOperations)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||||
|
return Convert_admissionregistration_RuleWithOperations_To_v1_RuleWithOperations(a.(*admissionregistration.RuleWithOperations), b.(*v1.RuleWithOperations), scope)
|
||||||
|
}); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err := s.AddGeneratedConversionFunc((*v1.ServiceReference)(nil), (*admissionregistration.ServiceReference)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||||
|
return Convert_v1_ServiceReference_To_admissionregistration_ServiceReference(a.(*v1.ServiceReference), b.(*admissionregistration.ServiceReference), scope)
|
||||||
|
}); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err := s.AddGeneratedConversionFunc((*admissionregistration.ServiceReference)(nil), (*v1.ServiceReference)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||||
|
return Convert_admissionregistration_ServiceReference_To_v1_ServiceReference(a.(*admissionregistration.ServiceReference), b.(*v1.ServiceReference), scope)
|
||||||
|
}); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err := s.AddGeneratedConversionFunc((*v1.ValidatingWebhook)(nil), (*admissionregistration.ValidatingWebhook)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||||
|
return Convert_v1_ValidatingWebhook_To_admissionregistration_ValidatingWebhook(a.(*v1.ValidatingWebhook), b.(*admissionregistration.ValidatingWebhook), scope)
|
||||||
|
}); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err := s.AddGeneratedConversionFunc((*admissionregistration.ValidatingWebhook)(nil), (*v1.ValidatingWebhook)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||||
|
return Convert_admissionregistration_ValidatingWebhook_To_v1_ValidatingWebhook(a.(*admissionregistration.ValidatingWebhook), b.(*v1.ValidatingWebhook), scope)
|
||||||
|
}); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err := s.AddGeneratedConversionFunc((*v1.ValidatingWebhookConfiguration)(nil), (*admissionregistration.ValidatingWebhookConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||||
|
return Convert_v1_ValidatingWebhookConfiguration_To_admissionregistration_ValidatingWebhookConfiguration(a.(*v1.ValidatingWebhookConfiguration), b.(*admissionregistration.ValidatingWebhookConfiguration), scope)
|
||||||
|
}); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err := s.AddGeneratedConversionFunc((*admissionregistration.ValidatingWebhookConfiguration)(nil), (*v1.ValidatingWebhookConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||||
|
return Convert_admissionregistration_ValidatingWebhookConfiguration_To_v1_ValidatingWebhookConfiguration(a.(*admissionregistration.ValidatingWebhookConfiguration), b.(*v1.ValidatingWebhookConfiguration), scope)
|
||||||
|
}); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err := s.AddGeneratedConversionFunc((*v1.ValidatingWebhookConfigurationList)(nil), (*admissionregistration.ValidatingWebhookConfigurationList)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||||
|
return Convert_v1_ValidatingWebhookConfigurationList_To_admissionregistration_ValidatingWebhookConfigurationList(a.(*v1.ValidatingWebhookConfigurationList), b.(*admissionregistration.ValidatingWebhookConfigurationList), scope)
|
||||||
|
}); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err := s.AddGeneratedConversionFunc((*admissionregistration.ValidatingWebhookConfigurationList)(nil), (*v1.ValidatingWebhookConfigurationList)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||||
|
return Convert_admissionregistration_ValidatingWebhookConfigurationList_To_v1_ValidatingWebhookConfigurationList(a.(*admissionregistration.ValidatingWebhookConfigurationList), b.(*v1.ValidatingWebhookConfigurationList), scope)
|
||||||
|
}); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err := s.AddGeneratedConversionFunc((*v1.WebhookClientConfig)(nil), (*admissionregistration.WebhookClientConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||||
|
return Convert_v1_WebhookClientConfig_To_admissionregistration_WebhookClientConfig(a.(*v1.WebhookClientConfig), b.(*admissionregistration.WebhookClientConfig), scope)
|
||||||
|
}); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if err := s.AddGeneratedConversionFunc((*admissionregistration.WebhookClientConfig)(nil), (*v1.WebhookClientConfig)(nil), func(a, b interface{}, scope conversion.Scope) error {
|
||||||
|
return Convert_admissionregistration_WebhookClientConfig_To_v1_WebhookClientConfig(a.(*admissionregistration.WebhookClientConfig), b.(*v1.WebhookClientConfig), scope)
|
||||||
|
}); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func autoConvert_v1_MutatingWebhook_To_admissionregistration_MutatingWebhook(in *v1.MutatingWebhook, out *admissionregistration.MutatingWebhook, s conversion.Scope) error {
|
||||||
|
out.Name = in.Name
|
||||||
|
if err := Convert_v1_WebhookClientConfig_To_admissionregistration_WebhookClientConfig(&in.ClientConfig, &out.ClientConfig, s); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
out.Rules = *(*[]admissionregistration.RuleWithOperations)(unsafe.Pointer(&in.Rules))
|
||||||
|
out.FailurePolicy = (*admissionregistration.FailurePolicyType)(unsafe.Pointer(in.FailurePolicy))
|
||||||
|
out.MatchPolicy = (*admissionregistration.MatchPolicyType)(unsafe.Pointer(in.MatchPolicy))
|
||||||
|
out.NamespaceSelector = (*metav1.LabelSelector)(unsafe.Pointer(in.NamespaceSelector))
|
||||||
|
out.ObjectSelector = (*metav1.LabelSelector)(unsafe.Pointer(in.ObjectSelector))
|
||||||
|
out.SideEffects = (*admissionregistration.SideEffectClass)(unsafe.Pointer(in.SideEffects))
|
||||||
|
out.TimeoutSeconds = (*int32)(unsafe.Pointer(in.TimeoutSeconds))
|
||||||
|
out.AdmissionReviewVersions = *(*[]string)(unsafe.Pointer(&in.AdmissionReviewVersions))
|
||||||
|
out.ReinvocationPolicy = (*admissionregistration.ReinvocationPolicyType)(unsafe.Pointer(in.ReinvocationPolicy))
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Convert_v1_MutatingWebhook_To_admissionregistration_MutatingWebhook is an autogenerated conversion function.
|
||||||
|
func Convert_v1_MutatingWebhook_To_admissionregistration_MutatingWebhook(in *v1.MutatingWebhook, out *admissionregistration.MutatingWebhook, s conversion.Scope) error {
|
||||||
|
return autoConvert_v1_MutatingWebhook_To_admissionregistration_MutatingWebhook(in, out, s)
|
||||||
|
}
|
||||||
|
|
||||||
|
func autoConvert_admissionregistration_MutatingWebhook_To_v1_MutatingWebhook(in *admissionregistration.MutatingWebhook, out *v1.MutatingWebhook, s conversion.Scope) error {
|
||||||
|
out.Name = in.Name
|
||||||
|
if err := Convert_admissionregistration_WebhookClientConfig_To_v1_WebhookClientConfig(&in.ClientConfig, &out.ClientConfig, s); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
out.Rules = *(*[]v1.RuleWithOperations)(unsafe.Pointer(&in.Rules))
|
||||||
|
out.FailurePolicy = (*v1.FailurePolicyType)(unsafe.Pointer(in.FailurePolicy))
|
||||||
|
out.MatchPolicy = (*v1.MatchPolicyType)(unsafe.Pointer(in.MatchPolicy))
|
||||||
|
out.NamespaceSelector = (*metav1.LabelSelector)(unsafe.Pointer(in.NamespaceSelector))
|
||||||
|
out.ObjectSelector = (*metav1.LabelSelector)(unsafe.Pointer(in.ObjectSelector))
|
||||||
|
out.SideEffects = (*v1.SideEffectClass)(unsafe.Pointer(in.SideEffects))
|
||||||
|
out.TimeoutSeconds = (*int32)(unsafe.Pointer(in.TimeoutSeconds))
|
||||||
|
out.AdmissionReviewVersions = *(*[]string)(unsafe.Pointer(&in.AdmissionReviewVersions))
|
||||||
|
out.ReinvocationPolicy = (*v1.ReinvocationPolicyType)(unsafe.Pointer(in.ReinvocationPolicy))
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Convert_admissionregistration_MutatingWebhook_To_v1_MutatingWebhook is an autogenerated conversion function.
|
||||||
|
func Convert_admissionregistration_MutatingWebhook_To_v1_MutatingWebhook(in *admissionregistration.MutatingWebhook, out *v1.MutatingWebhook, s conversion.Scope) error {
|
||||||
|
return autoConvert_admissionregistration_MutatingWebhook_To_v1_MutatingWebhook(in, out, s)
|
||||||
|
}
|
||||||
|
|
||||||
|
func autoConvert_v1_MutatingWebhookConfiguration_To_admissionregistration_MutatingWebhookConfiguration(in *v1.MutatingWebhookConfiguration, out *admissionregistration.MutatingWebhookConfiguration, s conversion.Scope) error {
|
||||||
|
out.ObjectMeta = in.ObjectMeta
|
||||||
|
if in.Webhooks != nil {
|
||||||
|
in, out := &in.Webhooks, &out.Webhooks
|
||||||
|
*out = make([]admissionregistration.MutatingWebhook, len(*in))
|
||||||
|
for i := range *in {
|
||||||
|
if err := Convert_v1_MutatingWebhook_To_admissionregistration_MutatingWebhook(&(*in)[i], &(*out)[i], s); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
out.Webhooks = nil
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Convert_v1_MutatingWebhookConfiguration_To_admissionregistration_MutatingWebhookConfiguration is an autogenerated conversion function.
|
||||||
|
func Convert_v1_MutatingWebhookConfiguration_To_admissionregistration_MutatingWebhookConfiguration(in *v1.MutatingWebhookConfiguration, out *admissionregistration.MutatingWebhookConfiguration, s conversion.Scope) error {
|
||||||
|
return autoConvert_v1_MutatingWebhookConfiguration_To_admissionregistration_MutatingWebhookConfiguration(in, out, s)
|
||||||
|
}
|
||||||
|
|
||||||
|
func autoConvert_admissionregistration_MutatingWebhookConfiguration_To_v1_MutatingWebhookConfiguration(in *admissionregistration.MutatingWebhookConfiguration, out *v1.MutatingWebhookConfiguration, s conversion.Scope) error {
|
||||||
|
out.ObjectMeta = in.ObjectMeta
|
||||||
|
if in.Webhooks != nil {
|
||||||
|
in, out := &in.Webhooks, &out.Webhooks
|
||||||
|
*out = make([]v1.MutatingWebhook, len(*in))
|
||||||
|
for i := range *in {
|
||||||
|
if err := Convert_admissionregistration_MutatingWebhook_To_v1_MutatingWebhook(&(*in)[i], &(*out)[i], s); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
out.Webhooks = nil
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Convert_admissionregistration_MutatingWebhookConfiguration_To_v1_MutatingWebhookConfiguration is an autogenerated conversion function.
|
||||||
|
func Convert_admissionregistration_MutatingWebhookConfiguration_To_v1_MutatingWebhookConfiguration(in *admissionregistration.MutatingWebhookConfiguration, out *v1.MutatingWebhookConfiguration, s conversion.Scope) error {
|
||||||
|
return autoConvert_admissionregistration_MutatingWebhookConfiguration_To_v1_MutatingWebhookConfiguration(in, out, s)
|
||||||
|
}
|
||||||
|
|
||||||
|
func autoConvert_v1_MutatingWebhookConfigurationList_To_admissionregistration_MutatingWebhookConfigurationList(in *v1.MutatingWebhookConfigurationList, out *admissionregistration.MutatingWebhookConfigurationList, s conversion.Scope) error {
|
||||||
|
out.ListMeta = in.ListMeta
|
||||||
|
if in.Items != nil {
|
||||||
|
in, out := &in.Items, &out.Items
|
||||||
|
*out = make([]admissionregistration.MutatingWebhookConfiguration, len(*in))
|
||||||
|
for i := range *in {
|
||||||
|
if err := Convert_v1_MutatingWebhookConfiguration_To_admissionregistration_MutatingWebhookConfiguration(&(*in)[i], &(*out)[i], s); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
out.Items = nil
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Convert_v1_MutatingWebhookConfigurationList_To_admissionregistration_MutatingWebhookConfigurationList is an autogenerated conversion function.
|
||||||
|
func Convert_v1_MutatingWebhookConfigurationList_To_admissionregistration_MutatingWebhookConfigurationList(in *v1.MutatingWebhookConfigurationList, out *admissionregistration.MutatingWebhookConfigurationList, s conversion.Scope) error {
|
||||||
|
return autoConvert_v1_MutatingWebhookConfigurationList_To_admissionregistration_MutatingWebhookConfigurationList(in, out, s)
|
||||||
|
}
|
||||||
|
|
||||||
|
func autoConvert_admissionregistration_MutatingWebhookConfigurationList_To_v1_MutatingWebhookConfigurationList(in *admissionregistration.MutatingWebhookConfigurationList, out *v1.MutatingWebhookConfigurationList, s conversion.Scope) error {
|
||||||
|
out.ListMeta = in.ListMeta
|
||||||
|
if in.Items != nil {
|
||||||
|
in, out := &in.Items, &out.Items
|
||||||
|
*out = make([]v1.MutatingWebhookConfiguration, len(*in))
|
||||||
|
for i := range *in {
|
||||||
|
if err := Convert_admissionregistration_MutatingWebhookConfiguration_To_v1_MutatingWebhookConfiguration(&(*in)[i], &(*out)[i], s); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
out.Items = nil
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Convert_admissionregistration_MutatingWebhookConfigurationList_To_v1_MutatingWebhookConfigurationList is an autogenerated conversion function.
|
||||||
|
func Convert_admissionregistration_MutatingWebhookConfigurationList_To_v1_MutatingWebhookConfigurationList(in *admissionregistration.MutatingWebhookConfigurationList, out *v1.MutatingWebhookConfigurationList, s conversion.Scope) error {
|
||||||
|
return autoConvert_admissionregistration_MutatingWebhookConfigurationList_To_v1_MutatingWebhookConfigurationList(in, out, s)
|
||||||
|
}
|
||||||
|
|
||||||
|
func autoConvert_v1_Rule_To_admissionregistration_Rule(in *v1.Rule, out *admissionregistration.Rule, s conversion.Scope) error {
|
||||||
|
out.APIGroups = *(*[]string)(unsafe.Pointer(&in.APIGroups))
|
||||||
|
out.APIVersions = *(*[]string)(unsafe.Pointer(&in.APIVersions))
|
||||||
|
out.Resources = *(*[]string)(unsafe.Pointer(&in.Resources))
|
||||||
|
out.Scope = (*admissionregistration.ScopeType)(unsafe.Pointer(in.Scope))
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Convert_v1_Rule_To_admissionregistration_Rule is an autogenerated conversion function.
|
||||||
|
func Convert_v1_Rule_To_admissionregistration_Rule(in *v1.Rule, out *admissionregistration.Rule, s conversion.Scope) error {
|
||||||
|
return autoConvert_v1_Rule_To_admissionregistration_Rule(in, out, s)
|
||||||
|
}
|
||||||
|
|
||||||
|
func autoConvert_admissionregistration_Rule_To_v1_Rule(in *admissionregistration.Rule, out *v1.Rule, s conversion.Scope) error {
|
||||||
|
out.APIGroups = *(*[]string)(unsafe.Pointer(&in.APIGroups))
|
||||||
|
out.APIVersions = *(*[]string)(unsafe.Pointer(&in.APIVersions))
|
||||||
|
out.Resources = *(*[]string)(unsafe.Pointer(&in.Resources))
|
||||||
|
out.Scope = (*v1.ScopeType)(unsafe.Pointer(in.Scope))
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Convert_admissionregistration_Rule_To_v1_Rule is an autogenerated conversion function.
|
||||||
|
func Convert_admissionregistration_Rule_To_v1_Rule(in *admissionregistration.Rule, out *v1.Rule, s conversion.Scope) error {
|
||||||
|
return autoConvert_admissionregistration_Rule_To_v1_Rule(in, out, s)
|
||||||
|
}
|
||||||
|
|
||||||
|
func autoConvert_v1_RuleWithOperations_To_admissionregistration_RuleWithOperations(in *v1.RuleWithOperations, out *admissionregistration.RuleWithOperations, s conversion.Scope) error {
|
||||||
|
out.Operations = *(*[]admissionregistration.OperationType)(unsafe.Pointer(&in.Operations))
|
||||||
|
if err := Convert_v1_Rule_To_admissionregistration_Rule(&in.Rule, &out.Rule, s); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Convert_v1_RuleWithOperations_To_admissionregistration_RuleWithOperations is an autogenerated conversion function.
|
||||||
|
func Convert_v1_RuleWithOperations_To_admissionregistration_RuleWithOperations(in *v1.RuleWithOperations, out *admissionregistration.RuleWithOperations, s conversion.Scope) error {
|
||||||
|
return autoConvert_v1_RuleWithOperations_To_admissionregistration_RuleWithOperations(in, out, s)
|
||||||
|
}
|
||||||
|
|
||||||
|
func autoConvert_admissionregistration_RuleWithOperations_To_v1_RuleWithOperations(in *admissionregistration.RuleWithOperations, out *v1.RuleWithOperations, s conversion.Scope) error {
|
||||||
|
out.Operations = *(*[]v1.OperationType)(unsafe.Pointer(&in.Operations))
|
||||||
|
if err := Convert_admissionregistration_Rule_To_v1_Rule(&in.Rule, &out.Rule, s); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Convert_admissionregistration_RuleWithOperations_To_v1_RuleWithOperations is an autogenerated conversion function.
|
||||||
|
func Convert_admissionregistration_RuleWithOperations_To_v1_RuleWithOperations(in *admissionregistration.RuleWithOperations, out *v1.RuleWithOperations, s conversion.Scope) error {
|
||||||
|
return autoConvert_admissionregistration_RuleWithOperations_To_v1_RuleWithOperations(in, out, s)
|
||||||
|
}
|
||||||
|
|
||||||
|
func autoConvert_v1_ServiceReference_To_admissionregistration_ServiceReference(in *v1.ServiceReference, out *admissionregistration.ServiceReference, s conversion.Scope) error {
|
||||||
|
out.Namespace = in.Namespace
|
||||||
|
out.Name = in.Name
|
||||||
|
out.Path = (*string)(unsafe.Pointer(in.Path))
|
||||||
|
if err := metav1.Convert_Pointer_int32_To_int32(&in.Port, &out.Port, s); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Convert_v1_ServiceReference_To_admissionregistration_ServiceReference is an autogenerated conversion function.
|
||||||
|
func Convert_v1_ServiceReference_To_admissionregistration_ServiceReference(in *v1.ServiceReference, out *admissionregistration.ServiceReference, s conversion.Scope) error {
|
||||||
|
return autoConvert_v1_ServiceReference_To_admissionregistration_ServiceReference(in, out, s)
|
||||||
|
}
|
||||||
|
|
||||||
|
func autoConvert_admissionregistration_ServiceReference_To_v1_ServiceReference(in *admissionregistration.ServiceReference, out *v1.ServiceReference, s conversion.Scope) error {
|
||||||
|
out.Namespace = in.Namespace
|
||||||
|
out.Name = in.Name
|
||||||
|
out.Path = (*string)(unsafe.Pointer(in.Path))
|
||||||
|
if err := metav1.Convert_int32_To_Pointer_int32(&in.Port, &out.Port, s); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Convert_admissionregistration_ServiceReference_To_v1_ServiceReference is an autogenerated conversion function.
|
||||||
|
func Convert_admissionregistration_ServiceReference_To_v1_ServiceReference(in *admissionregistration.ServiceReference, out *v1.ServiceReference, s conversion.Scope) error {
|
||||||
|
return autoConvert_admissionregistration_ServiceReference_To_v1_ServiceReference(in, out, s)
|
||||||
|
}
|
||||||
|
|
||||||
|
func autoConvert_v1_ValidatingWebhook_To_admissionregistration_ValidatingWebhook(in *v1.ValidatingWebhook, out *admissionregistration.ValidatingWebhook, s conversion.Scope) error {
|
||||||
|
out.Name = in.Name
|
||||||
|
if err := Convert_v1_WebhookClientConfig_To_admissionregistration_WebhookClientConfig(&in.ClientConfig, &out.ClientConfig, s); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
out.Rules = *(*[]admissionregistration.RuleWithOperations)(unsafe.Pointer(&in.Rules))
|
||||||
|
out.FailurePolicy = (*admissionregistration.FailurePolicyType)(unsafe.Pointer(in.FailurePolicy))
|
||||||
|
out.MatchPolicy = (*admissionregistration.MatchPolicyType)(unsafe.Pointer(in.MatchPolicy))
|
||||||
|
out.NamespaceSelector = (*metav1.LabelSelector)(unsafe.Pointer(in.NamespaceSelector))
|
||||||
|
out.ObjectSelector = (*metav1.LabelSelector)(unsafe.Pointer(in.ObjectSelector))
|
||||||
|
out.SideEffects = (*admissionregistration.SideEffectClass)(unsafe.Pointer(in.SideEffects))
|
||||||
|
out.TimeoutSeconds = (*int32)(unsafe.Pointer(in.TimeoutSeconds))
|
||||||
|
out.AdmissionReviewVersions = *(*[]string)(unsafe.Pointer(&in.AdmissionReviewVersions))
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Convert_v1_ValidatingWebhook_To_admissionregistration_ValidatingWebhook is an autogenerated conversion function.
|
||||||
|
func Convert_v1_ValidatingWebhook_To_admissionregistration_ValidatingWebhook(in *v1.ValidatingWebhook, out *admissionregistration.ValidatingWebhook, s conversion.Scope) error {
|
||||||
|
return autoConvert_v1_ValidatingWebhook_To_admissionregistration_ValidatingWebhook(in, out, s)
|
||||||
|
}
|
||||||
|
|
||||||
|
func autoConvert_admissionregistration_ValidatingWebhook_To_v1_ValidatingWebhook(in *admissionregistration.ValidatingWebhook, out *v1.ValidatingWebhook, s conversion.Scope) error {
|
||||||
|
out.Name = in.Name
|
||||||
|
if err := Convert_admissionregistration_WebhookClientConfig_To_v1_WebhookClientConfig(&in.ClientConfig, &out.ClientConfig, s); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
out.Rules = *(*[]v1.RuleWithOperations)(unsafe.Pointer(&in.Rules))
|
||||||
|
out.FailurePolicy = (*v1.FailurePolicyType)(unsafe.Pointer(in.FailurePolicy))
|
||||||
|
out.MatchPolicy = (*v1.MatchPolicyType)(unsafe.Pointer(in.MatchPolicy))
|
||||||
|
out.NamespaceSelector = (*metav1.LabelSelector)(unsafe.Pointer(in.NamespaceSelector))
|
||||||
|
out.ObjectSelector = (*metav1.LabelSelector)(unsafe.Pointer(in.ObjectSelector))
|
||||||
|
out.SideEffects = (*v1.SideEffectClass)(unsafe.Pointer(in.SideEffects))
|
||||||
|
out.TimeoutSeconds = (*int32)(unsafe.Pointer(in.TimeoutSeconds))
|
||||||
|
out.AdmissionReviewVersions = *(*[]string)(unsafe.Pointer(&in.AdmissionReviewVersions))
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Convert_admissionregistration_ValidatingWebhook_To_v1_ValidatingWebhook is an autogenerated conversion function.
|
||||||
|
func Convert_admissionregistration_ValidatingWebhook_To_v1_ValidatingWebhook(in *admissionregistration.ValidatingWebhook, out *v1.ValidatingWebhook, s conversion.Scope) error {
|
||||||
|
return autoConvert_admissionregistration_ValidatingWebhook_To_v1_ValidatingWebhook(in, out, s)
|
||||||
|
}
|
||||||
|
|
||||||
|
func autoConvert_v1_ValidatingWebhookConfiguration_To_admissionregistration_ValidatingWebhookConfiguration(in *v1.ValidatingWebhookConfiguration, out *admissionregistration.ValidatingWebhookConfiguration, s conversion.Scope) error {
|
||||||
|
out.ObjectMeta = in.ObjectMeta
|
||||||
|
if in.Webhooks != nil {
|
||||||
|
in, out := &in.Webhooks, &out.Webhooks
|
||||||
|
*out = make([]admissionregistration.ValidatingWebhook, len(*in))
|
||||||
|
for i := range *in {
|
||||||
|
if err := Convert_v1_ValidatingWebhook_To_admissionregistration_ValidatingWebhook(&(*in)[i], &(*out)[i], s); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
out.Webhooks = nil
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Convert_v1_ValidatingWebhookConfiguration_To_admissionregistration_ValidatingWebhookConfiguration is an autogenerated conversion function.
|
||||||
|
func Convert_v1_ValidatingWebhookConfiguration_To_admissionregistration_ValidatingWebhookConfiguration(in *v1.ValidatingWebhookConfiguration, out *admissionregistration.ValidatingWebhookConfiguration, s conversion.Scope) error {
|
||||||
|
return autoConvert_v1_ValidatingWebhookConfiguration_To_admissionregistration_ValidatingWebhookConfiguration(in, out, s)
|
||||||
|
}
|
||||||
|
|
||||||
|
func autoConvert_admissionregistration_ValidatingWebhookConfiguration_To_v1_ValidatingWebhookConfiguration(in *admissionregistration.ValidatingWebhookConfiguration, out *v1.ValidatingWebhookConfiguration, s conversion.Scope) error {
|
||||||
|
out.ObjectMeta = in.ObjectMeta
|
||||||
|
if in.Webhooks != nil {
|
||||||
|
in, out := &in.Webhooks, &out.Webhooks
|
||||||
|
*out = make([]v1.ValidatingWebhook, len(*in))
|
||||||
|
for i := range *in {
|
||||||
|
if err := Convert_admissionregistration_ValidatingWebhook_To_v1_ValidatingWebhook(&(*in)[i], &(*out)[i], s); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
out.Webhooks = nil
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Convert_admissionregistration_ValidatingWebhookConfiguration_To_v1_ValidatingWebhookConfiguration is an autogenerated conversion function.
|
||||||
|
func Convert_admissionregistration_ValidatingWebhookConfiguration_To_v1_ValidatingWebhookConfiguration(in *admissionregistration.ValidatingWebhookConfiguration, out *v1.ValidatingWebhookConfiguration, s conversion.Scope) error {
|
||||||
|
return autoConvert_admissionregistration_ValidatingWebhookConfiguration_To_v1_ValidatingWebhookConfiguration(in, out, s)
|
||||||
|
}
|
||||||
|
|
||||||
|
func autoConvert_v1_ValidatingWebhookConfigurationList_To_admissionregistration_ValidatingWebhookConfigurationList(in *v1.ValidatingWebhookConfigurationList, out *admissionregistration.ValidatingWebhookConfigurationList, s conversion.Scope) error {
|
||||||
|
out.ListMeta = in.ListMeta
|
||||||
|
if in.Items != nil {
|
||||||
|
in, out := &in.Items, &out.Items
|
||||||
|
*out = make([]admissionregistration.ValidatingWebhookConfiguration, len(*in))
|
||||||
|
for i := range *in {
|
||||||
|
if err := Convert_v1_ValidatingWebhookConfiguration_To_admissionregistration_ValidatingWebhookConfiguration(&(*in)[i], &(*out)[i], s); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
out.Items = nil
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Convert_v1_ValidatingWebhookConfigurationList_To_admissionregistration_ValidatingWebhookConfigurationList is an autogenerated conversion function.
|
||||||
|
func Convert_v1_ValidatingWebhookConfigurationList_To_admissionregistration_ValidatingWebhookConfigurationList(in *v1.ValidatingWebhookConfigurationList, out *admissionregistration.ValidatingWebhookConfigurationList, s conversion.Scope) error {
|
||||||
|
return autoConvert_v1_ValidatingWebhookConfigurationList_To_admissionregistration_ValidatingWebhookConfigurationList(in, out, s)
|
||||||
|
}
|
||||||
|
|
||||||
|
func autoConvert_admissionregistration_ValidatingWebhookConfigurationList_To_v1_ValidatingWebhookConfigurationList(in *admissionregistration.ValidatingWebhookConfigurationList, out *v1.ValidatingWebhookConfigurationList, s conversion.Scope) error {
|
||||||
|
out.ListMeta = in.ListMeta
|
||||||
|
if in.Items != nil {
|
||||||
|
in, out := &in.Items, &out.Items
|
||||||
|
*out = make([]v1.ValidatingWebhookConfiguration, len(*in))
|
||||||
|
for i := range *in {
|
||||||
|
if err := Convert_admissionregistration_ValidatingWebhookConfiguration_To_v1_ValidatingWebhookConfiguration(&(*in)[i], &(*out)[i], s); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
out.Items = nil
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Convert_admissionregistration_ValidatingWebhookConfigurationList_To_v1_ValidatingWebhookConfigurationList is an autogenerated conversion function.
|
||||||
|
func Convert_admissionregistration_ValidatingWebhookConfigurationList_To_v1_ValidatingWebhookConfigurationList(in *admissionregistration.ValidatingWebhookConfigurationList, out *v1.ValidatingWebhookConfigurationList, s conversion.Scope) error {
|
||||||
|
return autoConvert_admissionregistration_ValidatingWebhookConfigurationList_To_v1_ValidatingWebhookConfigurationList(in, out, s)
|
||||||
|
}
|
||||||
|
|
||||||
|
func autoConvert_v1_WebhookClientConfig_To_admissionregistration_WebhookClientConfig(in *v1.WebhookClientConfig, out *admissionregistration.WebhookClientConfig, s conversion.Scope) error {
|
||||||
|
out.URL = (*string)(unsafe.Pointer(in.URL))
|
||||||
|
if in.Service != nil {
|
||||||
|
in, out := &in.Service, &out.Service
|
||||||
|
*out = new(admissionregistration.ServiceReference)
|
||||||
|
if err := Convert_v1_ServiceReference_To_admissionregistration_ServiceReference(*in, *out, s); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
out.Service = nil
|
||||||
|
}
|
||||||
|
out.CABundle = *(*[]byte)(unsafe.Pointer(&in.CABundle))
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Convert_v1_WebhookClientConfig_To_admissionregistration_WebhookClientConfig is an autogenerated conversion function.
|
||||||
|
func Convert_v1_WebhookClientConfig_To_admissionregistration_WebhookClientConfig(in *v1.WebhookClientConfig, out *admissionregistration.WebhookClientConfig, s conversion.Scope) error {
|
||||||
|
return autoConvert_v1_WebhookClientConfig_To_admissionregistration_WebhookClientConfig(in, out, s)
|
||||||
|
}
|
||||||
|
|
||||||
|
func autoConvert_admissionregistration_WebhookClientConfig_To_v1_WebhookClientConfig(in *admissionregistration.WebhookClientConfig, out *v1.WebhookClientConfig, s conversion.Scope) error {
|
||||||
|
out.URL = (*string)(unsafe.Pointer(in.URL))
|
||||||
|
if in.Service != nil {
|
||||||
|
in, out := &in.Service, &out.Service
|
||||||
|
*out = new(v1.ServiceReference)
|
||||||
|
if err := Convert_admissionregistration_ServiceReference_To_v1_ServiceReference(*in, *out, s); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
out.Service = nil
|
||||||
|
}
|
||||||
|
out.CABundle = *(*[]byte)(unsafe.Pointer(&in.CABundle))
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Convert_admissionregistration_WebhookClientConfig_To_v1_WebhookClientConfig is an autogenerated conversion function.
|
||||||
|
func Convert_admissionregistration_WebhookClientConfig_To_v1_WebhookClientConfig(in *admissionregistration.WebhookClientConfig, out *v1.WebhookClientConfig, s conversion.Scope) error {
|
||||||
|
return autoConvert_admissionregistration_WebhookClientConfig_To_v1_WebhookClientConfig(in, out, s)
|
||||||
|
}
|
87
pkg/apis/admissionregistration/v1/zz_generated.defaults.go
generated
Normal file
87
pkg/apis/admissionregistration/v1/zz_generated.defaults.go
generated
Normal file
@ -0,0 +1,87 @@
|
|||||||
|
// +build !ignore_autogenerated
|
||||||
|
|
||||||
|
/*
|
||||||
|
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 defaulter-gen. DO NOT EDIT.
|
||||||
|
|
||||||
|
package v1
|
||||||
|
|
||||||
|
import (
|
||||||
|
v1 "k8s.io/api/admissionregistration/v1"
|
||||||
|
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||||
|
)
|
||||||
|
|
||||||
|
// RegisterDefaults adds defaulters functions to the given scheme.
|
||||||
|
// Public to allow building arbitrary schemes.
|
||||||
|
// All generated defaulters are covering - they call all nested defaulters.
|
||||||
|
func RegisterDefaults(scheme *runtime.Scheme) error {
|
||||||
|
scheme.AddTypeDefaultingFunc(&v1.MutatingWebhookConfiguration{}, func(obj interface{}) {
|
||||||
|
SetObjectDefaults_MutatingWebhookConfiguration(obj.(*v1.MutatingWebhookConfiguration))
|
||||||
|
})
|
||||||
|
scheme.AddTypeDefaultingFunc(&v1.MutatingWebhookConfigurationList{}, func(obj interface{}) {
|
||||||
|
SetObjectDefaults_MutatingWebhookConfigurationList(obj.(*v1.MutatingWebhookConfigurationList))
|
||||||
|
})
|
||||||
|
scheme.AddTypeDefaultingFunc(&v1.ValidatingWebhookConfiguration{}, func(obj interface{}) {
|
||||||
|
SetObjectDefaults_ValidatingWebhookConfiguration(obj.(*v1.ValidatingWebhookConfiguration))
|
||||||
|
})
|
||||||
|
scheme.AddTypeDefaultingFunc(&v1.ValidatingWebhookConfigurationList{}, func(obj interface{}) {
|
||||||
|
SetObjectDefaults_ValidatingWebhookConfigurationList(obj.(*v1.ValidatingWebhookConfigurationList))
|
||||||
|
})
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func SetObjectDefaults_MutatingWebhookConfiguration(in *v1.MutatingWebhookConfiguration) {
|
||||||
|
for i := range in.Webhooks {
|
||||||
|
a := &in.Webhooks[i]
|
||||||
|
SetDefaults_MutatingWebhook(a)
|
||||||
|
if a.ClientConfig.Service != nil {
|
||||||
|
SetDefaults_ServiceReference(a.ClientConfig.Service)
|
||||||
|
}
|
||||||
|
for j := range a.Rules {
|
||||||
|
b := &a.Rules[j]
|
||||||
|
SetDefaults_Rule(&b.Rule)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func SetObjectDefaults_MutatingWebhookConfigurationList(in *v1.MutatingWebhookConfigurationList) {
|
||||||
|
for i := range in.Items {
|
||||||
|
a := &in.Items[i]
|
||||||
|
SetObjectDefaults_MutatingWebhookConfiguration(a)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func SetObjectDefaults_ValidatingWebhookConfiguration(in *v1.ValidatingWebhookConfiguration) {
|
||||||
|
for i := range in.Webhooks {
|
||||||
|
a := &in.Webhooks[i]
|
||||||
|
SetDefaults_ValidatingWebhook(a)
|
||||||
|
if a.ClientConfig.Service != nil {
|
||||||
|
SetDefaults_ServiceReference(a.ClientConfig.Service)
|
||||||
|
}
|
||||||
|
for j := range a.Rules {
|
||||||
|
b := &a.Rules[j]
|
||||||
|
SetDefaults_Rule(&b.Rule)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func SetObjectDefaults_ValidatingWebhookConfigurationList(in *v1.ValidatingWebhookConfigurationList) {
|
||||||
|
for i := range in.Items {
|
||||||
|
a := &in.Items[i]
|
||||||
|
SetObjectDefaults_ValidatingWebhookConfiguration(a)
|
||||||
|
}
|
||||||
|
}
|
@ -1,9 +1,6 @@
|
|||||||
package(default_visibility = ["//visibility:public"])
|
package(default_visibility = ["//visibility:public"])
|
||||||
|
|
||||||
load(
|
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
|
||||||
"@io_bazel_rules_go//go:def.bzl",
|
|
||||||
"go_library",
|
|
||||||
)
|
|
||||||
|
|
||||||
go_library(
|
go_library(
|
||||||
name = "go_default_library",
|
name = "go_default_library",
|
||||||
@ -38,3 +35,19 @@ filegroup(
|
|||||||
srcs = [":package-srcs"],
|
srcs = [":package-srcs"],
|
||||||
tags = ["automanaged"],
|
tags = ["automanaged"],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
go_test(
|
||||||
|
name = "go_default_test",
|
||||||
|
srcs = ["defaults_test.go"],
|
||||||
|
embed = [":go_default_library"],
|
||||||
|
deps = [
|
||||||
|
"//pkg/api/legacyscheme:go_default_library",
|
||||||
|
"//pkg/apis/admissionregistration/install:go_default_library",
|
||||||
|
"//staging/src/k8s.io/api/admissionregistration/v1beta1:go_default_library",
|
||||||
|
"//staging/src/k8s.io/apimachinery/pkg/api/equality:go_default_library",
|
||||||
|
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
|
||||||
|
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
|
||||||
|
"//vendor/github.com/google/go-cmp/cmp:go_default_library",
|
||||||
|
"//vendor/k8s.io/utils/pointer:go_default_library",
|
||||||
|
],
|
||||||
|
)
|
||||||
|
143
pkg/apis/admissionregistration/v1beta1/defaults_test.go
Normal file
143
pkg/apis/admissionregistration/v1beta1/defaults_test.go
Normal file
@ -0,0 +1,143 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2019 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package v1beta1_test
|
||||||
|
|
||||||
|
import (
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"github.com/google/go-cmp/cmp"
|
||||||
|
|
||||||
|
v1beta1 "k8s.io/api/admissionregistration/v1beta1"
|
||||||
|
apiequality "k8s.io/apimachinery/pkg/api/equality"
|
||||||
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
"k8s.io/apimachinery/pkg/runtime"
|
||||||
|
"k8s.io/kubernetes/pkg/api/legacyscheme"
|
||||||
|
_ "k8s.io/kubernetes/pkg/apis/admissionregistration/install"
|
||||||
|
utilpointer "k8s.io/utils/pointer"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestDefaultAdmissionWebhook(t *testing.T) {
|
||||||
|
ignore := v1beta1.Ignore
|
||||||
|
exact := v1beta1.Exact
|
||||||
|
never := v1beta1.NeverReinvocationPolicy
|
||||||
|
thirty := int32(30)
|
||||||
|
allScopes := v1beta1.AllScopes
|
||||||
|
unknown := v1beta1.SideEffectClassUnknown
|
||||||
|
|
||||||
|
tests := []struct {
|
||||||
|
name string
|
||||||
|
original runtime.Object
|
||||||
|
expected runtime.Object
|
||||||
|
}{
|
||||||
|
{
|
||||||
|
name: "ValidatingWebhookConfiguration",
|
||||||
|
original: &v1beta1.ValidatingWebhookConfiguration{
|
||||||
|
Webhooks: []v1beta1.ValidatingWebhook{{}},
|
||||||
|
},
|
||||||
|
expected: &v1beta1.ValidatingWebhookConfiguration{
|
||||||
|
Webhooks: []v1beta1.ValidatingWebhook{{
|
||||||
|
FailurePolicy: &ignore,
|
||||||
|
MatchPolicy: &exact,
|
||||||
|
TimeoutSeconds: &thirty,
|
||||||
|
NamespaceSelector: &metav1.LabelSelector{},
|
||||||
|
ObjectSelector: &metav1.LabelSelector{},
|
||||||
|
SideEffects: &unknown,
|
||||||
|
AdmissionReviewVersions: []string{"v1beta1"},
|
||||||
|
}},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "MutatingWebhookConfiguration",
|
||||||
|
original: &v1beta1.MutatingWebhookConfiguration{
|
||||||
|
Webhooks: []v1beta1.MutatingWebhook{{}},
|
||||||
|
},
|
||||||
|
expected: &v1beta1.MutatingWebhookConfiguration{
|
||||||
|
Webhooks: []v1beta1.MutatingWebhook{{
|
||||||
|
FailurePolicy: &ignore,
|
||||||
|
MatchPolicy: &exact,
|
||||||
|
ReinvocationPolicy: &never,
|
||||||
|
TimeoutSeconds: &thirty,
|
||||||
|
NamespaceSelector: &metav1.LabelSelector{},
|
||||||
|
ObjectSelector: &metav1.LabelSelector{},
|
||||||
|
SideEffects: &unknown,
|
||||||
|
AdmissionReviewVersions: []string{"v1beta1"},
|
||||||
|
}},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "scope=*",
|
||||||
|
original: &v1beta1.MutatingWebhookConfiguration{
|
||||||
|
Webhooks: []v1beta1.MutatingWebhook{{
|
||||||
|
Rules: []v1beta1.RuleWithOperations{{}},
|
||||||
|
}},
|
||||||
|
},
|
||||||
|
expected: &v1beta1.MutatingWebhookConfiguration{
|
||||||
|
Webhooks: []v1beta1.MutatingWebhook{{
|
||||||
|
Rules: []v1beta1.RuleWithOperations{{Rule: v1beta1.Rule{
|
||||||
|
Scope: &allScopes, // defaulted
|
||||||
|
}}},
|
||||||
|
FailurePolicy: &ignore,
|
||||||
|
MatchPolicy: &exact,
|
||||||
|
ReinvocationPolicy: &never,
|
||||||
|
TimeoutSeconds: &thirty,
|
||||||
|
NamespaceSelector: &metav1.LabelSelector{},
|
||||||
|
ObjectSelector: &metav1.LabelSelector{},
|
||||||
|
SideEffects: &unknown,
|
||||||
|
AdmissionReviewVersions: []string{"v1beta1"},
|
||||||
|
}},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "port=443",
|
||||||
|
original: &v1beta1.MutatingWebhookConfiguration{
|
||||||
|
Webhooks: []v1beta1.MutatingWebhook{{
|
||||||
|
ClientConfig: v1beta1.WebhookClientConfig{
|
||||||
|
Service: &v1beta1.ServiceReference{},
|
||||||
|
},
|
||||||
|
}},
|
||||||
|
},
|
||||||
|
expected: &v1beta1.MutatingWebhookConfiguration{
|
||||||
|
Webhooks: []v1beta1.MutatingWebhook{{
|
||||||
|
ClientConfig: v1beta1.WebhookClientConfig{
|
||||||
|
Service: &v1beta1.ServiceReference{
|
||||||
|
Port: utilpointer.Int32Ptr(443), // defaulted
|
||||||
|
},
|
||||||
|
},
|
||||||
|
FailurePolicy: &ignore,
|
||||||
|
MatchPolicy: &exact,
|
||||||
|
ReinvocationPolicy: &never,
|
||||||
|
TimeoutSeconds: &thirty,
|
||||||
|
NamespaceSelector: &metav1.LabelSelector{},
|
||||||
|
ObjectSelector: &metav1.LabelSelector{},
|
||||||
|
SideEffects: &unknown,
|
||||||
|
AdmissionReviewVersions: []string{"v1beta1"},
|
||||||
|
}},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, test := range tests {
|
||||||
|
t.Run(test.name, func(t *testing.T) {
|
||||||
|
original := test.original
|
||||||
|
expected := test.expected
|
||||||
|
legacyscheme.Scheme.Default(original)
|
||||||
|
if !apiequality.Semantic.DeepEqual(original, expected) {
|
||||||
|
t.Error(cmp.Diff(expected, original))
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
@ -13,6 +13,7 @@ go_test(
|
|||||||
deps = [
|
deps = [
|
||||||
"//pkg/apis/admissionregistration:go_default_library",
|
"//pkg/apis/admissionregistration:go_default_library",
|
||||||
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
|
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
|
||||||
|
"//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -25,6 +26,7 @@ go_library(
|
|||||||
"//pkg/apis/admissionregistration/v1beta1:go_default_library",
|
"//pkg/apis/admissionregistration/v1beta1:go_default_library",
|
||||||
"//staging/src/k8s.io/apimachinery/pkg/api/validation:go_default_library",
|
"//staging/src/k8s.io/apimachinery/pkg/api/validation:go_default_library",
|
||||||
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/validation:go_default_library",
|
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/validation:go_default_library",
|
||||||
|
"//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library",
|
||||||
"//staging/src/k8s.io/apimachinery/pkg/util/sets:go_default_library",
|
"//staging/src/k8s.io/apimachinery/pkg/util/sets:go_default_library",
|
||||||
"//staging/src/k8s.io/apimachinery/pkg/util/validation:go_default_library",
|
"//staging/src/k8s.io/apimachinery/pkg/util/validation:go_default_library",
|
||||||
"//staging/src/k8s.io/apimachinery/pkg/util/validation/field:go_default_library",
|
"//staging/src/k8s.io/apimachinery/pkg/util/validation/field:go_default_library",
|
||||||
|
@ -22,6 +22,7 @@ import (
|
|||||||
|
|
||||||
genericvalidation "k8s.io/apimachinery/pkg/api/validation"
|
genericvalidation "k8s.io/apimachinery/pkg/api/validation"
|
||||||
metav1validation "k8s.io/apimachinery/pkg/apis/meta/v1/validation"
|
metav1validation "k8s.io/apimachinery/pkg/apis/meta/v1/validation"
|
||||||
|
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||||
"k8s.io/apimachinery/pkg/util/sets"
|
"k8s.io/apimachinery/pkg/util/sets"
|
||||||
utilvalidation "k8s.io/apimachinery/pkg/util/validation"
|
utilvalidation "k8s.io/apimachinery/pkg/util/validation"
|
||||||
"k8s.io/apimachinery/pkg/util/validation/field"
|
"k8s.io/apimachinery/pkg/util/validation/field"
|
||||||
@ -167,7 +168,7 @@ func validateAdmissionReviewVersions(versions []string, requireRecognizedVersion
|
|||||||
|
|
||||||
// Currently only v1beta1 accepted in AdmissionReviewVersions
|
// Currently only v1beta1 accepted in AdmissionReviewVersions
|
||||||
if len(versions) < 1 {
|
if len(versions) < 1 {
|
||||||
allErrors = append(allErrors, field.Required(fldPath, ""))
|
allErrors = append(allErrors, field.Required(fldPath, fmt.Sprintf("must specify one of %v", strings.Join(AcceptedAdmissionReviewVersions, ", "))))
|
||||||
} else {
|
} else {
|
||||||
seen := map[string]bool{}
|
seen := map[string]bool{}
|
||||||
hasAcceptedVersion := false
|
hasAcceptedVersion := false
|
||||||
@ -194,28 +195,44 @@ func validateAdmissionReviewVersions(versions []string, requireRecognizedVersion
|
|||||||
return allErrors
|
return allErrors
|
||||||
}
|
}
|
||||||
|
|
||||||
func ValidateValidatingWebhookConfiguration(e *admissionregistration.ValidatingWebhookConfiguration) field.ErrorList {
|
// ValidateValidatingWebhookConfiguration validates a webhook before creation.
|
||||||
return validateValidatingWebhookConfiguration(e, true)
|
func ValidateValidatingWebhookConfiguration(e *admissionregistration.ValidatingWebhookConfiguration, requestGV schema.GroupVersion) field.ErrorList {
|
||||||
|
return validateValidatingWebhookConfiguration(e, true, requireUniqueWebhookNames(requestGV))
|
||||||
}
|
}
|
||||||
|
|
||||||
func validateValidatingWebhookConfiguration(e *admissionregistration.ValidatingWebhookConfiguration, requireRecognizedVersion bool) field.ErrorList {
|
func validateValidatingWebhookConfiguration(e *admissionregistration.ValidatingWebhookConfiguration, requireRecognizedVersion, requireUniqueWebhookNames bool) field.ErrorList {
|
||||||
allErrors := genericvalidation.ValidateObjectMeta(&e.ObjectMeta, false, genericvalidation.NameIsDNSSubdomain, field.NewPath("metadata"))
|
allErrors := genericvalidation.ValidateObjectMeta(&e.ObjectMeta, false, genericvalidation.NameIsDNSSubdomain, field.NewPath("metadata"))
|
||||||
|
hookNames := sets.NewString()
|
||||||
for i, hook := range e.Webhooks {
|
for i, hook := range e.Webhooks {
|
||||||
allErrors = append(allErrors, validateValidatingWebhook(&hook, field.NewPath("webhooks").Index(i))...)
|
allErrors = append(allErrors, validateValidatingWebhook(&hook, field.NewPath("webhooks").Index(i))...)
|
||||||
allErrors = append(allErrors, validateAdmissionReviewVersions(hook.AdmissionReviewVersions, requireRecognizedVersion, field.NewPath("webhooks").Index(i).Child("admissionReviewVersions"))...)
|
allErrors = append(allErrors, validateAdmissionReviewVersions(hook.AdmissionReviewVersions, requireRecognizedVersion, field.NewPath("webhooks").Index(i).Child("admissionReviewVersions"))...)
|
||||||
|
if requireUniqueWebhookNames && len(hook.Name) > 0 {
|
||||||
|
if hookNames.Has(hook.Name) {
|
||||||
|
allErrors = append(allErrors, field.Duplicate(field.NewPath("webhooks").Index(i).Child("name"), hook.Name))
|
||||||
|
}
|
||||||
|
hookNames.Insert(hook.Name)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return allErrors
|
return allErrors
|
||||||
}
|
}
|
||||||
|
|
||||||
func ValidateMutatingWebhookConfiguration(e *admissionregistration.MutatingWebhookConfiguration) field.ErrorList {
|
// ValidateMutatingWebhookConfiguration validates a webhook before creation.
|
||||||
return validateMutatingWebhookConfiguration(e, true)
|
func ValidateMutatingWebhookConfiguration(e *admissionregistration.MutatingWebhookConfiguration, requestGV schema.GroupVersion) field.ErrorList {
|
||||||
|
return validateMutatingWebhookConfiguration(e, true, requireUniqueWebhookNames(requestGV))
|
||||||
}
|
}
|
||||||
|
|
||||||
func validateMutatingWebhookConfiguration(e *admissionregistration.MutatingWebhookConfiguration, requireRecognizedVersion bool) field.ErrorList {
|
func validateMutatingWebhookConfiguration(e *admissionregistration.MutatingWebhookConfiguration, requireRecognizedVersion, requireUniqueWebhookNames bool) field.ErrorList {
|
||||||
allErrors := genericvalidation.ValidateObjectMeta(&e.ObjectMeta, false, genericvalidation.NameIsDNSSubdomain, field.NewPath("metadata"))
|
allErrors := genericvalidation.ValidateObjectMeta(&e.ObjectMeta, false, genericvalidation.NameIsDNSSubdomain, field.NewPath("metadata"))
|
||||||
|
hookNames := sets.NewString()
|
||||||
for i, hook := range e.Webhooks {
|
for i, hook := range e.Webhooks {
|
||||||
allErrors = append(allErrors, validateMutatingWebhook(&hook, field.NewPath("webhooks").Index(i))...)
|
allErrors = append(allErrors, validateMutatingWebhook(&hook, field.NewPath("webhooks").Index(i))...)
|
||||||
allErrors = append(allErrors, validateAdmissionReviewVersions(hook.AdmissionReviewVersions, requireRecognizedVersion, field.NewPath("webhooks").Index(i).Child("admissionReviewVersions"))...)
|
allErrors = append(allErrors, validateAdmissionReviewVersions(hook.AdmissionReviewVersions, requireRecognizedVersion, field.NewPath("webhooks").Index(i).Child("admissionReviewVersions"))...)
|
||||||
|
if requireUniqueWebhookNames && len(hook.Name) > 0 {
|
||||||
|
if hookNames.Has(hook.Name) {
|
||||||
|
allErrors = append(allErrors, field.Duplicate(field.NewPath("webhooks").Index(i).Child("name"), hook.Name))
|
||||||
|
}
|
||||||
|
hookNames.Insert(hook.Name)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return allErrors
|
return allErrors
|
||||||
}
|
}
|
||||||
@ -234,6 +251,9 @@ func validateValidatingWebhook(hook *admissionregistration.ValidatingWebhook, fl
|
|||||||
if hook.MatchPolicy != nil && !supportedMatchPolicies.Has(string(*hook.MatchPolicy)) {
|
if hook.MatchPolicy != nil && !supportedMatchPolicies.Has(string(*hook.MatchPolicy)) {
|
||||||
allErrors = append(allErrors, field.NotSupported(fldPath.Child("matchPolicy"), *hook.MatchPolicy, supportedMatchPolicies.List()))
|
allErrors = append(allErrors, field.NotSupported(fldPath.Child("matchPolicy"), *hook.MatchPolicy, supportedMatchPolicies.List()))
|
||||||
}
|
}
|
||||||
|
if hook.SideEffects == nil {
|
||||||
|
allErrors = append(allErrors, field.Required(fldPath.Child("sideEffects"), fmt.Sprintf("must specify one of %v", strings.Join(supportedSideEffectClasses.List(), ", "))))
|
||||||
|
}
|
||||||
if hook.SideEffects != nil && !supportedSideEffectClasses.Has(string(*hook.SideEffects)) {
|
if hook.SideEffects != nil && !supportedSideEffectClasses.Has(string(*hook.SideEffects)) {
|
||||||
allErrors = append(allErrors, field.NotSupported(fldPath.Child("sideEffects"), *hook.SideEffects, supportedSideEffectClasses.List()))
|
allErrors = append(allErrors, field.NotSupported(fldPath.Child("sideEffects"), *hook.SideEffects, supportedSideEffectClasses.List()))
|
||||||
}
|
}
|
||||||
@ -275,6 +295,9 @@ func validateMutatingWebhook(hook *admissionregistration.MutatingWebhook, fldPat
|
|||||||
if hook.MatchPolicy != nil && !supportedMatchPolicies.Has(string(*hook.MatchPolicy)) {
|
if hook.MatchPolicy != nil && !supportedMatchPolicies.Has(string(*hook.MatchPolicy)) {
|
||||||
allErrors = append(allErrors, field.NotSupported(fldPath.Child("matchPolicy"), *hook.MatchPolicy, supportedMatchPolicies.List()))
|
allErrors = append(allErrors, field.NotSupported(fldPath.Child("matchPolicy"), *hook.MatchPolicy, supportedMatchPolicies.List()))
|
||||||
}
|
}
|
||||||
|
if hook.SideEffects == nil {
|
||||||
|
allErrors = append(allErrors, field.Required(fldPath.Child("sideEffects"), fmt.Sprintf("must specify one of %v", strings.Join(supportedSideEffectClasses.List(), ", "))))
|
||||||
|
}
|
||||||
if hook.SideEffects != nil && !supportedSideEffectClasses.Has(string(*hook.SideEffects)) {
|
if hook.SideEffects != nil && !supportedSideEffectClasses.Has(string(*hook.SideEffects)) {
|
||||||
allErrors = append(allErrors, field.NotSupported(fldPath.Child("sideEffects"), *hook.SideEffects, supportedSideEffectClasses.List()))
|
allErrors = append(allErrors, field.NotSupported(fldPath.Child("sideEffects"), *hook.SideEffects, supportedSideEffectClasses.List()))
|
||||||
}
|
}
|
||||||
@ -397,10 +420,47 @@ func validatingHasAcceptedAdmissionReviewVersions(webhooks []admissionregistrati
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
func ValidateValidatingWebhookConfigurationUpdate(newC, oldC *admissionregistration.ValidatingWebhookConfiguration) field.ErrorList {
|
// mutatingHasUniqueWebhookNames returns true if all webhooks have unique names
|
||||||
return validateValidatingWebhookConfiguration(newC, validatingHasAcceptedAdmissionReviewVersions(oldC.Webhooks))
|
func mutatingHasUniqueWebhookNames(webhooks []admissionregistration.MutatingWebhook) bool {
|
||||||
|
names := sets.NewString()
|
||||||
|
for _, hook := range webhooks {
|
||||||
|
if names.Has(hook.Name) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
names.Insert(hook.Name)
|
||||||
|
}
|
||||||
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
func ValidateMutatingWebhookConfigurationUpdate(newC, oldC *admissionregistration.MutatingWebhookConfiguration) field.ErrorList {
|
// validatingHasUniqueWebhookNames returns true if all webhooks have unique names
|
||||||
return validateMutatingWebhookConfiguration(newC, mutatingHasAcceptedAdmissionReviewVersions(oldC.Webhooks))
|
func validatingHasUniqueWebhookNames(webhooks []admissionregistration.ValidatingWebhook) bool {
|
||||||
|
names := sets.NewString()
|
||||||
|
for _, hook := range webhooks {
|
||||||
|
if names.Has(hook.Name) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
names.Insert(hook.Name)
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
func ValidateValidatingWebhookConfigurationUpdate(newC, oldC *admissionregistration.ValidatingWebhookConfiguration, requestGV schema.GroupVersion) field.ErrorList {
|
||||||
|
return validateValidatingWebhookConfiguration(
|
||||||
|
newC,
|
||||||
|
validatingHasAcceptedAdmissionReviewVersions(oldC.Webhooks),
|
||||||
|
requireUniqueWebhookNames(requestGV) && validatingHasUniqueWebhookNames(oldC.Webhooks),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
func ValidateMutatingWebhookConfigurationUpdate(newC, oldC *admissionregistration.MutatingWebhookConfiguration, requestGV schema.GroupVersion) field.ErrorList {
|
||||||
|
return validateMutatingWebhookConfiguration(
|
||||||
|
newC,
|
||||||
|
mutatingHasAcceptedAdmissionReviewVersions(oldC.Webhooks),
|
||||||
|
requireUniqueWebhookNames(requestGV) && mutatingHasUniqueWebhookNames(oldC.Webhooks),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
// requireUniqueWebhookNames returns true for all requests except v1beta1 (for backwards compatibility)
|
||||||
|
func requireUniqueWebhookNames(requestGV schema.GroupVersion) bool {
|
||||||
|
return requestGV != (schema.GroupVersion{Group: admissionregistration.GroupName, Version: "v1beta1"})
|
||||||
}
|
}
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -77,6 +77,7 @@
|
|||||||
"k8s.io/api/batch/v2alpha1",
|
"k8s.io/api/batch/v2alpha1",
|
||||||
"k8s.io/apiserver/pkg/registry/rest",
|
"k8s.io/apiserver/pkg/registry/rest",
|
||||||
"k8s.io/api/scheduling/v1alpha1",
|
"k8s.io/api/scheduling/v1alpha1",
|
||||||
|
"k8s.io/api/admissionregistration/v1",
|
||||||
"k8s.io/api/admissionregistration/v1beta1",
|
"k8s.io/api/admissionregistration/v1beta1",
|
||||||
"k8s.io/api/authorization/v1",
|
"k8s.io/api/authorization/v1",
|
||||||
"k8s.io/api/settings/v1alpha1",
|
"k8s.io/api/settings/v1alpha1",
|
||||||
|
@ -10,6 +10,7 @@ go_library(
|
|||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
deps = [
|
deps = [
|
||||||
"//staging/src/k8s.io/api/admission/v1beta1:go_default_library",
|
"//staging/src/k8s.io/api/admission/v1beta1:go_default_library",
|
||||||
|
"//staging/src/k8s.io/api/admissionregistration/v1:go_default_library",
|
||||||
"//staging/src/k8s.io/api/admissionregistration/v1beta1:go_default_library",
|
"//staging/src/k8s.io/api/admissionregistration/v1beta1:go_default_library",
|
||||||
"//staging/src/k8s.io/api/apps/v1:go_default_library",
|
"//staging/src/k8s.io/api/apps/v1:go_default_library",
|
||||||
"//staging/src/k8s.io/api/apps/v1beta1:go_default_library",
|
"//staging/src/k8s.io/api/apps/v1beta1:go_default_library",
|
||||||
|
@ -18,6 +18,7 @@ package scheme
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
admissionv1alpha1 "k8s.io/api/admission/v1beta1"
|
admissionv1alpha1 "k8s.io/api/admission/v1beta1"
|
||||||
|
admissionregistrationv1 "k8s.io/api/admissionregistration/v1"
|
||||||
admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1"
|
admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1"
|
||||||
appsv1 "k8s.io/api/apps/v1"
|
appsv1 "k8s.io/api/apps/v1"
|
||||||
appsv1beta1 "k8s.io/api/apps/v1beta1"
|
appsv1beta1 "k8s.io/api/apps/v1beta1"
|
||||||
@ -63,7 +64,7 @@ func init() {
|
|||||||
|
|
||||||
utilruntime.Must(Scheme.SetVersionPriority(corev1.SchemeGroupVersion))
|
utilruntime.Must(Scheme.SetVersionPriority(corev1.SchemeGroupVersion))
|
||||||
utilruntime.Must(Scheme.SetVersionPriority(admissionv1alpha1.SchemeGroupVersion))
|
utilruntime.Must(Scheme.SetVersionPriority(admissionv1alpha1.SchemeGroupVersion))
|
||||||
utilruntime.Must(Scheme.SetVersionPriority(admissionregistrationv1beta1.SchemeGroupVersion))
|
utilruntime.Must(Scheme.SetVersionPriority(admissionregistrationv1beta1.SchemeGroupVersion, admissionregistrationv1.SchemeGroupVersion))
|
||||||
utilruntime.Must(Scheme.SetVersionPriority(appsv1beta1.SchemeGroupVersion, appsv1beta2.SchemeGroupVersion, appsv1.SchemeGroupVersion))
|
utilruntime.Must(Scheme.SetVersionPriority(appsv1beta1.SchemeGroupVersion, appsv1beta2.SchemeGroupVersion, appsv1.SchemeGroupVersion))
|
||||||
utilruntime.Must(Scheme.SetVersionPriority(authenticationv1.SchemeGroupVersion, authenticationv1beta1.SchemeGroupVersion))
|
utilruntime.Must(Scheme.SetVersionPriority(authenticationv1.SchemeGroupVersion, authenticationv1beta1.SchemeGroupVersion))
|
||||||
utilruntime.Must(Scheme.SetVersionPriority(authorizationv1.SchemeGroupVersion, authorizationv1beta1.SchemeGroupVersion))
|
utilruntime.Must(Scheme.SetVersionPriority(authorizationv1.SchemeGroupVersion, authorizationv1beta1.SchemeGroupVersion))
|
||||||
|
@ -68,6 +68,7 @@ go_library(
|
|||||||
"//pkg/serviceaccount:go_default_library",
|
"//pkg/serviceaccount:go_default_library",
|
||||||
"//pkg/util/async:go_default_library",
|
"//pkg/util/async:go_default_library",
|
||||||
"//pkg/util/node:go_default_library",
|
"//pkg/util/node:go_default_library",
|
||||||
|
"//staging/src/k8s.io/api/admissionregistration/v1:go_default_library",
|
||||||
"//staging/src/k8s.io/api/admissionregistration/v1beta1:go_default_library",
|
"//staging/src/k8s.io/api/admissionregistration/v1beta1:go_default_library",
|
||||||
"//staging/src/k8s.io/api/apps/v1:go_default_library",
|
"//staging/src/k8s.io/api/apps/v1:go_default_library",
|
||||||
"//staging/src/k8s.io/api/apps/v1beta1:go_default_library",
|
"//staging/src/k8s.io/api/apps/v1beta1:go_default_library",
|
||||||
|
@ -24,6 +24,7 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
admissionregistrationv1 "k8s.io/api/admissionregistration/v1"
|
||||||
admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1"
|
admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1"
|
||||||
appsv1 "k8s.io/api/apps/v1"
|
appsv1 "k8s.io/api/apps/v1"
|
||||||
appsv1beta1 "k8s.io/api/apps/v1beta1"
|
appsv1beta1 "k8s.io/api/apps/v1beta1"
|
||||||
@ -479,6 +480,7 @@ func DefaultAPIResourceConfigSource() *serverstorage.ResourceConfig {
|
|||||||
ret := serverstorage.NewResourceConfig()
|
ret := serverstorage.NewResourceConfig()
|
||||||
// NOTE: GroupVersions listed here will be enabled by default. Don't put alpha versions in the list.
|
// NOTE: GroupVersions listed here will be enabled by default. Don't put alpha versions in the list.
|
||||||
ret.EnableVersions(
|
ret.EnableVersions(
|
||||||
|
admissionregistrationv1.SchemeGroupVersion,
|
||||||
admissionregistrationv1beta1.SchemeGroupVersion,
|
admissionregistrationv1beta1.SchemeGroupVersion,
|
||||||
apiv1.SchemeGroupVersion,
|
apiv1.SchemeGroupVersion,
|
||||||
appsv1.SchemeGroupVersion,
|
appsv1.SchemeGroupVersion,
|
||||||
|
@ -94,5 +94,7 @@ var GVRToStorageVersionHash = map[string]string{
|
|||||||
"apps/v1/statefulsets": "H+vl74LkKdo=",
|
"apps/v1/statefulsets": "H+vl74LkKdo=",
|
||||||
"admissionregistration.k8s.io/v1beta1/mutatingwebhookconfigurations": "yxW1cpLtfp8=",
|
"admissionregistration.k8s.io/v1beta1/mutatingwebhookconfigurations": "yxW1cpLtfp8=",
|
||||||
"admissionregistration.k8s.io/v1beta1/validatingwebhookconfigurations": "P9NhrezfnWE=",
|
"admissionregistration.k8s.io/v1beta1/validatingwebhookconfigurations": "P9NhrezfnWE=",
|
||||||
|
"admissionregistration.k8s.io/v1/mutatingwebhookconfigurations": "yxW1cpLtfp8=",
|
||||||
|
"admissionregistration.k8s.io/v1/validatingwebhookconfigurations": "P9NhrezfnWE=",
|
||||||
"events.k8s.io/v1beta1/events": "r2yiGXH7wu8=",
|
"events.k8s.io/v1beta1/events": "r2yiGXH7wu8=",
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,9 @@ go_library(
|
|||||||
"//pkg/apis/admissionregistration:go_default_library",
|
"//pkg/apis/admissionregistration:go_default_library",
|
||||||
"//pkg/apis/admissionregistration/validation:go_default_library",
|
"//pkg/apis/admissionregistration/validation:go_default_library",
|
||||||
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
|
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
|
||||||
|
"//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library",
|
||||||
"//staging/src/k8s.io/apimachinery/pkg/util/validation/field:go_default_library",
|
"//staging/src/k8s.io/apimachinery/pkg/util/validation/field:go_default_library",
|
||||||
|
"//staging/src/k8s.io/apiserver/pkg/endpoints/request:go_default_library",
|
||||||
"//staging/src/k8s.io/apiserver/pkg/storage/names:go_default_library",
|
"//staging/src/k8s.io/apiserver/pkg/storage/names:go_default_library",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
@ -21,7 +21,9 @@ import (
|
|||||||
"reflect"
|
"reflect"
|
||||||
|
|
||||||
"k8s.io/apimachinery/pkg/runtime"
|
"k8s.io/apimachinery/pkg/runtime"
|
||||||
|
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||||
"k8s.io/apimachinery/pkg/util/validation/field"
|
"k8s.io/apimachinery/pkg/util/validation/field"
|
||||||
|
genericapirequest "k8s.io/apiserver/pkg/endpoints/request"
|
||||||
"k8s.io/apiserver/pkg/storage/names"
|
"k8s.io/apiserver/pkg/storage/names"
|
||||||
"k8s.io/kubernetes/pkg/api/legacyscheme"
|
"k8s.io/kubernetes/pkg/api/legacyscheme"
|
||||||
"k8s.io/kubernetes/pkg/apis/admissionregistration"
|
"k8s.io/kubernetes/pkg/apis/admissionregistration"
|
||||||
@ -63,8 +65,13 @@ func (mutatingWebhookConfigurationStrategy) PrepareForUpdate(ctx context.Context
|
|||||||
|
|
||||||
// Validate validates a new mutatingWebhookConfiguration.
|
// Validate validates a new mutatingWebhookConfiguration.
|
||||||
func (mutatingWebhookConfigurationStrategy) Validate(ctx context.Context, obj runtime.Object) field.ErrorList {
|
func (mutatingWebhookConfigurationStrategy) Validate(ctx context.Context, obj runtime.Object) field.ErrorList {
|
||||||
|
var groupVersion schema.GroupVersion
|
||||||
|
if requestInfo, found := genericapirequest.RequestInfoFrom(ctx); found {
|
||||||
|
groupVersion = schema.GroupVersion{Group: requestInfo.APIGroup, Version: requestInfo.APIVersion}
|
||||||
|
}
|
||||||
|
|
||||||
ic := obj.(*admissionregistration.MutatingWebhookConfiguration)
|
ic := obj.(*admissionregistration.MutatingWebhookConfiguration)
|
||||||
return validation.ValidateMutatingWebhookConfiguration(ic)
|
return validation.ValidateMutatingWebhookConfiguration(ic, groupVersion)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Canonicalize normalizes the object after validation.
|
// Canonicalize normalizes the object after validation.
|
||||||
@ -78,7 +85,12 @@ func (mutatingWebhookConfigurationStrategy) AllowCreateOnUpdate() bool {
|
|||||||
|
|
||||||
// ValidateUpdate is the default update validation for an end user.
|
// ValidateUpdate is the default update validation for an end user.
|
||||||
func (mutatingWebhookConfigurationStrategy) ValidateUpdate(ctx context.Context, obj, old runtime.Object) field.ErrorList {
|
func (mutatingWebhookConfigurationStrategy) ValidateUpdate(ctx context.Context, obj, old runtime.Object) field.ErrorList {
|
||||||
return validation.ValidateMutatingWebhookConfigurationUpdate(obj.(*admissionregistration.MutatingWebhookConfiguration), old.(*admissionregistration.MutatingWebhookConfiguration))
|
var groupVersion schema.GroupVersion
|
||||||
|
if requestInfo, found := genericapirequest.RequestInfoFrom(ctx); found {
|
||||||
|
groupVersion = schema.GroupVersion{Group: requestInfo.APIGroup, Version: requestInfo.APIVersion}
|
||||||
|
}
|
||||||
|
|
||||||
|
return validation.ValidateMutatingWebhookConfigurationUpdate(obj.(*admissionregistration.MutatingWebhookConfiguration), old.(*admissionregistration.MutatingWebhookConfiguration), groupVersion)
|
||||||
}
|
}
|
||||||
|
|
||||||
// AllowUnconditionalUpdate is the default update policy for mutatingWebhookConfiguration objects. Status update should
|
// AllowUnconditionalUpdate is the default update policy for mutatingWebhookConfiguration objects. Status update should
|
||||||
|
@ -14,6 +14,7 @@ go_library(
|
|||||||
"//pkg/apis/admissionregistration:go_default_library",
|
"//pkg/apis/admissionregistration:go_default_library",
|
||||||
"//pkg/registry/admissionregistration/mutatingwebhookconfiguration/storage:go_default_library",
|
"//pkg/registry/admissionregistration/mutatingwebhookconfiguration/storage:go_default_library",
|
||||||
"//pkg/registry/admissionregistration/validatingwebhookconfiguration/storage:go_default_library",
|
"//pkg/registry/admissionregistration/validatingwebhookconfiguration/storage:go_default_library",
|
||||||
|
"//staging/src/k8s.io/api/admissionregistration/v1:go_default_library",
|
||||||
"//staging/src/k8s.io/api/admissionregistration/v1beta1:go_default_library",
|
"//staging/src/k8s.io/api/admissionregistration/v1beta1:go_default_library",
|
||||||
"//staging/src/k8s.io/apiserver/pkg/registry/generic:go_default_library",
|
"//staging/src/k8s.io/apiserver/pkg/registry/generic:go_default_library",
|
||||||
"//staging/src/k8s.io/apiserver/pkg/registry/rest:go_default_library",
|
"//staging/src/k8s.io/apiserver/pkg/registry/rest:go_default_library",
|
||||||
|
@ -17,6 +17,7 @@ limitations under the License.
|
|||||||
package rest
|
package rest
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
admissionregistrationv1 "k8s.io/api/admissionregistration/v1"
|
||||||
admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1"
|
admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1"
|
||||||
"k8s.io/apiserver/pkg/registry/generic"
|
"k8s.io/apiserver/pkg/registry/generic"
|
||||||
"k8s.io/apiserver/pkg/registry/rest"
|
"k8s.io/apiserver/pkg/registry/rest"
|
||||||
@ -38,6 +39,9 @@ func (p RESTStorageProvider) NewRESTStorage(apiResourceConfigSource serverstorag
|
|||||||
if apiResourceConfigSource.VersionEnabled(admissionregistrationv1beta1.SchemeGroupVersion) {
|
if apiResourceConfigSource.VersionEnabled(admissionregistrationv1beta1.SchemeGroupVersion) {
|
||||||
apiGroupInfo.VersionedResourcesStorageMap[admissionregistrationv1beta1.SchemeGroupVersion.Version] = p.v1beta1Storage(apiResourceConfigSource, restOptionsGetter)
|
apiGroupInfo.VersionedResourcesStorageMap[admissionregistrationv1beta1.SchemeGroupVersion.Version] = p.v1beta1Storage(apiResourceConfigSource, restOptionsGetter)
|
||||||
}
|
}
|
||||||
|
if apiResourceConfigSource.VersionEnabled(admissionregistrationv1.SchemeGroupVersion) {
|
||||||
|
apiGroupInfo.VersionedResourcesStorageMap[admissionregistrationv1.SchemeGroupVersion.Version] = p.v1Storage(apiResourceConfigSource, restOptionsGetter)
|
||||||
|
}
|
||||||
return apiGroupInfo, true
|
return apiGroupInfo, true
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -54,6 +58,19 @@ func (p RESTStorageProvider) v1beta1Storage(apiResourceConfigSource serverstorag
|
|||||||
return storage
|
return storage
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (p RESTStorageProvider) v1Storage(apiResourceConfigSource serverstorage.APIResourceConfigSource, restOptionsGetter generic.RESTOptionsGetter) map[string]rest.Storage {
|
||||||
|
storage := map[string]rest.Storage{}
|
||||||
|
// validatingwebhookconfigurations
|
||||||
|
validatingStorage := validatingwebhookconfigurationstorage.NewREST(restOptionsGetter)
|
||||||
|
storage["validatingwebhookconfigurations"] = validatingStorage
|
||||||
|
|
||||||
|
// mutatingwebhookconfigurations
|
||||||
|
mutatingStorage := mutatingwebhookconfigurationstorage.NewREST(restOptionsGetter)
|
||||||
|
storage["mutatingwebhookconfigurations"] = mutatingStorage
|
||||||
|
|
||||||
|
return storage
|
||||||
|
}
|
||||||
|
|
||||||
func (p RESTStorageProvider) GroupName() string {
|
func (p RESTStorageProvider) GroupName() string {
|
||||||
return admissionregistration.GroupName
|
return admissionregistration.GroupName
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,9 @@ go_library(
|
|||||||
"//pkg/apis/admissionregistration:go_default_library",
|
"//pkg/apis/admissionregistration:go_default_library",
|
||||||
"//pkg/apis/admissionregistration/validation:go_default_library",
|
"//pkg/apis/admissionregistration/validation:go_default_library",
|
||||||
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
|
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
|
||||||
|
"//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library",
|
||||||
"//staging/src/k8s.io/apimachinery/pkg/util/validation/field:go_default_library",
|
"//staging/src/k8s.io/apimachinery/pkg/util/validation/field:go_default_library",
|
||||||
|
"//staging/src/k8s.io/apiserver/pkg/endpoints/request:go_default_library",
|
||||||
"//staging/src/k8s.io/apiserver/pkg/storage/names:go_default_library",
|
"//staging/src/k8s.io/apiserver/pkg/storage/names:go_default_library",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
@ -21,7 +21,9 @@ import (
|
|||||||
"reflect"
|
"reflect"
|
||||||
|
|
||||||
"k8s.io/apimachinery/pkg/runtime"
|
"k8s.io/apimachinery/pkg/runtime"
|
||||||
|
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||||
"k8s.io/apimachinery/pkg/util/validation/field"
|
"k8s.io/apimachinery/pkg/util/validation/field"
|
||||||
|
genericapirequest "k8s.io/apiserver/pkg/endpoints/request"
|
||||||
"k8s.io/apiserver/pkg/storage/names"
|
"k8s.io/apiserver/pkg/storage/names"
|
||||||
"k8s.io/kubernetes/pkg/api/legacyscheme"
|
"k8s.io/kubernetes/pkg/api/legacyscheme"
|
||||||
"k8s.io/kubernetes/pkg/apis/admissionregistration"
|
"k8s.io/kubernetes/pkg/apis/admissionregistration"
|
||||||
@ -63,7 +65,12 @@ func (validatingWebhookConfigurationStrategy) PrepareForUpdate(ctx context.Conte
|
|||||||
|
|
||||||
// Validate validates a new validatingWebhookConfiguration.
|
// Validate validates a new validatingWebhookConfiguration.
|
||||||
func (validatingWebhookConfigurationStrategy) Validate(ctx context.Context, obj runtime.Object) field.ErrorList {
|
func (validatingWebhookConfigurationStrategy) Validate(ctx context.Context, obj runtime.Object) field.ErrorList {
|
||||||
return validation.ValidateValidatingWebhookConfiguration(obj.(*admissionregistration.ValidatingWebhookConfiguration))
|
var groupVersion schema.GroupVersion
|
||||||
|
if requestInfo, found := genericapirequest.RequestInfoFrom(ctx); found {
|
||||||
|
groupVersion = schema.GroupVersion{Group: requestInfo.APIGroup, Version: requestInfo.APIVersion}
|
||||||
|
}
|
||||||
|
|
||||||
|
return validation.ValidateValidatingWebhookConfiguration(obj.(*admissionregistration.ValidatingWebhookConfiguration), groupVersion)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Canonicalize normalizes the object after validation.
|
// Canonicalize normalizes the object after validation.
|
||||||
@ -77,7 +84,12 @@ func (validatingWebhookConfigurationStrategy) AllowCreateOnUpdate() bool {
|
|||||||
|
|
||||||
// ValidateUpdate is the default update validation for an end user.
|
// ValidateUpdate is the default update validation for an end user.
|
||||||
func (validatingWebhookConfigurationStrategy) ValidateUpdate(ctx context.Context, obj, old runtime.Object) field.ErrorList {
|
func (validatingWebhookConfigurationStrategy) ValidateUpdate(ctx context.Context, obj, old runtime.Object) field.ErrorList {
|
||||||
return validation.ValidateValidatingWebhookConfigurationUpdate(obj.(*admissionregistration.ValidatingWebhookConfiguration), old.(*admissionregistration.ValidatingWebhookConfiguration))
|
var groupVersion schema.GroupVersion
|
||||||
|
if requestInfo, found := genericapirequest.RequestInfoFrom(ctx); found {
|
||||||
|
groupVersion = schema.GroupVersion{Group: requestInfo.APIGroup, Version: requestInfo.APIVersion}
|
||||||
|
}
|
||||||
|
|
||||||
|
return validation.ValidateValidatingWebhookConfigurationUpdate(obj.(*admissionregistration.ValidatingWebhookConfiguration), old.(*admissionregistration.ValidatingWebhookConfiguration), groupVersion)
|
||||||
}
|
}
|
||||||
|
|
||||||
// AllowUnconditionalUpdate is the default update policy for validatingWebhookConfiguration objects. Status update should
|
// AllowUnconditionalUpdate is the default update policy for validatingWebhookConfiguration objects. Status update should
|
||||||
|
@ -6,6 +6,7 @@ go_test(
|
|||||||
data = glob(["testdata/**"]),
|
data = glob(["testdata/**"]),
|
||||||
deps = [
|
deps = [
|
||||||
"//staging/src/k8s.io/api/admission/v1beta1:go_default_library",
|
"//staging/src/k8s.io/api/admission/v1beta1:go_default_library",
|
||||||
|
"//staging/src/k8s.io/api/admissionregistration/v1:go_default_library",
|
||||||
"//staging/src/k8s.io/api/admissionregistration/v1beta1:go_default_library",
|
"//staging/src/k8s.io/api/admissionregistration/v1beta1:go_default_library",
|
||||||
"//staging/src/k8s.io/api/apps/v1:go_default_library",
|
"//staging/src/k8s.io/api/apps/v1:go_default_library",
|
||||||
"//staging/src/k8s.io/api/apps/v1beta1:go_default_library",
|
"//staging/src/k8s.io/api/apps/v1beta1:go_default_library",
|
||||||
@ -63,6 +64,7 @@ filegroup(
|
|||||||
srcs = [
|
srcs = [
|
||||||
":package-srcs",
|
":package-srcs",
|
||||||
"//staging/src/k8s.io/api/admission/v1beta1:all-srcs",
|
"//staging/src/k8s.io/api/admission/v1beta1:all-srcs",
|
||||||
|
"//staging/src/k8s.io/api/admissionregistration/v1:all-srcs",
|
||||||
"//staging/src/k8s.io/api/admissionregistration/v1beta1:all-srcs",
|
"//staging/src/k8s.io/api/admissionregistration/v1beta1:all-srcs",
|
||||||
"//staging/src/k8s.io/api/apps/v1:all-srcs",
|
"//staging/src/k8s.io/api/apps/v1:all-srcs",
|
||||||
"//staging/src/k8s.io/api/apps/v1beta1:all-srcs",
|
"//staging/src/k8s.io/api/apps/v1beta1:all-srcs",
|
||||||
|
39
staging/src/k8s.io/api/admissionregistration/v1/BUILD
Normal file
39
staging/src/k8s.io/api/admissionregistration/v1/BUILD
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
package(default_visibility = ["//visibility:public"])
|
||||||
|
|
||||||
|
load(
|
||||||
|
"@io_bazel_rules_go//go:def.bzl",
|
||||||
|
"go_library",
|
||||||
|
)
|
||||||
|
|
||||||
|
go_library(
|
||||||
|
name = "go_default_library",
|
||||||
|
srcs = [
|
||||||
|
"doc.go",
|
||||||
|
"generated.pb.go",
|
||||||
|
"register.go",
|
||||||
|
"types.go",
|
||||||
|
"types_swagger_doc_generated.go",
|
||||||
|
"zz_generated.deepcopy.go",
|
||||||
|
],
|
||||||
|
importmap = "k8s.io/kubernetes/vendor/k8s.io/api/admissionregistration/v1",
|
||||||
|
importpath = "k8s.io/api/admissionregistration/v1",
|
||||||
|
deps = [
|
||||||
|
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
|
||||||
|
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
|
||||||
|
"//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library",
|
||||||
|
"//vendor/github.com/gogo/protobuf/proto:go_default_library",
|
||||||
|
],
|
||||||
|
)
|
||||||
|
|
||||||
|
filegroup(
|
||||||
|
name = "package-srcs",
|
||||||
|
srcs = glob(["**"]),
|
||||||
|
tags = ["automanaged"],
|
||||||
|
visibility = ["//visibility:private"],
|
||||||
|
)
|
||||||
|
|
||||||
|
filegroup(
|
||||||
|
name = "all-srcs",
|
||||||
|
srcs = [":package-srcs"],
|
||||||
|
tags = ["automanaged"],
|
||||||
|
)
|
26
staging/src/k8s.io/api/admissionregistration/v1/doc.go
Normal file
26
staging/src/k8s.io/api/admissionregistration/v1/doc.go
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2019 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
// +k8s:deepcopy-gen=package
|
||||||
|
// +k8s:protobuf-gen=package
|
||||||
|
// +k8s:openapi-gen=true
|
||||||
|
// +groupName=admissionregistration.k8s.io
|
||||||
|
|
||||||
|
// Package v1 is the v1 version of the API.
|
||||||
|
// AdmissionConfiguration and AdmissionPluginConfiguration are legacy static admission plugin configuration
|
||||||
|
// MutatingWebhookConfiguration and ValidatingWebhookConfiguration are for the
|
||||||
|
// new dynamic admission controller configuration.
|
||||||
|
package v1 // import "k8s.io/api/admissionregistration/v1"
|
2979
staging/src/k8s.io/api/admissionregistration/v1/generated.pb.go
generated
Normal file
2979
staging/src/k8s.io/api/admissionregistration/v1/generated.pb.go
generated
Normal file
File diff suppressed because it is too large
Load Diff
479
staging/src/k8s.io/api/admissionregistration/v1/generated.proto
Normal file
479
staging/src/k8s.io/api/admissionregistration/v1/generated.proto
Normal file
@ -0,0 +1,479 @@
|
|||||||
|
/*
|
||||||
|
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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
// This file was autogenerated by go-to-protobuf. Do not edit it manually!
|
||||||
|
|
||||||
|
syntax = 'proto2';
|
||||||
|
|
||||||
|
package k8s.io.api.admissionregistration.v1;
|
||||||
|
|
||||||
|
import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto";
|
||||||
|
import "k8s.io/apimachinery/pkg/runtime/generated.proto";
|
||||||
|
import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto";
|
||||||
|
|
||||||
|
// Package-wide variables from generator "generated".
|
||||||
|
option go_package = "v1";
|
||||||
|
|
||||||
|
// MutatingWebhook describes an admission webhook and the resources and operations it applies to.
|
||||||
|
message MutatingWebhook {
|
||||||
|
// The name of the admission webhook.
|
||||||
|
// Name should be fully qualified, e.g., imagepolicy.kubernetes.io, where
|
||||||
|
// "imagepolicy" is the name of the webhook, and kubernetes.io is the name
|
||||||
|
// of the organization.
|
||||||
|
// Required.
|
||||||
|
optional string name = 1;
|
||||||
|
|
||||||
|
// ClientConfig defines how to communicate with the hook.
|
||||||
|
// Required
|
||||||
|
optional WebhookClientConfig clientConfig = 2;
|
||||||
|
|
||||||
|
// Rules describes what operations on what resources/subresources the webhook cares about.
|
||||||
|
// The webhook cares about an operation if it matches _any_ Rule.
|
||||||
|
// However, in order to prevent ValidatingAdmissionWebhooks and MutatingAdmissionWebhooks
|
||||||
|
// from putting the cluster in a state which cannot be recovered from without completely
|
||||||
|
// disabling the plugin, ValidatingAdmissionWebhooks and MutatingAdmissionWebhooks are never called
|
||||||
|
// on admission requests for ValidatingWebhookConfiguration and MutatingWebhookConfiguration objects.
|
||||||
|
repeated RuleWithOperations rules = 3;
|
||||||
|
|
||||||
|
// FailurePolicy defines how unrecognized errors from the admission endpoint are handled -
|
||||||
|
// allowed values are Ignore or Fail. Defaults to Fail.
|
||||||
|
// +optional
|
||||||
|
optional string failurePolicy = 4;
|
||||||
|
|
||||||
|
// matchPolicy defines how the "rules" list is used to match incoming requests.
|
||||||
|
// Allowed values are "Exact" or "Equivalent".
|
||||||
|
//
|
||||||
|
// - Exact: match a request only if it exactly matches a specified rule.
|
||||||
|
// For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1,
|
||||||
|
// but "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`,
|
||||||
|
// a request to apps/v1beta1 or extensions/v1beta1 would not be sent to the webhook.
|
||||||
|
//
|
||||||
|
// - Equivalent: match a request if modifies a resource listed in rules, even via another API group or version.
|
||||||
|
// For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1,
|
||||||
|
// and "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`,
|
||||||
|
// a request to apps/v1beta1 or extensions/v1beta1 would be converted to apps/v1 and sent to the webhook.
|
||||||
|
//
|
||||||
|
// Defaults to "Equivalent"
|
||||||
|
// +optional
|
||||||
|
optional string matchPolicy = 9;
|
||||||
|
|
||||||
|
// NamespaceSelector decides whether to run the webhook on an object based
|
||||||
|
// on whether the namespace for that object matches the selector. If the
|
||||||
|
// object itself is a namespace, the matching is performed on
|
||||||
|
// object.metadata.labels. If the object is another cluster scoped resource,
|
||||||
|
// it never skips the webhook.
|
||||||
|
//
|
||||||
|
// For example, to run the webhook on any objects whose namespace is not
|
||||||
|
// associated with "runlevel" of "0" or "1"; you will set the selector as
|
||||||
|
// follows:
|
||||||
|
// "namespaceSelector": {
|
||||||
|
// "matchExpressions": [
|
||||||
|
// {
|
||||||
|
// "key": "runlevel",
|
||||||
|
// "operator": "NotIn",
|
||||||
|
// "values": [
|
||||||
|
// "0",
|
||||||
|
// "1"
|
||||||
|
// ]
|
||||||
|
// }
|
||||||
|
// ]
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// If instead you want to only run the webhook on any objects whose
|
||||||
|
// namespace is associated with the "environment" of "prod" or "staging";
|
||||||
|
// you will set the selector as follows:
|
||||||
|
// "namespaceSelector": {
|
||||||
|
// "matchExpressions": [
|
||||||
|
// {
|
||||||
|
// "key": "environment",
|
||||||
|
// "operator": "In",
|
||||||
|
// "values": [
|
||||||
|
// "prod",
|
||||||
|
// "staging"
|
||||||
|
// ]
|
||||||
|
// }
|
||||||
|
// ]
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// See
|
||||||
|
// https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
|
||||||
|
// for more examples of label selectors.
|
||||||
|
//
|
||||||
|
// Default to the empty LabelSelector, which matches everything.
|
||||||
|
// +optional
|
||||||
|
optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector namespaceSelector = 5;
|
||||||
|
|
||||||
|
// ObjectSelector decides whether to run the webhook based on if the
|
||||||
|
// object has matching labels. objectSelector is evaluated against both
|
||||||
|
// the oldObject and newObject that would be sent to the webhook, and
|
||||||
|
// is considered to match if either object matches the selector. A null
|
||||||
|
// object (oldObject in the case of create, or newObject in the case of
|
||||||
|
// delete) or an object that cannot have labels (like a
|
||||||
|
// DeploymentRollback or a PodProxyOptions object) is not considered to
|
||||||
|
// match.
|
||||||
|
// Use the object selector only if the webhook is opt-in, because end
|
||||||
|
// users may skip the admission webhook by setting the labels.
|
||||||
|
// Default to the empty LabelSelector, which matches everything.
|
||||||
|
// +optional
|
||||||
|
optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector objectSelector = 11;
|
||||||
|
|
||||||
|
// SideEffects states whether this webhookk has side effects.
|
||||||
|
// Acceptable values are: Unknown, None, Some, NoneOnDryRun
|
||||||
|
// Webhooks with side effects MUST implement a reconciliation system, since a request may be
|
||||||
|
// rejected by a future step in the admission change and the side effects therefore need to be undone.
|
||||||
|
// Requests with the dryRun attribute will be auto-rejected if they match a webhook with
|
||||||
|
// sideEffects == Unknown or Some.
|
||||||
|
optional string sideEffects = 6;
|
||||||
|
|
||||||
|
// TimeoutSeconds specifies the timeout for this webhook. After the timeout passes,
|
||||||
|
// the webhook call will be ignored or the API call will fail based on the
|
||||||
|
// failure policy.
|
||||||
|
// The timeout value must be between 1 and 30 seconds.
|
||||||
|
// Default to 10 seconds.
|
||||||
|
// +optional
|
||||||
|
optional int32 timeoutSeconds = 7;
|
||||||
|
|
||||||
|
// AdmissionReviewVersions is an ordered list of preferred `AdmissionReview`
|
||||||
|
// versions the Webhook expects. API server will try to use first version in
|
||||||
|
// the list which it supports. If none of the versions specified in this list
|
||||||
|
// supported by API server, validation will fail for this object.
|
||||||
|
// If a persisted webhook configuration specifies allowed versions and does not
|
||||||
|
// include any versions known to the API Server, calls to the webhook will fail
|
||||||
|
// and be subject to the failure policy.
|
||||||
|
repeated string admissionReviewVersions = 8;
|
||||||
|
|
||||||
|
// reinvocationPolicy indicates whether this webhook should be called multiple times as part of a single admission evaluation.
|
||||||
|
// Allowed values are "Never" and "IfNeeded".
|
||||||
|
//
|
||||||
|
// Never: the webhook will not be called more than once in a single admission evaluation.
|
||||||
|
//
|
||||||
|
// IfNeeded: the webhook will be called at least one additional time as part of the admission evaluation
|
||||||
|
// if the object being admitted is modified by other admission plugins after the initial webhook call.
|
||||||
|
// Webhooks that specify this option *must* be idempotent, able to process objects they previously admitted.
|
||||||
|
// Note:
|
||||||
|
// * the number of additional invocations is not guaranteed to be exactly one.
|
||||||
|
// * if additional invocations result in further modifications to the object, webhooks are not guaranteed to be invoked again.
|
||||||
|
// * webhooks that use this option may be reordered to minimize the number of additional invocations.
|
||||||
|
// * to validate an object after all mutations are guaranteed complete, use a validating admission webhook instead.
|
||||||
|
//
|
||||||
|
// Defaults to "Never".
|
||||||
|
// +optional
|
||||||
|
optional string reinvocationPolicy = 10;
|
||||||
|
}
|
||||||
|
|
||||||
|
// MutatingWebhookConfiguration describes the configuration of and admission webhook that accept or reject and may change the object.
|
||||||
|
message MutatingWebhookConfiguration {
|
||||||
|
// Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.
|
||||||
|
// +optional
|
||||||
|
optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
|
||||||
|
|
||||||
|
// Webhooks is a list of webhooks and the affected resources and operations.
|
||||||
|
// +optional
|
||||||
|
// +patchMergeKey=name
|
||||||
|
// +patchStrategy=merge
|
||||||
|
repeated MutatingWebhook Webhooks = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
// MutatingWebhookConfigurationList is a list of MutatingWebhookConfiguration.
|
||||||
|
message MutatingWebhookConfigurationList {
|
||||||
|
// Standard list metadata.
|
||||||
|
// More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
|
||||||
|
// +optional
|
||||||
|
optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
|
||||||
|
|
||||||
|
// List of MutatingWebhookConfiguration.
|
||||||
|
repeated MutatingWebhookConfiguration items = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Rule is a tuple of APIGroups, APIVersion, and Resources.It is recommended
|
||||||
|
// to make sure that all the tuple expansions are valid.
|
||||||
|
message Rule {
|
||||||
|
// APIGroups is the API groups the resources belong to. '*' is all groups.
|
||||||
|
// If '*' is present, the length of the slice must be one.
|
||||||
|
// Required.
|
||||||
|
repeated string apiGroups = 1;
|
||||||
|
|
||||||
|
// APIVersions is the API versions the resources belong to. '*' is all versions.
|
||||||
|
// If '*' is present, the length of the slice must be one.
|
||||||
|
// Required.
|
||||||
|
repeated string apiVersions = 2;
|
||||||
|
|
||||||
|
// Resources is a list of resources this rule applies to.
|
||||||
|
//
|
||||||
|
// For example:
|
||||||
|
// 'pods' means pods.
|
||||||
|
// 'pods/log' means the log subresource of pods.
|
||||||
|
// '*' means all resources, but not subresources.
|
||||||
|
// 'pods/*' means all subresources of pods.
|
||||||
|
// '*/scale' means all scale subresources.
|
||||||
|
// '*/*' means all resources and their subresources.
|
||||||
|
//
|
||||||
|
// If wildcard is present, the validation rule will ensure resources do not
|
||||||
|
// overlap with each other.
|
||||||
|
//
|
||||||
|
// Depending on the enclosing object, subresources might not be allowed.
|
||||||
|
// Required.
|
||||||
|
repeated string resources = 3;
|
||||||
|
|
||||||
|
// scope specifies the scope of this rule.
|
||||||
|
// Valid values are "Cluster", "Namespaced", and "*"
|
||||||
|
// "Cluster" means that only cluster-scoped resources will match this rule.
|
||||||
|
// Namespace API objects are cluster-scoped.
|
||||||
|
// "Namespaced" means that only namespaced resources will match this rule.
|
||||||
|
// "*" means that there are no scope restrictions.
|
||||||
|
// Subresources match the scope of their parent resource.
|
||||||
|
// Default is "*".
|
||||||
|
//
|
||||||
|
// +optional
|
||||||
|
optional string scope = 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
// RuleWithOperations is a tuple of Operations and Resources. It is recommended to make
|
||||||
|
// sure that all the tuple expansions are valid.
|
||||||
|
message RuleWithOperations {
|
||||||
|
// Operations is the operations the admission hook cares about - CREATE, UPDATE, or *
|
||||||
|
// for all operations.
|
||||||
|
// If '*' is present, the length of the slice must be one.
|
||||||
|
// Required.
|
||||||
|
repeated string operations = 1;
|
||||||
|
|
||||||
|
// Rule is embedded, it describes other criteria of the rule, like
|
||||||
|
// APIGroups, APIVersions, Resources, etc.
|
||||||
|
optional Rule rule = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ServiceReference holds a reference to Service.legacy.k8s.io
|
||||||
|
message ServiceReference {
|
||||||
|
// `namespace` is the namespace of the service.
|
||||||
|
// Required
|
||||||
|
optional string namespace = 1;
|
||||||
|
|
||||||
|
// `name` is the name of the service.
|
||||||
|
// Required
|
||||||
|
optional string name = 2;
|
||||||
|
|
||||||
|
// `path` is an optional URL path which will be sent in any request to
|
||||||
|
// this service.
|
||||||
|
// +optional
|
||||||
|
optional string path = 3;
|
||||||
|
|
||||||
|
// If specified, the port on the service that hosting webhook.
|
||||||
|
// Default to 443 for backward compatibility.
|
||||||
|
// `port` should be a valid port number (1-65535, inclusive).
|
||||||
|
// +optional
|
||||||
|
optional int32 port = 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ValidatingWebhook describes an admission webhook and the resources and operations it applies to.
|
||||||
|
message ValidatingWebhook {
|
||||||
|
// The name of the admission webhook.
|
||||||
|
// Name should be fully qualified, e.g., imagepolicy.kubernetes.io, where
|
||||||
|
// "imagepolicy" is the name of the webhook, and kubernetes.io is the name
|
||||||
|
// of the organization.
|
||||||
|
// Required.
|
||||||
|
optional string name = 1;
|
||||||
|
|
||||||
|
// ClientConfig defines how to communicate with the hook.
|
||||||
|
// Required
|
||||||
|
optional WebhookClientConfig clientConfig = 2;
|
||||||
|
|
||||||
|
// Rules describes what operations on what resources/subresources the webhook cares about.
|
||||||
|
// The webhook cares about an operation if it matches _any_ Rule.
|
||||||
|
// However, in order to prevent ValidatingAdmissionWebhooks and MutatingAdmissionWebhooks
|
||||||
|
// from putting the cluster in a state which cannot be recovered from without completely
|
||||||
|
// disabling the plugin, ValidatingAdmissionWebhooks and MutatingAdmissionWebhooks are never called
|
||||||
|
// on admission requests for ValidatingWebhookConfiguration and MutatingWebhookConfiguration objects.
|
||||||
|
repeated RuleWithOperations rules = 3;
|
||||||
|
|
||||||
|
// FailurePolicy defines how unrecognized errors from the admission endpoint are handled -
|
||||||
|
// allowed values are Ignore or Fail. Defaults to Fail.
|
||||||
|
// +optional
|
||||||
|
optional string failurePolicy = 4;
|
||||||
|
|
||||||
|
// matchPolicy defines how the "rules" list is used to match incoming requests.
|
||||||
|
// Allowed values are "Exact" or "Equivalent".
|
||||||
|
//
|
||||||
|
// - Exact: match a request only if it exactly matches a specified rule.
|
||||||
|
// For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1,
|
||||||
|
// but "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`,
|
||||||
|
// a request to apps/v1beta1 or extensions/v1beta1 would not be sent to the webhook.
|
||||||
|
//
|
||||||
|
// - Equivalent: match a request if modifies a resource listed in rules, even via another API group or version.
|
||||||
|
// For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1,
|
||||||
|
// and "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`,
|
||||||
|
// a request to apps/v1beta1 or extensions/v1beta1 would be converted to apps/v1 and sent to the webhook.
|
||||||
|
//
|
||||||
|
// Defaults to "Equivalent"
|
||||||
|
// +optional
|
||||||
|
optional string matchPolicy = 9;
|
||||||
|
|
||||||
|
// NamespaceSelector decides whether to run the webhook on an object based
|
||||||
|
// on whether the namespace for that object matches the selector. If the
|
||||||
|
// object itself is a namespace, the matching is performed on
|
||||||
|
// object.metadata.labels. If the object is another cluster scoped resource,
|
||||||
|
// it never skips the webhook.
|
||||||
|
//
|
||||||
|
// For example, to run the webhook on any objects whose namespace is not
|
||||||
|
// associated with "runlevel" of "0" or "1"; you will set the selector as
|
||||||
|
// follows:
|
||||||
|
// "namespaceSelector": {
|
||||||
|
// "matchExpressions": [
|
||||||
|
// {
|
||||||
|
// "key": "runlevel",
|
||||||
|
// "operator": "NotIn",
|
||||||
|
// "values": [
|
||||||
|
// "0",
|
||||||
|
// "1"
|
||||||
|
// ]
|
||||||
|
// }
|
||||||
|
// ]
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// If instead you want to only run the webhook on any objects whose
|
||||||
|
// namespace is associated with the "environment" of "prod" or "staging";
|
||||||
|
// you will set the selector as follows:
|
||||||
|
// "namespaceSelector": {
|
||||||
|
// "matchExpressions": [
|
||||||
|
// {
|
||||||
|
// "key": "environment",
|
||||||
|
// "operator": "In",
|
||||||
|
// "values": [
|
||||||
|
// "prod",
|
||||||
|
// "staging"
|
||||||
|
// ]
|
||||||
|
// }
|
||||||
|
// ]
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// See
|
||||||
|
// https://kubernetes.io/docs/concepts/overview/working-with-objects/labels
|
||||||
|
// for more examples of label selectors.
|
||||||
|
//
|
||||||
|
// Default to the empty LabelSelector, which matches everything.
|
||||||
|
// +optional
|
||||||
|
optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector namespaceSelector = 5;
|
||||||
|
|
||||||
|
// ObjectSelector decides whether to run the webhook based on if the
|
||||||
|
// object has matching labels. objectSelector is evaluated against both
|
||||||
|
// the oldObject and newObject that would be sent to the webhook, and
|
||||||
|
// is considered to match if either object matches the selector. A null
|
||||||
|
// object (oldObject in the case of create, or newObject in the case of
|
||||||
|
// delete) or an object that cannot have labels (like a
|
||||||
|
// DeploymentRollback or a PodProxyOptions object) is not considered to
|
||||||
|
// match.
|
||||||
|
// Use the object selector only if the webhook is opt-in, because end
|
||||||
|
// users may skip the admission webhook by setting the labels.
|
||||||
|
// Default to the empty LabelSelector, which matches everything.
|
||||||
|
// +optional
|
||||||
|
optional k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector objectSelector = 10;
|
||||||
|
|
||||||
|
// SideEffects states whether this webhookk has side effects.
|
||||||
|
// Acceptable values are: Unknown, None, Some, NoneOnDryRun
|
||||||
|
// Webhooks with side effects MUST implement a reconciliation system, since a request may be
|
||||||
|
// rejected by a future step in the admission change and the side effects therefore need to be undone.
|
||||||
|
// Requests with the dryRun attribute will be auto-rejected if they match a webhook with
|
||||||
|
// sideEffects == Unknown or Some.
|
||||||
|
optional string sideEffects = 6;
|
||||||
|
|
||||||
|
// TimeoutSeconds specifies the timeout for this webhook. After the timeout passes,
|
||||||
|
// the webhook call will be ignored or the API call will fail based on the
|
||||||
|
// failure policy.
|
||||||
|
// The timeout value must be between 1 and 30 seconds.
|
||||||
|
// Default to 10 seconds.
|
||||||
|
// +optional
|
||||||
|
optional int32 timeoutSeconds = 7;
|
||||||
|
|
||||||
|
// AdmissionReviewVersions is an ordered list of preferred `AdmissionReview`
|
||||||
|
// versions the Webhook expects. API server will try to use first version in
|
||||||
|
// the list which it supports. If none of the versions specified in this list
|
||||||
|
// supported by API server, validation will fail for this object.
|
||||||
|
// If a persisted webhook configuration specifies allowed versions and does not
|
||||||
|
// include any versions known to the API Server, calls to the webhook will fail
|
||||||
|
// and be subject to the failure policy.
|
||||||
|
repeated string admissionReviewVersions = 8;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ValidatingWebhookConfiguration describes the configuration of and admission webhook that accept or reject and object without changing it.
|
||||||
|
message ValidatingWebhookConfiguration {
|
||||||
|
// Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.
|
||||||
|
// +optional
|
||||||
|
optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
|
||||||
|
|
||||||
|
// Webhooks is a list of webhooks and the affected resources and operations.
|
||||||
|
// +optional
|
||||||
|
// +patchMergeKey=name
|
||||||
|
// +patchStrategy=merge
|
||||||
|
repeated ValidatingWebhook Webhooks = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ValidatingWebhookConfigurationList is a list of ValidatingWebhookConfiguration.
|
||||||
|
message ValidatingWebhookConfigurationList {
|
||||||
|
// Standard list metadata.
|
||||||
|
// More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
|
||||||
|
// +optional
|
||||||
|
optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
|
||||||
|
|
||||||
|
// List of ValidatingWebhookConfiguration.
|
||||||
|
repeated ValidatingWebhookConfiguration items = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
// WebhookClientConfig contains the information to make a TLS
|
||||||
|
// connection with the webhook
|
||||||
|
message WebhookClientConfig {
|
||||||
|
// `url` gives the location of the webhook, in standard URL form
|
||||||
|
// (`scheme://host:port/path`). Exactly one of `url` or `service`
|
||||||
|
// must be specified.
|
||||||
|
//
|
||||||
|
// The `host` should not refer to a service running in the cluster; use
|
||||||
|
// the `service` field instead. The host might be resolved via external
|
||||||
|
// DNS in some apiservers (e.g., `kube-apiserver` cannot resolve
|
||||||
|
// in-cluster DNS as that would be a layering violation). `host` may
|
||||||
|
// also be an IP address.
|
||||||
|
//
|
||||||
|
// Please note that using `localhost` or `127.0.0.1` as a `host` is
|
||||||
|
// risky unless you take great care to run this webhook on all hosts
|
||||||
|
// which run an apiserver which might need to make calls to this
|
||||||
|
// webhook. Such installs are likely to be non-portable, i.e., not easy
|
||||||
|
// to turn up in a new cluster.
|
||||||
|
//
|
||||||
|
// The scheme must be "https"; the URL must begin with "https://".
|
||||||
|
//
|
||||||
|
// A path is optional, and if present may be any string permissible in
|
||||||
|
// a URL. You may use the path to pass an arbitrary string to the
|
||||||
|
// webhook, for example, a cluster identifier.
|
||||||
|
//
|
||||||
|
// Attempting to use a user or basic auth e.g. "user:password@" is not
|
||||||
|
// allowed. Fragments ("#...") and query parameters ("?...") are not
|
||||||
|
// allowed, either.
|
||||||
|
//
|
||||||
|
// +optional
|
||||||
|
optional string url = 3;
|
||||||
|
|
||||||
|
// `service` is a reference to the service for this webhook. Either
|
||||||
|
// `service` or `url` must be specified.
|
||||||
|
//
|
||||||
|
// If the webhook is running within the cluster, then you should use `service`.
|
||||||
|
//
|
||||||
|
// +optional
|
||||||
|
optional ServiceReference service = 1;
|
||||||
|
|
||||||
|
// `caBundle` is a PEM encoded CA bundle which will be used to validate the webhook's server certificate.
|
||||||
|
// If unspecified, system trust roots on the apiserver are used.
|
||||||
|
// +optional
|
||||||
|
optional bytes caBundle = 2;
|
||||||
|
}
|
||||||
|
|
53
staging/src/k8s.io/api/admissionregistration/v1/register.go
Normal file
53
staging/src/k8s.io/api/admissionregistration/v1/register.go
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2019 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package v1
|
||||||
|
|
||||||
|
import (
|
||||||
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
"k8s.io/apimachinery/pkg/runtime"
|
||||||
|
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||||
|
)
|
||||||
|
|
||||||
|
const GroupName = "admissionregistration.k8s.io"
|
||||||
|
|
||||||
|
// SchemeGroupVersion is group version used to register these objects
|
||||||
|
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1"}
|
||||||
|
|
||||||
|
// Resource takes an unqualified resource and returns a Group qualified GroupResource
|
||||||
|
func Resource(resource string) schema.GroupResource {
|
||||||
|
return SchemeGroupVersion.WithResource(resource).GroupResource()
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
// TODO: move SchemeBuilder with zz_generated.deepcopy.go to k8s.io/api.
|
||||||
|
// localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes.
|
||||||
|
SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
|
||||||
|
localSchemeBuilder = &SchemeBuilder
|
||||||
|
AddToScheme = localSchemeBuilder.AddToScheme
|
||||||
|
)
|
||||||
|
|
||||||
|
// Adds the list of known types to scheme.
|
||||||
|
func addKnownTypes(scheme *runtime.Scheme) error {
|
||||||
|
scheme.AddKnownTypes(SchemeGroupVersion,
|
||||||
|
&ValidatingWebhookConfiguration{},
|
||||||
|
&ValidatingWebhookConfigurationList{},
|
||||||
|
&MutatingWebhookConfiguration{},
|
||||||
|
&MutatingWebhookConfigurationList{},
|
||||||
|
)
|
||||||
|
metav1.AddToGroupVersion(scheme, SchemeGroupVersion)
|
||||||
|
return nil
|
||||||
|
}
|
551
staging/src/k8s.io/api/admissionregistration/v1/types.go
Normal file
551
staging/src/k8s.io/api/admissionregistration/v1/types.go
Normal file
@ -0,0 +1,551 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2019 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package v1
|
||||||
|
|
||||||
|
import (
|
||||||
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Rule is a tuple of APIGroups, APIVersion, and Resources.It is recommended
|
||||||
|
// to make sure that all the tuple expansions are valid.
|
||||||
|
type Rule struct {
|
||||||
|
// APIGroups is the API groups the resources belong to. '*' is all groups.
|
||||||
|
// If '*' is present, the length of the slice must be one.
|
||||||
|
// Required.
|
||||||
|
APIGroups []string `json:"apiGroups,omitempty" protobuf:"bytes,1,rep,name=apiGroups"`
|
||||||
|
|
||||||
|
// APIVersions is the API versions the resources belong to. '*' is all versions.
|
||||||
|
// If '*' is present, the length of the slice must be one.
|
||||||
|
// Required.
|
||||||
|
APIVersions []string `json:"apiVersions,omitempty" protobuf:"bytes,2,rep,name=apiVersions"`
|
||||||
|
|
||||||
|
// Resources is a list of resources this rule applies to.
|
||||||
|
//
|
||||||
|
// For example:
|
||||||
|
// 'pods' means pods.
|
||||||
|
// 'pods/log' means the log subresource of pods.
|
||||||
|
// '*' means all resources, but not subresources.
|
||||||
|
// 'pods/*' means all subresources of pods.
|
||||||
|
// '*/scale' means all scale subresources.
|
||||||
|
// '*/*' means all resources and their subresources.
|
||||||
|
//
|
||||||
|
// If wildcard is present, the validation rule will ensure resources do not
|
||||||
|
// overlap with each other.
|
||||||
|
//
|
||||||
|
// Depending on the enclosing object, subresources might not be allowed.
|
||||||
|
// Required.
|
||||||
|
Resources []string `json:"resources,omitempty" protobuf:"bytes,3,rep,name=resources"`
|
||||||
|
|
||||||
|
// scope specifies the scope of this rule.
|
||||||
|
// Valid values are "Cluster", "Namespaced", and "*"
|
||||||
|
// "Cluster" means that only cluster-scoped resources will match this rule.
|
||||||
|
// Namespace API objects are cluster-scoped.
|
||||||
|
// "Namespaced" means that only namespaced resources will match this rule.
|
||||||
|
// "*" means that there are no scope restrictions.
|
||||||
|
// Subresources match the scope of their parent resource.
|
||||||
|
// Default is "*".
|
||||||
|
//
|
||||||
|
// +optional
|
||||||
|
Scope *ScopeType `json:"scope,omitempty" protobuf:"bytes,4,rep,name=scope"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type ScopeType string
|
||||||
|
|
||||||
|
const (
|
||||||
|
// ClusterScope means that scope is limited to cluster-scoped objects.
|
||||||
|
// Namespace objects are cluster-scoped.
|
||||||
|
ClusterScope ScopeType = "Cluster"
|
||||||
|
// NamespacedScope means that scope is limited to namespaced objects.
|
||||||
|
NamespacedScope ScopeType = "Namespaced"
|
||||||
|
// AllScopes means that all scopes are included.
|
||||||
|
AllScopes ScopeType = "*"
|
||||||
|
)
|
||||||
|
|
||||||
|
type FailurePolicyType string
|
||||||
|
|
||||||
|
const (
|
||||||
|
// Ignore means that an error calling the webhook is ignored.
|
||||||
|
Ignore FailurePolicyType = "Ignore"
|
||||||
|
// Fail means that an error calling the webhook causes the admission to fail.
|
||||||
|
Fail FailurePolicyType = "Fail"
|
||||||
|
)
|
||||||
|
|
||||||
|
// MatchPolicyType specifies the type of match policy
|
||||||
|
type MatchPolicyType string
|
||||||
|
|
||||||
|
const (
|
||||||
|
// Exact means requests should only be sent to the webhook if they exactly match a given rule
|
||||||
|
Exact MatchPolicyType = "Exact"
|
||||||
|
// Equivalent means requests should be sent to the webhook if they modify a resource listed in rules via another API group or version.
|
||||||
|
Equivalent MatchPolicyType = "Equivalent"
|
||||||
|
)
|
||||||
|
|
||||||
|
type SideEffectClass string
|
||||||
|
|
||||||
|
const (
|
||||||
|
// SideEffectClassUnknown means that no information is known about the side effects of calling the webhook.
|
||||||
|
// If a request with the dry-run attribute would trigger a call to this webhook, the request will instead fail.
|
||||||
|
SideEffectClassUnknown SideEffectClass = "Unknown"
|
||||||
|
// SideEffectClassNone means that calling the webhook will have no side effects.
|
||||||
|
SideEffectClassNone SideEffectClass = "None"
|
||||||
|
// SideEffectClassSome means that calling the webhook will possibly have side effects.
|
||||||
|
// If a request with the dry-run attribute would trigger a call to this webhook, the request will instead fail.
|
||||||
|
SideEffectClassSome SideEffectClass = "Some"
|
||||||
|
// SideEffectClassNoneOnDryRun means that calling the webhook will possibly have side effects, but if the
|
||||||
|
// request being reviewed has the dry-run attribute, the side effects will be suppressed.
|
||||||
|
SideEffectClassNoneOnDryRun SideEffectClass = "NoneOnDryRun"
|
||||||
|
)
|
||||||
|
|
||||||
|
// +genclient
|
||||||
|
// +genclient:nonNamespaced
|
||||||
|
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||||
|
|
||||||
|
// ValidatingWebhookConfiguration describes the configuration of and admission webhook that accept or reject and object without changing it.
|
||||||
|
type ValidatingWebhookConfiguration struct {
|
||||||
|
metav1.TypeMeta `json:",inline"`
|
||||||
|
// Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.
|
||||||
|
// +optional
|
||||||
|
metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
|
||||||
|
// Webhooks is a list of webhooks and the affected resources and operations.
|
||||||
|
// +optional
|
||||||
|
// +patchMergeKey=name
|
||||||
|
// +patchStrategy=merge
|
||||||
|
Webhooks []ValidatingWebhook `json:"webhooks,omitempty" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,2,rep,name=Webhooks"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||||
|
|
||||||
|
// ValidatingWebhookConfigurationList is a list of ValidatingWebhookConfiguration.
|
||||||
|
type ValidatingWebhookConfigurationList struct {
|
||||||
|
metav1.TypeMeta `json:",inline"`
|
||||||
|
// Standard list metadata.
|
||||||
|
// More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
|
||||||
|
// +optional
|
||||||
|
metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
|
||||||
|
// List of ValidatingWebhookConfiguration.
|
||||||
|
Items []ValidatingWebhookConfiguration `json:"items" protobuf:"bytes,2,rep,name=items"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// +genclient
|
||||||
|
// +genclient:nonNamespaced
|
||||||
|
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||||
|
|
||||||
|
// MutatingWebhookConfiguration describes the configuration of and admission webhook that accept or reject and may change the object.
|
||||||
|
type MutatingWebhookConfiguration struct {
|
||||||
|
metav1.TypeMeta `json:",inline"`
|
||||||
|
// Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.
|
||||||
|
// +optional
|
||||||
|
metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
|
||||||
|
// Webhooks is a list of webhooks and the affected resources and operations.
|
||||||
|
// +optional
|
||||||
|
// +patchMergeKey=name
|
||||||
|
// +patchStrategy=merge
|
||||||
|
Webhooks []MutatingWebhook `json:"webhooks,omitempty" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,2,rep,name=Webhooks"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||||
|
|
||||||
|
// MutatingWebhookConfigurationList is a list of MutatingWebhookConfiguration.
|
||||||
|
type MutatingWebhookConfigurationList struct {
|
||||||
|
metav1.TypeMeta `json:",inline"`
|
||||||
|
// Standard list metadata.
|
||||||
|
// More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
|
||||||
|
// +optional
|
||||||
|
metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
|
||||||
|
// List of MutatingWebhookConfiguration.
|
||||||
|
Items []MutatingWebhookConfiguration `json:"items" protobuf:"bytes,2,rep,name=items"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// ValidatingWebhook describes an admission webhook and the resources and operations it applies to.
|
||||||
|
type ValidatingWebhook struct {
|
||||||
|
// The name of the admission webhook.
|
||||||
|
// Name should be fully qualified, e.g., imagepolicy.kubernetes.io, where
|
||||||
|
// "imagepolicy" is the name of the webhook, and kubernetes.io is the name
|
||||||
|
// of the organization.
|
||||||
|
// Required.
|
||||||
|
Name string `json:"name" protobuf:"bytes,1,opt,name=name"`
|
||||||
|
|
||||||
|
// ClientConfig defines how to communicate with the hook.
|
||||||
|
// Required
|
||||||
|
ClientConfig WebhookClientConfig `json:"clientConfig" protobuf:"bytes,2,opt,name=clientConfig"`
|
||||||
|
|
||||||
|
// Rules describes what operations on what resources/subresources the webhook cares about.
|
||||||
|
// The webhook cares about an operation if it matches _any_ Rule.
|
||||||
|
// However, in order to prevent ValidatingAdmissionWebhooks and MutatingAdmissionWebhooks
|
||||||
|
// from putting the cluster in a state which cannot be recovered from without completely
|
||||||
|
// disabling the plugin, ValidatingAdmissionWebhooks and MutatingAdmissionWebhooks are never called
|
||||||
|
// on admission requests for ValidatingWebhookConfiguration and MutatingWebhookConfiguration objects.
|
||||||
|
Rules []RuleWithOperations `json:"rules,omitempty" protobuf:"bytes,3,rep,name=rules"`
|
||||||
|
|
||||||
|
// FailurePolicy defines how unrecognized errors from the admission endpoint are handled -
|
||||||
|
// allowed values are Ignore or Fail. Defaults to Fail.
|
||||||
|
// +optional
|
||||||
|
FailurePolicy *FailurePolicyType `json:"failurePolicy,omitempty" protobuf:"bytes,4,opt,name=failurePolicy,casttype=FailurePolicyType"`
|
||||||
|
|
||||||
|
// matchPolicy defines how the "rules" list is used to match incoming requests.
|
||||||
|
// Allowed values are "Exact" or "Equivalent".
|
||||||
|
//
|
||||||
|
// - Exact: match a request only if it exactly matches a specified rule.
|
||||||
|
// For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1,
|
||||||
|
// but "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`,
|
||||||
|
// a request to apps/v1beta1 or extensions/v1beta1 would not be sent to the webhook.
|
||||||
|
//
|
||||||
|
// - Equivalent: match a request if modifies a resource listed in rules, even via another API group or version.
|
||||||
|
// For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1,
|
||||||
|
// and "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`,
|
||||||
|
// a request to apps/v1beta1 or extensions/v1beta1 would be converted to apps/v1 and sent to the webhook.
|
||||||
|
//
|
||||||
|
// Defaults to "Equivalent"
|
||||||
|
// +optional
|
||||||
|
MatchPolicy *MatchPolicyType `json:"matchPolicy,omitempty" protobuf:"bytes,9,opt,name=matchPolicy,casttype=MatchPolicyType"`
|
||||||
|
|
||||||
|
// NamespaceSelector decides whether to run the webhook on an object based
|
||||||
|
// on whether the namespace for that object matches the selector. If the
|
||||||
|
// object itself is a namespace, the matching is performed on
|
||||||
|
// object.metadata.labels. If the object is another cluster scoped resource,
|
||||||
|
// it never skips the webhook.
|
||||||
|
//
|
||||||
|
// For example, to run the webhook on any objects whose namespace is not
|
||||||
|
// associated with "runlevel" of "0" or "1"; you will set the selector as
|
||||||
|
// follows:
|
||||||
|
// "namespaceSelector": {
|
||||||
|
// "matchExpressions": [
|
||||||
|
// {
|
||||||
|
// "key": "runlevel",
|
||||||
|
// "operator": "NotIn",
|
||||||
|
// "values": [
|
||||||
|
// "0",
|
||||||
|
// "1"
|
||||||
|
// ]
|
||||||
|
// }
|
||||||
|
// ]
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// If instead you want to only run the webhook on any objects whose
|
||||||
|
// namespace is associated with the "environment" of "prod" or "staging";
|
||||||
|
// you will set the selector as follows:
|
||||||
|
// "namespaceSelector": {
|
||||||
|
// "matchExpressions": [
|
||||||
|
// {
|
||||||
|
// "key": "environment",
|
||||||
|
// "operator": "In",
|
||||||
|
// "values": [
|
||||||
|
// "prod",
|
||||||
|
// "staging"
|
||||||
|
// ]
|
||||||
|
// }
|
||||||
|
// ]
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// See
|
||||||
|
// https://kubernetes.io/docs/concepts/overview/working-with-objects/labels
|
||||||
|
// for more examples of label selectors.
|
||||||
|
//
|
||||||
|
// Default to the empty LabelSelector, which matches everything.
|
||||||
|
// +optional
|
||||||
|
NamespaceSelector *metav1.LabelSelector `json:"namespaceSelector,omitempty" protobuf:"bytes,5,opt,name=namespaceSelector"`
|
||||||
|
|
||||||
|
// ObjectSelector decides whether to run the webhook based on if the
|
||||||
|
// object has matching labels. objectSelector is evaluated against both
|
||||||
|
// the oldObject and newObject that would be sent to the webhook, and
|
||||||
|
// is considered to match if either object matches the selector. A null
|
||||||
|
// object (oldObject in the case of create, or newObject in the case of
|
||||||
|
// delete) or an object that cannot have labels (like a
|
||||||
|
// DeploymentRollback or a PodProxyOptions object) is not considered to
|
||||||
|
// match.
|
||||||
|
// Use the object selector only if the webhook is opt-in, because end
|
||||||
|
// users may skip the admission webhook by setting the labels.
|
||||||
|
// Default to the empty LabelSelector, which matches everything.
|
||||||
|
// +optional
|
||||||
|
ObjectSelector *metav1.LabelSelector `json:"objectSelector,omitempty" protobuf:"bytes,10,opt,name=objectSelector"`
|
||||||
|
|
||||||
|
// SideEffects states whether this webhookk has side effects.
|
||||||
|
// Acceptable values are: Unknown, None, Some, NoneOnDryRun
|
||||||
|
// Webhooks with side effects MUST implement a reconciliation system, since a request may be
|
||||||
|
// rejected by a future step in the admission change and the side effects therefore need to be undone.
|
||||||
|
// Requests with the dryRun attribute will be auto-rejected if they match a webhook with
|
||||||
|
// sideEffects == Unknown or Some.
|
||||||
|
SideEffects *SideEffectClass `json:"sideEffects" protobuf:"bytes,6,opt,name=sideEffects,casttype=SideEffectClass"`
|
||||||
|
|
||||||
|
// TimeoutSeconds specifies the timeout for this webhook. After the timeout passes,
|
||||||
|
// the webhook call will be ignored or the API call will fail based on the
|
||||||
|
// failure policy.
|
||||||
|
// The timeout value must be between 1 and 30 seconds.
|
||||||
|
// Default to 10 seconds.
|
||||||
|
// +optional
|
||||||
|
TimeoutSeconds *int32 `json:"timeoutSeconds,omitempty" protobuf:"varint,7,opt,name=timeoutSeconds"`
|
||||||
|
|
||||||
|
// AdmissionReviewVersions is an ordered list of preferred `AdmissionReview`
|
||||||
|
// versions the Webhook expects. API server will try to use first version in
|
||||||
|
// the list which it supports. If none of the versions specified in this list
|
||||||
|
// supported by API server, validation will fail for this object.
|
||||||
|
// If a persisted webhook configuration specifies allowed versions and does not
|
||||||
|
// include any versions known to the API Server, calls to the webhook will fail
|
||||||
|
// and be subject to the failure policy.
|
||||||
|
AdmissionReviewVersions []string `json:"admissionReviewVersions" protobuf:"bytes,8,rep,name=admissionReviewVersions"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// MutatingWebhook describes an admission webhook and the resources and operations it applies to.
|
||||||
|
type MutatingWebhook struct {
|
||||||
|
// The name of the admission webhook.
|
||||||
|
// Name should be fully qualified, e.g., imagepolicy.kubernetes.io, where
|
||||||
|
// "imagepolicy" is the name of the webhook, and kubernetes.io is the name
|
||||||
|
// of the organization.
|
||||||
|
// Required.
|
||||||
|
Name string `json:"name" protobuf:"bytes,1,opt,name=name"`
|
||||||
|
|
||||||
|
// ClientConfig defines how to communicate with the hook.
|
||||||
|
// Required
|
||||||
|
ClientConfig WebhookClientConfig `json:"clientConfig" protobuf:"bytes,2,opt,name=clientConfig"`
|
||||||
|
|
||||||
|
// Rules describes what operations on what resources/subresources the webhook cares about.
|
||||||
|
// The webhook cares about an operation if it matches _any_ Rule.
|
||||||
|
// However, in order to prevent ValidatingAdmissionWebhooks and MutatingAdmissionWebhooks
|
||||||
|
// from putting the cluster in a state which cannot be recovered from without completely
|
||||||
|
// disabling the plugin, ValidatingAdmissionWebhooks and MutatingAdmissionWebhooks are never called
|
||||||
|
// on admission requests for ValidatingWebhookConfiguration and MutatingWebhookConfiguration objects.
|
||||||
|
Rules []RuleWithOperations `json:"rules,omitempty" protobuf:"bytes,3,rep,name=rules"`
|
||||||
|
|
||||||
|
// FailurePolicy defines how unrecognized errors from the admission endpoint are handled -
|
||||||
|
// allowed values are Ignore or Fail. Defaults to Fail.
|
||||||
|
// +optional
|
||||||
|
FailurePolicy *FailurePolicyType `json:"failurePolicy,omitempty" protobuf:"bytes,4,opt,name=failurePolicy,casttype=FailurePolicyType"`
|
||||||
|
|
||||||
|
// matchPolicy defines how the "rules" list is used to match incoming requests.
|
||||||
|
// Allowed values are "Exact" or "Equivalent".
|
||||||
|
//
|
||||||
|
// - Exact: match a request only if it exactly matches a specified rule.
|
||||||
|
// For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1,
|
||||||
|
// but "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`,
|
||||||
|
// a request to apps/v1beta1 or extensions/v1beta1 would not be sent to the webhook.
|
||||||
|
//
|
||||||
|
// - Equivalent: match a request if modifies a resource listed in rules, even via another API group or version.
|
||||||
|
// For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1,
|
||||||
|
// and "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`,
|
||||||
|
// a request to apps/v1beta1 or extensions/v1beta1 would be converted to apps/v1 and sent to the webhook.
|
||||||
|
//
|
||||||
|
// Defaults to "Equivalent"
|
||||||
|
// +optional
|
||||||
|
MatchPolicy *MatchPolicyType `json:"matchPolicy,omitempty" protobuf:"bytes,9,opt,name=matchPolicy,casttype=MatchPolicyType"`
|
||||||
|
|
||||||
|
// NamespaceSelector decides whether to run the webhook on an object based
|
||||||
|
// on whether the namespace for that object matches the selector. If the
|
||||||
|
// object itself is a namespace, the matching is performed on
|
||||||
|
// object.metadata.labels. If the object is another cluster scoped resource,
|
||||||
|
// it never skips the webhook.
|
||||||
|
//
|
||||||
|
// For example, to run the webhook on any objects whose namespace is not
|
||||||
|
// associated with "runlevel" of "0" or "1"; you will set the selector as
|
||||||
|
// follows:
|
||||||
|
// "namespaceSelector": {
|
||||||
|
// "matchExpressions": [
|
||||||
|
// {
|
||||||
|
// "key": "runlevel",
|
||||||
|
// "operator": "NotIn",
|
||||||
|
// "values": [
|
||||||
|
// "0",
|
||||||
|
// "1"
|
||||||
|
// ]
|
||||||
|
// }
|
||||||
|
// ]
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// If instead you want to only run the webhook on any objects whose
|
||||||
|
// namespace is associated with the "environment" of "prod" or "staging";
|
||||||
|
// you will set the selector as follows:
|
||||||
|
// "namespaceSelector": {
|
||||||
|
// "matchExpressions": [
|
||||||
|
// {
|
||||||
|
// "key": "environment",
|
||||||
|
// "operator": "In",
|
||||||
|
// "values": [
|
||||||
|
// "prod",
|
||||||
|
// "staging"
|
||||||
|
// ]
|
||||||
|
// }
|
||||||
|
// ]
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// See
|
||||||
|
// https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
|
||||||
|
// for more examples of label selectors.
|
||||||
|
//
|
||||||
|
// Default to the empty LabelSelector, which matches everything.
|
||||||
|
// +optional
|
||||||
|
NamespaceSelector *metav1.LabelSelector `json:"namespaceSelector,omitempty" protobuf:"bytes,5,opt,name=namespaceSelector"`
|
||||||
|
|
||||||
|
// ObjectSelector decides whether to run the webhook based on if the
|
||||||
|
// object has matching labels. objectSelector is evaluated against both
|
||||||
|
// the oldObject and newObject that would be sent to the webhook, and
|
||||||
|
// is considered to match if either object matches the selector. A null
|
||||||
|
// object (oldObject in the case of create, or newObject in the case of
|
||||||
|
// delete) or an object that cannot have labels (like a
|
||||||
|
// DeploymentRollback or a PodProxyOptions object) is not considered to
|
||||||
|
// match.
|
||||||
|
// Use the object selector only if the webhook is opt-in, because end
|
||||||
|
// users may skip the admission webhook by setting the labels.
|
||||||
|
// Default to the empty LabelSelector, which matches everything.
|
||||||
|
// +optional
|
||||||
|
ObjectSelector *metav1.LabelSelector `json:"objectSelector,omitempty" protobuf:"bytes,11,opt,name=objectSelector"`
|
||||||
|
|
||||||
|
// SideEffects states whether this webhookk has side effects.
|
||||||
|
// Acceptable values are: Unknown, None, Some, NoneOnDryRun
|
||||||
|
// Webhooks with side effects MUST implement a reconciliation system, since a request may be
|
||||||
|
// rejected by a future step in the admission change and the side effects therefore need to be undone.
|
||||||
|
// Requests with the dryRun attribute will be auto-rejected if they match a webhook with
|
||||||
|
// sideEffects == Unknown or Some.
|
||||||
|
SideEffects *SideEffectClass `json:"sideEffects" protobuf:"bytes,6,opt,name=sideEffects,casttype=SideEffectClass"`
|
||||||
|
|
||||||
|
// TimeoutSeconds specifies the timeout for this webhook. After the timeout passes,
|
||||||
|
// the webhook call will be ignored or the API call will fail based on the
|
||||||
|
// failure policy.
|
||||||
|
// The timeout value must be between 1 and 30 seconds.
|
||||||
|
// Default to 10 seconds.
|
||||||
|
// +optional
|
||||||
|
TimeoutSeconds *int32 `json:"timeoutSeconds,omitempty" protobuf:"varint,7,opt,name=timeoutSeconds"`
|
||||||
|
|
||||||
|
// AdmissionReviewVersions is an ordered list of preferred `AdmissionReview`
|
||||||
|
// versions the Webhook expects. API server will try to use first version in
|
||||||
|
// the list which it supports. If none of the versions specified in this list
|
||||||
|
// supported by API server, validation will fail for this object.
|
||||||
|
// If a persisted webhook configuration specifies allowed versions and does not
|
||||||
|
// include any versions known to the API Server, calls to the webhook will fail
|
||||||
|
// and be subject to the failure policy.
|
||||||
|
AdmissionReviewVersions []string `json:"admissionReviewVersions" protobuf:"bytes,8,rep,name=admissionReviewVersions"`
|
||||||
|
|
||||||
|
// reinvocationPolicy indicates whether this webhook should be called multiple times as part of a single admission evaluation.
|
||||||
|
// Allowed values are "Never" and "IfNeeded".
|
||||||
|
//
|
||||||
|
// Never: the webhook will not be called more than once in a single admission evaluation.
|
||||||
|
//
|
||||||
|
// IfNeeded: the webhook will be called at least one additional time as part of the admission evaluation
|
||||||
|
// if the object being admitted is modified by other admission plugins after the initial webhook call.
|
||||||
|
// Webhooks that specify this option *must* be idempotent, able to process objects they previously admitted.
|
||||||
|
// Note:
|
||||||
|
// * the number of additional invocations is not guaranteed to be exactly one.
|
||||||
|
// * if additional invocations result in further modifications to the object, webhooks are not guaranteed to be invoked again.
|
||||||
|
// * webhooks that use this option may be reordered to minimize the number of additional invocations.
|
||||||
|
// * to validate an object after all mutations are guaranteed complete, use a validating admission webhook instead.
|
||||||
|
//
|
||||||
|
// Defaults to "Never".
|
||||||
|
// +optional
|
||||||
|
ReinvocationPolicy *ReinvocationPolicyType `json:"reinvocationPolicy,omitempty" protobuf:"bytes,10,opt,name=reinvocationPolicy,casttype=ReinvocationPolicyType"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// ReinvocationPolicyType specifies what type of policy the admission hook uses.
|
||||||
|
type ReinvocationPolicyType string
|
||||||
|
|
||||||
|
const (
|
||||||
|
// NeverReinvocationPolicy indicates that the webhook must not be called more than once in a
|
||||||
|
// single admission evaluation.
|
||||||
|
NeverReinvocationPolicy ReinvocationPolicyType = "Never"
|
||||||
|
// IfNeededReinvocationPolicy indicates that the webhook may be called at least one
|
||||||
|
// additional time as part of the admission evaluation if the object being admitted is
|
||||||
|
// modified by other admission plugins after the initial webhook call.
|
||||||
|
IfNeededReinvocationPolicy ReinvocationPolicyType = "IfNeeded"
|
||||||
|
)
|
||||||
|
|
||||||
|
// RuleWithOperations is a tuple of Operations and Resources. It is recommended to make
|
||||||
|
// sure that all the tuple expansions are valid.
|
||||||
|
type RuleWithOperations struct {
|
||||||
|
// Operations is the operations the admission hook cares about - CREATE, UPDATE, or *
|
||||||
|
// for all operations.
|
||||||
|
// If '*' is present, the length of the slice must be one.
|
||||||
|
// Required.
|
||||||
|
Operations []OperationType `json:"operations,omitempty" protobuf:"bytes,1,rep,name=operations,casttype=OperationType"`
|
||||||
|
// Rule is embedded, it describes other criteria of the rule, like
|
||||||
|
// APIGroups, APIVersions, Resources, etc.
|
||||||
|
Rule `json:",inline" protobuf:"bytes,2,opt,name=rule"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type OperationType string
|
||||||
|
|
||||||
|
// The constants should be kept in sync with those defined in k8s.io/kubernetes/pkg/admission/interface.go.
|
||||||
|
const (
|
||||||
|
OperationAll OperationType = "*"
|
||||||
|
Create OperationType = "CREATE"
|
||||||
|
Update OperationType = "UPDATE"
|
||||||
|
Delete OperationType = "DELETE"
|
||||||
|
Connect OperationType = "CONNECT"
|
||||||
|
)
|
||||||
|
|
||||||
|
// WebhookClientConfig contains the information to make a TLS
|
||||||
|
// connection with the webhook
|
||||||
|
type WebhookClientConfig struct {
|
||||||
|
// `url` gives the location of the webhook, in standard URL form
|
||||||
|
// (`scheme://host:port/path`). Exactly one of `url` or `service`
|
||||||
|
// must be specified.
|
||||||
|
//
|
||||||
|
// The `host` should not refer to a service running in the cluster; use
|
||||||
|
// the `service` field instead. The host might be resolved via external
|
||||||
|
// DNS in some apiservers (e.g., `kube-apiserver` cannot resolve
|
||||||
|
// in-cluster DNS as that would be a layering violation). `host` may
|
||||||
|
// also be an IP address.
|
||||||
|
//
|
||||||
|
// Please note that using `localhost` or `127.0.0.1` as a `host` is
|
||||||
|
// risky unless you take great care to run this webhook on all hosts
|
||||||
|
// which run an apiserver which might need to make calls to this
|
||||||
|
// webhook. Such installs are likely to be non-portable, i.e., not easy
|
||||||
|
// to turn up in a new cluster.
|
||||||
|
//
|
||||||
|
// The scheme must be "https"; the URL must begin with "https://".
|
||||||
|
//
|
||||||
|
// A path is optional, and if present may be any string permissible in
|
||||||
|
// a URL. You may use the path to pass an arbitrary string to the
|
||||||
|
// webhook, for example, a cluster identifier.
|
||||||
|
//
|
||||||
|
// Attempting to use a user or basic auth e.g. "user:password@" is not
|
||||||
|
// allowed. Fragments ("#...") and query parameters ("?...") are not
|
||||||
|
// allowed, either.
|
||||||
|
//
|
||||||
|
// +optional
|
||||||
|
URL *string `json:"url,omitempty" protobuf:"bytes,3,opt,name=url"`
|
||||||
|
|
||||||
|
// `service` is a reference to the service for this webhook. Either
|
||||||
|
// `service` or `url` must be specified.
|
||||||
|
//
|
||||||
|
// If the webhook is running within the cluster, then you should use `service`.
|
||||||
|
//
|
||||||
|
// +optional
|
||||||
|
Service *ServiceReference `json:"service,omitempty" protobuf:"bytes,1,opt,name=service"`
|
||||||
|
|
||||||
|
// `caBundle` is a PEM encoded CA bundle which will be used to validate the webhook's server certificate.
|
||||||
|
// If unspecified, system trust roots on the apiserver are used.
|
||||||
|
// +optional
|
||||||
|
CABundle []byte `json:"caBundle,omitempty" protobuf:"bytes,2,opt,name=caBundle"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// ServiceReference holds a reference to Service.legacy.k8s.io
|
||||||
|
type ServiceReference struct {
|
||||||
|
// `namespace` is the namespace of the service.
|
||||||
|
// Required
|
||||||
|
Namespace string `json:"namespace" protobuf:"bytes,1,opt,name=namespace"`
|
||||||
|
// `name` is the name of the service.
|
||||||
|
// Required
|
||||||
|
Name string `json:"name" protobuf:"bytes,2,opt,name=name"`
|
||||||
|
|
||||||
|
// `path` is an optional URL path which will be sent in any request to
|
||||||
|
// this service.
|
||||||
|
// +optional
|
||||||
|
Path *string `json:"path,omitempty" protobuf:"bytes,3,opt,name=path"`
|
||||||
|
|
||||||
|
// If specified, the port on the service that hosting webhook.
|
||||||
|
// Default to 443 for backward compatibility.
|
||||||
|
// `port` should be a valid port number (1-65535, inclusive).
|
||||||
|
// +optional
|
||||||
|
Port *int32 `json:"port,omitempty" protobuf:"varint,4,opt,name=port"`
|
||||||
|
}
|
151
staging/src/k8s.io/api/admissionregistration/v1/types_swagger_doc_generated.go
generated
Normal file
151
staging/src/k8s.io/api/admissionregistration/v1/types_swagger_doc_generated.go
generated
Normal file
@ -0,0 +1,151 @@
|
|||||||
|
/*
|
||||||
|
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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package v1
|
||||||
|
|
||||||
|
// This file contains a collection of methods that can be used from go-restful to
|
||||||
|
// generate Swagger API documentation for its models. Please read this PR for more
|
||||||
|
// information on the implementation: https://github.com/emicklei/go-restful/pull/215
|
||||||
|
//
|
||||||
|
// TODOs are ignored from the parser (e.g. TODO(andronat):... || TODO:...) if and only if
|
||||||
|
// they are on one line! For multiple line or blocks that you want to ignore use ---.
|
||||||
|
// Any context after a --- is ignored.
|
||||||
|
//
|
||||||
|
// Those methods can be generated by using hack/update-generated-swagger-docs.sh
|
||||||
|
|
||||||
|
// AUTO-GENERATED FUNCTIONS START HERE. DO NOT EDIT.
|
||||||
|
var map_MutatingWebhook = map[string]string{
|
||||||
|
"": "MutatingWebhook describes an admission webhook and the resources and operations it applies to.",
|
||||||
|
"name": "The name of the admission webhook. Name should be fully qualified, e.g., imagepolicy.kubernetes.io, where \"imagepolicy\" is the name of the webhook, and kubernetes.io is the name of the organization. Required.",
|
||||||
|
"clientConfig": "ClientConfig defines how to communicate with the hook. Required",
|
||||||
|
"rules": "Rules describes what operations on what resources/subresources the webhook cares about. The webhook cares about an operation if it matches _any_ Rule. However, in order to prevent ValidatingAdmissionWebhooks and MutatingAdmissionWebhooks from putting the cluster in a state which cannot be recovered from without completely disabling the plugin, ValidatingAdmissionWebhooks and MutatingAdmissionWebhooks are never called on admission requests for ValidatingWebhookConfiguration and MutatingWebhookConfiguration objects.",
|
||||||
|
"failurePolicy": "FailurePolicy defines how unrecognized errors from the admission endpoint are handled - allowed values are Ignore or Fail. Defaults to Fail.",
|
||||||
|
"matchPolicy": "matchPolicy defines how the \"rules\" list is used to match incoming requests. Allowed values are \"Exact\" or \"Equivalent\".\n\n- Exact: match a request only if it exactly matches a specified rule. For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, but \"rules\" only included `apiGroups:[\"apps\"], apiVersions:[\"v1\"], resources: [\"deployments\"]`, a request to apps/v1beta1 or extensions/v1beta1 would not be sent to the webhook.\n\n- Equivalent: match a request if modifies a resource listed in rules, even via another API group or version. For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, and \"rules\" only included `apiGroups:[\"apps\"], apiVersions:[\"v1\"], resources: [\"deployments\"]`, a request to apps/v1beta1 or extensions/v1beta1 would be converted to apps/v1 and sent to the webhook.\n\nDefaults to \"Equivalent\"",
|
||||||
|
"namespaceSelector": "NamespaceSelector decides whether to run the webhook on an object based on whether the namespace for that object matches the selector. If the object itself is a namespace, the matching is performed on object.metadata.labels. If the object is another cluster scoped resource, it never skips the webhook.\n\nFor example, to run the webhook on any objects whose namespace is not associated with \"runlevel\" of \"0\" or \"1\"; you will set the selector as follows: \"namespaceSelector\": {\n \"matchExpressions\": [\n {\n \"key\": \"runlevel\",\n \"operator\": \"NotIn\",\n \"values\": [\n \"0\",\n \"1\"\n ]\n }\n ]\n}\n\nIf instead you want to only run the webhook on any objects whose namespace is associated with the \"environment\" of \"prod\" or \"staging\"; you will set the selector as follows: \"namespaceSelector\": {\n \"matchExpressions\": [\n {\n \"key\": \"environment\",\n \"operator\": \"In\",\n \"values\": [\n \"prod\",\n \"staging\"\n ]\n }\n ]\n}\n\nSee https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ for more examples of label selectors.\n\nDefault to the empty LabelSelector, which matches everything.",
|
||||||
|
"objectSelector": "ObjectSelector decides whether to run the webhook based on if the object has matching labels. objectSelector is evaluated against both the oldObject and newObject that would be sent to the webhook, and is considered to match if either object matches the selector. A null object (oldObject in the case of create, or newObject in the case of delete) or an object that cannot have labels (like a DeploymentRollback or a PodProxyOptions object) is not considered to match. Use the object selector only if the webhook is opt-in, because end users may skip the admission webhook by setting the labels. Default to the empty LabelSelector, which matches everything.",
|
||||||
|
"sideEffects": "SideEffects states whether this webhookk has side effects. Acceptable values are: Unknown, None, Some, NoneOnDryRun Webhooks with side effects MUST implement a reconciliation system, since a request may be rejected by a future step in the admission change and the side effects therefore need to be undone. Requests with the dryRun attribute will be auto-rejected if they match a webhook with sideEffects == Unknown or Some.",
|
||||||
|
"timeoutSeconds": "TimeoutSeconds specifies the timeout for this webhook. After the timeout passes, the webhook call will be ignored or the API call will fail based on the failure policy. The timeout value must be between 1 and 30 seconds. Default to 10 seconds.",
|
||||||
|
"admissionReviewVersions": "AdmissionReviewVersions is an ordered list of preferred `AdmissionReview` versions the Webhook expects. API server will try to use first version in the list which it supports. If none of the versions specified in this list supported by API server, validation will fail for this object. If a persisted webhook configuration specifies allowed versions and does not include any versions known to the API Server, calls to the webhook will fail and be subject to the failure policy.",
|
||||||
|
"reinvocationPolicy": "reinvocationPolicy indicates whether this webhook should be called multiple times as part of a single admission evaluation. Allowed values are \"Never\" and \"IfNeeded\".\n\nNever: the webhook will not be called more than once in a single admission evaluation.\n\nIfNeeded: the webhook will be called at least one additional time as part of the admission evaluation if the object being admitted is modified by other admission plugins after the initial webhook call. Webhooks that specify this option *must* be idempotent, able to process objects they previously admitted. Note: * the number of additional invocations is not guaranteed to be exactly one. * if additional invocations result in further modifications to the object, webhooks are not guaranteed to be invoked again. * webhooks that use this option may be reordered to minimize the number of additional invocations. * to validate an object after all mutations are guaranteed complete, use a validating admission webhook instead.\n\nDefaults to \"Never\".",
|
||||||
|
}
|
||||||
|
|
||||||
|
func (MutatingWebhook) SwaggerDoc() map[string]string {
|
||||||
|
return map_MutatingWebhook
|
||||||
|
}
|
||||||
|
|
||||||
|
var map_MutatingWebhookConfiguration = map[string]string{
|
||||||
|
"": "MutatingWebhookConfiguration describes the configuration of and admission webhook that accept or reject and may change the object.",
|
||||||
|
"metadata": "Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.",
|
||||||
|
"webhooks": "Webhooks is a list of webhooks and the affected resources and operations.",
|
||||||
|
}
|
||||||
|
|
||||||
|
func (MutatingWebhookConfiguration) SwaggerDoc() map[string]string {
|
||||||
|
return map_MutatingWebhookConfiguration
|
||||||
|
}
|
||||||
|
|
||||||
|
var map_MutatingWebhookConfigurationList = map[string]string{
|
||||||
|
"": "MutatingWebhookConfigurationList is a list of MutatingWebhookConfiguration.",
|
||||||
|
"metadata": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds",
|
||||||
|
"items": "List of MutatingWebhookConfiguration.",
|
||||||
|
}
|
||||||
|
|
||||||
|
func (MutatingWebhookConfigurationList) SwaggerDoc() map[string]string {
|
||||||
|
return map_MutatingWebhookConfigurationList
|
||||||
|
}
|
||||||
|
|
||||||
|
var map_Rule = map[string]string{
|
||||||
|
"": "Rule is a tuple of APIGroups, APIVersion, and Resources.It is recommended to make sure that all the tuple expansions are valid.",
|
||||||
|
"apiGroups": "APIGroups is the API groups the resources belong to. '*' is all groups. If '*' is present, the length of the slice must be one. Required.",
|
||||||
|
"apiVersions": "APIVersions is the API versions the resources belong to. '*' is all versions. If '*' is present, the length of the slice must be one. Required.",
|
||||||
|
"resources": "Resources is a list of resources this rule applies to.\n\nFor example: 'pods' means pods. 'pods/log' means the log subresource of pods. '*' means all resources, but not subresources. 'pods/*' means all subresources of pods. '*/scale' means all scale subresources. '*/*' means all resources and their subresources.\n\nIf wildcard is present, the validation rule will ensure resources do not overlap with each other.\n\nDepending on the enclosing object, subresources might not be allowed. Required.",
|
||||||
|
"scope": "scope specifies the scope of this rule. Valid values are \"Cluster\", \"Namespaced\", and \"*\" \"Cluster\" means that only cluster-scoped resources will match this rule. Namespace API objects are cluster-scoped. \"Namespaced\" means that only namespaced resources will match this rule. \"*\" means that there are no scope restrictions. Subresources match the scope of their parent resource. Default is \"*\".",
|
||||||
|
}
|
||||||
|
|
||||||
|
func (Rule) SwaggerDoc() map[string]string {
|
||||||
|
return map_Rule
|
||||||
|
}
|
||||||
|
|
||||||
|
var map_RuleWithOperations = map[string]string{
|
||||||
|
"": "RuleWithOperations is a tuple of Operations and Resources. It is recommended to make sure that all the tuple expansions are valid.",
|
||||||
|
"operations": "Operations is the operations the admission hook cares about - CREATE, UPDATE, or * for all operations. If '*' is present, the length of the slice must be one. Required.",
|
||||||
|
}
|
||||||
|
|
||||||
|
func (RuleWithOperations) SwaggerDoc() map[string]string {
|
||||||
|
return map_RuleWithOperations
|
||||||
|
}
|
||||||
|
|
||||||
|
var map_ServiceReference = map[string]string{
|
||||||
|
"": "ServiceReference holds a reference to Service.legacy.k8s.io",
|
||||||
|
"namespace": "`namespace` is the namespace of the service. Required",
|
||||||
|
"name": "`name` is the name of the service. Required",
|
||||||
|
"path": "`path` is an optional URL path which will be sent in any request to this service.",
|
||||||
|
"port": "If specified, the port on the service that hosting webhook. Default to 443 for backward compatibility. `port` should be a valid port number (1-65535, inclusive).",
|
||||||
|
}
|
||||||
|
|
||||||
|
func (ServiceReference) SwaggerDoc() map[string]string {
|
||||||
|
return map_ServiceReference
|
||||||
|
}
|
||||||
|
|
||||||
|
var map_ValidatingWebhook = map[string]string{
|
||||||
|
"": "ValidatingWebhook describes an admission webhook and the resources and operations it applies to.",
|
||||||
|
"name": "The name of the admission webhook. Name should be fully qualified, e.g., imagepolicy.kubernetes.io, where \"imagepolicy\" is the name of the webhook, and kubernetes.io is the name of the organization. Required.",
|
||||||
|
"clientConfig": "ClientConfig defines how to communicate with the hook. Required",
|
||||||
|
"rules": "Rules describes what operations on what resources/subresources the webhook cares about. The webhook cares about an operation if it matches _any_ Rule. However, in order to prevent ValidatingAdmissionWebhooks and MutatingAdmissionWebhooks from putting the cluster in a state which cannot be recovered from without completely disabling the plugin, ValidatingAdmissionWebhooks and MutatingAdmissionWebhooks are never called on admission requests for ValidatingWebhookConfiguration and MutatingWebhookConfiguration objects.",
|
||||||
|
"failurePolicy": "FailurePolicy defines how unrecognized errors from the admission endpoint are handled - allowed values are Ignore or Fail. Defaults to Fail.",
|
||||||
|
"matchPolicy": "matchPolicy defines how the \"rules\" list is used to match incoming requests. Allowed values are \"Exact\" or \"Equivalent\".\n\n- Exact: match a request only if it exactly matches a specified rule. For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, but \"rules\" only included `apiGroups:[\"apps\"], apiVersions:[\"v1\"], resources: [\"deployments\"]`, a request to apps/v1beta1 or extensions/v1beta1 would not be sent to the webhook.\n\n- Equivalent: match a request if modifies a resource listed in rules, even via another API group or version. For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, and \"rules\" only included `apiGroups:[\"apps\"], apiVersions:[\"v1\"], resources: [\"deployments\"]`, a request to apps/v1beta1 or extensions/v1beta1 would be converted to apps/v1 and sent to the webhook.\n\nDefaults to \"Equivalent\"",
|
||||||
|
"namespaceSelector": "NamespaceSelector decides whether to run the webhook on an object based on whether the namespace for that object matches the selector. If the object itself is a namespace, the matching is performed on object.metadata.labels. If the object is another cluster scoped resource, it never skips the webhook.\n\nFor example, to run the webhook on any objects whose namespace is not associated with \"runlevel\" of \"0\" or \"1\"; you will set the selector as follows: \"namespaceSelector\": {\n \"matchExpressions\": [\n {\n \"key\": \"runlevel\",\n \"operator\": \"NotIn\",\n \"values\": [\n \"0\",\n \"1\"\n ]\n }\n ]\n}\n\nIf instead you want to only run the webhook on any objects whose namespace is associated with the \"environment\" of \"prod\" or \"staging\"; you will set the selector as follows: \"namespaceSelector\": {\n \"matchExpressions\": [\n {\n \"key\": \"environment\",\n \"operator\": \"In\",\n \"values\": [\n \"prod\",\n \"staging\"\n ]\n }\n ]\n}\n\nSee https://kubernetes.io/docs/concepts/overview/working-with-objects/labels for more examples of label selectors.\n\nDefault to the empty LabelSelector, which matches everything.",
|
||||||
|
"objectSelector": "ObjectSelector decides whether to run the webhook based on if the object has matching labels. objectSelector is evaluated against both the oldObject and newObject that would be sent to the webhook, and is considered to match if either object matches the selector. A null object (oldObject in the case of create, or newObject in the case of delete) or an object that cannot have labels (like a DeploymentRollback or a PodProxyOptions object) is not considered to match. Use the object selector only if the webhook is opt-in, because end users may skip the admission webhook by setting the labels. Default to the empty LabelSelector, which matches everything.",
|
||||||
|
"sideEffects": "SideEffects states whether this webhookk has side effects. Acceptable values are: Unknown, None, Some, NoneOnDryRun Webhooks with side effects MUST implement a reconciliation system, since a request may be rejected by a future step in the admission change and the side effects therefore need to be undone. Requests with the dryRun attribute will be auto-rejected if they match a webhook with sideEffects == Unknown or Some.",
|
||||||
|
"timeoutSeconds": "TimeoutSeconds specifies the timeout for this webhook. After the timeout passes, the webhook call will be ignored or the API call will fail based on the failure policy. The timeout value must be between 1 and 30 seconds. Default to 10 seconds.",
|
||||||
|
"admissionReviewVersions": "AdmissionReviewVersions is an ordered list of preferred `AdmissionReview` versions the Webhook expects. API server will try to use first version in the list which it supports. If none of the versions specified in this list supported by API server, validation will fail for this object. If a persisted webhook configuration specifies allowed versions and does not include any versions known to the API Server, calls to the webhook will fail and be subject to the failure policy.",
|
||||||
|
}
|
||||||
|
|
||||||
|
func (ValidatingWebhook) SwaggerDoc() map[string]string {
|
||||||
|
return map_ValidatingWebhook
|
||||||
|
}
|
||||||
|
|
||||||
|
var map_ValidatingWebhookConfiguration = map[string]string{
|
||||||
|
"": "ValidatingWebhookConfiguration describes the configuration of and admission webhook that accept or reject and object without changing it.",
|
||||||
|
"metadata": "Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata.",
|
||||||
|
"webhooks": "Webhooks is a list of webhooks and the affected resources and operations.",
|
||||||
|
}
|
||||||
|
|
||||||
|
func (ValidatingWebhookConfiguration) SwaggerDoc() map[string]string {
|
||||||
|
return map_ValidatingWebhookConfiguration
|
||||||
|
}
|
||||||
|
|
||||||
|
var map_ValidatingWebhookConfigurationList = map[string]string{
|
||||||
|
"": "ValidatingWebhookConfigurationList is a list of ValidatingWebhookConfiguration.",
|
||||||
|
"metadata": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds",
|
||||||
|
"items": "List of ValidatingWebhookConfiguration.",
|
||||||
|
}
|
||||||
|
|
||||||
|
func (ValidatingWebhookConfigurationList) SwaggerDoc() map[string]string {
|
||||||
|
return map_ValidatingWebhookConfigurationList
|
||||||
|
}
|
||||||
|
|
||||||
|
var map_WebhookClientConfig = map[string]string{
|
||||||
|
"": "WebhookClientConfig contains the information to make a TLS connection with the webhook",
|
||||||
|
"url": "`url` gives the location of the webhook, in standard URL form (`scheme://host:port/path`). Exactly one of `url` or `service` must be specified.\n\nThe `host` should not refer to a service running in the cluster; use the `service` field instead. The host might be resolved via external DNS in some apiservers (e.g., `kube-apiserver` cannot resolve in-cluster DNS as that would be a layering violation). `host` may also be an IP address.\n\nPlease note that using `localhost` or `127.0.0.1` as a `host` is risky unless you take great care to run this webhook on all hosts which run an apiserver which might need to make calls to this webhook. Such installs are likely to be non-portable, i.e., not easy to turn up in a new cluster.\n\nThe scheme must be \"https\"; the URL must begin with \"https://\".\n\nA path is optional, and if present may be any string permissible in a URL. You may use the path to pass an arbitrary string to the webhook, for example, a cluster identifier.\n\nAttempting to use a user or basic auth e.g. \"user:password@\" is not allowed. Fragments (\"#...\") and query parameters (\"?...\") are not allowed, either.",
|
||||||
|
"service": "`service` is a reference to the service for this webhook. Either `service` or `url` must be specified.\n\nIf the webhook is running within the cluster, then you should use `service`.",
|
||||||
|
"caBundle": "`caBundle` is a PEM encoded CA bundle which will be used to validate the webhook's server certificate. If unspecified, system trust roots on the apiserver are used.",
|
||||||
|
}
|
||||||
|
|
||||||
|
func (WebhookClientConfig) SwaggerDoc() map[string]string {
|
||||||
|
return map_WebhookClientConfig
|
||||||
|
}
|
||||||
|
|
||||||
|
// AUTO-GENERATED FUNCTIONS END HERE
|
396
staging/src/k8s.io/api/admissionregistration/v1/zz_generated.deepcopy.go
generated
Normal file
396
staging/src/k8s.io/api/admissionregistration/v1/zz_generated.deepcopy.go
generated
Normal file
@ -0,0 +1,396 @@
|
|||||||
|
// +build !ignore_autogenerated
|
||||||
|
|
||||||
|
/*
|
||||||
|
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 deepcopy-gen. DO NOT EDIT.
|
||||||
|
|
||||||
|
package v1
|
||||||
|
|
||||||
|
import (
|
||||||
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||||
|
)
|
||||||
|
|
||||||
|
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||||
|
func (in *MutatingWebhook) DeepCopyInto(out *MutatingWebhook) {
|
||||||
|
*out = *in
|
||||||
|
in.ClientConfig.DeepCopyInto(&out.ClientConfig)
|
||||||
|
if in.Rules != nil {
|
||||||
|
in, out := &in.Rules, &out.Rules
|
||||||
|
*out = make([]RuleWithOperations, len(*in))
|
||||||
|
for i := range *in {
|
||||||
|
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if in.FailurePolicy != nil {
|
||||||
|
in, out := &in.FailurePolicy, &out.FailurePolicy
|
||||||
|
*out = new(FailurePolicyType)
|
||||||
|
**out = **in
|
||||||
|
}
|
||||||
|
if in.MatchPolicy != nil {
|
||||||
|
in, out := &in.MatchPolicy, &out.MatchPolicy
|
||||||
|
*out = new(MatchPolicyType)
|
||||||
|
**out = **in
|
||||||
|
}
|
||||||
|
if in.NamespaceSelector != nil {
|
||||||
|
in, out := &in.NamespaceSelector, &out.NamespaceSelector
|
||||||
|
*out = new(metav1.LabelSelector)
|
||||||
|
(*in).DeepCopyInto(*out)
|
||||||
|
}
|
||||||
|
if in.ObjectSelector != nil {
|
||||||
|
in, out := &in.ObjectSelector, &out.ObjectSelector
|
||||||
|
*out = new(metav1.LabelSelector)
|
||||||
|
(*in).DeepCopyInto(*out)
|
||||||
|
}
|
||||||
|
if in.SideEffects != nil {
|
||||||
|
in, out := &in.SideEffects, &out.SideEffects
|
||||||
|
*out = new(SideEffectClass)
|
||||||
|
**out = **in
|
||||||
|
}
|
||||||
|
if in.TimeoutSeconds != nil {
|
||||||
|
in, out := &in.TimeoutSeconds, &out.TimeoutSeconds
|
||||||
|
*out = new(int32)
|
||||||
|
**out = **in
|
||||||
|
}
|
||||||
|
if in.AdmissionReviewVersions != nil {
|
||||||
|
in, out := &in.AdmissionReviewVersions, &out.AdmissionReviewVersions
|
||||||
|
*out = make([]string, len(*in))
|
||||||
|
copy(*out, *in)
|
||||||
|
}
|
||||||
|
if in.ReinvocationPolicy != nil {
|
||||||
|
in, out := &in.ReinvocationPolicy, &out.ReinvocationPolicy
|
||||||
|
*out = new(ReinvocationPolicyType)
|
||||||
|
**out = **in
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MutatingWebhook.
|
||||||
|
func (in *MutatingWebhook) DeepCopy() *MutatingWebhook {
|
||||||
|
if in == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
out := new(MutatingWebhook)
|
||||||
|
in.DeepCopyInto(out)
|
||||||
|
return out
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||||
|
func (in *MutatingWebhookConfiguration) DeepCopyInto(out *MutatingWebhookConfiguration) {
|
||||||
|
*out = *in
|
||||||
|
out.TypeMeta = in.TypeMeta
|
||||||
|
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||||
|
if in.Webhooks != nil {
|
||||||
|
in, out := &in.Webhooks, &out.Webhooks
|
||||||
|
*out = make([]MutatingWebhook, len(*in))
|
||||||
|
for i := range *in {
|
||||||
|
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MutatingWebhookConfiguration.
|
||||||
|
func (in *MutatingWebhookConfiguration) DeepCopy() *MutatingWebhookConfiguration {
|
||||||
|
if in == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
out := new(MutatingWebhookConfiguration)
|
||||||
|
in.DeepCopyInto(out)
|
||||||
|
return out
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||||
|
func (in *MutatingWebhookConfiguration) DeepCopyObject() runtime.Object {
|
||||||
|
if c := in.DeepCopy(); c != nil {
|
||||||
|
return c
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||||
|
func (in *MutatingWebhookConfigurationList) DeepCopyInto(out *MutatingWebhookConfigurationList) {
|
||||||
|
*out = *in
|
||||||
|
out.TypeMeta = in.TypeMeta
|
||||||
|
in.ListMeta.DeepCopyInto(&out.ListMeta)
|
||||||
|
if in.Items != nil {
|
||||||
|
in, out := &in.Items, &out.Items
|
||||||
|
*out = make([]MutatingWebhookConfiguration, len(*in))
|
||||||
|
for i := range *in {
|
||||||
|
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MutatingWebhookConfigurationList.
|
||||||
|
func (in *MutatingWebhookConfigurationList) DeepCopy() *MutatingWebhookConfigurationList {
|
||||||
|
if in == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
out := new(MutatingWebhookConfigurationList)
|
||||||
|
in.DeepCopyInto(out)
|
||||||
|
return out
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||||
|
func (in *MutatingWebhookConfigurationList) DeepCopyObject() runtime.Object {
|
||||||
|
if c := in.DeepCopy(); c != nil {
|
||||||
|
return c
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||||
|
func (in *Rule) DeepCopyInto(out *Rule) {
|
||||||
|
*out = *in
|
||||||
|
if in.APIGroups != nil {
|
||||||
|
in, out := &in.APIGroups, &out.APIGroups
|
||||||
|
*out = make([]string, len(*in))
|
||||||
|
copy(*out, *in)
|
||||||
|
}
|
||||||
|
if in.APIVersions != nil {
|
||||||
|
in, out := &in.APIVersions, &out.APIVersions
|
||||||
|
*out = make([]string, len(*in))
|
||||||
|
copy(*out, *in)
|
||||||
|
}
|
||||||
|
if in.Resources != nil {
|
||||||
|
in, out := &in.Resources, &out.Resources
|
||||||
|
*out = make([]string, len(*in))
|
||||||
|
copy(*out, *in)
|
||||||
|
}
|
||||||
|
if in.Scope != nil {
|
||||||
|
in, out := &in.Scope, &out.Scope
|
||||||
|
*out = new(ScopeType)
|
||||||
|
**out = **in
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Rule.
|
||||||
|
func (in *Rule) DeepCopy() *Rule {
|
||||||
|
if in == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
out := new(Rule)
|
||||||
|
in.DeepCopyInto(out)
|
||||||
|
return out
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||||
|
func (in *RuleWithOperations) DeepCopyInto(out *RuleWithOperations) {
|
||||||
|
*out = *in
|
||||||
|
if in.Operations != nil {
|
||||||
|
in, out := &in.Operations, &out.Operations
|
||||||
|
*out = make([]OperationType, len(*in))
|
||||||
|
copy(*out, *in)
|
||||||
|
}
|
||||||
|
in.Rule.DeepCopyInto(&out.Rule)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RuleWithOperations.
|
||||||
|
func (in *RuleWithOperations) DeepCopy() *RuleWithOperations {
|
||||||
|
if in == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
out := new(RuleWithOperations)
|
||||||
|
in.DeepCopyInto(out)
|
||||||
|
return out
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||||
|
func (in *ServiceReference) DeepCopyInto(out *ServiceReference) {
|
||||||
|
*out = *in
|
||||||
|
if in.Path != nil {
|
||||||
|
in, out := &in.Path, &out.Path
|
||||||
|
*out = new(string)
|
||||||
|
**out = **in
|
||||||
|
}
|
||||||
|
if in.Port != nil {
|
||||||
|
in, out := &in.Port, &out.Port
|
||||||
|
*out = new(int32)
|
||||||
|
**out = **in
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceReference.
|
||||||
|
func (in *ServiceReference) DeepCopy() *ServiceReference {
|
||||||
|
if in == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
out := new(ServiceReference)
|
||||||
|
in.DeepCopyInto(out)
|
||||||
|
return out
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||||
|
func (in *ValidatingWebhook) DeepCopyInto(out *ValidatingWebhook) {
|
||||||
|
*out = *in
|
||||||
|
in.ClientConfig.DeepCopyInto(&out.ClientConfig)
|
||||||
|
if in.Rules != nil {
|
||||||
|
in, out := &in.Rules, &out.Rules
|
||||||
|
*out = make([]RuleWithOperations, len(*in))
|
||||||
|
for i := range *in {
|
||||||
|
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if in.FailurePolicy != nil {
|
||||||
|
in, out := &in.FailurePolicy, &out.FailurePolicy
|
||||||
|
*out = new(FailurePolicyType)
|
||||||
|
**out = **in
|
||||||
|
}
|
||||||
|
if in.MatchPolicy != nil {
|
||||||
|
in, out := &in.MatchPolicy, &out.MatchPolicy
|
||||||
|
*out = new(MatchPolicyType)
|
||||||
|
**out = **in
|
||||||
|
}
|
||||||
|
if in.NamespaceSelector != nil {
|
||||||
|
in, out := &in.NamespaceSelector, &out.NamespaceSelector
|
||||||
|
*out = new(metav1.LabelSelector)
|
||||||
|
(*in).DeepCopyInto(*out)
|
||||||
|
}
|
||||||
|
if in.ObjectSelector != nil {
|
||||||
|
in, out := &in.ObjectSelector, &out.ObjectSelector
|
||||||
|
*out = new(metav1.LabelSelector)
|
||||||
|
(*in).DeepCopyInto(*out)
|
||||||
|
}
|
||||||
|
if in.SideEffects != nil {
|
||||||
|
in, out := &in.SideEffects, &out.SideEffects
|
||||||
|
*out = new(SideEffectClass)
|
||||||
|
**out = **in
|
||||||
|
}
|
||||||
|
if in.TimeoutSeconds != nil {
|
||||||
|
in, out := &in.TimeoutSeconds, &out.TimeoutSeconds
|
||||||
|
*out = new(int32)
|
||||||
|
**out = **in
|
||||||
|
}
|
||||||
|
if in.AdmissionReviewVersions != nil {
|
||||||
|
in, out := &in.AdmissionReviewVersions, &out.AdmissionReviewVersions
|
||||||
|
*out = make([]string, len(*in))
|
||||||
|
copy(*out, *in)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ValidatingWebhook.
|
||||||
|
func (in *ValidatingWebhook) DeepCopy() *ValidatingWebhook {
|
||||||
|
if in == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
out := new(ValidatingWebhook)
|
||||||
|
in.DeepCopyInto(out)
|
||||||
|
return out
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||||
|
func (in *ValidatingWebhookConfiguration) DeepCopyInto(out *ValidatingWebhookConfiguration) {
|
||||||
|
*out = *in
|
||||||
|
out.TypeMeta = in.TypeMeta
|
||||||
|
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||||
|
if in.Webhooks != nil {
|
||||||
|
in, out := &in.Webhooks, &out.Webhooks
|
||||||
|
*out = make([]ValidatingWebhook, len(*in))
|
||||||
|
for i := range *in {
|
||||||
|
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ValidatingWebhookConfiguration.
|
||||||
|
func (in *ValidatingWebhookConfiguration) DeepCopy() *ValidatingWebhookConfiguration {
|
||||||
|
if in == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
out := new(ValidatingWebhookConfiguration)
|
||||||
|
in.DeepCopyInto(out)
|
||||||
|
return out
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||||
|
func (in *ValidatingWebhookConfiguration) DeepCopyObject() runtime.Object {
|
||||||
|
if c := in.DeepCopy(); c != nil {
|
||||||
|
return c
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||||
|
func (in *ValidatingWebhookConfigurationList) DeepCopyInto(out *ValidatingWebhookConfigurationList) {
|
||||||
|
*out = *in
|
||||||
|
out.TypeMeta = in.TypeMeta
|
||||||
|
in.ListMeta.DeepCopyInto(&out.ListMeta)
|
||||||
|
if in.Items != nil {
|
||||||
|
in, out := &in.Items, &out.Items
|
||||||
|
*out = make([]ValidatingWebhookConfiguration, len(*in))
|
||||||
|
for i := range *in {
|
||||||
|
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ValidatingWebhookConfigurationList.
|
||||||
|
func (in *ValidatingWebhookConfigurationList) DeepCopy() *ValidatingWebhookConfigurationList {
|
||||||
|
if in == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
out := new(ValidatingWebhookConfigurationList)
|
||||||
|
in.DeepCopyInto(out)
|
||||||
|
return out
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||||
|
func (in *ValidatingWebhookConfigurationList) DeepCopyObject() runtime.Object {
|
||||||
|
if c := in.DeepCopy(); c != nil {
|
||||||
|
return c
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||||
|
func (in *WebhookClientConfig) DeepCopyInto(out *WebhookClientConfig) {
|
||||||
|
*out = *in
|
||||||
|
if in.URL != nil {
|
||||||
|
in, out := &in.URL, &out.URL
|
||||||
|
*out = new(string)
|
||||||
|
**out = **in
|
||||||
|
}
|
||||||
|
if in.Service != nil {
|
||||||
|
in, out := &in.Service, &out.Service
|
||||||
|
*out = new(ServiceReference)
|
||||||
|
(*in).DeepCopyInto(*out)
|
||||||
|
}
|
||||||
|
if in.CABundle != nil {
|
||||||
|
in, out := &in.CABundle, &out.CABundle
|
||||||
|
*out = make([]byte, len(*in))
|
||||||
|
copy(*out, *in)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WebhookClientConfig.
|
||||||
|
func (in *WebhookClientConfig) DeepCopy() *WebhookClientConfig {
|
||||||
|
if in == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
out := new(WebhookClientConfig)
|
||||||
|
in.DeepCopyInto(out)
|
||||||
|
return out
|
||||||
|
}
|
@ -21,6 +21,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
admissionv1beta1 "k8s.io/api/admission/v1beta1"
|
admissionv1beta1 "k8s.io/api/admission/v1beta1"
|
||||||
|
admissionregv1 "k8s.io/api/admissionregistration/v1"
|
||||||
admissionregv1beta1 "k8s.io/api/admissionregistration/v1beta1"
|
admissionregv1beta1 "k8s.io/api/admissionregistration/v1beta1"
|
||||||
appsv1 "k8s.io/api/apps/v1"
|
appsv1 "k8s.io/api/apps/v1"
|
||||||
appsv1beta1 "k8s.io/api/apps/v1beta1"
|
appsv1beta1 "k8s.io/api/apps/v1beta1"
|
||||||
@ -69,6 +70,7 @@ import (
|
|||||||
var groups = []runtime.SchemeBuilder{
|
var groups = []runtime.SchemeBuilder{
|
||||||
admissionv1beta1.SchemeBuilder,
|
admissionv1beta1.SchemeBuilder,
|
||||||
admissionregv1beta1.SchemeBuilder,
|
admissionregv1beta1.SchemeBuilder,
|
||||||
|
admissionregv1.SchemeBuilder,
|
||||||
appsv1beta1.SchemeBuilder,
|
appsv1beta1.SchemeBuilder,
|
||||||
appsv1beta2.SchemeBuilder,
|
appsv1beta2.SchemeBuilder,
|
||||||
appsv1.SchemeBuilder,
|
appsv1.SchemeBuilder,
|
||||||
|
@ -0,0 +1,108 @@
|
|||||||
|
{
|
||||||
|
"kind": "MutatingWebhookConfiguration",
|
||||||
|
"apiVersion": "admissionregistration.k8s.io/v1",
|
||||||
|
"metadata": {
|
||||||
|
"name": "2",
|
||||||
|
"generateName": "3",
|
||||||
|
"namespace": "4",
|
||||||
|
"selfLink": "5",
|
||||||
|
"uid": "ą飋īqJ枊a8衍`Ĩɘ.蘯6ċV夸e",
|
||||||
|
"resourceVersion": "16964250748386560239",
|
||||||
|
"generation": 8071137005907523419,
|
||||||
|
"creationTimestamp": null,
|
||||||
|
"deletionGracePeriodSeconds": -4955867275792137171,
|
||||||
|
"labels": {
|
||||||
|
"7": "8"
|
||||||
|
},
|
||||||
|
"annotations": {
|
||||||
|
"9": "10"
|
||||||
|
},
|
||||||
|
"ownerReferences": [
|
||||||
|
{
|
||||||
|
"apiVersion": "11",
|
||||||
|
"kind": "12",
|
||||||
|
"name": "13",
|
||||||
|
"uid": "Dz廔ȇ{sŊƏp",
|
||||||
|
"controller": false,
|
||||||
|
"blockOwnerDeletion": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"finalizers": [
|
||||||
|
"14"
|
||||||
|
],
|
||||||
|
"clusterName": "15",
|
||||||
|
"managedFields": [
|
||||||
|
{
|
||||||
|
"manager": "16",
|
||||||
|
"operation": "鐊唊飙Ş-U圴÷a/ɔ}摁(湗Ć]",
|
||||||
|
"apiVersion": "17",
|
||||||
|
"fields": {"18":{"19":null}}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"webhooks": [
|
||||||
|
{
|
||||||
|
"name": "24",
|
||||||
|
"clientConfig": {
|
||||||
|
"url": "25",
|
||||||
|
"service": {
|
||||||
|
"namespace": "26",
|
||||||
|
"name": "27",
|
||||||
|
"path": "28",
|
||||||
|
"port": 2114329341
|
||||||
|
},
|
||||||
|
"caBundle": "RA=="
|
||||||
|
},
|
||||||
|
"rules": [
|
||||||
|
{
|
||||||
|
"operations": [
|
||||||
|
"ʕVŚ(ĿȊ甞谐颋DžSǡƏS$+½H牗"
|
||||||
|
],
|
||||||
|
"apiGroups": [
|
||||||
|
"29"
|
||||||
|
],
|
||||||
|
"apiVersions": [
|
||||||
|
"30"
|
||||||
|
],
|
||||||
|
"resources": [
|
||||||
|
"31"
|
||||||
|
],
|
||||||
|
"scope": "ȎțêɘIJ斬³;Ơ歿"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"failurePolicy": "狞夌碕ʂɭ",
|
||||||
|
"matchPolicy": "cP$Iņɖ橙9",
|
||||||
|
"namespaceSelector": {
|
||||||
|
"matchLabels": {
|
||||||
|
"MHLU..8._bQw.-dG6c-.6--_x.--0wmZk1_8.3": "U-_Bq.m_4"
|
||||||
|
},
|
||||||
|
"matchExpressions": [
|
||||||
|
{
|
||||||
|
"key": "p503---477-49p---o61---4fy--9---7--9-9s-0-u5lj2--10pq-0-7-9-2-0/fP81.-.9Vdx.TB_M-H_5_.t..bG0",
|
||||||
|
"operator": "In",
|
||||||
|
"values": [
|
||||||
|
"D07.a_.y_y_o0_5qN2_---_M.N_._a6.9bHjdH.-.5_.I8__n"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"objectSelector": {
|
||||||
|
"matchLabels": {
|
||||||
|
"81po6c-m6173y.390q-6-i2d020hj--a-8g--z-nt-b-6-17-58-n---5df19/H.__.h-J-M.9_T.q-o7.y-SQ.9A-F-.4--_vLW.jj-.5B.._.5_3-_4.3i": "i.Fg.Cs_.8-EA"
|
||||||
|
},
|
||||||
|
"matchExpressions": [
|
||||||
|
{
|
||||||
|
"key": "4m-s0833--52-9guv59s-3------6tv27r-m8w-6d/5w9-Wm_AO-l8VKLyHA_.-F_E2_QOuQ_8.-1_57__JR.N-1zL-4--6o-B",
|
||||||
|
"operator": "DoesNotExist"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"sideEffects": "ŴĿ",
|
||||||
|
"timeoutSeconds": 1525829664,
|
||||||
|
"admissionReviewVersions": [
|
||||||
|
"44"
|
||||||
|
],
|
||||||
|
"reinvocationPolicy": "ȉ彂"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
BIN
staging/src/k8s.io/api/testdata/HEAD/admissionregistration.k8s.io.v1.MutatingWebhookConfiguration.pb
vendored
Normal file
BIN
staging/src/k8s.io/api/testdata/HEAD/admissionregistration.k8s.io.v1.MutatingWebhookConfiguration.pb
vendored
Normal file
Binary file not shown.
@ -0,0 +1,74 @@
|
|||||||
|
apiVersion: admissionregistration.k8s.io/v1
|
||||||
|
kind: MutatingWebhookConfiguration
|
||||||
|
metadata:
|
||||||
|
annotations:
|
||||||
|
"9": "10"
|
||||||
|
clusterName: "15"
|
||||||
|
creationTimestamp: null
|
||||||
|
deletionGracePeriodSeconds: -4955867275792137171
|
||||||
|
finalizers:
|
||||||
|
- "14"
|
||||||
|
generateName: "3"
|
||||||
|
generation: 8071137005907523419
|
||||||
|
labels:
|
||||||
|
"7": "8"
|
||||||
|
managedFields:
|
||||||
|
- apiVersion: "17"
|
||||||
|
fields:
|
||||||
|
"18":
|
||||||
|
"19": null
|
||||||
|
manager: "16"
|
||||||
|
operation: 鐊唊飙Ş-U圴÷a/ɔ}摁(湗Ć]
|
||||||
|
name: "2"
|
||||||
|
namespace: "4"
|
||||||
|
ownerReferences:
|
||||||
|
- apiVersion: "11"
|
||||||
|
blockOwnerDeletion: true
|
||||||
|
controller: false
|
||||||
|
kind: "12"
|
||||||
|
name: "13"
|
||||||
|
uid: Dz廔ȇ{sŊƏp
|
||||||
|
resourceVersion: "16964250748386560239"
|
||||||
|
selfLink: "5"
|
||||||
|
uid: ą飋īqJ枊a8衍`Ĩɘ.蘯6ċV夸e
|
||||||
|
webhooks:
|
||||||
|
- admissionReviewVersions:
|
||||||
|
- "44"
|
||||||
|
clientConfig:
|
||||||
|
caBundle: RA==
|
||||||
|
service:
|
||||||
|
name: "27"
|
||||||
|
namespace: "26"
|
||||||
|
path: "28"
|
||||||
|
port: 2114329341
|
||||||
|
url: "25"
|
||||||
|
failurePolicy: 狞夌碕ʂɭ
|
||||||
|
matchPolicy: cP$Iņɖ橙9
|
||||||
|
name: "24"
|
||||||
|
namespaceSelector:
|
||||||
|
matchExpressions:
|
||||||
|
- key: p503---477-49p---o61---4fy--9---7--9-9s-0-u5lj2--10pq-0-7-9-2-0/fP81.-.9Vdx.TB_M-H_5_.t..bG0
|
||||||
|
operator: In
|
||||||
|
values:
|
||||||
|
- D07.a_.y_y_o0_5qN2_---_M.N_._a6.9bHjdH.-.5_.I8__n
|
||||||
|
matchLabels:
|
||||||
|
MHLU..8._bQw.-dG6c-.6--_x.--0wmZk1_8.3: U-_Bq.m_4
|
||||||
|
objectSelector:
|
||||||
|
matchExpressions:
|
||||||
|
- key: 4m-s0833--52-9guv59s-3------6tv27r-m8w-6d/5w9-Wm_AO-l8VKLyHA_.-F_E2_QOuQ_8.-1_57__JR.N-1zL-4--6o-B
|
||||||
|
operator: DoesNotExist
|
||||||
|
matchLabels:
|
||||||
|
81po6c-m6173y.390q-6-i2d020hj--a-8g--z-nt-b-6-17-58-n---5df19/H.__.h-J-M.9_T.q-o7.y-SQ.9A-F-.4--_vLW.jj-.5B.._.5_3-_4.3i: i.Fg.Cs_.8-EA
|
||||||
|
reinvocationPolicy: ȉ彂
|
||||||
|
rules:
|
||||||
|
- apiGroups:
|
||||||
|
- "29"
|
||||||
|
apiVersions:
|
||||||
|
- "30"
|
||||||
|
operations:
|
||||||
|
- ʕVŚ(ĿȊ甞谐颋DžSǡƏS$+½H牗
|
||||||
|
resources:
|
||||||
|
- "31"
|
||||||
|
scope: ȎțêɘIJ斬³;Ơ歿
|
||||||
|
sideEffects: ŴĿ
|
||||||
|
timeoutSeconds: 1525829664
|
@ -0,0 +1,107 @@
|
|||||||
|
{
|
||||||
|
"kind": "ValidatingWebhookConfiguration",
|
||||||
|
"apiVersion": "admissionregistration.k8s.io/v1",
|
||||||
|
"metadata": {
|
||||||
|
"name": "2",
|
||||||
|
"generateName": "3",
|
||||||
|
"namespace": "4",
|
||||||
|
"selfLink": "5",
|
||||||
|
"uid": "ą飋īqJ枊a8衍`Ĩɘ.蘯6ċV夸e",
|
||||||
|
"resourceVersion": "16964250748386560239",
|
||||||
|
"generation": 8071137005907523419,
|
||||||
|
"creationTimestamp": null,
|
||||||
|
"deletionGracePeriodSeconds": -4955867275792137171,
|
||||||
|
"labels": {
|
||||||
|
"7": "8"
|
||||||
|
},
|
||||||
|
"annotations": {
|
||||||
|
"9": "10"
|
||||||
|
},
|
||||||
|
"ownerReferences": [
|
||||||
|
{
|
||||||
|
"apiVersion": "11",
|
||||||
|
"kind": "12",
|
||||||
|
"name": "13",
|
||||||
|
"uid": "Dz廔ȇ{sŊƏp",
|
||||||
|
"controller": false,
|
||||||
|
"blockOwnerDeletion": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"finalizers": [
|
||||||
|
"14"
|
||||||
|
],
|
||||||
|
"clusterName": "15",
|
||||||
|
"managedFields": [
|
||||||
|
{
|
||||||
|
"manager": "16",
|
||||||
|
"operation": "鐊唊飙Ş-U圴÷a/ɔ}摁(湗Ć]",
|
||||||
|
"apiVersion": "17",
|
||||||
|
"fields": {"18":{"19":null}}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"webhooks": [
|
||||||
|
{
|
||||||
|
"name": "24",
|
||||||
|
"clientConfig": {
|
||||||
|
"url": "25",
|
||||||
|
"service": {
|
||||||
|
"namespace": "26",
|
||||||
|
"name": "27",
|
||||||
|
"path": "28",
|
||||||
|
"port": 2114329341
|
||||||
|
},
|
||||||
|
"caBundle": "RA=="
|
||||||
|
},
|
||||||
|
"rules": [
|
||||||
|
{
|
||||||
|
"operations": [
|
||||||
|
"ʕVŚ(ĿȊ甞谐颋DžSǡƏS$+½H牗"
|
||||||
|
],
|
||||||
|
"apiGroups": [
|
||||||
|
"29"
|
||||||
|
],
|
||||||
|
"apiVersions": [
|
||||||
|
"30"
|
||||||
|
],
|
||||||
|
"resources": [
|
||||||
|
"31"
|
||||||
|
],
|
||||||
|
"scope": "ȎțêɘIJ斬³;Ơ歿"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"failurePolicy": "狞夌碕ʂɭ",
|
||||||
|
"matchPolicy": "cP$Iņɖ橙9",
|
||||||
|
"namespaceSelector": {
|
||||||
|
"matchLabels": {
|
||||||
|
"MHLU..8._bQw.-dG6c-.6--_x.--0wmZk1_8.3": "U-_Bq.m_4"
|
||||||
|
},
|
||||||
|
"matchExpressions": [
|
||||||
|
{
|
||||||
|
"key": "p503---477-49p---o61---4fy--9---7--9-9s-0-u5lj2--10pq-0-7-9-2-0/fP81.-.9Vdx.TB_M-H_5_.t..bG0",
|
||||||
|
"operator": "In",
|
||||||
|
"values": [
|
||||||
|
"D07.a_.y_y_o0_5qN2_---_M.N_._a6.9bHjdH.-.5_.I8__n"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"objectSelector": {
|
||||||
|
"matchLabels": {
|
||||||
|
"81po6c-m6173y.390q-6-i2d020hj--a-8g--z-nt-b-6-17-58-n---5df19/H.__.h-J-M.9_T.q-o7.y-SQ.9A-F-.4--_vLW.jj-.5B.._.5_3-_4.3i": "i.Fg.Cs_.8-EA"
|
||||||
|
},
|
||||||
|
"matchExpressions": [
|
||||||
|
{
|
||||||
|
"key": "4m-s0833--52-9guv59s-3------6tv27r-m8w-6d/5w9-Wm_AO-l8VKLyHA_.-F_E2_QOuQ_8.-1_57__JR.N-1zL-4--6o-B",
|
||||||
|
"operator": "DoesNotExist"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"sideEffects": "ŴĿ",
|
||||||
|
"timeoutSeconds": 1525829664,
|
||||||
|
"admissionReviewVersions": [
|
||||||
|
"44"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
Binary file not shown.
@ -0,0 +1,73 @@
|
|||||||
|
apiVersion: admissionregistration.k8s.io/v1
|
||||||
|
kind: ValidatingWebhookConfiguration
|
||||||
|
metadata:
|
||||||
|
annotations:
|
||||||
|
"9": "10"
|
||||||
|
clusterName: "15"
|
||||||
|
creationTimestamp: null
|
||||||
|
deletionGracePeriodSeconds: -4955867275792137171
|
||||||
|
finalizers:
|
||||||
|
- "14"
|
||||||
|
generateName: "3"
|
||||||
|
generation: 8071137005907523419
|
||||||
|
labels:
|
||||||
|
"7": "8"
|
||||||
|
managedFields:
|
||||||
|
- apiVersion: "17"
|
||||||
|
fields:
|
||||||
|
"18":
|
||||||
|
"19": null
|
||||||
|
manager: "16"
|
||||||
|
operation: 鐊唊飙Ş-U圴÷a/ɔ}摁(湗Ć]
|
||||||
|
name: "2"
|
||||||
|
namespace: "4"
|
||||||
|
ownerReferences:
|
||||||
|
- apiVersion: "11"
|
||||||
|
blockOwnerDeletion: true
|
||||||
|
controller: false
|
||||||
|
kind: "12"
|
||||||
|
name: "13"
|
||||||
|
uid: Dz廔ȇ{sŊƏp
|
||||||
|
resourceVersion: "16964250748386560239"
|
||||||
|
selfLink: "5"
|
||||||
|
uid: ą飋īqJ枊a8衍`Ĩɘ.蘯6ċV夸e
|
||||||
|
webhooks:
|
||||||
|
- admissionReviewVersions:
|
||||||
|
- "44"
|
||||||
|
clientConfig:
|
||||||
|
caBundle: RA==
|
||||||
|
service:
|
||||||
|
name: "27"
|
||||||
|
namespace: "26"
|
||||||
|
path: "28"
|
||||||
|
port: 2114329341
|
||||||
|
url: "25"
|
||||||
|
failurePolicy: 狞夌碕ʂɭ
|
||||||
|
matchPolicy: cP$Iņɖ橙9
|
||||||
|
name: "24"
|
||||||
|
namespaceSelector:
|
||||||
|
matchExpressions:
|
||||||
|
- key: p503---477-49p---o61---4fy--9---7--9-9s-0-u5lj2--10pq-0-7-9-2-0/fP81.-.9Vdx.TB_M-H_5_.t..bG0
|
||||||
|
operator: In
|
||||||
|
values:
|
||||||
|
- D07.a_.y_y_o0_5qN2_---_M.N_._a6.9bHjdH.-.5_.I8__n
|
||||||
|
matchLabels:
|
||||||
|
MHLU..8._bQw.-dG6c-.6--_x.--0wmZk1_8.3: U-_Bq.m_4
|
||||||
|
objectSelector:
|
||||||
|
matchExpressions:
|
||||||
|
- key: 4m-s0833--52-9guv59s-3------6tv27r-m8w-6d/5w9-Wm_AO-l8VKLyHA_.-F_E2_QOuQ_8.-1_57__JR.N-1zL-4--6o-B
|
||||||
|
operator: DoesNotExist
|
||||||
|
matchLabels:
|
||||||
|
81po6c-m6173y.390q-6-i2d020hj--a-8g--z-nt-b-6-17-58-n---5df19/H.__.h-J-M.9_T.q-o7.y-SQ.9A-F-.4--_vLW.jj-.5B.._.5_3-_4.3i: i.Fg.Cs_.8-EA
|
||||||
|
rules:
|
||||||
|
- apiGroups:
|
||||||
|
- "29"
|
||||||
|
apiVersions:
|
||||||
|
- "30"
|
||||||
|
operations:
|
||||||
|
- ʕVŚ(ĿȊ甞谐颋DžSǡƏS$+½H牗
|
||||||
|
resources:
|
||||||
|
- "31"
|
||||||
|
scope: ȎțêɘIJ斬³;Ơ歿
|
||||||
|
sideEffects: ŴĿ
|
||||||
|
timeoutSeconds: 1525829664
|
@ -22,6 +22,7 @@ filegroup(
|
|||||||
"//staging/src/k8s.io/client-go/informers:all-srcs",
|
"//staging/src/k8s.io/client-go/informers:all-srcs",
|
||||||
"//staging/src/k8s.io/client-go/kubernetes:all-srcs",
|
"//staging/src/k8s.io/client-go/kubernetes:all-srcs",
|
||||||
"//staging/src/k8s.io/client-go/kubernetes_test:all-srcs",
|
"//staging/src/k8s.io/client-go/kubernetes_test:all-srcs",
|
||||||
|
"//staging/src/k8s.io/client-go/listers/admissionregistration/v1:all-srcs",
|
||||||
"//staging/src/k8s.io/client-go/listers/admissionregistration/v1beta1:all-srcs",
|
"//staging/src/k8s.io/client-go/listers/admissionregistration/v1beta1:all-srcs",
|
||||||
"//staging/src/k8s.io/client-go/listers/apps/v1:all-srcs",
|
"//staging/src/k8s.io/client-go/listers/apps/v1:all-srcs",
|
||||||
"//staging/src/k8s.io/client-go/listers/apps/v1beta1:all-srcs",
|
"//staging/src/k8s.io/client-go/listers/apps/v1beta1:all-srcs",
|
||||||
|
@ -10,6 +10,7 @@ go_library(
|
|||||||
importpath = "k8s.io/client-go/informers",
|
importpath = "k8s.io/client-go/informers",
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
deps = [
|
deps = [
|
||||||
|
"//staging/src/k8s.io/api/admissionregistration/v1:go_default_library",
|
||||||
"//staging/src/k8s.io/api/admissionregistration/v1beta1:go_default_library",
|
"//staging/src/k8s.io/api/admissionregistration/v1beta1:go_default_library",
|
||||||
"//staging/src/k8s.io/api/apps/v1:go_default_library",
|
"//staging/src/k8s.io/api/apps/v1:go_default_library",
|
||||||
"//staging/src/k8s.io/api/apps/v1beta1:go_default_library",
|
"//staging/src/k8s.io/api/apps/v1beta1:go_default_library",
|
||||||
|
@ -11,6 +11,7 @@ go_library(
|
|||||||
importmap = "k8s.io/kubernetes/vendor/k8s.io/client-go/informers/admissionregistration",
|
importmap = "k8s.io/kubernetes/vendor/k8s.io/client-go/informers/admissionregistration",
|
||||||
importpath = "k8s.io/client-go/informers/admissionregistration",
|
importpath = "k8s.io/client-go/informers/admissionregistration",
|
||||||
deps = [
|
deps = [
|
||||||
|
"//staging/src/k8s.io/client-go/informers/admissionregistration/v1:go_default_library",
|
||||||
"//staging/src/k8s.io/client-go/informers/admissionregistration/v1beta1:go_default_library",
|
"//staging/src/k8s.io/client-go/informers/admissionregistration/v1beta1:go_default_library",
|
||||||
"//staging/src/k8s.io/client-go/informers/internalinterfaces:go_default_library",
|
"//staging/src/k8s.io/client-go/informers/internalinterfaces:go_default_library",
|
||||||
],
|
],
|
||||||
@ -27,6 +28,7 @@ filegroup(
|
|||||||
name = "all-srcs",
|
name = "all-srcs",
|
||||||
srcs = [
|
srcs = [
|
||||||
":package-srcs",
|
":package-srcs",
|
||||||
|
"//staging/src/k8s.io/client-go/informers/admissionregistration/v1:all-srcs",
|
||||||
"//staging/src/k8s.io/client-go/informers/admissionregistration/v1beta1:all-srcs",
|
"//staging/src/k8s.io/client-go/informers/admissionregistration/v1beta1:all-srcs",
|
||||||
],
|
],
|
||||||
tags = ["automanaged"],
|
tags = ["automanaged"],
|
||||||
|
@ -19,12 +19,15 @@ limitations under the License.
|
|||||||
package admissionregistration
|
package admissionregistration
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
v1 "k8s.io/client-go/informers/admissionregistration/v1"
|
||||||
v1beta1 "k8s.io/client-go/informers/admissionregistration/v1beta1"
|
v1beta1 "k8s.io/client-go/informers/admissionregistration/v1beta1"
|
||||||
internalinterfaces "k8s.io/client-go/informers/internalinterfaces"
|
internalinterfaces "k8s.io/client-go/informers/internalinterfaces"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Interface provides access to each of this group's versions.
|
// Interface provides access to each of this group's versions.
|
||||||
type Interface interface {
|
type Interface interface {
|
||||||
|
// V1 provides access to shared informers for resources in V1.
|
||||||
|
V1() v1.Interface
|
||||||
// V1beta1 provides access to shared informers for resources in V1beta1.
|
// V1beta1 provides access to shared informers for resources in V1beta1.
|
||||||
V1beta1() v1beta1.Interface
|
V1beta1() v1beta1.Interface
|
||||||
}
|
}
|
||||||
@ -40,6 +43,11 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList
|
|||||||
return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions}
|
return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// V1 returns a new v1.Interface.
|
||||||
|
func (g *group) V1() v1.Interface {
|
||||||
|
return v1.New(g.factory, g.namespace, g.tweakListOptions)
|
||||||
|
}
|
||||||
|
|
||||||
// V1beta1 returns a new v1beta1.Interface.
|
// V1beta1 returns a new v1beta1.Interface.
|
||||||
func (g *group) V1beta1() v1beta1.Interface {
|
func (g *group) V1beta1() v1beta1.Interface {
|
||||||
return v1beta1.New(g.factory, g.namespace, g.tweakListOptions)
|
return v1beta1.New(g.factory, g.namespace, g.tweakListOptions)
|
||||||
|
@ -0,0 +1,37 @@
|
|||||||
|
load("@io_bazel_rules_go//go:def.bzl", "go_library")
|
||||||
|
|
||||||
|
go_library(
|
||||||
|
name = "go_default_library",
|
||||||
|
srcs = [
|
||||||
|
"interface.go",
|
||||||
|
"mutatingwebhookconfiguration.go",
|
||||||
|
"validatingwebhookconfiguration.go",
|
||||||
|
],
|
||||||
|
importmap = "k8s.io/kubernetes/vendor/k8s.io/client-go/informers/admissionregistration/v1",
|
||||||
|
importpath = "k8s.io/client-go/informers/admissionregistration/v1",
|
||||||
|
visibility = ["//visibility:public"],
|
||||||
|
deps = [
|
||||||
|
"//staging/src/k8s.io/api/admissionregistration/v1:go_default_library",
|
||||||
|
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
|
||||||
|
"//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library",
|
||||||
|
"//staging/src/k8s.io/apimachinery/pkg/watch:go_default_library",
|
||||||
|
"//staging/src/k8s.io/client-go/informers/internalinterfaces:go_default_library",
|
||||||
|
"//staging/src/k8s.io/client-go/kubernetes:go_default_library",
|
||||||
|
"//staging/src/k8s.io/client-go/listers/admissionregistration/v1:go_default_library",
|
||||||
|
"//staging/src/k8s.io/client-go/tools/cache:go_default_library",
|
||||||
|
],
|
||||||
|
)
|
||||||
|
|
||||||
|
filegroup(
|
||||||
|
name = "package-srcs",
|
||||||
|
srcs = glob(["**"]),
|
||||||
|
tags = ["automanaged"],
|
||||||
|
visibility = ["//visibility:private"],
|
||||||
|
)
|
||||||
|
|
||||||
|
filegroup(
|
||||||
|
name = "all-srcs",
|
||||||
|
srcs = [":package-srcs"],
|
||||||
|
tags = ["automanaged"],
|
||||||
|
visibility = ["//visibility:public"],
|
||||||
|
)
|
@ -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 informer-gen. DO NOT EDIT.
|
||||||
|
|
||||||
|
package v1
|
||||||
|
|
||||||
|
import (
|
||||||
|
internalinterfaces "k8s.io/client-go/informers/internalinterfaces"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Interface provides access to all the informers in this group version.
|
||||||
|
type Interface interface {
|
||||||
|
// MutatingWebhookConfigurations returns a MutatingWebhookConfigurationInformer.
|
||||||
|
MutatingWebhookConfigurations() MutatingWebhookConfigurationInformer
|
||||||
|
// ValidatingWebhookConfigurations returns a ValidatingWebhookConfigurationInformer.
|
||||||
|
ValidatingWebhookConfigurations() ValidatingWebhookConfigurationInformer
|
||||||
|
}
|
||||||
|
|
||||||
|
type version struct {
|
||||||
|
factory internalinterfaces.SharedInformerFactory
|
||||||
|
namespace string
|
||||||
|
tweakListOptions internalinterfaces.TweakListOptionsFunc
|
||||||
|
}
|
||||||
|
|
||||||
|
// New returns a new Interface.
|
||||||
|
func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface {
|
||||||
|
return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions}
|
||||||
|
}
|
||||||
|
|
||||||
|
// MutatingWebhookConfigurations returns a MutatingWebhookConfigurationInformer.
|
||||||
|
func (v *version) MutatingWebhookConfigurations() MutatingWebhookConfigurationInformer {
|
||||||
|
return &mutatingWebhookConfigurationInformer{factory: v.factory, tweakListOptions: v.tweakListOptions}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ValidatingWebhookConfigurations returns a ValidatingWebhookConfigurationInformer.
|
||||||
|
func (v *version) ValidatingWebhookConfigurations() ValidatingWebhookConfigurationInformer {
|
||||||
|
return &validatingWebhookConfigurationInformer{factory: v.factory, tweakListOptions: v.tweakListOptions}
|
||||||
|
}
|
@ -0,0 +1,88 @@
|
|||||||
|
/*
|
||||||
|
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 informer-gen. DO NOT EDIT.
|
||||||
|
|
||||||
|
package v1
|
||||||
|
|
||||||
|
import (
|
||||||
|
time "time"
|
||||||
|
|
||||||
|
admissionregistrationv1 "k8s.io/api/admissionregistration/v1"
|
||||||
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||||
|
watch "k8s.io/apimachinery/pkg/watch"
|
||||||
|
internalinterfaces "k8s.io/client-go/informers/internalinterfaces"
|
||||||
|
kubernetes "k8s.io/client-go/kubernetes"
|
||||||
|
v1 "k8s.io/client-go/listers/admissionregistration/v1"
|
||||||
|
cache "k8s.io/client-go/tools/cache"
|
||||||
|
)
|
||||||
|
|
||||||
|
// MutatingWebhookConfigurationInformer provides access to a shared informer and lister for
|
||||||
|
// MutatingWebhookConfigurations.
|
||||||
|
type MutatingWebhookConfigurationInformer interface {
|
||||||
|
Informer() cache.SharedIndexInformer
|
||||||
|
Lister() v1.MutatingWebhookConfigurationLister
|
||||||
|
}
|
||||||
|
|
||||||
|
type mutatingWebhookConfigurationInformer struct {
|
||||||
|
factory internalinterfaces.SharedInformerFactory
|
||||||
|
tweakListOptions internalinterfaces.TweakListOptionsFunc
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewMutatingWebhookConfigurationInformer constructs a new informer for MutatingWebhookConfiguration type.
|
||||||
|
// Always prefer using an informer factory to get a shared informer instead of getting an independent
|
||||||
|
// one. This reduces memory footprint and number of connections to the server.
|
||||||
|
func NewMutatingWebhookConfigurationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||||
|
return NewFilteredMutatingWebhookConfigurationInformer(client, resyncPeriod, indexers, nil)
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewFilteredMutatingWebhookConfigurationInformer constructs a new informer for MutatingWebhookConfiguration type.
|
||||||
|
// Always prefer using an informer factory to get a shared informer instead of getting an independent
|
||||||
|
// one. This reduces memory footprint and number of connections to the server.
|
||||||
|
func NewFilteredMutatingWebhookConfigurationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
|
||||||
|
return cache.NewSharedIndexInformer(
|
||||||
|
&cache.ListWatch{
|
||||||
|
ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
|
||||||
|
if tweakListOptions != nil {
|
||||||
|
tweakListOptions(&options)
|
||||||
|
}
|
||||||
|
return client.AdmissionregistrationV1().MutatingWebhookConfigurations().List(options)
|
||||||
|
},
|
||||||
|
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
|
||||||
|
if tweakListOptions != nil {
|
||||||
|
tweakListOptions(&options)
|
||||||
|
}
|
||||||
|
return client.AdmissionregistrationV1().MutatingWebhookConfigurations().Watch(options)
|
||||||
|
},
|
||||||
|
},
|
||||||
|
&admissionregistrationv1.MutatingWebhookConfiguration{},
|
||||||
|
resyncPeriod,
|
||||||
|
indexers,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (f *mutatingWebhookConfigurationInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||||
|
return NewFilteredMutatingWebhookConfigurationInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (f *mutatingWebhookConfigurationInformer) Informer() cache.SharedIndexInformer {
|
||||||
|
return f.factory.InformerFor(&admissionregistrationv1.MutatingWebhookConfiguration{}, f.defaultInformer)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (f *mutatingWebhookConfigurationInformer) Lister() v1.MutatingWebhookConfigurationLister {
|
||||||
|
return v1.NewMutatingWebhookConfigurationLister(f.Informer().GetIndexer())
|
||||||
|
}
|
@ -0,0 +1,88 @@
|
|||||||
|
/*
|
||||||
|
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 informer-gen. DO NOT EDIT.
|
||||||
|
|
||||||
|
package v1
|
||||||
|
|
||||||
|
import (
|
||||||
|
time "time"
|
||||||
|
|
||||||
|
admissionregistrationv1 "k8s.io/api/admissionregistration/v1"
|
||||||
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||||
|
watch "k8s.io/apimachinery/pkg/watch"
|
||||||
|
internalinterfaces "k8s.io/client-go/informers/internalinterfaces"
|
||||||
|
kubernetes "k8s.io/client-go/kubernetes"
|
||||||
|
v1 "k8s.io/client-go/listers/admissionregistration/v1"
|
||||||
|
cache "k8s.io/client-go/tools/cache"
|
||||||
|
)
|
||||||
|
|
||||||
|
// ValidatingWebhookConfigurationInformer provides access to a shared informer and lister for
|
||||||
|
// ValidatingWebhookConfigurations.
|
||||||
|
type ValidatingWebhookConfigurationInformer interface {
|
||||||
|
Informer() cache.SharedIndexInformer
|
||||||
|
Lister() v1.ValidatingWebhookConfigurationLister
|
||||||
|
}
|
||||||
|
|
||||||
|
type validatingWebhookConfigurationInformer struct {
|
||||||
|
factory internalinterfaces.SharedInformerFactory
|
||||||
|
tweakListOptions internalinterfaces.TweakListOptionsFunc
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewValidatingWebhookConfigurationInformer constructs a new informer for ValidatingWebhookConfiguration type.
|
||||||
|
// Always prefer using an informer factory to get a shared informer instead of getting an independent
|
||||||
|
// one. This reduces memory footprint and number of connections to the server.
|
||||||
|
func NewValidatingWebhookConfigurationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||||
|
return NewFilteredValidatingWebhookConfigurationInformer(client, resyncPeriod, indexers, nil)
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewFilteredValidatingWebhookConfigurationInformer constructs a new informer for ValidatingWebhookConfiguration type.
|
||||||
|
// Always prefer using an informer factory to get a shared informer instead of getting an independent
|
||||||
|
// one. This reduces memory footprint and number of connections to the server.
|
||||||
|
func NewFilteredValidatingWebhookConfigurationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
|
||||||
|
return cache.NewSharedIndexInformer(
|
||||||
|
&cache.ListWatch{
|
||||||
|
ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
|
||||||
|
if tweakListOptions != nil {
|
||||||
|
tweakListOptions(&options)
|
||||||
|
}
|
||||||
|
return client.AdmissionregistrationV1().ValidatingWebhookConfigurations().List(options)
|
||||||
|
},
|
||||||
|
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
|
||||||
|
if tweakListOptions != nil {
|
||||||
|
tweakListOptions(&options)
|
||||||
|
}
|
||||||
|
return client.AdmissionregistrationV1().ValidatingWebhookConfigurations().Watch(options)
|
||||||
|
},
|
||||||
|
},
|
||||||
|
&admissionregistrationv1.ValidatingWebhookConfiguration{},
|
||||||
|
resyncPeriod,
|
||||||
|
indexers,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (f *validatingWebhookConfigurationInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||||
|
return NewFilteredValidatingWebhookConfigurationInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (f *validatingWebhookConfigurationInformer) Informer() cache.SharedIndexInformer {
|
||||||
|
return f.factory.InformerFor(&admissionregistrationv1.ValidatingWebhookConfiguration{}, f.defaultInformer)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (f *validatingWebhookConfigurationInformer) Lister() v1.ValidatingWebhookConfigurationLister {
|
||||||
|
return v1.NewValidatingWebhookConfigurationLister(f.Informer().GetIndexer())
|
||||||
|
}
|
@ -21,8 +21,9 @@ package informers
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
|
v1 "k8s.io/api/admissionregistration/v1"
|
||||||
v1beta1 "k8s.io/api/admissionregistration/v1beta1"
|
v1beta1 "k8s.io/api/admissionregistration/v1beta1"
|
||||||
v1 "k8s.io/api/apps/v1"
|
appsv1 "k8s.io/api/apps/v1"
|
||||||
appsv1beta1 "k8s.io/api/apps/v1beta1"
|
appsv1beta1 "k8s.io/api/apps/v1beta1"
|
||||||
v1beta2 "k8s.io/api/apps/v1beta2"
|
v1beta2 "k8s.io/api/apps/v1beta2"
|
||||||
v1alpha1 "k8s.io/api/auditregistration/v1alpha1"
|
v1alpha1 "k8s.io/api/auditregistration/v1alpha1"
|
||||||
@ -83,6 +84,12 @@ func (f *genericInformer) Lister() cache.GenericLister {
|
|||||||
// TODO extend this to unknown resources with a client pool
|
// TODO extend this to unknown resources with a client pool
|
||||||
func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) {
|
func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) {
|
||||||
switch resource {
|
switch resource {
|
||||||
|
// Group=admissionregistration.k8s.io, Version=v1
|
||||||
|
case v1.SchemeGroupVersion.WithResource("mutatingwebhookconfigurations"):
|
||||||
|
return &genericInformer{resource: resource.GroupResource(), informer: f.Admissionregistration().V1().MutatingWebhookConfigurations().Informer()}, nil
|
||||||
|
case v1.SchemeGroupVersion.WithResource("validatingwebhookconfigurations"):
|
||||||
|
return &genericInformer{resource: resource.GroupResource(), informer: f.Admissionregistration().V1().ValidatingWebhookConfigurations().Informer()}, nil
|
||||||
|
|
||||||
// Group=admissionregistration.k8s.io, Version=v1beta1
|
// Group=admissionregistration.k8s.io, Version=v1beta1
|
||||||
case v1beta1.SchemeGroupVersion.WithResource("mutatingwebhookconfigurations"):
|
case v1beta1.SchemeGroupVersion.WithResource("mutatingwebhookconfigurations"):
|
||||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Admissionregistration().V1beta1().MutatingWebhookConfigurations().Informer()}, nil
|
return &genericInformer{resource: resource.GroupResource(), informer: f.Admissionregistration().V1beta1().MutatingWebhookConfigurations().Informer()}, nil
|
||||||
@ -90,15 +97,15 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource
|
|||||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Admissionregistration().V1beta1().ValidatingWebhookConfigurations().Informer()}, nil
|
return &genericInformer{resource: resource.GroupResource(), informer: f.Admissionregistration().V1beta1().ValidatingWebhookConfigurations().Informer()}, nil
|
||||||
|
|
||||||
// Group=apps, Version=v1
|
// Group=apps, Version=v1
|
||||||
case v1.SchemeGroupVersion.WithResource("controllerrevisions"):
|
case appsv1.SchemeGroupVersion.WithResource("controllerrevisions"):
|
||||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Apps().V1().ControllerRevisions().Informer()}, nil
|
return &genericInformer{resource: resource.GroupResource(), informer: f.Apps().V1().ControllerRevisions().Informer()}, nil
|
||||||
case v1.SchemeGroupVersion.WithResource("daemonsets"):
|
case appsv1.SchemeGroupVersion.WithResource("daemonsets"):
|
||||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Apps().V1().DaemonSets().Informer()}, nil
|
return &genericInformer{resource: resource.GroupResource(), informer: f.Apps().V1().DaemonSets().Informer()}, nil
|
||||||
case v1.SchemeGroupVersion.WithResource("deployments"):
|
case appsv1.SchemeGroupVersion.WithResource("deployments"):
|
||||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Apps().V1().Deployments().Informer()}, nil
|
return &genericInformer{resource: resource.GroupResource(), informer: f.Apps().V1().Deployments().Informer()}, nil
|
||||||
case v1.SchemeGroupVersion.WithResource("replicasets"):
|
case appsv1.SchemeGroupVersion.WithResource("replicasets"):
|
||||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Apps().V1().ReplicaSets().Informer()}, nil
|
return &genericInformer{resource: resource.GroupResource(), informer: f.Apps().V1().ReplicaSets().Informer()}, nil
|
||||||
case v1.SchemeGroupVersion.WithResource("statefulsets"):
|
case appsv1.SchemeGroupVersion.WithResource("statefulsets"):
|
||||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Apps().V1().StatefulSets().Informer()}, nil
|
return &genericInformer{resource: resource.GroupResource(), informer: f.Apps().V1().StatefulSets().Informer()}, nil
|
||||||
|
|
||||||
// Group=apps, Version=v1beta1
|
// Group=apps, Version=v1beta1
|
||||||
|
@ -12,6 +12,7 @@ go_library(
|
|||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
deps = [
|
deps = [
|
||||||
"//staging/src/k8s.io/client-go/discovery:go_default_library",
|
"//staging/src/k8s.io/client-go/discovery:go_default_library",
|
||||||
|
"//staging/src/k8s.io/client-go/kubernetes/typed/admissionregistration/v1:go_default_library",
|
||||||
"//staging/src/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1:go_default_library",
|
"//staging/src/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1:go_default_library",
|
||||||
"//staging/src/k8s.io/client-go/kubernetes/typed/apps/v1:go_default_library",
|
"//staging/src/k8s.io/client-go/kubernetes/typed/apps/v1:go_default_library",
|
||||||
"//staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta1:go_default_library",
|
"//staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta1:go_default_library",
|
||||||
@ -66,6 +67,7 @@ filegroup(
|
|||||||
":package-srcs",
|
":package-srcs",
|
||||||
"//staging/src/k8s.io/client-go/kubernetes/fake:all-srcs",
|
"//staging/src/k8s.io/client-go/kubernetes/fake:all-srcs",
|
||||||
"//staging/src/k8s.io/client-go/kubernetes/scheme:all-srcs",
|
"//staging/src/k8s.io/client-go/kubernetes/scheme:all-srcs",
|
||||||
|
"//staging/src/k8s.io/client-go/kubernetes/typed/admissionregistration/v1:all-srcs",
|
||||||
"//staging/src/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1:all-srcs",
|
"//staging/src/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1:all-srcs",
|
||||||
"//staging/src/k8s.io/client-go/kubernetes/typed/apps/v1:all-srcs",
|
"//staging/src/k8s.io/client-go/kubernetes/typed/apps/v1:all-srcs",
|
||||||
"//staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta1:all-srcs",
|
"//staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta1:all-srcs",
|
||||||
|
@ -22,6 +22,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
discovery "k8s.io/client-go/discovery"
|
discovery "k8s.io/client-go/discovery"
|
||||||
|
admissionregistrationv1 "k8s.io/client-go/kubernetes/typed/admissionregistration/v1"
|
||||||
admissionregistrationv1beta1 "k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1"
|
admissionregistrationv1beta1 "k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1"
|
||||||
appsv1 "k8s.io/client-go/kubernetes/typed/apps/v1"
|
appsv1 "k8s.io/client-go/kubernetes/typed/apps/v1"
|
||||||
appsv1beta1 "k8s.io/client-go/kubernetes/typed/apps/v1beta1"
|
appsv1beta1 "k8s.io/client-go/kubernetes/typed/apps/v1beta1"
|
||||||
@ -64,6 +65,7 @@ import (
|
|||||||
|
|
||||||
type Interface interface {
|
type Interface interface {
|
||||||
Discovery() discovery.DiscoveryInterface
|
Discovery() discovery.DiscoveryInterface
|
||||||
|
AdmissionregistrationV1() admissionregistrationv1.AdmissionregistrationV1Interface
|
||||||
AdmissionregistrationV1beta1() admissionregistrationv1beta1.AdmissionregistrationV1beta1Interface
|
AdmissionregistrationV1beta1() admissionregistrationv1beta1.AdmissionregistrationV1beta1Interface
|
||||||
AppsV1() appsv1.AppsV1Interface
|
AppsV1() appsv1.AppsV1Interface
|
||||||
AppsV1beta1() appsv1beta1.AppsV1beta1Interface
|
AppsV1beta1() appsv1beta1.AppsV1beta1Interface
|
||||||
@ -106,6 +108,7 @@ type Interface interface {
|
|||||||
// version included in a Clientset.
|
// version included in a Clientset.
|
||||||
type Clientset struct {
|
type Clientset struct {
|
||||||
*discovery.DiscoveryClient
|
*discovery.DiscoveryClient
|
||||||
|
admissionregistrationV1 *admissionregistrationv1.AdmissionregistrationV1Client
|
||||||
admissionregistrationV1beta1 *admissionregistrationv1beta1.AdmissionregistrationV1beta1Client
|
admissionregistrationV1beta1 *admissionregistrationv1beta1.AdmissionregistrationV1beta1Client
|
||||||
appsV1 *appsv1.AppsV1Client
|
appsV1 *appsv1.AppsV1Client
|
||||||
appsV1beta1 *appsv1beta1.AppsV1beta1Client
|
appsV1beta1 *appsv1beta1.AppsV1beta1Client
|
||||||
@ -144,6 +147,11 @@ type Clientset struct {
|
|||||||
storageV1alpha1 *storagev1alpha1.StorageV1alpha1Client
|
storageV1alpha1 *storagev1alpha1.StorageV1alpha1Client
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// AdmissionregistrationV1 retrieves the AdmissionregistrationV1Client
|
||||||
|
func (c *Clientset) AdmissionregistrationV1() admissionregistrationv1.AdmissionregistrationV1Interface {
|
||||||
|
return c.admissionregistrationV1
|
||||||
|
}
|
||||||
|
|
||||||
// AdmissionregistrationV1beta1 retrieves the AdmissionregistrationV1beta1Client
|
// AdmissionregistrationV1beta1 retrieves the AdmissionregistrationV1beta1Client
|
||||||
func (c *Clientset) AdmissionregistrationV1beta1() admissionregistrationv1beta1.AdmissionregistrationV1beta1Interface {
|
func (c *Clientset) AdmissionregistrationV1beta1() admissionregistrationv1beta1.AdmissionregistrationV1beta1Interface {
|
||||||
return c.admissionregistrationV1beta1
|
return c.admissionregistrationV1beta1
|
||||||
@ -345,6 +353,10 @@ func NewForConfig(c *rest.Config) (*Clientset, error) {
|
|||||||
}
|
}
|
||||||
var cs Clientset
|
var cs Clientset
|
||||||
var err error
|
var err error
|
||||||
|
cs.admissionregistrationV1, err = admissionregistrationv1.NewForConfig(&configShallowCopy)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
cs.admissionregistrationV1beta1, err = admissionregistrationv1beta1.NewForConfig(&configShallowCopy)
|
cs.admissionregistrationV1beta1, err = admissionregistrationv1beta1.NewForConfig(&configShallowCopy)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@ -501,6 +513,7 @@ func NewForConfig(c *rest.Config) (*Clientset, error) {
|
|||||||
// panics if there is an error in the config.
|
// panics if there is an error in the config.
|
||||||
func NewForConfigOrDie(c *rest.Config) *Clientset {
|
func NewForConfigOrDie(c *rest.Config) *Clientset {
|
||||||
var cs Clientset
|
var cs Clientset
|
||||||
|
cs.admissionregistrationV1 = admissionregistrationv1.NewForConfigOrDie(c)
|
||||||
cs.admissionregistrationV1beta1 = admissionregistrationv1beta1.NewForConfigOrDie(c)
|
cs.admissionregistrationV1beta1 = admissionregistrationv1beta1.NewForConfigOrDie(c)
|
||||||
cs.appsV1 = appsv1.NewForConfigOrDie(c)
|
cs.appsV1 = appsv1.NewForConfigOrDie(c)
|
||||||
cs.appsV1beta1 = appsv1beta1.NewForConfigOrDie(c)
|
cs.appsV1beta1 = appsv1beta1.NewForConfigOrDie(c)
|
||||||
@ -545,6 +558,7 @@ func NewForConfigOrDie(c *rest.Config) *Clientset {
|
|||||||
// New creates a new Clientset for the given RESTClient.
|
// New creates a new Clientset for the given RESTClient.
|
||||||
func New(c rest.Interface) *Clientset {
|
func New(c rest.Interface) *Clientset {
|
||||||
var cs Clientset
|
var cs Clientset
|
||||||
|
cs.admissionregistrationV1 = admissionregistrationv1.New(c)
|
||||||
cs.admissionregistrationV1beta1 = admissionregistrationv1beta1.New(c)
|
cs.admissionregistrationV1beta1 = admissionregistrationv1beta1.New(c)
|
||||||
cs.appsV1 = appsv1.New(c)
|
cs.appsV1 = appsv1.New(c)
|
||||||
cs.appsV1beta1 = appsv1beta1.New(c)
|
cs.appsV1beta1 = appsv1beta1.New(c)
|
||||||
|
@ -11,6 +11,7 @@ go_library(
|
|||||||
importpath = "k8s.io/client-go/kubernetes/fake",
|
importpath = "k8s.io/client-go/kubernetes/fake",
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
deps = [
|
deps = [
|
||||||
|
"//staging/src/k8s.io/api/admissionregistration/v1:go_default_library",
|
||||||
"//staging/src/k8s.io/api/admissionregistration/v1beta1:go_default_library",
|
"//staging/src/k8s.io/api/admissionregistration/v1beta1:go_default_library",
|
||||||
"//staging/src/k8s.io/api/apps/v1:go_default_library",
|
"//staging/src/k8s.io/api/apps/v1:go_default_library",
|
||||||
"//staging/src/k8s.io/api/apps/v1beta1:go_default_library",
|
"//staging/src/k8s.io/api/apps/v1beta1:go_default_library",
|
||||||
@ -56,6 +57,8 @@ go_library(
|
|||||||
"//staging/src/k8s.io/client-go/discovery:go_default_library",
|
"//staging/src/k8s.io/client-go/discovery:go_default_library",
|
||||||
"//staging/src/k8s.io/client-go/discovery/fake:go_default_library",
|
"//staging/src/k8s.io/client-go/discovery/fake:go_default_library",
|
||||||
"//staging/src/k8s.io/client-go/kubernetes:go_default_library",
|
"//staging/src/k8s.io/client-go/kubernetes:go_default_library",
|
||||||
|
"//staging/src/k8s.io/client-go/kubernetes/typed/admissionregistration/v1:go_default_library",
|
||||||
|
"//staging/src/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/fake:go_default_library",
|
||||||
"//staging/src/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1:go_default_library",
|
"//staging/src/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1:go_default_library",
|
||||||
"//staging/src/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake:go_default_library",
|
"//staging/src/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake:go_default_library",
|
||||||
"//staging/src/k8s.io/client-go/kubernetes/typed/apps/v1:go_default_library",
|
"//staging/src/k8s.io/client-go/kubernetes/typed/apps/v1:go_default_library",
|
||||||
|
@ -24,6 +24,8 @@ import (
|
|||||||
"k8s.io/client-go/discovery"
|
"k8s.io/client-go/discovery"
|
||||||
fakediscovery "k8s.io/client-go/discovery/fake"
|
fakediscovery "k8s.io/client-go/discovery/fake"
|
||||||
clientset "k8s.io/client-go/kubernetes"
|
clientset "k8s.io/client-go/kubernetes"
|
||||||
|
admissionregistrationv1 "k8s.io/client-go/kubernetes/typed/admissionregistration/v1"
|
||||||
|
fakeadmissionregistrationv1 "k8s.io/client-go/kubernetes/typed/admissionregistration/v1/fake"
|
||||||
admissionregistrationv1beta1 "k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1"
|
admissionregistrationv1beta1 "k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1"
|
||||||
fakeadmissionregistrationv1beta1 "k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake"
|
fakeadmissionregistrationv1beta1 "k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake"
|
||||||
appsv1 "k8s.io/client-go/kubernetes/typed/apps/v1"
|
appsv1 "k8s.io/client-go/kubernetes/typed/apps/v1"
|
||||||
@ -146,6 +148,11 @@ func (c *Clientset) Tracker() testing.ObjectTracker {
|
|||||||
|
|
||||||
var _ clientset.Interface = &Clientset{}
|
var _ clientset.Interface = &Clientset{}
|
||||||
|
|
||||||
|
// AdmissionregistrationV1 retrieves the AdmissionregistrationV1Client
|
||||||
|
func (c *Clientset) AdmissionregistrationV1() admissionregistrationv1.AdmissionregistrationV1Interface {
|
||||||
|
return &fakeadmissionregistrationv1.FakeAdmissionregistrationV1{Fake: &c.Fake}
|
||||||
|
}
|
||||||
|
|
||||||
// AdmissionregistrationV1beta1 retrieves the AdmissionregistrationV1beta1Client
|
// AdmissionregistrationV1beta1 retrieves the AdmissionregistrationV1beta1Client
|
||||||
func (c *Clientset) AdmissionregistrationV1beta1() admissionregistrationv1beta1.AdmissionregistrationV1beta1Interface {
|
func (c *Clientset) AdmissionregistrationV1beta1() admissionregistrationv1beta1.AdmissionregistrationV1beta1Interface {
|
||||||
return &fakeadmissionregistrationv1beta1.FakeAdmissionregistrationV1beta1{Fake: &c.Fake}
|
return &fakeadmissionregistrationv1beta1.FakeAdmissionregistrationV1beta1{Fake: &c.Fake}
|
||||||
|
@ -19,6 +19,7 @@ limitations under the License.
|
|||||||
package fake
|
package fake
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
admissionregistrationv1 "k8s.io/api/admissionregistration/v1"
|
||||||
admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1"
|
admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1"
|
||||||
appsv1 "k8s.io/api/apps/v1"
|
appsv1 "k8s.io/api/apps/v1"
|
||||||
appsv1beta1 "k8s.io/api/apps/v1beta1"
|
appsv1beta1 "k8s.io/api/apps/v1beta1"
|
||||||
@ -66,6 +67,7 @@ var scheme = runtime.NewScheme()
|
|||||||
var codecs = serializer.NewCodecFactory(scheme)
|
var codecs = serializer.NewCodecFactory(scheme)
|
||||||
var parameterCodec = runtime.NewParameterCodec(scheme)
|
var parameterCodec = runtime.NewParameterCodec(scheme)
|
||||||
var localSchemeBuilder = runtime.SchemeBuilder{
|
var localSchemeBuilder = runtime.SchemeBuilder{
|
||||||
|
admissionregistrationv1.AddToScheme,
|
||||||
admissionregistrationv1beta1.AddToScheme,
|
admissionregistrationv1beta1.AddToScheme,
|
||||||
appsv1.AddToScheme,
|
appsv1.AddToScheme,
|
||||||
appsv1beta1.AddToScheme,
|
appsv1beta1.AddToScheme,
|
||||||
|
@ -10,6 +10,7 @@ go_library(
|
|||||||
importpath = "k8s.io/client-go/kubernetes/scheme",
|
importpath = "k8s.io/client-go/kubernetes/scheme",
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
deps = [
|
deps = [
|
||||||
|
"//staging/src/k8s.io/api/admissionregistration/v1:go_default_library",
|
||||||
"//staging/src/k8s.io/api/admissionregistration/v1beta1:go_default_library",
|
"//staging/src/k8s.io/api/admissionregistration/v1beta1:go_default_library",
|
||||||
"//staging/src/k8s.io/api/apps/v1:go_default_library",
|
"//staging/src/k8s.io/api/apps/v1:go_default_library",
|
||||||
"//staging/src/k8s.io/api/apps/v1beta1:go_default_library",
|
"//staging/src/k8s.io/api/apps/v1beta1:go_default_library",
|
||||||
|
@ -19,6 +19,7 @@ limitations under the License.
|
|||||||
package scheme
|
package scheme
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
admissionregistrationv1 "k8s.io/api/admissionregistration/v1"
|
||||||
admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1"
|
admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1"
|
||||||
appsv1 "k8s.io/api/apps/v1"
|
appsv1 "k8s.io/api/apps/v1"
|
||||||
appsv1beta1 "k8s.io/api/apps/v1beta1"
|
appsv1beta1 "k8s.io/api/apps/v1beta1"
|
||||||
@ -66,6 +67,7 @@ var Scheme = runtime.NewScheme()
|
|||||||
var Codecs = serializer.NewCodecFactory(Scheme)
|
var Codecs = serializer.NewCodecFactory(Scheme)
|
||||||
var ParameterCodec = runtime.NewParameterCodec(Scheme)
|
var ParameterCodec = runtime.NewParameterCodec(Scheme)
|
||||||
var localSchemeBuilder = runtime.SchemeBuilder{
|
var localSchemeBuilder = runtime.SchemeBuilder{
|
||||||
|
admissionregistrationv1.AddToScheme,
|
||||||
admissionregistrationv1beta1.AddToScheme,
|
admissionregistrationv1beta1.AddToScheme,
|
||||||
appsv1.AddToScheme,
|
appsv1.AddToScheme,
|
||||||
appsv1beta1.AddToScheme,
|
appsv1beta1.AddToScheme,
|
||||||
|
@ -0,0 +1,40 @@
|
|||||||
|
load("@io_bazel_rules_go//go:def.bzl", "go_library")
|
||||||
|
|
||||||
|
go_library(
|
||||||
|
name = "go_default_library",
|
||||||
|
srcs = [
|
||||||
|
"admissionregistration_client.go",
|
||||||
|
"doc.go",
|
||||||
|
"generated_expansion.go",
|
||||||
|
"mutatingwebhookconfiguration.go",
|
||||||
|
"validatingwebhookconfiguration.go",
|
||||||
|
],
|
||||||
|
importmap = "k8s.io/kubernetes/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1",
|
||||||
|
importpath = "k8s.io/client-go/kubernetes/typed/admissionregistration/v1",
|
||||||
|
visibility = ["//visibility:public"],
|
||||||
|
deps = [
|
||||||
|
"//staging/src/k8s.io/api/admissionregistration/v1:go_default_library",
|
||||||
|
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
|
||||||
|
"//staging/src/k8s.io/apimachinery/pkg/types:go_default_library",
|
||||||
|
"//staging/src/k8s.io/apimachinery/pkg/watch:go_default_library",
|
||||||
|
"//staging/src/k8s.io/client-go/kubernetes/scheme:go_default_library",
|
||||||
|
"//staging/src/k8s.io/client-go/rest:go_default_library",
|
||||||
|
],
|
||||||
|
)
|
||||||
|
|
||||||
|
filegroup(
|
||||||
|
name = "package-srcs",
|
||||||
|
srcs = glob(["**"]),
|
||||||
|
tags = ["automanaged"],
|
||||||
|
visibility = ["//visibility:private"],
|
||||||
|
)
|
||||||
|
|
||||||
|
filegroup(
|
||||||
|
name = "all-srcs",
|
||||||
|
srcs = [
|
||||||
|
":package-srcs",
|
||||||
|
"//staging/src/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/fake:all-srcs",
|
||||||
|
],
|
||||||
|
tags = ["automanaged"],
|
||||||
|
visibility = ["//visibility:public"],
|
||||||
|
)
|
@ -0,0 +1,94 @@
|
|||||||
|
/*
|
||||||
|
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 client-gen. DO NOT EDIT.
|
||||||
|
|
||||||
|
package v1
|
||||||
|
|
||||||
|
import (
|
||||||
|
v1 "k8s.io/api/admissionregistration/v1"
|
||||||
|
"k8s.io/client-go/kubernetes/scheme"
|
||||||
|
rest "k8s.io/client-go/rest"
|
||||||
|
)
|
||||||
|
|
||||||
|
type AdmissionregistrationV1Interface interface {
|
||||||
|
RESTClient() rest.Interface
|
||||||
|
MutatingWebhookConfigurationsGetter
|
||||||
|
ValidatingWebhookConfigurationsGetter
|
||||||
|
}
|
||||||
|
|
||||||
|
// AdmissionregistrationV1Client is used to interact with features provided by the admissionregistration.k8s.io group.
|
||||||
|
type AdmissionregistrationV1Client struct {
|
||||||
|
restClient rest.Interface
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *AdmissionregistrationV1Client) MutatingWebhookConfigurations() MutatingWebhookConfigurationInterface {
|
||||||
|
return newMutatingWebhookConfigurations(c)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *AdmissionregistrationV1Client) ValidatingWebhookConfigurations() ValidatingWebhookConfigurationInterface {
|
||||||
|
return newValidatingWebhookConfigurations(c)
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewForConfig creates a new AdmissionregistrationV1Client for the given config.
|
||||||
|
func NewForConfig(c *rest.Config) (*AdmissionregistrationV1Client, error) {
|
||||||
|
config := *c
|
||||||
|
if err := setConfigDefaults(&config); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
client, err := rest.RESTClientFor(&config)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return &AdmissionregistrationV1Client{client}, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewForConfigOrDie creates a new AdmissionregistrationV1Client for the given config and
|
||||||
|
// panics if there is an error in the config.
|
||||||
|
func NewForConfigOrDie(c *rest.Config) *AdmissionregistrationV1Client {
|
||||||
|
client, err := NewForConfig(c)
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
return client
|
||||||
|
}
|
||||||
|
|
||||||
|
// New creates a new AdmissionregistrationV1Client for the given RESTClient.
|
||||||
|
func New(c rest.Interface) *AdmissionregistrationV1Client {
|
||||||
|
return &AdmissionregistrationV1Client{c}
|
||||||
|
}
|
||||||
|
|
||||||
|
func setConfigDefaults(config *rest.Config) error {
|
||||||
|
gv := v1.SchemeGroupVersion
|
||||||
|
config.GroupVersion = &gv
|
||||||
|
config.APIPath = "/apis"
|
||||||
|
config.NegotiatedSerializer = scheme.Codecs.WithoutConversion()
|
||||||
|
|
||||||
|
if config.UserAgent == "" {
|
||||||
|
config.UserAgent = rest.DefaultKubernetesUserAgent()
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// RESTClient returns a RESTClient that is used to communicate
|
||||||
|
// with API server by this client implementation.
|
||||||
|
func (c *AdmissionregistrationV1Client) RESTClient() rest.Interface {
|
||||||
|
if c == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
return c.restClient
|
||||||
|
}
|
@ -0,0 +1,20 @@
|
|||||||
|
/*
|
||||||
|
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 client-gen. DO NOT EDIT.
|
||||||
|
|
||||||
|
// This package has the automatically generated typed clients.
|
||||||
|
package v1
|
@ -0,0 +1,39 @@
|
|||||||
|
load("@io_bazel_rules_go//go:def.bzl", "go_library")
|
||||||
|
|
||||||
|
go_library(
|
||||||
|
name = "go_default_library",
|
||||||
|
srcs = [
|
||||||
|
"doc.go",
|
||||||
|
"fake_admissionregistration_client.go",
|
||||||
|
"fake_mutatingwebhookconfiguration.go",
|
||||||
|
"fake_validatingwebhookconfiguration.go",
|
||||||
|
],
|
||||||
|
importmap = "k8s.io/kubernetes/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/fake",
|
||||||
|
importpath = "k8s.io/client-go/kubernetes/typed/admissionregistration/v1/fake",
|
||||||
|
visibility = ["//visibility:public"],
|
||||||
|
deps = [
|
||||||
|
"//staging/src/k8s.io/api/admissionregistration/v1:go_default_library",
|
||||||
|
"//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
|
||||||
|
"//staging/src/k8s.io/apimachinery/pkg/labels:go_default_library",
|
||||||
|
"//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library",
|
||||||
|
"//staging/src/k8s.io/apimachinery/pkg/types:go_default_library",
|
||||||
|
"//staging/src/k8s.io/apimachinery/pkg/watch:go_default_library",
|
||||||
|
"//staging/src/k8s.io/client-go/kubernetes/typed/admissionregistration/v1:go_default_library",
|
||||||
|
"//staging/src/k8s.io/client-go/rest:go_default_library",
|
||||||
|
"//staging/src/k8s.io/client-go/testing:go_default_library",
|
||||||
|
],
|
||||||
|
)
|
||||||
|
|
||||||
|
filegroup(
|
||||||
|
name = "package-srcs",
|
||||||
|
srcs = glob(["**"]),
|
||||||
|
tags = ["automanaged"],
|
||||||
|
visibility = ["//visibility:private"],
|
||||||
|
)
|
||||||
|
|
||||||
|
filegroup(
|
||||||
|
name = "all-srcs",
|
||||||
|
srcs = [":package-srcs"],
|
||||||
|
tags = ["automanaged"],
|
||||||
|
visibility = ["//visibility:public"],
|
||||||
|
)
|
@ -0,0 +1,20 @@
|
|||||||
|
/*
|
||||||
|
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 client-gen. DO NOT EDIT.
|
||||||
|
|
||||||
|
// Package fake has the automatically generated clients.
|
||||||
|
package fake
|
@ -0,0 +1,44 @@
|
|||||||
|
/*
|
||||||
|
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 client-gen. DO NOT EDIT.
|
||||||
|
|
||||||
|
package fake
|
||||||
|
|
||||||
|
import (
|
||||||
|
v1 "k8s.io/client-go/kubernetes/typed/admissionregistration/v1"
|
||||||
|
rest "k8s.io/client-go/rest"
|
||||||
|
testing "k8s.io/client-go/testing"
|
||||||
|
)
|
||||||
|
|
||||||
|
type FakeAdmissionregistrationV1 struct {
|
||||||
|
*testing.Fake
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *FakeAdmissionregistrationV1) MutatingWebhookConfigurations() v1.MutatingWebhookConfigurationInterface {
|
||||||
|
return &FakeMutatingWebhookConfigurations{c}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *FakeAdmissionregistrationV1) ValidatingWebhookConfigurations() v1.ValidatingWebhookConfigurationInterface {
|
||||||
|
return &FakeValidatingWebhookConfigurations{c}
|
||||||
|
}
|
||||||
|
|
||||||
|
// RESTClient returns a RESTClient that is used to communicate
|
||||||
|
// with API server by this client implementation.
|
||||||
|
func (c *FakeAdmissionregistrationV1) RESTClient() rest.Interface {
|
||||||
|
var ret *rest.RESTClient
|
||||||
|
return ret
|
||||||
|
}
|
@ -0,0 +1,120 @@
|
|||||||
|
/*
|
||||||
|
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 client-gen. DO NOT EDIT.
|
||||||
|
|
||||||
|
package fake
|
||||||
|
|
||||||
|
import (
|
||||||
|
admissionregistrationv1 "k8s.io/api/admissionregistration/v1"
|
||||||
|
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
labels "k8s.io/apimachinery/pkg/labels"
|
||||||
|
schema "k8s.io/apimachinery/pkg/runtime/schema"
|
||||||
|
types "k8s.io/apimachinery/pkg/types"
|
||||||
|
watch "k8s.io/apimachinery/pkg/watch"
|
||||||
|
testing "k8s.io/client-go/testing"
|
||||||
|
)
|
||||||
|
|
||||||
|
// FakeMutatingWebhookConfigurations implements MutatingWebhookConfigurationInterface
|
||||||
|
type FakeMutatingWebhookConfigurations struct {
|
||||||
|
Fake *FakeAdmissionregistrationV1
|
||||||
|
}
|
||||||
|
|
||||||
|
var mutatingwebhookconfigurationsResource = schema.GroupVersionResource{Group: "admissionregistration.k8s.io", Version: "v1", Resource: "mutatingwebhookconfigurations"}
|
||||||
|
|
||||||
|
var mutatingwebhookconfigurationsKind = schema.GroupVersionKind{Group: "admissionregistration.k8s.io", Version: "v1", Kind: "MutatingWebhookConfiguration"}
|
||||||
|
|
||||||
|
// Get takes name of the mutatingWebhookConfiguration, and returns the corresponding mutatingWebhookConfiguration object, and an error if there is any.
|
||||||
|
func (c *FakeMutatingWebhookConfigurations) Get(name string, options v1.GetOptions) (result *admissionregistrationv1.MutatingWebhookConfiguration, err error) {
|
||||||
|
obj, err := c.Fake.
|
||||||
|
Invokes(testing.NewRootGetAction(mutatingwebhookconfigurationsResource, name), &admissionregistrationv1.MutatingWebhookConfiguration{})
|
||||||
|
if obj == nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return obj.(*admissionregistrationv1.MutatingWebhookConfiguration), err
|
||||||
|
}
|
||||||
|
|
||||||
|
// List takes label and field selectors, and returns the list of MutatingWebhookConfigurations that match those selectors.
|
||||||
|
func (c *FakeMutatingWebhookConfigurations) List(opts v1.ListOptions) (result *admissionregistrationv1.MutatingWebhookConfigurationList, err error) {
|
||||||
|
obj, err := c.Fake.
|
||||||
|
Invokes(testing.NewRootListAction(mutatingwebhookconfigurationsResource, mutatingwebhookconfigurationsKind, opts), &admissionregistrationv1.MutatingWebhookConfigurationList{})
|
||||||
|
if obj == nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||||
|
if label == nil {
|
||||||
|
label = labels.Everything()
|
||||||
|
}
|
||||||
|
list := &admissionregistrationv1.MutatingWebhookConfigurationList{ListMeta: obj.(*admissionregistrationv1.MutatingWebhookConfigurationList).ListMeta}
|
||||||
|
for _, item := range obj.(*admissionregistrationv1.MutatingWebhookConfigurationList).Items {
|
||||||
|
if label.Matches(labels.Set(item.Labels)) {
|
||||||
|
list.Items = append(list.Items, item)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return list, err
|
||||||
|
}
|
||||||
|
|
||||||
|
// Watch returns a watch.Interface that watches the requested mutatingWebhookConfigurations.
|
||||||
|
func (c *FakeMutatingWebhookConfigurations) Watch(opts v1.ListOptions) (watch.Interface, error) {
|
||||||
|
return c.Fake.
|
||||||
|
InvokesWatch(testing.NewRootWatchAction(mutatingwebhookconfigurationsResource, opts))
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create takes the representation of a mutatingWebhookConfiguration and creates it. Returns the server's representation of the mutatingWebhookConfiguration, and an error, if there is any.
|
||||||
|
func (c *FakeMutatingWebhookConfigurations) Create(mutatingWebhookConfiguration *admissionregistrationv1.MutatingWebhookConfiguration) (result *admissionregistrationv1.MutatingWebhookConfiguration, err error) {
|
||||||
|
obj, err := c.Fake.
|
||||||
|
Invokes(testing.NewRootCreateAction(mutatingwebhookconfigurationsResource, mutatingWebhookConfiguration), &admissionregistrationv1.MutatingWebhookConfiguration{})
|
||||||
|
if obj == nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return obj.(*admissionregistrationv1.MutatingWebhookConfiguration), err
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update takes the representation of a mutatingWebhookConfiguration and updates it. Returns the server's representation of the mutatingWebhookConfiguration, and an error, if there is any.
|
||||||
|
func (c *FakeMutatingWebhookConfigurations) Update(mutatingWebhookConfiguration *admissionregistrationv1.MutatingWebhookConfiguration) (result *admissionregistrationv1.MutatingWebhookConfiguration, err error) {
|
||||||
|
obj, err := c.Fake.
|
||||||
|
Invokes(testing.NewRootUpdateAction(mutatingwebhookconfigurationsResource, mutatingWebhookConfiguration), &admissionregistrationv1.MutatingWebhookConfiguration{})
|
||||||
|
if obj == nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return obj.(*admissionregistrationv1.MutatingWebhookConfiguration), err
|
||||||
|
}
|
||||||
|
|
||||||
|
// Delete takes name of the mutatingWebhookConfiguration and deletes it. Returns an error if one occurs.
|
||||||
|
func (c *FakeMutatingWebhookConfigurations) Delete(name string, options *v1.DeleteOptions) error {
|
||||||
|
_, err := c.Fake.
|
||||||
|
Invokes(testing.NewRootDeleteAction(mutatingwebhookconfigurationsResource, name), &admissionregistrationv1.MutatingWebhookConfiguration{})
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeleteCollection deletes a collection of objects.
|
||||||
|
func (c *FakeMutatingWebhookConfigurations) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
|
||||||
|
action := testing.NewRootDeleteCollectionAction(mutatingwebhookconfigurationsResource, listOptions)
|
||||||
|
|
||||||
|
_, err := c.Fake.Invokes(action, &admissionregistrationv1.MutatingWebhookConfigurationList{})
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// Patch applies the patch and returns the patched mutatingWebhookConfiguration.
|
||||||
|
func (c *FakeMutatingWebhookConfigurations) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *admissionregistrationv1.MutatingWebhookConfiguration, err error) {
|
||||||
|
obj, err := c.Fake.
|
||||||
|
Invokes(testing.NewRootPatchSubresourceAction(mutatingwebhookconfigurationsResource, name, pt, data, subresources...), &admissionregistrationv1.MutatingWebhookConfiguration{})
|
||||||
|
if obj == nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return obj.(*admissionregistrationv1.MutatingWebhookConfiguration), err
|
||||||
|
}
|
@ -0,0 +1,120 @@
|
|||||||
|
/*
|
||||||
|
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 client-gen. DO NOT EDIT.
|
||||||
|
|
||||||
|
package fake
|
||||||
|
|
||||||
|
import (
|
||||||
|
admissionregistrationv1 "k8s.io/api/admissionregistration/v1"
|
||||||
|
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
labels "k8s.io/apimachinery/pkg/labels"
|
||||||
|
schema "k8s.io/apimachinery/pkg/runtime/schema"
|
||||||
|
types "k8s.io/apimachinery/pkg/types"
|
||||||
|
watch "k8s.io/apimachinery/pkg/watch"
|
||||||
|
testing "k8s.io/client-go/testing"
|
||||||
|
)
|
||||||
|
|
||||||
|
// FakeValidatingWebhookConfigurations implements ValidatingWebhookConfigurationInterface
|
||||||
|
type FakeValidatingWebhookConfigurations struct {
|
||||||
|
Fake *FakeAdmissionregistrationV1
|
||||||
|
}
|
||||||
|
|
||||||
|
var validatingwebhookconfigurationsResource = schema.GroupVersionResource{Group: "admissionregistration.k8s.io", Version: "v1", Resource: "validatingwebhookconfigurations"}
|
||||||
|
|
||||||
|
var validatingwebhookconfigurationsKind = schema.GroupVersionKind{Group: "admissionregistration.k8s.io", Version: "v1", Kind: "ValidatingWebhookConfiguration"}
|
||||||
|
|
||||||
|
// Get takes name of the validatingWebhookConfiguration, and returns the corresponding validatingWebhookConfiguration object, and an error if there is any.
|
||||||
|
func (c *FakeValidatingWebhookConfigurations) Get(name string, options v1.GetOptions) (result *admissionregistrationv1.ValidatingWebhookConfiguration, err error) {
|
||||||
|
obj, err := c.Fake.
|
||||||
|
Invokes(testing.NewRootGetAction(validatingwebhookconfigurationsResource, name), &admissionregistrationv1.ValidatingWebhookConfiguration{})
|
||||||
|
if obj == nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return obj.(*admissionregistrationv1.ValidatingWebhookConfiguration), err
|
||||||
|
}
|
||||||
|
|
||||||
|
// List takes label and field selectors, and returns the list of ValidatingWebhookConfigurations that match those selectors.
|
||||||
|
func (c *FakeValidatingWebhookConfigurations) List(opts v1.ListOptions) (result *admissionregistrationv1.ValidatingWebhookConfigurationList, err error) {
|
||||||
|
obj, err := c.Fake.
|
||||||
|
Invokes(testing.NewRootListAction(validatingwebhookconfigurationsResource, validatingwebhookconfigurationsKind, opts), &admissionregistrationv1.ValidatingWebhookConfigurationList{})
|
||||||
|
if obj == nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||||
|
if label == nil {
|
||||||
|
label = labels.Everything()
|
||||||
|
}
|
||||||
|
list := &admissionregistrationv1.ValidatingWebhookConfigurationList{ListMeta: obj.(*admissionregistrationv1.ValidatingWebhookConfigurationList).ListMeta}
|
||||||
|
for _, item := range obj.(*admissionregistrationv1.ValidatingWebhookConfigurationList).Items {
|
||||||
|
if label.Matches(labels.Set(item.Labels)) {
|
||||||
|
list.Items = append(list.Items, item)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return list, err
|
||||||
|
}
|
||||||
|
|
||||||
|
// Watch returns a watch.Interface that watches the requested validatingWebhookConfigurations.
|
||||||
|
func (c *FakeValidatingWebhookConfigurations) Watch(opts v1.ListOptions) (watch.Interface, error) {
|
||||||
|
return c.Fake.
|
||||||
|
InvokesWatch(testing.NewRootWatchAction(validatingwebhookconfigurationsResource, opts))
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create takes the representation of a validatingWebhookConfiguration and creates it. Returns the server's representation of the validatingWebhookConfiguration, and an error, if there is any.
|
||||||
|
func (c *FakeValidatingWebhookConfigurations) Create(validatingWebhookConfiguration *admissionregistrationv1.ValidatingWebhookConfiguration) (result *admissionregistrationv1.ValidatingWebhookConfiguration, err error) {
|
||||||
|
obj, err := c.Fake.
|
||||||
|
Invokes(testing.NewRootCreateAction(validatingwebhookconfigurationsResource, validatingWebhookConfiguration), &admissionregistrationv1.ValidatingWebhookConfiguration{})
|
||||||
|
if obj == nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return obj.(*admissionregistrationv1.ValidatingWebhookConfiguration), err
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update takes the representation of a validatingWebhookConfiguration and updates it. Returns the server's representation of the validatingWebhookConfiguration, and an error, if there is any.
|
||||||
|
func (c *FakeValidatingWebhookConfigurations) Update(validatingWebhookConfiguration *admissionregistrationv1.ValidatingWebhookConfiguration) (result *admissionregistrationv1.ValidatingWebhookConfiguration, err error) {
|
||||||
|
obj, err := c.Fake.
|
||||||
|
Invokes(testing.NewRootUpdateAction(validatingwebhookconfigurationsResource, validatingWebhookConfiguration), &admissionregistrationv1.ValidatingWebhookConfiguration{})
|
||||||
|
if obj == nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return obj.(*admissionregistrationv1.ValidatingWebhookConfiguration), err
|
||||||
|
}
|
||||||
|
|
||||||
|
// Delete takes name of the validatingWebhookConfiguration and deletes it. Returns an error if one occurs.
|
||||||
|
func (c *FakeValidatingWebhookConfigurations) Delete(name string, options *v1.DeleteOptions) error {
|
||||||
|
_, err := c.Fake.
|
||||||
|
Invokes(testing.NewRootDeleteAction(validatingwebhookconfigurationsResource, name), &admissionregistrationv1.ValidatingWebhookConfiguration{})
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeleteCollection deletes a collection of objects.
|
||||||
|
func (c *FakeValidatingWebhookConfigurations) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
|
||||||
|
action := testing.NewRootDeleteCollectionAction(validatingwebhookconfigurationsResource, listOptions)
|
||||||
|
|
||||||
|
_, err := c.Fake.Invokes(action, &admissionregistrationv1.ValidatingWebhookConfigurationList{})
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// Patch applies the patch and returns the patched validatingWebhookConfiguration.
|
||||||
|
func (c *FakeValidatingWebhookConfigurations) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *admissionregistrationv1.ValidatingWebhookConfiguration, err error) {
|
||||||
|
obj, err := c.Fake.
|
||||||
|
Invokes(testing.NewRootPatchSubresourceAction(validatingwebhookconfigurationsResource, name, pt, data, subresources...), &admissionregistrationv1.ValidatingWebhookConfiguration{})
|
||||||
|
if obj == nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return obj.(*admissionregistrationv1.ValidatingWebhookConfiguration), err
|
||||||
|
}
|
@ -0,0 +1,23 @@
|
|||||||
|
/*
|
||||||
|
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 client-gen. DO NOT EDIT.
|
||||||
|
|
||||||
|
package v1
|
||||||
|
|
||||||
|
type MutatingWebhookConfigurationExpansion interface{}
|
||||||
|
|
||||||
|
type ValidatingWebhookConfigurationExpansion interface{}
|
@ -0,0 +1,164 @@
|
|||||||
|
/*
|
||||||
|
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 client-gen. DO NOT EDIT.
|
||||||
|
|
||||||
|
package v1
|
||||||
|
|
||||||
|
import (
|
||||||
|
"time"
|
||||||
|
|
||||||
|
v1 "k8s.io/api/admissionregistration/v1"
|
||||||
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
types "k8s.io/apimachinery/pkg/types"
|
||||||
|
watch "k8s.io/apimachinery/pkg/watch"
|
||||||
|
scheme "k8s.io/client-go/kubernetes/scheme"
|
||||||
|
rest "k8s.io/client-go/rest"
|
||||||
|
)
|
||||||
|
|
||||||
|
// MutatingWebhookConfigurationsGetter has a method to return a MutatingWebhookConfigurationInterface.
|
||||||
|
// A group's client should implement this interface.
|
||||||
|
type MutatingWebhookConfigurationsGetter interface {
|
||||||
|
MutatingWebhookConfigurations() MutatingWebhookConfigurationInterface
|
||||||
|
}
|
||||||
|
|
||||||
|
// MutatingWebhookConfigurationInterface has methods to work with MutatingWebhookConfiguration resources.
|
||||||
|
type MutatingWebhookConfigurationInterface interface {
|
||||||
|
Create(*v1.MutatingWebhookConfiguration) (*v1.MutatingWebhookConfiguration, error)
|
||||||
|
Update(*v1.MutatingWebhookConfiguration) (*v1.MutatingWebhookConfiguration, error)
|
||||||
|
Delete(name string, options *metav1.DeleteOptions) error
|
||||||
|
DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error
|
||||||
|
Get(name string, options metav1.GetOptions) (*v1.MutatingWebhookConfiguration, error)
|
||||||
|
List(opts metav1.ListOptions) (*v1.MutatingWebhookConfigurationList, error)
|
||||||
|
Watch(opts metav1.ListOptions) (watch.Interface, error)
|
||||||
|
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.MutatingWebhookConfiguration, err error)
|
||||||
|
MutatingWebhookConfigurationExpansion
|
||||||
|
}
|
||||||
|
|
||||||
|
// mutatingWebhookConfigurations implements MutatingWebhookConfigurationInterface
|
||||||
|
type mutatingWebhookConfigurations struct {
|
||||||
|
client rest.Interface
|
||||||
|
}
|
||||||
|
|
||||||
|
// newMutatingWebhookConfigurations returns a MutatingWebhookConfigurations
|
||||||
|
func newMutatingWebhookConfigurations(c *AdmissionregistrationV1Client) *mutatingWebhookConfigurations {
|
||||||
|
return &mutatingWebhookConfigurations{
|
||||||
|
client: c.RESTClient(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get takes name of the mutatingWebhookConfiguration, and returns the corresponding mutatingWebhookConfiguration object, and an error if there is any.
|
||||||
|
func (c *mutatingWebhookConfigurations) Get(name string, options metav1.GetOptions) (result *v1.MutatingWebhookConfiguration, err error) {
|
||||||
|
result = &v1.MutatingWebhookConfiguration{}
|
||||||
|
err = c.client.Get().
|
||||||
|
Resource("mutatingwebhookconfigurations").
|
||||||
|
Name(name).
|
||||||
|
VersionedParams(&options, scheme.ParameterCodec).
|
||||||
|
Do().
|
||||||
|
Into(result)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// List takes label and field selectors, and returns the list of MutatingWebhookConfigurations that match those selectors.
|
||||||
|
func (c *mutatingWebhookConfigurations) List(opts metav1.ListOptions) (result *v1.MutatingWebhookConfigurationList, err error) {
|
||||||
|
var timeout time.Duration
|
||||||
|
if opts.TimeoutSeconds != nil {
|
||||||
|
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
|
||||||
|
}
|
||||||
|
result = &v1.MutatingWebhookConfigurationList{}
|
||||||
|
err = c.client.Get().
|
||||||
|
Resource("mutatingwebhookconfigurations").
|
||||||
|
VersionedParams(&opts, scheme.ParameterCodec).
|
||||||
|
Timeout(timeout).
|
||||||
|
Do().
|
||||||
|
Into(result)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// Watch returns a watch.Interface that watches the requested mutatingWebhookConfigurations.
|
||||||
|
func (c *mutatingWebhookConfigurations) Watch(opts metav1.ListOptions) (watch.Interface, error) {
|
||||||
|
var timeout time.Duration
|
||||||
|
if opts.TimeoutSeconds != nil {
|
||||||
|
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
|
||||||
|
}
|
||||||
|
opts.Watch = true
|
||||||
|
return c.client.Get().
|
||||||
|
Resource("mutatingwebhookconfigurations").
|
||||||
|
VersionedParams(&opts, scheme.ParameterCodec).
|
||||||
|
Timeout(timeout).
|
||||||
|
Watch()
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create takes the representation of a mutatingWebhookConfiguration and creates it. Returns the server's representation of the mutatingWebhookConfiguration, and an error, if there is any.
|
||||||
|
func (c *mutatingWebhookConfigurations) Create(mutatingWebhookConfiguration *v1.MutatingWebhookConfiguration) (result *v1.MutatingWebhookConfiguration, err error) {
|
||||||
|
result = &v1.MutatingWebhookConfiguration{}
|
||||||
|
err = c.client.Post().
|
||||||
|
Resource("mutatingwebhookconfigurations").
|
||||||
|
Body(mutatingWebhookConfiguration).
|
||||||
|
Do().
|
||||||
|
Into(result)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update takes the representation of a mutatingWebhookConfiguration and updates it. Returns the server's representation of the mutatingWebhookConfiguration, and an error, if there is any.
|
||||||
|
func (c *mutatingWebhookConfigurations) Update(mutatingWebhookConfiguration *v1.MutatingWebhookConfiguration) (result *v1.MutatingWebhookConfiguration, err error) {
|
||||||
|
result = &v1.MutatingWebhookConfiguration{}
|
||||||
|
err = c.client.Put().
|
||||||
|
Resource("mutatingwebhookconfigurations").
|
||||||
|
Name(mutatingWebhookConfiguration.Name).
|
||||||
|
Body(mutatingWebhookConfiguration).
|
||||||
|
Do().
|
||||||
|
Into(result)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// Delete takes name of the mutatingWebhookConfiguration and deletes it. Returns an error if one occurs.
|
||||||
|
func (c *mutatingWebhookConfigurations) Delete(name string, options *metav1.DeleteOptions) error {
|
||||||
|
return c.client.Delete().
|
||||||
|
Resource("mutatingwebhookconfigurations").
|
||||||
|
Name(name).
|
||||||
|
Body(options).
|
||||||
|
Do().
|
||||||
|
Error()
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeleteCollection deletes a collection of objects.
|
||||||
|
func (c *mutatingWebhookConfigurations) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error {
|
||||||
|
var timeout time.Duration
|
||||||
|
if listOptions.TimeoutSeconds != nil {
|
||||||
|
timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
|
||||||
|
}
|
||||||
|
return c.client.Delete().
|
||||||
|
Resource("mutatingwebhookconfigurations").
|
||||||
|
VersionedParams(&listOptions, scheme.ParameterCodec).
|
||||||
|
Timeout(timeout).
|
||||||
|
Body(options).
|
||||||
|
Do().
|
||||||
|
Error()
|
||||||
|
}
|
||||||
|
|
||||||
|
// Patch applies the patch and returns the patched mutatingWebhookConfiguration.
|
||||||
|
func (c *mutatingWebhookConfigurations) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.MutatingWebhookConfiguration, err error) {
|
||||||
|
result = &v1.MutatingWebhookConfiguration{}
|
||||||
|
err = c.client.Patch(pt).
|
||||||
|
Resource("mutatingwebhookconfigurations").
|
||||||
|
SubResource(subresources...).
|
||||||
|
Name(name).
|
||||||
|
Body(data).
|
||||||
|
Do().
|
||||||
|
Into(result)
|
||||||
|
return
|
||||||
|
}
|
@ -0,0 +1,164 @@
|
|||||||
|
/*
|
||||||
|
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 client-gen. DO NOT EDIT.
|
||||||
|
|
||||||
|
package v1
|
||||||
|
|
||||||
|
import (
|
||||||
|
"time"
|
||||||
|
|
||||||
|
v1 "k8s.io/api/admissionregistration/v1"
|
||||||
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
types "k8s.io/apimachinery/pkg/types"
|
||||||
|
watch "k8s.io/apimachinery/pkg/watch"
|
||||||
|
scheme "k8s.io/client-go/kubernetes/scheme"
|
||||||
|
rest "k8s.io/client-go/rest"
|
||||||
|
)
|
||||||
|
|
||||||
|
// ValidatingWebhookConfigurationsGetter has a method to return a ValidatingWebhookConfigurationInterface.
|
||||||
|
// A group's client should implement this interface.
|
||||||
|
type ValidatingWebhookConfigurationsGetter interface {
|
||||||
|
ValidatingWebhookConfigurations() ValidatingWebhookConfigurationInterface
|
||||||
|
}
|
||||||
|
|
||||||
|
// ValidatingWebhookConfigurationInterface has methods to work with ValidatingWebhookConfiguration resources.
|
||||||
|
type ValidatingWebhookConfigurationInterface interface {
|
||||||
|
Create(*v1.ValidatingWebhookConfiguration) (*v1.ValidatingWebhookConfiguration, error)
|
||||||
|
Update(*v1.ValidatingWebhookConfiguration) (*v1.ValidatingWebhookConfiguration, error)
|
||||||
|
Delete(name string, options *metav1.DeleteOptions) error
|
||||||
|
DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error
|
||||||
|
Get(name string, options metav1.GetOptions) (*v1.ValidatingWebhookConfiguration, error)
|
||||||
|
List(opts metav1.ListOptions) (*v1.ValidatingWebhookConfigurationList, error)
|
||||||
|
Watch(opts metav1.ListOptions) (watch.Interface, error)
|
||||||
|
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ValidatingWebhookConfiguration, err error)
|
||||||
|
ValidatingWebhookConfigurationExpansion
|
||||||
|
}
|
||||||
|
|
||||||
|
// validatingWebhookConfigurations implements ValidatingWebhookConfigurationInterface
|
||||||
|
type validatingWebhookConfigurations struct {
|
||||||
|
client rest.Interface
|
||||||
|
}
|
||||||
|
|
||||||
|
// newValidatingWebhookConfigurations returns a ValidatingWebhookConfigurations
|
||||||
|
func newValidatingWebhookConfigurations(c *AdmissionregistrationV1Client) *validatingWebhookConfigurations {
|
||||||
|
return &validatingWebhookConfigurations{
|
||||||
|
client: c.RESTClient(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get takes name of the validatingWebhookConfiguration, and returns the corresponding validatingWebhookConfiguration object, and an error if there is any.
|
||||||
|
func (c *validatingWebhookConfigurations) Get(name string, options metav1.GetOptions) (result *v1.ValidatingWebhookConfiguration, err error) {
|
||||||
|
result = &v1.ValidatingWebhookConfiguration{}
|
||||||
|
err = c.client.Get().
|
||||||
|
Resource("validatingwebhookconfigurations").
|
||||||
|
Name(name).
|
||||||
|
VersionedParams(&options, scheme.ParameterCodec).
|
||||||
|
Do().
|
||||||
|
Into(result)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// List takes label and field selectors, and returns the list of ValidatingWebhookConfigurations that match those selectors.
|
||||||
|
func (c *validatingWebhookConfigurations) List(opts metav1.ListOptions) (result *v1.ValidatingWebhookConfigurationList, err error) {
|
||||||
|
var timeout time.Duration
|
||||||
|
if opts.TimeoutSeconds != nil {
|
||||||
|
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
|
||||||
|
}
|
||||||
|
result = &v1.ValidatingWebhookConfigurationList{}
|
||||||
|
err = c.client.Get().
|
||||||
|
Resource("validatingwebhookconfigurations").
|
||||||
|
VersionedParams(&opts, scheme.ParameterCodec).
|
||||||
|
Timeout(timeout).
|
||||||
|
Do().
|
||||||
|
Into(result)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// Watch returns a watch.Interface that watches the requested validatingWebhookConfigurations.
|
||||||
|
func (c *validatingWebhookConfigurations) Watch(opts metav1.ListOptions) (watch.Interface, error) {
|
||||||
|
var timeout time.Duration
|
||||||
|
if opts.TimeoutSeconds != nil {
|
||||||
|
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
|
||||||
|
}
|
||||||
|
opts.Watch = true
|
||||||
|
return c.client.Get().
|
||||||
|
Resource("validatingwebhookconfigurations").
|
||||||
|
VersionedParams(&opts, scheme.ParameterCodec).
|
||||||
|
Timeout(timeout).
|
||||||
|
Watch()
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create takes the representation of a validatingWebhookConfiguration and creates it. Returns the server's representation of the validatingWebhookConfiguration, and an error, if there is any.
|
||||||
|
func (c *validatingWebhookConfigurations) Create(validatingWebhookConfiguration *v1.ValidatingWebhookConfiguration) (result *v1.ValidatingWebhookConfiguration, err error) {
|
||||||
|
result = &v1.ValidatingWebhookConfiguration{}
|
||||||
|
err = c.client.Post().
|
||||||
|
Resource("validatingwebhookconfigurations").
|
||||||
|
Body(validatingWebhookConfiguration).
|
||||||
|
Do().
|
||||||
|
Into(result)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update takes the representation of a validatingWebhookConfiguration and updates it. Returns the server's representation of the validatingWebhookConfiguration, and an error, if there is any.
|
||||||
|
func (c *validatingWebhookConfigurations) Update(validatingWebhookConfiguration *v1.ValidatingWebhookConfiguration) (result *v1.ValidatingWebhookConfiguration, err error) {
|
||||||
|
result = &v1.ValidatingWebhookConfiguration{}
|
||||||
|
err = c.client.Put().
|
||||||
|
Resource("validatingwebhookconfigurations").
|
||||||
|
Name(validatingWebhookConfiguration.Name).
|
||||||
|
Body(validatingWebhookConfiguration).
|
||||||
|
Do().
|
||||||
|
Into(result)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// Delete takes name of the validatingWebhookConfiguration and deletes it. Returns an error if one occurs.
|
||||||
|
func (c *validatingWebhookConfigurations) Delete(name string, options *metav1.DeleteOptions) error {
|
||||||
|
return c.client.Delete().
|
||||||
|
Resource("validatingwebhookconfigurations").
|
||||||
|
Name(name).
|
||||||
|
Body(options).
|
||||||
|
Do().
|
||||||
|
Error()
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeleteCollection deletes a collection of objects.
|
||||||
|
func (c *validatingWebhookConfigurations) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error {
|
||||||
|
var timeout time.Duration
|
||||||
|
if listOptions.TimeoutSeconds != nil {
|
||||||
|
timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
|
||||||
|
}
|
||||||
|
return c.client.Delete().
|
||||||
|
Resource("validatingwebhookconfigurations").
|
||||||
|
VersionedParams(&listOptions, scheme.ParameterCodec).
|
||||||
|
Timeout(timeout).
|
||||||
|
Body(options).
|
||||||
|
Do().
|
||||||
|
Error()
|
||||||
|
}
|
||||||
|
|
||||||
|
// Patch applies the patch and returns the patched validatingWebhookConfiguration.
|
||||||
|
func (c *validatingWebhookConfigurations) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ValidatingWebhookConfiguration, err error) {
|
||||||
|
result = &v1.ValidatingWebhookConfiguration{}
|
||||||
|
err = c.client.Patch(pt).
|
||||||
|
Resource("validatingwebhookconfigurations").
|
||||||
|
SubResource(subresources...).
|
||||||
|
Name(name).
|
||||||
|
Body(data).
|
||||||
|
Do().
|
||||||
|
Into(result)
|
||||||
|
return
|
||||||
|
}
|
@ -0,0 +1,33 @@
|
|||||||
|
load("@io_bazel_rules_go//go:def.bzl", "go_library")
|
||||||
|
|
||||||
|
go_library(
|
||||||
|
name = "go_default_library",
|
||||||
|
srcs = [
|
||||||
|
"expansion_generated.go",
|
||||||
|
"mutatingwebhookconfiguration.go",
|
||||||
|
"validatingwebhookconfiguration.go",
|
||||||
|
],
|
||||||
|
importmap = "k8s.io/kubernetes/vendor/k8s.io/client-go/listers/admissionregistration/v1",
|
||||||
|
importpath = "k8s.io/client-go/listers/admissionregistration/v1",
|
||||||
|
visibility = ["//visibility:public"],
|
||||||
|
deps = [
|
||||||
|
"//staging/src/k8s.io/api/admissionregistration/v1:go_default_library",
|
||||||
|
"//staging/src/k8s.io/apimachinery/pkg/api/errors:go_default_library",
|
||||||
|
"//staging/src/k8s.io/apimachinery/pkg/labels:go_default_library",
|
||||||
|
"//staging/src/k8s.io/client-go/tools/cache:go_default_library",
|
||||||
|
],
|
||||||
|
)
|
||||||
|
|
||||||
|
filegroup(
|
||||||
|
name = "package-srcs",
|
||||||
|
srcs = glob(["**"]),
|
||||||
|
tags = ["automanaged"],
|
||||||
|
visibility = ["//visibility:private"],
|
||||||
|
)
|
||||||
|
|
||||||
|
filegroup(
|
||||||
|
name = "all-srcs",
|
||||||
|
srcs = [":package-srcs"],
|
||||||
|
tags = ["automanaged"],
|
||||||
|
visibility = ["//visibility:public"],
|
||||||
|
)
|
@ -0,0 +1,27 @@
|
|||||||
|
/*
|
||||||
|
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 lister-gen. DO NOT EDIT.
|
||||||
|
|
||||||
|
package v1
|
||||||
|
|
||||||
|
// MutatingWebhookConfigurationListerExpansion allows custom methods to be added to
|
||||||
|
// MutatingWebhookConfigurationLister.
|
||||||
|
type MutatingWebhookConfigurationListerExpansion interface{}
|
||||||
|
|
||||||
|
// ValidatingWebhookConfigurationListerExpansion allows custom methods to be added to
|
||||||
|
// ValidatingWebhookConfigurationLister.
|
||||||
|
type ValidatingWebhookConfigurationListerExpansion interface{}
|
@ -0,0 +1,65 @@
|
|||||||
|
/*
|
||||||
|
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 lister-gen. DO NOT EDIT.
|
||||||
|
|
||||||
|
package v1
|
||||||
|
|
||||||
|
import (
|
||||||
|
v1 "k8s.io/api/admissionregistration/v1"
|
||||||
|
"k8s.io/apimachinery/pkg/api/errors"
|
||||||
|
"k8s.io/apimachinery/pkg/labels"
|
||||||
|
"k8s.io/client-go/tools/cache"
|
||||||
|
)
|
||||||
|
|
||||||
|
// MutatingWebhookConfigurationLister helps list MutatingWebhookConfigurations.
|
||||||
|
type MutatingWebhookConfigurationLister interface {
|
||||||
|
// List lists all MutatingWebhookConfigurations in the indexer.
|
||||||
|
List(selector labels.Selector) (ret []*v1.MutatingWebhookConfiguration, err error)
|
||||||
|
// Get retrieves the MutatingWebhookConfiguration from the index for a given name.
|
||||||
|
Get(name string) (*v1.MutatingWebhookConfiguration, error)
|
||||||
|
MutatingWebhookConfigurationListerExpansion
|
||||||
|
}
|
||||||
|
|
||||||
|
// mutatingWebhookConfigurationLister implements the MutatingWebhookConfigurationLister interface.
|
||||||
|
type mutatingWebhookConfigurationLister struct {
|
||||||
|
indexer cache.Indexer
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewMutatingWebhookConfigurationLister returns a new MutatingWebhookConfigurationLister.
|
||||||
|
func NewMutatingWebhookConfigurationLister(indexer cache.Indexer) MutatingWebhookConfigurationLister {
|
||||||
|
return &mutatingWebhookConfigurationLister{indexer: indexer}
|
||||||
|
}
|
||||||
|
|
||||||
|
// List lists all MutatingWebhookConfigurations in the indexer.
|
||||||
|
func (s *mutatingWebhookConfigurationLister) List(selector labels.Selector) (ret []*v1.MutatingWebhookConfiguration, err error) {
|
||||||
|
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
|
||||||
|
ret = append(ret, m.(*v1.MutatingWebhookConfiguration))
|
||||||
|
})
|
||||||
|
return ret, err
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get retrieves the MutatingWebhookConfiguration from the index for a given name.
|
||||||
|
func (s *mutatingWebhookConfigurationLister) Get(name string) (*v1.MutatingWebhookConfiguration, error) {
|
||||||
|
obj, exists, err := s.indexer.GetByKey(name)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if !exists {
|
||||||
|
return nil, errors.NewNotFound(v1.Resource("mutatingwebhookconfiguration"), name)
|
||||||
|
}
|
||||||
|
return obj.(*v1.MutatingWebhookConfiguration), nil
|
||||||
|
}
|
@ -0,0 +1,65 @@
|
|||||||
|
/*
|
||||||
|
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 lister-gen. DO NOT EDIT.
|
||||||
|
|
||||||
|
package v1
|
||||||
|
|
||||||
|
import (
|
||||||
|
v1 "k8s.io/api/admissionregistration/v1"
|
||||||
|
"k8s.io/apimachinery/pkg/api/errors"
|
||||||
|
"k8s.io/apimachinery/pkg/labels"
|
||||||
|
"k8s.io/client-go/tools/cache"
|
||||||
|
)
|
||||||
|
|
||||||
|
// ValidatingWebhookConfigurationLister helps list ValidatingWebhookConfigurations.
|
||||||
|
type ValidatingWebhookConfigurationLister interface {
|
||||||
|
// List lists all ValidatingWebhookConfigurations in the indexer.
|
||||||
|
List(selector labels.Selector) (ret []*v1.ValidatingWebhookConfiguration, err error)
|
||||||
|
// Get retrieves the ValidatingWebhookConfiguration from the index for a given name.
|
||||||
|
Get(name string) (*v1.ValidatingWebhookConfiguration, error)
|
||||||
|
ValidatingWebhookConfigurationListerExpansion
|
||||||
|
}
|
||||||
|
|
||||||
|
// validatingWebhookConfigurationLister implements the ValidatingWebhookConfigurationLister interface.
|
||||||
|
type validatingWebhookConfigurationLister struct {
|
||||||
|
indexer cache.Indexer
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewValidatingWebhookConfigurationLister returns a new ValidatingWebhookConfigurationLister.
|
||||||
|
func NewValidatingWebhookConfigurationLister(indexer cache.Indexer) ValidatingWebhookConfigurationLister {
|
||||||
|
return &validatingWebhookConfigurationLister{indexer: indexer}
|
||||||
|
}
|
||||||
|
|
||||||
|
// List lists all ValidatingWebhookConfigurations in the indexer.
|
||||||
|
func (s *validatingWebhookConfigurationLister) List(selector labels.Selector) (ret []*v1.ValidatingWebhookConfiguration, err error) {
|
||||||
|
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
|
||||||
|
ret = append(ret, m.(*v1.ValidatingWebhookConfiguration))
|
||||||
|
})
|
||||||
|
return ret, err
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get retrieves the ValidatingWebhookConfiguration from the index for a given name.
|
||||||
|
func (s *validatingWebhookConfigurationLister) Get(name string) (*v1.ValidatingWebhookConfiguration, error) {
|
||||||
|
obj, exists, err := s.indexer.GetByKey(name)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if !exists {
|
||||||
|
return nil, errors.NewNotFound(v1.Resource("validatingwebhookconfiguration"), name)
|
||||||
|
}
|
||||||
|
return obj.(*v1.ValidatingWebhookConfiguration), nil
|
||||||
|
}
|
@ -124,6 +124,8 @@ var (
|
|||||||
admissionExemptResources = map[schema.GroupVersionResource]bool{
|
admissionExemptResources = map[schema.GroupVersionResource]bool{
|
||||||
gvr("admissionregistration.k8s.io", "v1beta1", "mutatingwebhookconfigurations"): true,
|
gvr("admissionregistration.k8s.io", "v1beta1", "mutatingwebhookconfigurations"): true,
|
||||||
gvr("admissionregistration.k8s.io", "v1beta1", "validatingwebhookconfigurations"): true,
|
gvr("admissionregistration.k8s.io", "v1beta1", "validatingwebhookconfigurations"): true,
|
||||||
|
gvr("admissionregistration.k8s.io", "v1", "mutatingwebhookconfigurations"): true,
|
||||||
|
gvr("admissionregistration.k8s.io", "v1", "validatingwebhookconfigurations"): true,
|
||||||
}
|
}
|
||||||
|
|
||||||
parentResources = map[schema.GroupVersionResource]schema.GroupVersionResource{
|
parentResources = map[schema.GroupVersionResource]schema.GroupVersionResource{
|
||||||
|
@ -413,6 +413,19 @@ func GetEtcdStorageDataForNamespace(namespace string) map[schema.GroupVersionRes
|
|||||||
},
|
},
|
||||||
// --
|
// --
|
||||||
|
|
||||||
|
// k8s.io/kubernetes/pkg/apis/admissionregistration/v1
|
||||||
|
gvr("admissionregistration.k8s.io", "v1", "validatingwebhookconfigurations"): {
|
||||||
|
Stub: `{"metadata":{"name":"hook2","creationTimestamp":null},"webhooks":[{"name":"externaladmissionhook.k8s.io","clientConfig":{"service":{"namespace":"ns","name":"n"},"caBundle":null},"rules":[{"operations":["CREATE"],"apiGroups":["group"],"apiVersions":["version"],"resources":["resource"]}],"failurePolicy":"Ignore","sideEffects":"Unknown","admissionReviewVersions":["v1beta1"]}]}`,
|
||||||
|
ExpectedEtcdPath: "/registry/validatingwebhookconfigurations/hook2",
|
||||||
|
ExpectedGVK: gvkP("admissionregistration.k8s.io", "v1beta1", "ValidatingWebhookConfiguration"),
|
||||||
|
},
|
||||||
|
gvr("admissionregistration.k8s.io", "v1", "mutatingwebhookconfigurations"): {
|
||||||
|
Stub: `{"metadata":{"name":"hook2","creationTimestamp":null},"webhooks":[{"name":"externaladmissionhook.k8s.io","clientConfig":{"service":{"namespace":"ns","name":"n"},"caBundle":null},"rules":[{"operations":["CREATE"],"apiGroups":["group"],"apiVersions":["version"],"resources":["resource"]}],"failurePolicy":"Ignore","sideEffects":"Unknown","admissionReviewVersions":["v1beta1"]}]}`,
|
||||||
|
ExpectedEtcdPath: "/registry/mutatingwebhookconfigurations/hook2",
|
||||||
|
ExpectedGVK: gvkP("admissionregistration.k8s.io", "v1beta1", "MutatingWebhookConfiguration"),
|
||||||
|
},
|
||||||
|
// --
|
||||||
|
|
||||||
// k8s.io/kubernetes/pkg/apis/admissionregistration/v1beta1
|
// k8s.io/kubernetes/pkg/apis/admissionregistration/v1beta1
|
||||||
gvr("admissionregistration.k8s.io", "v1beta1", "validatingwebhookconfigurations"): {
|
gvr("admissionregistration.k8s.io", "v1beta1", "validatingwebhookconfigurations"): {
|
||||||
Stub: `{"metadata":{"name":"hook1","creationTimestamp":null},"webhooks":[{"name":"externaladmissionhook.k8s.io","clientConfig":{"service":{"namespace":"ns","name":"n"},"caBundle":null},"rules":[{"operations":["CREATE"],"apiGroups":["group"],"apiVersions":["version"],"resources":["resource"]}],"failurePolicy":"Ignore"}]}`,
|
Stub: `{"metadata":{"name":"hook1","creationTimestamp":null},"webhooks":[{"name":"externaladmissionhook.k8s.io","clientConfig":{"service":{"namespace":"ns","name":"n"},"caBundle":null},"rules":[{"operations":["CREATE"],"apiGroups":["group"],"apiVersions":["version"],"resources":["resource"]}],"failurePolicy":"Ignore"}]}`,
|
||||||
|
5
vendor/modules.txt
vendored
5
vendor/modules.txt
vendored
@ -1021,6 +1021,7 @@ gopkg.in/warnings.v0
|
|||||||
gopkg.in/yaml.v2
|
gopkg.in/yaml.v2
|
||||||
# k8s.io/api v0.0.0 => ./staging/src/k8s.io/api
|
# k8s.io/api v0.0.0 => ./staging/src/k8s.io/api
|
||||||
k8s.io/api/admission/v1beta1
|
k8s.io/api/admission/v1beta1
|
||||||
|
k8s.io/api/admissionregistration/v1
|
||||||
k8s.io/api/admissionregistration/v1beta1
|
k8s.io/api/admissionregistration/v1beta1
|
||||||
k8s.io/api/apps/v1
|
k8s.io/api/apps/v1
|
||||||
k8s.io/api/apps/v1beta1
|
k8s.io/api/apps/v1beta1
|
||||||
@ -1318,6 +1319,7 @@ k8s.io/client-go/dynamic
|
|||||||
k8s.io/client-go/dynamic/fake
|
k8s.io/client-go/dynamic/fake
|
||||||
k8s.io/client-go/informers
|
k8s.io/client-go/informers
|
||||||
k8s.io/client-go/informers/admissionregistration
|
k8s.io/client-go/informers/admissionregistration
|
||||||
|
k8s.io/client-go/informers/admissionregistration/v1
|
||||||
k8s.io/client-go/informers/admissionregistration/v1beta1
|
k8s.io/client-go/informers/admissionregistration/v1beta1
|
||||||
k8s.io/client-go/informers/apps
|
k8s.io/client-go/informers/apps
|
||||||
k8s.io/client-go/informers/apps/v1
|
k8s.io/client-go/informers/apps/v1
|
||||||
@ -1370,6 +1372,8 @@ k8s.io/client-go/informers/storage/v1beta1
|
|||||||
k8s.io/client-go/kubernetes
|
k8s.io/client-go/kubernetes
|
||||||
k8s.io/client-go/kubernetes/fake
|
k8s.io/client-go/kubernetes/fake
|
||||||
k8s.io/client-go/kubernetes/scheme
|
k8s.io/client-go/kubernetes/scheme
|
||||||
|
k8s.io/client-go/kubernetes/typed/admissionregistration/v1
|
||||||
|
k8s.io/client-go/kubernetes/typed/admissionregistration/v1/fake
|
||||||
k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1
|
k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1
|
||||||
k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake
|
k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/fake
|
||||||
k8s.io/client-go/kubernetes/typed/apps/v1
|
k8s.io/client-go/kubernetes/typed/apps/v1
|
||||||
@ -1442,6 +1446,7 @@ k8s.io/client-go/kubernetes/typed/storage/v1alpha1
|
|||||||
k8s.io/client-go/kubernetes/typed/storage/v1alpha1/fake
|
k8s.io/client-go/kubernetes/typed/storage/v1alpha1/fake
|
||||||
k8s.io/client-go/kubernetes/typed/storage/v1beta1
|
k8s.io/client-go/kubernetes/typed/storage/v1beta1
|
||||||
k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake
|
k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake
|
||||||
|
k8s.io/client-go/listers/admissionregistration/v1
|
||||||
k8s.io/client-go/listers/admissionregistration/v1beta1
|
k8s.io/client-go/listers/admissionregistration/v1beta1
|
||||||
k8s.io/client-go/listers/apps/v1
|
k8s.io/client-go/listers/apps/v1
|
||||||
k8s.io/client-go/listers/apps/v1beta1
|
k8s.io/client-go/listers/apps/v1beta1
|
||||||
|
Loading…
Reference in New Issue
Block a user