mirror of https://github.com/knative/client.git
upgrade to latest dependencies (#1671)
bumping knative.dev/pkg 5c8cc3c...a8b7d99: > a8b7d99 Update community files (# 2515) > 0719b40 upgrade to latest dependencies (# 2512) > 2451664 Switch to iota/fmt.Stringer-based diagnostic levels. (# 2511) > ea3c8cb Fix timeout test on darwin and log dial destination on timeout. (# 2510) > af54d73 Support fetching configs from `ctx`. (# 2505) > 5f5455f Use the updated action that infers the module name (# 2509) > 4fced01 Use knative/action/go/downstream-test (# 2507) > 16b36b7 Add support for admission webhook warnings. (# 2498) > 6ec9c1a Fix linting (# 2506) bumping knative.dev/serving f6cb424...f726b1d: > f726b1d Bump cert-manager to 1.8.0 (# 12923) > 01f15e1 Update net-gateway-api nightly (# 12920) > dcb16f2 Update net-kourier nightly (# 12919) > d9f4954 Update net-istio nightly (# 12918) > 69bf45c Update net-certmanager nightly (# 12901) > 754ea6c Update net-kourier nightly (# 12916) > 4273c6e Update net-contour nightly (# 12915) > 119517a Update net-gateway-api nightly (# 12902) > 18da4c0 upgrade to latest dependencies (# 12907) > 8129005 Update community files (# 12913) > 9dc1baa run go.mod tidy (# 12911) > 061be9e Fixing the panicRPSM parameter in autoscaler (# 12910) > 7aa5d8a Update net-kourier nightly (# 12903) bumping knative.dev/eventing 01f5612...9af9870: > 9af9870 upgrade to latest dependencies (# 6371) > 59e25b8 Export trace for events which exceeded unavailable period limit (# 6372) > 22e2a2c upgrade to latest dependencies (# 6365) > e033a2a Update community files (# 6369) > ec36c86 upgrade to latest dependencies (# 6360) bumping knative.dev/networking 591d2bb...91dcb36: > 91dcb36 Update community files (# 667) > 8d5dcbe upgrade to latest dependencies (# 666) > a60cb5f upgrade to latest dependencies (# 665) bumping knative.dev/hack 5f47386...a8076b0: > a8076b0 Model []byte as strings (# 175) > ccf82ad Update community files (# 174) > 46c77f1 Skip passing enable-ha flag to test script (# 173) Signed-off-by: Knative Automation <automation@knative.team>
This commit is contained in:
parent
48ff336ce4
commit
dcd6bb612b
11
go.mod
11
go.mod
|
|
@ -21,11 +21,11 @@ require (
|
||||||
k8s.io/cli-runtime v0.23.4
|
k8s.io/cli-runtime v0.23.4
|
||||||
k8s.io/client-go v0.23.5
|
k8s.io/client-go v0.23.5
|
||||||
k8s.io/code-generator v0.23.5
|
k8s.io/code-generator v0.23.5
|
||||||
knative.dev/eventing v0.31.1-0.20220428204853-01f56122bf2a
|
knative.dev/eventing v0.31.1-0.20220509144032-9af98709e92b
|
||||||
knative.dev/hack v0.0.0-20220427014036-5f473869d377
|
knative.dev/hack v0.0.0-20220506160929-a8076b0510ed
|
||||||
knative.dev/networking v0.0.0-20220429044653-591d2bb63aae
|
knative.dev/networking v0.0.0-20220505013701-91dcb36802a9
|
||||||
knative.dev/pkg v0.0.0-20220428192552-5c8cc3c9efd3
|
knative.dev/pkg v0.0.0-20220505013700-a8b7d99374a3
|
||||||
knative.dev/serving v0.31.1-0.20220429200154-f6cb424aaae3
|
knative.dev/serving v0.31.1-0.20220510145433-f726b1db1b0a
|
||||||
sigs.k8s.io/yaml v1.3.0
|
sigs.k8s.io/yaml v1.3.0
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -107,7 +107,6 @@ require (
|
||||||
go.opencensus.io v0.23.0 // indirect
|
go.opencensus.io v0.23.0 // indirect
|
||||||
go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5 // indirect
|
go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5 // indirect
|
||||||
go.uber.org/atomic v1.9.0 // indirect
|
go.uber.org/atomic v1.9.0 // indirect
|
||||||
go.uber.org/goleak v1.1.12 // indirect
|
|
||||||
go.uber.org/multierr v1.6.0 // indirect
|
go.uber.org/multierr v1.6.0 // indirect
|
||||||
go.uber.org/zap v1.19.1 // indirect
|
go.uber.org/zap v1.19.1 // indirect
|
||||||
golang.org/x/crypto v0.0.0-20220214200702-86341886e292 // indirect
|
golang.org/x/crypto v0.0.0-20220214200702-86341886e292 // indirect
|
||||||
|
|
|
||||||
33
go.sum
33
go.sum
|
|
@ -2268,22 +2268,25 @@ k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b/go.mod h1:jPW/WVKK9YHAvNhRxK0md/
|
||||||
k8s.io/utils v0.0.0-20211116205334-6203023598ed/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
|
k8s.io/utils v0.0.0-20211116205334-6203023598ed/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
|
||||||
k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9 h1:HNSDgDCrr/6Ly3WEGKZftiE7IY19Vz2GdbOCyI4qqhc=
|
k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9 h1:HNSDgDCrr/6Ly3WEGKZftiE7IY19Vz2GdbOCyI4qqhc=
|
||||||
k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
|
k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
|
||||||
knative.dev/caching v0.0.0-20220428025253-fbd3e15507cf/go.mod h1:KrKJ/aoy/mwlQcSvHidBRPlJn1rRhZlPbqPHbxGtuz4=
|
knative.dev/caching v0.0.0-20220504134959-dd8e0ef37355/go.mod h1:AoEBl6LxEVEHZNkuu/s34Z/ffIFX8SQBJ7+puQXkczU=
|
||||||
knative.dev/eventing v0.31.1-0.20220428204853-01f56122bf2a h1:WLiDXHa9k97/lDmwBqgPuzI/6zQL4agrTH+jYjw1vFM=
|
knative.dev/eventing v0.31.1-0.20220509144032-9af98709e92b h1:Pn78o0BAvZY5KBdYpt0zFuOOQHXzI6WOaQT+R78wx3E=
|
||||||
knative.dev/eventing v0.31.1-0.20220428204853-01f56122bf2a/go.mod h1:jdXjZKlLMwEj2KFKatzbqKWyOJAjUtn3072V3SkKIGI=
|
knative.dev/eventing v0.31.1-0.20220509144032-9af98709e92b/go.mod h1:aqiJ8eEXtXBz3vERz/2lbkRjA1jbG6yXujaEGHqKLgs=
|
||||||
knative.dev/hack v0.0.0-20220411131823-6ffd8417de7c/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI=
|
|
||||||
knative.dev/hack v0.0.0-20220427014036-5f473869d377 h1:NMJG3LkOZ5Xut7TzbxtwaQAmT8ZBfDMxwCkoatZv8ms=
|
|
||||||
knative.dev/hack v0.0.0-20220427014036-5f473869d377/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI=
|
knative.dev/hack v0.0.0-20220427014036-5f473869d377/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI=
|
||||||
knative.dev/hack/schema v0.0.0-20220427014036-5f473869d377/go.mod h1:ffjwmdcrH5vN3mPhO8RrF2KfNnbHeCE2C60A+2cv3U0=
|
knative.dev/hack v0.0.0-20220503220458-46c77f157e20/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI=
|
||||||
knative.dev/networking v0.0.0-20220429044653-591d2bb63aae h1:zdQdJdTDzqudH+FJVFfGt+3N3zqqljZpF0mCIV/CX2Y=
|
knative.dev/hack v0.0.0-20220505013956-ccf82ad03f32/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI=
|
||||||
knative.dev/networking v0.0.0-20220429044653-591d2bb63aae/go.mod h1:SocyTv3I1HLDCOcLTKgdRrciOg3m0fNxd0BfqOEWv20=
|
knative.dev/hack v0.0.0-20220506160929-a8076b0510ed h1:6mFHY1IFMRnO9O1z9q6xL9mAy6Gpm8SmRQ2KbahXKz0=
|
||||||
knative.dev/pkg v0.0.0-20220427013826-1f681e126af6/go.mod h1:j2MeD8s+JoCu1vegX80GbRXV/xd20Jm1NznxBYtVXiM=
|
knative.dev/hack v0.0.0-20220506160929-a8076b0510ed/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI=
|
||||||
knative.dev/pkg v0.0.0-20220427171752-2d552be030f6/go.mod h1:NXK3p/UMCbFybBM9xQGii3TuMN/WKHByXcYsTwZ6Y6U=
|
knative.dev/hack/schema v0.0.0-20220506160929-a8076b0510ed/go.mod h1:ffjwmdcrH5vN3mPhO8RrF2KfNnbHeCE2C60A+2cv3U0=
|
||||||
knative.dev/pkg v0.0.0-20220428192552-5c8cc3c9efd3 h1:wznCcHq6F1QNC8MGqekF+L4EpjMLwmFv+WQKds9qM1g=
|
knative.dev/networking v0.0.0-20220504043559-8d5dcbeeea2a/go.mod h1:+H5KnK/r/4/WtRRacuQuuGEjCn0961q2o7gwl+FoZfo=
|
||||||
knative.dev/pkg v0.0.0-20220428192552-5c8cc3c9efd3/go.mod h1:NXK3p/UMCbFybBM9xQGii3TuMN/WKHByXcYsTwZ6Y6U=
|
knative.dev/networking v0.0.0-20220505013701-91dcb36802a9 h1:3/5bRIjG/cHKCQVmD/lMVCFKaym1U+0+Hlah25sF8c8=
|
||||||
knative.dev/reconciler-test v0.0.0-20220427134652-f14902d1c7a5/go.mod h1:IZTJfC1sgr70/39NIne/MmaNbDWRHwT6cWvJB3AeHIU=
|
knative.dev/networking v0.0.0-20220505013701-91dcb36802a9/go.mod h1:+H5KnK/r/4/WtRRacuQuuGEjCn0961q2o7gwl+FoZfo=
|
||||||
knative.dev/serving v0.31.1-0.20220429200154-f6cb424aaae3 h1:4zcGmn2hgyUn4GH69wPGXSADb6QFUfCi/7DofUnDWjY=
|
knative.dev/pkg v0.0.0-20220503223858-245166458ef4/go.mod h1:NXK3p/UMCbFybBM9xQGii3TuMN/WKHByXcYsTwZ6Y6U=
|
||||||
knative.dev/serving v0.31.1-0.20220429200154-f6cb424aaae3/go.mod h1:0QD86J9/jjo9p8EBGdegLYG3n5HP75RMBORtoXs7/Lo=
|
knative.dev/pkg v0.0.0-20220504135159-0719b405eca5/go.mod h1:mRzBIY8eoQurpADZ4+3LzNuucKOBhsSvhX6lXqMVpIc=
|
||||||
|
knative.dev/pkg v0.0.0-20220505013700-a8b7d99374a3 h1:odf5hudTbupqdYDsxeqofZtMsZuU0FqPZqWI6xETYIA=
|
||||||
|
knative.dev/pkg v0.0.0-20220505013700-a8b7d99374a3/go.mod h1:mRzBIY8eoQurpADZ4+3LzNuucKOBhsSvhX6lXqMVpIc=
|
||||||
|
knative.dev/reconciler-test v0.0.0-20220505183729-e295cedfd97b/go.mod h1:blANTpykbOpFykGxucL/8RkU8hH4WmZRWaxifP8heF4=
|
||||||
|
knative.dev/serving v0.31.1-0.20220510145433-f726b1db1b0a h1:M2wdCCJPQYWtqNT4HzRXKSyyWvgSzv1+RVMWNsIF5As=
|
||||||
|
knative.dev/serving v0.31.1-0.20220510145433-f726b1db1b0a/go.mod h1:p3hhjSBFUOGgyapoypIGLgHp9dJvdIH3ZiJz+DCtbic=
|
||||||
mvdan.cc/gofumpt v0.1.1/go.mod h1:yXG1r1WqZVKWbVRtBWKWX9+CxGYfA51nSomhM0woR48=
|
mvdan.cc/gofumpt v0.1.1/go.mod h1:yXG1r1WqZVKWbVRtBWKWX9+CxGYfA51nSomhM0woR48=
|
||||||
mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed/go.mod h1:Xkxe497xwlCKkIaQYRfC7CSLworTXY9RMqwhhCm+8Nc=
|
mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed/go.mod h1:Xkxe497xwlCKkIaQYRfC7CSLworTXY9RMqwhhCm+8Nc=
|
||||||
mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b/go.mod h1:2odslEg/xrtNQqCYg2/jCoyKnw3vv5biOc3JnIcYfL4=
|
mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b/go.mod h1:2odslEg/xrtNQqCYg2/jCoyKnw3vv5biOc3JnIcYfL4=
|
||||||
|
|
|
||||||
|
|
@ -137,13 +137,17 @@ CLOUD_PROVIDER="gke"
|
||||||
function initialize() {
|
function initialize() {
|
||||||
local run_tests=0
|
local run_tests=0
|
||||||
local custom_flags=()
|
local custom_flags=()
|
||||||
|
local parse_script_flags=0
|
||||||
E2E_SCRIPT="$(get_canonical_path "$0")"
|
E2E_SCRIPT="$(get_canonical_path "$0")"
|
||||||
local e2e_script_command=( "${E2E_SCRIPT}" "--run-tests" )
|
local e2e_script_command=( "${E2E_SCRIPT}" "--run-tests" )
|
||||||
|
|
||||||
|
for i in "$@"; do
|
||||||
|
if [[ $i == "--run-tests" ]]; then parse_script_flags=1; fi
|
||||||
|
done
|
||||||
|
|
||||||
cd "${REPO_ROOT_DIR}"
|
cd "${REPO_ROOT_DIR}"
|
||||||
while [[ $# -ne 0 ]]; do
|
while [[ $# -ne 0 ]]; do
|
||||||
local parameter=$1
|
local parameter=$1
|
||||||
# TODO(chizhg): remove parse_flags logic if no repos are using it.
|
|
||||||
# Try parsing flag as a custom one.
|
# Try parsing flag as a custom one.
|
||||||
if function_exists parse_flags; then
|
if function_exists parse_flags; then
|
||||||
parse_flags "$@"
|
parse_flags "$@"
|
||||||
|
|
@ -152,7 +156,10 @@ function initialize() {
|
||||||
# Skip parsed flag (and possibly argument) and continue
|
# Skip parsed flag (and possibly argument) and continue
|
||||||
# Also save it to it's passed through to the test script
|
# Also save it to it's passed through to the test script
|
||||||
for ((i=1;i<=skip;i++)); do
|
for ((i=1;i<=skip;i++)); do
|
||||||
|
# Avoid double-parsing
|
||||||
|
if (( parse_script_flags )); then
|
||||||
e2e_script_command+=("$1")
|
e2e_script_command+=("$1")
|
||||||
|
fi
|
||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
continue
|
continue
|
||||||
|
|
|
||||||
|
|
@ -36,12 +36,15 @@ func CheckDeprecated(ctx context.Context, obj interface{}) *FieldError {
|
||||||
// CheckDeprecatedUpdate checks whether the provided named deprecated fields
|
// CheckDeprecatedUpdate checks whether the provided named deprecated fields
|
||||||
// are set in a context where deprecation is disallowed.
|
// are set in a context where deprecation is disallowed.
|
||||||
// This is a json shallow check. We will recursively check inlined structs.
|
// This is a json shallow check. We will recursively check inlined structs.
|
||||||
func CheckDeprecatedUpdate(ctx context.Context, obj, original interface{}) *FieldError {
|
func CheckDeprecatedUpdate(ctx context.Context, obj, original interface{}) (errs *FieldError) {
|
||||||
if IsDeprecatedAllowed(ctx) {
|
if IsDeprecatedAllowed(ctx) {
|
||||||
|
// TODO: We should still run through the validation here, but do
|
||||||
|
// something like:
|
||||||
|
// defer func() {
|
||||||
|
// errs = errs.At(WarningLevel)
|
||||||
|
// }()
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
var errs *FieldError
|
|
||||||
objFields, objInlined := getPrefixedNamedFieldValues(deprecatedPrefix, obj)
|
objFields, objInlined := getPrefixedNamedFieldValues(deprecatedPrefix, obj)
|
||||||
|
|
||||||
if nonZero(reflect.ValueOf(original)) {
|
if nonZero(reflect.ValueOf(original)) {
|
||||||
|
|
|
||||||
|
|
@ -28,17 +28,53 @@ import (
|
||||||
// a problem with the current field itself.
|
// a problem with the current field itself.
|
||||||
const CurrentField = ""
|
const CurrentField = ""
|
||||||
|
|
||||||
|
// DiagnosticLevel is used to signal the severity of a particular diagnostic
|
||||||
|
// in the form of a FieldError.
|
||||||
|
type DiagnosticLevel int
|
||||||
|
|
||||||
|
const (
|
||||||
|
// ErrorLevel is used to signify fatal/blocking diagnostics, e.g. those
|
||||||
|
// that should block admission in a validating admission webhook.
|
||||||
|
ErrorLevel DiagnosticLevel = iota
|
||||||
|
|
||||||
|
// WarningLevel is used to signify information/non-blocking diagnostics,
|
||||||
|
// e.g. those that should be surfaced as warnings in a validating admission
|
||||||
|
// webhook.
|
||||||
|
WarningLevel
|
||||||
|
)
|
||||||
|
|
||||||
|
func (dl DiagnosticLevel) String() string {
|
||||||
|
switch dl {
|
||||||
|
case ErrorLevel:
|
||||||
|
return "Error"
|
||||||
|
case WarningLevel:
|
||||||
|
return "Warning"
|
||||||
|
|
||||||
|
default:
|
||||||
|
return fmt.Sprintf("<UNKNOWN: %d>", dl)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// FieldError is used to propagate the context of errors pertaining to
|
// FieldError is used to propagate the context of errors pertaining to
|
||||||
// specific fields in a manner suitable for use in a recursive walk, so
|
// specific fields in a manner suitable for use in a recursive walk, so
|
||||||
// that errors contain the appropriate field context.
|
// that errors contain the appropriate field context.
|
||||||
// FieldError methods are non-mutating.
|
// FieldError methods are non-mutating.
|
||||||
// +k8s:deepcopy-gen=true
|
// +k8s:deepcopy-gen=true
|
||||||
type FieldError struct {
|
type FieldError struct {
|
||||||
|
// Message holds the main diagnostic message carried by this FieldError
|
||||||
Message string
|
Message string
|
||||||
|
|
||||||
|
// Paths holds a list of paths to which this diagnostic pertains
|
||||||
Paths []string
|
Paths []string
|
||||||
|
|
||||||
|
// Level holds the severity of the diagnostic.
|
||||||
|
// If empty, this defaults to ErrorLevel.
|
||||||
|
Level DiagnosticLevel
|
||||||
|
|
||||||
// Details contains an optional longer payload.
|
// Details contains an optional longer payload.
|
||||||
// +optional
|
// +optional
|
||||||
Details string
|
Details string
|
||||||
|
|
||||||
errors []FieldError
|
errors []FieldError
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -60,6 +96,7 @@ func (fe *FieldError) ViaField(prefix ...string) *FieldError {
|
||||||
// along using .Also().
|
// along using .Also().
|
||||||
newErr := &FieldError{
|
newErr := &FieldError{
|
||||||
Message: fe.Message,
|
Message: fe.Message,
|
||||||
|
Level: fe.Level,
|
||||||
Details: fe.Details,
|
Details: fe.Details,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -107,6 +144,54 @@ func (fe *FieldError) ViaFieldKey(field, key string) *FieldError {
|
||||||
return fe.ViaKey(key).ViaField(field)
|
return fe.ViaKey(key).ViaField(field)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// At is a way to alter the level of the diagnostics held in this FieldError.
|
||||||
|
// ErrMissingField("foo").At(WarningLevel)
|
||||||
|
func (fe *FieldError) At(l DiagnosticLevel) *FieldError {
|
||||||
|
if fe == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
// Copy over message and details, paths will be updated and errors come
|
||||||
|
// along using .Also().
|
||||||
|
newErr := &FieldError{
|
||||||
|
Message: fe.Message,
|
||||||
|
Level: l,
|
||||||
|
Details: fe.Details,
|
||||||
|
Paths: fe.Paths,
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, e := range fe.errors {
|
||||||
|
newErr = newErr.Also(e.At(l))
|
||||||
|
}
|
||||||
|
return newErr
|
||||||
|
}
|
||||||
|
|
||||||
|
// Filter is a way to access the set of diagnostics having a particular level.
|
||||||
|
// if err := x.Validate(ctx).Filter(ErrorLevel); err != nil {
|
||||||
|
// return err
|
||||||
|
// }
|
||||||
|
func (fe *FieldError) Filter(l DiagnosticLevel) *FieldError {
|
||||||
|
if fe == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
var newErr *FieldError
|
||||||
|
if l == fe.Level {
|
||||||
|
newErr = &FieldError{
|
||||||
|
Message: fe.Message,
|
||||||
|
Level: fe.Level,
|
||||||
|
Details: fe.Details,
|
||||||
|
Paths: fe.Paths,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, e := range fe.errors {
|
||||||
|
newErr = newErr.Also(e.Filter(l))
|
||||||
|
}
|
||||||
|
if newErr.isEmpty() {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
return newErr
|
||||||
|
}
|
||||||
|
|
||||||
// Also collects errors, returns a new collection of existing errors and new errors.
|
// Also collects errors, returns a new collection of existing errors and new errors.
|
||||||
func (fe *FieldError) Also(errs ...*FieldError) *FieldError {
|
func (fe *FieldError) Also(errs ...*FieldError) *FieldError {
|
||||||
// Avoid doing any work, if we don't have to.
|
// Avoid doing any work, if we don't have to.
|
||||||
|
|
@ -154,6 +239,7 @@ func (fe *FieldError) normalized() []*FieldError {
|
||||||
if fe.Message != "" {
|
if fe.Message != "" {
|
||||||
errors = append(errors, &FieldError{
|
errors = append(errors, &FieldError{
|
||||||
Message: fe.Message,
|
Message: fe.Message,
|
||||||
|
Level: fe.Level,
|
||||||
Paths: fe.Paths,
|
Paths: fe.Paths,
|
||||||
Details: fe.Details,
|
Details: fe.Details,
|
||||||
})
|
})
|
||||||
|
|
@ -274,6 +360,9 @@ func merge(errs []*FieldError) []*FieldError {
|
||||||
// Sort the flattened map.
|
// Sort the flattened map.
|
||||||
sort.Slice(newErrs, func(i, j int) bool {
|
sort.Slice(newErrs, func(i, j int) bool {
|
||||||
if newErrs[i].Message == newErrs[j].Message {
|
if newErrs[i].Message == newErrs[j].Message {
|
||||||
|
if newErrs[i].Details == newErrs[j].Details {
|
||||||
|
return newErrs[i].Level < newErrs[j].Level
|
||||||
|
}
|
||||||
return newErrs[i].Details < newErrs[j].Details
|
return newErrs[i].Details < newErrs[j].Details
|
||||||
}
|
}
|
||||||
return newErrs[i].Message < newErrs[j].Message
|
return newErrs[i].Message < newErrs[j].Message
|
||||||
|
|
@ -285,7 +374,7 @@ func merge(errs []*FieldError) []*FieldError {
|
||||||
|
|
||||||
// key returns the key using the fields .Message and .Details.
|
// key returns the key using the fields .Message and .Details.
|
||||||
func key(err *FieldError) string {
|
func key(err *FieldError) string {
|
||||||
return fmt.Sprintf("%s-%s", err.Message, err.Details)
|
return fmt.Sprintf("%s-%s-%s", err.Level, err.Message, err.Details)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Public helpers ---
|
// Public helpers ---
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ limitations under the License.
|
||||||
package leaderelection
|
package leaderelection
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
@ -88,6 +89,24 @@ type Config struct {
|
||||||
LeaseNamesPrefixMapping map[string]string
|
LeaseNamesPrefixMapping map[string]string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type lecfg struct{}
|
||||||
|
|
||||||
|
// WithConfig associates a leader election configuration with the
|
||||||
|
// context.
|
||||||
|
func WithConfig(ctx context.Context, cfg *Config) context.Context {
|
||||||
|
return context.WithValue(ctx, lecfg{}, cfg)
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetConfig gets the leader election config from the provided
|
||||||
|
// context.
|
||||||
|
func GetConfig(ctx context.Context) *Config {
|
||||||
|
untyped := ctx.Value(lecfg{})
|
||||||
|
if untyped == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
return untyped.(*Config)
|
||||||
|
}
|
||||||
|
|
||||||
func (c *Config) GetComponentConfig(name string) ComponentConfig {
|
func (c *Config) GetComponentConfig(name string) ComponentConfig {
|
||||||
return ComponentConfig{
|
return ComponentConfig{
|
||||||
Component: name,
|
Component: name,
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ limitations under the License.
|
||||||
package logging
|
package logging
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
@ -136,6 +137,22 @@ type Config struct {
|
||||||
LoggingLevel map[string]zapcore.Level
|
LoggingLevel map[string]zapcore.Level
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type lcfg struct{}
|
||||||
|
|
||||||
|
// WithConfig associates a logging configuration with the context.
|
||||||
|
func WithConfig(ctx context.Context, cfg *Config) context.Context {
|
||||||
|
return context.WithValue(ctx, lcfg{}, cfg)
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetConfig gets the logging config from the provided context.
|
||||||
|
func GetConfig(ctx context.Context) *Config {
|
||||||
|
untyped := ctx.Value(lcfg{})
|
||||||
|
if untyped == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
return untyped.(*Config)
|
||||||
|
}
|
||||||
|
|
||||||
func defaultConfig() *Config {
|
func defaultConfig() *Config {
|
||||||
return &Config{
|
return &Config{
|
||||||
LoggingLevel: make(map[string]zapcore.Level),
|
LoggingLevel: make(map[string]zapcore.Level),
|
||||||
|
|
|
||||||
|
|
@ -113,7 +113,7 @@ func dialBackOffHelper(ctx context.Context, network, address string, bo wait.Bac
|
||||||
return c, nil
|
return c, nil
|
||||||
}
|
}
|
||||||
elapsed := time.Since(start)
|
elapsed := time.Since(start)
|
||||||
return nil, fmt.Errorf("%w after %.2fs", ErrTimeoutDialing, elapsed.Seconds())
|
return nil, fmt.Errorf("%w %s after %.2fs", ErrTimeoutDialing, address, elapsed.Seconds())
|
||||||
}
|
}
|
||||||
|
|
||||||
func newHTTPTransport(disableKeepAlives, disableCompression bool, maxIdle, maxIdlePerHost int) http.RoundTripper {
|
func newHTTPTransport(disableKeepAlives, disableCompression bool, maxIdle, maxIdlePerHost int) http.RoundTripper {
|
||||||
|
|
|
||||||
|
|
@ -354,8 +354,6 @@ go.starlark.net/syntax
|
||||||
# go.uber.org/atomic v1.9.0
|
# go.uber.org/atomic v1.9.0
|
||||||
## explicit; go 1.13
|
## explicit; go 1.13
|
||||||
go.uber.org/atomic
|
go.uber.org/atomic
|
||||||
# go.uber.org/goleak v1.1.12
|
|
||||||
## explicit; go 1.13
|
|
||||||
# go.uber.org/multierr v1.6.0
|
# go.uber.org/multierr v1.6.0
|
||||||
## explicit; go 1.12
|
## explicit; go 1.12
|
||||||
go.uber.org/multierr
|
go.uber.org/multierr
|
||||||
|
|
@ -894,7 +892,7 @@ k8s.io/utils/internal/third_party/forked/golang/net
|
||||||
k8s.io/utils/net
|
k8s.io/utils/net
|
||||||
k8s.io/utils/pointer
|
k8s.io/utils/pointer
|
||||||
k8s.io/utils/trace
|
k8s.io/utils/trace
|
||||||
# knative.dev/eventing v0.31.1-0.20220428204853-01f56122bf2a
|
# knative.dev/eventing v0.31.1-0.20220509144032-9af98709e92b
|
||||||
## explicit; go 1.16
|
## explicit; go 1.16
|
||||||
knative.dev/eventing/pkg/apis/config
|
knative.dev/eventing/pkg/apis/config
|
||||||
knative.dev/eventing/pkg/apis/duck
|
knative.dev/eventing/pkg/apis/duck
|
||||||
|
|
@ -922,10 +920,10 @@ knative.dev/eventing/pkg/client/clientset/versioned/typed/sources/v1
|
||||||
knative.dev/eventing/pkg/client/clientset/versioned/typed/sources/v1/fake
|
knative.dev/eventing/pkg/client/clientset/versioned/typed/sources/v1/fake
|
||||||
knative.dev/eventing/pkg/client/clientset/versioned/typed/sources/v1beta2
|
knative.dev/eventing/pkg/client/clientset/versioned/typed/sources/v1beta2
|
||||||
knative.dev/eventing/pkg/client/clientset/versioned/typed/sources/v1beta2/fake
|
knative.dev/eventing/pkg/client/clientset/versioned/typed/sources/v1beta2/fake
|
||||||
# knative.dev/hack v0.0.0-20220427014036-5f473869d377
|
# knative.dev/hack v0.0.0-20220506160929-a8076b0510ed
|
||||||
## explicit; go 1.14
|
## explicit; go 1.14
|
||||||
knative.dev/hack
|
knative.dev/hack
|
||||||
# knative.dev/networking v0.0.0-20220429044653-591d2bb63aae
|
# knative.dev/networking v0.0.0-20220505013701-91dcb36802a9
|
||||||
## explicit; go 1.16
|
## explicit; go 1.16
|
||||||
knative.dev/networking/pkg
|
knative.dev/networking/pkg
|
||||||
knative.dev/networking/pkg/apis/networking
|
knative.dev/networking/pkg/apis/networking
|
||||||
|
|
@ -933,7 +931,7 @@ knative.dev/networking/pkg/apis/networking/v1alpha1
|
||||||
knative.dev/networking/pkg/client/clientset/versioned
|
knative.dev/networking/pkg/client/clientset/versioned
|
||||||
knative.dev/networking/pkg/client/clientset/versioned/scheme
|
knative.dev/networking/pkg/client/clientset/versioned/scheme
|
||||||
knative.dev/networking/pkg/client/clientset/versioned/typed/networking/v1alpha1
|
knative.dev/networking/pkg/client/clientset/versioned/typed/networking/v1alpha1
|
||||||
# knative.dev/pkg v0.0.0-20220428192552-5c8cc3c9efd3
|
# knative.dev/pkg v0.0.0-20220505013700-a8b7d99374a3
|
||||||
## explicit; go 1.17
|
## explicit; go 1.17
|
||||||
knative.dev/pkg/apis
|
knative.dev/pkg/apis
|
||||||
knative.dev/pkg/apis/duck
|
knative.dev/pkg/apis/duck
|
||||||
|
|
@ -983,7 +981,7 @@ knative.dev/pkg/tracing/config
|
||||||
knative.dev/pkg/tracing/propagation
|
knative.dev/pkg/tracing/propagation
|
||||||
knative.dev/pkg/tracing/propagation/tracecontextb3
|
knative.dev/pkg/tracing/propagation/tracecontextb3
|
||||||
knative.dev/pkg/tracker
|
knative.dev/pkg/tracker
|
||||||
# knative.dev/serving v0.31.1-0.20220429200154-f6cb424aaae3
|
# knative.dev/serving v0.31.1-0.20220510145433-f726b1db1b0a
|
||||||
## explicit; go 1.17
|
## explicit; go 1.17
|
||||||
knative.dev/serving/pkg/apis/autoscaling
|
knative.dev/serving/pkg/apis/autoscaling
|
||||||
knative.dev/serving/pkg/apis/autoscaling/v1alpha1
|
knative.dev/serving/pkg/apis/autoscaling/v1alpha1
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue