Merge pull request #115140 from smarterclayton/wait_context

wait: Use a context implementation for ContextForChannel

Kubernetes-commit: 8bee5dca1d94625aad8a321d3ed4d1dbeeeb0a62
This commit is contained in:
Kubernetes Publisher 2023-01-18 17:54:33 -08:00
commit b51a237e4c
3 changed files with 7 additions and 6 deletions

4
go.mod
View File

@ -43,7 +43,7 @@ require (
gopkg.in/natefinch/lumberjack.v2 v2.0.0
gopkg.in/square/go-jose.v2 v2.2.2
k8s.io/api v0.0.0-20230112183318-59fcd23597fd
k8s.io/apimachinery v0.0.0-20230119000403-b39d3a97b9a6
k8s.io/apimachinery v0.0.0-20230119040132-7e672c0a278e
k8s.io/client-go v0.0.0-20230119002741-c33df1cccbfb
k8s.io/component-base v0.0.0-20230119004332-38b99c2c9e9a
k8s.io/klog/v2 v2.80.1
@ -123,7 +123,7 @@ require (
replace (
k8s.io/api => k8s.io/api v0.0.0-20230112183318-59fcd23597fd
k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20230119000403-b39d3a97b9a6
k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20230119040132-7e672c0a278e
k8s.io/client-go => k8s.io/client-go v0.0.0-20230119002741-c33df1cccbfb
k8s.io/component-base => k8s.io/component-base v0.0.0-20230119004332-38b99c2c9e9a
k8s.io/kms => k8s.io/kms v0.0.0-20230117203143-407acb40b4f8

4
go.sum
View File

@ -992,8 +992,8 @@ 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=
k8s.io/api v0.0.0-20230112183318-59fcd23597fd h1:Y/vljv797SrqMUZ4KwQaIDcz+lecu074ACcke2d8D9s=
k8s.io/api v0.0.0-20230112183318-59fcd23597fd/go.mod h1:K1fbar68K91an+8RbH9eJWJRnoXQ5rugf6J5wsGMMWg=
k8s.io/apimachinery v0.0.0-20230119000403-b39d3a97b9a6 h1:nxc7EioumBwPm/wfQ2OfTyKq7sSt7RSThMTheCqe7Gg=
k8s.io/apimachinery v0.0.0-20230119000403-b39d3a97b9a6/go.mod h1:mb1AP2xs7Ajs+OvXRynwIgKVID9/rOtI7lFxIixvFp0=
k8s.io/apimachinery v0.0.0-20230119040132-7e672c0a278e h1:P6nqf84F2kJ1x0Xo6g9LZK1jIw5gtk1U89ooEVaOp/8=
k8s.io/apimachinery v0.0.0-20230119040132-7e672c0a278e/go.mod h1:mb1AP2xs7Ajs+OvXRynwIgKVID9/rOtI7lFxIixvFp0=
k8s.io/client-go v0.0.0-20230119002741-c33df1cccbfb h1:b86Po/QFXB7JQOSAb/fc/hBa33vGyhFChy7NyGZl31s=
k8s.io/client-go v0.0.0-20230119002741-c33df1cccbfb/go.mod h1:4LcNfL89QHAE9BINU66MM61I4GJ0BLuE8xSYu+OIEXg=
k8s.io/component-base v0.0.0-20230119004332-38b99c2c9e9a h1:zYjKaAlDW2q7W1t4W8ds+wn+AB09ZlA68rtcz+9EMyg=

View File

@ -17,6 +17,7 @@ limitations under the License.
package options
import (
"context"
"fmt"
"net/http"
"strconv"
@ -228,8 +229,8 @@ func (s *EtcdOptions) Complete(
}
if len(s.EncryptionProviderConfigFilepath) != 0 {
ctxTransformers, closeTransformers := wait.ContextForChannel(stopCh)
ctxServer, _ := wait.ContextForChannel(stopCh) // explicitly ignore cancel here because we do not own the server's lifecycle
ctxServer := wait.ContextForChannel(stopCh)
ctxTransformers, closeTransformers := context.WithCancel(ctxServer)
encryptionConfiguration, err := encryptionconfig.LoadEncryptionConfig(ctxTransformers, s.EncryptionProviderConfigFilepath, s.EncryptionProviderConfigAutomaticReload)
if err != nil {