diff --git a/go.mod b/go.mod index 1c48e875ae4..2986c74e144 100644 --- a/go.mod +++ b/go.mod @@ -18,13 +18,13 @@ require ( github.com/stretchr/testify v1.8.2 golang.org/x/net v0.17.0 google.golang.org/grpc v1.59.0 - k8s.io/api v0.27.7 - k8s.io/apimachinery v0.27.7 - k8s.io/client-go v0.27.7 - k8s.io/component-base v0.27.7 + k8s.io/api v0.27.8 + k8s.io/apimachinery v0.27.8 + k8s.io/client-go v0.27.8 + k8s.io/component-base v0.27.8 k8s.io/klog/v2 v2.90.1 - k8s.io/kubernetes v1.27.7 - k8s.io/mount-utils v0.27.7 + k8s.io/kubernetes v1.27.8 + k8s.io/mount-utils v0.27.8 k8s.io/pod-security-admission v0.0.0 k8s.io/utils v0.0.0-20230209194617-a36077c30491 sigs.k8s.io/yaml v1.3.0 @@ -114,8 +114,8 @@ require ( golang.org/x/sys v0.14.0 // indirect golang.org/x/term v0.13.0 // indirect golang.org/x/text v0.14.0 // indirect - golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect - golang.org/x/tools v0.7.0 // indirect + golang.org/x/time v0.3.0 // indirect + golang.org/x/tools v0.12.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/genproto v0.0.0-20231016165738-49dd2c1f3d0b // indirect google.golang.org/genproto/googleapis/api v0.0.0-20231012201019-e917dd12ba7a // indirect @@ -126,11 +126,11 @@ require ( gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect k8s.io/apiextensions-apiserver v0.0.0 // indirect - k8s.io/apiserver v0.27.7 // indirect + k8s.io/apiserver v0.27.8 // indirect k8s.io/cloud-provider v0.0.0 // indirect - k8s.io/component-helpers v0.27.7 // indirect - k8s.io/controller-manager v0.27.7 // indirect - k8s.io/kms v0.27.7 // indirect + k8s.io/component-helpers v0.27.8 // indirect + k8s.io/controller-manager v0.27.8 // indirect + k8s.io/kms v0.27.8 // indirect k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f // indirect k8s.io/kubectl v0.0.0 // indirect k8s.io/kubelet v0.0.0 // indirect @@ -140,34 +140,33 @@ require ( ) replace ( - k8s.io/api => k8s.io/api v0.27.7 - k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.27.7 - k8s.io/apimachinery => k8s.io/apimachinery v0.27.7 - k8s.io/apiserver => k8s.io/apiserver v0.27.7 - k8s.io/cli-runtime => k8s.io/cli-runtime v0.27.7 - k8s.io/client-go => k8s.io/client-go v0.27.7 - k8s.io/cloud-provider => k8s.io/cloud-provider v0.27.7 - k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.27.7 - k8s.io/code-generator => k8s.io/code-generator v0.27.7 - k8s.io/component-base => k8s.io/component-base v0.27.7 - k8s.io/component-helpers => k8s.io/component-helpers v0.27.7 - k8s.io/controller-manager => k8s.io/controller-manager v0.27.7 - k8s.io/cri-api => k8s.io/cri-api v0.27.7 - k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.27.7 - k8s.io/dynamic-resource-allocation => k8s.io/dynamic-resource-allocation v0.27.7 + k8s.io/api => k8s.io/api v0.27.8 + k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.27.8 + k8s.io/apimachinery => k8s.io/apimachinery v0.27.8 + k8s.io/apiserver => k8s.io/apiserver v0.27.8 + k8s.io/cli-runtime => k8s.io/cli-runtime v0.27.8 + k8s.io/client-go => k8s.io/client-go v0.27.8 + k8s.io/cloud-provider => k8s.io/cloud-provider v0.27.8 + k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.27.8 + k8s.io/code-generator => k8s.io/code-generator v0.27.8 + k8s.io/component-base => k8s.io/component-base v0.27.8 + k8s.io/component-helpers => k8s.io/component-helpers v0.27.8 + k8s.io/controller-manager => k8s.io/controller-manager v0.27.8 + k8s.io/cri-api => k8s.io/cri-api v0.27.8 + k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.27.8 + k8s.io/dynamic-resource-allocation => k8s.io/dynamic-resource-allocation v0.27.8 k8s.io/gengo => k8s.io/gengo v0.0.0-20200114144118-36b2048a9120 k8s.io/heapster => k8s.io/heapster v1.2.0-beta.1 - k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.27.7 - k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.27.7 - k8s.io/kube-proxy => k8s.io/kube-proxy v0.27.7 - k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.27.7 - k8s.io/kubectl => k8s.io/kubectl v0.27.7 - k8s.io/kubelet => k8s.io/kubelet v0.27.7 - k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.27.7 - k8s.io/metrics => k8s.io/metrics v0.27.7 - k8s.io/mount-utils => k8s.io/mount-utils v0.0.0-20230103133730-1df1a57439e2 - k8s.io/pod-security-admission => k8s.io/pod-security-admission v0.27.7 - k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.27.7 - k8s.io/sample-cli-plugin => k8s.io/sample-cli-plugin v0.27.7 - k8s.io/sample-controller => k8s.io/sample-controller v0.27.7 + k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.27.8 + k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.27.8 + k8s.io/kube-proxy => k8s.io/kube-proxy v0.27.8 + k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.27.8 + k8s.io/kubectl => k8s.io/kubectl v0.27.8 + k8s.io/kubelet => k8s.io/kubelet v0.27.8 + k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.27.8 + k8s.io/metrics => k8s.io/metrics v0.27.8 + k8s.io/pod-security-admission => k8s.io/pod-security-admission v0.27.8 + k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.27.8 + k8s.io/sample-cli-plugin => k8s.io/sample-cli-plugin v0.27.8 + k8s.io/sample-controller => k8s.io/sample-controller v0.27.8 ) diff --git a/go.sum b/go.sum index 0e8cf72d085..a2d476e2a7b 100644 --- a/go.sum +++ b/go.sum @@ -481,6 +481,7 @@ golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -612,8 +613,8 @@ golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 h1:vVKdlvoWBphwdxWKrFZEuM0kGgGLxUOYcY4U/2Vjg44= -golang.org/x/time v0.0.0-20220210224613-90d013bbcef8/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= +golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= @@ -658,8 +659,8 @@ golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.7.0 h1:W4OVu8VVOaIO0yzWMNdepAulS7YfoS3Zabrm8DOXXU4= -golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s= +golang.org/x/tools v0.12.0 h1:YW6HUoUmYBpwSgyaGaZq1fHjrBjX1rlpZ54T6mu2kss= +golang.org/x/tools v0.12.0/go.mod h1:Sc0INKfu04TlqNoRA1hgpFZbhYXHPr4V5DzpSBTPqQM= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -791,41 +792,41 @@ 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.27.7 h1:7yG4D3t/q4utJe2ptlRw9aPuxcSmroTsYxsofkQNl/A= -k8s.io/api v0.27.7/go.mod h1:ZNExI/Lhrs9YrLgVWx6jjHZdoWCTXfBXuFjt1X6olro= -k8s.io/apiextensions-apiserver v0.27.7 h1:YqIOwZAUokzxJIjunmUd4zS1v3JhK34EPXn+pP0/bsU= -k8s.io/apiextensions-apiserver v0.27.7/go.mod h1:x0p+b5a955lfPz9gaDeBy43obM12s+N9dNHK6+dUL+g= -k8s.io/apimachinery v0.27.7 h1:Gxgtb7Y/Rsu8ymgmUEaiErkxa6RY4oTd8kNUI6SUR58= -k8s.io/apimachinery v0.27.7/go.mod h1:jBGQgTjkw99ef6q5hv1YurDd3BqKDk9YRxmX0Ozo0i8= -k8s.io/apiserver v0.27.7 h1:E8sDHwfUug82YC1++qvE73QxihaXDqT4tr8XYBOEtc4= -k8s.io/apiserver v0.27.7/go.mod h1:OrLG9RwCOerutAlo8QJW5EHzUG9Dad7k6rgcDUNSO/w= -k8s.io/client-go v0.27.7 h1:+Xgh9OOKv6A3qdD4Dnl/0VOI5EvAv+0s/OseDxVVTwQ= -k8s.io/client-go v0.27.7/go.mod h1:dZ2kqcalYp5YZ2EV12XIMc77G6PxHWOJp/kclZr4+5Q= -k8s.io/cloud-provider v0.27.7 h1:tKn1bQVt3j95skBKaPO5dwBxmr39/SqdsCw3yNqcXws= -k8s.io/cloud-provider v0.27.7/go.mod h1:FI1QOdb/hnbrc+jEx+efrwDn/QyqMd3CfoOrm1bVmxs= -k8s.io/component-base v0.27.7 h1:kngM58HR9W9Nqpv7e4rpdRyWnKl/ABpUhLAZ+HoliMs= -k8s.io/component-base v0.27.7/go.mod h1:YGjlCVL1oeKvG3HSciyPHFh+LCjIEqsxz4BDR3cfHRs= -k8s.io/component-helpers v0.27.7 h1:4oJkgJuvrwUpuTLvJjoENUv8HO/Bb0VnyhQXFByU+Hg= -k8s.io/component-helpers v0.27.7/go.mod h1:L9Kzzc7amjdzPP7aipEWjkLakBolXkrEGb7Enl8geGs= -k8s.io/controller-manager v0.27.7 h1:ImTbPspuIL8mIWrF6g2BqEH7yNfqQ9kmfvBIqGjeWTw= -k8s.io/controller-manager v0.27.7/go.mod h1:R5pFgkLbAR0E48HAmjKBw6RIXh1PSfOH1kcPOJmmzhI= -k8s.io/csi-translation-lib v0.27.7 h1:TBBkOXdX/3t9I9wJhnkl/ZVmkBOfwB8fLw1+NRolX7A= +k8s.io/api v0.27.8 h1:Ja93gbyII5c3TJzWefEwGhlqC5SZksWhzRS+OYHIocU= +k8s.io/api v0.27.8/go.mod h1:2HuWJC6gpx4UScY+ezziNzv6j6Jqd2q0rGgobYSSjcs= +k8s.io/apiextensions-apiserver v0.27.8 h1:u9PON71euIhVbHdZ5YlznpY60GtRjPagf1mQXLo1siA= +k8s.io/apiextensions-apiserver v0.27.8/go.mod h1:qBlRJTKCA0gnFVCsjzbz3YJZ49TCBNEwvEF2TPMRqOs= +k8s.io/apimachinery v0.27.8 h1:Xg+ogjDm8s7KmV3vZGf7uOZ0jrC6FPy2Lk/h7BIRmvg= +k8s.io/apimachinery v0.27.8/go.mod h1:EIXLxLt/b1muPITiF5zlrcm7I+YnXsIgM+0GdnPTQvA= +k8s.io/apiserver v0.27.8 h1:fdrEm98wl1lxFoF8tCdQiYQOfmU3TOGkQr4YTLYHwzc= +k8s.io/apiserver v0.27.8/go.mod h1:8yLtDnOdRq9fubaea0zQ3AVheQUinb5Y/RqBUdQMT0Y= +k8s.io/client-go v0.27.8 h1:uXIsGniqc85kKQ8FV0iAwspb0JHtS1UybqrqzHaQ9hc= +k8s.io/client-go v0.27.8/go.mod h1:Ka6MUpObn3LRTfFPvjzyettp8LXCbhqLzZfi8TD4fP8= +k8s.io/cloud-provider v0.27.8 h1:juD0BcRWKW7WaNxO70EWAvsBrBlRa2/WjRQKY/vUlfw= +k8s.io/cloud-provider v0.27.8/go.mod h1:qtA+pX9uzrNiYxooBfE2QahsfcRaL3sH4QfgDyeaS2M= +k8s.io/component-base v0.27.8 h1:O8YRFv/wWvoo9z62p1N52lq+w5FpzILAlE1h8b9o3K8= +k8s.io/component-base v0.27.8/go.mod h1:h3uyZl+bFQeuLRz3owfSLaw3JKTrn6gmbvybkkW2z+I= +k8s.io/component-helpers v0.27.8 h1:w8Z+VFrhn/If48RHv2qtwJScHT6ifaLric0YZw2QxN8= +k8s.io/component-helpers v0.27.8/go.mod h1:AhGfmwrttufwWW+y7EfsbhEvCW6haVHgpMeuBChA0r8= +k8s.io/controller-manager v0.27.8 h1:GG6VhjOvgsiX3vOMT/clMlU1LeizP8s4rsHI//Szrww= +k8s.io/controller-manager v0.27.8/go.mod h1:Q5qtr4W1R3ovjnOH+W6IHx3qKumuWPtt7mIaazonubM= +k8s.io/csi-translation-lib v0.27.8 h1:oDfAN4NAuSLcd0QQzoRU9t8sIL0jmJrwcUKSf08rYGA= k8s.io/klog/v2 v2.90.1 h1:m4bYOKall2MmOiRaR1J+We67Do7vm9KiQVlT96lnHUw= k8s.io/klog/v2 v2.90.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= -k8s.io/kms v0.27.7 h1:3iB92lQIH4uEz0V+wQAXvAsgIDhmXg/8lCu01FCjtqI= -k8s.io/kms v0.27.7/go.mod h1:JspOc8g6+cDlZfgW5GqnHS+OV6tAVyg4iXytCrqfNPw= +k8s.io/kms v0.27.8 h1:D7s2vZAFWKD1+1Yg6Y4C+l7k+ZjEsMc7BjY0QRKAOY8= +k8s.io/kms v0.27.8/go.mod h1:+yIM/3y+UgdaZSQaMJObNONp0i237t/dVrxswECh7a0= k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f h1:2kWPakN3i/k81b0gvD5C5FJ2kxm1WrQFanWchyKuqGg= k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f/go.mod h1:byini6yhqGC14c3ebc/QwanvYwhuMWF6yz2F8uwW8eg= -k8s.io/kubectl v0.27.7 h1:HTEDa4s/oWjB3t5ysdW1yKlcNl9bzigcqWBq0LIIe3k= -k8s.io/kubectl v0.27.7/go.mod h1:Xb1Ubc8uN1i2RvSN1HCgSHTtzgX0woihMk/gW7XbjJU= -k8s.io/kubelet v0.27.7 h1:DiptBLFbl6nyadTP9DUfhiReasBDV1qyE1r8h2o5mXc= -k8s.io/kubelet v0.27.7/go.mod h1:WKoEgiCa6/hzmgN4UgVioEwcpLC8wg+9Xzzc8fqOCYs= -k8s.io/kubernetes v1.27.7 h1:YXzCNZ289k8cy5pOOGzGqBUjCF9eLVqwwImEIX+uB4I= -k8s.io/kubernetes v1.27.7/go.mod h1:9RuASG1ooCxhMDOxMG5nJ0Vw/wap9iylq4Y/Uzn/R/0= -k8s.io/mount-utils v0.0.0-20230103133730-1df1a57439e2 h1:kfACKquxtsEA7XXDy+iC92lg/1stK0UtzAhf7R2Y8Fc= -k8s.io/mount-utils v0.0.0-20230103133730-1df1a57439e2/go.mod h1:au99w4FWU5ZWelLb3Yx6kJc8RZ387IyWVM9tN65Yhxo= -k8s.io/pod-security-admission v0.27.7 h1:dzroM+0fPWec0884LG5q5aJ5ZuITH4TDTjd6lM6Ipag= -k8s.io/pod-security-admission v0.27.7/go.mod h1:g0Lx/Ufn3ABaDmA1I+TpDlrYMW1FJTVk9HPd3Mkv7fI= +k8s.io/kubectl v0.27.8 h1:VipG0f9E1kGRGJYm2/kNv188RgDduvx1g2q1b20niHg= +k8s.io/kubectl v0.27.8/go.mod h1:ZufZqfI5V7oBuGFALJHoTxypO0fewOwbadr4saUkRKo= +k8s.io/kubelet v0.27.8 h1:U6+jInyVkQbVky1MofSc2bDPHu7V4oZFRzv/g34hWEc= +k8s.io/kubelet v0.27.8/go.mod h1:fCkdJ8bPZTsVwVKIyYAy0hMCOIxdgS0MeqcT5xBBup8= +k8s.io/kubernetes v1.27.8 h1:K848lTo/D0jvrxUlTvw4nNADixbhXLHgKNDP/KlFGy8= +k8s.io/kubernetes v1.27.8/go.mod h1:PUXXrx0IhAi+kI9BMDqNJHUnLndVv9W0DkriqyjuJOs= +k8s.io/mount-utils v0.27.8 h1:BfzSou4epo21IFKanDx7JmVOVK62xg4PdV328YsHr34= +k8s.io/mount-utils v0.27.8/go.mod h1:xhPO8oPBui6ReCKsJQ+p6me6vhwrBPVb5Ib/8Xkap40= +k8s.io/pod-security-admission v0.27.8 h1:iy2+7jpA4kV0UUpw0+maKhEmG0BopUzJxvvxneBki9I= +k8s.io/pod-security-admission v0.27.8/go.mod h1:KKFL+Vu17cqif6aqhXuTmnmNYiDNa4NoyLaleJnuDI0= k8s.io/utils v0.0.0-20230209194617-a36077c30491 h1:r0BAOLElQnnFhE/ApUsg3iHdVYYPBjNSSOMowRZxxsY= k8s.io/utils v0.0.0-20230209194617-a36077c30491/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= diff --git a/vendor/golang.org/x/time/AUTHORS b/vendor/golang.org/x/time/AUTHORS deleted file mode 100644 index 15167cd746c..00000000000 --- a/vendor/golang.org/x/time/AUTHORS +++ /dev/null @@ -1,3 +0,0 @@ -# This source code refers to The Go Authors for copyright purposes. -# The master list of authors is in the main Go distribution, -# visible at http://tip.golang.org/AUTHORS. diff --git a/vendor/golang.org/x/time/CONTRIBUTORS b/vendor/golang.org/x/time/CONTRIBUTORS deleted file mode 100644 index 1c4577e9680..00000000000 --- a/vendor/golang.org/x/time/CONTRIBUTORS +++ /dev/null @@ -1,3 +0,0 @@ -# This source code was written by the Go contributors. -# The master list of contributors is in the main Go distribution, -# visible at http://tip.golang.org/CONTRIBUTORS. diff --git a/vendor/golang.org/x/time/rate/rate.go b/vendor/golang.org/x/time/rate/rate.go index b0b982e9c6e..f0e0cf3cb1d 100644 --- a/vendor/golang.org/x/time/rate/rate.go +++ b/vendor/golang.org/x/time/rate/rate.go @@ -80,6 +80,19 @@ func (lim *Limiter) Burst() int { return lim.burst } +// TokensAt returns the number of tokens available at time t. +func (lim *Limiter) TokensAt(t time.Time) float64 { + lim.mu.Lock() + _, tokens := lim.advance(t) // does not mutate lim + lim.mu.Unlock() + return tokens +} + +// Tokens returns the number of tokens available now. +func (lim *Limiter) Tokens() float64 { + return lim.TokensAt(time.Now()) +} + // NewLimiter returns a new Limiter that allows events up to rate r and permits // bursts of at most b tokens. func NewLimiter(r Limit, b int) *Limiter { @@ -89,16 +102,16 @@ func NewLimiter(r Limit, b int) *Limiter { } } -// Allow is shorthand for AllowN(time.Now(), 1). +// Allow reports whether an event may happen now. func (lim *Limiter) Allow() bool { return lim.AllowN(time.Now(), 1) } -// AllowN reports whether n events may happen at time now. +// AllowN reports whether n events may happen at time t. // Use this method if you intend to drop / skip events that exceed the rate limit. // Otherwise use Reserve or Wait. -func (lim *Limiter) AllowN(now time.Time, n int) bool { - return lim.reserveN(now, n, 0).ok +func (lim *Limiter) AllowN(t time.Time, n int) bool { + return lim.reserveN(t, n, 0).ok } // A Reservation holds information about events that are permitted by a Limiter to happen after a delay. @@ -125,17 +138,17 @@ func (r *Reservation) Delay() time.Duration { } // InfDuration is the duration returned by Delay when a Reservation is not OK. -const InfDuration = time.Duration(1<<63 - 1) +const InfDuration = time.Duration(math.MaxInt64) // DelayFrom returns the duration for which the reservation holder must wait // before taking the reserved action. Zero duration means act immediately. // InfDuration means the limiter cannot grant the tokens requested in this // Reservation within the maximum wait time. -func (r *Reservation) DelayFrom(now time.Time) time.Duration { +func (r *Reservation) DelayFrom(t time.Time) time.Duration { if !r.ok { return InfDuration } - delay := r.timeToAct.Sub(now) + delay := r.timeToAct.Sub(t) if delay < 0 { return 0 } @@ -150,7 +163,7 @@ func (r *Reservation) Cancel() { // CancelAt indicates that the reservation holder will not perform the reserved action // and reverses the effects of this Reservation on the rate limit as much as possible, // considering that other reservations may have already been made. -func (r *Reservation) CancelAt(now time.Time) { +func (r *Reservation) CancelAt(t time.Time) { if !r.ok { return } @@ -158,7 +171,7 @@ func (r *Reservation) CancelAt(now time.Time) { r.lim.mu.Lock() defer r.lim.mu.Unlock() - if r.lim.limit == Inf || r.tokens == 0 || r.timeToAct.Before(now) { + if r.lim.limit == Inf || r.tokens == 0 || r.timeToAct.Before(t) { return } @@ -170,18 +183,18 @@ func (r *Reservation) CancelAt(now time.Time) { return } // advance time to now - now, _, tokens := r.lim.advance(now) + t, tokens := r.lim.advance(t) // calculate new number of tokens tokens += restoreTokens if burst := float64(r.lim.burst); tokens > burst { tokens = burst } // update state - r.lim.last = now + r.lim.last = t r.lim.tokens = tokens if r.timeToAct == r.lim.lastEvent { prevEvent := r.timeToAct.Add(r.limit.durationFromTokens(float64(-r.tokens))) - if !prevEvent.Before(now) { + if !prevEvent.Before(t) { r.lim.lastEvent = prevEvent } } @@ -196,18 +209,20 @@ func (lim *Limiter) Reserve() *Reservation { // The Limiter takes this Reservation into account when allowing future events. // The returned Reservation’s OK() method returns false if n exceeds the Limiter's burst size. // Usage example: -// r := lim.ReserveN(time.Now(), 1) -// if !r.OK() { -// // Not allowed to act! Did you remember to set lim.burst to be > 0 ? -// return -// } -// time.Sleep(r.Delay()) -// Act() +// +// r := lim.ReserveN(time.Now(), 1) +// if !r.OK() { +// // Not allowed to act! Did you remember to set lim.burst to be > 0 ? +// return +// } +// time.Sleep(r.Delay()) +// Act() +// // Use this method if you wish to wait and slow down in accordance with the rate limit without dropping events. // If you need to respect a deadline or cancel the delay, use Wait instead. // To drop or skip events exceeding rate limit, use Allow instead. -func (lim *Limiter) ReserveN(now time.Time, n int) *Reservation { - r := lim.reserveN(now, n, InfDuration) +func (lim *Limiter) ReserveN(t time.Time, n int) *Reservation { + r := lim.reserveN(t, n, InfDuration) return &r } @@ -221,6 +236,18 @@ func (lim *Limiter) Wait(ctx context.Context) (err error) { // canceled, or the expected wait time exceeds the Context's Deadline. // The burst limit is ignored if the rate limit is Inf. func (lim *Limiter) WaitN(ctx context.Context, n int) (err error) { + // The test code calls lim.wait with a fake timer generator. + // This is the real timer generator. + newTimer := func(d time.Duration) (<-chan time.Time, func() bool, func()) { + timer := time.NewTimer(d) + return timer.C, timer.Stop, func() {} + } + + return lim.wait(ctx, n, time.Now(), newTimer) +} + +// wait is the internal implementation of WaitN. +func (lim *Limiter) wait(ctx context.Context, n int, t time.Time, newTimer func(d time.Duration) (<-chan time.Time, func() bool, func())) error { lim.mu.Lock() burst := lim.burst limit := lim.limit @@ -236,25 +263,25 @@ func (lim *Limiter) WaitN(ctx context.Context, n int) (err error) { default: } // Determine wait limit - now := time.Now() waitLimit := InfDuration if deadline, ok := ctx.Deadline(); ok { - waitLimit = deadline.Sub(now) + waitLimit = deadline.Sub(t) } // Reserve - r := lim.reserveN(now, n, waitLimit) + r := lim.reserveN(t, n, waitLimit) if !r.ok { return fmt.Errorf("rate: Wait(n=%d) would exceed context deadline", n) } // Wait if necessary - delay := r.DelayFrom(now) + delay := r.DelayFrom(t) if delay == 0 { return nil } - t := time.NewTimer(delay) - defer t.Stop() + ch, stop, advance := newTimer(delay) + defer stop() + advance() // only has an effect when testing select { - case <-t.C: + case <-ch: // We can proceed. return nil case <-ctx.Done(): @@ -273,13 +300,13 @@ func (lim *Limiter) SetLimit(newLimit Limit) { // SetLimitAt sets a new Limit for the limiter. The new Limit, and Burst, may be violated // or underutilized by those which reserved (using Reserve or Wait) but did not yet act // before SetLimitAt was called. -func (lim *Limiter) SetLimitAt(now time.Time, newLimit Limit) { +func (lim *Limiter) SetLimitAt(t time.Time, newLimit Limit) { lim.mu.Lock() defer lim.mu.Unlock() - now, _, tokens := lim.advance(now) + t, tokens := lim.advance(t) - lim.last = now + lim.last = t lim.tokens = tokens lim.limit = newLimit } @@ -290,13 +317,13 @@ func (lim *Limiter) SetBurst(newBurst int) { } // SetBurstAt sets a new burst size for the limiter. -func (lim *Limiter) SetBurstAt(now time.Time, newBurst int) { +func (lim *Limiter) SetBurstAt(t time.Time, newBurst int) { lim.mu.Lock() defer lim.mu.Unlock() - now, _, tokens := lim.advance(now) + t, tokens := lim.advance(t) - lim.last = now + lim.last = t lim.tokens = tokens lim.burst = newBurst } @@ -304,7 +331,7 @@ func (lim *Limiter) SetBurstAt(now time.Time, newBurst int) { // reserveN is a helper method for AllowN, ReserveN, and WaitN. // maxFutureReserve specifies the maximum reservation wait duration allowed. // reserveN returns Reservation, not *Reservation, to avoid allocation in AllowN and WaitN. -func (lim *Limiter) reserveN(now time.Time, n int, maxFutureReserve time.Duration) Reservation { +func (lim *Limiter) reserveN(t time.Time, n int, maxFutureReserve time.Duration) Reservation { lim.mu.Lock() defer lim.mu.Unlock() @@ -313,7 +340,7 @@ func (lim *Limiter) reserveN(now time.Time, n int, maxFutureReserve time.Duratio ok: true, lim: lim, tokens: n, - timeToAct: now, + timeToAct: t, } } else if lim.limit == 0 { var ok bool @@ -325,11 +352,11 @@ func (lim *Limiter) reserveN(now time.Time, n int, maxFutureReserve time.Duratio ok: ok, lim: lim, tokens: lim.burst, - timeToAct: now, + timeToAct: t, } } - now, last, tokens := lim.advance(now) + t, tokens := lim.advance(t) // Calculate the remaining number of tokens resulting from the request. tokens -= float64(n) @@ -351,16 +378,12 @@ func (lim *Limiter) reserveN(now time.Time, n int, maxFutureReserve time.Duratio } if ok { r.tokens = n - r.timeToAct = now.Add(waitDuration) - } + r.timeToAct = t.Add(waitDuration) - // Update state - if ok { - lim.last = now + // Update state + lim.last = t lim.tokens = tokens lim.lastEvent = r.timeToAct - } else { - lim.last = last } return r @@ -369,20 +392,20 @@ func (lim *Limiter) reserveN(now time.Time, n int, maxFutureReserve time.Duratio // advance calculates and returns an updated state for lim resulting from the passage of time. // lim is not changed. // advance requires that lim.mu is held. -func (lim *Limiter) advance(now time.Time) (newNow time.Time, newLast time.Time, newTokens float64) { +func (lim *Limiter) advance(t time.Time) (newT time.Time, newTokens float64) { last := lim.last - if now.Before(last) { - last = now + if t.Before(last) { + last = t } // Calculate the new number of tokens, due to time that passed. - elapsed := now.Sub(last) + elapsed := t.Sub(last) delta := lim.limit.tokensFromDuration(elapsed) tokens := lim.tokens + delta if burst := float64(lim.burst); tokens > burst { tokens = burst } - return now, last, tokens + return t, tokens } // durationFromTokens is a unit conversion function from the number of tokens to the duration diff --git a/vendor/golang.org/x/time/rate/sometimes.go b/vendor/golang.org/x/time/rate/sometimes.go new file mode 100644 index 00000000000..6ba99ddb67b --- /dev/null +++ b/vendor/golang.org/x/time/rate/sometimes.go @@ -0,0 +1,67 @@ +// Copyright 2022 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package rate + +import ( + "sync" + "time" +) + +// Sometimes will perform an action occasionally. The First, Every, and +// Interval fields govern the behavior of Do, which performs the action. +// A zero Sometimes value will perform an action exactly once. +// +// # Example: logging with rate limiting +// +// var sometimes = rate.Sometimes{First: 3, Interval: 10*time.Second} +// func Spammy() { +// sometimes.Do(func() { log.Info("here I am!") }) +// } +type Sometimes struct { + First int // if non-zero, the first N calls to Do will run f. + Every int // if non-zero, every Nth call to Do will run f. + Interval time.Duration // if non-zero and Interval has elapsed since f's last run, Do will run f. + + mu sync.Mutex + count int // number of Do calls + last time.Time // last time f was run +} + +// Do runs the function f as allowed by First, Every, and Interval. +// +// The model is a union (not intersection) of filters. The first call to Do +// always runs f. Subsequent calls to Do run f if allowed by First or Every or +// Interval. +// +// A non-zero First:N causes the first N Do(f) calls to run f. +// +// A non-zero Every:M causes every Mth Do(f) call, starting with the first, to +// run f. +// +// A non-zero Interval causes Do(f) to run f if Interval has elapsed since +// Do last ran f. +// +// Specifying multiple filters produces the union of these execution streams. +// For example, specifying both First:N and Every:M causes the first N Do(f) +// calls and every Mth Do(f) call, starting with the first, to run f. See +// Examples for more. +// +// If Do is called multiple times simultaneously, the calls will block and run +// serially. Therefore, Do is intended for lightweight operations. +// +// Because a call to Do may block until f returns, if f causes Do to be called, +// it will deadlock. +func (s *Sometimes) Do(f func()) { + s.mu.Lock() + defer s.mu.Unlock() + if s.count == 0 || + (s.First > 0 && s.count < s.First) || + (s.Every > 0 && s.count%s.Every == 0) || + (s.Interval > 0 && time.Since(s.last) >= s.Interval) { + f() + s.last = time.Now() + } + s.count++ +} diff --git a/vendor/golang.org/x/tools/go/ast/inspector/inspector.go b/vendor/golang.org/x/tools/go/ast/inspector/inspector.go index 3fbfebf3693..1fc1de0bd10 100644 --- a/vendor/golang.org/x/tools/go/ast/inspector/inspector.go +++ b/vendor/golang.org/x/tools/go/ast/inspector/inspector.go @@ -64,8 +64,9 @@ type event struct { // depth-first order. It calls f(n) for each node n before it visits // n's children. // +// The complete traversal sequence is determined by ast.Inspect. // The types argument, if non-empty, enables type-based filtering of -// events. The function f if is called only for nodes whose type +// events. The function f is called only for nodes whose type // matches an element of the types slice. func (in *Inspector) Preorder(types []ast.Node, f func(ast.Node)) { // Because it avoids postorder calls to f, and the pruning @@ -97,6 +98,7 @@ func (in *Inspector) Preorder(types []ast.Node, f func(ast.Node)) { // of the non-nil children of the node, followed by a call of // f(n, false). // +// The complete traversal sequence is determined by ast.Inspect. // The types argument, if non-empty, enables type-based filtering of // events. The function f if is called only for nodes whose type // matches an element of the types slice. diff --git a/vendor/golang.org/x/tools/internal/typeparams/common.go b/vendor/golang.org/x/tools/internal/typeparams/common.go index cfba8189f15..d0d0649fe2a 100644 --- a/vendor/golang.org/x/tools/internal/typeparams/common.go +++ b/vendor/golang.org/x/tools/internal/typeparams/common.go @@ -23,6 +23,7 @@ package typeparams import ( + "fmt" "go/ast" "go/token" "go/types" @@ -105,6 +106,31 @@ func OriginMethod(fn *types.Func) *types.Func { } orig := NamedTypeOrigin(named) gfn, _, _ := types.LookupFieldOrMethod(orig, true, fn.Pkg(), fn.Name()) + + // This is a fix for a gopls crash (#60628) due to a go/types bug (#60634). In: + // package p + // type T *int + // func (*T) f() {} + // LookupFieldOrMethod(T, true, p, f)=nil, but NewMethodSet(*T)={(*T).f}. + // Here we make them consistent by force. + // (The go/types bug is general, but this workaround is reached only + // for generic T thanks to the early return above.) + if gfn == nil { + mset := types.NewMethodSet(types.NewPointer(orig)) + for i := 0; i < mset.Len(); i++ { + m := mset.At(i) + if m.Obj().Id() == fn.Id() { + gfn = m.Obj() + break + } + } + } + + // In golang/go#61196, we observe another crash, this time inexplicable. + if gfn == nil { + panic(fmt.Sprintf("missing origin method for %s.%s; named == origin: %t, named.NumMethods(): %d, origin.NumMethods(): %d", named, fn, named == orig, named.NumMethods(), orig.NumMethods())) + } + return gfn.(*types.Func) } diff --git a/vendor/golang.org/x/tools/internal/typeparams/typeparams_go117.go b/vendor/golang.org/x/tools/internal/typeparams/typeparams_go117.go index b4788978ff4..7ed86e1711b 100644 --- a/vendor/golang.org/x/tools/internal/typeparams/typeparams_go117.go +++ b/vendor/golang.org/x/tools/internal/typeparams/typeparams_go117.go @@ -129,7 +129,7 @@ func NamedTypeArgs(*types.Named) *TypeList { } // NamedTypeOrigin is the identity method at this Go version. -func NamedTypeOrigin(named *types.Named) types.Type { +func NamedTypeOrigin(named *types.Named) *types.Named { return named } diff --git a/vendor/golang.org/x/tools/internal/typeparams/typeparams_go118.go b/vendor/golang.org/x/tools/internal/typeparams/typeparams_go118.go index 114a36b866b..cf301af1dbe 100644 --- a/vendor/golang.org/x/tools/internal/typeparams/typeparams_go118.go +++ b/vendor/golang.org/x/tools/internal/typeparams/typeparams_go118.go @@ -103,7 +103,7 @@ func NamedTypeArgs(named *types.Named) *TypeList { } // NamedTypeOrigin returns named.Orig(). -func NamedTypeOrigin(named *types.Named) types.Type { +func NamedTypeOrigin(named *types.Named) *types.Named { return named.Origin() } diff --git a/vendor/k8s.io/mount-utils/mount.go b/vendor/k8s.io/mount-utils/mount.go index d7845ac495c..0bd91ee617b 100644 --- a/vendor/k8s.io/mount-utils/mount.go +++ b/vendor/k8s.io/mount-utils/mount.go @@ -147,6 +147,37 @@ func NewMountError(mountErrorValue MountErrorType, format string, args ...interf type SafeFormatAndMount struct { Interface Exec utilexec.Interface + + formatSem chan any + formatTimeout time.Duration +} + +func NewSafeFormatAndMount(mounter Interface, exec utilexec.Interface, opts ...Option) *SafeFormatAndMount { + res := &SafeFormatAndMount{ + Interface: mounter, + Exec: exec, + } + for _, opt := range opts { + opt(res) + } + return res +} + +type Option func(*SafeFormatAndMount) + +// WithMaxConcurrentFormat sets the maximum number of concurrent format +// operations executed by the mounter. The timeout controls the maximum +// duration of a format operation before its concurrency token is released. +// Once a token is released, it can be acquired by another concurrent format +// operation. The original operation is allowed to complete. +// If n < 1, concurrency is set to unlimited. +func WithMaxConcurrentFormat(n int, timeout time.Duration) Option { + return func(mounter *SafeFormatAndMount) { + if n > 0 { + mounter.formatSem = make(chan any, n) + mounter.formatTimeout = timeout + } + } } // FormatAndMount formats the given disk, if needed, and mounts it. diff --git a/vendor/k8s.io/mount-utils/mount_linux.go b/vendor/k8s.io/mount-utils/mount_linux.go index a7c00ea1b6d..f0125fcb489 100644 --- a/vendor/k8s.io/mount-utils/mount_linux.go +++ b/vendor/k8s.io/mount-utils/mount_linux.go @@ -363,19 +363,7 @@ func (mounter *Mounter) Unmount(target string) error { command := exec.Command("umount", target) output, err := command.CombinedOutput() if err != nil { - if err.Error() == errNoChildProcesses { - if command.ProcessState.Success() { - // We don't consider errNoChildProcesses an error if the process itself succeeded (see - k/k issue #103753). - return nil - } - // Rewrite err with the actual exit error of the process. - err = &exec.ExitError{ProcessState: command.ProcessState} - } - if mounter.withSafeNotMountedBehavior && strings.Contains(string(output), errNotMounted) { - klog.V(4).Infof("ignoring 'not mounted' error for %s", target) - return nil - } - return fmt.Errorf("unmount failed: %v\nUnmounting arguments: %s\nOutput: %s", err, target, string(output)) + return checkUmountError(target, command, output, err, mounter.withSafeNotMountedBehavior) } return nil } @@ -383,11 +371,11 @@ func (mounter *Mounter) Unmount(target string) error { // UnmountWithForce unmounts given target but will retry unmounting with force option // after given timeout. func (mounter *Mounter) UnmountWithForce(target string, umountTimeout time.Duration) error { - err := tryUnmount(mounter, target, umountTimeout) + err := tryUnmount(target, mounter.withSafeNotMountedBehavior, umountTimeout) if err != nil { if err == context.DeadlineExceeded { klog.V(2).Infof("Timed out waiting for unmount of %s, trying with -f", target) - err = forceUmount(target) + err = forceUmount(target, mounter.withSafeNotMountedBehavior) } return err } @@ -527,7 +515,8 @@ func (mounter *SafeFormatAndMount) formatAndMountSensitive(source string, target args = append(formatOptions, args...) klog.Infof("Disk %q appears to be unformatted, attempting to format as type: %q with options: %v", source, fstype, args) - output, err := mounter.Exec.Command("mkfs."+fstype, args...).CombinedOutput() + + output, err := mounter.format(fstype, args) if err != nil { // Do not log sensitiveOptions only options sensitiveOptionsLog := sanitizedOptionsForLogging(options, sensitiveOptions) @@ -562,6 +551,29 @@ func (mounter *SafeFormatAndMount) formatAndMountSensitive(source string, target return nil } +func (mounter *SafeFormatAndMount) format(fstype string, args []string) ([]byte, error) { + if mounter.formatSem != nil { + done := make(chan struct{}) + defer close(done) + + mounter.formatSem <- struct{}{} + + go func() { + defer func() { <-mounter.formatSem }() + + timeout := time.NewTimer(mounter.formatTimeout) + defer timeout.Stop() + + select { + case <-done: + case <-timeout.C: + } + }() + } + + return mounter.Exec.Command("mkfs."+fstype, args...).CombinedOutput() +} + func getDiskFormat(exec utilexec.Interface, disk string) (string, error) { args := []string{"-p", "-s", "TYPE", "-s", "PTTYPE", "-o", "export", disk} klog.V(4).Infof("Attempting to determine if disk %q is formatted using blkid with args: (%v)", disk, args) @@ -775,13 +787,13 @@ func (mounter *Mounter) IsMountPoint(file string) (bool, error) { } // tryUnmount calls plain "umount" and waits for unmountTimeout for it to finish. -func tryUnmount(mounter *Mounter, path string, unmountTimeout time.Duration) error { - klog.V(4).Infof("Unmounting %s", path) +func tryUnmount(target string, withSafeNotMountedBehavior bool, unmountTimeout time.Duration) error { + klog.V(4).Infof("Unmounting %s", target) ctx, cancel := context.WithTimeout(context.Background(), unmountTimeout) defer cancel() - cmd := exec.CommandContext(ctx, "umount", path) - out, cmderr := cmd.CombinedOutput() + command := exec.CommandContext(ctx, "umount", target) + output, err := command.CombinedOutput() // CombinedOutput() does not return DeadlineExceeded, make sure it's // propagated on timeout. @@ -789,22 +801,35 @@ func tryUnmount(mounter *Mounter, path string, unmountTimeout time.Duration) err return ctx.Err() } - if cmderr != nil { - if mounter.withSafeNotMountedBehavior && strings.Contains(string(out), errNotMounted) { - klog.V(4).Infof("ignoring 'not mounted' error for %s", path) - return nil - } - return fmt.Errorf("unmount failed: %v\nUnmounting arguments: %s\nOutput: %s", cmderr, path, string(out)) + if err != nil { + return checkUmountError(target, command, output, err, withSafeNotMountedBehavior) } return nil } -func forceUmount(path string) error { - cmd := exec.Command("umount", "-f", path) - out, cmderr := cmd.CombinedOutput() +func forceUmount(target string, withSafeNotMountedBehavior bool) error { + command := exec.Command("umount", "-f", target) + output, err := command.CombinedOutput() - if cmderr != nil { - return fmt.Errorf("unmount failed: %v\nUnmounting arguments: %s\nOutput: %s", cmderr, path, string(out)) + if err != nil { + return checkUmountError(target, command, output, err, withSafeNotMountedBehavior) } return nil } + +// checkUmountError checks a result of umount command and determine a return value. +func checkUmountError(target string, command *exec.Cmd, output []byte, err error, withSafeNotMountedBehavior bool) error { + if err.Error() == errNoChildProcesses { + if command.ProcessState.Success() { + // We don't consider errNoChildProcesses an error if the process itself succeeded (see - k/k issue #103753). + return nil + } + // Rewrite err with the actual exit error of the process. + err = &exec.ExitError{ProcessState: command.ProcessState} + } + if withSafeNotMountedBehavior && strings.Contains(string(output), errNotMounted) { + klog.V(4).Infof("ignoring 'not mounted' error for %s", target) + return nil + } + return fmt.Errorf("unmount failed: %v\nUnmounting arguments: %s\nOutput: %s", err, target, string(output)) +} diff --git a/vendor/k8s.io/mount-utils/mount_windows.go b/vendor/k8s.io/mount-utils/mount_windows.go index 7b2a2d1a15e..6c6624b609f 100644 --- a/vendor/k8s.io/mount-utils/mount_windows.go +++ b/vendor/k8s.io/mount-utils/mount_windows.go @@ -150,12 +150,12 @@ func (mounter *Mounter) MountSensitive(source string, target string, fstype stri mklinkSource = mklinkSource + "\\" } - output, err := exec.Command("cmd", "/c", "mklink", "/D", target, mklinkSource).CombinedOutput() + err := os.Symlink(mklinkSource, target) if err != nil { - klog.Errorf("mklink failed: %v, source(%q) target(%q) output: %q", err, mklinkSource, target, string(output)) + klog.Errorf("symlink failed: %v, source(%q) target(%q)", err, mklinkSource, target) return err } - klog.V(2).Infof("mklink source(%q) on target(%q) successfully, output: %q", mklinkSource, target, string(output)) + klog.V(2).Infof("symlink source(%q) on target(%q) successfully", mklinkSource, target) return nil } @@ -219,8 +219,9 @@ func removeSMBMapping(remotepath string) (string, error) { func (mounter *Mounter) Unmount(target string) error { klog.V(4).Infof("Unmount target (%q)", target) target = NormalizeWindowsPath(target) - if output, err := exec.Command("cmd", "/c", "rmdir", target).CombinedOutput(); err != nil { - klog.Errorf("rmdir failed: %v, output: %q", err, string(output)) + + if err := os.Remove(target); err != nil { + klog.Errorf("removing directory %s failed: %v", target, err) return err } return nil @@ -287,14 +288,20 @@ func (mounter *SafeFormatAndMount) formatAndMountSensitive(source string, target fstype = "NTFS" } - // format disk if it is unformatted(raw) - formatOptionsUnwrapped := "" if len(formatOptions) > 0 { - formatOptionsUnwrapped = " " + strings.Join(formatOptions, " ") + return fmt.Errorf("diskMount: formatOptions are not supported on Windows") } - cmd := fmt.Sprintf("Get-Disk -Number %s | Where partitionstyle -eq 'raw' | Initialize-Disk -PartitionStyle GPT -PassThru"+ - " | New-Partition -UseMaximumSize | Format-Volume -FileSystem %s -Confirm:$false%s", source, fstype, formatOptionsUnwrapped) - if output, err := mounter.Exec.Command("powershell", "/c", cmd).CombinedOutput(); err != nil { + + cmdString := "Get-Disk -Number $env:source | Where partitionstyle -eq 'raw' | Initialize-Disk -PartitionStyle GPT -PassThru" + + " | New-Partition -UseMaximumSize | Format-Volume -FileSystem $env:fstype -Confirm:$false" + cmd := mounter.Exec.Command("powershell", "/c", cmdString) + env := append(os.Environ(), + fmt.Sprintf("source=%s", source), + fmt.Sprintf("fstype=%s", fstype), + ) + cmd.SetEnv(env) + klog.V(8).Infof("Executing command: %q", cmdString) + if output, err := cmd.CombinedOutput(); err != nil { return fmt.Errorf("diskMount: format disk failed, error: %v, output: %q", err, string(output)) } klog.V(4).Infof("diskMount: Disk successfully formatted, disk: %q, fstype: %q", source, fstype) @@ -316,8 +323,10 @@ func (mounter *SafeFormatAndMount) formatAndMountSensitive(source string, target // ListVolumesOnDisk - returns back list of volumes(volumeIDs) in the disk (requested in diskID). func listVolumesOnDisk(diskID string) (volumeIDs []string, err error) { - cmd := fmt.Sprintf("(Get-Disk -DeviceId %s | Get-Partition | Get-Volume).UniqueId", diskID) - output, err := exec.Command("powershell", "/c", cmd).CombinedOutput() + cmd := exec.Command("powershell", "/c", "(Get-Disk -DeviceId $env:diskID | Get-Partition | Get-Volume).UniqueId") + cmd.Env = append(os.Environ(), fmt.Sprintf("diskID=%s", diskID)) + klog.V(8).Infof("Executing command: %q", cmd.String()) + output, err := cmd.CombinedOutput() klog.V(4).Infof("listVolumesOnDisk id from %s: %s", diskID, string(output)) if err != nil { return []string{}, fmt.Errorf("error list volumes on disk. cmd: %s, output: %s, error: %v", cmd, string(output), err) diff --git a/vendor/modules.txt b/vendor/modules.txt index f62df3b1e60..d3201145556 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -488,10 +488,10 @@ golang.org/x/text/transform golang.org/x/text/unicode/bidi golang.org/x/text/unicode/norm golang.org/x/text/width -# golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 +# golang.org/x/time v0.3.0 ## explicit golang.org/x/time/rate -# golang.org/x/tools v0.7.0 +# golang.org/x/tools v0.12.0 ## explicit; go 1.18 golang.org/x/tools/go/ast/inspector golang.org/x/tools/internal/typeparams @@ -622,7 +622,7 @@ gopkg.in/yaml.v2 # gopkg.in/yaml.v3 v3.0.1 ## explicit gopkg.in/yaml.v3 -# k8s.io/api v0.27.7 => k8s.io/api v0.27.7 +# k8s.io/api v0.27.8 => k8s.io/api v0.27.8 ## explicit; go 1.20 k8s.io/api/admission/v1 k8s.io/api/admission/v1beta1 @@ -678,11 +678,11 @@ 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.0.0 => k8s.io/apiextensions-apiserver v0.27.7 +# k8s.io/apiextensions-apiserver v0.0.0 => k8s.io/apiextensions-apiserver v0.27.8 ## explicit; go 1.20 k8s.io/apiextensions-apiserver/pkg/apis/apiextensions k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1 -# k8s.io/apimachinery v0.27.7 => k8s.io/apimachinery v0.27.7 +# k8s.io/apimachinery v0.27.8 => k8s.io/apimachinery v0.27.8 ## explicit; go 1.20 k8s.io/apimachinery/pkg/api/equality k8s.io/apimachinery/pkg/api/errors @@ -742,7 +742,7 @@ k8s.io/apimachinery/pkg/watch k8s.io/apimachinery/third_party/forked/golang/json k8s.io/apimachinery/third_party/forked/golang/netutil k8s.io/apimachinery/third_party/forked/golang/reflect -# k8s.io/apiserver v0.27.7 => k8s.io/apiserver v0.27.7 +# k8s.io/apiserver v0.27.8 => k8s.io/apiserver v0.27.8 ## explicit; go 1.20 k8s.io/apiserver/pkg/admission k8s.io/apiserver/pkg/admission/cel @@ -884,7 +884,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.27.7 => k8s.io/client-go v0.27.7 +# k8s.io/client-go v0.27.8 => k8s.io/client-go v0.27.8 ## explicit; go 1.20 k8s.io/client-go/applyconfigurations/admissionregistration/v1 k8s.io/client-go/applyconfigurations/admissionregistration/v1alpha1 @@ -1151,7 +1151,7 @@ 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.0.0 => k8s.io/cloud-provider v0.27.7 +# k8s.io/cloud-provider v0.0.0 => k8s.io/cloud-provider v0.27.8 ## explicit; go 1.20 k8s.io/cloud-provider k8s.io/cloud-provider/app/config @@ -1163,7 +1163,7 @@ k8s.io/cloud-provider/controllers/node/config/v1alpha1 k8s.io/cloud-provider/controllers/service/config k8s.io/cloud-provider/controllers/service/config/v1alpha1 k8s.io/cloud-provider/options -# k8s.io/component-base v0.27.7 => k8s.io/component-base v0.27.7 +# k8s.io/component-base v0.27.8 => k8s.io/component-base v0.27.8 ## explicit; go 1.20 k8s.io/component-base/cli/flag k8s.io/component-base/config @@ -1185,13 +1185,13 @@ k8s.io/component-base/metrics/testutil k8s.io/component-base/tracing k8s.io/component-base/tracing/api/v1 k8s.io/component-base/version -# k8s.io/component-helpers v0.27.7 => k8s.io/component-helpers v0.27.7 +# k8s.io/component-helpers v0.27.8 => k8s.io/component-helpers v0.27.8 ## explicit; go 1.20 k8s.io/component-helpers/node/util/sysctl k8s.io/component-helpers/scheduling/corev1 k8s.io/component-helpers/scheduling/corev1/nodeaffinity k8s.io/component-helpers/storage/volume -# k8s.io/controller-manager v0.27.7 => k8s.io/controller-manager v0.27.7 +# k8s.io/controller-manager v0.27.8 => k8s.io/controller-manager v0.27.8 ## explicit; go 1.20 k8s.io/controller-manager/config k8s.io/controller-manager/config/v1 @@ -1211,7 +1211,7 @@ k8s.io/klog/v2/internal/clock k8s.io/klog/v2/internal/dbg k8s.io/klog/v2/internal/serialize k8s.io/klog/v2/internal/severity -# k8s.io/kms v0.27.7 +# k8s.io/kms v0.27.8 ## explicit; go 1.20 k8s.io/kms/apis/v1beta1 k8s.io/kms/apis/v2 @@ -1239,14 +1239,14 @@ k8s.io/kube-openapi/pkg/validation/errors k8s.io/kube-openapi/pkg/validation/spec k8s.io/kube-openapi/pkg/validation/strfmt k8s.io/kube-openapi/pkg/validation/strfmt/bson -# k8s.io/kubectl v0.0.0 => k8s.io/kubectl v0.27.7 +# k8s.io/kubectl v0.0.0 => k8s.io/kubectl v0.27.8 ## explicit; go 1.20 k8s.io/kubectl/pkg/scale k8s.io/kubectl/pkg/util/podutils -# k8s.io/kubelet v0.0.0 => k8s.io/kubelet v0.27.7 +# k8s.io/kubelet v0.0.0 => k8s.io/kubelet v0.27.8 ## explicit; go 1.20 k8s.io/kubelet/pkg/apis -# k8s.io/kubernetes v1.27.7 +# k8s.io/kubernetes v1.27.8 ## explicit; go 1.20 k8s.io/kubernetes/pkg/api/legacyscheme k8s.io/kubernetes/pkg/api/service @@ -1312,10 +1312,10 @@ k8s.io/kubernetes/test/utils k8s.io/kubernetes/test/utils/format k8s.io/kubernetes/test/utils/image k8s.io/kubernetes/test/utils/kubeconfig -# k8s.io/mount-utils v0.27.7 => k8s.io/mount-utils v0.0.0-20230103133730-1df1a57439e2 -## explicit; go 1.19 +# k8s.io/mount-utils v0.27.8 +## explicit; go 1.20 k8s.io/mount-utils -# k8s.io/pod-security-admission v0.0.0 => k8s.io/pod-security-admission v0.27.7 +# k8s.io/pod-security-admission v0.0.0 => k8s.io/pod-security-admission v0.27.8 ## explicit; go 1.20 k8s.io/pod-security-admission/api k8s.io/pod-security-admission/policy @@ -1358,33 +1358,32 @@ 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.27.7 -# k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.27.7 -# k8s.io/apimachinery => k8s.io/apimachinery v0.27.7 -# k8s.io/apiserver => k8s.io/apiserver v0.27.7 -# k8s.io/cli-runtime => k8s.io/cli-runtime v0.27.7 -# k8s.io/client-go => k8s.io/client-go v0.27.7 -# k8s.io/cloud-provider => k8s.io/cloud-provider v0.27.7 -# k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.27.7 -# k8s.io/code-generator => k8s.io/code-generator v0.27.7 -# k8s.io/component-base => k8s.io/component-base v0.27.7 -# k8s.io/component-helpers => k8s.io/component-helpers v0.27.7 -# k8s.io/controller-manager => k8s.io/controller-manager v0.27.7 -# k8s.io/cri-api => k8s.io/cri-api v0.27.7 -# k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.27.7 -# k8s.io/dynamic-resource-allocation => k8s.io/dynamic-resource-allocation v0.27.7 +# k8s.io/api => k8s.io/api v0.27.8 +# k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.27.8 +# k8s.io/apimachinery => k8s.io/apimachinery v0.27.8 +# k8s.io/apiserver => k8s.io/apiserver v0.27.8 +# k8s.io/cli-runtime => k8s.io/cli-runtime v0.27.8 +# k8s.io/client-go => k8s.io/client-go v0.27.8 +# k8s.io/cloud-provider => k8s.io/cloud-provider v0.27.8 +# k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.27.8 +# k8s.io/code-generator => k8s.io/code-generator v0.27.8 +# k8s.io/component-base => k8s.io/component-base v0.27.8 +# k8s.io/component-helpers => k8s.io/component-helpers v0.27.8 +# k8s.io/controller-manager => k8s.io/controller-manager v0.27.8 +# k8s.io/cri-api => k8s.io/cri-api v0.27.8 +# k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.27.8 +# k8s.io/dynamic-resource-allocation => k8s.io/dynamic-resource-allocation v0.27.8 # k8s.io/gengo => k8s.io/gengo v0.0.0-20200114144118-36b2048a9120 # k8s.io/heapster => k8s.io/heapster v1.2.0-beta.1 -# k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.27.7 -# k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.27.7 -# k8s.io/kube-proxy => k8s.io/kube-proxy v0.27.7 -# k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.27.7 -# k8s.io/kubectl => k8s.io/kubectl v0.27.7 -# k8s.io/kubelet => k8s.io/kubelet v0.27.7 -# k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.27.7 -# k8s.io/metrics => k8s.io/metrics v0.27.7 -# k8s.io/mount-utils => k8s.io/mount-utils v0.0.0-20230103133730-1df1a57439e2 -# k8s.io/pod-security-admission => k8s.io/pod-security-admission v0.27.7 -# k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.27.7 -# k8s.io/sample-cli-plugin => k8s.io/sample-cli-plugin v0.27.7 -# k8s.io/sample-controller => k8s.io/sample-controller v0.27.7 +# k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.27.8 +# k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.27.8 +# k8s.io/kube-proxy => k8s.io/kube-proxy v0.27.8 +# k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.27.8 +# k8s.io/kubectl => k8s.io/kubectl v0.27.8 +# k8s.io/kubelet => k8s.io/kubelet v0.27.8 +# k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.27.8 +# k8s.io/metrics => k8s.io/metrics v0.27.8 +# k8s.io/pod-security-admission => k8s.io/pod-security-admission v0.27.8 +# k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.27.8 +# k8s.io/sample-cli-plugin => k8s.io/sample-cli-plugin v0.27.8 +# k8s.io/sample-controller => k8s.io/sample-controller v0.27.8