Skip to content

Commit

Permalink
Auto-update dependencies
Browse files Browse the repository at this point in the history
Produced via:
  `./hack/update-deps.sh --upgrade && ./hack/update-codegen.sh`
/assign maximilien rhuss
/cc maximilien rhuss
  • Loading branch information
mattmoor committed Mar 13, 2020
1 parent db569fa commit 8e74bdc
Show file tree
Hide file tree
Showing 11 changed files with 90 additions and 58 deletions.
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ require (
k8s.io/apimachinery v0.17.0
k8s.io/cli-runtime v0.17.0
k8s.io/client-go v0.17.0
knative.dev/eventing v0.13.1
knative.dev/pkg v0.0.0-20200304185554-312b1be35ceb
knative.dev/serving v0.13.0
knative.dev/test-infra v0.0.0-20200229011351-4dac123b9a3d
knative.dev/eventing v0.13.3
knative.dev/pkg v0.0.0-20200313012929-1893541a0fac
knative.dev/serving v0.13.1-0.20200313103129-34717bfa04b0
knative.dev/test-infra v0.0.0-20200312203729-3f96c9e98f31
sigs.k8s.io/yaml v1.1.0
)

Expand Down
16 changes: 8 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -592,14 +592,14 @@ k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKf
k8s.io/legacy-cloud-providers v0.17.0/go.mod h1:DdzaepJ3RtRy+e5YhNtrCYwlgyK87j/5+Yfp0L9Syp8=
k8s.io/utils v0.0.0-20191114184206-e782cd3c129f h1:GiPwtSzdP43eI1hpPCbROQCCIgCuiMMNF8YUVLF3vJo=
k8s.io/utils v0.0.0-20191114184206-e782cd3c129f/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew=
knative.dev/eventing v0.13.1 h1:2jnxea7XtqFX8dMFu9cZ7ocMuQV5ZnXX+6tLF6AbYGo=
knative.dev/eventing v0.13.1/go.mod h1:UxweNv8yXhsdHJitcb9R6rmfNaUD2DFi9GWwNRyIs58=
knative.dev/pkg v0.0.0-20200304185554-312b1be35ceb h1:cgpFaVF0jb7z+zJGzq30HMfxMmWwX5WEnkMZ9EHli7I=
knative.dev/pkg v0.0.0-20200304185554-312b1be35ceb/go.mod h1:pgODObA1dTyhNoFxPZTTjNWfx6F0aKsKzn+vaT9XO/Q=
knative.dev/serving v0.13.0 h1:HkkTVBi6EWoFJcgjXgAVUFdKdxZRulb38dnfnkBYCrQ=
knative.dev/serving v0.13.0/go.mod h1:x2n255JS2XBI39tmjZ8CwTxIf9EKNMCrkVuiOttLRm0=
knative.dev/test-infra v0.0.0-20200229011351-4dac123b9a3d h1:YlscBzPOL3Rfyl8844/wHhJNL5uiHDdyaRn6IEVvv64=
knative.dev/test-infra v0.0.0-20200229011351-4dac123b9a3d/go.mod h1:xcdUkMJrLlBswIZqL5zCuBFOC22WIPMQoVX1L35i0vQ=
knative.dev/eventing v0.13.3 h1:SzPcNnasyQywTCQ5kexJmBVgRfFcKPSDsCYI0iu0zNM=
knative.dev/eventing v0.13.3/go.mod h1:UxweNv8yXhsdHJitcb9R6rmfNaUD2DFi9GWwNRyIs58=
knative.dev/pkg v0.0.0-20200313012929-1893541a0fac h1:fHIW1KQdTlH0Wg8PcEZDMd8nODZchGlT3OnQqmkoeEQ=
knative.dev/pkg v0.0.0-20200313012929-1893541a0fac/go.mod h1:pgODObA1dTyhNoFxPZTTjNWfx6F0aKsKzn+vaT9XO/Q=
knative.dev/serving v0.13.1-0.20200313103129-34717bfa04b0 h1:lwuDcULnoqhDoQ3/2XJtJPMpl2zHSd9PaMPKy9Dyfj4=
knative.dev/serving v0.13.1-0.20200313103129-34717bfa04b0/go.mod h1:x2n255JS2XBI39tmjZ8CwTxIf9EKNMCrkVuiOttLRm0=
knative.dev/test-infra v0.0.0-20200312203729-3f96c9e98f31 h1:dbcLXd5b4slTUx/xJktQUue7bgCTkCsC5GB/FlpxHa0=
knative.dev/test-infra v0.0.0-20200312203729-3f96c9e98f31/go.mod h1:xcdUkMJrLlBswIZqL5zCuBFOC22WIPMQoVX1L35i0vQ=
modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw=
modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk=
modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ func (pa *PodAutoscalerSpec) Validate(ctx context.Context) *apis.FieldError {
if equality.Semantic.DeepEqual(pa, &PodAutoscalerSpec{}) {
return apis.ErrMissingField(apis.CurrentField)
}
return serving.ValidateNamespacedObjectReference(&pa.ScaleTargetRef).ViaField("scaleTargetRef").Also(serving.ValidateContainerConcurrency(&pa.ContainerConcurrency).ViaField("containerConcurrency")).Also(validateSKSFields(ctx, pa))
return serving.ValidateNamespacedObjectReference(&pa.ScaleTargetRef).
ViaField("scaleTargetRef").Also(
serving.ValidateContainerConcurrency(
ctx, &pa.ContainerConcurrency).ViaField("containerConcurrency")).Also(
validateSKSFields(ctx, pa))
}

func validateSKSFields(ctx context.Context, rs *PodAutoscalerSpec) (errs *apis.FieldError) {
Expand Down
59 changes: 38 additions & 21 deletions vendor/knative.dev/serving/pkg/apis/config/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"context"
"fmt"
"io/ioutil"
"math"
"strconv"
"text/template"

Expand Down Expand Up @@ -53,44 +54,56 @@ const (
DefaultMaxRevisionContainerConcurrency int64 = 1000
)

func defaultConfig() *Defaults {
return &Defaults{
RevisionTimeoutSeconds: DefaultRevisionTimeoutSeconds,
MaxRevisionTimeoutSeconds: DefaultMaxRevisionTimeoutSeconds,
UserContainerNameTemplate: DefaultUserContainerName,
ContainerConcurrency: DefaultContainerConcurrency,
ContainerConcurrencyMaxLimit: DefaultMaxRevisionContainerConcurrency,
}
}

// NewDefaultsConfigFromMap creates a Defaults from the supplied Map
func NewDefaultsConfigFromMap(data map[string]string) (*Defaults, error) {
nc := &Defaults{}
nc := defaultConfig()

// Process int64 fields
for _, i64 := range []struct {
key string
field *int64
// specified exactly when optional
defaultValue int64
}{{
key: "revision-timeout-seconds",
field: &nc.RevisionTimeoutSeconds,
defaultValue: DefaultRevisionTimeoutSeconds,
key: "revision-timeout-seconds",
field: &nc.RevisionTimeoutSeconds,
}, {
key: "max-revision-timeout-seconds",
field: &nc.MaxRevisionTimeoutSeconds,
defaultValue: DefaultMaxRevisionTimeoutSeconds,
key: "max-revision-timeout-seconds",
field: &nc.MaxRevisionTimeoutSeconds,
}, {
key: "container-concurrency",
field: &nc.ContainerConcurrency,
defaultValue: DefaultContainerConcurrency,
key: "container-concurrency",
field: &nc.ContainerConcurrency,
}, {
key: "container-concurrency-max-limit",
field: &nc.ContainerConcurrencyMaxLimit,
}} {
if raw, ok := data[i64.key]; !ok {
*i64.field = i64.defaultValue
} else if val, err := strconv.ParseInt(raw, 10, 64); err != nil {
return nil, err
} else {
*i64.field = val
if raw, ok := data[i64.key]; ok {
if val, err := strconv.ParseInt(raw, 10, 64); err != nil {
return nil, err
} else {
*i64.field = val
}
}
}

if nc.RevisionTimeoutSeconds > nc.MaxRevisionTimeoutSeconds {
return nil, fmt.Errorf("revision-timeout-seconds (%d) cannot be greater than max-revision-timeout-seconds (%d)", nc.RevisionTimeoutSeconds, nc.MaxRevisionTimeoutSeconds)
}

if nc.ContainerConcurrency < 0 || nc.ContainerConcurrency > DefaultMaxRevisionContainerConcurrency {
return nil, apis.ErrOutOfBoundsValue(nc.ContainerConcurrency, 0, DefaultMaxRevisionContainerConcurrency, "containerConcurrency")
if nc.ContainerConcurrencyMaxLimit < 1 {
return nil, apis.ErrOutOfBoundsValue(
nc.ContainerConcurrencyMaxLimit, 1, math.MaxInt32, "container-concurrency-max-limit")
}
if nc.ContainerConcurrency < 0 || nc.ContainerConcurrency > nc.ContainerConcurrencyMaxLimit {
return nil, apis.ErrOutOfBoundsValue(
nc.ContainerConcurrency, 0, nc.ContainerConcurrencyMaxLimit, "container-concurrency")
}

// Process resource quantity fields
Expand Down Expand Up @@ -154,6 +167,10 @@ type Defaults struct {

ContainerConcurrency int64

// ContainerConcurrencyMaxLimit is the maximum permitted container concurrency
// or target value in the system.
ContainerConcurrencyMaxLimit int64

RevisionCPURequest *resource.Quantity
RevisionCPULimit *resource.Quantity
RevisionMemoryRequest *resource.Quantity
Expand Down
6 changes: 1 addition & 5 deletions vendor/knative.dev/serving/pkg/apis/networking/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const (
SKSLabelKey = GroupName + "/serverlessservice"

// ServiceTypeKey is the label key attached to a service specifying the type of service.
// e.g. Public, Metrics
// e.g. Public, Private.
ServiceTypeKey = GroupName + "/serviceType"

// OriginSecretNameLabelKey is the label key attached to the TLS secret to indicate
Expand Down Expand Up @@ -98,10 +98,6 @@ const (
// ServiceTypePublic is the label value for externally reachable
// services for user applications.
ServiceTypePublic ServiceType = "Public"
// ServiceTypeMetrics is the label value for Metrics services. Such services
// are used for metric scraping.
// TODO(5900): Remove after 0.12 is cut.
ServiceTypeMetrics ServiceType = "Metrics"
)

// Pseudo-constants
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,12 @@ func ValidateTimeoutSeconds(ctx context.Context, timeoutSeconds int64) *apis.Fie

// ValidateContainerConcurrency function validates the ContainerConcurrency field
// TODO(#5007): Move this to autoscaling.
func ValidateContainerConcurrency(containerConcurrency *int64) *apis.FieldError {
func ValidateContainerConcurrency(ctx context.Context, containerConcurrency *int64) *apis.FieldError {
if containerConcurrency != nil {
if *containerConcurrency < 0 || *containerConcurrency > config.DefaultMaxRevisionContainerConcurrency {
cfg := config.FromContextOrDefaults(ctx).Defaults
if *containerConcurrency < 0 || *containerConcurrency > cfg.ContainerConcurrencyMaxLimit {
return apis.ErrOutOfBoundsValue(
*containerConcurrency, 0, config.DefaultMaxRevisionContainerConcurrency, apis.CurrentField)
*containerConcurrency, 0, cfg.ContainerConcurrencyMaxLimit, apis.CurrentField)
}
}
return nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func (rs *RevisionSpec) Validate(ctx context.Context) *apis.FieldError {
}

if rs.ContainerConcurrency != nil {
errs = errs.Also(serving.ValidateContainerConcurrency(rs.ContainerConcurrency).ViaField("containerConcurrency"))
errs = errs.Also(serving.ValidateContainerConcurrency(ctx, rs.ContainerConcurrency).ViaField("containerConcurrency"))
}

return errs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func (rs *RevisionSpec) Validate(ctx context.Context) *apis.FieldError {
errs = errs.Also(err)
} else {
if rs.ContainerConcurrency != nil {
errs = errs.Also(serving.ValidateContainerConcurrency(rs.ContainerConcurrency).ViaField("containerConcurrency"))
errs = errs.Also(serving.ValidateContainerConcurrency(ctx, rs.ContainerConcurrency).ViaField("containerConcurrency"))
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# For help, see
# https://github.com/raviqqe/liche/blob/master/README.md

# Don't check localhost links
-x "^https?://localhost($|[:/].*)"
# Don't check localhost links and don't check templated links
-x "(^https?://localhost($|[:/].*))|(^https://.*{{.*$)"
30 changes: 22 additions & 8 deletions vendor/knative.dev/test-infra/scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -498,9 +498,30 @@ function publish_artifacts() {

# Entry point for a release script.
function main() {
parse_flags "$@"

# Checkout specific branch, if necessary
local current_branch
current_branch="$(git rev-parse --abbrev-ref HEAD)"
if [[ -n "${RELEASE_BRANCH}" && -z "${FROM_NIGHTLY_RELEASE}" && "${current_branch}" != "${RELEASE_BRANCH}" ]]; then
setup_upstream
setup_branch
# When it runs in Prow, the origin is identical with upstream, and previous
# fetch already fetched release-* branches, so no need to `checkout -b`
if (( IS_PROW )); then
git checkout "${RELEASE_BRANCH}" || abort "cannot checkout branch ${RELEASE_BRANCH}"
else
git checkout -b "${RELEASE_BRANCH}" upstream/"${RELEASE_BRANCH}" || abort "cannot checkout branch ${RELEASE_BRANCH}"
fi
# HACK HACK HACK
# Rerun the release script from the release branch. Fixes https://github.com/knative/test-infra/issues/1262
./hack/release.sh "$@"
exit "$?"
fi

function_exists build_release || abort "function 'build_release()' not defined"
[[ -x ${VALIDATION_TESTS} ]] || abort "test script '${VALIDATION_TESTS}' doesn't exist"
parse_flags "$@"

# Log what will be done and where.
banner "Release configuration"
if which gcloud &>/dev/null ; then
Expand Down Expand Up @@ -533,13 +554,6 @@ function main() {
fi
[[ -n "${RELEASE_NOTES}" ]] && echo "- Release notes are generated from '${RELEASE_NOTES}'"

# Checkout specific branch, if necessary
if [[ -n "${RELEASE_BRANCH}" && -z "${FROM_NIGHTLY_RELEASE}" ]]; then
setup_upstream
setup_branch
git checkout upstream/${RELEASE_BRANCH} || abort "cannot checkout branch ${RELEASE_BRANCH}"
fi

if [[ -n "${FROM_NIGHTLY_RELEASE}" ]]; then
build_from_nightly_release
else
Expand Down
8 changes: 4 additions & 4 deletions vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ k8s.io/kube-openapi/pkg/util/proto
k8s.io/utils/buffer
k8s.io/utils/integer
k8s.io/utils/trace
# knative.dev/eventing v0.13.1
# knative.dev/eventing v0.13.3
knative.dev/eventing/pkg/apis/config
knative.dev/eventing/pkg/apis/configs
knative.dev/eventing/pkg/apis/configs/v1alpha1
Expand Down Expand Up @@ -495,7 +495,7 @@ knative.dev/eventing/pkg/client/clientset/versioned/typed/sources/v1alpha2/fake
knative.dev/eventing/pkg/legacyclient/clientset/versioned/scheme
knative.dev/eventing/pkg/legacyclient/clientset/versioned/typed/legacysources/v1alpha1
knative.dev/eventing/pkg/logging
# knative.dev/pkg v0.0.0-20200304185554-312b1be35ceb
# knative.dev/pkg v0.0.0-20200313012929-1893541a0fac
knative.dev/pkg/apis
knative.dev/pkg/apis/duck
knative.dev/pkg/apis/duck/v1
Expand All @@ -511,7 +511,7 @@ knative.dev/pkg/logging/logkey
knative.dev/pkg/profiling
knative.dev/pkg/ptr
knative.dev/pkg/tracker
# knative.dev/serving v0.13.0
# knative.dev/serving v0.13.1-0.20200313103129-34717bfa04b0
knative.dev/serving/pkg/apis/autoscaling
knative.dev/serving/pkg/apis/autoscaling/v1alpha1
knative.dev/serving/pkg/apis/config
Expand All @@ -525,7 +525,7 @@ knative.dev/serving/pkg/autoscaler/config
knative.dev/serving/pkg/client/clientset/versioned/scheme
knative.dev/serving/pkg/client/clientset/versioned/typed/serving/v1
knative.dev/serving/pkg/client/clientset/versioned/typed/serving/v1/fake
# knative.dev/test-infra v0.0.0-20200229011351-4dac123b9a3d
# knative.dev/test-infra v0.0.0-20200312203729-3f96c9e98f31
knative.dev/test-infra/scripts
# sigs.k8s.io/kustomize v2.0.3+incompatible
sigs.k8s.io/kustomize/pkg/commands/build
Expand Down

0 comments on commit 8e74bdc

Please sign in to comment.