mirror of https://github.com/knative/caching.git
upgrade to latest dependencies (#540)
bumping knative.dev/pkg 2267a4c...a00ba48: > a00ba48 Add unit test coverage of cluster-scoped tracker. (# 2306) > 11a3414 Provide the webhook infrastructure with the raw request context. (# 2305) > b4b8bca Allow tracking Cluster-scoped resources. (# 2304) > 74ac82a Check Knative CustomResourceDefinitions stored version (# 2272) Signed-off-by: Knative Automation <automation@knative.team>
This commit is contained in:
parent
9b6ee73dc4
commit
5d5320f829
2
go.mod
2
go.mod
|
@ -21,5 +21,5 @@ require (
|
|||
k8s.io/code-generator v0.21.4
|
||||
k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7
|
||||
knative.dev/hack v0.0.0-20210806075220-815cd312d65c
|
||||
knative.dev/pkg v0.0.0-20210929111822-2267a4cbebb8
|
||||
knative.dev/pkg v0.0.0-20211005203644-a00ba487121e
|
||||
)
|
||||
|
|
4
go.sum
4
go.sum
|
@ -1085,8 +1085,8 @@ k8s.io/utils v0.0.0-20201110183641-67b214c5f920 h1:CbnUZsM497iRC5QMVkHwyl8s2tB3g
|
|||
k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
|
||||
knative.dev/hack v0.0.0-20210806075220-815cd312d65c h1:nOXoDWAAItwr4o0dp3nHr6skgpVD4IvME/UX84YNl5k=
|
||||
knative.dev/hack v0.0.0-20210806075220-815cd312d65c/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI=
|
||||
knative.dev/pkg v0.0.0-20210929111822-2267a4cbebb8 h1:Ut2Z22rH5WfybI5hjEfi9fDU7rK6kIduWpSAgoEXh7M=
|
||||
knative.dev/pkg v0.0.0-20210929111822-2267a4cbebb8/go.mod h1:r27D20afKNeK+9aNOg+0qMv8JgQcyeP+CAYQIR1jEQY=
|
||||
knative.dev/pkg v0.0.0-20211005203644-a00ba487121e h1:gLyCvMSW2wAN4g3J60nJ9L1Ywzn1DbVMfoNMHR+164w=
|
||||
knative.dev/pkg v0.0.0-20211005203644-a00ba487121e/go.mod h1:r27D20afKNeK+9aNOg+0qMv8JgQcyeP+CAYQIR1jEQY=
|
||||
pgregory.net/rapid v0.3.3/go.mod h1:UYpPVyjFHzYBGHIxLFoupi8vwk6rXNzRY9OMvVxFIOU=
|
||||
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
|
||||
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
|
||||
|
|
|
@ -18,6 +18,7 @@ package apis
|
|||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
|
||||
authenticationv1 "k8s.io/api/authentication/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
|
@ -233,3 +234,22 @@ func WithDryRun(ctx context.Context) context.Context {
|
|||
func IsDryRun(ctx context.Context) bool {
|
||||
return ctx.Value(isDryRun{}) != nil
|
||||
}
|
||||
|
||||
// This is attached to contexts passed to webhook interfaces with
|
||||
// additional context from the HTTP request.
|
||||
type httpReq struct{}
|
||||
|
||||
// WithHTTPRequest associated the HTTP request object the webhook
|
||||
// received with the context.
|
||||
func WithHTTPRequest(ctx context.Context, r *http.Request) context.Context {
|
||||
return context.WithValue(ctx, httpReq{}, r)
|
||||
}
|
||||
|
||||
// GetHTTPRequest fetches the raw HTTP request received by the webhook.
|
||||
func GetHTTPRequest(ctx context.Context) *http.Request {
|
||||
v := ctx.Value(httpReq{})
|
||||
if v == nil {
|
||||
return nil
|
||||
}
|
||||
return v.(*http.Request)
|
||||
}
|
||||
|
|
|
@ -95,7 +95,10 @@ func (i *impl) TrackReference(ref Reference, obj interface{}) error {
|
|||
invalidFields := map[string][]string{
|
||||
"APIVersion": validation.IsQualifiedName(ref.APIVersion),
|
||||
"Kind": validation.IsCIdentifier(ref.Kind),
|
||||
"Namespace": validation.IsDNS1123Label(ref.Namespace),
|
||||
}
|
||||
// Allow namespace to be empty for cluster-scoped references.
|
||||
if ref.Namespace != "" {
|
||||
invalidFields["Namespace"] = validation.IsDNS1123Label(ref.Namespace)
|
||||
}
|
||||
var selector labels.Selector
|
||||
fieldErrors := []string{}
|
||||
|
|
|
@ -613,7 +613,7 @@ k8s.io/utils/trace
|
|||
# knative.dev/hack v0.0.0-20210806075220-815cd312d65c
|
||||
## explicit
|
||||
knative.dev/hack
|
||||
# knative.dev/pkg v0.0.0-20210929111822-2267a4cbebb8
|
||||
# knative.dev/pkg v0.0.0-20211005203644-a00ba487121e
|
||||
## explicit
|
||||
knative.dev/pkg/apis
|
||||
knative.dev/pkg/apis/duck
|
||||
|
|
Loading…
Reference in New Issue