From 0fb729b2165d9d6654f60cf430f89ebd70218a30 Mon Sep 17 00:00:00 2001 From: yolgun Date: Mon, 24 Oct 2022 11:43:12 +0200 Subject: [PATCH] upgrade webhook from v1beta1 to v1 (#43) - cherry picked from 7a5d8be276254aaec1d662fc1998a90f8b7e2b68 - change failurePolicy to Ignore Co-authored-by: Yunus Olgun --- cmd/webhook-manager/app/util.go | 23 ++- docs/design/queue/queue-state-management.md | 4 +- .../admission/jobs/mutate/mutate_job.go | 24 +-- .../admission/jobs/validate/admit_job.go | 24 +-- .../admission/jobs/validate/admit_job_test.go | 52 +++---- .../podgroups/mutate/mutate_podgroup.go | 24 +-- pkg/webhooks/admission/pods/admit_pod.go | 23 ++- pkg/webhooks/admission/pods/admit_pod_test.go | 12 +- .../admission/queues/mutate/mutate_queue.go | 24 +-- .../queues/mutate/mutate_queue_test.go | 30 ++-- .../queues/validate/validate_queue.go | 24 +-- .../queues/validate/validate_queue_test.go | 112 +++++++------- pkg/webhooks/router/interface.go | 10 +- pkg/webhooks/router/server.go | 12 +- pkg/webhooks/schema/schema.go | 4 +- pkg/webhooks/util/util.go | 6 +- .../api/admission/{v1beta1 => v1}/doc.go | 5 +- .../admission/{v1beta1 => v1}/generated.pb.go | 140 +++++++++--------- .../admission/{v1beta1 => v1}/generated.proto | 6 +- .../api/admission/{v1beta1 => v1}/register.go | 6 +- .../api/admission/{v1beta1 => v1}/types.go | 11 +- .../types_swagger_doc_generated.go | 4 +- .../{v1beta1 => v1}/zz_generated.deepcopy.go | 10 +- .../zz_generated.prerelease-lifecycle.go | 50 ------- vendor/modules.txt | 2 +- 25 files changed, 298 insertions(+), 344 deletions(-) rename vendor/k8s.io/api/admission/{v1beta1 => v1}/doc.go (82%) rename vendor/k8s.io/api/admission/{v1beta1 => v1}/generated.pb.go (87%) rename vendor/k8s.io/api/admission/{v1beta1 => v1}/generated.proto (98%) rename vendor/k8s.io/api/admission/{v1beta1 => v1}/register.go (96%) rename vendor/k8s.io/api/admission/{v1beta1 => v1}/types.go (94%) rename vendor/k8s.io/api/admission/{v1beta1 => v1}/types_swagger_doc_generated.go (98%) rename vendor/k8s.io/api/admission/{v1beta1 => v1}/zz_generated.deepcopy.go (95%) delete mode 100644 vendor/k8s.io/api/admission/v1beta1/zz_generated.prerelease-lifecycle.go diff --git a/cmd/webhook-manager/app/util.go b/cmd/webhook-manager/app/util.go index 291bae25a4..59f421ddcd 100644 --- a/cmd/webhook-manager/app/util.go +++ b/cmd/webhook-manager/app/util.go @@ -22,7 +22,7 @@ import ( "regexp" "strings" - "k8s.io/api/admissionregistration/v1beta1" + "k8s.io/api/admissionregistration/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes" @@ -35,7 +35,10 @@ import ( ) func registerWebhookConfig(kubeClient *kubernetes.Clientset, config *options.Config, service *router.AdmissionService, caBundle []byte) { - clientConfig := v1beta1.WebhookClientConfig{ + failurePolicy := v1.Ignore + sideEffect := v1.SideEffectClassNoneOnDryRun + reviewVersions := []string{"v1"} + clientConfig := v1.WebhookClientConfig{ CABundle: caBundle, } if config.WebhookURL != "" { @@ -44,7 +47,7 @@ func registerWebhookConfig(kubeClient *kubernetes.Clientset, config *options.Con klog.Infof("The URL of webhook manager is <%s>.", url) } if config.WebhookName != "" && config.WebhookNamespace != "" { - clientConfig.Service = &v1beta1.ServiceReference{ + clientConfig.Service = &v1.ServiceReference{ Name: config.WebhookName, Namespace: config.WebhookNamespace, Path: &service.Path, @@ -54,7 +57,10 @@ func registerWebhookConfig(kubeClient *kubernetes.Clientset, config *options.Con } if service.MutatingConfig != nil { for i := range service.MutatingConfig.Webhooks { + service.MutatingConfig.Webhooks[i].SideEffects = &sideEffect + service.MutatingConfig.Webhooks[i].AdmissionReviewVersions = reviewVersions service.MutatingConfig.Webhooks[i].ClientConfig = clientConfig + service.MutatingConfig.Webhooks[i].FailurePolicy = &failurePolicy } service.MutatingConfig.ObjectMeta.Name = webhookConfigName(config.WebhookName, service.Path) @@ -68,7 +74,10 @@ func registerWebhookConfig(kubeClient *kubernetes.Clientset, config *options.Con } if service.ValidatingConfig != nil { for i := range service.ValidatingConfig.Webhooks { + service.ValidatingConfig.Webhooks[i].SideEffects = &sideEffect + service.ValidatingConfig.Webhooks[i].AdmissionReviewVersions = reviewVersions service.ValidatingConfig.Webhooks[i].ClientConfig = clientConfig + service.ValidatingConfig.Webhooks[i].FailurePolicy = &failurePolicy } service.ValidatingConfig.ObjectMeta.Name = webhookConfigName(config.WebhookName, service.Path) @@ -130,8 +139,8 @@ func configTLS(config *options.Config, restConfig *rest.Config) *tls.Config { return &tls.Config{} } -func registerMutateWebhook(clientset *kubernetes.Clientset, hook *v1beta1.MutatingWebhookConfiguration) error { - client := clientset.AdmissionregistrationV1beta1().MutatingWebhookConfigurations() +func registerMutateWebhook(clientset *kubernetes.Clientset, hook *v1.MutatingWebhookConfiguration) error { + client := clientset.AdmissionregistrationV1().MutatingWebhookConfigurations() existing, err := client.Get(context.TODO(), hook.Name, metav1.GetOptions{}) if err != nil && !apierrors.IsNotFound(err) { return err @@ -152,8 +161,8 @@ func registerMutateWebhook(clientset *kubernetes.Clientset, hook *v1beta1.Mutati return nil } -func registerValidateWebhook(clientset *kubernetes.Clientset, hook *v1beta1.ValidatingWebhookConfiguration) error { - client := clientset.AdmissionregistrationV1beta1().ValidatingWebhookConfigurations() +func registerValidateWebhook(clientset *kubernetes.Clientset, hook *v1.ValidatingWebhookConfiguration) error { + client := clientset.AdmissionregistrationV1().ValidatingWebhookConfigurations() existing, err := client.Get(context.TODO(), hook.Name, metav1.GetOptions{}) if err != nil && !apierrors.IsNotFound(err) { diff --git a/docs/design/queue/queue-state-management.md b/docs/design/queue/queue-state-management.md index d616ebaa6a..a1a243f6fd 100644 --- a/docs/design/queue/queue-state-management.md +++ b/docs/design/queue/queue-state-management.md @@ -118,7 +118,7 @@ under the status of queue, not the `state` under the `spec` of queue. Add `validatingwebhookconfiguration` for queue validation during creating, updating or deleting of queue. ```yaml -apiVersion: admissionregistration.k8s.io/v1beta1 +apiVersion: admissionregistration.k8s.io/v1 kind: ValidatingWebhookConfiguration metadata: name: {{ .Release.Name }}-validate-queue @@ -165,7 +165,7 @@ We need another `webhook` to set default state value for queue during queue crea and `MutateQueues` function ```yaml -apiVersion: admissionregistration.k8s.io/v1beta1 +apiVersion: admissionregistration.k8s.io/v1 kind: MutatingWebhookConfiguration metadata: name: {{ .Release.Name }}-mutate-queue diff --git a/pkg/webhooks/admission/jobs/mutate/mutate_job.go b/pkg/webhooks/admission/jobs/mutate/mutate_job.go index 04634b52c7..900bb32381 100644 --- a/pkg/webhooks/admission/jobs/mutate/mutate_job.go +++ b/pkg/webhooks/admission/jobs/mutate/mutate_job.go @@ -21,8 +21,8 @@ import ( "fmt" "strconv" - "k8s.io/api/admission/v1beta1" - whv1beta1 "k8s.io/api/admissionregistration/v1beta1" + admissionv1 "k8s.io/api/admission/v1" + whv1 "k8s.io/api/admissionregistration/v1" v1 "k8s.io/api/core/v1" "k8s.io/klog" @@ -49,13 +49,13 @@ var service = &router.AdmissionService{ Path: "/jobs/mutate", Func: Jobs, - MutatingConfig: &whv1beta1.MutatingWebhookConfiguration{ - Webhooks: []whv1beta1.MutatingWebhook{{ + MutatingConfig: &whv1.MutatingWebhookConfiguration{ + Webhooks: []whv1.MutatingWebhook{{ Name: "mutatejob.volcano.sh", - Rules: []whv1beta1.RuleWithOperations{ + Rules: []whv1.RuleWithOperations{ { - Operations: []whv1beta1.OperationType{whv1beta1.Create}, - Rule: whv1beta1.Rule{ + Operations: []whv1.OperationType{whv1.Create}, + Rule: whv1.Rule{ APIGroups: []string{"batch.volcano.sh"}, APIVersions: []string{"v1alpha1"}, Resources: []string{"jobs"}, @@ -72,8 +72,8 @@ type patchOperation struct { Value interface{} `json:"value,omitempty"` } -// MutateJobs mutate jobs. -func Jobs(ar v1beta1.AdmissionReview) *v1beta1.AdmissionResponse { +// Jobs mutate jobs. +func Jobs(ar admissionv1.AdmissionReview) *admissionv1.AdmissionResponse { klog.V(3).Infof("mutating jobs") job, err := schema.DecodeJob(ar.Request.Object, ar.Request.Resource) @@ -83,7 +83,7 @@ func Jobs(ar v1beta1.AdmissionReview) *v1beta1.AdmissionResponse { var patchBytes []byte switch ar.Request.Operation { - case v1beta1.Create: + case admissionv1.Create: patchBytes, _ = createPatch(job) break default: @@ -92,11 +92,11 @@ func Jobs(ar v1beta1.AdmissionReview) *v1beta1.AdmissionResponse { } klog.V(3).Infof("AdmissionResponse: patch=%v", string(patchBytes)) - reviewResponse := v1beta1.AdmissionResponse{ + reviewResponse := admissionv1.AdmissionResponse{ Allowed: true, Patch: patchBytes, } - pt := v1beta1.PatchTypeJSONPatch + pt := admissionv1.PatchTypeJSONPatch reviewResponse.PatchType = &pt return &reviewResponse diff --git a/pkg/webhooks/admission/jobs/validate/admit_job.go b/pkg/webhooks/admission/jobs/validate/admit_job.go index 3e734706e2..814b383873 100644 --- a/pkg/webhooks/admission/jobs/validate/admit_job.go +++ b/pkg/webhooks/admission/jobs/validate/admit_job.go @@ -21,8 +21,8 @@ import ( "fmt" "strings" - "k8s.io/api/admission/v1beta1" - whv1beta1 "k8s.io/api/admissionregistration/v1beta1" + admissionv1 "k8s.io/api/admission/v1" + whv1 "k8s.io/api/admissionregistration/v1" v1 "k8s.io/api/core/v1" apiequality "k8s.io/apimachinery/pkg/api/equality" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -52,13 +52,13 @@ var service = &router.AdmissionService{ Config: config, - ValidatingConfig: &whv1beta1.ValidatingWebhookConfiguration{ - Webhooks: []whv1beta1.ValidatingWebhook{{ + ValidatingConfig: &whv1.ValidatingWebhookConfiguration{ + Webhooks: []whv1.ValidatingWebhook{{ Name: "validatejob.volcano.sh", - Rules: []whv1beta1.RuleWithOperations{ + Rules: []whv1.RuleWithOperations{ { - Operations: []whv1beta1.OperationType{whv1beta1.Create, whv1beta1.Update}, - Rule: whv1beta1.Rule{ + Operations: []whv1.OperationType{whv1.Create, whv1.Update}, + Rule: whv1.Rule{ APIGroups: []string{"batch.volcano.sh"}, APIVersions: []string{"v1alpha1"}, Resources: []string{"jobs"}, @@ -72,7 +72,7 @@ var service = &router.AdmissionService{ var config = &router.AdmissionServiceConfig{} // AdmitJobs is to admit jobs and return response. -func AdmitJobs(ar v1beta1.AdmissionReview) *v1beta1.AdmissionResponse { +func AdmitJobs(ar admissionv1.AdmissionReview) *admissionv1.AdmissionResponse { klog.V(3).Infof("admitting jobs -- %s", ar.Request.Operation) job, err := schema.DecodeJob(ar.Request.Object, ar.Request.Resource) @@ -80,13 +80,13 @@ func AdmitJobs(ar v1beta1.AdmissionReview) *v1beta1.AdmissionResponse { return util.ToAdmissionResponse(err) } var msg string - reviewResponse := v1beta1.AdmissionResponse{} + reviewResponse := admissionv1.AdmissionResponse{} reviewResponse.Allowed = true switch ar.Request.Operation { - case v1beta1.Create: + case admissionv1.Create: msg = validateJobCreate(job, &reviewResponse) - case v1beta1.Update: + case admissionv1.Update: oldJob, err := schema.DecodeJob(ar.Request.OldObject, ar.Request.Resource) if err != nil { return util.ToAdmissionResponse(err) @@ -106,7 +106,7 @@ func AdmitJobs(ar v1beta1.AdmissionReview) *v1beta1.AdmissionResponse { return &reviewResponse } -func validateJobCreate(job *v1alpha1.Job, reviewResponse *v1beta1.AdmissionResponse) string { +func validateJobCreate(job *v1alpha1.Job, reviewResponse *admissionv1.AdmissionResponse) string { var msg string taskNames := map[string]string{} var totalReplicas int32 diff --git a/pkg/webhooks/admission/jobs/validate/admit_job_test.go b/pkg/webhooks/admission/jobs/validate/admit_job_test.go index 444dc34809..aec3292dd3 100644 --- a/pkg/webhooks/admission/jobs/validate/admit_job_test.go +++ b/pkg/webhooks/admission/jobs/validate/admit_job_test.go @@ -18,10 +18,10 @@ package validate import ( "context" + admissionv1 "k8s.io/api/admission/v1" "strings" "testing" - "k8s.io/api/admission/v1beta1" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -41,7 +41,7 @@ func TestValidateJobCreate(t *testing.T) { Name string Job v1alpha1.Job ExpectErr bool - reviewResponse v1beta1.AdmissionResponse + reviewResponse admissionv1.AdmissionResponse ret string }{ { @@ -81,7 +81,7 @@ func TestValidateJobCreate(t *testing.T) { }, }, }, - reviewResponse: v1beta1.AdmissionResponse{Allowed: true}, + reviewResponse: admissionv1.AdmissionResponse{Allowed: true}, ret: "", ExpectErr: false, }, @@ -134,7 +134,7 @@ func TestValidateJobCreate(t *testing.T) { }, }, }, - reviewResponse: v1beta1.AdmissionResponse{Allowed: true}, + reviewResponse: admissionv1.AdmissionResponse{Allowed: true}, ret: "duplicated task name duplicated-task-1", ExpectErr: true, }, @@ -180,7 +180,7 @@ func TestValidateJobCreate(t *testing.T) { }, }, }, - reviewResponse: v1beta1.AdmissionResponse{Allowed: true}, + reviewResponse: admissionv1.AdmissionResponse{Allowed: true}, ret: "duplicate", ExpectErr: true, }, @@ -216,7 +216,7 @@ func TestValidateJobCreate(t *testing.T) { }, }, }, - reviewResponse: v1beta1.AdmissionResponse{Allowed: true}, + reviewResponse: admissionv1.AdmissionResponse{Allowed: true}, ret: "job 'minAvailable' should not be greater than total replicas in tasks", ExpectErr: true, }, @@ -255,7 +255,7 @@ func TestValidateJobCreate(t *testing.T) { }, }, }, - reviewResponse: v1beta1.AdmissionResponse{Allowed: true}, + reviewResponse: admissionv1.AdmissionResponse{Allowed: true}, ret: "unable to find job plugin: big_plugin", ExpectErr: true, }, @@ -292,7 +292,7 @@ func TestValidateJobCreate(t *testing.T) { TTLSecondsAfterFinished: &invTTL, }, }, - reviewResponse: v1beta1.AdmissionResponse{Allowed: true}, + reviewResponse: admissionv1.AdmissionResponse{Allowed: true}, ret: "'ttlSecondsAfterFinished' cannot be less than zero", ExpectErr: true, }, @@ -328,7 +328,7 @@ func TestValidateJobCreate(t *testing.T) { }, }, }, - reviewResponse: v1beta1.AdmissionResponse{Allowed: false}, + reviewResponse: admissionv1.AdmissionResponse{Allowed: false}, ret: "job 'minAvailable' must be >= 0", ExpectErr: true, }, @@ -365,7 +365,7 @@ func TestValidateJobCreate(t *testing.T) { }, }, }, - reviewResponse: v1beta1.AdmissionResponse{Allowed: false}, + reviewResponse: admissionv1.AdmissionResponse{Allowed: false}, ret: "'maxRetry' cannot be less than zero.", ExpectErr: true, }, @@ -383,7 +383,7 @@ func TestValidateJobCreate(t *testing.T) { Tasks: []v1alpha1.TaskSpec{}, }, }, - reviewResponse: v1beta1.AdmissionResponse{Allowed: false}, + reviewResponse: admissionv1.AdmissionResponse{Allowed: false}, ret: "No task specified in job spec", ExpectErr: true, }, @@ -419,7 +419,7 @@ func TestValidateJobCreate(t *testing.T) { }, }, }, - reviewResponse: v1beta1.AdmissionResponse{Allowed: false}, + reviewResponse: admissionv1.AdmissionResponse{Allowed: false}, ret: "'replicas' < 0 in task: task-1;", ExpectErr: true, }, @@ -455,7 +455,7 @@ func TestValidateJobCreate(t *testing.T) { }, }, }, - reviewResponse: v1beta1.AdmissionResponse{Allowed: false}, + reviewResponse: admissionv1.AdmissionResponse{Allowed: false}, ret: "[a lowercase RFC 1123 label must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character (e.g. 'my-name', or '123-abc', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?')];", ExpectErr: true, }, @@ -498,7 +498,7 @@ func TestValidateJobCreate(t *testing.T) { }, }, }, - reviewResponse: v1beta1.AdmissionResponse{Allowed: true}, + reviewResponse: admissionv1.AdmissionResponse{Allowed: true}, ret: "must not specify event and exitCode simultaneously", ExpectErr: true, }, @@ -539,7 +539,7 @@ func TestValidateJobCreate(t *testing.T) { }, }, }, - reviewResponse: v1beta1.AdmissionResponse{Allowed: true}, + reviewResponse: admissionv1.AdmissionResponse{Allowed: true}, ret: "either event and exitCode should be specified", ExpectErr: true, }, @@ -581,7 +581,7 @@ func TestValidateJobCreate(t *testing.T) { }, }, }, - reviewResponse: v1beta1.AdmissionResponse{Allowed: true}, + reviewResponse: admissionv1.AdmissionResponse{Allowed: true}, ret: "invalid policy event", ExpectErr: true, }, @@ -623,7 +623,7 @@ func TestValidateJobCreate(t *testing.T) { }, }, }, - reviewResponse: v1beta1.AdmissionResponse{Allowed: true}, + reviewResponse: admissionv1.AdmissionResponse{Allowed: true}, ret: "invalid policy action", ExpectErr: true, }, @@ -667,7 +667,7 @@ func TestValidateJobCreate(t *testing.T) { }, }, }, - reviewResponse: v1beta1.AdmissionResponse{Allowed: true}, + reviewResponse: admissionv1.AdmissionResponse{Allowed: true}, ret: "0 is not a valid error code", ExpectErr: true, }, @@ -715,7 +715,7 @@ func TestValidateJobCreate(t *testing.T) { }, }, }, - reviewResponse: v1beta1.AdmissionResponse{Allowed: true}, + reviewResponse: admissionv1.AdmissionResponse{Allowed: true}, ret: "duplicate exitCode 1", ExpectErr: true, }, @@ -761,7 +761,7 @@ func TestValidateJobCreate(t *testing.T) { }, }, }, - reviewResponse: v1beta1.AdmissionResponse{Allowed: true}, + reviewResponse: admissionv1.AdmissionResponse{Allowed: true}, ret: "if there's * here, no other policy should be here", ExpectErr: true, }, @@ -808,7 +808,7 @@ func TestValidateJobCreate(t *testing.T) { }, }, }, - reviewResponse: v1beta1.AdmissionResponse{Allowed: true}, + reviewResponse: admissionv1.AdmissionResponse{Allowed: true}, ret: " mountPath is required;", ExpectErr: true, }, @@ -860,7 +860,7 @@ func TestValidateJobCreate(t *testing.T) { }, }, }, - reviewResponse: v1beta1.AdmissionResponse{Allowed: true}, + reviewResponse: admissionv1.AdmissionResponse{Allowed: true}, ret: " duplicated mountPath: /var;", ExpectErr: true, }, @@ -909,7 +909,7 @@ func TestValidateJobCreate(t *testing.T) { }, }, }, - reviewResponse: v1beta1.AdmissionResponse{Allowed: true}, + reviewResponse: admissionv1.AdmissionResponse{Allowed: true}, ret: " either VolumeClaim or VolumeClaimName must be specified;", ExpectErr: true, }, @@ -955,7 +955,7 @@ func TestValidateJobCreate(t *testing.T) { }, }, }, - reviewResponse: v1beta1.AdmissionResponse{Allowed: true}, + reviewResponse: admissionv1.AdmissionResponse{Allowed: true}, ret: "if there's * here, no other policy should be here", ExpectErr: true, }, @@ -991,7 +991,7 @@ func TestValidateJobCreate(t *testing.T) { }, }, }, - reviewResponse: v1beta1.AdmissionResponse{Allowed: true}, + reviewResponse: admissionv1.AdmissionResponse{Allowed: true}, ret: "unable to find job queue", ExpectErr: true, }, @@ -1029,7 +1029,7 @@ func TestValidateJobCreate(t *testing.T) { }, }, }, - reviewResponse: v1beta1.AdmissionResponse{Allowed: true}, + reviewResponse: admissionv1.AdmissionResponse{Allowed: true}, ret: "", ExpectErr: false, }, diff --git a/pkg/webhooks/admission/podgroups/mutate/mutate_podgroup.go b/pkg/webhooks/admission/podgroups/mutate/mutate_podgroup.go index 9370a47a41..c65acc8b86 100644 --- a/pkg/webhooks/admission/podgroups/mutate/mutate_podgroup.go +++ b/pkg/webhooks/admission/podgroups/mutate/mutate_podgroup.go @@ -20,8 +20,8 @@ import ( "encoding/json" "fmt" - "k8s.io/api/admission/v1beta1" - whv1beta1 "k8s.io/api/admissionregistration/v1beta1" + admissionv1 "k8s.io/api/admission/v1" + whv1 "k8s.io/api/admissionregistration/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/klog" @@ -39,13 +39,13 @@ var service = &router.AdmissionService{ Path: "/podgroups/mutate", Func: PodGroups, - MutatingConfig: &whv1beta1.MutatingWebhookConfiguration{ - Webhooks: []whv1beta1.MutatingWebhook{{ + MutatingConfig: &whv1.MutatingWebhookConfiguration{ + Webhooks: []whv1.MutatingWebhook{{ Name: "mutatepodgroup.volcano.sh", - Rules: []whv1beta1.RuleWithOperations{ + Rules: []whv1.RuleWithOperations{ { - Operations: []whv1beta1.OperationType{whv1beta1.Create}, - Rule: whv1beta1.Rule{ + Operations: []whv1.OperationType{whv1.Create}, + Rule: whv1.Rule{ APIGroups: []string{schedulingv1beta1.SchemeGroupVersion.Group}, APIVersions: []string{schedulingv1beta1.SchemeGroupVersion.Version}, Resources: []string{"podgroups"}, @@ -63,7 +63,7 @@ type patchOperation struct { } // PodGroups mutate podgroups. -func PodGroups(ar v1beta1.AdmissionReview) *v1beta1.AdmissionResponse { +func PodGroups(ar admissionv1.AdmissionReview) *admissionv1.AdmissionResponse { klog.V(3).Infof("Mutating %s podgroup %s.", ar.Request.Operation, ar.Request.Name) podgroup, err := schema.DecodePodGroup(ar.Request.Object, ar.Request.Resource) @@ -73,7 +73,7 @@ func PodGroups(ar v1beta1.AdmissionReview) *v1beta1.AdmissionResponse { var patchBytes []byte switch ar.Request.Operation { - case v1beta1.Create: + case admissionv1.Create: patchBytes, err = createPodGroupPatch(podgroup) default: return util.ToAdmissionResponse(fmt.Errorf("invalid operation `%s`, "+ @@ -81,14 +81,14 @@ func PodGroups(ar v1beta1.AdmissionReview) *v1beta1.AdmissionResponse { } if err != nil { - return &v1beta1.AdmissionResponse{ + return &admissionv1.AdmissionResponse{ Allowed: false, Result: &metav1.Status{Message: err.Error()}, } } - pt := v1beta1.PatchTypeJSONPatch - return &v1beta1.AdmissionResponse{ + pt := admissionv1.PatchTypeJSONPatch + return &admissionv1.AdmissionResponse{ Allowed: true, Patch: patchBytes, PatchType: &pt, diff --git a/pkg/webhooks/admission/pods/admit_pod.go b/pkg/webhooks/admission/pods/admit_pod.go index d3bbc5f6ec..b5cb0a5068 100644 --- a/pkg/webhooks/admission/pods/admit_pod.go +++ b/pkg/webhooks/admission/pods/admit_pod.go @@ -23,8 +23,8 @@ import ( "strings" - "k8s.io/api/admission/v1beta1" - whv1beta1 "k8s.io/api/admissionregistration/v1beta1" + admissionv1 "k8s.io/api/admission/v1" + whv1 "k8s.io/api/admissionregistration/v1" v1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -48,13 +48,13 @@ var service = &router.AdmissionService{ Config: config, - ValidatingConfig: &whv1beta1.ValidatingWebhookConfiguration{ - Webhooks: []whv1beta1.ValidatingWebhook{{ + ValidatingConfig: &whv1.ValidatingWebhookConfiguration{ + Webhooks: []whv1.ValidatingWebhook{{ Name: "validatepod.volcano.sh", - Rules: []whv1beta1.RuleWithOperations{ + Rules: []whv1.RuleWithOperations{ { - Operations: []whv1beta1.OperationType{whv1beta1.Create}, - Rule: whv1beta1.Rule{ + Operations: []whv1.OperationType{whv1.Create}, + Rule: whv1.Rule{ APIGroups: []string{""}, APIVersions: []string{"v1"}, Resources: []string{"pods"}, @@ -68,8 +68,7 @@ var service = &router.AdmissionService{ var config = &router.AdmissionServiceConfig{} // AdmitPods is to admit pods and return response. -func AdmitPods(ar v1beta1.AdmissionReview) *v1beta1.AdmissionResponse { - +func AdmitPods(ar admissionv1.AdmissionReview) *admissionv1.AdmissionResponse { klog.V(3).Infof("admitting pods -- %s", ar.Request.Operation) pod, err := schema.DecodePod(ar.Request.Object, ar.Request.Resource) @@ -78,11 +77,11 @@ func AdmitPods(ar v1beta1.AdmissionReview) *v1beta1.AdmissionResponse { } var msg string - reviewResponse := v1beta1.AdmissionResponse{} + reviewResponse := admissionv1.AdmissionResponse{} reviewResponse.Allowed = true switch ar.Request.Operation { - case v1beta1.Create: + case admissionv1.Create: msg = validatePod(pod, &reviewResponse) default: err := fmt.Errorf("expect operation to be 'CREATE'") @@ -102,7 +101,7 @@ allow pods to create when 3. normal pods whose schedulerName is volcano don't have podgroup. 4. check pod budget annotations configure */ -func validatePod(pod *v1.Pod, reviewResponse *v1beta1.AdmissionResponse) string { +func validatePod(pod *v1.Pod, reviewResponse *admissionv1.AdmissionResponse) string { if pod.Spec.SchedulerName != config.SchedulerName { return "" } diff --git a/pkg/webhooks/admission/pods/admit_pod_test.go b/pkg/webhooks/admission/pods/admit_pod_test.go index 9cd08f0596..9f85e54f55 100644 --- a/pkg/webhooks/admission/pods/admit_pod_test.go +++ b/pkg/webhooks/admission/pods/admit_pod_test.go @@ -21,7 +21,7 @@ import ( "strings" "testing" - "k8s.io/api/admission/v1beta1" + admissionv1 "k8s.io/api/admission/v1" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -39,7 +39,7 @@ func TestValidatePod(t *testing.T) { Name string Pod v1.Pod ExpectErr bool - reviewResponse v1beta1.AdmissionResponse + reviewResponse admissionv1.AdmissionResponse ret string disabledPG bool }{ @@ -60,7 +60,7 @@ func TestValidatePod(t *testing.T) { }, }, - reviewResponse: v1beta1.AdmissionResponse{Allowed: true}, + reviewResponse: admissionv1.AdmissionResponse{Allowed: true}, ret: "", ExpectErr: false, }, @@ -84,7 +84,7 @@ func TestValidatePod(t *testing.T) { }, }, - reviewResponse: v1beta1.AdmissionResponse{Allowed: false}, + reviewResponse: admissionv1.AdmissionResponse{Allowed: false}, ret: "failed to create pod as the podgroup phase is Pending", ExpectErr: true, }, @@ -106,7 +106,7 @@ func TestValidatePod(t *testing.T) { }, }, - reviewResponse: v1beta1.AdmissionResponse{Allowed: false}, + reviewResponse: admissionv1.AdmissionResponse{Allowed: false}, ret: "failed to create pod as the podgroup phase is Pending", ExpectErr: true, }, @@ -128,7 +128,7 @@ func TestValidatePod(t *testing.T) { }, }, - reviewResponse: v1beta1.AdmissionResponse{Allowed: false}, + reviewResponse: admissionv1.AdmissionResponse{Allowed: false}, ret: `failed to get PodGroup for pod : podgroups.scheduling.volcano.sh "podgroup-p1" not found`, ExpectErr: true, disabledPG: true, diff --git a/pkg/webhooks/admission/queues/mutate/mutate_queue.go b/pkg/webhooks/admission/queues/mutate/mutate_queue.go index 56b46de246..b39546b0b5 100644 --- a/pkg/webhooks/admission/queues/mutate/mutate_queue.go +++ b/pkg/webhooks/admission/queues/mutate/mutate_queue.go @@ -21,8 +21,8 @@ import ( "fmt" "strings" - "k8s.io/api/admission/v1beta1" - whv1beta1 "k8s.io/api/admissionregistration/v1beta1" + admissionv1 "k8s.io/api/admission/v1" + whv1 "k8s.io/api/admissionregistration/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/klog" @@ -40,13 +40,13 @@ var service = &router.AdmissionService{ Path: "/queues/mutate", Func: Queues, - MutatingConfig: &whv1beta1.MutatingWebhookConfiguration{ - Webhooks: []whv1beta1.MutatingWebhook{{ + MutatingConfig: &whv1.MutatingWebhookConfiguration{ + Webhooks: []whv1.MutatingWebhook{{ Name: "mutatequeue.volcano.sh", - Rules: []whv1beta1.RuleWithOperations{ + Rules: []whv1.RuleWithOperations{ { - Operations: []whv1beta1.OperationType{whv1beta1.Create}, - Rule: whv1beta1.Rule{ + Operations: []whv1.OperationType{whv1.Create}, + Rule: whv1.Rule{ APIGroups: []string{schedulingv1beta1.SchemeGroupVersion.Group}, APIVersions: []string{schedulingv1beta1.SchemeGroupVersion.Version}, Resources: []string{"queues"}, @@ -64,7 +64,7 @@ type patchOperation struct { } // Queues mutate queues. -func Queues(ar v1beta1.AdmissionReview) *v1beta1.AdmissionResponse { +func Queues(ar admissionv1.AdmissionReview) *admissionv1.AdmissionResponse { klog.V(3).Infof("Mutating %s queue %s.", ar.Request.Operation, ar.Request.Name) queue, err := schema.DecodeQueue(ar.Request.Object, ar.Request.Resource) @@ -74,7 +74,7 @@ func Queues(ar v1beta1.AdmissionReview) *v1beta1.AdmissionResponse { var patchBytes []byte switch ar.Request.Operation { - case v1beta1.Create: + case admissionv1.Create: patchBytes, err = createQueuePatch(queue) default: return util.ToAdmissionResponse(fmt.Errorf("invalid operation `%s`, "+ @@ -82,14 +82,14 @@ func Queues(ar v1beta1.AdmissionReview) *v1beta1.AdmissionResponse { } if err != nil { - return &v1beta1.AdmissionResponse{ + return &admissionv1.AdmissionResponse{ Allowed: false, Result: &metav1.Status{Message: err.Error()}, } } - pt := v1beta1.PatchTypeJSONPatch - return &v1beta1.AdmissionResponse{ + pt := admissionv1.PatchTypeJSONPatch + return &admissionv1.AdmissionResponse{ Allowed: true, Patch: patchBytes, PatchType: &pt, diff --git a/pkg/webhooks/admission/queues/mutate/mutate_queue_test.go b/pkg/webhooks/admission/queues/mutate/mutate_queue_test.go index 7724a14270..95117fa319 100644 --- a/pkg/webhooks/admission/queues/mutate/mutate_queue_test.go +++ b/pkg/webhooks/admission/queues/mutate/mutate_queue_test.go @@ -23,7 +23,7 @@ import ( "strings" "testing" - "k8s.io/api/admission/v1beta1" + admissionv1 "k8s.io/api/admission/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" @@ -65,7 +65,7 @@ func TestMutateQueues(t *testing.T) { t.Errorf("Marshal queue with open state failed for %v.", err) } - pt := v1beta1.PatchTypeJSONPatch + pt := admissionv1.PatchTypeJSONPatch var refreshPatch []patchOperation refreshPatch = append(refreshPatch, patchOperation{ @@ -118,17 +118,17 @@ func TestMutateQueues(t *testing.T) { testCases := []struct { Name string - AR v1beta1.AdmissionReview - reviewResponse *v1beta1.AdmissionResponse + AR admissionv1.AdmissionReview + reviewResponse *admissionv1.AdmissionResponse }{ { Name: "Normal Case Refresh Default Open State and Reclaimable For Queue", - AR: v1beta1.AdmissionReview{ + AR: admissionv1.AdmissionReview{ TypeMeta: metav1.TypeMeta{ Kind: "AdmissionReview", - APIVersion: "admission.k8s.io/v1beta1", + APIVersion: "admission.k8s.io/v1", }, - Request: &v1beta1.AdmissionRequest{ + Request: &admissionv1.AdmissionRequest{ Kind: metav1.GroupVersionKind{ Group: "scheduling.volcano.sh", Version: "v1beta1", @@ -146,7 +146,7 @@ func TestMutateQueues(t *testing.T) { }, }, }, - reviewResponse: &v1beta1.AdmissionResponse{ + reviewResponse: &admissionv1.AdmissionResponse{ Allowed: true, PatchType: &pt, Patch: refreshPatchJSON, @@ -154,12 +154,12 @@ func TestMutateQueues(t *testing.T) { }, { Name: "Invalid Action", - AR: v1beta1.AdmissionReview{ + AR: admissionv1.AdmissionReview{ TypeMeta: metav1.TypeMeta{ Kind: "AdmissionReview", - APIVersion: "admission.k8s.io/v1beta1", + APIVersion: "admission.k8s.io/v1", }, - Request: &v1beta1.AdmissionRequest{ + Request: &admissionv1.AdmissionRequest{ Kind: metav1.GroupVersionKind{ Group: "scheduling.volcano.sh", Version: "v1beta1", @@ -182,12 +182,12 @@ func TestMutateQueues(t *testing.T) { }, { Name: "Normal Case Append Default Root to The HDRF Attributes", - AR: v1beta1.AdmissionReview{ + AR: admissionv1.AdmissionReview{ TypeMeta: metav1.TypeMeta{ Kind: "AdmissionReview", - APIVersion: "admission.k8s.io/v1beta1", + APIVersion: "admission.k8s.io/v1", }, - Request: &v1beta1.AdmissionRequest{ + Request: &admissionv1.AdmissionRequest{ Kind: metav1.GroupVersionKind{ Group: "scheduling.volcano.sh", Version: "v1beta1", @@ -205,7 +205,7 @@ func TestMutateQueues(t *testing.T) { }, }, }, - reviewResponse: &v1beta1.AdmissionResponse{ + reviewResponse: &admissionv1.AdmissionResponse{ Allowed: true, PatchType: &pt, Patch: appendRootPatchJSON, diff --git a/pkg/webhooks/admission/queues/validate/validate_queue.go b/pkg/webhooks/admission/queues/validate/validate_queue.go index 41b5ac22e8..4554f71f9c 100644 --- a/pkg/webhooks/admission/queues/validate/validate_queue.go +++ b/pkg/webhooks/admission/queues/validate/validate_queue.go @@ -19,11 +19,11 @@ package validate import ( "context" "fmt" + admissionv1 "k8s.io/api/admission/v1" "strconv" "strings" - "k8s.io/api/admission/v1beta1" - whv1beta1 "k8s.io/api/admissionregistration/v1beta1" + whv1 "k8s.io/api/admissionregistration/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/validation/field" "k8s.io/klog" @@ -44,13 +44,13 @@ var service = &router.AdmissionService{ Config: config, - ValidatingConfig: &whv1beta1.ValidatingWebhookConfiguration{ - Webhooks: []whv1beta1.ValidatingWebhook{{ + ValidatingConfig: &whv1.ValidatingWebhookConfiguration{ + Webhooks: []whv1.ValidatingWebhook{{ Name: "validatequeue.volcano.sh", - Rules: []whv1beta1.RuleWithOperations{ + Rules: []whv1.RuleWithOperations{ { - Operations: []whv1beta1.OperationType{whv1beta1.Create, whv1beta1.Update, whv1beta1.Delete}, - Rule: whv1beta1.Rule{ + Operations: []whv1.OperationType{whv1.Create, whv1.Update, whv1.Delete}, + Rule: whv1.Rule{ APIGroups: []string{schedulingv1beta1.SchemeGroupVersion.Group}, APIVersions: []string{schedulingv1beta1.SchemeGroupVersion.Version}, Resources: []string{"queues"}, @@ -64,7 +64,7 @@ var service = &router.AdmissionService{ var config = &router.AdmissionServiceConfig{} // AdmitQueues is to admit queues and return response. -func AdmitQueues(ar v1beta1.AdmissionReview) *v1beta1.AdmissionResponse { +func AdmitQueues(ar admissionv1.AdmissionReview) *admissionv1.AdmissionResponse { klog.V(3).Infof("Admitting %s queue %s.", ar.Request.Operation, ar.Request.Name) queue, err := schema.DecodeQueue(ar.Request.Object, ar.Request.Resource) @@ -73,9 +73,9 @@ func AdmitQueues(ar v1beta1.AdmissionReview) *v1beta1.AdmissionResponse { } switch ar.Request.Operation { - case v1beta1.Create, v1beta1.Update: + case admissionv1.Create, admissionv1.Update: err = validateQueue(queue) - case v1beta1.Delete: + case admissionv1.Delete: err = validateQueueDeleting(ar.Request.Name) default: return util.ToAdmissionResponse(fmt.Errorf("invalid operation `%s`, "+ @@ -83,13 +83,13 @@ func AdmitQueues(ar v1beta1.AdmissionReview) *v1beta1.AdmissionResponse { } if err != nil { - return &v1beta1.AdmissionResponse{ + return &admissionv1.AdmissionResponse{ Allowed: false, Result: &metav1.Status{Message: err.Error()}, } } - return &v1beta1.AdmissionResponse{ + return &admissionv1.AdmissionResponse{ Allowed: true, } } diff --git a/pkg/webhooks/admission/queues/validate/validate_queue_test.go b/pkg/webhooks/admission/queues/validate/validate_queue_test.go index 95c43f2332..7a4d0f3ff2 100644 --- a/pkg/webhooks/admission/queues/validate/validate_queue_test.go +++ b/pkg/webhooks/admission/queues/validate/validate_queue_test.go @@ -23,7 +23,7 @@ import ( "reflect" "testing" - "k8s.io/api/admission/v1beta1" + admissionv1 "k8s.io/api/admission/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" @@ -306,17 +306,17 @@ func TestAdmitQueues(t *testing.T) { testCases := []struct { Name string - AR v1beta1.AdmissionReview - reviewResponse *v1beta1.AdmissionResponse + AR admissionv1.AdmissionReview + reviewResponse *admissionv1.AdmissionResponse }{ { Name: "Normal Case State Not Set During Creating", - AR: v1beta1.AdmissionReview{ + AR: admissionv1.AdmissionReview{ TypeMeta: metav1.TypeMeta{ Kind: "AdmissionReview", APIVersion: "admission.k8s.io/v1beta1", }, - Request: &v1beta1.AdmissionRequest{ + Request: &admissionv1.AdmissionRequest{ Kind: metav1.GroupVersionKind{ Group: "scheduling.volcano.sh", Version: "v1beta1", @@ -334,18 +334,18 @@ func TestAdmitQueues(t *testing.T) { }, }, }, - reviewResponse: &v1beta1.AdmissionResponse{ + reviewResponse: &admissionv1.AdmissionResponse{ Allowed: true, }, }, { Name: "Normal Case Set State of Open During Creating", - AR: v1beta1.AdmissionReview{ + AR: admissionv1.AdmissionReview{ TypeMeta: metav1.TypeMeta{ Kind: "AdmissionReview", APIVersion: "admission.k8s.io/v1beta1", }, - Request: &v1beta1.AdmissionRequest{ + Request: &admissionv1.AdmissionRequest{ Kind: metav1.GroupVersionKind{ Group: "scheduling.volcano.sh", Version: "v1beta1", @@ -363,18 +363,18 @@ func TestAdmitQueues(t *testing.T) { }, }, }, - reviewResponse: &v1beta1.AdmissionResponse{ + reviewResponse: &admissionv1.AdmissionResponse{ Allowed: true, }, }, { Name: "Normal Case Set State of Closed During Creating", - AR: v1beta1.AdmissionReview{ + AR: admissionv1.AdmissionReview{ TypeMeta: metav1.TypeMeta{ Kind: "AdmissionReview", APIVersion: "admission.k8s.io/v1beta1", }, - Request: &v1beta1.AdmissionRequest{ + Request: &admissionv1.AdmissionRequest{ Kind: metav1.GroupVersionKind{ Group: "scheduling.volcano.sh", Version: "v1beta1", @@ -392,18 +392,18 @@ func TestAdmitQueues(t *testing.T) { }, }, }, - reviewResponse: &v1beta1.AdmissionResponse{ + reviewResponse: &admissionv1.AdmissionResponse{ Allowed: true, }, }, { Name: "Abnormal Case Wrong State Configured During Creating", - AR: v1beta1.AdmissionReview{ + AR: admissionv1.AdmissionReview{ TypeMeta: metav1.TypeMeta{ Kind: "AdmissionReview", APIVersion: "admission.k8s.io/v1beta1", }, - Request: &v1beta1.AdmissionRequest{ + Request: &admissionv1.AdmissionRequest{ Kind: metav1.GroupVersionKind{ Group: "scheduling.volcano.sh", Version: "v1beta1", @@ -421,7 +421,7 @@ func TestAdmitQueues(t *testing.T) { }, }, }, - reviewResponse: &v1beta1.AdmissionResponse{ + reviewResponse: &admissionv1.AdmissionResponse{ Allowed: false, Result: &metav1.Status{ Message: field.Invalid(field.NewPath("requestBody").Child("spec").Child("state"), @@ -434,12 +434,12 @@ func TestAdmitQueues(t *testing.T) { }, { Name: "Normal Case Changing State From Open to Closed During Updating", - AR: v1beta1.AdmissionReview{ + AR: admissionv1.AdmissionReview{ TypeMeta: metav1.TypeMeta{ Kind: "AdmissionReview", APIVersion: "admission.k8s.io/v1beta1", }, - Request: &v1beta1.AdmissionRequest{ + Request: &admissionv1.AdmissionRequest{ Kind: metav1.GroupVersionKind{ Group: "scheduling.volcano.sh", Version: "v1beta1", @@ -460,18 +460,18 @@ func TestAdmitQueues(t *testing.T) { }, }, }, - reviewResponse: &v1beta1.AdmissionResponse{ + reviewResponse: &admissionv1.AdmissionResponse{ Allowed: true, }, }, { Name: "Normal Case Changing State From Closed to Open During Updating", - AR: v1beta1.AdmissionReview{ + AR: admissionv1.AdmissionReview{ TypeMeta: metav1.TypeMeta{ Kind: "AdmissionReview", APIVersion: "admission.k8s.io/v1beta1", }, - Request: &v1beta1.AdmissionRequest{ + Request: &admissionv1.AdmissionRequest{ Kind: metav1.GroupVersionKind{ Group: "scheduling.volcano.sh", Version: "v1beta1", @@ -492,18 +492,18 @@ func TestAdmitQueues(t *testing.T) { }, }, }, - reviewResponse: &v1beta1.AdmissionResponse{ + reviewResponse: &admissionv1.AdmissionResponse{ Allowed: true, }, }, { Name: "Abnormal Case Changing State From Open to Wrong State During Updating", - AR: v1beta1.AdmissionReview{ + AR: admissionv1.AdmissionReview{ TypeMeta: metav1.TypeMeta{ Kind: "AdmissionReview", APIVersion: "admission.k8s.io/v1beta1", }, - Request: &v1beta1.AdmissionRequest{ + Request: &admissionv1.AdmissionRequest{ Kind: metav1.GroupVersionKind{ Group: "scheduling.volcano.sh", Version: "v1beta1", @@ -524,7 +524,7 @@ func TestAdmitQueues(t *testing.T) { }, }, }, - reviewResponse: &v1beta1.AdmissionResponse{ + reviewResponse: &admissionv1.AdmissionResponse{ Allowed: false, Result: &metav1.Status{ Message: field.Invalid(field.NewPath("requestBody").Child("spec").Child("state"), @@ -537,12 +537,12 @@ func TestAdmitQueues(t *testing.T) { }, { Name: "Normal Case Queue With Closed State Can Be Deleted", - AR: v1beta1.AdmissionReview{ + AR: admissionv1.AdmissionReview{ TypeMeta: metav1.TypeMeta{ Kind: "AdmissionReview", APIVersion: "admission.k8s.io/v1beta1", }, - Request: &v1beta1.AdmissionRequest{ + Request: &admissionv1.AdmissionRequest{ Kind: metav1.GroupVersionKind{ Group: "scheduling.volcano.sh", Version: "v1beta1", @@ -560,18 +560,18 @@ func TestAdmitQueues(t *testing.T) { }, }, }, - reviewResponse: &v1beta1.AdmissionResponse{ + reviewResponse: &admissionv1.AdmissionResponse{ Allowed: true, }, }, { Name: "Abnormal Case Queue With Open State Can Not Be Deleted", - AR: v1beta1.AdmissionReview{ + AR: admissionv1.AdmissionReview{ TypeMeta: metav1.TypeMeta{ Kind: "AdmissionReview", APIVersion: "admission.k8s.io/v1beta1", }, - Request: &v1beta1.AdmissionRequest{ + Request: &admissionv1.AdmissionRequest{ Kind: metav1.GroupVersionKind{ Group: "scheduling.volcano.sh", Version: "v1beta1", @@ -589,7 +589,7 @@ func TestAdmitQueues(t *testing.T) { }, }, }, - reviewResponse: &v1beta1.AdmissionResponse{ + reviewResponse: &admissionv1.AdmissionResponse{ Allowed: false, Result: &metav1.Status{ Message: fmt.Sprintf("only queue with state `%s` can be deleted, queue `%s` state is `%s`", @@ -599,12 +599,12 @@ func TestAdmitQueues(t *testing.T) { }, { Name: "Abnormal Case default Queue Can Not Be Deleted", - AR: v1beta1.AdmissionReview{ + AR: admissionv1.AdmissionReview{ TypeMeta: metav1.TypeMeta{ Kind: "AdmissionReview", APIVersion: "admission.k8s.io/v1beta1", }, - Request: &v1beta1.AdmissionRequest{ + Request: &admissionv1.AdmissionRequest{ Kind: metav1.GroupVersionKind{ Group: "scheduling.volcano.sh", Version: "v1beta1", @@ -622,7 +622,7 @@ func TestAdmitQueues(t *testing.T) { }, }, }, - reviewResponse: &v1beta1.AdmissionResponse{ + reviewResponse: &admissionv1.AdmissionResponse{ Allowed: false, Result: &metav1.Status{ Message: fmt.Sprintf("`%s` queue can not be deleted", "default"), @@ -631,12 +631,12 @@ func TestAdmitQueues(t *testing.T) { }, { Name: "Invalid Action", - AR: v1beta1.AdmissionReview{ + AR: admissionv1.AdmissionReview{ TypeMeta: metav1.TypeMeta{ Kind: "AdmissionReview", APIVersion: "admission.k8s.io/v1beta1", }, - Request: &v1beta1.AdmissionRequest{ + Request: &admissionv1.AdmissionRequest{ Kind: metav1.GroupVersionKind{ Group: "scheduling.volcano.sh", Version: "v1beta1", @@ -659,12 +659,12 @@ func TestAdmitQueues(t *testing.T) { }, { Name: "Create queue without weight", - AR: v1beta1.AdmissionReview{ + AR: admissionv1.AdmissionReview{ TypeMeta: metav1.TypeMeta{ Kind: "AdmissionReview", APIVersion: "admission.k8s.io/v1beta1", }, - Request: &v1beta1.AdmissionRequest{ + Request: &admissionv1.AdmissionRequest{ Kind: metav1.GroupVersionKind{ Group: "scheduling.volcano.sh", Version: "v1beta1", @@ -682,7 +682,7 @@ func TestAdmitQueues(t *testing.T) { }, }, }, - reviewResponse: &v1beta1.AdmissionResponse{ + reviewResponse: &admissionv1.AdmissionResponse{ Allowed: false, Result: &metav1.Status{ Message: field.Invalid(field.NewPath("requestBody").Child("spec").Child("weight"), @@ -692,12 +692,12 @@ func TestAdmitQueues(t *testing.T) { }, { Name: "Create queue with negative weight", - AR: v1beta1.AdmissionReview{ + AR: admissionv1.AdmissionReview{ TypeMeta: metav1.TypeMeta{ Kind: "AdmissionReview", APIVersion: "admission.k8s.io/v1beta1", }, - Request: &v1beta1.AdmissionRequest{ + Request: &admissionv1.AdmissionRequest{ Kind: metav1.GroupVersionKind{ Group: "scheduling.volcano.sh", Version: "v1beta1", @@ -715,7 +715,7 @@ func TestAdmitQueues(t *testing.T) { }, }, }, - reviewResponse: &v1beta1.AdmissionResponse{ + reviewResponse: &admissionv1.AdmissionResponse{ Allowed: false, Result: &metav1.Status{ Message: field.Invalid(field.NewPath("requestBody").Child("spec").Child("weight"), @@ -725,12 +725,12 @@ func TestAdmitQueues(t *testing.T) { }, { Name: "Update queue with negative weight", - AR: v1beta1.AdmissionReview{ + AR: admissionv1.AdmissionReview{ TypeMeta: metav1.TypeMeta{ Kind: "AdmissionReview", APIVersion: "admission.k8s.io/v1beta1", }, - Request: &v1beta1.AdmissionRequest{ + Request: &admissionv1.AdmissionRequest{ Kind: metav1.GroupVersionKind{ Group: "scheduling.volcano.sh", Version: "v1beta1", @@ -751,7 +751,7 @@ func TestAdmitQueues(t *testing.T) { }, }, }, - reviewResponse: &v1beta1.AdmissionResponse{ + reviewResponse: &admissionv1.AdmissionResponse{ Allowed: false, Result: &metav1.Status{ Message: field.Invalid(field.NewPath("requestBody").Child("spec").Child("weight"), @@ -762,12 +762,12 @@ func TestAdmitQueues(t *testing.T) { { Name: "Abnormal Case Hierarchy And Weights Do Not Match", - AR: v1beta1.AdmissionReview{ + AR: admissionv1.AdmissionReview{ TypeMeta: metav1.TypeMeta{ Kind: "AdmissionReview", APIVersion: "admission.k8s.io/v1beta1", }, - Request: &v1beta1.AdmissionRequest{ + Request: &admissionv1.AdmissionRequest{ Kind: metav1.GroupVersionKind{ Group: "scheduling.volcano.sh", Version: "v1beta1", @@ -785,7 +785,7 @@ func TestAdmitQueues(t *testing.T) { }, }, }, - reviewResponse: &v1beta1.AdmissionResponse{ + reviewResponse: &admissionv1.AdmissionResponse{ Allowed: false, Result: &metav1.Status{ Message: field.Invalid(field.NewPath("requestBody").Child("metadata").Child("annotations"), @@ -798,12 +798,12 @@ func TestAdmitQueues(t *testing.T) { }, { Name: "Abnormal Case Weights Is Negative", - AR: v1beta1.AdmissionReview{ + AR: admissionv1.AdmissionReview{ TypeMeta: metav1.TypeMeta{ Kind: "AdmissionReview", APIVersion: "admission.k8s.io/v1beta1", }, - Request: &v1beta1.AdmissionRequest{ + Request: &admissionv1.AdmissionRequest{ Kind: metav1.GroupVersionKind{ Group: "scheduling.volcano.sh", Version: "v1beta1", @@ -821,7 +821,7 @@ func TestAdmitQueues(t *testing.T) { }, }, }, - reviewResponse: &v1beta1.AdmissionResponse{ + reviewResponse: &admissionv1.AdmissionResponse{ Allowed: false, Result: &metav1.Status{ Message: field.Invalid(field.NewPath("requestBody").Child("metadata").Child("annotations"), @@ -834,12 +834,12 @@ func TestAdmitQueues(t *testing.T) { }, { Name: "Abnormal Case Weights Is Format Illegal", - AR: v1beta1.AdmissionReview{ + AR: admissionv1.AdmissionReview{ TypeMeta: metav1.TypeMeta{ Kind: "AdmissionReview", APIVersion: "admission.k8s.io/v1beta1", }, - Request: &v1beta1.AdmissionRequest{ + Request: &admissionv1.AdmissionRequest{ Kind: metav1.GroupVersionKind{ Group: "scheduling.volcano.sh", Version: "v1beta1", @@ -857,7 +857,7 @@ func TestAdmitQueues(t *testing.T) { }, }, }, - reviewResponse: &v1beta1.AdmissionResponse{ + reviewResponse: &admissionv1.AdmissionResponse{ Allowed: false, Result: &metav1.Status{ Message: field.Invalid(field.NewPath("requestBody").Child("metadata").Child("annotations"), @@ -870,12 +870,12 @@ func TestAdmitQueues(t *testing.T) { }, { Name: "Abnormal Case Hierarchy Is In Sub Path of Another Queue", - AR: v1beta1.AdmissionReview{ + AR: admissionv1.AdmissionReview{ TypeMeta: metav1.TypeMeta{ Kind: "AdmissionReview", APIVersion: "admission.k8s.io/v1beta1", }, - Request: &v1beta1.AdmissionRequest{ + Request: &admissionv1.AdmissionRequest{ Kind: metav1.GroupVersionKind{ Group: "scheduling.volcano.sh", Version: "v1beta1", @@ -893,7 +893,7 @@ func TestAdmitQueues(t *testing.T) { }, }, }, - reviewResponse: &v1beta1.AdmissionResponse{ + reviewResponse: &admissionv1.AdmissionResponse{ Allowed: false, Result: &metav1.Status{ Message: field.Invalid(field.NewPath("requestBody").Child("metadata").Child("annotations"), diff --git a/pkg/webhooks/router/interface.go b/pkg/webhooks/router/interface.go index 503567aa26..65d5d5dd3b 100644 --- a/pkg/webhooks/router/interface.go +++ b/pkg/webhooks/router/interface.go @@ -17,15 +17,15 @@ limitations under the License. package router import ( - "k8s.io/api/admission/v1beta1" - whv1beta1 "k8s.io/api/admissionregistration/v1beta1" + admissionv1 "k8s.io/api/admission/v1" + whv1 "k8s.io/api/admissionregistration/v1" "k8s.io/client-go/kubernetes" "k8s.io/client-go/tools/record" "volcano.sh/apis/pkg/client/clientset/versioned" ) //The AdmitFunc returns response. -type AdmitFunc func(v1beta1.AdmissionReview) *v1beta1.AdmissionResponse +type AdmitFunc func(admissionv1.AdmissionReview) *admissionv1.AdmissionResponse type AdmissionServiceConfig struct { SchedulerName string @@ -39,8 +39,8 @@ type AdmissionService struct { Func AdmitFunc Handler AdmissionHandler - ValidatingConfig *whv1beta1.ValidatingWebhookConfiguration - MutatingConfig *whv1beta1.MutatingWebhookConfiguration + ValidatingConfig *whv1.ValidatingWebhookConfiguration + MutatingConfig *whv1.MutatingWebhookConfiguration Config *AdmissionServiceConfig } diff --git a/pkg/webhooks/router/server.go b/pkg/webhooks/router/server.go index 8988d74daa..ab73d35089 100644 --- a/pkg/webhooks/router/server.go +++ b/pkg/webhooks/router/server.go @@ -22,7 +22,7 @@ import ( "io/ioutil" "net/http" - "k8s.io/api/admission/v1beta1" + admissionv1 "k8s.io/api/admission/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/klog" @@ -52,8 +52,8 @@ func Serve(w io.Writer, r *http.Request, admit AdmitFunc) { return } - var reviewResponse *v1beta1.AdmissionResponse - ar := v1beta1.AdmissionReview{} + var reviewResponse *admissionv1.AdmissionResponse + ar := admissionv1.AdmissionReview{} deserializer := schema.Codecs.UniversalDeserializer() if _, _, err := deserializer.Decode(body, nil, &ar); err != nil { reviewResponse = util.ToAdmissionResponse(err) @@ -72,9 +72,11 @@ func Serve(w io.Writer, r *http.Request, admit AdmitFunc) { } } -func createResponse(reviewResponse *v1beta1.AdmissionResponse, ar *v1beta1.AdmissionReview) v1beta1.AdmissionReview { - response := v1beta1.AdmissionReview{} +func createResponse(reviewResponse *admissionv1.AdmissionResponse, ar *admissionv1.AdmissionReview) admissionv1.AdmissionReview { + response := admissionv1.AdmissionReview{} if reviewResponse != nil { + response.APIVersion = "admission.k8s.io/v1" + response.Kind = "AdmissionReview" response.Response = reviewResponse response.Response.UID = ar.Request.UID } diff --git a/pkg/webhooks/schema/schema.go b/pkg/webhooks/schema/schema.go index e4492fe6b0..1a369a5930 100644 --- a/pkg/webhooks/schema/schema.go +++ b/pkg/webhooks/schema/schema.go @@ -19,7 +19,7 @@ package schema import ( "fmt" - "k8s.io/api/admission/v1beta1" + admissionv1 "k8s.io/api/admission/v1" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" @@ -43,7 +43,7 @@ var Codecs = serializer.NewCodecFactory(scheme) func addToScheme(scheme *runtime.Scheme) { corev1.AddToScheme(scheme) - v1beta1.AddToScheme(scheme) + admissionv1.AddToScheme(scheme) } //DecodeJob decodes the job using deserializer from the raw object. diff --git a/pkg/webhooks/util/util.go b/pkg/webhooks/util/util.go index cbed20edb2..224381fcff 100644 --- a/pkg/webhooks/util/util.go +++ b/pkg/webhooks/util/util.go @@ -17,15 +17,15 @@ limitations under the License. package util import ( - "k8s.io/api/admission/v1beta1" + admissionv1 "k8s.io/api/admission/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/klog" ) //ToAdmissionResponse updates the admission response with the input error. -func ToAdmissionResponse(err error) *v1beta1.AdmissionResponse { +func ToAdmissionResponse(err error) *admissionv1.AdmissionResponse { klog.Error(err) - return &v1beta1.AdmissionResponse{ + return &admissionv1.AdmissionResponse{ Allowed: false, Result: &metav1.Status{ Message: err.Error(), diff --git a/vendor/k8s.io/api/admission/v1beta1/doc.go b/vendor/k8s.io/api/admission/v1/doc.go similarity index 82% rename from vendor/k8s.io/api/admission/v1beta1/doc.go rename to vendor/k8s.io/api/admission/v1/doc.go index a5669022a0..cbc6bb59dd 100644 --- a/vendor/k8s.io/api/admission/v1beta1/doc.go +++ b/vendor/k8s.io/api/admission/v1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +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. @@ -17,8 +17,7 @@ limitations under the License. // +k8s:deepcopy-gen=package // +k8s:protobuf-gen=package // +k8s:openapi-gen=false -// +k8s:prerelease-lifecycle-gen=true // +groupName=admission.k8s.io -package v1beta1 // import "k8s.io/api/admission/v1beta1" +package v1 // import "k8s.io/api/admission/v1" diff --git a/vendor/k8s.io/api/admission/v1beta1/generated.pb.go b/vendor/k8s.io/api/admission/v1/generated.pb.go similarity index 87% rename from vendor/k8s.io/api/admission/v1beta1/generated.pb.go rename to vendor/k8s.io/api/admission/v1/generated.pb.go index c0de5a93b9..f2db634b86 100644 --- a/vendor/k8s.io/api/admission/v1beta1/generated.pb.go +++ b/vendor/k8s.io/api/admission/v1/generated.pb.go @@ -15,9 +15,9 @@ limitations under the License. */ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: k8s.io/kubernetes/vendor/k8s.io/api/admission/v1beta1/generated.proto +// source: k8s.io/kubernetes/vendor/k8s.io/api/admission/v1/generated.proto -package v1beta1 +package v1 import ( fmt "fmt" @@ -50,7 +50,7 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package func (m *AdmissionRequest) Reset() { *m = AdmissionRequest{} } func (*AdmissionRequest) ProtoMessage() {} func (*AdmissionRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_b87c2352de86eab9, []int{0} + return fileDescriptor_4b73421fd5edef9f, []int{0} } func (m *AdmissionRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -78,7 +78,7 @@ var xxx_messageInfo_AdmissionRequest proto.InternalMessageInfo func (m *AdmissionResponse) Reset() { *m = AdmissionResponse{} } func (*AdmissionResponse) ProtoMessage() {} func (*AdmissionResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b87c2352de86eab9, []int{1} + return fileDescriptor_4b73421fd5edef9f, []int{1} } func (m *AdmissionResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -106,7 +106,7 @@ var xxx_messageInfo_AdmissionResponse proto.InternalMessageInfo func (m *AdmissionReview) Reset() { *m = AdmissionReview{} } func (*AdmissionReview) ProtoMessage() {} func (*AdmissionReview) Descriptor() ([]byte, []int) { - return fileDescriptor_b87c2352de86eab9, []int{2} + return fileDescriptor_4b73421fd5edef9f, []int{2} } func (m *AdmissionReview) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -132,76 +132,76 @@ func (m *AdmissionReview) XXX_DiscardUnknown() { var xxx_messageInfo_AdmissionReview proto.InternalMessageInfo func init() { - proto.RegisterType((*AdmissionRequest)(nil), "k8s.io.api.admission.v1beta1.AdmissionRequest") - proto.RegisterType((*AdmissionResponse)(nil), "k8s.io.api.admission.v1beta1.AdmissionResponse") - proto.RegisterMapType((map[string]string)(nil), "k8s.io.api.admission.v1beta1.AdmissionResponse.AuditAnnotationsEntry") - proto.RegisterType((*AdmissionReview)(nil), "k8s.io.api.admission.v1beta1.AdmissionReview") + proto.RegisterType((*AdmissionRequest)(nil), "k8s.io.api.admission.v1.AdmissionRequest") + proto.RegisterType((*AdmissionResponse)(nil), "k8s.io.api.admission.v1.AdmissionResponse") + proto.RegisterMapType((map[string]string)(nil), "k8s.io.api.admission.v1.AdmissionResponse.AuditAnnotationsEntry") + proto.RegisterType((*AdmissionReview)(nil), "k8s.io.api.admission.v1.AdmissionReview") } func init() { - proto.RegisterFile("k8s.io/kubernetes/vendor/k8s.io/api/admission/v1beta1/generated.proto", fileDescriptor_b87c2352de86eab9) + proto.RegisterFile("k8s.io/kubernetes/vendor/k8s.io/api/admission/v1/generated.proto", fileDescriptor_4b73421fd5edef9f) } -var fileDescriptor_b87c2352de86eab9 = []byte{ - // 925 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0xcb, 0x6e, 0x23, 0x45, - 0x17, 0x76, 0x8f, 0x1d, 0xdb, 0x5d, 0xce, 0x3f, 0xf6, 0xd4, 0xfc, 0x48, 0x2d, 0x0b, 0xb5, 0x4d, - 0x16, 0xc8, 0x48, 0x93, 0x6a, 0x12, 0xc1, 0x28, 0x1a, 0xb1, 0x49, 0x93, 0x08, 0x05, 0xa4, 0x49, - 0x54, 0x33, 0x86, 0x81, 0x05, 0x52, 0xd9, 0xae, 0xb1, 0x1b, 0xdb, 0x55, 0x4d, 0x57, 0xb5, 0x83, - 0x77, 0xec, 0xd9, 0xf0, 0x06, 0xbc, 0x00, 0x6f, 0xc1, 0x26, 0xcb, 0x59, 0xce, 0xca, 0x22, 0xe6, - 0x2d, 0xb2, 0x42, 0x55, 0x5d, 0x7d, 0x19, 0x27, 0x81, 0xb9, 0xb0, 0x72, 0x9f, 0xcb, 0xf7, 0x9d, - 0xe3, 0xef, 0xf4, 0x39, 0x0d, 0x8e, 0xa7, 0x07, 0x02, 0x05, 0xdc, 0x9b, 0xc6, 0x03, 0x1a, 0x31, - 0x2a, 0xa9, 0xf0, 0x16, 0x94, 0x8d, 0x78, 0xe4, 0x99, 0x00, 0x09, 0x03, 0x8f, 0x8c, 0xe6, 0x81, - 0x10, 0x01, 0x67, 0xde, 0x62, 0x6f, 0x40, 0x25, 0xd9, 0xf3, 0xc6, 0x94, 0xd1, 0x88, 0x48, 0x3a, - 0x42, 0x61, 0xc4, 0x25, 0x87, 0xef, 0x27, 0xd9, 0x88, 0x84, 0x01, 0xca, 0xb2, 0x91, 0xc9, 0x6e, - 0xef, 0x8e, 0x03, 0x39, 0x89, 0x07, 0x68, 0xc8, 0xe7, 0xde, 0x98, 0x8f, 0xb9, 0xa7, 0x41, 0x83, - 0xf8, 0xb9, 0xb6, 0xb4, 0xa1, 0x9f, 0x12, 0xb2, 0xf6, 0x83, 0x62, 0xe9, 0x58, 0x4e, 0x28, 0x93, - 0xc1, 0x90, 0xc8, 0xa4, 0xfe, 0x66, 0xe9, 0xf6, 0x27, 0x79, 0xf6, 0x9c, 0x0c, 0x27, 0x01, 0xa3, - 0xd1, 0xd2, 0x0b, 0xa7, 0x63, 0xe5, 0x10, 0xde, 0x9c, 0x4a, 0x72, 0x13, 0xca, 0xbb, 0x0d, 0x15, - 0xc5, 0x4c, 0x06, 0x73, 0x7a, 0x0d, 0xf0, 0xf0, 0xdf, 0x00, 0x62, 0x38, 0xa1, 0x73, 0xb2, 0x89, - 0xdb, 0xf9, 0xcd, 0x06, 0xad, 0xc3, 0x54, 0x11, 0x4c, 0x7f, 0x8c, 0xa9, 0x90, 0xd0, 0x07, 0xe5, - 0x38, 0x18, 0x39, 0x56, 0xd7, 0xea, 0xd9, 0xfe, 0xc7, 0x17, 0xab, 0x4e, 0x69, 0xbd, 0xea, 0x94, - 0xfb, 0x27, 0x47, 0x57, 0xab, 0xce, 0x07, 0xb7, 0x15, 0x92, 0xcb, 0x90, 0x0a, 0xd4, 0x3f, 0x39, - 0xc2, 0x0a, 0x0c, 0x9f, 0x81, 0xca, 0x34, 0x60, 0x23, 0xe7, 0x4e, 0xd7, 0xea, 0x35, 0xf6, 0x1f,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0x8b, 0x98, 0x72, 0xc1, 0x6f, 0xf5, 0x87, 0x48, 0xeb, 0x64, 0x3e, 0x73, 0xde, - 0x1b, 0xca, 0x9b, 0x48, 0x91, 0x5a, 0x38, 0xa3, 0xf3, 0x77, 0x2f, 0x2e, 0xdd, 0xd2, 0x8b, 0x4b, - 0xb7, 0xf4, 0xf2, 0xd2, 0x2d, 0xfd, 0xbc, 0x76, 0xad, 0x8b, 0xb5, 0x6b, 0xbd, 0x58, 0xbb, 0xd6, - 0xcb, 0xb5, 0x6b, 0xfd, 0xb9, 0x76, 0xad, 0x5f, 0xff, 0x72, 0x4b, 0xdf, 0xd5, 0x0c, 0xf1, 0xdf, - 0x01, 0x00, 0x00, 0xff, 0xff, 0x6c, 0x23, 0xa1, 0xd9, 0x27, 0x09, 0x00, 0x00, +var fileDescriptor_4b73421fd5edef9f = []byte{ + // 919 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0x4f, 0x6f, 0x1b, 0x45, + 0x14, 0xf7, 0xd6, 0x8e, 0xed, 0x1d, 0x87, 0xda, 0x9d, 0x82, 0x58, 0xf9, 0xb0, 0x36, 0x39, 0x20, + 0x17, 0xb5, 0xbb, 0x24, 0x82, 0x2a, 0xaa, 0x38, 0x34, 0x4b, 0x2a, 0x14, 0x90, 0x9a, 0x68, 0xda, + 0x40, 0xc5, 0x01, 0x69, 0xec, 0x9d, 0xda, 0x83, 0xed, 0x99, 0x65, 0x67, 0xd6, 0xc1, 0x37, 0x4e, + 0x9c, 0xf9, 0x06, 0x1c, 0xf9, 0x0c, 0x7c, 0x83, 0x1c, 0x7b, 0xec, 0xc9, 0x22, 0xe6, 0x5b, 0xe4, + 0x84, 0x66, 0x76, 0xf6, 0x4f, 0xf3, 0x47, 0x84, 0x96, 0x93, 0xf7, 0xfd, 0xf9, 0xfd, 0xde, 0xf3, + 0xef, 0xed, 0x7b, 0x0b, 0x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0x91, 0x02, 0xc3, 0x17, 0xa0, 0x36, + 0xa5, 0x2c, 0x74, 0x6e, 0xf5, 0xad, 0x41, 0x6b, 0xe7, 0xa1, 0x57, 0x88, 0x9f, 0xc3, 0xbc, 0x68, + 0x3a, 0x56, 0x0e, 0xe1, 0x29, 0x19, 0xbc, 0xc5, 0xb6, 0xf7, 0x55, 0xcc, 0x93, 0xe8, 0x5b, 0x12, + 0xab, 0x66, 0xbe, 0xa1, 0x2c, 0x0c, 0x36, 0x4d, 0xf1, 0x9a, 0xb2, 0x90, 0x66, 0x84, 0x13, 0xd0, + 0x8c, 0x89, 0xe0, 0x49, 0x3c, 0x22, 0x4e, 0x55, 0xb3, 0x3f, 0xfa, 0xef, 0xec, 0xc8, 0x30, 0x04, + 0x1d, 0x53, 0xa1, 0x99, 0x79, 0x50, 0xce, 0x0e, 0x3f, 0x07, 0x2d, 0x91, 0x0c, 0xb3, 0x80, 0x53, + 0xd3, 0x7a, 0xdc, 0x35, 0x80, 0xd6, 0xb3, 0x22, 0x84, 0xca, 0x79, 0x90, 0x82, 0x56, 0x9c, 0x2a, + 0xa9, 0xba, 0x76, 0xde, 0x7b, 0x27, 0x05, 0xda, 0xaa, 0x14, 0x2a, 0xe8, 0x50, 0x99, 0x1b, 0x2e, + 0x41, 0xdb, 0x98, 0x79, 0x97, 0xb7, 0xdf, 0x59, 0x92, 0xbb, 0xeb, 0x55, 0xaf, 0x8d, 0xde, 0xa4, + 0x45, 0x17, 0xeb, 0xc0, 0xaf, 0x01, 0x34, 0xae, 0x92, 0x10, 0x4e, 0x5b, 0x6b, 0xd4, 0x35, 0x1a, + 0x41, 0x74, 0x29, 0x03, 0x5d, 0x81, 0x82, 0x7d, 0x50, 0x63, 0x78, 0x4e, 0x9c, 0x0d, 0x8d, 0xce, + 0x87, 0xfe, 0x14, 0xcf, 0x09, 0xd2, 0x11, 0xe8, 0x03, 0x5b, 0xfd, 0x8a, 0x08, 0x8f, 0x88, 0x53, + 0xd7, 0x69, 0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, 0xee, 0x8d, + 0xe6, 0x68, 0xed, 0xdc, 0xbb, 0x89, 0x02, 0x1a, 0x10, 0xb4, 0xd4, 0xab, 0x90, 0xdd, 0xc1, 0x8c, + 0x46, 0x9d, 0x86, 0xd8, 0x48, 0x64, 0x3e, 0x6e, 0x9f, 0xdc, 0x5c, 0xd4, 0x54, 0x80, 0xcc, 0x42, + 0x39, 0x53, 0x30, 0x38, 0x3d, 0x73, 0x2b, 0xaf, 0xce, 0xdc, 0xca, 0xeb, 0x33, 0xb7, 0xf2, 0xcb, + 0xda, 0xb5, 0x4e, 0xd7, 0xae, 0xf5, 0x6a, 0xed, 0x5a, 0xaf, 0xd7, 0xae, 0xf5, 0xd7, 0xda, 0xb5, + 0x7e, 0xfb, 0xdb, 0xad, 0x7c, 0x7f, 0x6b, 0xb1, 0xfd, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x62, + 0xcb, 0x64, 0xf1, 0x09, 0x09, 0x00, 0x00, } func (m *AdmissionRequest) Marshal() (dAtA []byte, err error) { diff --git a/vendor/k8s.io/api/admission/v1beta1/generated.proto b/vendor/k8s.io/api/admission/v1/generated.proto similarity index 98% rename from vendor/k8s.io/api/admission/v1beta1/generated.proto rename to vendor/k8s.io/api/admission/v1/generated.proto index 41a2643120..5fc0e342e8 100644 --- a/vendor/k8s.io/api/admission/v1beta1/generated.proto +++ b/vendor/k8s.io/api/admission/v1/generated.proto @@ -19,7 +19,7 @@ limitations under the License. syntax = "proto2"; -package k8s.io.api.admission.v1beta1; +package k8s.io.api.admission.v1; import "k8s.io/api/authentication/v1/generated.proto"; import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto"; @@ -27,7 +27,7 @@ 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 = "v1beta1"; +option go_package = "v1"; // AdmissionRequest describes the admission.Attributes for the admission request. message AdmissionRequest { @@ -120,7 +120,7 @@ message AdmissionRequest { // AdmissionResponse describes an admission response. message AdmissionResponse { // UID is an identifier for the individual request/response. - // This should be copied over from the corresponding AdmissionRequest. + // This must be copied over from the corresponding AdmissionRequest. optional string uid = 1; // Allowed indicates whether or not the admission request was permitted. diff --git a/vendor/k8s.io/api/admission/v1beta1/register.go b/vendor/k8s.io/api/admission/v1/register.go similarity index 96% rename from vendor/k8s.io/api/admission/v1beta1/register.go rename to vendor/k8s.io/api/admission/v1/register.go index 1c53e755dd..79000535c7 100644 --- a/vendor/k8s.io/api/admission/v1beta1/register.go +++ b/vendor/k8s.io/api/admission/v1/register.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +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. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1beta1 +package v1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -26,7 +26,7 @@ import ( const GroupName = "admission.k8s.io" // SchemeGroupVersion is group version used to register these objects -var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1beta1"} +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 { diff --git a/vendor/k8s.io/api/admission/v1beta1/types.go b/vendor/k8s.io/api/admission/v1/types.go similarity index 94% rename from vendor/k8s.io/api/admission/v1beta1/types.go rename to vendor/k8s.io/api/admission/v1/types.go index 00c619d998..556fd1ad54 100644 --- a/vendor/k8s.io/api/admission/v1beta1/types.go +++ b/vendor/k8s.io/api/admission/v1/types.go @@ -1,5 +1,5 @@ /* -Copyright 2017 The Kubernetes Authors. +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. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1beta1 +package v1 import ( authenticationv1 "k8s.io/api/authentication/v1" @@ -24,11 +24,6 @@ import ( ) // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +k8s:prerelease-lifecycle-gen:introduced=1.9 -// +k8s:prerelease-lifecycle-gen:deprecated=1.19 -// This API is never server served. It is used for outbound requests from apiservers. This will ensure it never gets served accidentally -// and having the generator against this group will protect future APIs which may be served. -// +k8s:prerelease-lifecycle-gen:replacement=admission.k8s.io,v1,AdmissionReview // AdmissionReview describes an admission review request/response. type AdmissionReview struct { @@ -120,7 +115,7 @@ type AdmissionRequest struct { // AdmissionResponse describes an admission response. type AdmissionResponse struct { // UID is an identifier for the individual request/response. - // This should be copied over from the corresponding AdmissionRequest. + // This must be copied over from the corresponding AdmissionRequest. UID types.UID `json:"uid" protobuf:"bytes,1,opt,name=uid"` // Allowed indicates whether or not the admission request was permitted. diff --git a/vendor/k8s.io/api/admission/v1beta1/types_swagger_doc_generated.go b/vendor/k8s.io/api/admission/v1/types_swagger_doc_generated.go similarity index 98% rename from vendor/k8s.io/api/admission/v1beta1/types_swagger_doc_generated.go rename to vendor/k8s.io/api/admission/v1/types_swagger_doc_generated.go index 13067ad80d..f81594c912 100644 --- a/vendor/k8s.io/api/admission/v1beta1/types_swagger_doc_generated.go +++ b/vendor/k8s.io/api/admission/v1/types_swagger_doc_generated.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1beta1 +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 @@ -52,7 +52,7 @@ func (AdmissionRequest) SwaggerDoc() map[string]string { var map_AdmissionResponse = map[string]string{ "": "AdmissionResponse describes an admission response.", - "uid": "UID is an identifier for the individual request/response. This should be copied over from the corresponding AdmissionRequest.", + "uid": "UID is an identifier for the individual request/response. This must be copied over from the corresponding AdmissionRequest.", "allowed": "Allowed indicates whether or not the admission request was permitted.", "status": "Result contains extra details into why an admission request was denied. This field IS NOT consulted in any way if \"Allowed\" is \"true\".", "patch": "The patch body. Currently we only support \"JSONPatch\" which implements RFC 6902.", diff --git a/vendor/k8s.io/api/admission/v1beta1/zz_generated.deepcopy.go b/vendor/k8s.io/api/admission/v1/zz_generated.deepcopy.go similarity index 95% rename from vendor/k8s.io/api/admission/v1beta1/zz_generated.deepcopy.go rename to vendor/k8s.io/api/admission/v1/zz_generated.deepcopy.go index 8234b322f9..d356882851 100644 --- a/vendor/k8s.io/api/admission/v1beta1/zz_generated.deepcopy.go +++ b/vendor/k8s.io/api/admission/v1/zz_generated.deepcopy.go @@ -19,10 +19,10 @@ limitations under the License. // Code generated by deepcopy-gen. DO NOT EDIT. -package v1beta1 +package v1 import ( - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" ) @@ -33,12 +33,12 @@ func (in *AdmissionRequest) DeepCopyInto(out *AdmissionRequest) { out.Resource = in.Resource if in.RequestKind != nil { in, out := &in.RequestKind, &out.RequestKind - *out = new(v1.GroupVersionKind) + *out = new(metav1.GroupVersionKind) **out = **in } if in.RequestResource != nil { in, out := &in.RequestResource, &out.RequestResource - *out = new(v1.GroupVersionResource) + *out = new(metav1.GroupVersionResource) **out = **in } in.UserInfo.DeepCopyInto(&out.UserInfo) @@ -68,7 +68,7 @@ func (in *AdmissionResponse) DeepCopyInto(out *AdmissionResponse) { *out = *in if in.Result != nil { in, out := &in.Result, &out.Result - *out = new(v1.Status) + *out = new(metav1.Status) (*in).DeepCopyInto(*out) } if in.Patch != nil { diff --git a/vendor/k8s.io/api/admission/v1beta1/zz_generated.prerelease-lifecycle.go b/vendor/k8s.io/api/admission/v1beta1/zz_generated.prerelease-lifecycle.go deleted file mode 100644 index f96e8a4433..0000000000 --- a/vendor/k8s.io/api/admission/v1beta1/zz_generated.prerelease-lifecycle.go +++ /dev/null @@ -1,50 +0,0 @@ -//go:build !ignore_autogenerated -// +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 prerelease-lifecycle-gen. DO NOT EDIT. - -package v1beta1 - -import ( - schema "k8s.io/apimachinery/pkg/runtime/schema" -) - -// APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison. -// It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go. -func (in *AdmissionReview) APILifecycleIntroduced() (major, minor int) { - return 1, 9 -} - -// APILifecycleDeprecated is an autogenerated function, returning the release in which the API struct was or will be deprecated as int versions of major and minor for comparison. -// It is controlled by "k8s:prerelease-lifecycle-gen:deprecated" tags in types.go or "k8s:prerelease-lifecycle-gen:introduced" plus three minor. -func (in *AdmissionReview) APILifecycleDeprecated() (major, minor int) { - return 1, 19 -} - -// APILifecycleReplacement is an autogenerated function, returning the group, version, and kind that should be used instead of this deprecated type. -// It is controlled by "k8s:prerelease-lifecycle-gen:replacement=,," tags in types.go. -func (in *AdmissionReview) APILifecycleReplacement() schema.GroupVersionKind { - return schema.GroupVersionKind{Group: "admission.k8s.io", Version: "v1", Kind: "AdmissionReview"} -} - -// APILifecycleRemoved is an autogenerated function, returning the release in which the API is no longer served as int versions of major and minor for comparison. -// It is controlled by "k8s:prerelease-lifecycle-gen:removed" tags in types.go or "k8s:prerelease-lifecycle-gen:deprecated" plus three minor. -func (in *AdmissionReview) APILifecycleRemoved() (major, minor int) { - return 1, 22 -} diff --git a/vendor/modules.txt b/vendor/modules.txt index b90d615fd3..616e709dce 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -445,7 +445,7 @@ gopkg.in/yaml.v2 gopkg.in/yaml.v3 # k8s.io/api v0.23.0 => k8s.io/api v0.23.0 ## explicit; go 1.16 -k8s.io/api/admission/v1beta1 +k8s.io/api/admission/v1 k8s.io/api/admissionregistration/v1 k8s.io/api/admissionregistration/v1beta1 k8s.io/api/apiserverinternal/v1alpha1