mirror of https://github.com/knative/client.git
client release v0.20.0 prep (#1189)
* Update deps for release v0.20.0 * Update version command * Update CHANGELOG * Run tests against serving and eventing v0.20.0 * Run tests against serving and eventing v0.20.0
This commit is contained in:
parent
c795f2131d
commit
174e41b628
|
|
@ -12,7 +12,7 @@
|
||||||
| https://github.com/knative/client/pull/[#]
|
| https://github.com/knative/client/pull/[#]
|
||||||
////
|
////
|
||||||
|
|
||||||
### Unreleased
|
## v0.20.0 (2021-01-14)
|
||||||
[cols="1,10,3", options="header", width="100%"]
|
[cols="1,10,3", options="header", width="100%"]
|
||||||
|===
|
|===
|
||||||
| | Description | PR
|
| | Description | PR
|
||||||
|
|
|
||||||
18
go.mod
18
go.mod
|
|
@ -19,23 +19,25 @@ require (
|
||||||
gotest.tools v2.2.0+incompatible
|
gotest.tools v2.2.0+incompatible
|
||||||
k8s.io/api v0.18.12
|
k8s.io/api v0.18.12
|
||||||
k8s.io/apimachinery v0.18.12
|
k8s.io/apimachinery v0.18.12
|
||||||
k8s.io/cli-runtime v0.18.8
|
k8s.io/cli-runtime v0.18.12
|
||||||
k8s.io/client-go v11.0.1-0.20190805182717-6502b5e7b1b5+incompatible
|
k8s.io/client-go v11.0.1-0.20190805182717-6502b5e7b1b5+incompatible
|
||||||
k8s.io/code-generator v0.18.12
|
k8s.io/code-generator v0.18.12
|
||||||
knative.dev/eventing v0.19.1-0.20210108160436-37837062208b
|
knative.dev/eventing v0.20.0
|
||||||
knative.dev/hack v0.0.0-20201214230143-4ed1ecb8db24
|
knative.dev/hack v0.0.0-20201214230143-4ed1ecb8db24
|
||||||
knative.dev/networking v0.0.0-20210107024535-ecb89ced52d9
|
knative.dev/networking v0.0.0-20210107024535-ecb89ced52d9
|
||||||
knative.dev/pkg v0.0.0-20210107022335-51c72e24c179
|
knative.dev/pkg v0.0.0-20210107022335-51c72e24c179
|
||||||
knative.dev/serving v0.19.1-0.20210111022736-4b3e6fea2778
|
knative.dev/serving v0.20.0
|
||||||
sigs.k8s.io/yaml v1.2.0
|
sigs.k8s.io/yaml v1.2.0
|
||||||
)
|
)
|
||||||
|
|
||||||
// Temporary pinning certain libraries. Please check periodically, whether these are still needed
|
// Temporary pinning certain libraries. Please check periodically, whether these are still needed
|
||||||
// ----------------------------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------------------------
|
||||||
replace (
|
replace (
|
||||||
k8s.io/api => k8s.io/api v0.18.8
|
k8s.io/api => k8s.io/api v0.18.12
|
||||||
k8s.io/apimachinery => k8s.io/apimachinery v0.18.8
|
k8s.io/apimachinery => k8s.io/apimachinery v0.18.12
|
||||||
k8s.io/cli-runtime => k8s.io/cli-runtime v0.18.8
|
k8s.io/cli-runtime => k8s.io/cli-runtime v0.18.12
|
||||||
k8s.io/client-go => k8s.io/client-go v0.18.8
|
k8s.io/client-go => k8s.io/client-go v0.18.12
|
||||||
k8s.io/code-generator => k8s.io/code-generator v0.18.8
|
k8s.io/code-generator => k8s.io/code-generator v0.18.12
|
||||||
)
|
)
|
||||||
|
|
||||||
|
replace k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.18.12
|
||||||
|
|
|
||||||
28
go.sum
28
go.sum
|
|
@ -1221,20 +1221,20 @@ honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9
|
||||||
honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
|
honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
|
||||||
honnef.co/go/tools v0.0.1-2020.1.5 h1:nI5egYTGJakVyOryqLs1cQO5dO0ksin5XXs2pspk75k=
|
honnef.co/go/tools v0.0.1-2020.1.5 h1:nI5egYTGJakVyOryqLs1cQO5dO0ksin5XXs2pspk75k=
|
||||||
honnef.co/go/tools v0.0.1-2020.1.5/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
|
honnef.co/go/tools v0.0.1-2020.1.5/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
|
||||||
k8s.io/api v0.18.8 h1:aIKUzJPb96f3fKec2lxtY7acZC9gQNDLVhfSGpxBAC4=
|
k8s.io/api v0.18.12 h1:97X6znOXMVgCKivTAgpBXGBGlCe3gbM++yFdldgBCaE=
|
||||||
k8s.io/api v0.18.8/go.mod h1:d/CXqwWv+Z2XEG1LgceeDmHQwpUJhROPx16SlxJgERY=
|
k8s.io/api v0.18.12/go.mod h1:3sS78jmUoGHwERyMbEhxP6owcQ77UxGo+Yy+dKNWrh0=
|
||||||
k8s.io/apiextensions-apiserver v0.18.12/go.mod h1:nihADkPed1L37Vxpz2/BrtxO9mCtINH23aNtUe/CRLo=
|
k8s.io/apiextensions-apiserver v0.18.12/go.mod h1:nihADkPed1L37Vxpz2/BrtxO9mCtINH23aNtUe/CRLo=
|
||||||
k8s.io/apimachinery v0.18.8 h1:jimPrycCqgx2QPearX3to1JePz7wSbVLq+7PdBTTwQ0=
|
k8s.io/apimachinery v0.18.12 h1:bLFXU4IxOu06F6Z6PV7eqtapXFb1G2q0ni0XBNFtJH8=
|
||||||
k8s.io/apimachinery v0.18.8/go.mod h1:6sQd+iHEqmOtALqOFjSWp2KZ9F0wlU/nWm0ZgsYWMig=
|
k8s.io/apimachinery v0.18.12/go.mod h1:PF5taHbXgTEJLU+xMypMmYTXTWPJ5LaW8bfsisxnEXk=
|
||||||
k8s.io/apiserver v0.18.8/go.mod h1:12u5FuGql8Cc497ORNj79rhPdiXQC4bf53X/skR/1YM=
|
k8s.io/apiserver v0.18.8/go.mod h1:12u5FuGql8Cc497ORNj79rhPdiXQC4bf53X/skR/1YM=
|
||||||
k8s.io/apiserver v0.18.12/go.mod h1:uFOeW4LlxS6KDgLWy3n3gh0DhC6m41QIFgL33ouk+4w=
|
k8s.io/apiserver v0.18.12/go.mod h1:uFOeW4LlxS6KDgLWy3n3gh0DhC6m41QIFgL33ouk+4w=
|
||||||
k8s.io/cli-runtime v0.18.8 h1:ycmbN3hs7CfkJIYxJAOB10iW7BVPmXGXkfEyiV9NJ+k=
|
k8s.io/cli-runtime v0.18.12 h1:gVWbvntlEttCIvy1jc5UUr2cG/4TmmCM1MY/PGeENBo=
|
||||||
k8s.io/cli-runtime v0.18.8/go.mod h1:7EzWiDbS9PFd0hamHHVoCY4GrokSTPSL32MA4rzIu0M=
|
k8s.io/cli-runtime v0.18.12/go.mod h1:wTj8W8za8NDWe505mrlckiZ5H2cZA0YEuv0E7WC+Srs=
|
||||||
k8s.io/client-go v0.18.8 h1:SdbLpIxk5j5YbFr1b7fq8S7mDgDjYmUxSbszyoesoDM=
|
k8s.io/client-go v0.18.12 h1:MDGRE2tGidz29g45dI4kfelJo+aRmDqWx0Way8mD88A=
|
||||||
k8s.io/client-go v0.18.8/go.mod h1:HqFqMllQ5NnQJNwjro9k5zMyfhZlOwpuTLVrxjkYSxU=
|
k8s.io/client-go v0.18.12/go.mod h1:0aC8XkA09dX/goYqHQJ/kVv0zL1t+weOZt3pmz9LpxA=
|
||||||
k8s.io/cloud-provider v0.18.8/go.mod h1:cn9AlzMPVIXA4HHLVbgGUigaQlZyHSZ7WAwDEFNrQSs=
|
k8s.io/cloud-provider v0.18.8/go.mod h1:cn9AlzMPVIXA4HHLVbgGUigaQlZyHSZ7WAwDEFNrQSs=
|
||||||
k8s.io/code-generator v0.18.8 h1:lgO1P1wjikEtzNvj7ia+x1VC4svJ28a/r0wnOLhhOTU=
|
k8s.io/code-generator v0.18.12 h1:/cSUfqlYZ90y0WDxxWfwfTXUGkJer2Gt1L3AIaVvviQ=
|
||||||
k8s.io/code-generator v0.18.8/go.mod h1:TgNEVx9hCyPGpdtCWA34olQYLkh3ok9ar7XfSsr8b6c=
|
k8s.io/code-generator v0.18.12/go.mod h1:TgNEVx9hCyPGpdtCWA34olQYLkh3ok9ar7XfSsr8b6c=
|
||||||
k8s.io/component-base v0.18.8/go.mod h1:00frPRDas29rx58pPCxNkhUfPbwajlyyvu8ruNgSErU=
|
k8s.io/component-base v0.18.8/go.mod h1:00frPRDas29rx58pPCxNkhUfPbwajlyyvu8ruNgSErU=
|
||||||
k8s.io/component-base v0.18.12/go.mod h1:pRGKXsx2KWfsJqlDi4sbCc1jpaB87rXIIqupjhr5wj0=
|
k8s.io/component-base v0.18.12/go.mod h1:pRGKXsx2KWfsJqlDi4sbCc1jpaB87rXIIqupjhr5wj0=
|
||||||
k8s.io/csi-translation-lib v0.18.8/go.mod h1:6cA6Btlzxy9s3QrS4BCZzQqclIWnTLr6Jx3H2ctAzY4=
|
k8s.io/csi-translation-lib v0.18.8/go.mod h1:6cA6Btlzxy9s3QrS4BCZzQqclIWnTLr6Jx3H2ctAzY4=
|
||||||
|
|
@ -1256,8 +1256,8 @@ k8s.io/utils v0.0.0-20200324210504-a9aa75ae1b89/go.mod h1:sZAwmy6armz5eXlNoLmJcl
|
||||||
k8s.io/utils v0.0.0-20200603063816-c1c6865ac451 h1:v8ud2Up6QK1lNOKFgiIVrZdMg7MpmSnvtrOieolJKoE=
|
k8s.io/utils v0.0.0-20200603063816-c1c6865ac451 h1:v8ud2Up6QK1lNOKFgiIVrZdMg7MpmSnvtrOieolJKoE=
|
||||||
k8s.io/utils v0.0.0-20200603063816-c1c6865ac451/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
|
k8s.io/utils v0.0.0-20200603063816-c1c6865ac451/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
|
||||||
knative.dev/caching v0.0.0-20210107021736-1ee47505018d/go.mod h1:N3jOlbf/CWZsEcfEpthv5b+LB9e+TqiDTVLH/Ti+vWE=
|
knative.dev/caching v0.0.0-20210107021736-1ee47505018d/go.mod h1:N3jOlbf/CWZsEcfEpthv5b+LB9e+TqiDTVLH/Ti+vWE=
|
||||||
knative.dev/eventing v0.19.1-0.20210108160436-37837062208b h1:Chk9wplWhETp2Kz6WHyjGES8BBWWIV3AExoL1GbBVQc=
|
knative.dev/eventing v0.20.0 h1:CtW8JYds0gvaiCWvoeX6zHbm8Jbfwu3hieyCTNudNnk=
|
||||||
knative.dev/eventing v0.19.1-0.20210108160436-37837062208b/go.mod h1:7KjOHRQTPqsH0y1NbQLnboZeWJWVTztQVd/0lFCmz7A=
|
knative.dev/eventing v0.20.0/go.mod h1:7KjOHRQTPqsH0y1NbQLnboZeWJWVTztQVd/0lFCmz7A=
|
||||||
knative.dev/hack v0.0.0-20201214230143-4ed1ecb8db24 h1:kIztWfvnIFV8Lhlea02K3YO2mIzcDyQNzrBLn0Oq9sA=
|
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/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 h1:7SXik2ulHr7URICeDYHPVdnyuT72RW9GouJ97XRkWbo=
|
||||||
|
|
@ -1266,8 +1266,8 @@ knative.dev/pkg v0.0.0-20201224024804-27db5ac24cfb/go.mod h1:hckgW978SdzPA2H5EDv
|
||||||
knative.dev/pkg v0.0.0-20210107022335-51c72e24c179 h1:lkrgrv69iUk2qhOG9symy15kJUaJZmMybSloi7C3gIw=
|
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-20210107022335-51c72e24c179/go.mod h1:hckgW978SdzPA2H5EDvRPY8xsnPuDZLJLbPf8Jte7Q0=
|
||||||
knative.dev/reconciler-test v0.0.0-20210108100436-db4d65735605/go.mod h1:rmQpZseeqDpg6/ToFzIeV5hTRkOJujaXBCK7iYL7M4E=
|
knative.dev/reconciler-test v0.0.0-20210108100436-db4d65735605/go.mod h1:rmQpZseeqDpg6/ToFzIeV5hTRkOJujaXBCK7iYL7M4E=
|
||||||
knative.dev/serving v0.19.1-0.20210111022736-4b3e6fea2778 h1:Wb84kuFqxzt/DLFnU5FKzuSIceYeZTdpAX3dBCNC15I=
|
knative.dev/serving v0.20.0 h1:bxnmLCrwXDESqM4J1d8uKdl1XUQOq1DnHEVl6Ottnwo=
|
||||||
knative.dev/serving v0.19.1-0.20210111022736-4b3e6fea2778/go.mod h1:357cOGGPTY1aNqbDeyr35/LvYn1yc0WCe0EQLTNN8Mc=
|
knative.dev/serving v0.20.0/go.mod h1:357cOGGPTY1aNqbDeyr35/LvYn1yc0WCe0EQLTNN8Mc=
|
||||||
pgregory.net/rapid v0.3.3/go.mod h1:UYpPVyjFHzYBGHIxLFoupi8vwk6rXNzRY9OMvVxFIOU=
|
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/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
|
||||||
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
|
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ set -o nounset
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
export GO111MODULE=on
|
export GO111MODULE=on
|
||||||
export K8S_VERSION="${1:-v0.18.8}"
|
export K8S_VERSION="${1:-v0.18.12}"
|
||||||
|
|
||||||
K8S_DEPS=(
|
K8S_DEPS=(
|
||||||
"k8s.io/api"
|
"k8s.io/api"
|
||||||
|
|
|
||||||
|
|
@ -31,11 +31,11 @@ var GitRevision string
|
||||||
// update this var as we add more deps
|
// update this var as we add more deps
|
||||||
var apiVersions = map[string][]string{
|
var apiVersions = map[string][]string{
|
||||||
"serving": {
|
"serving": {
|
||||||
"serving.knative.dev/v1 (knative-serving v0.19.0)",
|
"serving.knative.dev/v1 (knative-serving v0.20.0)",
|
||||||
},
|
},
|
||||||
"eventing": {
|
"eventing": {
|
||||||
"sources.knative.dev/v1alpha2 (knative-eventing v0.19.0)",
|
"sources.knative.dev/v1alpha2 (knative-eventing v0.20.0)",
|
||||||
"eventing.knative.dev/v1beta1 (knative-eventing v0.19.0)",
|
"eventing.knative.dev/v1beta1 (knative-eventing v0.20.0)",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
# This script is used in Knative/test-infra as a custom prow job to run the
|
# This script is used in Knative/test-infra as a custom prow job to run the
|
||||||
# integration tests against Knative Serving / Eventing of a specific version.
|
# integration tests against Knative Serving / Eventing of a specific version.
|
||||||
|
|
||||||
export KNATIVE_SERVING_VERSION="0.19.0"
|
export KNATIVE_SERVING_VERSION="0.20.0"
|
||||||
export KNATIVE_EVENTING_VERSION="0.19.1"
|
export KNATIVE_EVENTING_VERSION="0.20.0"
|
||||||
|
|
||||||
$(dirname $0)/presubmit-tests.sh --integration-tests
|
$(dirname $0)/presubmit-tests.sh --integration-tests
|
||||||
|
|
|
||||||
|
|
@ -138,11 +138,11 @@ func (c *controller) Run(stopCh <-chan struct{}) {
|
||||||
c.reflectorMutex.Unlock()
|
c.reflectorMutex.Unlock()
|
||||||
|
|
||||||
var wg wait.Group
|
var wg wait.Group
|
||||||
defer wg.Wait()
|
|
||||||
|
|
||||||
wg.StartWithChannel(stopCh, r.Run)
|
wg.StartWithChannel(stopCh, r.Run)
|
||||||
|
|
||||||
wait.Until(c.processLoop, time.Second, stopCh)
|
wait.Until(c.processLoop, time.Second, stopCh)
|
||||||
|
wg.Wait()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns true once this controller has completed an initial resource listing
|
// Returns true once this controller has completed an initial resource listing
|
||||||
|
|
|
||||||
|
|
@ -551,5 +551,26 @@ func isExpiredError(err error) bool {
|
||||||
}
|
}
|
||||||
|
|
||||||
func isTooLargeResourceVersionError(err error) bool {
|
func isTooLargeResourceVersionError(err error) bool {
|
||||||
return apierrors.HasStatusCause(err, metav1.CauseTypeResourceVersionTooLarge)
|
if apierrors.HasStatusCause(err, metav1.CauseTypeResourceVersionTooLarge) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
// In Kubernetes 1.17.0-1.18.5, the api server doesn't set the error status cause to
|
||||||
|
// metav1.CauseTypeResourceVersionTooLarge to indicate that the requested minimum resource
|
||||||
|
// version is larger than the largest currently available resource version. To ensure backward
|
||||||
|
// compatibility with these server versions we also need to detect the error based on the content
|
||||||
|
// of the error message field.
|
||||||
|
if !apierrors.IsTimeout(err) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
apierr, ok := err.(apierrors.APIStatus)
|
||||||
|
if !ok || apierr == nil || apierr.Status().Details == nil {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
for _, cause := range apierr.Status().Details.Causes {
|
||||||
|
// Matches the message returned by api server 1.17.0-1.18.5 for this error condition
|
||||||
|
if cause.Message == "Too large resource version" {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -289,8 +289,12 @@ func (le *LeaderElector) release() bool {
|
||||||
if !le.IsLeader() {
|
if !le.IsLeader() {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
now := metav1.Now()
|
||||||
leaderElectionRecord := rl.LeaderElectionRecord{
|
leaderElectionRecord := rl.LeaderElectionRecord{
|
||||||
LeaderTransitions: le.observedRecord.LeaderTransitions,
|
LeaderTransitions: le.observedRecord.LeaderTransitions,
|
||||||
|
LeaseDurationSeconds: 1,
|
||||||
|
RenewTime: now,
|
||||||
|
AcquireTime: now,
|
||||||
}
|
}
|
||||||
if err := le.config.Lock.Update(context.TODO(), leaderElectionRecord); err != nil {
|
if err := le.config.Lock.Update(context.TODO(), leaderElectionRecord); err != nil {
|
||||||
klog.Errorf("Failed to release lock: %v", err)
|
klog.Errorf("Failed to release lock: %v", err)
|
||||||
|
|
|
||||||
|
|
@ -92,8 +92,12 @@ func (cml *ConfigMapLock) Update(ctx context.Context, ler LeaderElectionRecord)
|
||||||
cml.cm.Annotations = make(map[string]string)
|
cml.cm.Annotations = make(map[string]string)
|
||||||
}
|
}
|
||||||
cml.cm.Annotations[LeaderElectionRecordAnnotationKey] = string(recordBytes)
|
cml.cm.Annotations[LeaderElectionRecordAnnotationKey] = string(recordBytes)
|
||||||
cml.cm, err = cml.Client.ConfigMaps(cml.ConfigMapMeta.Namespace).Update(ctx, cml.cm, metav1.UpdateOptions{})
|
cm, err := cml.Client.ConfigMaps(cml.ConfigMapMeta.Namespace).Update(ctx, cml.cm, metav1.UpdateOptions{})
|
||||||
return err
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
cml.cm = cm
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// RecordEvent in leader election while adding meta-data
|
// RecordEvent in leader election while adding meta-data
|
||||||
|
|
|
||||||
|
|
@ -87,8 +87,12 @@ func (el *EndpointsLock) Update(ctx context.Context, ler LeaderElectionRecord) e
|
||||||
el.e.Annotations = make(map[string]string)
|
el.e.Annotations = make(map[string]string)
|
||||||
}
|
}
|
||||||
el.e.Annotations[LeaderElectionRecordAnnotationKey] = string(recordBytes)
|
el.e.Annotations[LeaderElectionRecordAnnotationKey] = string(recordBytes)
|
||||||
el.e, err = el.Client.Endpoints(el.EndpointsMeta.Namespace).Update(ctx, el.e, metav1.UpdateOptions{})
|
e, err := el.Client.Endpoints(el.EndpointsMeta.Namespace).Update(ctx, el.e, metav1.UpdateOptions{})
|
||||||
return err
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
el.e = e
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// RecordEvent in leader election while adding meta-data
|
// RecordEvent in leader election while adding meta-data
|
||||||
|
|
|
||||||
|
|
@ -71,9 +71,14 @@ func (ll *LeaseLock) Update(ctx context.Context, ler LeaderElectionRecord) error
|
||||||
return errors.New("lease not initialized, call get or create first")
|
return errors.New("lease not initialized, call get or create first")
|
||||||
}
|
}
|
||||||
ll.lease.Spec = LeaderElectionRecordToLeaseSpec(&ler)
|
ll.lease.Spec = LeaderElectionRecordToLeaseSpec(&ler)
|
||||||
var err error
|
|
||||||
ll.lease, err = ll.Client.Leases(ll.LeaseMeta.Namespace).Update(ctx, ll.lease, metav1.UpdateOptions{})
|
lease, err := ll.Client.Leases(ll.LeaseMeta.Namespace).Update(ctx, ll.lease, metav1.UpdateOptions{})
|
||||||
return err
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
ll.lease = lease
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// RecordEvent in leader election while adding meta-data
|
// RecordEvent in leader election while adding meta-data
|
||||||
|
|
|
||||||
|
|
@ -47,10 +47,8 @@ type tlsCacheKey struct {
|
||||||
keyData string
|
keyData string
|
||||||
certFile string
|
certFile string
|
||||||
keyFile string
|
keyFile string
|
||||||
getCert string
|
|
||||||
serverName string
|
serverName string
|
||||||
nextProtos string
|
nextProtos string
|
||||||
dial string
|
|
||||||
disableCompression bool
|
disableCompression bool
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -59,22 +57,24 @@ func (t tlsCacheKey) String() string {
|
||||||
if len(t.keyData) > 0 {
|
if len(t.keyData) > 0 {
|
||||||
keyText = "<redacted>"
|
keyText = "<redacted>"
|
||||||
}
|
}
|
||||||
return fmt.Sprintf("insecure:%v, caData:%#v, certData:%#v, keyData:%s, getCert: %s, serverName:%s, dial:%s disableCompression:%t", t.insecure, t.caData, t.certData, keyText, t.getCert, t.serverName, t.dial, t.disableCompression)
|
return fmt.Sprintf("insecure:%v, caData:%#v, certData:%#v, keyData:%s, serverName:%s, disableCompression:%t", t.insecure, t.caData, t.certData, keyText, t.serverName, t.disableCompression)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *tlsTransportCache) get(config *Config) (http.RoundTripper, error) {
|
func (c *tlsTransportCache) get(config *Config) (http.RoundTripper, error) {
|
||||||
key, err := tlsConfigKey(config)
|
key, canCache, err := tlsConfigKey(config)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ensure we only create a single transport for the given TLS options
|
if canCache {
|
||||||
c.mu.Lock()
|
// Ensure we only create a single transport for the given TLS options
|
||||||
defer c.mu.Unlock()
|
c.mu.Lock()
|
||||||
|
defer c.mu.Unlock()
|
||||||
|
|
||||||
// See if we already have a custom transport for this config
|
// See if we already have a custom transport for this config
|
||||||
if t, ok := c.transports[key]; ok {
|
if t, ok := c.transports[key]; ok {
|
||||||
return t, nil
|
return t, nil
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the TLS options for this client config
|
// Get the TLS options for this client config
|
||||||
|
|
@ -104,8 +104,7 @@ func (c *tlsTransportCache) get(config *Config) (http.RoundTripper, error) {
|
||||||
go dynamicCertDialer.Run(wait.NeverStop)
|
go dynamicCertDialer.Run(wait.NeverStop)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cache a single transport for these options
|
transport := utilnet.SetTransportDefaults(&http.Transport{
|
||||||
c.transports[key] = utilnet.SetTransportDefaults(&http.Transport{
|
|
||||||
Proxy: http.ProxyFromEnvironment,
|
Proxy: http.ProxyFromEnvironment,
|
||||||
TLSHandshakeTimeout: 10 * time.Second,
|
TLSHandshakeTimeout: 10 * time.Second,
|
||||||
TLSClientConfig: tlsConfig,
|
TLSClientConfig: tlsConfig,
|
||||||
|
|
@ -113,22 +112,32 @@ func (c *tlsTransportCache) get(config *Config) (http.RoundTripper, error) {
|
||||||
DialContext: dial,
|
DialContext: dial,
|
||||||
DisableCompression: config.DisableCompression,
|
DisableCompression: config.DisableCompression,
|
||||||
})
|
})
|
||||||
return c.transports[key], nil
|
|
||||||
|
if canCache {
|
||||||
|
// Cache a single transport for these options
|
||||||
|
c.transports[key] = transport
|
||||||
|
}
|
||||||
|
|
||||||
|
return transport, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// tlsConfigKey returns a unique key for tls.Config objects returned from TLSConfigFor
|
// tlsConfigKey returns a unique key for tls.Config objects returned from TLSConfigFor
|
||||||
func tlsConfigKey(c *Config) (tlsCacheKey, error) {
|
func tlsConfigKey(c *Config) (tlsCacheKey, bool, error) {
|
||||||
// Make sure ca/key/cert content is loaded
|
// Make sure ca/key/cert content is loaded
|
||||||
if err := loadTLSFiles(c); err != nil {
|
if err := loadTLSFiles(c); err != nil {
|
||||||
return tlsCacheKey{}, err
|
return tlsCacheKey{}, false, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if c.TLS.GetCert != nil || c.Dial != nil {
|
||||||
|
// cannot determine equality for functions
|
||||||
|
return tlsCacheKey{}, false, nil
|
||||||
|
}
|
||||||
|
|
||||||
k := tlsCacheKey{
|
k := tlsCacheKey{
|
||||||
insecure: c.TLS.Insecure,
|
insecure: c.TLS.Insecure,
|
||||||
caData: string(c.TLS.CAData),
|
caData: string(c.TLS.CAData),
|
||||||
getCert: fmt.Sprintf("%p", c.TLS.GetCert),
|
|
||||||
serverName: c.TLS.ServerName,
|
serverName: c.TLS.ServerName,
|
||||||
nextProtos: strings.Join(c.TLS.NextProtos, ","),
|
nextProtos: strings.Join(c.TLS.NextProtos, ","),
|
||||||
dial: fmt.Sprintf("%p", c.Dial),
|
|
||||||
disableCompression: c.DisableCompression,
|
disableCompression: c.DisableCompression,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -140,5 +149,5 @@ func tlsConfigKey(c *Config) (tlsCacheKey, error) {
|
||||||
k.keyData = string(c.TLS.KeyData)
|
k.keyData = string(c.TLS.KeyData)
|
||||||
}
|
}
|
||||||
|
|
||||||
return k, nil
|
return k, true, nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -506,7 +506,7 @@ gotest.tools/assert/cmp
|
||||||
gotest.tools/internal/difflib
|
gotest.tools/internal/difflib
|
||||||
gotest.tools/internal/format
|
gotest.tools/internal/format
|
||||||
gotest.tools/internal/source
|
gotest.tools/internal/source
|
||||||
# k8s.io/api v0.18.12 => k8s.io/api v0.18.8
|
# k8s.io/api v0.18.12 => k8s.io/api v0.18.12
|
||||||
## explicit
|
## explicit
|
||||||
k8s.io/api/admissionregistration/v1
|
k8s.io/api/admissionregistration/v1
|
||||||
k8s.io/api/admissionregistration/v1beta1
|
k8s.io/api/admissionregistration/v1beta1
|
||||||
|
|
@ -548,7 +548,7 @@ k8s.io/api/settings/v1alpha1
|
||||||
k8s.io/api/storage/v1
|
k8s.io/api/storage/v1
|
||||||
k8s.io/api/storage/v1alpha1
|
k8s.io/api/storage/v1alpha1
|
||||||
k8s.io/api/storage/v1beta1
|
k8s.io/api/storage/v1beta1
|
||||||
# k8s.io/apimachinery v0.18.12 => k8s.io/apimachinery v0.18.8
|
# k8s.io/apimachinery v0.18.12 => k8s.io/apimachinery v0.18.12
|
||||||
## explicit
|
## explicit
|
||||||
k8s.io/apimachinery/pkg/api/equality
|
k8s.io/apimachinery/pkg/api/equality
|
||||||
k8s.io/apimachinery/pkg/api/errors
|
k8s.io/apimachinery/pkg/api/errors
|
||||||
|
|
@ -599,7 +599,7 @@ k8s.io/apimachinery/pkg/version
|
||||||
k8s.io/apimachinery/pkg/watch
|
k8s.io/apimachinery/pkg/watch
|
||||||
k8s.io/apimachinery/third_party/forked/golang/json
|
k8s.io/apimachinery/third_party/forked/golang/json
|
||||||
k8s.io/apimachinery/third_party/forked/golang/reflect
|
k8s.io/apimachinery/third_party/forked/golang/reflect
|
||||||
# k8s.io/cli-runtime v0.18.8 => k8s.io/cli-runtime v0.18.8
|
# k8s.io/cli-runtime v0.18.12 => k8s.io/cli-runtime v0.18.12
|
||||||
## explicit
|
## explicit
|
||||||
k8s.io/cli-runtime/pkg/genericclioptions
|
k8s.io/cli-runtime/pkg/genericclioptions
|
||||||
k8s.io/cli-runtime/pkg/kustomize
|
k8s.io/cli-runtime/pkg/kustomize
|
||||||
|
|
@ -613,7 +613,7 @@ k8s.io/cli-runtime/pkg/kustomize/k8sdeps/transformer/patch
|
||||||
k8s.io/cli-runtime/pkg/kustomize/k8sdeps/validator
|
k8s.io/cli-runtime/pkg/kustomize/k8sdeps/validator
|
||||||
k8s.io/cli-runtime/pkg/printers
|
k8s.io/cli-runtime/pkg/printers
|
||||||
k8s.io/cli-runtime/pkg/resource
|
k8s.io/cli-runtime/pkg/resource
|
||||||
# k8s.io/client-go v11.0.1-0.20190805182717-6502b5e7b1b5+incompatible => k8s.io/client-go v0.18.8
|
# k8s.io/client-go v11.0.1-0.20190805182717-6502b5e7b1b5+incompatible => k8s.io/client-go v0.18.12
|
||||||
## explicit
|
## explicit
|
||||||
k8s.io/client-go/discovery
|
k8s.io/client-go/discovery
|
||||||
k8s.io/client-go/discovery/cached/disk
|
k8s.io/client-go/discovery/cached/disk
|
||||||
|
|
@ -695,7 +695,7 @@ k8s.io/client-go/util/jsonpath
|
||||||
k8s.io/client-go/util/keyutil
|
k8s.io/client-go/util/keyutil
|
||||||
k8s.io/client-go/util/retry
|
k8s.io/client-go/util/retry
|
||||||
k8s.io/client-go/util/workqueue
|
k8s.io/client-go/util/workqueue
|
||||||
# k8s.io/code-generator v0.18.12 => k8s.io/code-generator v0.18.8
|
# k8s.io/code-generator v0.18.12 => k8s.io/code-generator v0.18.12
|
||||||
## explicit
|
## explicit
|
||||||
k8s.io/code-generator
|
k8s.io/code-generator
|
||||||
k8s.io/code-generator/cmd/client-gen
|
k8s.io/code-generator/cmd/client-gen
|
||||||
|
|
@ -756,7 +756,7 @@ k8s.io/kube-openapi/pkg/util/sets
|
||||||
k8s.io/utils/buffer
|
k8s.io/utils/buffer
|
||||||
k8s.io/utils/integer
|
k8s.io/utils/integer
|
||||||
k8s.io/utils/trace
|
k8s.io/utils/trace
|
||||||
# knative.dev/eventing v0.19.1-0.20210108160436-37837062208b
|
# knative.dev/eventing v0.20.0
|
||||||
## explicit
|
## explicit
|
||||||
knative.dev/eventing/pkg/apis/config
|
knative.dev/eventing/pkg/apis/config
|
||||||
knative.dev/eventing/pkg/apis/configs
|
knative.dev/eventing/pkg/apis/configs
|
||||||
|
|
@ -838,7 +838,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.19.1-0.20210111022736-4b3e6fea2778
|
# knative.dev/serving v0.20.0
|
||||||
## explicit
|
## explicit
|
||||||
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
|
||||||
|
|
@ -889,8 +889,9 @@ sigs.k8s.io/structured-merge-diff/v3/value
|
||||||
# sigs.k8s.io/yaml v1.2.0
|
# sigs.k8s.io/yaml v1.2.0
|
||||||
## explicit
|
## explicit
|
||||||
sigs.k8s.io/yaml
|
sigs.k8s.io/yaml
|
||||||
# k8s.io/api => k8s.io/api v0.18.8
|
# k8s.io/api => k8s.io/api v0.18.12
|
||||||
# k8s.io/apimachinery => k8s.io/apimachinery v0.18.8
|
# k8s.io/apimachinery => k8s.io/apimachinery v0.18.12
|
||||||
# k8s.io/cli-runtime => k8s.io/cli-runtime v0.18.8
|
# k8s.io/cli-runtime => k8s.io/cli-runtime v0.18.12
|
||||||
# k8s.io/client-go => k8s.io/client-go v0.18.8
|
# k8s.io/client-go => k8s.io/client-go v0.18.12
|
||||||
# k8s.io/code-generator => k8s.io/code-generator v0.18.8
|
# k8s.io/code-generator => k8s.io/code-generator v0.18.12
|
||||||
|
# k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.18.12
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue