From 227d1e7a387aa0492d765fd8bc31e9364bfa876e Mon Sep 17 00:00:00 2001 From: Divyen Patel Date: Tue, 4 Aug 2020 12:22:19 -0700 Subject: [PATCH 01/17] bump csi-translation-lib --- go.mod | 2 - go.sum | 18 +- pkg/resizer/csi_resizer.go | 11 +- pkg/resizer/trivial_resizer.go | 5 +- .../csi-translation-lib/CONTRIBUTING.md | 2 +- vendor/k8s.io/csi-translation-lib/OWNERS | 1 + .../csi-translation-lib/SECURITY_CONTACTS | 5 + vendor/k8s.io/csi-translation-lib/go.mod | 22 +- vendor/k8s.io/csi-translation-lib/go.sum | 384 ++++++++++++++++-- .../csi-translation-lib/plugins/aws_ebs.go | 59 ++- .../csi-translation-lib/plugins/azure_disk.go | 98 ++++- .../csi-translation-lib/plugins/azure_file.go | 135 ++++-- .../csi-translation-lib/plugins/gce_pd.go | 156 ++++--- .../plugins/in_tree_volume.go | 140 ++++++- .../plugins/openstack_cinder.go | 18 +- .../plugins/vsphere_volume.go | 208 ++++++++++ .../k8s.io/csi-translation-lib/translate.go | 69 +++- vendor/modules.txt | 4 +- 18 files changed, 1131 insertions(+), 206 deletions(-) create mode 100644 vendor/k8s.io/csi-translation-lib/plugins/vsphere_volume.go diff --git a/go.mod b/go.mod index 219322f04..f3d216568 100644 --- a/go.mod +++ b/go.mod @@ -53,5 +53,3 @@ replace k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.19.0-rc.2 replace k8s.io/sample-cli-plugin => k8s.io/sample-cli-plugin v0.19.0-rc.2 replace k8s.io/sample-controller => k8s.io/sample-controller v0.19.0-rc.2 - -replace k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.0.0-20190918203248-97c07dcbb623 diff --git a/go.sum b/go.sum index e273d55bc..5f9a60c51 100644 --- a/go.sum +++ b/go.sum @@ -66,7 +66,6 @@ github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymF github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/evanphx/json-patch v0.0.0-20190203023257-5858425f7550/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch v0.0.0-20190815234213-e83c0a1c26c8/go.mod h1:pmLOTb3x90VhIKxsA9yeQG5yfOkkKnkk1h+Ql8NDYDw= github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch v4.5.0+incompatible h1:ouOWdg56aJriqS0huScTkVXPC5IcNrDCXZ6OoTAWu7M= @@ -89,7 +88,6 @@ github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1 github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc= github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/gogo/protobuf v0.0.0-20171007142547-342cbe0a0415/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d h1:3PaI8p3seN09VjbTYC/QWlUZdZ1qS1zGjy7LH2Wt07I= github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= @@ -131,7 +129,6 @@ github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= -github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g= @@ -141,7 +138,6 @@ github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OI github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= @@ -163,7 +159,6 @@ github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJ github.com/imdario/mergo v0.3.9 h1:UauaLniWCFHWd+Jp9oCEkTBj8VO/9DKg3PV3VCNMDIg= github.com/imdario/mergo v0.3.9/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v0.0.0-20180701071628-ab8a2e0c74be/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.6 h1:MrUvLMLTMxbqFJ9kzlvat/rYZqZnW3u4wkLzWTaFwKs= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.8 h1:QiWkFLKq0T7mpzwOTu6BzNDbfTE8OLrYhVKYMLF46Ok= @@ -212,7 +207,6 @@ github.com/onsi/ginkgo v1.10.2/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+ github.com/onsi/ginkgo v1.11.0 h1:JAKSXpt1YjtLA7YpPiqO9ss6sNXEsPfSGdwN0UHqzrw= github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= -github.com/onsi/gomega v0.0.0-20190113212917-5533ce8a0da3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.0 h1:XPnZz8VVBHjVsy1vzJmRwIcSwiUO+JFfrv/xGiigmME= github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= @@ -250,7 +244,6 @@ github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6Mwd github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= @@ -312,7 +305,6 @@ golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190812203447-cdfb69ac37fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553 h1:efeOvDhwQ29Dj3SdAV/MJf8oukgn+8D8WgaCaRMchF8= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -359,7 +351,6 @@ golang.org/x/sys v0.0.0-20200622214017-ed371f2e16b4/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= @@ -448,7 +439,6 @@ gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/inf.v0 v0.9.0/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= @@ -468,12 +458,10 @@ honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -k8s.io/api v0.0.0-20190918195907-bd6ac527cfd2/go.mod h1:AOxZTnaXR/xiarlQL0JUfwQPxjmKDvVYoRp58cA7lUo= k8s.io/api v0.17.0 h1:H9d/lw+VkZKEVIUc8F3wgiQ+FUXTTr21M87jXLU7yqM= k8s.io/api v0.17.0/go.mod h1:npsyOePkeP0CPwyGfXDHxvypiYMJxBWAMpQxCaJ4ZxI= k8s.io/api v0.19.0-rc.2 h1:Lq0owhvgpWXmMtz+t2AT/JJpIAPX9X8lK3oE2qslYCU= k8s.io/api v0.19.0-rc.2/go.mod h1:9nHeM2gbqeaL7yN6UFvOxKzLG5gZ4v+DJ6bpavDetZo= -k8s.io/apimachinery v0.0.0-20190817020851-f2f3a405f61d/go.mod h1:3jediapYqJ2w1BFw7lAZPCx7scubsTfosqHkhXCWJKw= k8s.io/apimachinery v0.17.0/go.mod h1:b9qmWdKlLuU9EBh+06BtLcSf/Mu89rWL33naRxs1uZg= k8s.io/apimachinery v0.17.1-beta.0 h1:0Wl/KpAiFOMe9to5h8x2Y6JnjV+BEWJiTcUk1Vx7zdE= k8s.io/apimachinery v0.17.1-beta.0/go.mod h1:b9qmWdKlLuU9EBh+06BtLcSf/Mu89rWL33naRxs1uZg= @@ -487,19 +475,17 @@ k8s.io/cloud-provider v0.19.0-rc.2 h1:Y0ErTXKY/Ia1o3yukW6RRci4BR2VW7haWro7XA2+AK k8s.io/cloud-provider v0.19.0-rc.2/go.mod h1:qj7f/cA8+X6M7LGwipdF5iIQ0D7tgFilzZY/hmJB0L0= k8s.io/component-base v0.19.0-rc.2 h1:pJponI+sSso1sx+frQqJYWn/QhxoqpufVbQp+SOazRg= k8s.io/component-base v0.19.0-rc.2/go.mod h1:aqXtywSxbTRUXnC1+1+DFIT1GXBxb6SogGhsHXmEbyc= -k8s.io/csi-translation-lib v0.0.0-20190918203248-97c07dcbb623 h1:Eb9+TO7Naai1jhWz5YQEo9/54L547jh3WQLA8K7trcA= -k8s.io/csi-translation-lib v0.0.0-20190918203248-97c07dcbb623/go.mod h1:FP2ff9xZ2FL6m427s99qF74Y18P8WSCvv1+CxK2RpLM= +k8s.io/csi-translation-lib v0.19.0-rc.2 h1:bQQGrBWdA6m1E2jC+N7H74/EPEedfCrzpMPV6NZLPn4= +k8s.io/csi-translation-lib v0.19.0-rc.2/go.mod h1:ZNXQMbfrCr0iH+mbYZ9LviD/Q8gM5Zt8KLg1K1tHQUk= k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= -k8s.io/klog v0.3.1/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.2.0 h1:XRvcwJozkgZ1UQJmfMGpvRthQHOvihEhYtDfAaxMz/A= k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= -k8s.io/kube-openapi v0.0.0-20190228160746-b3a7cee44a30/go.mod h1:BXM9ceUBTj2QnfH2MK1odQs778ajze1RxcmP6S8RVVc= k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a h1:UcxjrRMyNx/i/y8G7kPvLyy7rfbeuf1PYyBf973pgyU= k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= k8s.io/kube-openapi v0.0.0-20200427153329-656914f816f9 h1:5NC2ITmvg8RoxoH0wgmL4zn4VZqXGsKbxrikjaQx6s4= diff --git a/pkg/resizer/csi_resizer.go b/pkg/resizer/csi_resizer.go index fd9644951..2c3ddc46f 100644 --- a/pkg/resizer/csi_resizer.go +++ b/pkg/resizer/csi_resizer.go @@ -31,7 +31,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/informers" "k8s.io/client-go/kubernetes" - csitranslationlib "k8s.io/csi-translation-lib" + csitrans "k8s.io/csi-translation-lib" "k8s.io/klog" ) @@ -133,10 +133,10 @@ func (r *csiResizer) CanSupport(pv *v1.PersistentVolume, pvc *v1.PersistentVolum // otherwise, it will be in-tree plugin name // r.name is the CSI driver name, return true only when they match // and the CSI driver is migrated - if csitranslationlib.IsMigratedCSIDriverByName(r.name) && resizerName == r.name { + translator := csitrans.New() + if translator.IsMigratedCSIDriverByName(r.name) && resizerName == r.name { return true } - source := pv.Spec.CSI if source == nil { klog.V(4).Infof("PV %s is not a CSI volume, skip it", pv.Name) @@ -163,9 +163,10 @@ func (r *csiResizer) Resize(pv *v1.PersistentVolume, requestSize resource.Quanti volumeID = source.VolumeHandle pvSpec = pv.Spec } else { - if csitranslationlib.IsMigratedCSIDriverByName(r.name) { + translator := csitrans.New() + if translator.IsMigratedCSIDriverByName(r.name) { // handle migrated in-tree volume - csiPV, err := csitranslationlib.TranslateInTreePVToCSI(pv) + csiPV, err := translator.TranslateInTreePVToCSI(pv) if err != nil { return oldSize, false, fmt.Errorf("failed to translate persistent volume: %v", err) } diff --git a/pkg/resizer/trivial_resizer.go b/pkg/resizer/trivial_resizer.go index e174a1dc3..60738963d 100644 --- a/pkg/resizer/trivial_resizer.go +++ b/pkg/resizer/trivial_resizer.go @@ -20,7 +20,7 @@ import ( "github.com/kubernetes-csi/external-resizer/pkg/util" "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" - csitranslationlib "k8s.io/csi-translation-lib" + csitrans "k8s.io/csi-translation-lib" "k8s.io/klog" ) @@ -39,7 +39,8 @@ func (r *trivialResizer) Name() string { func (r *trivialResizer) CanSupport(pv *v1.PersistentVolume, pvc *v1.PersistentVolumeClaim) bool { resizerName := pvc.Annotations[util.VolumeResizerKey] - if csitranslationlib.IsMigratedCSIDriverByName(r.name) && resizerName == r.name { + translator := csitrans.New() + if translator.IsMigratedCSIDriverByName(r.name) && resizerName == r.name { return true } diff --git a/vendor/k8s.io/csi-translation-lib/CONTRIBUTING.md b/vendor/k8s.io/csi-translation-lib/CONTRIBUTING.md index f82be8de0..ecdb5f952 100644 --- a/vendor/k8s.io/csi-translation-lib/CONTRIBUTING.md +++ b/vendor/k8s.io/csi-translation-lib/CONTRIBUTING.md @@ -2,6 +2,6 @@ Do not open pull requests directly against this repository, they will be ignored. Instead, please open pull requests against [kubernetes/kubernetes](https://git.k8s.io/kubernetes/). Please follow the same [contributing guide](https://git.k8s.io/kubernetes/CONTRIBUTING.md) you would follow for any other pull request made to kubernetes/kubernetes. -This repository is published from [kubernetes/kubernetes/staging/src/k8s.io/csi-api](https://git.k8s.io/kubernetes/staging/src/k8s.io/csi-api) by the [kubernetes publishing-bot](https://git.k8s.io/publishing-bot). +This repository is published from [kubernetes/kubernetes/staging/src/k8s.io/csi-translation-lib](https://git.k8s.io/kubernetes/staging/src/k8s.io/csi-translation-lib) by the [kubernetes publishing-bot](https://git.k8s.io/publishing-bot). Please see [Staging Directory and Publishing](https://git.k8s.io/community/contributors/devel/sig-architecture/staging.md) for more information. diff --git a/vendor/k8s.io/csi-translation-lib/OWNERS b/vendor/k8s.io/csi-translation-lib/OWNERS index ecd5ad820..84dffb095 100644 --- a/vendor/k8s.io/csi-translation-lib/OWNERS +++ b/vendor/k8s.io/csi-translation-lib/OWNERS @@ -6,6 +6,7 @@ reviewers: - msau42 - ddebroy - leakingtapan + - andyzhangx approvers: - davidz627 diff --git a/vendor/k8s.io/csi-translation-lib/SECURITY_CONTACTS b/vendor/k8s.io/csi-translation-lib/SECURITY_CONTACTS index 2e1f26adf..14fe23e18 100644 --- a/vendor/k8s.io/csi-translation-lib/SECURITY_CONTACTS +++ b/vendor/k8s.io/csi-translation-lib/SECURITY_CONTACTS @@ -11,3 +11,8 @@ # INSTRUCTIONS AT https://kubernetes.io/security/ saad-ali +cjcullen +joelsmith +liggitt +philips +tallclair diff --git a/vendor/k8s.io/csi-translation-lib/go.mod b/vendor/k8s.io/csi-translation-lib/go.mod index 22662bce0..08cece082 100644 --- a/vendor/k8s.io/csi-translation-lib/go.mod +++ b/vendor/k8s.io/csi-translation-lib/go.mod @@ -2,20 +2,20 @@ module k8s.io/csi-translation-lib -go 1.12 +go 1.13 require ( - k8s.io/api v0.0.0-20190918195907-bd6ac527cfd2 - k8s.io/apimachinery v0.0.0-20190817020851-f2f3a405f61d - k8s.io/cloud-provider v0.0.0-20190918203125-ae665f80358a + github.com/stretchr/testify v1.4.0 + k8s.io/api v0.19.0-rc.2 + k8s.io/apimachinery v0.19.0-rc.2 + k8s.io/cloud-provider v0.19.0-rc.2 + k8s.io/klog/v2 v2.2.0 ) replace ( - golang.org/x/sync => golang.org/x/sync v0.0.0-20181108010431-42b317875d0f - golang.org/x/sys => golang.org/x/sys v0.0.0-20190209173611-3b5209105503 - golang.org/x/tools => golang.org/x/tools v0.0.0-20190313210603-aa82965741a9 - k8s.io/api => k8s.io/api v0.0.0-20190918195907-bd6ac527cfd2 - k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20190817020851-f2f3a405f61d - k8s.io/client-go => k8s.io/client-go v0.0.0-20190918200256-06eb1244587a - k8s.io/cloud-provider => k8s.io/cloud-provider v0.0.0-20190918203125-ae665f80358a + k8s.io/api => k8s.io/api v0.19.0-rc.2 + k8s.io/apimachinery => k8s.io/apimachinery v0.19.0-rc.2 + k8s.io/client-go => k8s.io/client-go v0.19.0-rc.2 + k8s.io/cloud-provider => k8s.io/cloud-provider v0.19.0-rc.2 + k8s.io/component-base => k8s.io/component-base v0.19.0-rc.2 ) diff --git a/vendor/k8s.io/csi-translation-lib/go.sum b/vendor/k8s.io/csi-translation-lib/go.sum index d9ff5bfc3..b9527549a 100644 --- a/vendor/k8s.io/csi-translation-lib/go.sum +++ b/vendor/k8s.io/csi-translation-lib/go.sum @@ -1,75 +1,373 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -github.com/Azure/go-autorest v11.1.2+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= +cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go v0.51.0/go.mod h1:hWtGJ6gnXH+KgDv+V0zFGDvpi07n3z8ZNj3T1RW0Gcw= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= +github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= +github.com/Azure/go-autorest/autorest v0.9.6/go.mod h1:/FALq9T/kS7b5J5qsQ+RSTUdAmGFqi0vUdVNNx8q630= +github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= +github.com/Azure/go-autorest/autorest/adal v0.8.2/go.mod h1:ZjhuQClTqx435SRJ2iMlOxPYt3d2C/T/7TiQCVZSn3Q= +github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA= +github.com/Azure/go-autorest/autorest/date v0.2.0/go.mod h1:vcORJHLJEh643/Ioh9+vPmf1Ij9AEBM5FuBIXLmIy0g= +github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= +github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= +github.com/Azure/go-autorest/autorest/mocks v0.3.0/go.mod h1:a8FDP3DYzQ4RYfVAxAN3SVSiiO77gL2j2ronKKP0syM= +github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= +github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= +github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= +github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/blang/semver v3.5.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dgrijalva/jwt-go v0.0.0-20160705203006-01aeca54ebda/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= +github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= -github.com/elazarl/goproxy v0.0.0-20170405201442-c4fc26588b6e/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= -github.com/evanphx/json-patch v0.0.0-20190203023257-5858425f7550/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= +github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= +github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/evanphx/json-patch v0.0.0-20190815234213-e83c0a1c26c8/go.mod h1:pmLOTb3x90VhIKxsA9yeQG5yfOkkKnkk1h+Ql8NDYDw= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/gogo/protobuf v0.0.0-20171007142547-342cbe0a0415 h1:WSBJMqJbLxsn+bTCPyPYZfqHdJmc8MK4wrBjMft6BAM= -github.com/gogo/protobuf v0.0.0-20171007142547-342cbe0a0415/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-logr/logr v0.1.0 h1:M1Tv3VzNlEHg6uyACnRdtrploV2P7wZqH8BoQMtz0cg= +github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= +github.com/go-logr/logr v0.2.0 h1:QvGt2nLcHH0WK9orKa+ppBPAxREcH364nPUedEpK0TY= +github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= +github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0= +github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg= +github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc= +github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls= +github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/google/btree v0.0.0-20160524151835-7d79101e329e/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf h1:+RRA9JqSOZFfKrOeqr2z77+8R2RKyh8PG66dcu1V0ck= -github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= -github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= -github.com/gophercloud/gophercloud v0.0.0-20190126172459-c818fa66e4c8/go.mod h1:3WdhXV3rUYy9p6AUW8d94kr+HS62Y4VL9mBnFxsD8q4= -github.com/gregjones/httpcache v0.0.0-20170728041850-787624de3eb7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g= +github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= +github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg= +github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= -github.com/json-iterator/go v0.0.0-20180701071628-ab8a2e0c74be h1:AHimNtVIpiBjPUhEF5KNCkrUyqTSA5zWUl8sQ2bfGBE= -github.com/json-iterator/go v0.0.0-20180701071628-ab8a2e0c74be/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.10 h1:Kz6Cvnvv2wGdaG/V8yMvfkmNiXq9Ya2KUv4rouJJr68= +github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= +github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= +github.com/moby/term v0.0.0-20200312100748-672ec06f55cd/go.mod h1:DdlQx2hp0Ss5/fLikoLlEeIYiATotOjgB//nb973jeo= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= +github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/gomega v0.0.0-20190113212917-5533ce8a0da3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= +github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/spf13/pflag v1.0.1 h1:aCvUg6QPl3ibpQUxyLkrEkCHtPqYJL4x9AuhqVqFis4= -github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= +github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= +github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= +github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= +github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -golang.org/x/crypto v0.0.0-20181025213731-e84da0312774/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200220183623-bac4c82f6975/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= 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-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190812203447-cdfb69ac37fc h1:gkKoSkUmnU6bpS/VhkuO27bzQeSA51uaEfbOW5dNb68= -golang.org/x/net v0.0.0-20190812203447-cdfb69ac37fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/oauth2 v0.0.0-20190402181905-9f3314589c9a/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e h1:3G+cUijn7XD+S4eJFddp53Pv7+slrESplyjG25HgL+k= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20190209173611-3b5209105503/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200622214017-ed371f2e16b4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db h1:6/JqlYfC1CCaLnGceQTI+sDGhC9UBSPAsBqI0Gun6kU= -golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/time v0.0.0-20161028155119-f51c12702a4d/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/tools v0.0.0-20190313210603-aa82965741a9/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +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/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/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= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +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 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= +gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/inf.v0 v0.9.0 h1:3zYtXIO92bvsdS3ggAdA8Gb4Azj0YU+TVY1uGYNFA8o= -gopkg.in/inf.v0 v0.9.0/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= +gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= +gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/yaml.v2 v2.2.1 h1:mUhvW9EsL+naU5Q3cakzfE91YhliOondGd6ZrsDBHQE= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -k8s.io/api v0.0.0-20190918195907-bd6ac527cfd2/go.mod h1:AOxZTnaXR/xiarlQL0JUfwQPxjmKDvVYoRp58cA7lUo= -k8s.io/apimachinery v0.0.0-20190817020851-f2f3a405f61d/go.mod h1:3jediapYqJ2w1BFw7lAZPCx7scubsTfosqHkhXCWJKw= -k8s.io/client-go v0.0.0-20190918200256-06eb1244587a/go.mod h1:3YAcTbI2ArBRmhHns5vlHRX8YQqvkVYpz+U/N5i1mVU= -k8s.io/cloud-provider v0.0.0-20190918203125-ae665f80358a/go.mod h1:hfxdMPnFjoiVZrbaHkBS0t56GelBDM199c4gOXAwQ/I= -k8s.io/klog v0.3.1 h1:RVgyDHY/kFKtLqh67NvEWIgkMneNoIrdkN0CxDSQc68= -k8s.io/klog v0.3.1/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= -k8s.io/kube-openapi v0.0.0-20190228160746-b3a7cee44a30/go.mod h1:BXM9ceUBTj2QnfH2MK1odQs778ajze1RxcmP6S8RVVc= -k8s.io/utils v0.0.0-20190221042446-c2654d5206da/go.mod h1:8k8uAuAQ0rXslZKaEWd0c3oVhZz7sSzSiPnVZayjIX0= -sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= +gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +k8s.io/api v0.19.0-rc.2/go.mod h1:9nHeM2gbqeaL7yN6UFvOxKzLG5gZ4v+DJ6bpavDetZo= +k8s.io/apimachinery v0.19.0-rc.2/go.mod h1:eHbWZVMaaewmYBAUuRYnAmTTMtDhvpPNZuh8/6Yl7v0= +k8s.io/client-go v0.19.0-rc.2/go.mod h1:8ELpdR+MEbL/z6gbYHpB52eKPKOVJNKj4I1WiR3g87A= +k8s.io/cloud-provider v0.19.0-rc.2/go.mod h1:qj7f/cA8+X6M7LGwipdF5iIQ0D7tgFilzZY/hmJB0L0= +k8s.io/component-base v0.19.0-rc.2/go.mod h1:aqXtywSxbTRUXnC1+1+DFIT1GXBxb6SogGhsHXmEbyc= +k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= +k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= +k8s.io/klog/v2 v2.2.0 h1:XRvcwJozkgZ1UQJmfMGpvRthQHOvihEhYtDfAaxMz/A= +k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= +k8s.io/kube-openapi v0.0.0-20200427153329-656914f816f9/go.mod h1:bfCVj+qXcEaE5SCvzBaqpOySr6tuCcpPKqF6HD8nyCw= +k8s.io/utils v0.0.0-20200720150651-0bdb4ca86cbc/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +sigs.k8s.io/structured-merge-diff/v3 v3.0.0-20200116222232-67a7b8c61874/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw= +sigs.k8s.io/structured-merge-diff/v3 v3.0.1-0.20200706213357-43c19bbb7fba h1:AAbnc5KQuTWKuh2QSnyghKIOTFzB0Jayv7/OFDn3Cy4= +sigs.k8s.io/structured-merge-diff/v3 v3.0.1-0.20200706213357-43c19bbb7fba/go.mod h1:V06abazjHneE37ZdSY/UUwPVgcJMKI/jU5XGUjgIKoc= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= +sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q= +sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= diff --git a/vendor/k8s.io/csi-translation-lib/plugins/aws_ebs.go b/vendor/k8s.io/csi-translation-lib/plugins/aws_ebs.go index 97c264f96..5db1e921f 100644 --- a/vendor/k8s.io/csi-translation-lib/plugins/aws_ebs.go +++ b/vendor/k8s.io/csi-translation-lib/plugins/aws_ebs.go @@ -23,8 +23,9 @@ import ( "strconv" "strings" - "k8s.io/api/core/v1" + v1 "k8s.io/api/core/v1" storage "k8s.io/api/storage/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) const ( @@ -32,6 +33,8 @@ const ( AWSEBSDriverName = "ebs.csi.aws.com" // AWSEBSInTreePluginName is the name of the intree plugin for EBS AWSEBSInTreePluginName = "kubernetes.io/aws-ebs" + // AWSEBSTopologyKey is the zonal topology key for AWS EBS CSI driver + AWSEBSTopologyKey = "topology." + AWSEBSDriverName + "/zone" ) var _ InTreePlugin = &awsElasticBlockStoreCSITranslator{} @@ -44,8 +47,39 @@ func NewAWSElasticBlockStoreCSITranslator() InTreePlugin { return &awsElasticBlockStoreCSITranslator{} } -// TranslateInTreeStorageClassParametersToCSI translates InTree EBS storage class parameters to CSI storage class +// TranslateInTreeStorageClassToCSI translates InTree EBS storage class parameters to CSI storage class func (t *awsElasticBlockStoreCSITranslator) TranslateInTreeStorageClassToCSI(sc *storage.StorageClass) (*storage.StorageClass, error) { + var ( + generatedTopologies []v1.TopologySelectorTerm + params = map[string]string{} + ) + for k, v := range sc.Parameters { + switch strings.ToLower(k) { + case fsTypeKey: + params[csiFsTypeKey] = v + case zoneKey: + generatedTopologies = generateToplogySelectors(AWSEBSTopologyKey, []string{v}) + case zonesKey: + generatedTopologies = generateToplogySelectors(AWSEBSTopologyKey, strings.Split(v, ",")) + default: + params[k] = v + } + } + + if len(generatedTopologies) > 0 && len(sc.AllowedTopologies) > 0 { + return nil, fmt.Errorf("cannot simultaneously set allowed topologies and zone/zones parameters") + } else if len(generatedTopologies) > 0 { + sc.AllowedTopologies = generatedTopologies + } else if len(sc.AllowedTopologies) > 0 { + newTopologies, err := translateAllowedTopologies(sc.AllowedTopologies, AWSEBSTopologyKey) + if err != nil { + return nil, fmt.Errorf("failed translating allowed topologies: %v", err) + } + sc.AllowedTopologies = newTopologies + } + + sc.Parameters = params + return sc, nil } @@ -56,12 +90,21 @@ func (t *awsElasticBlockStoreCSITranslator) TranslateInTreeInlineVolumeToCSI(vol return nil, fmt.Errorf("volume is nil or AWS EBS not defined on volume") } ebsSource := volume.AWSElasticBlockStore + volumeHandle, err := KubernetesVolumeIDToEBSVolumeID(ebsSource.VolumeID) + if err != nil { + return nil, fmt.Errorf("failed to translate Kubernetes ID to EBS Volume ID %v", err) + } pv := &v1.PersistentVolume{ + ObjectMeta: metav1.ObjectMeta{ + // Must be unique per disk as it is used as the unique part of the + // staging path + Name: fmt.Sprintf("%s-%s", AWSEBSDriverName, ebsSource.VolumeID), + }, Spec: v1.PersistentVolumeSpec{ PersistentVolumeSource: v1.PersistentVolumeSource{ CSI: &v1.CSIPersistentVolumeSource{ Driver: AWSEBSDriverName, - VolumeHandle: ebsSource.VolumeID, + VolumeHandle: volumeHandle, ReadOnly: ebsSource.ReadOnly, FSType: ebsSource.FSType, VolumeAttributes: map[string]string{ @@ -99,6 +142,10 @@ func (t *awsElasticBlockStoreCSITranslator) TranslateInTreePVToCSI(pv *v1.Persis }, } + if err := translateTopology(pv, AWSEBSTopologyKey); err != nil { + return nil, fmt.Errorf("failed to translate topology: %v", err) + } + pv.Spec.AWSElasticBlockStore = nil pv.Spec.CSI = csiSource return pv, nil @@ -122,7 +169,7 @@ func (t *awsElasticBlockStoreCSITranslator) TranslateCSIPVToInTree(pv *v1.Persis if partition, ok := csiSource.VolumeAttributes["partition"]; ok { partValue, err := strconv.Atoi(partition) if err != nil { - return nil, fmt.Errorf("Failed to convert partition %v to integer: %v", partition, err) + return nil, fmt.Errorf("failed to convert partition %v to integer: %v", partition, err) } ebsSource.Partition = int32(partValue) } @@ -156,6 +203,10 @@ func (t *awsElasticBlockStoreCSITranslator) GetCSIPluginName() string { return AWSEBSDriverName } +func (t *awsElasticBlockStoreCSITranslator) RepairVolumeHandle(volumeHandle, nodeID string) (string, error) { + return volumeHandle, nil +} + // awsVolumeRegMatch represents Regex Match for AWS volume. var awsVolumeRegMatch = regexp.MustCompile("^vol-[^/]*$") diff --git a/vendor/k8s.io/csi-translation-lib/plugins/azure_disk.go b/vendor/k8s.io/csi-translation-lib/plugins/azure_disk.go index 7b44c658b..8184881de 100644 --- a/vendor/k8s.io/csi-translation-lib/plugins/azure_disk.go +++ b/vendor/k8s.io/csi-translation-lib/plugins/azure_disk.go @@ -21,18 +21,22 @@ import ( "regexp" "strings" - "k8s.io/api/core/v1" + v1 "k8s.io/api/core/v1" storage "k8s.io/api/storage/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) const ( // AzureDiskDriverName is the name of the CSI driver for Azure Disk AzureDiskDriverName = "disk.csi.azure.com" + // AzureDiskTopologyKey is the topology key of Azure Disk CSI driver + AzureDiskTopologyKey = "topology.disk.csi.azure.com/zone" // AzureDiskInTreePluginName is the name of the intree plugin for Azure Disk AzureDiskInTreePluginName = "kubernetes.io/azure-disk" // Parameter names defined in azure disk CSI driver, refer to // https://github.com/kubernetes-sigs/azuredisk-csi-driver/blob/master/docs/driver-parameters.md + azureDiskKind = "kind" azureDiskCachingMode = "cachingMode" azureDiskFSType = "fsType" ) @@ -55,6 +59,35 @@ func NewAzureDiskCSITranslator() InTreePlugin { // TranslateInTreeStorageClassParametersToCSI translates InTree Azure Disk storage class parameters to CSI storage class func (t *azureDiskCSITranslator) TranslateInTreeStorageClassToCSI(sc *storage.StorageClass) (*storage.StorageClass, error) { + var ( + generatedTopologies []v1.TopologySelectorTerm + params = map[string]string{} + ) + for k, v := range sc.Parameters { + switch strings.ToLower(k) { + case zoneKey: + generatedTopologies = generateToplogySelectors(AzureDiskTopologyKey, []string{v}) + case zonesKey: + generatedTopologies = generateToplogySelectors(AzureDiskTopologyKey, strings.Split(v, ",")) + default: + params[k] = v + } + } + + if len(generatedTopologies) > 0 && len(sc.AllowedTopologies) > 0 { + return nil, fmt.Errorf("cannot simultaneously set allowed topologies and zone/zones parameters") + } else if len(generatedTopologies) > 0 { + sc.AllowedTopologies = generatedTopologies + } else if len(sc.AllowedTopologies) > 0 { + newTopologies, err := translateAllowedTopologies(sc.AllowedTopologies, AzureDiskTopologyKey) + if err != nil { + return nil, fmt.Errorf("failed translating allowed topologies: %v", err) + } + sc.AllowedTopologies = newTopologies + } + + sc.Parameters = params + return sc, nil } @@ -67,26 +100,36 @@ func (t *azureDiskCSITranslator) TranslateInTreeInlineVolumeToCSI(volume *v1.Vol azureSource := volume.AzureDisk pv := &v1.PersistentVolume{ + ObjectMeta: metav1.ObjectMeta{ + // Must be unique per disk as it is used as the unique part of the + // staging path + Name: fmt.Sprintf("%s-%s", AzureDiskDriverName, azureSource.DiskName), + }, Spec: v1.PersistentVolumeSpec{ PersistentVolumeSource: v1.PersistentVolumeSource{ CSI: &v1.CSIPersistentVolumeSource{ Driver: AzureDiskDriverName, VolumeHandle: azureSource.DataDiskURI, - ReadOnly: *azureSource.ReadOnly, - FSType: *azureSource.FSType, - VolumeAttributes: map[string]string{}, + VolumeAttributes: map[string]string{azureDiskKind: "Managed"}, }, }, AccessModes: []v1.PersistentVolumeAccessMode{v1.ReadWriteOnce}, }, } + if azureSource.ReadOnly != nil { + pv.Spec.PersistentVolumeSource.CSI.ReadOnly = *azureSource.ReadOnly + } - if *azureSource.CachingMode != "" { + if azureSource.CachingMode != nil && *azureSource.CachingMode != "" { pv.Spec.PersistentVolumeSource.CSI.VolumeAttributes[azureDiskCachingMode] = string(*azureSource.CachingMode) } - if *azureSource.FSType != "" { + if azureSource.FSType != nil { + pv.Spec.PersistentVolumeSource.CSI.FSType = *azureSource.FSType pv.Spec.PersistentVolumeSource.CSI.VolumeAttributes[azureDiskFSType] = *azureSource.FSType } + if azureSource.Kind != nil { + pv.Spec.PersistentVolumeSource.CSI.VolumeAttributes[azureDiskKind] = string(*azureSource.Kind) + } return pv, nil } @@ -98,28 +141,36 @@ func (t *azureDiskCSITranslator) TranslateInTreePVToCSI(pv *v1.PersistentVolume) return nil, fmt.Errorf("pv is nil or Azure Disk source not defined on pv") } - azureSource := pv.Spec.PersistentVolumeSource.AzureDisk + var ( + azureSource = pv.Spec.PersistentVolumeSource.AzureDisk - // refer to https://github.com/kubernetes-sigs/azuredisk-csi-driver/blob/master/docs/driver-parameters.md - csiSource := &v1.CSIPersistentVolumeSource{ - Driver: AzureDiskDriverName, - VolumeHandle: azureSource.DataDiskURI, - ReadOnly: *azureSource.ReadOnly, - FSType: *azureSource.FSType, - VolumeAttributes: map[string]string{}, - } + // refer to https://github.com/kubernetes-sigs/azuredisk-csi-driver/blob/master/docs/driver-parameters.md + csiSource = &v1.CSIPersistentVolumeSource{ + Driver: AzureDiskDriverName, + VolumeAttributes: map[string]string{azureDiskKind: "Managed"}, + VolumeHandle: azureSource.DataDiskURI, + } + ) - if *azureSource.CachingMode != "" { + if azureSource.CachingMode != nil { csiSource.VolumeAttributes[azureDiskCachingMode] = string(*azureSource.CachingMode) } - if *azureSource.FSType != "" { + if azureSource.FSType != nil { + csiSource.FSType = *azureSource.FSType csiSource.VolumeAttributes[azureDiskFSType] = *azureSource.FSType } + if azureSource.Kind != nil { + csiSource.VolumeAttributes[azureDiskKind] = string(*azureSource.Kind) + } + + if azureSource.ReadOnly != nil { + csiSource.ReadOnly = *azureSource.ReadOnly + } + pv.Spec.PersistentVolumeSource.AzureDisk = nil pv.Spec.PersistentVolumeSource.CSI = csiSource - pv.Spec.AccessModes = backwardCompatibleAccessModes(pv.Spec.AccessModes) return pv, nil } @@ -139,11 +190,13 @@ func (t *azureDiskCSITranslator) TranslateCSIPVToInTree(pv *v1.PersistentVolume) } // refer to https://github.com/kubernetes-sigs/azuredisk-csi-driver/blob/master/docs/driver-parameters.md + managed := v1.AzureManagedDisk azureSource := &v1.AzureDiskVolumeSource{ DiskName: diskName, DataDiskURI: diskURI, FSType: &csiSource.FSType, ReadOnly: &csiSource.ReadOnly, + Kind: &managed, } if csiSource.VolumeAttributes != nil { @@ -155,6 +208,11 @@ func (t *azureDiskCSITranslator) TranslateCSIPVToInTree(pv *v1.PersistentVolume) if fsType, ok := csiSource.VolumeAttributes[azureDiskFSType]; ok && fsType != "" { azureSource.FSType = &fsType } + + if kind, ok := csiSource.VolumeAttributes[azureDiskKind]; ok && kind != "" { + diskKind := v1.AzureDataDiskKind(kind) + azureSource.Kind = &diskKind + } } pv.Spec.CSI = nil @@ -187,6 +245,10 @@ func (t *azureDiskCSITranslator) GetCSIPluginName() string { return AzureDiskDriverName } +func (t *azureDiskCSITranslator) RepairVolumeHandle(volumeHandle, nodeID string) (string, error) { + return volumeHandle, nil +} + func isManagedDisk(diskURI string) bool { if len(diskURI) > 4 && strings.ToLower(diskURI[:4]) == "http" { return false diff --git a/vendor/k8s.io/csi-translation-lib/plugins/azure_file.go b/vendor/k8s.io/csi-translation-lib/plugins/azure_file.go index 2b58dbda7..ff1c2b0b5 100644 --- a/vendor/k8s.io/csi-translation-lib/plugins/azure_file.go +++ b/vendor/k8s.io/csi-translation-lib/plugins/azure_file.go @@ -18,10 +18,13 @@ package plugins import ( "fmt" + "regexp" "strings" - "k8s.io/api/core/v1" + v1 "k8s.io/api/core/v1" storage "k8s.io/api/storage/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/klog/v2" ) const ( @@ -31,14 +34,21 @@ const ( AzureFileInTreePluginName = "kubernetes.io/azure-file" separator = "#" - volumeIDTemplate = "%s#%s#%s" + volumeIDTemplate = "%s#%s#%s#%s" // Parameter names defined in azure file CSI driver, refer to // https://github.com/kubernetes-sigs/azurefile-csi-driver/blob/master/docs/driver-parameters.md azureFileShareName = "shareName" + + secretNameTemplate = "azure-storage-account-%s-secret" + defaultSecretNamespace = "default" + + resourceGroupAnnotation = "kubernetes.io/azure-file-resource-group" ) var _ InTreePlugin = &azureFileCSITranslator{} +var secretNameFormatRE = regexp.MustCompile(`azure-storage-account-(.+)-secret`) + // azureFileCSITranslator handles translation of PV spec from In-tree // Azure File to CSI Azure File and vice versa type azureFileCSITranslator struct{} @@ -57,27 +67,41 @@ func (t *azureFileCSITranslator) TranslateInTreeStorageClassToCSI(sc *storage.St // and converts the AzureFile source to a CSIPersistentVolumeSource func (t *azureFileCSITranslator) TranslateInTreeInlineVolumeToCSI(volume *v1.Volume) (*v1.PersistentVolume, error) { if volume == nil || volume.AzureFile == nil { - return nil, fmt.Errorf("volume is nil or AWS EBS not defined on volume") + return nil, fmt.Errorf("volume is nil or Azure File not defined on volume") } azureSource := volume.AzureFile + accountName, err := getStorageAccountName(azureSource.SecretName) + if err != nil { + klog.Warningf("getStorageAccountName(%s) returned with error: %v", azureSource.SecretName, err) + accountName = azureSource.SecretName + } - pv := &v1.PersistentVolume{ - Spec: v1.PersistentVolumeSpec{ - PersistentVolumeSource: v1.PersistentVolumeSource{ - CSI: &v1.CSIPersistentVolumeSource{ - VolumeHandle: fmt.Sprintf(volumeIDTemplate, "", azureSource.SecretName, azureSource.ShareName), - ReadOnly: azureSource.ReadOnly, - VolumeAttributes: map[string]string{azureFileShareName: azureSource.ShareName}, - NodePublishSecretRef: &v1.SecretReference{ - Name: azureSource.ShareName, - Namespace: "default", + var ( + pv = &v1.PersistentVolume{ + ObjectMeta: metav1.ObjectMeta{ + // Must be unique per disk as it is used as the unique part of the + // staging path + Name: fmt.Sprintf("%s-%s", AzureFileDriverName, azureSource.ShareName), + }, + Spec: v1.PersistentVolumeSpec{ + PersistentVolumeSource: v1.PersistentVolumeSource{ + CSI: &v1.CSIPersistentVolumeSource{ + Driver: AzureFileDriverName, + VolumeHandle: fmt.Sprintf(volumeIDTemplate, "", accountName, azureSource.ShareName, ""), + ReadOnly: azureSource.ReadOnly, + VolumeAttributes: map[string]string{azureFileShareName: azureSource.ShareName}, + NodeStageSecretRef: &v1.SecretReference{ + Name: azureSource.SecretName, + Namespace: defaultSecretNamespace, + }, }, }, + AccessModes: []v1.PersistentVolumeAccessMode{v1.ReadWriteMany}, }, - AccessModes: []v1.PersistentVolumeAccessMode{v1.ReadWriteMany}, - }, - } + } + ) + return pv, nil } @@ -89,23 +113,37 @@ func (t *azureFileCSITranslator) TranslateInTreePVToCSI(pv *v1.PersistentVolume) } azureSource := pv.Spec.PersistentVolumeSource.AzureFile - - volumeID := fmt.Sprintf(volumeIDTemplate, "", azureSource.SecretName, azureSource.ShareName) - // refer to https://github.com/kubernetes-sigs/azurefile-csi-driver/blob/master/docs/driver-parameters.md - csiSource := &v1.CSIPersistentVolumeSource{ - VolumeHandle: volumeID, - ReadOnly: azureSource.ReadOnly, - VolumeAttributes: map[string]string{azureFileShareName: azureSource.ShareName}, + accountName, err := getStorageAccountName(azureSource.SecretName) + if err != nil { + klog.Warningf("getStorageAccountName(%s) returned with error: %v", azureSource.SecretName, err) + accountName = azureSource.SecretName } + resourceGroup := "" + if v, ok := pv.ObjectMeta.Annotations[resourceGroupAnnotation]; ok { + resourceGroup = v + } + volumeID := fmt.Sprintf(volumeIDTemplate, resourceGroup, accountName, azureSource.ShareName, "") + + var ( + // refer to https://github.com/kubernetes-sigs/azurefile-csi-driver/blob/master/docs/driver-parameters.md + csiSource = &v1.CSIPersistentVolumeSource{ + Driver: AzureFileDriverName, + NodeStageSecretRef: &v1.SecretReference{ + Name: azureSource.SecretName, + Namespace: defaultSecretNamespace, + }, + ReadOnly: azureSource.ReadOnly, + VolumeAttributes: map[string]string{azureFileShareName: azureSource.ShareName}, + VolumeHandle: volumeID, + } + ) - csiSource.NodePublishSecretRef = &v1.SecretReference{ - Name: azureSource.ShareName, - Namespace: *azureSource.SecretNamespace, + if azureSource.SecretNamespace != nil { + csiSource.NodeStageSecretRef.Namespace = *azureSource.SecretNamespace } pv.Spec.PersistentVolumeSource.AzureFile = nil pv.Spec.PersistentVolumeSource.CSI = csiSource - pv.Spec.AccessModes = backwardCompatibleAccessModes(pv.Spec.AccessModes) return pv, nil } @@ -123,26 +161,30 @@ func (t *azureFileCSITranslator) TranslateCSIPVToInTree(pv *v1.PersistentVolume) ReadOnly: csiSource.ReadOnly, } - if csiSource.NodePublishSecretRef != nil && csiSource.NodePublishSecretRef.Name != "" { - azureSource.SecretName = csiSource.NodePublishSecretRef.Name - azureSource.SecretNamespace = &csiSource.NodePublishSecretRef.Namespace + resourceGroup := "" + if csiSource.NodeStageSecretRef != nil && csiSource.NodeStageSecretRef.Name != "" { + azureSource.SecretName = csiSource.NodeStageSecretRef.Name + azureSource.SecretNamespace = &csiSource.NodeStageSecretRef.Namespace if csiSource.VolumeAttributes != nil { if shareName, ok := csiSource.VolumeAttributes[azureFileShareName]; ok { azureSource.ShareName = shareName } } } else { - _, _, fileShareName, err := getFileShareInfo(csiSource.VolumeHandle) + rg, storageAccount, fileShareName, _, err := getFileShareInfo(csiSource.VolumeHandle) if err != nil { return nil, err } azureSource.ShareName = fileShareName - // to-do: for dynamic provision scenario in CSI, it uses cluster's identity to get storage account key - // secret for the file share is not created, we may create a serect here + azureSource.SecretName = fmt.Sprintf(secretNameTemplate, storageAccount) + resourceGroup = rg } pv.Spec.CSI = nil pv.Spec.AzureFile = azureSource + if resourceGroup != "" { + pv.ObjectMeta.Annotations[resourceGroupAnnotation] = resourceGroup + } return pv, nil } @@ -171,13 +213,30 @@ func (t *azureFileCSITranslator) GetCSIPluginName() string { return AzureFileDriverName } +func (t *azureFileCSITranslator) RepairVolumeHandle(volumeHandle, nodeID string) (string, error) { + return volumeHandle, nil +} + // get file share info according to volume id, e.g. -// input: "rg#f5713de20cde511e8ba4900#pvc-file-dynamic-17e43f84-f474-11e8-acd0-000d3a00df41" -// output: rg, f5713de20cde511e8ba4900, pvc-file-dynamic-17e43f84-f474-11e8-acd0-000d3a00df41 -func getFileShareInfo(id string) (string, string, string, error) { +// input: "rg#f5713de20cde511e8ba4900#pvc-file-dynamic-17e43f84-f474-11e8-acd0-000d3a00df41#diskname.vhd" +// output: rg, f5713de20cde511e8ba4900, pvc-file-dynamic-17e43f84-f474-11e8-acd0-000d3a00df41, diskname.vhd +func getFileShareInfo(id string) (string, string, string, string, error) { segments := strings.Split(id, separator) if len(segments) < 3 { - return "", "", "", fmt.Errorf("error parsing volume id: %q, should at least contain two #", id) + return "", "", "", "", fmt.Errorf("error parsing volume id: %q, should at least contain two #", id) + } + var diskName string + if len(segments) > 3 { + diskName = segments[3] + } + return segments[0], segments[1], segments[2], diskName, nil +} + +// get storage account name from secret name +func getStorageAccountName(secretName string) (string, error) { + matches := secretNameFormatRE.FindStringSubmatch(secretName) + if len(matches) != 2 { + return "", fmt.Errorf("could not get account name from %s, correct format: %s", secretName, secretNameFormatRE) } - return segments[0], segments[1], segments[2], nil + return matches[1], nil } diff --git a/vendor/k8s.io/csi-translation-lib/plugins/gce_pd.go b/vendor/k8s.io/csi-translation-lib/plugins/gce_pd.go index 1a9b11a13..95677562d 100644 --- a/vendor/k8s.io/csi-translation-lib/plugins/gce_pd.go +++ b/vendor/k8s.io/csi-translation-lib/plugins/gce_pd.go @@ -21,8 +21,9 @@ import ( "strconv" "strings" - "k8s.io/api/core/v1" + v1 "k8s.io/api/core/v1" storage "k8s.io/api/storage/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/sets" cloudvolume "k8s.io/cloud-provider/volume" ) @@ -40,9 +41,14 @@ const ( // "projects/{projectName}/zones/{zoneName}/disks/{diskName}" volIDZonalFmt = "projects/%s/zones/%s/disks/%s" // "projects/{projectName}/regions/{regionName}/disks/{diskName}" - volIDRegionalFmt = "projects/%s/regions/%s/disks/%s" - volIDDiskNameValue = 5 - volIDTotalElements = 6 + volIDRegionalFmt = "projects/%s/regions/%s/disks/%s" + volIDProjectValue = 1 + volIDRegionalityValue = 2 + volIDZoneValue = 3 + volIDDiskNameValue = 5 + volIDTotalElements = 6 + + nodeIDFmt = "projects/%s/zones/%s/instances/%s" // UnspecifiedValue is used for an unknown zone string UnspecifiedValue = "UNSPECIFIED" @@ -59,33 +65,6 @@ func NewGCEPersistentDiskCSITranslator() InTreePlugin { return &gcePersistentDiskCSITranslator{} } -func translateAllowedTopologies(terms []v1.TopologySelectorTerm) ([]v1.TopologySelectorTerm, error) { - if terms == nil { - return nil, nil - } - - newTopologies := []v1.TopologySelectorTerm{} - for _, term := range terms { - newTerm := v1.TopologySelectorTerm{} - for _, exp := range term.MatchLabelExpressions { - var newExp v1.TopologySelectorLabelRequirement - if exp.Key == v1.LabelZoneFailureDomain { - newExp = v1.TopologySelectorLabelRequirement{ - Key: GCEPDTopologyKey, - Values: exp.Values, - } - } else if exp.Key == GCEPDTopologyKey { - newExp = exp - } else { - return nil, fmt.Errorf("unknown topology key: %v", exp.Key) - } - newTerm.MatchLabelExpressions = append(newTerm.MatchLabelExpressions, newExp) - } - newTopologies = append(newTopologies, newTerm) - } - return newTopologies, nil -} - func generateToplogySelectors(key string, values []string) []v1.TopologySelectorTerm { return []v1.TopologySelectorTerm{ { @@ -106,13 +85,13 @@ func (g *gcePersistentDiskCSITranslator) TranslateInTreeStorageClassToCSI(sc *st np := map[string]string{} for k, v := range sc.Parameters { switch strings.ToLower(k) { - case "fstype": + case fsTypeKey: // prefixed fstype parameter is stripped out by external provisioner - np["csi.storage.k8s.io/fstype"] = v + np[csiFsTypeKey] = v // Strip out zone and zones parameters and translate them into topologies instead - case "zone": + case zoneKey: generatedTopologies = generateToplogySelectors(GCEPDTopologyKey, []string{v}) - case "zones": + case zonesKey: generatedTopologies = generateToplogySelectors(GCEPDTopologyKey, strings.Split(v, ",")) default: np[k] = v @@ -124,7 +103,7 @@ func (g *gcePersistentDiskCSITranslator) TranslateInTreeStorageClassToCSI(sc *st } else if len(generatedTopologies) > 0 { sc.AllowedTopologies = generatedTopologies } else if len(sc.AllowedTopologies) > 0 { - newTopologies, err := translateAllowedTopologies(sc.AllowedTopologies) + newTopologies, err := translateAllowedTopologies(sc.AllowedTopologies, GCEPDTopologyKey) if err != nil { return nil, fmt.Errorf("failed translating allowed topologies: %v", err) } @@ -141,19 +120,44 @@ func (g *gcePersistentDiskCSITranslator) TranslateInTreeStorageClassToCSI(sc *st // plugin never supported ReadWriteMany but also did not validate or enforce // this access mode for pre-provisioned volumes. The GCE PD CSI Driver validates // and enforces (fails) ReadWriteMany. Therefore we treat all in-tree -// ReadWriteMany as ReadWriteOnce volumes to not break legacy volumes. +// ReadWriteMany as ReadWriteOnce volumes to not break legacy volumes. It also +// takes [ReadWriteOnce, ReadOnlyMany] and makes it ReadWriteOnce. This is +// because the in-tree plugin does not enforce access modes and just attaches +// the disk in ReadWriteOnce mode; however, the CSI external-attacher will fail +// this combination because technically [ReadWriteOnce, ReadOnlyMany] is not +// supportable on an attached volume +// See: https://github.com/kubernetes-csi/external-attacher/issues/153 func backwardCompatibleAccessModes(ams []v1.PersistentVolumeAccessMode) []v1.PersistentVolumeAccessMode { if ams == nil { return nil } - newAM := []v1.PersistentVolumeAccessMode{} + + s := map[v1.PersistentVolumeAccessMode]bool{} + var newAM []v1.PersistentVolumeAccessMode + for _, am := range ams { if am == v1.ReadWriteMany { - newAM = append(newAM, v1.ReadWriteOnce) + // ReadWriteMany is unsupported in CSI, but in-tree did no + // validation and treated it as ReadWriteOnce + s[v1.ReadWriteOnce] = true } else { - newAM = append(newAM, am) + s[am] = true } } + + switch { + case s[v1.ReadOnlyMany] && s[v1.ReadWriteOnce]: + // ROX,RWO is unsupported in CSI, but in-tree did not validation and + // treated it as ReadWriteOnce + newAM = []v1.PersistentVolumeAccessMode{v1.ReadWriteOnce} + case s[v1.ReadWriteOnce]: + newAM = []v1.PersistentVolumeAccessMode{v1.ReadWriteOnce} + case s[v1.ReadOnlyMany]: + newAM = []v1.PersistentVolumeAccessMode{v1.ReadOnlyMany} + default: + newAM = []v1.PersistentVolumeAccessMode{v1.ReadWriteOnce} + } + return newAM } @@ -171,7 +175,20 @@ func (g *gcePersistentDiskCSITranslator) TranslateInTreeInlineVolumeToCSI(volume partition = strconv.Itoa(int(pdSource.Partition)) } - pv := &v1.PersistentVolume{ + var am v1.PersistentVolumeAccessMode + if pdSource.ReadOnly { + am = v1.ReadOnlyMany + } else { + am = v1.ReadWriteOnce + } + + fsMode := v1.PersistentVolumeFilesystem + return &v1.PersistentVolume{ + ObjectMeta: metav1.ObjectMeta{ + // Must be unique per disk as it is used as the unique part of the + // staging path + Name: fmt.Sprintf("%s-%s", GCEPDDriverName, pdSource.PDName), + }, Spec: v1.PersistentVolumeSpec{ PersistentVolumeSource: v1.PersistentVolumeSource{ CSI: &v1.CSIPersistentVolumeSource{ @@ -184,10 +201,10 @@ func (g *gcePersistentDiskCSITranslator) TranslateInTreeInlineVolumeToCSI(volume }, }, }, - AccessModes: []v1.PersistentVolumeAccessMode{v1.ReadWriteOnce}, + AccessModes: []v1.PersistentVolumeAccessMode{am}, + VolumeMode: &fsMode, }, - } - return pv, nil + }, nil } // TranslateInTreePVToCSI takes a PV with GCEPersistentDisk set from in-tree @@ -233,6 +250,10 @@ func (g *gcePersistentDiskCSITranslator) TranslateInTreePVToCSI(pv *v1.Persisten }, } + if err := translateTopology(pv, GCEPDTopologyKey); err != nil { + return nil, fmt.Errorf("failed to translate topology: %v", err) + } + pv.Spec.PersistentVolumeSource.GCEPersistentDisk = nil pv.Spec.PersistentVolumeSource.CSI = csiSource pv.Spec.AccessModes = backwardCompatibleAccessModes(pv.Spec.AccessModes) @@ -298,10 +319,53 @@ func (g *gcePersistentDiskCSITranslator) GetCSIPluginName() string { return GCEPDDriverName } +// RepairVolumeHandle returns a fully specified volume handle by inferring +// project, zone/region from the node ID if the volume handle has UNSPECIFIED +// sections +func (g *gcePersistentDiskCSITranslator) RepairVolumeHandle(volumeHandle, nodeID string) (string, error) { + var err error + tok := strings.Split(volumeHandle, "/") + if len(tok) < volIDTotalElements { + return "", fmt.Errorf("volume handle has wrong number of elements; got %v, wanted %v or more", len(tok), volIDTotalElements) + } + if tok[volIDProjectValue] != UnspecifiedValue { + return volumeHandle, nil + } + + nodeTok := strings.Split(nodeID, "/") + if len(nodeTok) < volIDTotalElements { + return "", fmt.Errorf("node handle has wrong number of elements; got %v, wanted %v or more", len(nodeTok), volIDTotalElements) + } + + switch tok[volIDRegionalityValue] { + case "zones": + zone := "" + if tok[volIDZoneValue] == UnspecifiedValue { + zone = nodeTok[volIDZoneValue] + } else { + zone = tok[volIDZoneValue] + } + return fmt.Sprintf(volIDZonalFmt, nodeTok[volIDProjectValue], zone, tok[volIDDiskNameValue]), nil + case "regions": + region := "" + if tok[volIDZoneValue] == UnspecifiedValue { + region, err = getRegionFromZones([]string{nodeTok[volIDZoneValue]}) + if err != nil { + return "", fmt.Errorf("failed to get region from zone %s: %v", nodeTok[volIDZoneValue], err) + } + } else { + region = tok[volIDZoneValue] + } + return fmt.Sprintf(volIDRegionalFmt, nodeTok[volIDProjectValue], region, tok[volIDDiskNameValue]), nil + default: + return "", fmt.Errorf("expected volume handle to have zones or regions regionality value, got: %s", tok[volIDRegionalityValue]) + } +} + func pdNameFromVolumeID(id string) (string, error) { splitID := strings.Split(id, "/") - if len(splitID) != volIDTotalElements { - return "", fmt.Errorf("failed to get id components. Expected projects/{project}/zones/{zone}/disks/{name}. Got: %s", id) + if len(splitID) < volIDTotalElements { + return "", fmt.Errorf("failed to get id components.Got: %v, wanted %v components or more. ", len(splitID), volIDTotalElements) } return splitID[volIDDiskNameValue], nil } diff --git a/vendor/k8s.io/csi-translation-lib/plugins/in_tree_volume.go b/vendor/k8s.io/csi-translation-lib/plugins/in_tree_volume.go index 2095084d8..be659416d 100644 --- a/vendor/k8s.io/csi-translation-lib/plugins/in_tree_volume.go +++ b/vendor/k8s.io/csi-translation-lib/plugins/in_tree_volume.go @@ -17,8 +17,14 @@ limitations under the License. package plugins import ( - "k8s.io/api/core/v1" + "errors" + "fmt" + "strings" + + v1 "k8s.io/api/core/v1" storage "k8s.io/api/storage/v1" + "k8s.io/apimachinery/pkg/util/sets" + cloudvolume "k8s.io/cloud-provider/volume" ) // InTreePlugin handles translations between CSI and in-tree sources in a PV @@ -55,4 +61,136 @@ type InTreePlugin interface { // GetCSIPluginName returns the name of the CSI plugin that supersedes the in-tree plugin GetCSIPluginName() string + + // RepairVolumeHandle generates a correct volume handle based on node ID information. + RepairVolumeHandle(volumeHandle, nodeID string) (string, error) +} + +const ( + // fsTypeKey is the deprecated storage class parameter key for fstype + fsTypeKey = "fstype" + // csiFsTypeKey is the storage class parameter key for CSI fstype + csiFsTypeKey = "csi.storage.k8s.io/fstype" + // zoneKey is the deprecated storage class parameter key for zone + zoneKey = "zone" + // zonesKey is the deprecated storage class parameter key for zones + zonesKey = "zones" +) + +// replaceTopology overwrites an existing topology key by a new one. +func replaceTopology(pv *v1.PersistentVolume, oldKey, newKey string) error { + for i := range pv.Spec.NodeAffinity.Required.NodeSelectorTerms { + for j, r := range pv.Spec.NodeAffinity.Required.NodeSelectorTerms[i].MatchExpressions { + if r.Key == oldKey { + pv.Spec.NodeAffinity.Required.NodeSelectorTerms[i].MatchExpressions[j].Key = newKey + } + } + } + return nil +} + +// getTopologyZones returns all topology zones with the given key found in the PV. +func getTopologyZones(pv *v1.PersistentVolume, key string) []string { + if pv.Spec.NodeAffinity == nil || + pv.Spec.NodeAffinity.Required == nil || + len(pv.Spec.NodeAffinity.Required.NodeSelectorTerms) < 1 { + return nil + } + + var values []string + for i := range pv.Spec.NodeAffinity.Required.NodeSelectorTerms { + for _, r := range pv.Spec.NodeAffinity.Required.NodeSelectorTerms[i].MatchExpressions { + if r.Key == key { + values = append(values, r.Values...) + } + } + } + return values +} + +// addTopology appends the topology to the given PV. +func addTopology(pv *v1.PersistentVolume, topologyKey string, zones []string) error { + // Make sure there are no duplicate or empty strings + filteredZones := sets.String{} + for i := range zones { + zone := strings.TrimSpace(zones[i]) + if len(zone) > 0 { + filteredZones.Insert(zone) + } + } + + zones = filteredZones.List() + if len(zones) < 1 { + return errors.New("there are no valid zones to add to pv") + } + + // Make sure the necessary fields exist + pv.Spec.NodeAffinity = new(v1.VolumeNodeAffinity) + pv.Spec.NodeAffinity.Required = new(v1.NodeSelector) + pv.Spec.NodeAffinity.Required.NodeSelectorTerms = make([]v1.NodeSelectorTerm, 1) + + topology := v1.NodeSelectorRequirement{ + Key: topologyKey, + Operator: v1.NodeSelectorOpIn, + Values: zones, + } + + pv.Spec.NodeAffinity.Required.NodeSelectorTerms[0].MatchExpressions = append( + pv.Spec.NodeAffinity.Required.NodeSelectorTerms[0].MatchExpressions, + topology, + ) + + return nil +} + +// translateTopology converts existing zone labels or in-tree topology to CSI topology. +// In-tree topology has precedence over zone labels. +func translateTopology(pv *v1.PersistentVolume, topologyKey string) error { + // If topology is already set, assume the content is accurate + if len(getTopologyZones(pv, topologyKey)) > 0 { + return nil + } + + zones := getTopologyZones(pv, v1.LabelZoneFailureDomain) + if len(zones) > 0 { + return replaceTopology(pv, v1.LabelZoneFailureDomain, topologyKey) + } + + if label, ok := pv.Labels[v1.LabelZoneFailureDomain]; ok { + zones = strings.Split(label, cloudvolume.LabelMultiZoneDelimiter) + if len(zones) > 0 { + return addTopology(pv, topologyKey, zones) + } + } + + return nil +} + +// translateAllowedTopologies translates allowed topologies within storage class +// from legacy failure domain to given CSI topology key +func translateAllowedTopologies(terms []v1.TopologySelectorTerm, key string) ([]v1.TopologySelectorTerm, error) { + if terms == nil { + return nil, nil + } + + newTopologies := []v1.TopologySelectorTerm{} + for _, term := range terms { + newTerm := v1.TopologySelectorTerm{} + for _, exp := range term.MatchLabelExpressions { + var newExp v1.TopologySelectorLabelRequirement + if exp.Key == v1.LabelZoneFailureDomain { + newExp = v1.TopologySelectorLabelRequirement{ + Key: key, + Values: exp.Values, + } + } else if exp.Key == key { + newExp = exp + } else { + return nil, fmt.Errorf("unknown topology key: %v", exp.Key) + } + newTerm.MatchLabelExpressions = append(newTerm.MatchLabelExpressions, newExp) + } + newTopologies = append(newTopologies, newTerm) + } + return newTopologies, nil } diff --git a/vendor/k8s.io/csi-translation-lib/plugins/openstack_cinder.go b/vendor/k8s.io/csi-translation-lib/plugins/openstack_cinder.go index 0573ebc05..f3e21bc76 100644 --- a/vendor/k8s.io/csi-translation-lib/plugins/openstack_cinder.go +++ b/vendor/k8s.io/csi-translation-lib/plugins/openstack_cinder.go @@ -19,13 +19,16 @@ package plugins import ( "fmt" - "k8s.io/api/core/v1" + v1 "k8s.io/api/core/v1" storage "k8s.io/api/storage/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) const ( // CinderDriverName is the name of the CSI driver for Cinder CinderDriverName = "cinder.csi.openstack.org" + // CinderTopologyKey is the zonal topology key for Cinder CSI Driver + CinderTopologyKey = "topology.cinder.csi.openstack.org/zone" // CinderInTreePluginName is the name of the intree plugin for Cinder CinderInTreePluginName = "kubernetes.io/cinder" ) @@ -54,6 +57,11 @@ func (t *osCinderCSITranslator) TranslateInTreeInlineVolumeToCSI(volume *v1.Volu cinderSource := volume.Cinder pv := &v1.PersistentVolume{ + ObjectMeta: metav1.ObjectMeta{ + // Must be unique per disk as it is used as the unique part of the + // staging path + Name: fmt.Sprintf("%s-%s", CinderDriverName, cinderSource.VolumeID), + }, Spec: v1.PersistentVolumeSpec{ PersistentVolumeSource: v1.PersistentVolumeSource{ CSI: &v1.CSIPersistentVolumeSource{ @@ -87,6 +95,10 @@ func (t *osCinderCSITranslator) TranslateInTreePVToCSI(pv *v1.PersistentVolume) VolumeAttributes: map[string]string{}, } + if err := translateTopology(pv, CinderTopologyKey); err != nil { + return nil, fmt.Errorf("failed to translate topology: %v", err) + } + pv.Spec.Cinder = nil pv.Spec.CSI = csiSource return pv, nil @@ -135,3 +147,7 @@ func (t *osCinderCSITranslator) GetInTreePluginName() string { func (t *osCinderCSITranslator) GetCSIPluginName() string { return CinderDriverName } + +func (t *osCinderCSITranslator) RepairVolumeHandle(volumeHandle, nodeID string) (string, error) { + return volumeHandle, nil +} diff --git a/vendor/k8s.io/csi-translation-lib/plugins/vsphere_volume.go b/vendor/k8s.io/csi-translation-lib/plugins/vsphere_volume.go new file mode 100644 index 000000000..531aff0d9 --- /dev/null +++ b/vendor/k8s.io/csi-translation-lib/plugins/vsphere_volume.go @@ -0,0 +1,208 @@ +/* +Copyright 2020 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package plugins + +import ( + "fmt" + "strings" + + v1 "k8s.io/api/core/v1" + storage "k8s.io/api/storage/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/klog/v2" +) + +const ( + // VSphereDriverName is the name of the CSI driver for vSphere Volume + VSphereDriverName = "csi.vsphere.vmware.com" + // VSphereInTreePluginName is the name of the in-tree plugin for vSphere Volume + VSphereInTreePluginName = "kubernetes.io/vsphere-volume" + + // paramStoragePolicyName used to supply SPBM Policy name for Volume provisioning + paramStoragePolicyName = "storagepolicyname" + + // This param is used to tell Driver to return volumePath and not VolumeID + // in-tree vSphere plugin does not understand volume id, it uses volumePath + paramcsiMigration = "csimigration" + + // This param is used to supply datastore name for Volume provisioning + paramDatastore = "datastore-migrationparam" + + // This param supplies disk foramt (thin, thick, zeoredthick) for Volume provisioning + paramDiskFormat = "diskformat-migrationparam" + + // vSAN Policy Parameters + paramHostFailuresToTolerate = "hostfailurestotolerate-migrationparam" + paramForceProvisioning = "forceprovisioning-migrationparam" + paramCacheReservation = "cachereservation-migrationparam" + paramDiskstripes = "diskstripes-migrationparam" + paramObjectspacereservation = "objectspacereservation-migrationparam" + paramIopslimit = "iopslimit-migrationparam" + + // AttributeInitialVolumeFilepath represents the path of volume where volume is created + AttributeInitialVolumeFilepath = "initialvolumefilepath" +) + +var _ InTreePlugin = &vSphereCSITranslator{} + +// vSphereCSITranslator handles translation of PV spec from In-tree vSphere Volume to vSphere CSI +type vSphereCSITranslator struct{} + +// NewvSphereCSITranslator returns a new instance of vSphereCSITranslator +func NewvSphereCSITranslator() InTreePlugin { + return &vSphereCSITranslator{} +} + +// TranslateInTreeStorageClassToCSI translates InTree vSphere storage class parameters to CSI storage class +func (t *vSphereCSITranslator) TranslateInTreeStorageClassToCSI(sc *storage.StorageClass) (*storage.StorageClass, error) { + if sc == nil { + return nil, fmt.Errorf("sc is nil") + } + var params = map[string]string{} + for k, v := range sc.Parameters { + switch strings.ToLower(k) { + case fsTypeKey: + params[csiFsTypeKey] = v + case paramStoragePolicyName: + params[paramStoragePolicyName] = v + case "datastore": + params[paramDatastore] = v + case "diskformat": + params[paramDiskFormat] = v + case "hostfailurestotolerate": + params[paramHostFailuresToTolerate] = v + case "forceprovisioning": + params[paramForceProvisioning] = v + case "cachereservation": + params[paramCacheReservation] = v + case "diskstripes": + params[paramDiskstripes] = v + case "objectspacereservation": + params[paramObjectspacereservation] = v + case "iopslimit": + params[paramIopslimit] = v + default: + klog.V(2).Infof("StorageClass parameter [name:%q, value:%q] is not supported", k, v) + } + } + + // This helps vSphere CSI driver to identify in-tree provisioner request vs CSI provisioner request + // When this is true, Driver returns initialvolumefilepath in the VolumeContext, which is + // used in TranslateCSIPVToInTree + params[paramcsiMigration] = "true" + // Note: sc.AllowedTopologies for Topology based volume provisioning will be supplied as it is. + sc.Parameters = params + return sc, nil +} + +// TranslateInTreeInlineVolumeToCSI takes a Volume with VsphereVolume set from in-tree +// and converts the VsphereVolume source to a CSIPersistentVolumeSource +func (t *vSphereCSITranslator) TranslateInTreeInlineVolumeToCSI(volume *v1.Volume) (*v1.PersistentVolume, error) { + if volume == nil || volume.VsphereVolume == nil { + return nil, fmt.Errorf("volume is nil or VsphereVolume not defined on volume") + } + pv := &v1.PersistentVolume{ + ObjectMeta: metav1.ObjectMeta{ + // Must be unique per disk as it is used as the unique part of the + // staging path + Name: fmt.Sprintf("%s-%s", VSphereDriverName, volume.VsphereVolume.VolumePath), + }, + Spec: v1.PersistentVolumeSpec{ + PersistentVolumeSource: v1.PersistentVolumeSource{ + CSI: &v1.CSIPersistentVolumeSource{ + Driver: VSphereDriverName, + VolumeHandle: volume.VsphereVolume.VolumePath, + FSType: volume.VsphereVolume.FSType, + VolumeAttributes: make(map[string]string), + }, + }, + AccessModes: []v1.PersistentVolumeAccessMode{v1.ReadWriteOnce}, + }, + } + if volume.VsphereVolume.StoragePolicyName != "" { + pv.Spec.CSI.VolumeAttributes[paramStoragePolicyName] = pv.Spec.VsphereVolume.StoragePolicyName + } + return pv, nil +} + +// TranslateInTreePVToCSI takes a PV with VsphereVolume set from in-tree +// and converts the VsphereVolume source to a CSIPersistentVolumeSource +func (t *vSphereCSITranslator) TranslateInTreePVToCSI(pv *v1.PersistentVolume) (*v1.PersistentVolume, error) { + if pv == nil || pv.Spec.VsphereVolume == nil { + return nil, fmt.Errorf("pv is nil or VsphereVolume not defined on pv") + } + csiSource := &v1.CSIPersistentVolumeSource{ + Driver: VSphereDriverName, + VolumeHandle: pv.Spec.VsphereVolume.VolumePath, + FSType: pv.Spec.VsphereVolume.FSType, + VolumeAttributes: make(map[string]string), + } + if pv.Spec.VsphereVolume.StoragePolicyName != "" { + csiSource.VolumeAttributes[paramStoragePolicyName] = pv.Spec.VsphereVolume.StoragePolicyName + } + pv.Spec.VsphereVolume = nil + pv.Spec.CSI = csiSource + return pv, nil +} + +// TranslateCSIPVToInTree takes a PV with CSIPersistentVolumeSource set and +// translates the vSphere CSI source to a vSphereVolume source. +func (t *vSphereCSITranslator) TranslateCSIPVToInTree(pv *v1.PersistentVolume) (*v1.PersistentVolume, error) { + if pv == nil || pv.Spec.CSI == nil { + return nil, fmt.Errorf("pv is nil or CSI source not defined on pv") + } + csiSource := pv.Spec.CSI + vsphereVirtualDiskVolumeSource := &v1.VsphereVirtualDiskVolumeSource{ + FSType: csiSource.FSType, + } + volumeFilePath, ok := csiSource.VolumeAttributes[AttributeInitialVolumeFilepath] + if ok { + vsphereVirtualDiskVolumeSource.VolumePath = volumeFilePath + } + pv.Spec.CSI = nil + pv.Spec.VsphereVolume = vsphereVirtualDiskVolumeSource + return pv, nil +} + +// CanSupport tests whether the plugin supports a given persistent volume +// specification from the API. +func (t *vSphereCSITranslator) CanSupport(pv *v1.PersistentVolume) bool { + return pv != nil && pv.Spec.VsphereVolume != nil +} + +// CanSupportInline tests whether the plugin supports a given inline volume +// specification from the API. +func (t *vSphereCSITranslator) CanSupportInline(volume *v1.Volume) bool { + return volume != nil && volume.VsphereVolume != nil +} + +// GetInTreePluginName returns the name of the in-tree plugin driver +func (t *vSphereCSITranslator) GetInTreePluginName() string { + return VSphereInTreePluginName +} + +// GetCSIPluginName returns the name of the CSI plugin +func (t *vSphereCSITranslator) GetCSIPluginName() string { + return VSphereDriverName +} + +// RepairVolumeHandle is needed in VerifyVolumesAttached on the external attacher when we need to do strict volume +// handle matching to check VolumeAttachment attached status. +// vSphere volume does not need patch to help verify whether that volume is attached. +func (t *vSphereCSITranslator) RepairVolumeHandle(volumeHandle, nodeID string) (string, error) { + return volumeHandle, nil +} diff --git a/vendor/k8s.io/csi-translation-lib/translate.go b/vendor/k8s.io/csi-translation-lib/translate.go index 46ae1cbbf..21f5c49d5 100644 --- a/vendor/k8s.io/csi-translation-lib/translate.go +++ b/vendor/k8s.io/csi-translation-lib/translate.go @@ -20,7 +20,7 @@ import ( "errors" "fmt" - "k8s.io/api/core/v1" + v1 "k8s.io/api/core/v1" storage "k8s.io/api/storage/v1" "k8s.io/csi-translation-lib/plugins" ) @@ -32,12 +32,24 @@ var ( plugins.CinderDriverName: plugins.NewOpenStackCinderCSITranslator(), plugins.AzureDiskDriverName: plugins.NewAzureDiskCSITranslator(), plugins.AzureFileDriverName: plugins.NewAzureFileCSITranslator(), + plugins.VSphereDriverName: plugins.NewvSphereCSITranslator(), } ) +// CSITranslator translates in-tree storage API objects to their equivalent CSI +// API objects. It also provides many helper functions to determine whether +// translation logic exists and the mappings between "in-tree plugin <-> csi driver" +type CSITranslator struct{} + +// New creates a new CSITranslator which does real translation +// for "in-tree plugins <-> csi drivers" +func New() CSITranslator { + return CSITranslator{} +} + // TranslateInTreeStorageClassToCSI takes in-tree Storage Class // and translates it to a set of parameters consumable by CSI plugin -func TranslateInTreeStorageClassToCSI(inTreePluginName string, sc *storage.StorageClass) (*storage.StorageClass, error) { +func (CSITranslator) TranslateInTreeStorageClassToCSI(inTreePluginName string, sc *storage.StorageClass) (*storage.StorageClass, error) { newSC := sc.DeepCopy() for _, curPlugin := range inTreePlugins { if inTreePluginName == curPlugin.GetInTreePluginName() { @@ -50,13 +62,26 @@ func TranslateInTreeStorageClassToCSI(inTreePluginName string, sc *storage.Stora // TranslateInTreeInlineVolumeToCSI takes a inline volume and will translate // the in-tree volume source to a CSIPersistentVolumeSource (wrapped in a PV) // if the translation logic has been implemented. -func TranslateInTreeInlineVolumeToCSI(volume *v1.Volume) (*v1.PersistentVolume, error) { +func (CSITranslator) TranslateInTreeInlineVolumeToCSI(volume *v1.Volume) (*v1.PersistentVolume, error) { if volume == nil { return nil, fmt.Errorf("persistent volume was nil") } for _, curPlugin := range inTreePlugins { if curPlugin.CanSupportInline(volume) { - return curPlugin.TranslateInTreeInlineVolumeToCSI(volume) + pv, err := curPlugin.TranslateInTreeInlineVolumeToCSI(volume) + if err != nil { + return nil, err + } + // Inline volumes only support PersistentVolumeFilesystem (and not block). + // If VolumeMode has not been set explicitly by plugin-specific + // translator, set it to Filesystem here. + // This is only necessary for inline volumes as the default PV + // initialization that populates VolumeMode does not apply to inline volumes. + if pv.Spec.VolumeMode == nil { + volumeMode := v1.PersistentVolumeFilesystem + pv.Spec.VolumeMode = &volumeMode + } + return pv, nil } } return nil, fmt.Errorf("could not find in-tree plugin translation logic for %#v", volume.Name) @@ -66,7 +91,7 @@ func TranslateInTreeInlineVolumeToCSI(volume *v1.Volume) (*v1.PersistentVolume, // the in-tree source to a CSI Source if the translation logic // has been implemented. The input persistent volume will not // be modified -func TranslateInTreePVToCSI(pv *v1.PersistentVolume) (*v1.PersistentVolume, error) { +func (CSITranslator) TranslateInTreePVToCSI(pv *v1.PersistentVolume) (*v1.PersistentVolume, error) { if pv == nil { return nil, errors.New("persistent volume was nil") } @@ -82,7 +107,7 @@ func TranslateInTreePVToCSI(pv *v1.PersistentVolume) (*v1.PersistentVolume, erro // TranslateCSIPVToInTree takes a PV with a CSI PersistentVolume Source and will translate // it to a in-tree Persistent Volume Source for the specific in-tree volume specified // by the `Driver` field in the CSI Source. The input PV object will not be modified. -func TranslateCSIPVToInTree(pv *v1.PersistentVolume) (*v1.PersistentVolume, error) { +func (CSITranslator) TranslateCSIPVToInTree(pv *v1.PersistentVolume) (*v1.PersistentVolume, error) { if pv == nil || pv.Spec.CSI == nil { return nil, errors.New("CSI persistent volume was nil") } @@ -97,7 +122,7 @@ func TranslateCSIPVToInTree(pv *v1.PersistentVolume) (*v1.PersistentVolume, erro // IsMigratableIntreePluginByName tests whether there is migration logic for the in-tree plugin // whose name matches the given name -func IsMigratableIntreePluginByName(inTreePluginName string) bool { +func (CSITranslator) IsMigratableIntreePluginByName(inTreePluginName string) bool { for _, curPlugin := range inTreePlugins { if curPlugin.GetInTreePluginName() == inTreePluginName { return true @@ -108,7 +133,7 @@ func IsMigratableIntreePluginByName(inTreePluginName string) bool { // IsMigratedCSIDriverByName tests whether there exists an in-tree plugin with logic // to migrate to the CSI driver with given name -func IsMigratedCSIDriverByName(csiPluginName string) bool { +func (CSITranslator) IsMigratedCSIDriverByName(csiPluginName string) bool { if _, ok := inTreePlugins[csiPluginName]; ok { return true } @@ -116,7 +141,7 @@ func IsMigratedCSIDriverByName(csiPluginName string) bool { } // GetInTreePluginNameFromSpec returns the plugin name -func GetInTreePluginNameFromSpec(pv *v1.PersistentVolume, vol *v1.Volume) (string, error) { +func (CSITranslator) GetInTreePluginNameFromSpec(pv *v1.PersistentVolume, vol *v1.Volume) (string, error) { if pv != nil { for _, curPlugin := range inTreePlugins { if curPlugin.CanSupport(pv) { @@ -125,8 +150,12 @@ func GetInTreePluginNameFromSpec(pv *v1.PersistentVolume, vol *v1.Volume) (strin } return "", fmt.Errorf("could not find in-tree plugin name from persistent volume %v", pv) } else if vol != nil { - // TODO(dyzz): Implement inline volume migration support - return "", errors.New("inline volume migration not yet supported") + for _, curPlugin := range inTreePlugins { + if curPlugin.CanSupportInline(vol) { + return curPlugin.GetInTreePluginName(), nil + } + } + return "", fmt.Errorf("could not find in-tree plugin name from volume %v", vol) } else { return "", errors.New("both persistent volume and volume are nil") } @@ -134,7 +163,7 @@ func GetInTreePluginNameFromSpec(pv *v1.PersistentVolume, vol *v1.Volume) (strin // GetCSINameFromInTreeName returns the name of a CSI driver that supersedes the // in-tree plugin with the given name -func GetCSINameFromInTreeName(pluginName string) (string, error) { +func (CSITranslator) GetCSINameFromInTreeName(pluginName string) (string, error) { for csiDriverName, curPlugin := range inTreePlugins { if curPlugin.GetInTreePluginName() == pluginName { return csiDriverName, nil @@ -145,15 +174,15 @@ func GetCSINameFromInTreeName(pluginName string) (string, error) { // GetInTreeNameFromCSIName returns the name of the in-tree plugin superseded by // a CSI driver with the given name -func GetInTreeNameFromCSIName(pluginName string) (string, error) { +func (CSITranslator) GetInTreeNameFromCSIName(pluginName string) (string, error) { if plugin, ok := inTreePlugins[pluginName]; ok { return plugin.GetInTreePluginName(), nil } - return "", fmt.Errorf("Could not find In-Tree driver name for CSI plugin %v", pluginName) + return "", fmt.Errorf("could not find In-Tree driver name for CSI plugin %v", pluginName) } // IsPVMigratable tests whether there is migration logic for the given Persistent Volume -func IsPVMigratable(pv *v1.PersistentVolume) bool { +func (CSITranslator) IsPVMigratable(pv *v1.PersistentVolume) bool { for _, curPlugin := range inTreePlugins { if curPlugin.CanSupport(pv) { return true @@ -163,7 +192,7 @@ func IsPVMigratable(pv *v1.PersistentVolume) bool { } // IsInlineMigratable tests whether there is Migration logic for the given Inline Volume -func IsInlineMigratable(vol *v1.Volume) bool { +func (CSITranslator) IsInlineMigratable(vol *v1.Volume) bool { for _, curPlugin := range inTreePlugins { if curPlugin.CanSupportInline(vol) { return true @@ -171,3 +200,11 @@ func IsInlineMigratable(vol *v1.Volume) bool { } return false } + +// RepairVolumeHandle generates a correct volume handle based on node ID information. +func (CSITranslator) RepairVolumeHandle(driverName, volumeHandle, nodeID string) (string, error) { + if plugin, ok := inTreePlugins[driverName]; ok { + return plugin.RepairVolumeHandle(volumeHandle, nodeID) + } + return "", fmt.Errorf("could not find In-Tree driver name for CSI plugin %v", driverName) +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 779a91a10..10a0ebf90 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -483,12 +483,12 @@ k8s.io/client-go/util/flowcontrol k8s.io/client-go/util/homedir k8s.io/client-go/util/keyutil k8s.io/client-go/util/workqueue -# k8s.io/cloud-provider v0.0.0-20190918203125-ae665f80358a => k8s.io/cloud-provider v0.19.0-rc.2 +# k8s.io/cloud-provider v0.19.0-rc.2 => k8s.io/cloud-provider v0.19.0-rc.2 k8s.io/cloud-provider/volume # k8s.io/component-base v0.19.0-rc.2 => k8s.io/component-base v0.19.0-rc.2 k8s.io/component-base/metrics k8s.io/component-base/version -# k8s.io/csi-translation-lib v0.19.0-rc.2 => k8s.io/csi-translation-lib v0.0.0-20190918203248-97c07dcbb623 +# k8s.io/csi-translation-lib v0.19.0-rc.2 k8s.io/csi-translation-lib k8s.io/csi-translation-lib/plugins # k8s.io/klog v1.0.0 From 843bddca1493740fe733d44f749e8ba1e450ad72 Mon Sep 17 00:00:00 2001 From: Michelle Au Date: Wed, 5 Aug 2020 13:29:03 -0700 Subject: [PATCH 02/17] Add steps on promoting release images --- SIDECAR_RELEASE_PROCESS.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/SIDECAR_RELEASE_PROCESS.md b/SIDECAR_RELEASE_PROCESS.md index 6960607ef..f6434c825 100644 --- a/SIDECAR_RELEASE_PROCESS.md +++ b/SIDECAR_RELEASE_PROCESS.md @@ -86,6 +86,12 @@ naming convention `-on-`. [external-provisioner example](https://github.com/kubernetes-csi/external-provisioner/releases/new) 1. If release was a new major/minor version, create a new `release-` branch at that commit. +1. Check [image build status](https://k8s-testgrid.appspot.com/sig-storage-image-build). +1. Promote images from k8s-staging-sig-storage to k8s.gcr.io/sig-storage. From + the [k8s image + repo](https://github.com/kubernetes/k8s.io/tree/master/k8s.gcr.io/images/k8s-staging-sig-storage), + run `./generate.sh > images.yaml`, and send a PR with the updated images. + Once merged, the image promoter will copy the images from staging to prod. 1. Update [kubernetes-csi/docs](https://github.com/kubernetes-csi/docs) sidecar and feature pages with the new released version. 1. After all the sidecars have been released, update From 77f4ef877e47c891aa52e62309e90ceaa40c5983 Mon Sep 17 00:00:00 2001 From: Humble Chirammal Date: Thu, 6 Aug 2020 13:15:47 +0530 Subject: [PATCH 03/17] Replace `csiTimeout` to `timeout` param for resizer At present the resizer has CSI call timeout value taken as arg in form of `--csiTimeout` , however all other sidecars have this parameter as `--timeout`. This patch replaces `csiTimeout` to `timeout` value NOTE: This is a breaking change, so we need a new release Signed-off-by: Humble Chirammal --- README.md | 2 +- cmd/csi-resizer/main.go | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index e709900b9..b0fed3bdf 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ Note that the external-resizer does not scale with more replicas. Only one exter * `--leader-election-namespace`: Namespace where the leader election resource lives. Defaults to the pod namespace if not set. -* `--csiTimeout `: Timeout of all calls to CSI driver. It should be set to value that accommodates majority of `ControllerExpandVolume` calls. 15 seconds is used by default. +* `--timeout `: Timeout of all calls to CSI driver. It should be set to value that accommodates majority of `ControllerExpandVolume` calls. 10 seconds is used by default. * `--retry-interval-start`: The starting value of the exponential backoff for failures. 1 second is used by default. diff --git a/cmd/csi-resizer/main.go b/cmd/csi-resizer/main.go index 0d7740229..fad34c5f2 100644 --- a/cmd/csi-resizer/main.go +++ b/cmd/csi-resizer/main.go @@ -20,11 +20,12 @@ import ( "context" "flag" "fmt" + "os" + "time" + "k8s.io/client-go/kubernetes" "k8s.io/client-go/rest" "k8s.io/client-go/tools/clientcmd" - "os" - "time" "k8s.io/client-go/util/workqueue" @@ -44,8 +45,9 @@ var ( resyncPeriod = flag.Duration("resync-period", time.Minute*10, "Resync period for cache") workers = flag.Int("workers", 10, "Concurrency to process multiple resize requests") - csiAddress = flag.String("csi-address", "/run/csi/socket", "Address of the CSI driver socket.") - csiTimeout = flag.Duration("csiTimeout", 15*time.Second, "Timeout for waiting for CSI driver socket.") + csiAddress = flag.String("csi-address", "/run/csi/socket", "Address of the CSI driver socket.") + timeout = flag.Duration("timeout", 10*time.Second, "Timeout for waiting for CSI driver socket.") + showVersion = flag.Bool("version", false, "Show version") retryIntervalStart = flag.Duration("retry-interval-start", time.Second, "Initial retry interval of failed volume resize. It exponentially increases with each failure, up to retry-interval-max.") @@ -99,7 +101,7 @@ func main() { csiResizer, err := resizer.NewResizer( *csiAddress, - *csiTimeout, + *timeout, kubeClient, informerFactory, *metricsAddress, From 82d108acdc4dd4cbd6d8d97534000dd5d8ea7e8d Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Wed, 12 Aug 2020 09:42:55 +0200 Subject: [PATCH 04/17] switch to Go 1.15 Go 1.15 was released and is the major version that Kubernetes 1.19.0 is going to use. There are probably bugs in the older 1.13.3 that were fixed, so we should update. --- travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/travis.yml b/travis.yml index bfd7647ba..1ab13aef2 100644 --- a/travis.yml +++ b/travis.yml @@ -6,7 +6,7 @@ git: depth: false matrix: include: - - go: 1.13.3 + - go: 1.15 before_script: - mkdir -p bin - wget https://github.com/golang/dep/releases/download/v0.5.1/dep-linux-amd64 -O bin/dep From 3b4a2f1d956845ab094e61d8701eab2080226cd3 Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Fri, 14 Aug 2020 14:21:51 +0200 Subject: [PATCH 05/17] prow.sh: fix installing Go for Kubernetes 1.19.0 Kubernetes 1.19.0 uses Go 1.15, but refers to it as 1.15.0. This broke both the check whether we need to install 1.15 (because "go version" reports 1.15, which didn't match 1.15.0) and then downloading the release archive (because the URL also only uses 1.15). --- prow.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/prow.sh b/prow.sh index 9778635f9..8ce80cf87 100755 --- a/prow.sh +++ b/prow.sh @@ -513,6 +513,10 @@ go_version_for_kubernetes () ( if ! [ "$go_version" ]; then die "Unable to determine Go version for Kubernetes $version from hack/lib/golang.sh." fi + # Strip the trailing .0. Kubernetes includes it, Go itself doesn't. + # Ignore: See if you can use ${variable//search/replace} instead. + # shellcheck disable=SC2001 + go_version="$(echo "$go_version" | sed -e 's/\.0$//')" echo "$go_version" ) From 0979c091026916e3593022951c08d4f79bdb2bdf Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Fri, 14 Aug 2020 14:23:51 +0200 Subject: [PATCH 06/17] prow.sh: fix E2E suite for Kubernetes >= 1.18 It used to be necessary to override from where the E2E suite came on a case-by-case basis (initially, testing was using a more recent suite against an older Kubernetes). This should never become necessary again and the lack of a specific entry for 1.18 already had the unintended effect that Kubernetes 1.18 was tested with the suite from master, so overall it is better to always use the E2E suite which matches Kubernetes. --- prow.sh | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/prow.sh b/prow.sh index 8ce80cf87..05d397a97 100755 --- a/prow.sh +++ b/prow.sh @@ -218,17 +218,18 @@ configvar CSI_PROW_DRIVER_CANARY "${CSI_PROW_HOSTPATH_CANARY}" "driver image ove # all generated files are present. # # CSI_PROW_E2E_REPO=none disables E2E testing. -# TOOO: remove versioned variables and make e2e version match k8s version -configvar CSI_PROW_E2E_VERSION_1_15 v1.15.0 "E2E version for Kubernetes 1.15.x" -configvar CSI_PROW_E2E_VERSION_1_16 v1.16.0 "E2E version for Kubernetes 1.16.x" -configvar CSI_PROW_E2E_VERSION_1_17 v1.17.0 "E2E version for Kubernetes 1.17.x" -# TODO: add new CSI_PROW_E2E_VERSION entry for future Kubernetes releases -configvar CSI_PROW_E2E_VERSION_LATEST master "E2E version for Kubernetes master" # testing against Kubernetes master is already tracking a moving target, so we might as well use a moving E2E version -configvar CSI_PROW_E2E_REPO_LATEST https://github.com/kubernetes/kubernetes "E2E repo for Kubernetes >= 1.13.x" # currently the same for all versions -configvar CSI_PROW_E2E_IMPORT_PATH_LATEST k8s.io/kubernetes "E2E package for Kubernetes >= 1.13.x" # currently the same for all versions -configvar CSI_PROW_E2E_VERSION "$(get_versioned_variable CSI_PROW_E2E_VERSION "${csi_prow_kubernetes_version_suffix}")" "E2E version" -configvar CSI_PROW_E2E_REPO "$(get_versioned_variable CSI_PROW_E2E_REPO "${csi_prow_kubernetes_version_suffix}")" "E2E repo" -configvar CSI_PROW_E2E_IMPORT_PATH "$(get_versioned_variable CSI_PROW_E2E_IMPORT_PATH "${csi_prow_kubernetes_version_suffix}")" "E2E package" +tag_from_version () { + version="$1" + shift + case "$version" in + latest) echo "master";; + release-*) echo "$version";; + *) echo "v$version";; + esac +} +configvar CSI_PROW_E2E_VERSION "$(tag_from_version "${CSI_PROW_KUBERNETES_VERSION}")" "E2E version" +configvar CSI_PROW_E2E_REPO "https://github.com/kubernetes/kubernetes" "E2E repo" +configvar CSI_PROW_E2E_IMPORT_PATH "k8s.io/kubernetes" "E2E package" # csi-sanity testing from the csi-test repo can be run against the installed # CSI driver. For this to work, deploying the driver must expose the Unix domain From e1ec0acfcd8208d1c49dea1c70c66c21d59decc9 Mon Sep 17 00:00:00 2001 From: Hemant Kumar Date: Mon, 10 Aug 2020 16:28:03 -0400 Subject: [PATCH 07/17] We need to ensure that we are not reading stale PV objects So as we don't end up resizing same object more than once --- pkg/controller/controller.go | 117 ++++++++++++++++++++---------- pkg/controller/controller_test.go | 87 ++++++++++++++++++++++ pkg/csi/mock_client.go | 10 +++ pkg/util/util.go | 12 +-- 4 files changed, 183 insertions(+), 43 deletions(-) diff --git a/pkg/controller/controller.go b/pkg/controller/controller.go index bd715be06..a82262fab 100644 --- a/pkg/controller/controller.go +++ b/pkg/controller/controller.go @@ -26,7 +26,6 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" v1 "k8s.io/api/core/v1" - k8serrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" utilruntime "k8s.io/apimachinery/pkg/util/runtime" @@ -55,15 +54,18 @@ type resizeController struct { kubeClient kubernetes.Interface claimQueue workqueue.RateLimitingInterface eventRecorder record.EventRecorder - pvLister corelisters.PersistentVolumeLister pvSynced cache.InformerSynced - pvcLister corelisters.PersistentVolumeClaimLister pvcSynced cache.InformerSynced usedPVCs *inUsePVCStore - podLister corelisters.PodLister - podListerSynced cache.InformerSynced + podLister corelisters.PodLister + podListerSynced cache.InformerSynced + + // a cache to store PersistentVolume objects + volumes cache.Store + // a cache to store PersistentVolumeClaim objects + claims cache.Store handleVolumeInUseError bool } @@ -91,11 +93,11 @@ func NewResizeController( name: name, resizer: resizer, kubeClient: kubeClient, - pvLister: pvInformer.Lister(), pvSynced: pvInformer.Informer().HasSynced, - pvcLister: pvcInformer.Lister(), pvcSynced: pvcInformer.Informer().HasSynced, claimQueue: claimQueue, + volumes: pvInformer.Informer().GetStore(), + claims: pvcInformer.Informer().GetStore(), eventRecorder: eventRecorder, usedPVCs: newUsedPVCStore(), handleVolumeInUseError: handleVolumeInUseError, @@ -266,6 +268,7 @@ func (ctrl *resizeController) syncPVCs() { if err := ctrl.syncPVC(key.(string)); err != nil { // Put PVC back to the queue so that we can retry later. + klog.Errorf("Error syncing PVC: %v", err) ctrl.claimQueue.AddRateLimited(key) } else { ctrl.claimQueue.Forget(key) @@ -278,18 +281,22 @@ func (ctrl *resizeController) syncPVC(key string) error { namespace, name, err := cache.SplitMetaNamespaceKey(key) if err != nil { - klog.Errorf("Split meta namespace key of pvc %s failed: %v", key, err) - return err + return fmt.Errorf("getting namespace and name from key %s failed: %v", key, err) } - pvc, err := ctrl.pvcLister.PersistentVolumeClaims(namespace).Get(name) + pvcObject, exists, err := ctrl.claims.GetByKey(key) if err != nil { - if k8serrors.IsNotFound(err) { - klog.V(3).Infof("PVC %s/%s is deleted, no need to process it", namespace, name) - return nil - } - klog.Errorf("Get PVC %s/%s failed: %v", namespace, name, err) - return err + return fmt.Errorf("getting PVC %s/%s failed: %v", namespace, name, err) + } + + if !exists { + klog.V(3).Infof("PVC %s/%s is deleted or does not exist", namespace, name) + return nil + } + + pvc, ok := pvcObject.(*v1.PersistentVolumeClaim) + if !ok { + return fmt.Errorf("expected PVC got: %v", pvcObject) } if !ctrl.pvcNeedResize(pvc) { @@ -297,14 +304,19 @@ func (ctrl *resizeController) syncPVC(key string) error { return nil } - pv, err := ctrl.pvLister.Get(pvc.Spec.VolumeName) + volumeObj, exists, err := ctrl.volumes.GetByKey(pvc.Spec.VolumeName) if err != nil { - if k8serrors.IsNotFound(err) { - klog.V(3).Infof("PV %s is deleted, no need to process it", pvc.Spec.VolumeName) - return nil - } - klog.Errorf("Get PV %q of pvc %q failed: %v", pvc.Spec.VolumeName, util.PVCKey(pvc), err) - return err + return fmt.Errorf("Get PV %q of pvc %q failed: %v", pvc.Spec.VolumeName, util.PVCKey(pvc), err) + } + + if !exists { + klog.Warningf("PV %q bound to PVC %s not found", pvc.Spec.VolumeName, util.PVCKey(pvc)) + return nil + } + + pv, ok := volumeObj.(*v1.PersistentVolume) + if !ok { + return fmt.Errorf("expected volume but got %+v", volumeObj) } if !ctrl.pvNeedResize(pvc, pv) { @@ -369,8 +381,7 @@ func (ctrl *resizeController) pvNeedResize(pvc *v1.PersistentVolumeClaim, pv *v1 // 3. Mark pvc as resizing finished(no error, no need to resize fs), need resizing fs or resize failed. func (ctrl *resizeController) resizePVC(pvc *v1.PersistentVolumeClaim, pv *v1.PersistentVolume) error { if updatedPVC, err := ctrl.markPVCResizeInProgress(pvc); err != nil { - klog.Errorf("Mark pvc %q as resizing failed: %v", util.PVCKey(pvc), err) - return err + return fmt.Errorf("marking pvc %q as resizing failed: %v", util.PVCKey(pvc), err) } else if updatedPVC != nil { pvc = updatedPVC } @@ -406,7 +417,6 @@ func (ctrl *resizeController) resizePVC(pvc *v1.PersistentVolumeClaim, pv *v1.Pe // Record an event to indicate that resize operation is failed. ctrl.eventRecorder.Eventf(pvc, v1.EventTypeWarning, util.VolumeResizeFailed, err.Error()) } - return err } @@ -426,18 +436,17 @@ func (ctrl *resizeController) resizeVolume( newSize, fsResizeRequired, err := ctrl.resizer.Resize(pv, requestSize) if err != nil { - klog.Errorf("Resize volume %q by resizer %q failed: %v", pv.Name, ctrl.name, err) // if this error was a in-use error then it must be tracked so as we don't retry without // first verifying if volume is in-use if inUseError(err) { ctrl.usedPVCs.addPVCWithInUseError(pvc) } - return newSize, fsResizeRequired, fmt.Errorf("resize volume %s failed: %v", pv.Name, err) + return newSize, fsResizeRequired, fmt.Errorf("resize volume %q by resizer %q failed: %v", pv.Name, ctrl.name, err) } klog.V(4).Infof("Resize volume succeeded for volume %q, start to update PV's capacity", pv.Name) - if err := util.UpdatePVCapacity(pv, newSize, ctrl.kubeClient); err != nil { - klog.Errorf("Update capacity of PV %q to %s failed: %v", pv.Name, newSize.String(), err) + err = ctrl.updatePVCapacity(pv, newSize) + if err != nil { return newSize, fsResizeRequired, err } klog.V(4).Infof("Update capacity of PV %q to %s succeeded", pv.Name, newSize.String()) @@ -455,7 +464,15 @@ func (ctrl *resizeController) markPVCResizeInProgress(pvc *v1.PersistentVolumeCl newPVC := pvc.DeepCopy() newPVC.Status.Conditions = util.MergeResizeConditionsOfPVC(newPVC.Status.Conditions, []v1.PersistentVolumeClaimCondition{progressCondition}) - return util.PatchPVCStatus(pvc, newPVC, ctrl.kubeClient) + updatedPVC, err := util.PatchPVCStatus(pvc, newPVC, ctrl.kubeClient) + if err != nil { + return nil, err + } + err = ctrl.claims.Update(updatedPVC) + if err != nil { + return nil, fmt.Errorf("error updating PVC %s in local cache: %v", util.PVCKey(newPVC), err) + } + return updatedPVC, nil } func (ctrl *resizeController) markPVCResizeFinished( @@ -464,9 +481,14 @@ func (ctrl *resizeController) markPVCResizeFinished( newPVC := pvc.DeepCopy() newPVC.Status.Capacity[v1.ResourceStorage] = newSize newPVC.Status.Conditions = util.MergeResizeConditionsOfPVC(pvc.Status.Conditions, []v1.PersistentVolumeClaimCondition{}) - if _, err := util.PatchPVCStatus(pvc, newPVC, ctrl.kubeClient); err != nil { - klog.Errorf("Mark PVC %q as resize finished failed: %v", util.PVCKey(pvc), err) - return err + updatedPVC, err := util.PatchPVCStatus(pvc, newPVC, ctrl.kubeClient) + if err != nil { + return fmt.Errorf("Mark PVC %q as resize finished failed: %v", util.PVCKey(pvc), err) + } + + err = ctrl.claims.Update(updatedPVC) + if err != nil { + return fmt.Errorf("error updating PVC %s in local cache: %v", util.PVCKey(newPVC), err) } klog.V(4).Infof("Resize PVC %q finished", util.PVCKey(pvc)) @@ -475,6 +497,20 @@ func (ctrl *resizeController) markPVCResizeFinished( return nil } +func (ctrl *resizeController) updatePVCapacity(pv *v1.PersistentVolume, newCapacity resource.Quantity) error { + klog.V(4).Infof("Resize volume succeeded for volume %q, start to update PV's capacity", pv.Name) + updatedPV, err := util.UpdatePVCapacity(pv, newCapacity, ctrl.kubeClient) + + if err != nil { + return fmt.Errorf("updating capacity of PV %q to %s failed: %v", pv.Name, newCapacity.String(), err) + } + err = ctrl.volumes.Update(updatedPV) + if err != nil { + return fmt.Errorf("error updating PV %s: %v", updatedPV.Name, err) + } + return nil +} + func (ctrl *resizeController) markPVCAsFSResizeRequired(pvc *v1.PersistentVolumeClaim) error { pvcCondition := v1.PersistentVolumeClaimCondition{ Type: v1.PersistentVolumeClaimFileSystemResizePending, @@ -486,10 +522,17 @@ func (ctrl *resizeController) markPVCAsFSResizeRequired(pvc *v1.PersistentVolume newPVC.Status.Conditions = util.MergeResizeConditionsOfPVC(newPVC.Status.Conditions, []v1.PersistentVolumeClaimCondition{pvcCondition}) - if _, err := util.PatchPVCStatus(pvc, newPVC, ctrl.kubeClient); err != nil { - klog.Errorf("Mark PVC %q as file system resize required failed: %v", util.PVCKey(pvc), err) - return err + updatedPVC, err := util.PatchPVCStatus(pvc, newPVC, ctrl.kubeClient) + + if err != nil { + return fmt.Errorf("Mark PVC %q as file system resize required failed: %v", util.PVCKey(pvc), err) } + + err = ctrl.claims.Update(updatedPVC) + if err != nil { + return fmt.Errorf("error updating pvc %s in local cache: %v", util.PVCKey(updatedPVC), err) + } + klog.V(4).Infof("Mark PVC %q as file system resize required", util.PVCKey(pvc)) ctrl.eventRecorder.Eventf(pvc, v1.EventTypeNormal, util.FileSystemResizeRequired, "Require file system resize of volume on node") diff --git a/pkg/controller/controller_test.go b/pkg/controller/controller_test.go index fc67846ca..c67e71379 100644 --- a/pkg/controller/controller_test.go +++ b/pkg/controller/controller_test.go @@ -277,6 +277,93 @@ func TestController(t *testing.T) { } } +func TestResizePVC(t *testing.T) { + fsVolumeMode := v1.PersistentVolumeFilesystem + + for _, test := range []struct { + Name string + PVC *v1.PersistentVolumeClaim + PV *v1.PersistentVolume + + NodeResize bool + expansionFailure bool + expectFailure bool + }{ + { + Name: "Resize PVC with FS resize", + PVC: createPVC(2, 1), + PV: createPV(1, "testPVC", defaultNS, "foobar", &fsVolumeMode), + NodeResize: true, + }, + { + Name: "Resize PVC with FS resize failure", + PVC: createPVC(2, 1), + PV: createPV(1, "testPVC", defaultNS, "foobar", &fsVolumeMode), + NodeResize: true, + expansionFailure: true, + expectFailure: true, + }, + } { + client := csi.NewMockClient("mock", test.NodeResize, true, true) + if test.expansionFailure { + client.SetExpansionFailed() + } + driverName, _ := client.GetDriverName(context.TODO()) + + initialObjects := []runtime.Object{} + if test.PVC != nil { + initialObjects = append(initialObjects, test.PVC) + } + if test.PV != nil { + test.PV.Spec.PersistentVolumeSource.CSI.Driver = driverName + initialObjects = append(initialObjects, test.PV) + } + + kubeClient, informerFactory := fakeK8s(initialObjects) + pvInformer := informerFactory.Core().V1().PersistentVolumes() + pvcInformer := informerFactory.Core().V1().PersistentVolumeClaims() + podInformer := informerFactory.Core().V1().Pods() + + metricsManager := metrics.NewCSIMetricsManager("" /* driverName */) + metricsAddress := "" + metricsPath := "" + csiResizer, err := resizer.NewResizerFromClient(client, 15*time.Second, kubeClient, informerFactory, metricsManager, metricsAddress, metricsPath) + if err != nil { + t.Fatalf("Test %s: Unable to create resizer: %v", test.Name, err) + } + + controller := NewResizeController(driverName, csiResizer, kubeClient, time.Second, informerFactory, workqueue.DefaultControllerRateLimiter(), true /* disableVolumeInUseErrorHandler*/) + + ctrlInstance, _ := controller.(*resizeController) + + stopCh := make(chan struct{}) + informerFactory.Start(stopCh) + + for _, obj := range initialObjects { + switch obj.(type) { + case *v1.PersistentVolume: + pvInformer.Informer().GetStore().Add(obj) + case *v1.PersistentVolumeClaim: + pvcInformer.Informer().GetStore().Add(obj) + case *v1.Pod: + podInformer.Informer().GetStore().Add(obj) + default: + t.Fatalf("Test %s: Unknown initalObject type: %+v", test.Name, obj) + } + } + + err = ctrlInstance.resizePVC(test.PVC, test.PV) + if test.expectFailure && err == nil { + t.Errorf("for %s expected error got nothing", test.Name) + continue + } + if !test.expectFailure && err != nil { + t.Errorf("for %s, unexpected error: %v", test.Name, err) + } + + } +} + func invalidPVC() *v1.PersistentVolumeClaim { pvc := createPVC(1, 1) pvc.ObjectMeta.Name = "" diff --git a/pkg/csi/mock_client.go b/pkg/csi/mock_client.go index 42912478c..1852f498e 100644 --- a/pkg/csi/mock_client.go +++ b/pkg/csi/mock_client.go @@ -2,6 +2,7 @@ package csi import ( "context" + "fmt" "github.com/container-storage-interface/spec/lib/go/csi" ) @@ -26,6 +27,7 @@ type MockClient struct { supportsControllerResize bool supportsPluginControllerService bool expandCalled int + expansionFailed bool usedSecrets map[string]string usedCapability *csi.VolumeCapability } @@ -46,6 +48,10 @@ func (c *MockClient) SupportsNodeResize(context.Context) (bool, error) { return c.supportsNodeResize, nil } +func (c *MockClient) SetExpansionFailed() { + c.expansionFailed = true +} + func (c *MockClient) Expand( ctx context.Context, volumeID string, @@ -53,6 +59,10 @@ func (c *MockClient) Expand( secrets map[string]string, capability *csi.VolumeCapability) (int64, bool, error) { // TODO: Determine whether the operation succeeds or fails by parameters. + if c.expansionFailed { + c.expandCalled++ + return requestBytes, c.supportsNodeResize, fmt.Errorf("expansion failed") + } c.expandCalled++ c.usedSecrets = secrets c.usedCapability = capability diff --git a/pkg/util/util.go b/pkg/util/util.go index e3eed0ec9..c513e0fff 100644 --- a/pkg/util/util.go +++ b/pkg/util/util.go @@ -22,7 +22,7 @@ import ( "fmt" "regexp" - "k8s.io/api/core/v1" + v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/meta" "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -124,18 +124,18 @@ func addResourceVersion(patchBytes []byte, resourceVersion string) ([]byte, erro } // UpdatePVCapacity updates PVC capacity with requested size. -func UpdatePVCapacity(pv *v1.PersistentVolume, newCapacity resource.Quantity, kubeClient kubernetes.Interface) error { +func UpdatePVCapacity(pv *v1.PersistentVolume, newCapacity resource.Quantity, kubeClient kubernetes.Interface) (*v1.PersistentVolume, error) { newPV := pv.DeepCopy() newPV.Spec.Capacity[v1.ResourceStorage] = newCapacity patchBytes, err := getPatchData(pv, newPV) if err != nil { - return fmt.Errorf("can't update capacity of PV %s as generate path data failed: %v", pv.Name, err) + return nil, fmt.Errorf("can't update capacity of PV %s as generate path data failed: %v", pv.Name, err) } - _, updateErr := kubeClient.CoreV1().PersistentVolumes().Patch(context.TODO(), pv.Name, types.StrategicMergePatchType, patchBytes, metav1.PatchOptions{}) + updatedPV, updateErr := kubeClient.CoreV1().PersistentVolumes().Patch(context.TODO(), pv.Name, types.StrategicMergePatchType, patchBytes, metav1.PatchOptions{}) if updateErr != nil { - return fmt.Errorf("update capacity of PV %s failed: %v", pv.Name, updateErr) + return nil, fmt.Errorf("update capacity of PV %s failed: %v", pv.Name, updateErr) } - return nil + return updatedPV, nil } func getPatchData(oldObj, newObj interface{}) ([]byte, error) { From a1746e8dac2fa1875f2f6adfeb5ec37b3a582c4b Mon Sep 17 00:00:00 2001 From: Hemant Kumar Date: Fri, 21 Aug 2020 09:05:07 -0400 Subject: [PATCH 08/17] Move functions for updating PV and PVC into controller --- pkg/controller/controller.go | 99 ++++++++++++++++++++++-------------- pkg/util/util.go | 43 ++-------------- pkg/util/util_test.go | 2 +- 3 files changed, 64 insertions(+), 80 deletions(-) diff --git a/pkg/controller/controller.go b/pkg/controller/controller.go index a82262fab..ee78973b2 100644 --- a/pkg/controller/controller.go +++ b/pkg/controller/controller.go @@ -28,6 +28,7 @@ import ( v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/apimachinery/pkg/util/wait" "k8s.io/client-go/informers" @@ -454,6 +455,30 @@ func (ctrl *resizeController) resizeVolume( return newSize, fsResizeRequired, nil } +func (ctrl *resizeController) markPVCAsFSResizeRequired(pvc *v1.PersistentVolumeClaim) error { + pvcCondition := v1.PersistentVolumeClaimCondition{ + Type: v1.PersistentVolumeClaimFileSystemResizePending, + Status: v1.ConditionTrue, + LastTransitionTime: metav1.Now(), + Message: "Waiting for user to (re-)start a pod to finish file system resize of volume on node.", + } + newPVC := pvc.DeepCopy() + newPVC.Status.Conditions = util.MergeResizeConditionsOfPVC(newPVC.Status.Conditions, + []v1.PersistentVolumeClaimCondition{pvcCondition}) + + _, err := ctrl.patchClaim(pvc, newPVC) + + if err != nil { + return fmt.Errorf("Mark PVC %q as file system resize required failed: %v", util.PVCKey(pvc), err) + } + + klog.V(4).Infof("Mark PVC %q as file system resize required", util.PVCKey(pvc)) + ctrl.eventRecorder.Eventf(pvc, v1.EventTypeNormal, + util.FileSystemResizeRequired, "Require file system resize of volume on node") + + return nil +} + func (ctrl *resizeController) markPVCResizeInProgress(pvc *v1.PersistentVolumeClaim) (*v1.PersistentVolumeClaim, error) { // Mark PVC as Resize Started progressCondition := v1.PersistentVolumeClaimCondition{ @@ -464,14 +489,11 @@ func (ctrl *resizeController) markPVCResizeInProgress(pvc *v1.PersistentVolumeCl newPVC := pvc.DeepCopy() newPVC.Status.Conditions = util.MergeResizeConditionsOfPVC(newPVC.Status.Conditions, []v1.PersistentVolumeClaimCondition{progressCondition}) - updatedPVC, err := util.PatchPVCStatus(pvc, newPVC, ctrl.kubeClient) + + updatedPVC, err := ctrl.patchClaim(pvc, newPVC) if err != nil { return nil, err } - err = ctrl.claims.Update(updatedPVC) - if err != nil { - return nil, fmt.Errorf("error updating PVC %s in local cache: %v", util.PVCKey(newPVC), err) - } return updatedPVC, nil } @@ -481,14 +503,10 @@ func (ctrl *resizeController) markPVCResizeFinished( newPVC := pvc.DeepCopy() newPVC.Status.Capacity[v1.ResourceStorage] = newSize newPVC.Status.Conditions = util.MergeResizeConditionsOfPVC(pvc.Status.Conditions, []v1.PersistentVolumeClaimCondition{}) - updatedPVC, err := util.PatchPVCStatus(pvc, newPVC, ctrl.kubeClient) - if err != nil { - return fmt.Errorf("Mark PVC %q as resize finished failed: %v", util.PVCKey(pvc), err) - } - err = ctrl.claims.Update(updatedPVC) + _, err := ctrl.patchClaim(pvc, newPVC) if err != nil { - return fmt.Errorf("error updating PVC %s in local cache: %v", util.PVCKey(newPVC), err) + return fmt.Errorf("Mark PVC %q as resize finished failed: %v", util.PVCKey(pvc), err) } klog.V(4).Infof("Resize PVC %q finished", util.PVCKey(pvc)) @@ -497,47 +515,50 @@ func (ctrl *resizeController) markPVCResizeFinished( return nil } +func (ctrl *resizeController) patchClaim(oldPVC, newPVC *v1.PersistentVolumeClaim) (*v1.PersistentVolumeClaim, error) { + patchBytes, err := util.GetPVCPatchData(oldPVC, newPVC) + if err != nil { + return nil, fmt.Errorf("can't patch status of PVC %s as generate path data failed: %v", util.PVCKey(oldPVC), err) + } + updatedClaim, updateErr := ctrl.kubeClient.CoreV1().PersistentVolumeClaims(oldPVC.Namespace). + Patch(context.TODO(), oldPVC.Name, types.StrategicMergePatchType, patchBytes, metav1.PatchOptions{}, "status") + if updateErr != nil { + return nil, fmt.Errorf("can't patch status of PVC %s with %v", util.PVCKey(oldPVC), updateErr) + } + err = ctrl.claims.Update(updatedClaim) + if err != nil { + return nil, fmt.Errorf("error updating PVC %s in local cache: %v", util.PVCKey(newPVC), err) + } + + return updatedClaim, nil +} + func (ctrl *resizeController) updatePVCapacity(pv *v1.PersistentVolume, newCapacity resource.Quantity) error { klog.V(4).Infof("Resize volume succeeded for volume %q, start to update PV's capacity", pv.Name) - updatedPV, err := util.UpdatePVCapacity(pv, newCapacity, ctrl.kubeClient) + newPV := pv.DeepCopy() + newPV.Spec.Capacity[v1.ResourceStorage] = newCapacity + _, err := ctrl.patchPersistentVolume(pv, newPV) if err != nil { return fmt.Errorf("updating capacity of PV %q to %s failed: %v", pv.Name, newCapacity.String(), err) } - err = ctrl.volumes.Update(updatedPV) - if err != nil { - return fmt.Errorf("error updating PV %s: %v", updatedPV.Name, err) - } return nil } -func (ctrl *resizeController) markPVCAsFSResizeRequired(pvc *v1.PersistentVolumeClaim) error { - pvcCondition := v1.PersistentVolumeClaimCondition{ - Type: v1.PersistentVolumeClaimFileSystemResizePending, - Status: v1.ConditionTrue, - LastTransitionTime: metav1.Now(), - Message: "Waiting for user to (re-)start a pod to finish file system resize of volume on node.", - } - newPVC := pvc.DeepCopy() - newPVC.Status.Conditions = util.MergeResizeConditionsOfPVC(newPVC.Status.Conditions, - []v1.PersistentVolumeClaimCondition{pvcCondition}) - - updatedPVC, err := util.PatchPVCStatus(pvc, newPVC, ctrl.kubeClient) - +func (ctrl *resizeController) patchPersistentVolume(oldPV, newPV *v1.PersistentVolume) (*v1.PersistentVolume, error) { + patchBytes, err := util.GetPatchData(oldPV, newPV) if err != nil { - return fmt.Errorf("Mark PVC %q as file system resize required failed: %v", util.PVCKey(pvc), err) + return nil, fmt.Errorf("can't update capacity of PV %s as generate path data failed: %v", newPV.Name, err) } - - err = ctrl.claims.Update(updatedPVC) + updatedPV, updateErr := ctrl.kubeClient.CoreV1().PersistentVolumes().Patch(context.TODO(), newPV.Name, types.StrategicMergePatchType, patchBytes, metav1.PatchOptions{}) + if updateErr != nil { + return nil, fmt.Errorf("update capacity of PV %s failed: %v", newPV.Name, updateErr) + } + err = ctrl.volumes.Update(updatedPV) if err != nil { - return fmt.Errorf("error updating pvc %s in local cache: %v", util.PVCKey(updatedPVC), err) + return nil, fmt.Errorf("error updating PV %s in local cache: %v", newPV.Name, err) } - - klog.V(4).Infof("Mark PVC %q as file system resize required", util.PVCKey(pvc)) - ctrl.eventRecorder.Eventf(pvc, v1.EventTypeNormal, - util.FileSystemResizeRequired, "Require file system resize of volume on node") - - return nil + return updatedPV, nil } func parsePod(obj interface{}) *v1.Pod { diff --git a/pkg/util/util.go b/pkg/util/util.go index c513e0fff..79b349225 100644 --- a/pkg/util/util.go +++ b/pkg/util/util.go @@ -17,19 +17,14 @@ limitations under the License. package util import ( - "context" "encoding/json" "fmt" "regexp" v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/meta" - "k8s.io/apimachinery/pkg/api/resource" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/strategicpatch" - "k8s.io/client-go/kubernetes" ) var knownResizeConditions = map[v1.PersistentVolumeClaimConditionType]bool{ @@ -74,25 +69,8 @@ func MergeResizeConditionsOfPVC(oldConditions, newConditions []v1.PersistentVolu return resultConditions } -// PatchPVCStatus updates PVC status using PATCH verb -func PatchPVCStatus( - oldPVC *v1.PersistentVolumeClaim, - newPVC *v1.PersistentVolumeClaim, - kubeClient kubernetes.Interface) (*v1.PersistentVolumeClaim, error) { - patchBytes, err := getPVCPatchData(oldPVC, newPVC) - if err != nil { - return nil, fmt.Errorf("can't patch status of PVC %s as generate path data failed: %v", PVCKey(oldPVC), err) - } - updatedClaim, updateErr := kubeClient.CoreV1().PersistentVolumeClaims(oldPVC.Namespace). - Patch(context.TODO(), oldPVC.Name, types.StrategicMergePatchType, patchBytes, metav1.PatchOptions{}, "status") - if updateErr != nil { - return nil, fmt.Errorf("can't patch status of PVC %s with %v", PVCKey(oldPVC), updateErr) - } - return updatedClaim, nil -} - -func getPVCPatchData(oldPVC, newPVC *v1.PersistentVolumeClaim) ([]byte, error) { - patchBytes, err := getPatchData(oldPVC, newPVC) +func GetPVCPatchData(oldPVC, newPVC *v1.PersistentVolumeClaim) ([]byte, error) { + patchBytes, err := GetPatchData(oldPVC, newPVC) if err != nil { return patchBytes, err } @@ -123,22 +101,7 @@ func addResourceVersion(patchBytes []byte, resourceVersion string) ([]byte, erro return versionBytes, nil } -// UpdatePVCapacity updates PVC capacity with requested size. -func UpdatePVCapacity(pv *v1.PersistentVolume, newCapacity resource.Quantity, kubeClient kubernetes.Interface) (*v1.PersistentVolume, error) { - newPV := pv.DeepCopy() - newPV.Spec.Capacity[v1.ResourceStorage] = newCapacity - patchBytes, err := getPatchData(pv, newPV) - if err != nil { - return nil, fmt.Errorf("can't update capacity of PV %s as generate path data failed: %v", pv.Name, err) - } - updatedPV, updateErr := kubeClient.CoreV1().PersistentVolumes().Patch(context.TODO(), pv.Name, types.StrategicMergePatchType, patchBytes, metav1.PatchOptions{}) - if updateErr != nil { - return nil, fmt.Errorf("update capacity of PV %s failed: %v", pv.Name, updateErr) - } - return updatedPV, nil -} - -func getPatchData(oldObj, newObj interface{}) ([]byte, error) { +func GetPatchData(oldObj, newObj interface{}) ([]byte, error) { oldData, err := json.Marshal(oldObj) if err != nil { return nil, fmt.Errorf("marshal old object failed: %v", err) diff --git a/pkg/util/util_test.go b/pkg/util/util_test.go index 6bfd599b3..b0322203d 100644 --- a/pkg/util/util_test.go +++ b/pkg/util/util_test.go @@ -18,7 +18,7 @@ func TestGetPVCPatchData(t *testing.T) { newPVC := c.OldPVC.DeepCopy() newPVC.Status.Conditions = append(newPVC.Status.Conditions, v1.PersistentVolumeClaimCondition{Type: VolumeResizing, Status: v1.ConditionTrue}) - patchBytes, err := getPVCPatchData(c.OldPVC, newPVC) + patchBytes, err := GetPVCPatchData(c.OldPVC, newPVC) if err != nil { t.Errorf("Case %d: Get patch data failed: %v", i, err) } From 9fe59d6524118ee4f7b674fef403dffe33c402e1 Mon Sep 17 00:00:00 2001 From: Jan Safranek Date: Thu, 6 Jun 2019 12:04:04 +0200 Subject: [PATCH 09/17] UPSTREAM: : Add OpenShift Dockerfiles --- Dockerfile.openshift | 10 ++++++++++ Dockerfile.openshift.rhel7 | 10 ++++++++++ 2 files changed, 20 insertions(+) create mode 100644 Dockerfile.openshift create mode 100644 Dockerfile.openshift.rhel7 diff --git a/Dockerfile.openshift b/Dockerfile.openshift new file mode 100644 index 000000000..87b389edb --- /dev/null +++ b/Dockerfile.openshift @@ -0,0 +1,10 @@ +FROM registry.svc.ci.openshift.org/openshift/release:golang-1.11 AS builder +WORKDIR /go/src/github.com/kubernetes-csi/external-resizer +COPY . . +RUN go build ./cmd/csi-resizer + +FROM registry.svc.ci.openshift.org/openshift/origin-v4.0:base +COPY --from=builder /go/src/github.com/kubernetes-csi/external-resizer/csi-resizer /usr/bin/ +RUN useradd csi-resizer +USER csi-resizer +ENTRYPOINT ["/usr/bin/csi-resizer"] diff --git a/Dockerfile.openshift.rhel7 b/Dockerfile.openshift.rhel7 new file mode 100644 index 000000000..ec6244e2b --- /dev/null +++ b/Dockerfile.openshift.rhel7 @@ -0,0 +1,10 @@ +FROM registry.svc.ci.openshift.org/ocp/builder:golang-1.11 AS builder +WORKDIR /go/src/github.com/kubernetes-csi/external-resizer +COPY . . +RUN go build ./cmd/csi-resizer + +FROM registry.svc.ci.openshift.org/ocp/4.0:base +COPY --from=builder /go/src/github.com/kubernetes-csi/external-resizer/csi-resizer /usr/bin/ +RUN useradd csi-resizer +USER csi-resizer +ENTRYPOINT ["/usr/bin/csi-resizer"] From 9c560cda0535d7882eebe17dabd09839fb00d764 Mon Sep 17 00:00:00 2001 From: Jan Safranek Date: Thu, 6 Jun 2019 12:04:23 +0200 Subject: [PATCH 10/17] UPSTREAM: : Add OpenShift OWNERS --- OWNERS | 1 + OWNERS_ALIASES | 7 +++++++ 2 files changed, 8 insertions(+) create mode 100644 OWNERS_ALIASES diff --git a/OWNERS b/OWNERS index a3e533b5e..ac8f05adb 100644 --- a/OWNERS +++ b/OWNERS @@ -1,6 +1,7 @@ # See the OWNERS docs: https://git.k8s.io/community/contributors/guide/owners.md approvers: + - openshift-storage-maintainers - saad-ali - gnufied - mlmhl diff --git a/OWNERS_ALIASES b/OWNERS_ALIASES new file mode 100644 index 000000000..dd2eec73f --- /dev/null +++ b/OWNERS_ALIASES @@ -0,0 +1,7 @@ +aliases: + openshift-storage-maintainers: + - jsafrane + - tsmetana + - gnufied + - childsb + - bertinatto From 9f88b11af7b2605f3c0d8d15b524a77dc7aa76a3 Mon Sep 17 00:00:00 2001 From: Jan Safranek Date: Mon, 10 Jun 2019 14:50:54 +0200 Subject: [PATCH 11/17] UPSTREAM: : Use upstream makefiles This will embed correct version (e.g. v1.1.1-24-g4b930a6) into the binary. --- Dockerfile.openshift | 4 ++-- Dockerfile.openshift.rhel7 | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile.openshift b/Dockerfile.openshift index 87b389edb..f6026d1fc 100644 --- a/Dockerfile.openshift +++ b/Dockerfile.openshift @@ -1,10 +1,10 @@ FROM registry.svc.ci.openshift.org/openshift/release:golang-1.11 AS builder WORKDIR /go/src/github.com/kubernetes-csi/external-resizer COPY . . -RUN go build ./cmd/csi-resizer +RUN make build FROM registry.svc.ci.openshift.org/openshift/origin-v4.0:base -COPY --from=builder /go/src/github.com/kubernetes-csi/external-resizer/csi-resizer /usr/bin/ +COPY --from=builder /go/src/github.com/kubernetes-csi/external-resizer/bin/csi-resizer /usr/bin/ RUN useradd csi-resizer USER csi-resizer ENTRYPOINT ["/usr/bin/csi-resizer"] diff --git a/Dockerfile.openshift.rhel7 b/Dockerfile.openshift.rhel7 index ec6244e2b..6070639f9 100644 --- a/Dockerfile.openshift.rhel7 +++ b/Dockerfile.openshift.rhel7 @@ -1,10 +1,10 @@ FROM registry.svc.ci.openshift.org/ocp/builder:golang-1.11 AS builder WORKDIR /go/src/github.com/kubernetes-csi/external-resizer COPY . . -RUN go build ./cmd/csi-resizer +RUN make build FROM registry.svc.ci.openshift.org/ocp/4.0:base -COPY --from=builder /go/src/github.com/kubernetes-csi/external-resizer/csi-resizer /usr/bin/ +COPY --from=builder /go/src/github.com/kubernetes-csi/external-resizer/bin/csi-resizer /usr/bin/ RUN useradd csi-resizer USER csi-resizer ENTRYPOINT ["/usr/bin/csi-resizer"] From 25afeeec9ff58066631ffc9617038b4bc0338c9f Mon Sep 17 00:00:00 2001 From: Jan Safranek Date: Wed, 31 Jul 2019 11:04:15 +0200 Subject: [PATCH 12/17] Don't run the sidecar container with specific UID Let the pod decide. --- Dockerfile.openshift | 2 -- Dockerfile.openshift.rhel7 | 2 -- 2 files changed, 4 deletions(-) diff --git a/Dockerfile.openshift b/Dockerfile.openshift index f6026d1fc..13d7bd0da 100644 --- a/Dockerfile.openshift +++ b/Dockerfile.openshift @@ -5,6 +5,4 @@ RUN make build FROM registry.svc.ci.openshift.org/openshift/origin-v4.0:base COPY --from=builder /go/src/github.com/kubernetes-csi/external-resizer/bin/csi-resizer /usr/bin/ -RUN useradd csi-resizer -USER csi-resizer ENTRYPOINT ["/usr/bin/csi-resizer"] diff --git a/Dockerfile.openshift.rhel7 b/Dockerfile.openshift.rhel7 index 6070639f9..909f24d95 100644 --- a/Dockerfile.openshift.rhel7 +++ b/Dockerfile.openshift.rhel7 @@ -5,6 +5,4 @@ RUN make build FROM registry.svc.ci.openshift.org/ocp/4.0:base COPY --from=builder /go/src/github.com/kubernetes-csi/external-resizer/bin/csi-resizer /usr/bin/ -RUN useradd csi-resizer -USER csi-resizer ENTRYPOINT ["/usr/bin/csi-resizer"] From 2a6ea95d167f1446b4d2c74b3cd62c6c029ef675 Mon Sep 17 00:00:00 2001 From: Christian Huffman Date: Tue, 15 Oct 2019 14:23:57 -0400 Subject: [PATCH 13/17] UPSTREAM: : Use golang 1.12 for OpenShift images --- Dockerfile.openshift | 2 +- Dockerfile.openshift.rhel7 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile.openshift b/Dockerfile.openshift index 13d7bd0da..ed7c91e4a 100644 --- a/Dockerfile.openshift +++ b/Dockerfile.openshift @@ -1,4 +1,4 @@ -FROM registry.svc.ci.openshift.org/openshift/release:golang-1.11 AS builder +FROM registry.svc.ci.openshift.org/openshift/release:golang-1.12 AS builder WORKDIR /go/src/github.com/kubernetes-csi/external-resizer COPY . . RUN make build diff --git a/Dockerfile.openshift.rhel7 b/Dockerfile.openshift.rhel7 index 909f24d95..435af3e57 100644 --- a/Dockerfile.openshift.rhel7 +++ b/Dockerfile.openshift.rhel7 @@ -1,4 +1,4 @@ -FROM registry.svc.ci.openshift.org/ocp/builder:golang-1.11 AS builder +FROM registry.svc.ci.openshift.org/ocp/builder:golang-1.12 AS builder WORKDIR /go/src/github.com/kubernetes-csi/external-resizer COPY . . RUN make build From 7f91580a43f23f00f1611f10b8a087f00c65711f Mon Sep 17 00:00:00 2001 From: Jan Safranek Date: Wed, 8 Jan 2020 12:13:56 +0100 Subject: [PATCH 14/17] Bump go version to 1.13 --- Dockerfile.openshift | 2 +- Dockerfile.openshift.rhel7 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile.openshift b/Dockerfile.openshift index ed7c91e4a..73bea3536 100644 --- a/Dockerfile.openshift +++ b/Dockerfile.openshift @@ -1,4 +1,4 @@ -FROM registry.svc.ci.openshift.org/openshift/release:golang-1.12 AS builder +FROM registry.svc.ci.openshift.org/openshift/release:golang-1.13 AS builder WORKDIR /go/src/github.com/kubernetes-csi/external-resizer COPY . . RUN make build diff --git a/Dockerfile.openshift.rhel7 b/Dockerfile.openshift.rhel7 index 435af3e57..b1d4b009b 100644 --- a/Dockerfile.openshift.rhel7 +++ b/Dockerfile.openshift.rhel7 @@ -1,4 +1,4 @@ -FROM registry.svc.ci.openshift.org/ocp/builder:golang-1.12 AS builder +FROM registry.svc.ci.openshift.org/ocp/builder:golang-1.13 AS builder WORKDIR /go/src/github.com/kubernetes-csi/external-resizer COPY . . RUN make build From 2243313856b05fca0c1c3940972a1781b091bb54 Mon Sep 17 00:00:00 2001 From: Jan Safranek Date: Wed, 8 Jan 2020 12:36:56 +0100 Subject: [PATCH 15/17] Sanitize OpenShift OWNERS --- OWNERS | 8 +------- OWNERS_ALIASES | 2 +- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/OWNERS b/OWNERS index ac8f05adb..1fb68175d 100644 --- a/OWNERS +++ b/OWNERS @@ -1,8 +1,2 @@ -# See the OWNERS docs: https://git.k8s.io/community/contributors/guide/owners.md - approvers: - - openshift-storage-maintainers - - saad-ali - - gnufied - - mlmhl - - msau42 +- openshift-storage-maintainers diff --git a/OWNERS_ALIASES b/OWNERS_ALIASES index dd2eec73f..9b1467543 100644 --- a/OWNERS_ALIASES +++ b/OWNERS_ALIASES @@ -3,5 +3,5 @@ aliases: - jsafrane - tsmetana - gnufied - - childsb - bertinatto + - huffmanca From 7193a2d4fe66dde342a39fe34952d9e74a66e01a Mon Sep 17 00:00:00 2001 From: Jan Safranek Date: Tue, 14 Apr 2020 10:04:34 +0200 Subject: [PATCH 16/17] carry: Add BZ component to OWNERS --- OWNERS | 1 + 1 file changed, 1 insertion(+) diff --git a/OWNERS b/OWNERS index 1fb68175d..4f5946c7a 100644 --- a/OWNERS +++ b/OWNERS @@ -1,2 +1,3 @@ approvers: - openshift-storage-maintainers +component: "Storage" From 16394f83a72408cb5f89e215a4e9c6d8def56dcf Mon Sep 17 00:00:00 2001 From: Jan Safranek Date: Thu, 6 Jun 2019 12:04:04 +0200 Subject: [PATCH 17/17] UPSTREAM: : Add OpenShift Dockerfiles --- Dockerfile.openshift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile.openshift b/Dockerfile.openshift index 73bea3536..cd69bdcb2 100644 --- a/Dockerfile.openshift +++ b/Dockerfile.openshift @@ -1,8 +1,8 @@ -FROM registry.svc.ci.openshift.org/openshift/release:golang-1.13 AS builder +FROM registry.svc.ci.openshift.org/ocp/builder:rhel-8-golang-openshift-4.6 AS builder WORKDIR /go/src/github.com/kubernetes-csi/external-resizer COPY . . RUN make build -FROM registry.svc.ci.openshift.org/openshift/origin-v4.0:base +FROM registry.svc.ci.openshift.org/ocp/4.6:base COPY --from=builder /go/src/github.com/kubernetes-csi/external-resizer/bin/csi-resizer /usr/bin/ ENTRYPOINT ["/usr/bin/csi-resizer"]