From 6469722f8bfcabb8abce88cbbcf2a087c5a1dc72 Mon Sep 17 00:00:00 2001 From: Wei Huang Date: Thu, 18 Aug 2022 10:17:06 -0700 Subject: [PATCH] bump k8s deps to v1.23.10 --- go.mod | 78 +++++++++--------- go.sum | 80 +++++++++---------- .../apiserver/pkg/server/options/audit.go | 4 + .../storage/storagebackend/factory/etcd3.go | 39 +++++++++ .../client-go/tools/clientcmd/auth_loaders.go | 2 +- .../framework/preemption/preemption.go | 1 + vendor/modules.txt | 80 +++++++++---------- 7 files changed, 164 insertions(+), 120 deletions(-) diff --git a/go.mod b/go.mod index 9af4b52d0..0802f3f03 100644 --- a/go.mod +++ b/go.mod @@ -11,17 +11,17 @@ require ( github.com/spf13/pflag v1.0.5 github.com/stretchr/testify v1.7.0 gonum.org/v1/gonum v0.6.2 - k8s.io/api v0.23.9 - k8s.io/apimachinery v0.23.9 - k8s.io/apiserver v0.23.9 - k8s.io/client-go v0.23.9 - k8s.io/code-generator v0.23.9 - k8s.io/component-base v0.23.9 - k8s.io/component-helpers v0.23.9 + k8s.io/api v0.23.10 + k8s.io/apimachinery v0.23.10 + k8s.io/apiserver v0.23.10 + k8s.io/client-go v0.23.10 + k8s.io/code-generator v0.23.10 + k8s.io/component-base v0.23.10 + k8s.io/component-helpers v0.23.10 k8s.io/klog/hack/tools v0.0.0-20210917071902-331d2323a192 k8s.io/klog/v2 v2.30.0 - k8s.io/kube-scheduler v0.23.9 - k8s.io/kubernetes v1.23.9 + k8s.io/kube-scheduler v0.23.10 + k8s.io/kubernetes v1.23.10 k8s.io/utils v0.0.0-20211116205334-6203023598ed sigs.k8s.io/controller-runtime v0.11.1 sigs.k8s.io/yaml v1.3.0 @@ -120,42 +120,42 @@ require ( gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect k8s.io/apiextensions-apiserver v0.23.0 // indirect - k8s.io/cloud-provider v0.23.9 // indirect - k8s.io/csi-translation-lib v0.23.9 // indirect + k8s.io/cloud-provider v0.23.10 // indirect + k8s.io/csi-translation-lib v0.23.10 // indirect k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c // indirect k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65 // indirect - k8s.io/metrics v0.23.9 // indirect - k8s.io/mount-utils v0.23.9 // indirect + k8s.io/metrics v0.23.10 // indirect + k8s.io/mount-utils v0.23.10 // indirect sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.30 // indirect sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6 // indirect sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect ) replace ( - k8s.io/api => k8s.io/api v0.23.9 - k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.23.9 - k8s.io/apimachinery => k8s.io/apimachinery v0.23.9 - k8s.io/apiserver => k8s.io/apiserver v0.23.9 - k8s.io/cli-runtime => k8s.io/cli-runtime v0.23.9 - k8s.io/client-go => k8s.io/client-go v0.23.9 - k8s.io/cloud-provider => k8s.io/cloud-provider v0.23.9 - k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.23.9 - k8s.io/code-generator => k8s.io/code-generator v0.23.9 - k8s.io/component-base => k8s.io/component-base v0.23.9 - k8s.io/component-helpers => k8s.io/component-helpers v0.23.9 - k8s.io/controller-manager => k8s.io/controller-manager v0.23.9 - k8s.io/cri-api => k8s.io/cri-api v0.23.9 - k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.23.9 - k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.23.9 - k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.23.9 - k8s.io/kube-proxy => k8s.io/kube-proxy v0.23.9 - k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.23.9 - k8s.io/kubectl => k8s.io/kubectl v0.23.9 - k8s.io/kubelet => k8s.io/kubelet v0.23.9 - k8s.io/kubernetes => k8s.io/kubernetes v1.23.9 - k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.23.9 - k8s.io/metrics => k8s.io/metrics v0.23.9 - k8s.io/mount-utils => k8s.io/mount-utils v0.23.9 - k8s.io/pod-security-admission => k8s.io/pod-security-admission v0.23.9 - k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.23.9 + k8s.io/api => k8s.io/api v0.23.10 + k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.23.10 + k8s.io/apimachinery => k8s.io/apimachinery v0.23.10 + k8s.io/apiserver => k8s.io/apiserver v0.23.10 + k8s.io/cli-runtime => k8s.io/cli-runtime v0.23.10 + k8s.io/client-go => k8s.io/client-go v0.23.10 + k8s.io/cloud-provider => k8s.io/cloud-provider v0.23.10 + k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.23.10 + k8s.io/code-generator => k8s.io/code-generator v0.23.10 + k8s.io/component-base => k8s.io/component-base v0.23.10 + k8s.io/component-helpers => k8s.io/component-helpers v0.23.10 + k8s.io/controller-manager => k8s.io/controller-manager v0.23.10 + k8s.io/cri-api => k8s.io/cri-api v0.23.10 + k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.23.10 + k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.23.10 + k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.23.10 + k8s.io/kube-proxy => k8s.io/kube-proxy v0.23.10 + k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.23.10 + k8s.io/kubectl => k8s.io/kubectl v0.23.10 + k8s.io/kubelet => k8s.io/kubelet v0.23.10 + k8s.io/kubernetes => k8s.io/kubernetes v1.23.10 + k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.23.10 + k8s.io/metrics => k8s.io/metrics v0.23.10 + k8s.io/mount-utils => k8s.io/mount-utils v0.23.10 + k8s.io/pod-security-admission => k8s.io/pod-security-admission v0.23.10 + k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.23.10 ) diff --git a/go.sum b/go.sum index acc892d18..1a3a5a204 100644 --- a/go.sum +++ b/go.sum @@ -1260,30 +1260,30 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -k8s.io/api v0.23.9 h1:v7Ee2CZuyb6rVm1q4bUe7ZonWleLsrvgcOTxPGjQVa4= -k8s.io/api v0.23.9/go.mod h1:r4g0GrGdLgwSYB90qgO4tBrbKtALBhUfut+oFt4ikCc= -k8s.io/apiextensions-apiserver v0.23.9 h1:q6X/HhgKo7/Up1p1TeNGNAwqcaBcxaxjxxwXa/5ht+E= -k8s.io/apiextensions-apiserver v0.23.9/go.mod h1:uu79PjF1T6YbfFqL5kVTmEdxb40Z0eHM7MfHDHz9dho= -k8s.io/apimachinery v0.23.9 h1:u9Pu7Ffe+9+QJUemtNjuCwvHSnOUeYEwgSHV+88Ne0g= -k8s.io/apimachinery v0.23.9/go.mod h1:BEuFMMBaIbcOqVIJqNZJXGFTP4W6AycEpb5+m/97hrM= -k8s.io/apiserver v0.23.9 h1:SyqC4vrduSS9hkWLHww8kuFL9mVRal798kRHwGHESRM= -k8s.io/apiserver v0.23.9/go.mod h1:vIXpgCnHep34bP/y+wGhYdn1NgxAvWtntxfEjst0e74= -k8s.io/cli-runtime v0.23.9/go.mod h1:hDcaaDVGThFtszfsg3tErDQ1k/elaNZjRljz0OWBdBg= -k8s.io/client-go v0.23.9 h1:OKxNCL+nhw7UBB5b01OVuAV4Db/AdBdaV6/GYpucuOw= -k8s.io/client-go v0.23.9/go.mod h1:sNo0X0MZqo4Uu0qDY5Fl5Y60cJFinBDWWUBOAM5JUCM= -k8s.io/cloud-provider v0.23.9 h1:Ae2IUEH24Rjj/B9TUZsntK4df2wiCaUWPSNQEz1wqZA= -k8s.io/cloud-provider v0.23.9/go.mod h1:pvwJIqXO2VdS5BH7O1kDJ0YNGLR2VF3g1H5vl8iZ9ak= -k8s.io/cluster-bootstrap v0.23.9/go.mod h1:QYh+SzpR4WFId3+URMKtF9M3RsuO+znRd4YA477s13Q= -k8s.io/code-generator v0.23.9 h1:nCvstXOrfWAbxcmrUzJ+TpRsbPHh2XVDNKxqzkH/nH4= -k8s.io/code-generator v0.23.9/go.mod h1:S0Q1JVA+kSzTI1oUvbKAxZY/DYbA/ZUb4Uknog12ETk= -k8s.io/component-base v0.23.9 h1:YcKppshHzZA7ZG+na+lRdUn/pj+3AMPsp9BaImh2hVo= -k8s.io/component-base v0.23.9/go.mod h1:WUNtIRIMd9WBS2r5LCSNZoh6f/Uh+8O+aGuZUG5t428= -k8s.io/component-helpers v0.23.9 h1:Q2psrzjXXxtAKDI4N7k0S3etWYifagKV/oHZyNqDWc4= -k8s.io/component-helpers v0.23.9/go.mod h1:avq4d71ORmz8QkIJ+uSIZ6+z9vbhEY+8KRyT9dBv0GA= -k8s.io/controller-manager v0.23.9/go.mod h1:QAqHOzJYPfzAE7adXo1xjJphjNP8g/cOyAiJmFtxoRE= -k8s.io/cri-api v0.23.9/go.mod h1:REJE3PSU0h/LOV1APBrupxrEJqnoxZC8KWzkBUHwrK4= -k8s.io/csi-translation-lib v0.23.9 h1:PNpN6LgRfDyvP52TT0arlrHBknW8qKLU73EWHh2BoC0= -k8s.io/csi-translation-lib v0.23.9/go.mod h1:In0Ze9BlrNCIbpCCwXtJp7LGtjGaTgtBbjGIcGlxz1Y= +k8s.io/api v0.23.10 h1:lbE62dyusvPnPUD5plS9X3hJQ4EWUt8iG69AigC6skE= +k8s.io/api v0.23.10/go.mod h1:+vpqBLTniW6bWQN7M3g3fttf3wQduJuRRmXGSb34Gas= +k8s.io/apiextensions-apiserver v0.23.10 h1:krNmpyXCtkx2d0BSxbeIgcxXchtaC4nKMLbUWlMdk+s= +k8s.io/apiextensions-apiserver v0.23.10/go.mod h1:ueYEf5xGH4EZ9BvHkPi6bL9HBiE3KOtTojyJ94b96Pk= +k8s.io/apimachinery v0.23.10 h1:ZZTDUh8kcKvpjptg/zOii7paedymrOIO9WOOOfZScVk= +k8s.io/apimachinery v0.23.10/go.mod h1:BEuFMMBaIbcOqVIJqNZJXGFTP4W6AycEpb5+m/97hrM= +k8s.io/apiserver v0.23.10 h1:Pw0XxLJxBjzmb1AS4FOsZ+gMYGJqbH1Yc4TO6vhFtKg= +k8s.io/apiserver v0.23.10/go.mod h1:ewIo2U9eKvT4NqnX7YD0vx/B8MSOVKVFAvyWHPhBdNU= +k8s.io/cli-runtime v0.23.10/go.mod h1:pDYkErqSRUGakyTYLNUOUVz7I+wziM59yJOwRIOYq+M= +k8s.io/client-go v0.23.10 h1:iDTADqhGG4VBHFGWVQEwRvG3oG8viD2WtFgp36AZ8Dw= +k8s.io/client-go v0.23.10/go.mod h1:+LdgZowNVtLC2/cGLEep+XuVa9jD0hjmxBwH/v+CZqM= +k8s.io/cloud-provider v0.23.10 h1:wX7j6o/OadJ4FTomLgYfGa46FMERvN6WEqMwUxsV1eQ= +k8s.io/cloud-provider v0.23.10/go.mod h1:n1QH4IvlE6GbpKDZSYYb153/UH8rljCgn77NcLFugnM= +k8s.io/cluster-bootstrap v0.23.10/go.mod h1:/IrhCtMxScm9/tsFpKHpFakb0q8ELN8kBqwgXV7pTlA= +k8s.io/code-generator v0.23.10 h1:CJ1VWbBoluGtUbog4KbVYor0PzK+vy2iUd9MfMFKE2w= +k8s.io/code-generator v0.23.10/go.mod h1:S0Q1JVA+kSzTI1oUvbKAxZY/DYbA/ZUb4Uknog12ETk= +k8s.io/component-base v0.23.10 h1:fMAM1YOt9R5bq7vziwKpK5bVwB28znIJB3Nxv8NQL20= +k8s.io/component-base v0.23.10/go.mod h1:Ev9VyeA1FFuk6YKuR0lR0l0ZcxJUv1Sebx3PXSguupQ= +k8s.io/component-helpers v0.23.10 h1:UvWDQy9ANtBb0ALsCxfPVArYiM5wpFH+NT2GtnmV7lM= +k8s.io/component-helpers v0.23.10/go.mod h1:IltTnLNM5XCQtUymqiy8kWZT31+EF3gs0YsgtDpH9K4= +k8s.io/controller-manager v0.23.10/go.mod h1:MHxp7q/bw2oMmVAp26DWSP635rg9KFc+cumWylG0fzA= +k8s.io/cri-api v0.23.10/go.mod h1:REJE3PSU0h/LOV1APBrupxrEJqnoxZC8KWzkBUHwrK4= +k8s.io/csi-translation-lib v0.23.10 h1:DJA2d6iZqR3NjgumnLzf6ZO9JkCW08PCbwSqB1l1zi4= +k8s.io/csi-translation-lib v0.23.10/go.mod h1:XRljd5/K1e+S4sXT5GWMViFBi6qZ+aQFacu2UEgrYEs= k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c h1:GohjlNKauSai7gN4wsJkeZ3WAJx4Sh+oT/b5IYn5suA= k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= @@ -1295,25 +1295,25 @@ k8s.io/klog/v2 v2.4.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= k8s.io/klog/v2 v2.9.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= k8s.io/klog/v2 v2.30.0 h1:bUO6drIvCIsvZ/XFgfxoGFQU/a4Qkh0iAlvUR7vlHJw= k8s.io/klog/v2 v2.30.0/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= -k8s.io/kube-aggregator v0.23.9/go.mod h1:vGrnbTttDQ/l8AJ9K+TyZeSSDdoc75Lze3YBS3r4JG0= -k8s.io/kube-controller-manager v0.23.9/go.mod h1:tW7XcVAE8412UqVNgWbUFwDi0QMgxPU4wRmtLEnkaqc= +k8s.io/kube-aggregator v0.23.10/go.mod h1:DXNnJCsvvhv3tT60aSN3C1IER03PRT7BjXAs+cXg7Q8= +k8s.io/kube-controller-manager v0.23.10/go.mod h1:KuydBU2blURmG1X/yPUOIaGnWul2d75zv+HKU/C4DGw= k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e/go.mod h1:vHXdDvt9+2spS2Rx9ql3I8tycm3H9FDfdUoIuKCefvw= k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65 h1:E3J9oCLlaobFUqsjG9DfKbP2BmgwBL2p7pn0A3dG9W4= k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65/go.mod h1:sX9MT8g7NVZM5lVL/j8QyCCJe8YSMW30QvGZWaCIDIk= -k8s.io/kube-proxy v0.23.9/go.mod h1:VkUWh9msa/Yn38snmW2DycNimmoz/StKI2TzHnFWCdY= -k8s.io/kube-scheduler v0.23.9 h1:sczoLwcLGlivRnlf1vc4OmSFtioYm1T1doZFGNMAh/k= -k8s.io/kube-scheduler v0.23.9/go.mod h1:JSCkATMtLLnYDQr3MqaeRiDYQND6uKXVDGrhllB+f3E= -k8s.io/kubectl v0.23.9/go.mod h1:h8zOBxF50vTLifPnxLtIg0wmG1kwiLhDcFYWTcCZIu8= -k8s.io/kubelet v0.23.9/go.mod h1:nyGThX8iqXX4OjUUs/RxgimYr7oJwGJaQFd0QdWs6VE= -k8s.io/kubernetes v1.23.9 h1:Tq1fs9Xi3cKHqMnVpTj2dV6nrCUP8XeZDFRzJCxIEEo= -k8s.io/kubernetes v1.23.9/go.mod h1:IgVzsE4wzcjQ2olWQskgJX30Hx3fOODQp3Jqp6E/Vzw= -k8s.io/legacy-cloud-providers v0.23.9/go.mod h1:+N1ZwqeY3opWkPkWwB2xU2ARS6949YZXEq98mojDU5o= -k8s.io/metrics v0.23.9 h1:j/qeWYJyqzgcVtSjELO8TUsz53h+QiC8vgyMY+SNH90= -k8s.io/metrics v0.23.9/go.mod h1:Lc1lEhSqNHdakbf+MlrEamEcaLRWDqmECWlRbedgTlU= -k8s.io/mount-utils v0.23.9 h1:Ln6x+kcHKYr5ICo2eb8gKkPsGlGrathgYZvSTrWbBaQ= -k8s.io/mount-utils v0.23.9/go.mod h1:OTN3LQPiOGMfx/SmVlsnySwsAmh4gYrDYLchlMHtf98= -k8s.io/pod-security-admission v0.23.9/go.mod h1:mzjmuTgKbL3BZsVSHVAhCHROLamxef8qJ1UntcJfOiU= -k8s.io/sample-apiserver v0.23.9/go.mod h1:s3l+Aw1VsHnnjYWDzrVWuE/IsdY+auvJIu5bgqQTSVs= +k8s.io/kube-proxy v0.23.10/go.mod h1:56ImmMXi1L+6hmGkT7S7sqh20XaSXxyoLYY7bOMjcjk= +k8s.io/kube-scheduler v0.23.10 h1:hXi+DNrNWpsbFaC0pHFKpkHONvlvnejnItyDb7VgejM= +k8s.io/kube-scheduler v0.23.10/go.mod h1:+FJAaaQB82MtF44ragZI5FATXjpKItraE2NBsD8uxRU= +k8s.io/kubectl v0.23.10/go.mod h1:WPGBtPBo0+usyk2aYTz6qBhekXMnif4DHMQ82cQleYI= +k8s.io/kubelet v0.23.10/go.mod h1:EXD0pzZM23imz3lQLGRvb99ub+Gv0a4PREuTcNL8BHQ= +k8s.io/kubernetes v1.23.10 h1:mgs1AJoKaBd4umoS7Z5A9dbWHkhgrUfdQ2nJiUQWSNM= +k8s.io/kubernetes v1.23.10/go.mod h1:IgVzsE4wzcjQ2olWQskgJX30Hx3fOODQp3Jqp6E/Vzw= +k8s.io/legacy-cloud-providers v0.23.10/go.mod h1:xqVuI2i/9ZT3wpXrc8ndNgvkuPfWcDKtE9kzCoOtlDg= +k8s.io/metrics v0.23.10 h1:KqRuN/Uxon7N8jWaUC9YtwwSMKdlGGz/YMpEVHQ1t/s= +k8s.io/metrics v0.23.10/go.mod h1:nEnEo9l9Dk/vYJNi+aUXFLazzd61evhxYg1SY2ruhDQ= +k8s.io/mount-utils v0.23.10 h1:nv2sRmNlrf4xx2LY41uYGHuwVwuWz4MWt6NSM/WDMeU= +k8s.io/mount-utils v0.23.10/go.mod h1:OTN3LQPiOGMfx/SmVlsnySwsAmh4gYrDYLchlMHtf98= +k8s.io/pod-security-admission v0.23.10/go.mod h1:RB1jgYlpHR2k3Bki0IsBPYCPLYXacye9rAAYfe7bQpI= +k8s.io/sample-apiserver v0.23.10/go.mod h1:qL+UkPLDo9VOd2FfRlW2habqqffsepjXk+jdCMj/CNM= k8s.io/system-validators v1.6.0/go.mod h1:bPldcLgkIUK22ALflnsXk8pvkTEndYdNuaHH6gRrl0Q= k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= diff --git a/vendor/k8s.io/apiserver/pkg/server/options/audit.go b/vendor/k8s.io/apiserver/pkg/server/options/audit.go index fde8e8eb0..1aa57f553 100644 --- a/vendor/k8s.io/apiserver/pkg/server/options/audit.go +++ b/vendor/k8s.io/apiserver/pkg/server/options/audit.go @@ -20,6 +20,7 @@ import ( "fmt" "io" "os" + "path/filepath" "strings" "time" @@ -529,6 +530,9 @@ func (o *AuditLogOptions) getWriter() (io.Writer, error) { } func (o *AuditLogOptions) ensureLogFile() error { + if err := os.MkdirAll(filepath.Dir(o.Path), 0700); err != nil { + return err + } mode := os.FileMode(0600) f, err := os.OpenFile(o.Path, os.O_CREATE|os.O_APPEND|os.O_RDWR, mode) if err != nil { diff --git a/vendor/k8s.io/apiserver/pkg/storage/storagebackend/factory/etcd3.go b/vendor/k8s.io/apiserver/pkg/storage/storagebackend/factory/etcd3.go index 63e18699d..df4fe6a6a 100644 --- a/vendor/k8s.io/apiserver/pkg/storage/storagebackend/factory/etcd3.go +++ b/vendor/k8s.io/apiserver/pkg/storage/storagebackend/factory/etcd3.go @@ -19,8 +19,10 @@ package factory import ( "context" "fmt" + "log" "net" "net/url" + "os" "path" "strings" "sync" @@ -28,9 +30,12 @@ import ( "time" grpcprom "github.com/grpc-ecosystem/go-grpc-prometheus" + "go.etcd.io/etcd/client/pkg/v3/logutil" "go.etcd.io/etcd/client/pkg/v3/transport" clientv3 "go.etcd.io/etcd/client/v3" "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc" + "go.uber.org/zap" + "go.uber.org/zap/zapcore" "google.golang.org/grpc" "k8s.io/apimachinery/pkg/runtime" @@ -63,6 +68,14 @@ const ( dbMetricsMonitorJitter = 0.5 ) +// TODO(negz): Stop using a package scoped logger. At the time of writing we're +// creating an etcd client for each CRD. We need to pass each etcd client a +// logger or each client will create its own, which comes with a significant +// memory cost (around 20% of the API server's memory when hundreds of CRDs are +// present). The correct fix here is to not create a client per CRD. See +// https://github.com/kubernetes/kubernetes/issues/111476 for more. +var etcd3ClientLogger *zap.Logger + func init() { // grpcprom auto-registers (via an init function) their client metrics, since we are opting out of // using the global prometheus registry and using our own wrapped global registry, @@ -70,6 +83,30 @@ func init() { // For reference: https://github.com/kubernetes/kubernetes/pull/81387 legacyregistry.RawMustRegister(grpcprom.DefaultClientMetrics) dbMetricsMonitors = make(map[string]struct{}) + + c := logutil.DefaultZapLoggerConfig + c.Level = zap.NewAtomicLevelAt(etcdClientDebugLevel()) + l, err := c.Build() + if err != nil { + l = zap.NewNop() + } + etcd3ClientLogger = l.Named("etcd-client") +} + +// etcdClientDebugLevel translates ETCD_CLIENT_DEBUG into zap log level. +// NOTE(negz): This is a copy of a private etcd client function: +// https://github.com/etcd-io/etcd/blob/v3.5.4/client/v3/logger.go#L47 +func etcdClientDebugLevel() zapcore.Level { + envLevel := os.Getenv("ETCD_CLIENT_DEBUG") + if envLevel == "" || envLevel == "true" { + return zapcore.InfoLevel + } + var l zapcore.Level + if err := l.Set(envLevel); err == nil { + log.Printf("Deprecated env ETCD_CLIENT_DEBUG value. Using default level: 'info'") + return zapcore.InfoLevel + } + return l } func newETCD3HealthCheck(c storagebackend.Config) (func() error, error) { @@ -172,6 +209,7 @@ func newETCD3Client(c storagebackend.TransportConfig) (*clientv3.Client, error) } dialOptions = append(dialOptions, grpc.WithContextDialer(dialer)) } + cfg := clientv3.Config{ DialTimeout: dialTimeout, DialKeepAliveTime: keepaliveTime, @@ -179,6 +217,7 @@ func newETCD3Client(c storagebackend.TransportConfig) (*clientv3.Client, error) DialOptions: dialOptions, Endpoints: c.ServerList, TLS: tlsConfig, + Logger: etcd3ClientLogger, } return clientv3.New(cfg) diff --git a/vendor/k8s.io/client-go/tools/clientcmd/auth_loaders.go b/vendor/k8s.io/client-go/tools/clientcmd/auth_loaders.go index 0e4127762..5153a95a2 100644 --- a/vendor/k8s.io/client-go/tools/clientcmd/auth_loaders.go +++ b/vendor/k8s.io/client-go/tools/clientcmd/auth_loaders.go @@ -51,10 +51,10 @@ func (a *PromptingAuthLoader) LoadAuth(path string) (*clientauth.Info, error) { // Prompt for user/pass and write a file if none exists. if _, err := os.Stat(path); os.IsNotExist(err) { authPtr, err := a.Prompt() - auth := *authPtr if err != nil { return nil, err } + auth := *authPtr data, err := json.Marshal(auth) if err != nil { return &auth, err diff --git a/vendor/k8s.io/kubernetes/pkg/scheduler/framework/preemption/preemption.go b/vendor/k8s.io/kubernetes/pkg/scheduler/framework/preemption/preemption.go index 5daf229eb..5d393dd16 100644 --- a/vendor/k8s.io/kubernetes/pkg/scheduler/framework/preemption/preemption.go +++ b/vendor/k8s.io/kubernetes/pkg/scheduler/framework/preemption/preemption.go @@ -549,6 +549,7 @@ func (ev *Evaluator) DryRunPreemption(ctx context.Context, pod *v1.Pod, potentia nonViolatingCandidates := newCandidateList(numCandidates) violatingCandidates := newCandidateList(numCandidates) parallelCtx, cancel := context.WithCancel(ctx) + defer cancel() nodeStatuses := make(framework.NodeToStatusMap) var statusesLock sync.Mutex var errs []error diff --git a/vendor/modules.txt b/vendor/modules.txt index 91c55839b..e4cf97ab1 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -560,7 +560,7 @@ gopkg.in/yaml.v2 # gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b ## explicit gopkg.in/yaml.v3 -# k8s.io/api v0.23.9 => k8s.io/api v0.23.9 +# k8s.io/api v0.23.10 => k8s.io/api v0.23.10 ## explicit; go 1.16 k8s.io/api/admission/v1 k8s.io/api/admission/v1beta1 @@ -609,7 +609,7 @@ k8s.io/api/scheduling/v1beta1 k8s.io/api/storage/v1 k8s.io/api/storage/v1alpha1 k8s.io/api/storage/v1beta1 -# k8s.io/apiextensions-apiserver v0.23.0 => k8s.io/apiextensions-apiserver v0.23.9 +# k8s.io/apiextensions-apiserver v0.23.0 => k8s.io/apiextensions-apiserver v0.23.10 ## explicit; go 1.16 k8s.io/apiextensions-apiserver/pkg/apis/apiextensions k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1 @@ -618,7 +618,7 @@ k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/scheme k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1 k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/typed/apiextensions/v1beta1 -# k8s.io/apimachinery v0.23.9 => k8s.io/apimachinery v0.23.9 +# k8s.io/apimachinery v0.23.10 => k8s.io/apimachinery v0.23.10 ## explicit; go 1.16 k8s.io/apimachinery/pkg/api/equality k8s.io/apimachinery/pkg/api/errors @@ -672,7 +672,7 @@ k8s.io/apimachinery/pkg/version k8s.io/apimachinery/pkg/watch k8s.io/apimachinery/third_party/forked/golang/json k8s.io/apimachinery/third_party/forked/golang/reflect -# k8s.io/apiserver v0.23.9 => k8s.io/apiserver v0.23.9 +# k8s.io/apiserver v0.23.10 => k8s.io/apiserver v0.23.10 ## explicit; go 1.16 k8s.io/apiserver/pkg/admission k8s.io/apiserver/pkg/admission/configuration @@ -802,7 +802,7 @@ k8s.io/apiserver/plugin/pkg/audit/truncate k8s.io/apiserver/plugin/pkg/audit/webhook k8s.io/apiserver/plugin/pkg/authenticator/token/webhook k8s.io/apiserver/plugin/pkg/authorizer/webhook -# k8s.io/client-go v0.23.9 => k8s.io/client-go v0.23.9 +# k8s.io/client-go v0.23.10 => k8s.io/client-go v0.23.10 ## explicit; go 1.16 k8s.io/client-go/applyconfigurations/admissionregistration/v1 k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1 @@ -1083,12 +1083,12 @@ k8s.io/client-go/util/homedir k8s.io/client-go/util/keyutil k8s.io/client-go/util/retry k8s.io/client-go/util/workqueue -# k8s.io/cloud-provider v0.23.9 => k8s.io/cloud-provider v0.23.9 +# k8s.io/cloud-provider v0.23.10 => k8s.io/cloud-provider v0.23.10 ## explicit; go 1.16 k8s.io/cloud-provider k8s.io/cloud-provider/volume k8s.io/cloud-provider/volume/helpers -# k8s.io/code-generator v0.23.9 => k8s.io/code-generator v0.23.9 +# k8s.io/code-generator v0.23.10 => k8s.io/code-generator v0.23.10 ## explicit; go 1.16 k8s.io/code-generator k8s.io/code-generator/cmd/client-gen @@ -1123,7 +1123,7 @@ k8s.io/code-generator/cmd/set-gen k8s.io/code-generator/pkg/namer k8s.io/code-generator/pkg/util k8s.io/code-generator/third_party/forked/golang/reflect -# k8s.io/component-base v0.23.9 => k8s.io/component-base v0.23.9 +# k8s.io/component-base v0.23.10 => k8s.io/component-base v0.23.10 ## explicit; go 1.16 k8s.io/component-base/cli k8s.io/component-base/cli/flag @@ -1146,7 +1146,7 @@ k8s.io/component-base/term k8s.io/component-base/traces k8s.io/component-base/version k8s.io/component-base/version/verflag -# k8s.io/component-helpers v0.23.9 => k8s.io/component-helpers v0.23.9 +# k8s.io/component-helpers v0.23.10 => k8s.io/component-helpers v0.23.10 ## explicit; go 1.16 k8s.io/component-helpers/node/topology k8s.io/component-helpers/node/util/sysctl @@ -1154,7 +1154,7 @@ k8s.io/component-helpers/scheduling/corev1 k8s.io/component-helpers/scheduling/corev1/nodeaffinity k8s.io/component-helpers/storage/ephemeral k8s.io/component-helpers/storage/volume -# k8s.io/csi-translation-lib v0.23.9 => k8s.io/csi-translation-lib v0.23.9 +# k8s.io/csi-translation-lib v0.23.10 => k8s.io/csi-translation-lib v0.23.10 ## explicit; go 1.16 k8s.io/csi-translation-lib k8s.io/csi-translation-lib/plugins @@ -1193,12 +1193,12 @@ k8s.io/kube-openapi/pkg/util k8s.io/kube-openapi/pkg/util/proto k8s.io/kube-openapi/pkg/util/sets k8s.io/kube-openapi/pkg/validation/spec -# k8s.io/kube-scheduler v0.23.9 => k8s.io/kube-scheduler v0.23.9 +# k8s.io/kube-scheduler v0.23.10 => k8s.io/kube-scheduler v0.23.10 ## explicit; go 1.16 k8s.io/kube-scheduler/config/v1beta2 k8s.io/kube-scheduler/config/v1beta3 k8s.io/kube-scheduler/extender/v1 -# k8s.io/kubernetes v1.23.9 => k8s.io/kubernetes v1.23.9 +# k8s.io/kubernetes v1.23.10 => k8s.io/kubernetes v1.23.10 ## explicit; go 1.16 k8s.io/kubernetes/cmd/kube-scheduler/app k8s.io/kubernetes/cmd/kube-scheduler/app/config @@ -1288,7 +1288,7 @@ k8s.io/kubernetes/pkg/volume/util/subpath k8s.io/kubernetes/pkg/volume/util/types k8s.io/kubernetes/pkg/volume/util/volumepathhandler k8s.io/kubernetes/test/utils/image -# k8s.io/metrics v0.23.9 => k8s.io/metrics v0.23.9 +# k8s.io/metrics v0.23.10 => k8s.io/metrics v0.23.10 ## explicit; go 1.16 k8s.io/metrics/pkg/apis/metrics k8s.io/metrics/pkg/apis/metrics/v1alpha1 @@ -1297,7 +1297,7 @@ k8s.io/metrics/pkg/client/clientset/versioned k8s.io/metrics/pkg/client/clientset/versioned/scheme k8s.io/metrics/pkg/client/clientset/versioned/typed/metrics/v1alpha1 k8s.io/metrics/pkg/client/clientset/versioned/typed/metrics/v1beta1 -# k8s.io/mount-utils v0.23.9 => k8s.io/mount-utils v0.23.9 +# k8s.io/mount-utils v0.23.10 => k8s.io/mount-utils v0.23.10 ## explicit; go 1.16 k8s.io/mount-utils # k8s.io/utils v0.0.0-20211116205334-6203023598ed @@ -1384,29 +1384,29 @@ sigs.k8s.io/structured-merge-diff/v4/value # sigs.k8s.io/yaml v1.3.0 ## explicit; go 1.12 sigs.k8s.io/yaml -# k8s.io/api => k8s.io/api v0.23.9 -# k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.23.9 -# k8s.io/apimachinery => k8s.io/apimachinery v0.23.9 -# k8s.io/apiserver => k8s.io/apiserver v0.23.9 -# k8s.io/cli-runtime => k8s.io/cli-runtime v0.23.9 -# k8s.io/client-go => k8s.io/client-go v0.23.9 -# k8s.io/cloud-provider => k8s.io/cloud-provider v0.23.9 -# k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.23.9 -# k8s.io/code-generator => k8s.io/code-generator v0.23.9 -# k8s.io/component-base => k8s.io/component-base v0.23.9 -# k8s.io/component-helpers => k8s.io/component-helpers v0.23.9 -# k8s.io/controller-manager => k8s.io/controller-manager v0.23.9 -# k8s.io/cri-api => k8s.io/cri-api v0.23.9 -# k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.23.9 -# k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.23.9 -# k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.23.9 -# k8s.io/kube-proxy => k8s.io/kube-proxy v0.23.9 -# k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.23.9 -# k8s.io/kubectl => k8s.io/kubectl v0.23.9 -# k8s.io/kubelet => k8s.io/kubelet v0.23.9 -# k8s.io/kubernetes => k8s.io/kubernetes v1.23.9 -# k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.23.9 -# k8s.io/metrics => k8s.io/metrics v0.23.9 -# k8s.io/mount-utils => k8s.io/mount-utils v0.23.9 -# k8s.io/pod-security-admission => k8s.io/pod-security-admission v0.23.9 -# k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.23.9 +# k8s.io/api => k8s.io/api v0.23.10 +# k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.23.10 +# k8s.io/apimachinery => k8s.io/apimachinery v0.23.10 +# k8s.io/apiserver => k8s.io/apiserver v0.23.10 +# k8s.io/cli-runtime => k8s.io/cli-runtime v0.23.10 +# k8s.io/client-go => k8s.io/client-go v0.23.10 +# k8s.io/cloud-provider => k8s.io/cloud-provider v0.23.10 +# k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.23.10 +# k8s.io/code-generator => k8s.io/code-generator v0.23.10 +# k8s.io/component-base => k8s.io/component-base v0.23.10 +# k8s.io/component-helpers => k8s.io/component-helpers v0.23.10 +# k8s.io/controller-manager => k8s.io/controller-manager v0.23.10 +# k8s.io/cri-api => k8s.io/cri-api v0.23.10 +# k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.23.10 +# k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.23.10 +# k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.23.10 +# k8s.io/kube-proxy => k8s.io/kube-proxy v0.23.10 +# k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.23.10 +# k8s.io/kubectl => k8s.io/kubectl v0.23.10 +# k8s.io/kubelet => k8s.io/kubelet v0.23.10 +# k8s.io/kubernetes => k8s.io/kubernetes v1.23.10 +# k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.23.10 +# k8s.io/metrics => k8s.io/metrics v0.23.10 +# k8s.io/mount-utils => k8s.io/mount-utils v0.23.10 +# k8s.io/pod-security-admission => k8s.io/pod-security-admission v0.23.10 +# k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.23.10