From 115a31ad2b92c928a2f4484884a38ff71bb53161 Mon Sep 17 00:00:00 2001 From: Dave Protasowski Date: Thu, 25 Jun 2020 15:43:27 -0400 Subject: [PATCH] include webhook update knative.dev/pkg which includes webhook fixes (#3416) --- go.mod | 2 +- go.sum | 4 ++-- vendor/knative.dev/pkg/webhook/admission.go | 8 +++++++- vendor/knative.dev/pkg/webhook/conversion.go | 4 ++++ vendor/modules.txt | 2 +- 5 files changed, 15 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index 5ca8ec9108a..183cb47ee87 100644 --- a/go.mod +++ b/go.mod @@ -39,7 +39,7 @@ require ( k8s.io/apiserver v0.17.0 k8s.io/client-go v11.0.1-0.20190805182717-6502b5e7b1b5+incompatible k8s.io/utils v0.0.0-20200124190032-861946025e34 - knative.dev/pkg v0.0.0-20200528142800-1c6815d7e4c9 + knative.dev/pkg v0.0.0-20200625173728-dfb81cf04a7c knative.dev/test-infra v0.0.0-20200519161858-554a95a37986 sigs.k8s.io/yaml v1.2.0 ) diff --git a/go.sum b/go.sum index a2afeeb27c8..60771a339cc 100644 --- a/go.sum +++ b/go.sum @@ -1440,8 +1440,8 @@ knative.dev/pkg v0.0.0-20200505191044-3da93ebb24c2/go.mod h1:Q6sL35DdGs8hIQZKdaC knative.dev/pkg v0.0.0-20200515002500-16d7b963416f/go.mod h1:tMOHGbxtRz8zYFGEGpV/bpoTEM1o89MwYFC4YJXl3GY= knative.dev/pkg v0.0.0-20200519155757-14eb3ae3a5a7 h1:9S2r59HZJF9nKvoRLg5zJzx6XpVlVyvVRqz/C/h6h2s= knative.dev/pkg v0.0.0-20200519155757-14eb3ae3a5a7/go.mod h1:QgNZTxnwpB/oSpNcfnLVlw+WpEwwyKAvJlvR3hgeltA= -knative.dev/pkg v0.0.0-20200528142800-1c6815d7e4c9 h1:bN9gghp5Osuw1bgKrvMaA+oiAvPuYmzSbRo54/EFSxI= -knative.dev/pkg v0.0.0-20200528142800-1c6815d7e4c9/go.mod h1:QgNZTxnwpB/oSpNcfnLVlw+WpEwwyKAvJlvR3hgeltA= +knative.dev/pkg v0.0.0-20200625173728-dfb81cf04a7c h1:QZYml0nrYQFvfDDSUV+J2PKcPuI3EisK3ePoe1Qdvq0= +knative.dev/pkg v0.0.0-20200625173728-dfb81cf04a7c/go.mod h1:QgNZTxnwpB/oSpNcfnLVlw+WpEwwyKAvJlvR3hgeltA= knative.dev/test-infra v0.0.0-20200407185800-1b88cb3b45a5/go.mod h1:xcdUkMJrLlBswIZqL5zCuBFOC22WIPMQoVX1L35i0vQ= knative.dev/test-infra v0.0.0-20200505052144-5ea2f705bb55/go.mod h1:WqF1Azka+FxPZ20keR2zCNtiQA1MP9ZB4BH4HuI+SIU= knative.dev/test-infra v0.0.0-20200513011557-d03429a76034/go.mod h1:aMif0KXL4g19YCYwsy4Ocjjz5xgPlseYV+B95Oo4JGE= diff --git a/vendor/knative.dev/pkg/webhook/admission.go b/vendor/knative.dev/pkg/webhook/admission.go index da9c5263111..6a3a405f63f 100644 --- a/vendor/knative.dev/pkg/webhook/admission.go +++ b/vendor/knative.dev/pkg/webhook/admission.go @@ -88,7 +88,13 @@ func admissionHandler(rootLogger *zap.SugaredLogger, stats StatsReporter, c Admi ctx := logging.WithLogger(r.Context(), logger) - var response admissionv1beta1.AdmissionReview + response := admissionv1beta1.AdmissionReview{ + // Use the same type meta as the request - this is required by the K8s API + // note: v1beta1 & v1 AdmissionReview shapes are identical so even though + // we're using v1 types we still support v1beta1 admission requests + TypeMeta: review.TypeMeta, + } + reviewResponse := c.Admit(ctx, review.Request) var patchType string if reviewResponse.PatchType != nil { diff --git a/vendor/knative.dev/pkg/webhook/conversion.go b/vendor/knative.dev/pkg/webhook/conversion.go index 59575c34f76..be295f2443d 100644 --- a/vendor/knative.dev/pkg/webhook/conversion.go +++ b/vendor/knative.dev/pkg/webhook/conversion.go @@ -54,6 +54,10 @@ func conversionHandler(rootLogger *zap.SugaredLogger, stats StatsReporter, c Con ctx := logging.WithLogger(r.Context(), logger) response := apixv1beta1.ConversionReview{ + // Use the same type meta as the request - this is required by the K8s API + // note: v1beta1 & v1 ConversionReview shapes are identical so even though + // we're using v1 types we still support v1beta1 conversion requests + TypeMeta: review.TypeMeta, Response: c.Convert(ctx, review.Request), } diff --git a/vendor/modules.txt b/vendor/modules.txt index 407121b11d8..5e0fd3456ac 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -910,7 +910,7 @@ k8s.io/utils/buffer k8s.io/utils/integer k8s.io/utils/pointer k8s.io/utils/trace -# knative.dev/pkg v0.0.0-20200528142800-1c6815d7e4c9 +# knative.dev/pkg v0.0.0-20200625173728-dfb81cf04a7c knative.dev/pkg/apiextensions/storageversion knative.dev/pkg/apiextensions/storageversion/cmd/migrate knative.dev/pkg/apis