Skip to content

Commit

Permalink
upgrade to latest dependencies
Browse files Browse the repository at this point in the history
```
bumping knative.dev/hack 4ed1ecb...ea9c9a0:
  > ea9c9a0 Add hermetic go mod aware handling to run_go_tool (knative#38)
bumping knative.dev/networking ecb89ce...c30dc94:
  > c30dc94 Use symlink for testdata version of config-network.yaml (knative#328)
bumping knative.dev/pkg 51c72e2...93874f0:
  > 93874f0 Drainer supports customized kubelet probe check (knative#1977)
```

Signed-off-by: Knative Automation <automation@knative.team>
  • Loading branch information
knative-automation committed Jan 11, 2021
1 parent 560a4f6 commit cc7213f
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 27 deletions.
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ require (
k8s.io/code-generator v0.18.12
k8s.io/kube-openapi v0.0.0-20200410145947-bcb3869e6f29
knative.dev/caching v0.0.0-20210107021736-1ee47505018d
knative.dev/hack v0.0.0-20201214230143-4ed1ecb8db24
knative.dev/networking v0.0.0-20210107024535-ecb89ced52d9
knative.dev/pkg v0.0.0-20210107022335-51c72e24c179
knative.dev/hack v0.0.0-20210108203236-ea9c9a0cac5c
knative.dev/networking v0.0.0-20210111171437-c30dc94f1dcf
knative.dev/pkg v0.0.0-20210107211936-93874f0ea7c0
sigs.k8s.io/yaml v1.2.0
)
10 changes: 6 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1227,12 +1227,14 @@ knative.dev/caching v0.0.0-20210107021736-1ee47505018d h1:C5JgxpCO4Dv+pqUHxIS+e+
knative.dev/caching v0.0.0-20210107021736-1ee47505018d/go.mod h1:N3jOlbf/CWZsEcfEpthv5b+LB9e+TqiDTVLH/Ti+vWE=
knative.dev/hack v0.0.0-20201214230143-4ed1ecb8db24 h1:kIztWfvnIFV8Lhlea02K3YO2mIzcDyQNzrBLn0Oq9sA=
knative.dev/hack v0.0.0-20201214230143-4ed1ecb8db24/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI=
knative.dev/networking v0.0.0-20210107024535-ecb89ced52d9 h1:7SXik2ulHr7URICeDYHPVdnyuT72RW9GouJ97XRkWbo=
knative.dev/networking v0.0.0-20210107024535-ecb89ced52d9/go.mod h1:N123KICErXy+bPo1oBszM6TVYGG0Za2wMmnEqX4MlFg=
knative.dev/hack v0.0.0-20210108203236-ea9c9a0cac5c h1:B/FwfbGrZRCwujjxVzFCc1sqNcAGL5oOm0ZkSSovSU8=
knative.dev/hack v0.0.0-20210108203236-ea9c9a0cac5c/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI=
knative.dev/networking v0.0.0-20210111171437-c30dc94f1dcf h1:s55gnmWT87q0bf/hNQXGomBQrB9pyFVsoDGayT5itgg=
knative.dev/networking v0.0.0-20210111171437-c30dc94f1dcf/go.mod h1:N123KICErXy+bPo1oBszM6TVYGG0Za2wMmnEqX4MlFg=
knative.dev/pkg v0.0.0-20201224024804-27db5ac24cfb h1:XVcmpSvfDMZ5Z+1pebSm5Msq5sQey/V4NHF2+dFNU1o=
knative.dev/pkg v0.0.0-20201224024804-27db5ac24cfb/go.mod h1:hckgW978SdzPA2H5EDvRPY8xsnPuDZLJLbPf8Jte7Q0=
knative.dev/pkg v0.0.0-20210107022335-51c72e24c179 h1:lkrgrv69iUk2qhOG9symy15kJUaJZmMybSloi7C3gIw=
knative.dev/pkg v0.0.0-20210107022335-51c72e24c179/go.mod h1:hckgW978SdzPA2H5EDvRPY8xsnPuDZLJLbPf8Jte7Q0=
knative.dev/pkg v0.0.0-20210107211936-93874f0ea7c0 h1:oLySohpGJOAo7LFCKpGEn1JOtZkzZ6QS8tQ03Pgll/0=
knative.dev/pkg v0.0.0-20210107211936-93874f0ea7c0/go.mod h1:hckgW978SdzPA2H5EDvRPY8xsnPuDZLJLbPf8Jte7Q0=
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
45 changes: 29 additions & 16 deletions vendor/knative.dev/hack/library.sh
Original file line number Diff line number Diff line change
Expand Up @@ -490,24 +490,37 @@ function start_latest_eventing_sugar_controller() {
function run_go_tool() {
local tool=$2
local install_failed=0
if [[ -z "$(which ${tool})" ]]; then
local action=get
[[ $1 =~ ^[\./].* ]] && action=install
# Avoid running `go get` from root dir of the repository, as it can change go.sum and go.mod files.
# See discussions in https://github.com/golang/go/issues/27643.
if [[ ${action} == "get" && $(pwd) == "${REPO_ROOT_DIR}" ]]; then
local temp_dir="$(mktemp -d)"
# Swallow the output as we are returning the stdout in the end.
pushd "${temp_dir}" > /dev/null 2>&1
GOFLAGS="" go ${action} "$1" || install_failed=1
popd > /dev/null 2>&1
else
GOFLAGS="" go ${action} "$1" || install_failed=1
local run=$1

if [[ "$(basename $1)" != "$2" ]]; then
echo "Assuming tool is in package $2"
run="${run}/$2"
fi

if [[ -z "$(go list -mod=readonly -f '{{.Module.Version}}' $1)" ]]; then
echo "Tool $1/$2 is not included in hack/tools.go, falling back to non-hermetic install (via GOPATH)."
if [[ -z "$(which ${tool})" ]]; then
local action=get
[[ $1 =~ ^[\./].* ]] && action=install
# Avoid running `go get` from root dir of the repository, as it can change go.sum and go.mod files.
# See discussions in https://github.com/golang/go/issues/27643.
if [[ ${action} == "get" && $(pwd) == "${REPO_ROOT_DIR}" ]]; then
local temp_dir="$(mktemp -d)"
# Swallow the output as we are returning the stdout in the end.
pushd "${temp_dir}" > /dev/null 2>&1
GOFLAGS="" go ${action} "$1" || install_failed=1
popd > /dev/null 2>&1
else
GOFLAGS="" go ${action} "$1" || install_failed=1
fi
fi
(( install_failed )) && return ${install_failed}
shift 2
${tool} "$@"
else
shift 2
GOFLAGS="-mod=vendor" go run "${run}" "$@"
fi
(( install_failed )) && return ${install_failed}
shift 2
${tool} "$@"
}

# Add function call to trap
Expand Down
9 changes: 8 additions & 1 deletion vendor/knative.dev/pkg/network/handlers/drain.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ var newTimer = func(d time.Duration) timer {
}

// Drainer wraps an inner http.Handler to support responding to kubelet
// probes and KProbes with a "200 OK" until the handler is told to Drain.
// probes and KProbes with a "200 OK" until the handler is told to Drain,
// or Drainer will optionally run the HealthCheck if it is defined.
// When the Drainer is told to Drain, it will immediately start to fail
// probes with a "500 shutting down", and the call will block until no
// requests have been received for QuietPeriod (defaults to
Expand All @@ -56,6 +57,10 @@ type Drainer struct {
// Mutex guards the initialization and resets of the timer
sync.RWMutex

// HealthCheck is an optional health check that is performed until the drain signal is received.
// When unspecified, a "200 OK" is returned, otherwise this function is invoked.
HealthCheck http.HandlerFunc

// Inner is the http.Handler to which we delegate actual requests.
Inner http.Handler

Expand All @@ -78,6 +83,8 @@ func (d *Drainer) ServeHTTP(w http.ResponseWriter, r *http.Request) {
if network.IsKubeletProbe(r) { // Respond to probes regardless of path.
if d.draining() {
http.Error(w, "shutting down", http.StatusServiceUnavailable)
} else if d.HealthCheck != nil {
d.HealthCheck(w, r)
} else {
w.WriteHeader(http.StatusOK)
}
Expand Down
6 changes: 3 additions & 3 deletions vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -984,11 +984,11 @@ knative.dev/caching/pkg/client/injection/informers/caching/v1alpha1/image/fake
knative.dev/caching/pkg/client/injection/informers/factory
knative.dev/caching/pkg/client/injection/informers/factory/fake
knative.dev/caching/pkg/client/listers/caching/v1alpha1
# knative.dev/hack v0.0.0-20201214230143-4ed1ecb8db24
# knative.dev/hack v0.0.0-20210108203236-ea9c9a0cac5c
## explicit
knative.dev/hack
knative.dev/hack/shell
# knative.dev/networking v0.0.0-20210107024535-ecb89ced52d9
# knative.dev/networking v0.0.0-20210111171437-c30dc94f1dcf
## explicit
knative.dev/networking/config
knative.dev/networking/pkg
Expand Down Expand Up @@ -1022,7 +1022,7 @@ knative.dev/networking/test/conformance/ingress
knative.dev/networking/test/defaultsystem
knative.dev/networking/test/test_images/grpc-ping/proto
knative.dev/networking/test/types
# knative.dev/pkg v0.0.0-20210107022335-51c72e24c179
# knative.dev/pkg v0.0.0-20210107211936-93874f0ea7c0
## explicit
knative.dev/pkg/apiextensions/storageversion
knative.dev/pkg/apiextensions/storageversion/cmd/migrate
Expand Down

0 comments on commit cc7213f

Please sign in to comment.