diff --git a/legacy/openstack-cinder-csi-driver-operator/go.mod b/legacy/openstack-cinder-csi-driver-operator/go.mod index a3971e2dd..ecc065ba8 100644 --- a/legacy/openstack-cinder-csi-driver-operator/go.mod +++ b/legacy/openstack-cinder-csi-driver-operator/go.mod @@ -5,8 +5,8 @@ go 1.22.0 toolchain go1.22.3 require ( - github.com/gophercloud/gophercloud v1.13.0 - github.com/gophercloud/utils v0.0.0-20231010081019-80377eca5d56 + github.com/gophercloud/gophercloud/v2 v2.1.0 + github.com/gophercloud/utils/v2 v2.0.0-20240812072210-8ce1fc0f2894 github.com/onsi/gomega v1.33.1 github.com/openshift/api v0.0.0-20240710000542-465787efd0d6 github.com/openshift/build-machinery-go v0.0.0-20240419090851-af9c868bcf52 @@ -44,6 +44,7 @@ require ( github.com/go-openapi/jsonpointer v0.21.0 // indirect github.com/go-openapi/jsonreference v0.21.0 // indirect github.com/go-openapi/swag v0.23.0 // indirect + github.com/gofrs/uuid/v5 v5.3.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.4 // indirect @@ -56,7 +57,6 @@ require ( github.com/gorilla/websocket v1.5.1 // indirect github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 // indirect - github.com/hashicorp/go-uuid v1.0.3 // indirect github.com/imdario/mergo v0.3.7 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/josharian/intern v1.0.0 // indirect @@ -94,10 +94,10 @@ require ( golang.org/x/exp v0.0.0-20240707233637-46b078467d37 // indirect golang.org/x/net v0.27.0 // indirect golang.org/x/oauth2 v0.21.0 // indirect - golang.org/x/sync v0.7.0 // indirect - golang.org/x/sys v0.22.0 // indirect + golang.org/x/sync v0.8.0 // indirect + golang.org/x/sys v0.24.0 // indirect golang.org/x/term v0.22.0 // indirect - golang.org/x/text v0.16.0 // indirect + golang.org/x/text v0.17.0 // indirect golang.org/x/time v0.5.0 // indirect google.golang.org/genproto v0.0.0-20240709173604-40e1e62336c5 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240709173604-40e1e62336c5 // indirect diff --git a/legacy/openstack-cinder-csi-driver-operator/go.sum b/legacy/openstack-cinder-csi-driver-operator/go.sum index 54f762163..6355d59f8 100644 --- a/legacy/openstack-cinder-csi-driver-operator/go.sum +++ b/legacy/openstack-cinder-csi-driver-operator/go.sum @@ -62,6 +62,8 @@ github.com/gobwas/httphead v0.1.0/go.mod h1:O/RXo79gxV8G+RqlR/otEwx4Q36zl9rqC5u1 github.com/gobwas/pool v0.2.1/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= github.com/gobwas/ws v1.2.1/go.mod h1:hRKAFb8wOxFROYNsT1bqfWnhX+b5MFeJM9r2ZSwg/KY= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= +github.com/gofrs/uuid/v5 v5.3.0 h1:m0mUMr+oVYUdxpMLgSYCZiXe7PuVPnI94+OMeVBNedk= +github.com/gofrs/uuid/v5 v5.3.0/go.mod h1:CDOjlDMVAtN56jqyRUZh58JT31Tiw7/oQyEXZV+9bD8= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= @@ -89,11 +91,10 @@ github.com/google/pprof v0.0.0-20240625030939-27f56978b8b0 h1:e+8XbKB6IMn8A4OAyZ github.com/google/pprof v0.0.0-20240625030939-27f56978b8b0/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/gophercloud/gophercloud v1.3.0/go.mod h1:aAVqcocTSXh2vYFZ1JTvx4EQmfgzxRcNupUfxZbBNDM= -github.com/gophercloud/gophercloud v1.13.0 h1:8iY9d1DAbzMW6Vok1AxbbK5ZaUjzMp0tdyt4fX9IeJ0= -github.com/gophercloud/gophercloud v1.13.0/go.mod h1:aAVqcocTSXh2vYFZ1JTvx4EQmfgzxRcNupUfxZbBNDM= -github.com/gophercloud/utils v0.0.0-20231010081019-80377eca5d56 h1:sH7xkTfYzxIEgzq1tDHIMKRh1vThOEOGNsettdEeLbE= -github.com/gophercloud/utils v0.0.0-20231010081019-80377eca5d56/go.mod h1:VSalo4adEk+3sNkmVJLnhHoOyOYYS8sTWLG4mv5BKto= +github.com/gophercloud/gophercloud/v2 v2.1.0 h1:91p6c+uMckXyx39nSIYjDirDBnPVFQq0q1njLNPX+NY= +github.com/gophercloud/gophercloud/v2 v2.1.0/go.mod h1:f2hMRC7Kakbv5vM7wSGHrIPZh6JZR60GVHryJlF/K44= +github.com/gophercloud/utils/v2 v2.0.0-20240812072210-8ce1fc0f2894 h1:KgYK/Mf71IdN7+sq2cVmY8Jtumi26GxahN7nlV0ETBQ= +github.com/gophercloud/utils/v2 v2.0.0-20240812072210-8ce1fc0f2894/go.mod h1:IXS9MKM8YBsr9G2xhnMAuiCOaNxmghQFQGi1p68+No0= github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY= github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY= github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw= @@ -104,8 +105,6 @@ github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4 github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 h1:bkypFPDjIYGfCYD5mRBvpqxfYX1YCS1PXdKYWi8FsN0= github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0/go.mod h1:P+Lt/0by1T8bfcF3z737NnSbmxQAppXMRziHUxPOC8k= -github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= -github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/ianlancetaylor/demangle v0.0.0-20210905161508-09a460cdf81d/go.mod h1:aYm2/VgdVmcIU8iMfdMvDMsRAQjcfZSKFby6HOFvi/w= github.com/ianlancetaylor/demangle v0.0.0-20230524184225-eabc099b10ab/go.mod h1:gx7rwoVhcfuVKG5uya9Hs3Sxj7EIvldVofAWIUtGouw= github.com/imdario/mergo v0.3.7 h1:Y+UAYTZ7gDEuOfhxKWy+dvb5dRQ6rJjFSdX2HZY1/gI= @@ -196,7 +195,6 @@ github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 h1:eY9dn8+vbi4tKz5 github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= go.etcd.io/bbolt v1.3.8 h1:xs88BrvEv273UsB79e0hcVrlUWmS0a8upikMFhSyAtA= go.etcd.io/bbolt v1.3.8/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw= go.etcd.io/etcd/api/v3 v3.5.14 h1:vHObSCxyB9zlF60w7qzAdTcGaglbJOpSj1Xj9+WGxq0= @@ -240,22 +238,16 @@ go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30= golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M= golang.org/x/exp v0.0.0-20240707233637-46b078467d37 h1:uLDX+AfeFCct3a2C7uIWBKMJIR3CJMhcgfrUAqjRK6w= golang.org/x/exp v0.0.0-20240707233637-46b078467d37/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= golang.org/x/oauth2 v0.21.0 h1:tsimM75w1tF/uws5rbeHzIWxEqElMehnc+iW793zsZs= @@ -264,42 +256,29 @@ golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJ 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/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI= -golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= +golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.22.0 h1:BbsgPEJULsl2fV/AT3v15Mjva5yXKQDyKf+TbDz7QJk= golang.org/x/term v0.22.0/go.mod h1:F3qCibpT5AMpCRfhfT53vVJwhLtIVHhB9XDjfFvnMI4= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= -golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= +golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= +golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.23.0 h1:SGsXPZ+2l4JsgaCKkx+FQ9YZ5XEtA1GZYuoDjenLjvg= golang.org/x/tools v0.23.0/go.mod h1:pnu6ufv6vQkll6szChhK3C3L/ruaIv5eBeztNG8wtsI= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/legacy/openstack-cinder-csi-driver-operator/pkg/controllers/config/cloudinfo.go b/legacy/openstack-cinder-csi-driver-operator/pkg/controllers/config/cloudinfo.go index d64636ab2..d3190deb8 100644 --- a/legacy/openstack-cinder-csi-driver-operator/pkg/controllers/config/cloudinfo.go +++ b/legacy/openstack-cinder-csi-driver-operator/pkg/controllers/config/cloudinfo.go @@ -1,13 +1,14 @@ package config import ( + "context" "fmt" "sort" - "github.com/gophercloud/gophercloud" - "github.com/gophercloud/gophercloud/openstack/blockstorage/extensions/availabilityzones" - "github.com/gophercloud/utils/openstack/clientconfig" - azutils "github.com/gophercloud/utils/openstack/compute/v2/availabilityzones" + "github.com/gophercloud/gophercloud/v2" + "github.com/gophercloud/gophercloud/v2/openstack/blockstorage/v3/availabilityzones" + "github.com/gophercloud/utils/v2/openstack/clientconfig" + azutils "github.com/gophercloud/utils/v2/openstack/compute/v2/availabilityzones" "github.com/openshift/openstack-cinder-csi-driver-operator/pkg/version" ) @@ -77,13 +78,13 @@ func getCloudInfo() (*CloudInfo, error) { ua := gophercloud.UserAgent{} ua.Prepend(fmt.Sprintf("openstack-cinder-csi-driver-operator/%s", version.Get().GitCommit)) - ci.clients.computeClient, err = clientconfig.NewServiceClient("compute", opts) + ci.clients.computeClient, err = clientconfig.NewServiceClient(context.TODO(), "compute", opts) if err != nil { return nil, fmt.Errorf("failed to create a compute client: %w", err) } ci.clients.computeClient.UserAgent = ua - ci.clients.volumeClient, err = clientconfig.NewServiceClient("volume", opts) + ci.clients.volumeClient, err = clientconfig.NewServiceClient(context.TODO(), "volume", opts) if err != nil { return nil, fmt.Errorf("failed to create a volume client: %w", err) } @@ -114,7 +115,7 @@ func (ci *CloudInfo) collectInfo() error { } func (ci *CloudInfo) getComputeZones() ([]string, error) { - zones, err := azutils.ListAvailableAvailabilityZones(ci.clients.computeClient) + zones, err := azutils.ListAvailableAvailabilityZones(context.TODO(), ci.clients.computeClient) if err != nil { return nil, fmt.Errorf("failed to list compute availability zones: %w", err) } @@ -129,7 +130,7 @@ func (ci *CloudInfo) getComputeZones() ([]string, error) { } func (ci *CloudInfo) getVolumeZones() ([]string, error) { - allPages, err := availabilityzones.List(ci.clients.volumeClient).AllPages() + allPages, err := availabilityzones.List(ci.clients.volumeClient).AllPages(context.TODO()) if err != nil { return nil, fmt.Errorf("failed to list volume availability zones: %w", err) } diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gofrs/uuid/v5/.gitignore b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gofrs/uuid/v5/.gitignore new file mode 100644 index 000000000..666dbbb5b --- /dev/null +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gofrs/uuid/v5/.gitignore @@ -0,0 +1,15 @@ +# Binaries for programs and plugins +*.exe +*.exe~ +*.dll +*.so +*.dylib + +# Test binary, build with `go test -c` +*.test + +# Output of the go coverage tool, specifically when used with LiteIDE +*.out + +# binary bundle generated by go-fuzz +uuid-fuzz.zip diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gofrs/uuid/v5/.pre-commit-config.yaml b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gofrs/uuid/v5/.pre-commit-config.yaml new file mode 100644 index 000000000..919f2c44b --- /dev/null +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gofrs/uuid/v5/.pre-commit-config.yaml @@ -0,0 +1,14 @@ +repos: +- repo: https://github.com/gitleaks/gitleaks + rev: v8.16.3 + hooks: + - id: gitleaks +- repo: https://github.com/golangci/golangci-lint + rev: v1.52.2 + hooks: + - id: golangci-lint +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.4.0 + hooks: + - id: end-of-file-fixer + - id: trailing-whitespace diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gofrs/uuid/v5/LICENSE b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gofrs/uuid/v5/LICENSE new file mode 100644 index 000000000..926d54987 --- /dev/null +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gofrs/uuid/v5/LICENSE @@ -0,0 +1,20 @@ +Copyright (C) 2013-2018 by Maxim Bublis + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gofrs/uuid/v5/README.md b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gofrs/uuid/v5/README.md new file mode 100644 index 000000000..f26206e0d --- /dev/null +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gofrs/uuid/v5/README.md @@ -0,0 +1,92 @@ +# UUID + +[![License](https://img.shields.io/github/license/gofrs/uuid.svg)](https://github.com/gofrs/uuid/blob/master/LICENSE) +[![Build Status](https://github.com/gofrs/uuid/actions/workflows/go.yml/badge.svg)](https://github.com/gofrs/uuid/actions/workflows/go.yml) +[![Go Reference](https://pkg.go.dev/badge/github.com/gofrs/uuid/v5.svg)](https://pkg.go.dev/github.com/gofrs/uuid/v5) +[![Coverage Status](https://codecov.io/gh/gofrs/uuid/branch/master/graphs/badge.svg?branch=master)](https://codecov.io/gh/gofrs/uuid/) +[![Go Report Card](https://goreportcard.com/badge/github.com/gofrs/uuid)](https://goreportcard.com/report/github.com/gofrs/uuid) +[![CodeQL](https://github.com/gofrs/uuid/actions/workflows/codeql.yml/badge.svg)](https://github.com/gofrs/uuid/actions/workflows/codeql.yml) +[![OpenSSF Best Practices](https://www.bestpractices.dev/projects/8929/badge)](https://www.bestpractices.dev/projects/8929) +[![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/gofrs/uuid/badge)](https://scorecard.dev/viewer/?uri=github.com/gofrs/uuid) + +Package uuid provides a pure Go implementation of Universally Unique Identifiers +(UUID) variant as defined in RFC-9562. This package supports both the creation +and parsing of UUIDs in different formats. + +This package supports the following UUID versions: + +* Version 1, based on timestamp and MAC address +* Version 3, based on MD5 hashing of a named value +* Version 4, based on random numbers +* Version 5, based on SHA-1 hashing of a named value +* Version 6, a k-sortable id based on timestamp, and field-compatible with v1 +* Version 7, a k-sortable id based on timestamp + +## Project History + +This project was originally forked from the +[github.com/satori/go.uuid](https://github.com/satori/go.uuid) repository after +it appeared to be no longer maintained, while exhibiting [critical +flaws](https://github.com/satori/go.uuid/issues/73). We have decided to take +over this project to ensure it receives regular maintenance for the benefit of +the larger Go community. + +We'd like to thank Maxim Bublis for his hard work on the original iteration of +the package. + +## License + +This source code of this package is released under the MIT License. Please see +the [LICENSE](https://github.com/gofrs/uuid/blob/master/LICENSE) for the full +content of the license. + +## Recommended Package Version + +We recommend using v2.0.0+ of this package, as versions prior to 2.0.0 were +created before our fork of the original package and have some known +deficiencies. + +## Requirements + +This package requires Go 1.19 or later + +## Usage + +Here is a quick overview of how to use this package. For more detailed +documentation, please see the [GoDoc Page](http://godoc.org/github.com/gofrs/uuid). + +```go +package main + +import ( + "log" + + "github.com/gofrs/uuid/v5" +) + +// Create a Version 4 UUID, panicking on error. +// Use this form to initialize package-level variables. +var u1 = uuid.Must(uuid.NewV4()) + +func main() { + // Create a Version 4 UUID. + u2, err := uuid.NewV4() + if err != nil { + log.Fatalf("failed to generate UUID: %v", err) + } + log.Printf("generated Version 4 UUID %v", u2) + + // Parse a UUID from a string. + s := "6ba7b810-9dad-11d1-80b4-00c04fd430c8" + u3, err := uuid.FromString(s) + if err != nil { + log.Fatalf("failed to parse UUID %q: %v", s, err) + } + log.Printf("successfully parsed UUID %v", u3) +} +``` + +## References + +* [RFC-9562](https://tools.ietf.org/html/rfc9562) (replaces RFC-4122) +* [DCE 1.1: Authentication and Security Services](http://pubs.opengroup.org/onlinepubs/9696989899/chap5.htm#tagcjh_08_02_01_01) diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gofrs/uuid/v5/SECURITY.md b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gofrs/uuid/v5/SECURITY.md new file mode 100644 index 000000000..e09411e8c --- /dev/null +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gofrs/uuid/v5/SECURITY.md @@ -0,0 +1,22 @@ +# Security Policy + +## Supported Versions + +We support the latest version of this library. We do not guarantee support of previous versions. If a defect is reported, it will generally be fixed on the latest version +(provided it exists) irrespective of whether it was introduced in a prior version. + +## Reporting a Vulnerability + +If you discover a vulnerability against this package, please report it in the issues tab with a `vulnerability` label. We will examine promptly. + +If you would like to disclose the vulnerability privately, you may reach the maintainers in our [channel](https://gophers.slack.com/archives/CBP4N9BEU) on the gophers slack. + +## Security Scorecard + +This project submits security [results](https://scorecard.dev/viewer/?uri=github.com/gofrs/uuid) to the [OpenSSF Scorecard](https://securityscorecards.dev/). + +### Actively Maintained + +One heuristic these scorecards measure to gauge whether a package is safe for consumption is an "Actively Maintained" metric. Because this library implements UUIDs, +it is very stable - there is not much maintenance required other than adding/updating newer UUID versions, keeping up to date with latest versions of Go, and responding +to reported exploits. As a result, periods of low active maintenance are to be expected. diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gofrs/uuid/v5/codec.go b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gofrs/uuid/v5/codec.go new file mode 100644 index 000000000..8087955de --- /dev/null +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gofrs/uuid/v5/codec.go @@ -0,0 +1,229 @@ +// Copyright (C) 2013-2018 by Maxim Bublis +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +package uuid + +import "fmt" + +// FromBytes returns a UUID generated from the raw byte slice input. +// It will return an error if the slice isn't 16 bytes long. +func FromBytes(input []byte) (UUID, error) { + u := UUID{} + err := u.UnmarshalBinary(input) + return u, err +} + +// FromBytesOrNil returns a UUID generated from the raw byte slice input. +// Same behavior as FromBytes(), but returns uuid.Nil instead of an error. +func FromBytesOrNil(input []byte) UUID { + uuid, err := FromBytes(input) + if err != nil { + return Nil + } + return uuid +} + +func fromHexChar(c byte) byte { + switch { + case '0' <= c && c <= '9': + return c - '0' + case 'a' <= c && c <= 'f': + return c - 'a' + 10 + case 'A' <= c && c <= 'F': + return c - 'A' + 10 + } + return 255 +} + +// Parse parses the UUID stored in the string text. Parsing and supported +// formats are the same as UnmarshalText. +func (u *UUID) Parse(s string) error { + switch len(s) { + case 32: // hash + case 36: // canonical + case 34, 38: + if s[0] != '{' || s[len(s)-1] != '}' { + return fmt.Errorf("%w %q", ErrIncorrectFormatInString, s) + } + s = s[1 : len(s)-1] + case 41, 45: + if s[:9] != "urn:uuid:" { + return fmt.Errorf("%w %q", ErrIncorrectFormatInString, s[:9]) + } + s = s[9:] + default: + return fmt.Errorf("%w %d in string %q", ErrIncorrectLength, len(s), s) + } + // canonical + if len(s) == 36 { + if s[8] != '-' || s[13] != '-' || s[18] != '-' || s[23] != '-' { + return fmt.Errorf("%w %q", ErrIncorrectFormatInString, s) + } + for i, x := range [16]byte{ + 0, 2, 4, 6, + 9, 11, + 14, 16, + 19, 21, + 24, 26, 28, 30, 32, 34, + } { + v1 := fromHexChar(s[x]) + v2 := fromHexChar(s[x+1]) + if v1|v2 == 255 { + return ErrInvalidFormat + } + u[i] = (v1 << 4) | v2 + } + return nil + } + // hash like + for i := 0; i < 32; i += 2 { + v1 := fromHexChar(s[i]) + v2 := fromHexChar(s[i+1]) + if v1|v2 == 255 { + return ErrInvalidFormat + } + u[i/2] = (v1 << 4) | v2 + } + return nil +} + +// FromString returns a UUID parsed from the input string. +// Input is expected in a form accepted by UnmarshalText. +func FromString(text string) (UUID, error) { + var u UUID + err := u.Parse(text) + return u, err +} + +// FromStringOrNil returns a UUID parsed from the input string. +// Same behavior as FromString(), but returns uuid.Nil instead of an error. +func FromStringOrNil(input string) UUID { + uuid, err := FromString(input) + if err != nil { + return Nil + } + return uuid +} + +// MarshalText implements the encoding.TextMarshaler interface. +// The encoding is the same as returned by the String() method. +func (u UUID) MarshalText() ([]byte, error) { + var buf [36]byte + encodeCanonical(buf[:], u) + return buf[:], nil +} + +// UnmarshalText implements the encoding.TextUnmarshaler interface. +// Following formats are supported: +// +// "6ba7b810-9dad-11d1-80b4-00c04fd430c8", +// "{6ba7b810-9dad-11d1-80b4-00c04fd430c8}", +// "urn:uuid:6ba7b810-9dad-11d1-80b4-00c04fd430c8" +// "6ba7b8109dad11d180b400c04fd430c8" +// "{6ba7b8109dad11d180b400c04fd430c8}", +// "urn:uuid:6ba7b8109dad11d180b400c04fd430c8" +// +// ABNF for supported UUID text representation follows: +// +// URN := 'urn' +// UUID-NID := 'uuid' +// +// hexdig := '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | +// 'a' | 'b' | 'c' | 'd' | 'e' | 'f' | +// 'A' | 'B' | 'C' | 'D' | 'E' | 'F' +// +// hexoct := hexdig hexdig +// 2hexoct := hexoct hexoct +// 4hexoct := 2hexoct 2hexoct +// 6hexoct := 4hexoct 2hexoct +// 12hexoct := 6hexoct 6hexoct +// +// hashlike := 12hexoct +// canonical := 4hexoct '-' 2hexoct '-' 2hexoct '-' 6hexoct +// +// plain := canonical | hashlike +// uuid := canonical | hashlike | braced | urn +// +// braced := '{' plain '}' | '{' hashlike '}' +// urn := URN ':' UUID-NID ':' plain +func (u *UUID) UnmarshalText(b []byte) error { + switch len(b) { + case 32: // hash + case 36: // canonical + case 34, 38: + if b[0] != '{' || b[len(b)-1] != '}' { + return fmt.Errorf("%w %q", ErrIncorrectFormatInString, b) + } + b = b[1 : len(b)-1] + case 41, 45: + if string(b[:9]) != "urn:uuid:" { + return fmt.Errorf("%w %q", ErrIncorrectFormatInString, b[:9]) + } + b = b[9:] + default: + return fmt.Errorf("%w %d in string %q", ErrIncorrectLength, len(b), b) + } + if len(b) == 36 { + if b[8] != '-' || b[13] != '-' || b[18] != '-' || b[23] != '-' { + return fmt.Errorf("%w %q", ErrIncorrectFormatInString, b) + } + for i, x := range [16]byte{ + 0, 2, 4, 6, + 9, 11, + 14, 16, + 19, 21, + 24, 26, 28, 30, 32, 34, + } { + v1 := fromHexChar(b[x]) + v2 := fromHexChar(b[x+1]) + if v1|v2 == 255 { + return ErrInvalidFormat + } + u[i] = (v1 << 4) | v2 + } + return nil + } + for i := 0; i < 32; i += 2 { + v1 := fromHexChar(b[i]) + v2 := fromHexChar(b[i+1]) + if v1|v2 == 255 { + return ErrInvalidFormat + } + u[i/2] = (v1 << 4) | v2 + } + return nil +} + +// MarshalBinary implements the encoding.BinaryMarshaler interface. +func (u UUID) MarshalBinary() ([]byte, error) { + return u.Bytes(), nil +} + +// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface. +// It will return an error if the slice isn't 16 bytes long. +func (u *UUID) UnmarshalBinary(data []byte) error { + if len(data) != Size { + return fmt.Errorf("%w, got %d bytes", ErrIncorrectByteLength, len(data)) + } + copy(u[:], data) + + return nil +} diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gofrs/uuid/v5/error.go b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gofrs/uuid/v5/error.go new file mode 100644 index 000000000..7ca0be498 --- /dev/null +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gofrs/uuid/v5/error.go @@ -0,0 +1,40 @@ +package uuid + +// Error is a custom error type for UUID-related errors +type Error string + +// The strings defined in the errors is matching the previous behavior before +// the custom error type was implemented. The reason is that some people might +// be relying on the exact string representation to handle errors in their code. +const ( + // ErrInvalidFormat is returned when the UUID string representation does not + // match the expected format. See also ErrIncorrectFormatInString. + ErrInvalidFormat = Error("uuid: invalid UUID format") + + // ErrIncorrectFormatInString can be returned instead of ErrInvalidFormat. + // A separate error type is used because of how errors used to be formatted + // before custom error types were introduced. + ErrIncorrectFormatInString = Error("uuid: incorrect UUID format in string") + + // ErrIncorrectLength is returned when the UUID does not have the + // appropriate string length for parsing the UUID. + ErrIncorrectLength = Error("uuid: incorrect UUID length") + + // ErrIncorrectByteLength indicates the UUID byte slice length is invalid. + ErrIncorrectByteLength = Error("uuid: UUID must be exactly 16 bytes long") + + // ErrNoHwAddressFound is returned when a hardware (MAC) address cannot be + // found for UUID generation. + ErrNoHwAddressFound = Error("uuid: no HW address found") + + // ErrTypeConvertError is returned for type conversion operation fails. + ErrTypeConvertError = Error("uuid: cannot convert") + + // ErrInvalidVersion indicates an unsupported or invalid UUID version. + ErrInvalidVersion = Error("uuid:") +) + +// Error returns the string representation of the UUID error. +func (e Error) Error() string { + return string(e) +} diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gofrs/uuid/v5/generator.go b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gofrs/uuid/v5/generator.go new file mode 100644 index 000000000..02cba76ae --- /dev/null +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gofrs/uuid/v5/generator.go @@ -0,0 +1,491 @@ +// Copyright (C) 2013-2018 by Maxim Bublis +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +package uuid + +import ( + "crypto/md5" + "crypto/rand" + "crypto/sha1" + "encoding/binary" + "hash" + "io" + "net" + "sync" + "time" +) + +// Difference in 100-nanosecond intervals between +// UUID epoch (October 15, 1582) and Unix epoch (January 1, 1970). +const epochStart = 122192928000000000 + +// EpochFunc is the function type used to provide the current time. +type EpochFunc func() time.Time + +// HWAddrFunc is the function type used to provide hardware (MAC) addresses. +type HWAddrFunc func() (net.HardwareAddr, error) + +// DefaultGenerator is the default UUID Generator used by this package. +var DefaultGenerator Generator = NewGen() + +// NewV1 returns a UUID based on the current timestamp and MAC address. +func NewV1() (UUID, error) { + return DefaultGenerator.NewV1() +} + +// NewV1 returns a UUID based on the provided timestamp and MAC address. +func NewV1AtTime(atTime time.Time) (UUID, error) { + return DefaultGenerator.NewV1AtTime(atTime) +} + +// NewV3 returns a UUID based on the MD5 hash of the namespace UUID and name. +func NewV3(ns UUID, name string) UUID { + return DefaultGenerator.NewV3(ns, name) +} + +// NewV4 returns a randomly generated UUID. +func NewV4() (UUID, error) { + return DefaultGenerator.NewV4() +} + +// NewV5 returns a UUID based on SHA-1 hash of the namespace UUID and name. +func NewV5(ns UUID, name string) UUID { + return DefaultGenerator.NewV5(ns, name) +} + +// NewV6 returns a k-sortable UUID based on the current timestamp and 48 bits of +// pseudorandom data. The timestamp in a V6 UUID is the same as V1, with the bit +// order being adjusted to allow the UUID to be k-sortable. +func NewV6() (UUID, error) { + return DefaultGenerator.NewV6() +} + +// NewV6 returns a k-sortable UUID based on the provided timestamp and 48 bits of +// pseudorandom data. The timestamp in a V6 UUID is the same as V1, with the bit +// order being adjusted to allow the UUID to be k-sortable. +func NewV6AtTime(atTime time.Time) (UUID, error) { + return DefaultGenerator.NewV6AtTime(atTime) +} + +// NewV7 returns a k-sortable UUID based on the current millisecond-precision +// UNIX epoch and 74 bits of pseudorandom data. It supports single-node batch +// generation (multiple UUIDs in the same timestamp) with a Monotonic Random counter. +func NewV7() (UUID, error) { + return DefaultGenerator.NewV7() +} + +// NewV7 returns a k-sortable UUID based on the provided millisecond-precision +// UNIX epoch and 74 bits of pseudorandom data. It supports single-node batch +// generation (multiple UUIDs in the same timestamp) with a Monotonic Random counter. +func NewV7AtTime(atTime time.Time) (UUID, error) { + return DefaultGenerator.NewV7AtTime(atTime) +} + +// Generator provides an interface for generating UUIDs. +type Generator interface { + NewV1() (UUID, error) + NewV1AtTime(time.Time) (UUID, error) + NewV3(ns UUID, name string) UUID + NewV4() (UUID, error) + NewV5(ns UUID, name string) UUID + NewV6() (UUID, error) + NewV6AtTime(time.Time) (UUID, error) + NewV7() (UUID, error) + NewV7AtTime(time.Time) (UUID, error) +} + +// Gen is a reference UUID generator based on the specifications laid out in +// RFC-9562 and DCE 1.1: Authentication and Security Services. This type +// satisfies the Generator interface as defined in this package. +// +// For consumers who are generating V1 UUIDs, but don't want to expose the MAC +// address of the node generating the UUIDs, the NewGenWithHWAF() function has been +// provided as a convenience. See the function's documentation for more info. +// +// The authors of this package do not feel that the majority of users will need +// to obfuscate their MAC address, and so we recommend using NewGen() to create +// a new generator. +type Gen struct { + clockSequenceOnce sync.Once + hardwareAddrOnce sync.Once + storageMutex sync.Mutex + + rand io.Reader + + epochFunc EpochFunc + hwAddrFunc HWAddrFunc + lastTime uint64 + clockSequence uint16 + hardwareAddr [6]byte +} + +// GenOption is a function type that can be used to configure a Gen generator. +type GenOption func(*Gen) + +// interface check -- build will fail if *Gen doesn't satisfy Generator +var _ Generator = (*Gen)(nil) + +// NewGen returns a new instance of Gen with some default values set. Most +// people should use this. +func NewGen() *Gen { + return NewGenWithHWAF(defaultHWAddrFunc) +} + +// NewGenWithHWAF builds a new UUID generator with the HWAddrFunc provided. Most +// consumers should use NewGen() instead. +// +// This is used so that consumers can generate their own MAC addresses, for use +// in the generated UUIDs, if there is some concern about exposing the physical +// address of the machine generating the UUID. +// +// The Gen generator will only invoke the HWAddrFunc once, and cache that MAC +// address for all the future UUIDs generated by it. If you'd like to switch the +// MAC address being used, you'll need to create a new generator using this +// function. +func NewGenWithHWAF(hwaf HWAddrFunc) *Gen { + return NewGenWithOptions(WithHWAddrFunc(hwaf)) +} + +// NewGenWithOptions returns a new instance of Gen with the options provided. +// Most people should use NewGen() or NewGenWithHWAF() instead. +// +// To customize the generator, you can pass in one or more GenOption functions. +// For example: +// +// gen := NewGenWithOptions( +// WithHWAddrFunc(myHWAddrFunc), +// WithEpochFunc(myEpochFunc), +// WithRandomReader(myRandomReader), +// ) +// +// NewGenWithOptions(WithHWAddrFunc(myHWAddrFunc)) is equivalent to calling +// NewGenWithHWAF(myHWAddrFunc) +// NewGenWithOptions() is equivalent to calling NewGen() +func NewGenWithOptions(opts ...GenOption) *Gen { + gen := &Gen{ + epochFunc: time.Now, + hwAddrFunc: defaultHWAddrFunc, + rand: rand.Reader, + } + + for _, opt := range opts { + opt(gen) + } + + return gen +} + +// WithHWAddrFunc is a GenOption that allows you to provide your own HWAddrFunc +// function. +// When this option is nil, the defaultHWAddrFunc is used. +func WithHWAddrFunc(hwaf HWAddrFunc) GenOption { + return func(gen *Gen) { + if hwaf == nil { + hwaf = defaultHWAddrFunc + } + + gen.hwAddrFunc = hwaf + } +} + +// WithEpochFunc is a GenOption that allows you to provide your own EpochFunc +// function. +// When this option is nil, time.Now is used. +func WithEpochFunc(epochf EpochFunc) GenOption { + return func(gen *Gen) { + if epochf == nil { + epochf = time.Now + } + + gen.epochFunc = epochf + } +} + +// WithRandomReader is a GenOption that allows you to provide your own random +// reader. +// When this option is nil, the default rand.Reader is used. +func WithRandomReader(reader io.Reader) GenOption { + return func(gen *Gen) { + if reader == nil { + reader = rand.Reader + } + + gen.rand = reader + } +} + +// NewV1 returns a UUID based on the current timestamp and MAC address. +func (g *Gen) NewV1() (UUID, error) { + return g.NewV1AtTime(g.epochFunc()) +} + +// NewV1AtTime returns a UUID based on the provided timestamp and current MAC address. +func (g *Gen) NewV1AtTime(atTime time.Time) (UUID, error) { + u := UUID{} + + timeNow, clockSeq, err := g.getClockSequence(false, atTime) + if err != nil { + return Nil, err + } + binary.BigEndian.PutUint32(u[0:], uint32(timeNow)) + binary.BigEndian.PutUint16(u[4:], uint16(timeNow>>32)) + binary.BigEndian.PutUint16(u[6:], uint16(timeNow>>48)) + binary.BigEndian.PutUint16(u[8:], clockSeq) + + hardwareAddr, err := g.getHardwareAddr() + if err != nil { + return Nil, err + } + copy(u[10:], hardwareAddr) + + u.SetVersion(V1) + u.SetVariant(VariantRFC9562) + + return u, nil +} + +// NewV3 returns a UUID based on the MD5 hash of the namespace UUID and name. +func (g *Gen) NewV3(ns UUID, name string) UUID { + u := newFromHash(md5.New(), ns, name) + u.SetVersion(V3) + u.SetVariant(VariantRFC9562) + + return u +} + +// NewV4 returns a randomly generated UUID. +func (g *Gen) NewV4() (UUID, error) { + u := UUID{} + if _, err := io.ReadFull(g.rand, u[:]); err != nil { + return Nil, err + } + u.SetVersion(V4) + u.SetVariant(VariantRFC9562) + + return u, nil +} + +// NewV5 returns a UUID based on SHA-1 hash of the namespace UUID and name. +func (g *Gen) NewV5(ns UUID, name string) UUID { + u := newFromHash(sha1.New(), ns, name) + u.SetVersion(V5) + u.SetVariant(VariantRFC9562) + + return u +} + +// NewV6 returns a k-sortable UUID based on the current timestamp and 48 bits of +// pseudorandom data. The timestamp in a V6 UUID is the same as V1, with the bit +// order being adjusted to allow the UUID to be k-sortable. +func (g *Gen) NewV6() (UUID, error) { + return g.NewV6AtTime(g.epochFunc()) +} + +// NewV6 returns a k-sortable UUID based on the provided timestamp and 48 bits of +// pseudorandom data. The timestamp in a V6 UUID is the same as V1, with the bit +// order being adjusted to allow the UUID to be k-sortable. +func (g *Gen) NewV6AtTime(atTime time.Time) (UUID, error) { + /* https://datatracker.ietf.org/doc/html/rfc9562#name-uuid-version-6 + 0 1 2 3 + 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | time_high | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | time_mid | ver | time_low | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + |var| clock_seq | node | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | node | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */ + var u UUID + + timeNow, _, err := g.getClockSequence(false, atTime) + if err != nil { + return Nil, err + } + + binary.BigEndian.PutUint32(u[0:], uint32(timeNow>>28)) // set time_high + binary.BigEndian.PutUint16(u[4:], uint16(timeNow>>12)) // set time_mid + binary.BigEndian.PutUint16(u[6:], uint16(timeNow&0xfff)) // set time_low (minus four version bits) + + // Based on the RFC 9562 recommendation that this data be fully random and not a monotonic counter, + //we do NOT support batching version 6 UUIDs. + //set clock_seq (14 bits) and node (48 bits) pseudo-random bits (first 2 bits will be overridden) + if _, err = io.ReadFull(g.rand, u[8:]); err != nil { + return Nil, err + } + + u.SetVersion(V6) + + //overwrite first 2 bits of byte[8] for the variant + u.SetVariant(VariantRFC9562) + + return u, nil +} + +// NewV7 returns a k-sortable UUID based on the current millisecond-precision +// UNIX epoch and 74 bits of pseudorandom data. +func (g *Gen) NewV7() (UUID, error) { + return g.NewV7AtTime(g.epochFunc()) +} + +// NewV7 returns a k-sortable UUID based on the provided millisecond-precision +// UNIX epoch and 74 bits of pseudorandom data. +func (g *Gen) NewV7AtTime(atTime time.Time) (UUID, error) { + var u UUID + /* https://datatracker.ietf.org/doc/html/rfc9562#name-uuid-version-7 + 0 1 2 3 + 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | unix_ts_ms | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | unix_ts_ms | ver | rand_a | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + |var| rand_b | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | rand_b | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */ + + ms, clockSeq, err := g.getClockSequence(true, atTime) + if err != nil { + return Nil, err + } + //UUIDv7 features a 48 bit timestamp. First 32bit (4bytes) represents seconds since 1970, followed by 2 bytes for the ms granularity. + u[0] = byte(ms >> 40) //1-6 bytes: big-endian unsigned number of Unix epoch timestamp + u[1] = byte(ms >> 32) + u[2] = byte(ms >> 24) + u[3] = byte(ms >> 16) + u[4] = byte(ms >> 8) + u[5] = byte(ms) + + //Support batching by using a monotonic pseudo-random sequence, + //as described in RFC 9562 section 6.2, Method 1. + //The 6th byte contains the version and partially rand_a data. + //We will lose the most significant bites from the clockSeq (with SetVersion), but it is ok, + //we need the least significant that contains the counter to ensure the monotonic property + binary.BigEndian.PutUint16(u[6:8], clockSeq) // set rand_a with clock seq which is random and monotonic + + //override first 4bits of u[6]. + u.SetVersion(V7) + + //set rand_b 64bits of pseudo-random bits (first 2 will be overridden) + if _, err = io.ReadFull(g.rand, u[8:16]); err != nil { + return Nil, err + } + //override first 2 bits of byte[8] for the variant + u.SetVariant(VariantRFC9562) + + return u, nil +} + +// getClockSequence returns the epoch and clock sequence of the provided time, +// used for generating V1,V6 and V7 UUIDs. +// +// When useUnixTSMs is false, it uses the Coordinated Universal Time (UTC) as a count of +// 100-nanosecond intervals since 00:00:00.00, 15 October 1582 (the date of Gregorian +// reform to the Christian calendar). +func (g *Gen) getClockSequence(useUnixTSMs bool, atTime time.Time) (uint64, uint16, error) { + var err error + g.clockSequenceOnce.Do(func() { + buf := make([]byte, 2) + if _, err = io.ReadFull(g.rand, buf); err != nil { + return + } + g.clockSequence = binary.BigEndian.Uint16(buf) + }) + if err != nil { + return 0, 0, err + } + + g.storageMutex.Lock() + defer g.storageMutex.Unlock() + + var timeNow uint64 + if useUnixTSMs { + timeNow = uint64(atTime.UnixMilli()) + } else { + timeNow = g.getEpoch(atTime) + } + // Clock didn't change since last UUID generation. + // Should increase clock sequence. + if timeNow <= g.lastTime { + g.clockSequence++ + } + g.lastTime = timeNow + + return timeNow, g.clockSequence, nil +} + +// Returns the hardware address. +func (g *Gen) getHardwareAddr() ([]byte, error) { + var err error + g.hardwareAddrOnce.Do(func() { + var hwAddr net.HardwareAddr + if hwAddr, err = g.hwAddrFunc(); err == nil { + copy(g.hardwareAddr[:], hwAddr) + return + } + + // Initialize hardwareAddr randomly in case + // of real network interfaces absence. + if _, err = io.ReadFull(g.rand, g.hardwareAddr[:]); err != nil { + return + } + // Set multicast bit as recommended by RFC-9562 + g.hardwareAddr[0] |= 0x01 + }) + if err != nil { + return []byte{}, err + } + return g.hardwareAddr[:], nil +} + +// Returns the difference between UUID epoch (October 15, 1582) +// and the provided time in 100-nanosecond intervals. +func (g *Gen) getEpoch(atTime time.Time) uint64 { + return epochStart + uint64(atTime.UnixNano()/100) +} + +// Returns the UUID based on the hashing of the namespace UUID and name. +func newFromHash(h hash.Hash, ns UUID, name string) UUID { + u := UUID{} + h.Write(ns[:]) + h.Write([]byte(name)) + copy(u[:], h.Sum(nil)) + + return u +} + +var netInterfaces = net.Interfaces + +// Returns the hardware address. +func defaultHWAddrFunc() (net.HardwareAddr, error) { + ifaces, err := netInterfaces() + if err != nil { + return []byte{}, err + } + for _, iface := range ifaces { + if len(iface.HardwareAddr) >= 6 { + return iface.HardwareAddr, nil + } + } + return []byte{}, ErrNoHwAddressFound +} diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gofrs/uuid/v5/sql.go b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gofrs/uuid/v5/sql.go new file mode 100644 index 000000000..cdc751820 --- /dev/null +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gofrs/uuid/v5/sql.go @@ -0,0 +1,116 @@ +// Copyright (C) 2013-2018 by Maxim Bublis +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +package uuid + +import ( + "database/sql" + "database/sql/driver" + "fmt" +) + +var _ driver.Valuer = UUID{} +var _ sql.Scanner = (*UUID)(nil) + +// Value implements the driver.Valuer interface. +func (u UUID) Value() (driver.Value, error) { + return u.String(), nil +} + +// Scan implements the sql.Scanner interface. +// A 16-byte slice will be handled by UnmarshalBinary, while +// a longer byte slice or a string will be handled by UnmarshalText. +func (u *UUID) Scan(src interface{}) error { + switch src := src.(type) { + case UUID: // support gorm convert from UUID to NullUUID + *u = src + return nil + + case []byte: + if len(src) == Size { + return u.UnmarshalBinary(src) + } + return u.UnmarshalText(src) + + case string: + uu, err := FromString(src) + *u = uu + return err + } + + return fmt.Errorf("%w %T to UUID", ErrTypeConvertError, src) +} + +// NullUUID can be used with the standard sql package to represent a +// UUID value that can be NULL in the database. +type NullUUID struct { + UUID UUID + Valid bool +} + +// Value implements the driver.Valuer interface. +func (u NullUUID) Value() (driver.Value, error) { + if !u.Valid { + return nil, nil + } + // Delegate to UUID Value function + return u.UUID.Value() +} + +// Scan implements the sql.Scanner interface. +func (u *NullUUID) Scan(src interface{}) error { + if src == nil { + u.UUID, u.Valid = Nil, false + return nil + } + + // Delegate to UUID Scan function + u.Valid = true + return u.UUID.Scan(src) +} + +var nullJSON = []byte("null") + +// MarshalJSON marshals the NullUUID as null or the nested UUID +func (u NullUUID) MarshalJSON() ([]byte, error) { + if !u.Valid { + return nullJSON, nil + } + var buf [38]byte + buf[0] = '"' + encodeCanonical(buf[1:37], u.UUID) + buf[37] = '"' + return buf[:], nil +} + +// UnmarshalJSON unmarshals a NullUUID +func (u *NullUUID) UnmarshalJSON(b []byte) error { + if string(b) == "null" { + u.UUID, u.Valid = Nil, false + return nil + } + if n := len(b); n >= 2 && b[0] == '"' { + b = b[1 : n-1] + } + err := u.UUID.UnmarshalText(b) + u.Valid = (err == nil) + return err +} diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gofrs/uuid/v5/uuid.go b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gofrs/uuid/v5/uuid.go new file mode 100644 index 000000000..e6fc3fc10 --- /dev/null +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gofrs/uuid/v5/uuid.go @@ -0,0 +1,320 @@ +// Copyright (C) 2013-2018 by Maxim Bublis +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +// Package uuid provides implementations of the Universally Unique Identifier +// (UUID), as specified in RFC-9562 (formerly RFC-4122). +// +// RFC-9562[1] provides the specification for versions 1, 3, 4, 5, 6 and 7. +// +// DCE 1.1[2] provides the specification for version 2, but version 2 support +// was removed from this package in v4 due to some concerns with the +// specification itself. Reading the spec, it seems that it would result in +// generating UUIDs that aren't very unique. In having read the spec it seemed +// that our implementation did not meet the spec. It also seems to be at-odds +// with RFC 9562, meaning we would need quite a bit of special code to support +// it. Lastly, there were no Version 2 implementations that we could find to +// ensure we were understanding the specification correctly. +// +// [1] https://tools.ietf.org/html/rfc9562 +// [2] http://pubs.opengroup.org/onlinepubs/9696989899/chap5.htm#tagcjh_08_02_01_01 +package uuid + +import ( + "encoding/binary" + "encoding/hex" + "fmt" + "time" +) + +// Size of a UUID in bytes. +const Size = 16 + +// UUID is an array type to represent the value of a UUID, as defined in RFC-9562. +type UUID [Size]byte + +// UUID versions. +const ( + _ byte = iota + V1 // Version 1 (date-time and MAC address) + _ // Version 2 (date-time and MAC address, DCE security version) [removed] + V3 // Version 3 (namespace name-based) + V4 // Version 4 (random) + V5 // Version 5 (namespace name-based) + V6 // Version 6 (k-sortable timestamp and random data, field-compatible with v1) + V7 // Version 7 (k-sortable timestamp and random data) + _ // Version 8 (k-sortable timestamp, meant for custom implementations) [not implemented] +) + +// UUID layout variants. +const ( + VariantNCS byte = iota + VariantRFC9562 + VariantMicrosoft + VariantFuture +) + +// Backward-compatible variant for RFC 4122 +const VariantRFC4122 = VariantRFC9562 + +// UUID DCE domains. +const ( + DomainPerson = iota + DomainGroup + DomainOrg +) + +// Timestamp is the count of 100-nanosecond intervals since 00:00:00.00, +// 15 October 1582 within a V1 UUID. This type has no meaning for other +// UUID versions since they don't have an embedded timestamp. +type Timestamp uint64 + +const _100nsPerSecond = 10000000 + +// Time returns the UTC time.Time representation of a Timestamp +func (t Timestamp) Time() (time.Time, error) { + secs := uint64(t) / _100nsPerSecond + nsecs := 100 * (uint64(t) % _100nsPerSecond) + + return time.Unix(int64(secs)-(epochStart/_100nsPerSecond), int64(nsecs)), nil +} + +// TimestampFromV1 returns the Timestamp embedded within a V1 UUID. +// Returns an error if the UUID is any version other than 1. +func TimestampFromV1(u UUID) (Timestamp, error) { + if u.Version() != 1 { + err := fmt.Errorf("%w %s is version %d, not version 1", ErrInvalidVersion, u, u.Version()) + return 0, err + } + + low := binary.BigEndian.Uint32(u[0:4]) + mid := binary.BigEndian.Uint16(u[4:6]) + hi := binary.BigEndian.Uint16(u[6:8]) & 0xfff + + return Timestamp(uint64(low) + (uint64(mid) << 32) + (uint64(hi) << 48)), nil +} + +// TimestampFromV6 returns the Timestamp embedded within a V6 UUID. This +// function returns an error if the UUID is any version other than 6. +func TimestampFromV6(u UUID) (Timestamp, error) { + if u.Version() != 6 { + return 0, fmt.Errorf("%w %s is version %d, not version 6", ErrInvalidVersion, u, u.Version()) + } + + hi := binary.BigEndian.Uint32(u[0:4]) + mid := binary.BigEndian.Uint16(u[4:6]) + low := binary.BigEndian.Uint16(u[6:8]) & 0xfff + + return Timestamp(uint64(low) + (uint64(mid) << 12) + (uint64(hi) << 28)), nil +} + +// TimestampFromV7 returns the Timestamp embedded within a V7 UUID. This +// function returns an error if the UUID is any version other than 7. +func TimestampFromV7(u UUID) (Timestamp, error) { + if u.Version() != 7 { + return 0, fmt.Errorf("%w %s is version %d, not version 7", ErrInvalidVersion, u, u.Version()) + } + + t := 0 | + (int64(u[0]) << 40) | + (int64(u[1]) << 32) | + (int64(u[2]) << 24) | + (int64(u[3]) << 16) | + (int64(u[4]) << 8) | + int64(u[5]) + + // convert to format expected by Timestamp + tsNanos := epochStart + time.UnixMilli(t).UTC().UnixNano()/100 + return Timestamp(tsNanos), nil +} + +// Nil is the nil UUID, as specified in RFC-9562, that has all 128 bits set to +// zero. +var Nil = UUID{} + +// Max is the maximum UUID, as specified in RFC-9562, that has all 128 bits +// set to one. +var Max = UUID{ + 0xFF, + 0xFF, + 0xFF, + 0xFF, + 0xFF, + 0xFF, + 0xFF, + 0xFF, + 0xFF, + 0xFF, + 0xFF, + 0xFF, + 0xFF, + 0xFF, + 0xFF, + 0xFF, +} + +// Predefined namespace UUIDs. +var ( + NamespaceDNS = Must(FromString("6ba7b810-9dad-11d1-80b4-00c04fd430c8")) + NamespaceURL = Must(FromString("6ba7b811-9dad-11d1-80b4-00c04fd430c8")) + NamespaceOID = Must(FromString("6ba7b812-9dad-11d1-80b4-00c04fd430c8")) + NamespaceX500 = Must(FromString("6ba7b814-9dad-11d1-80b4-00c04fd430c8")) +) + +// IsNil returns if the UUID is equal to the nil UUID +func (u UUID) IsNil() bool { + return u == Nil +} + +// Version returns the algorithm version used to generate the UUID. +func (u UUID) Version() byte { + return u[6] >> 4 +} + +// Variant returns the UUID layout variant. +func (u UUID) Variant() byte { + switch { + case (u[8] >> 7) == 0x00: + return VariantNCS + case (u[8] >> 6) == 0x02: + return VariantRFC9562 + case (u[8] >> 5) == 0x06: + return VariantMicrosoft + case (u[8] >> 5) == 0x07: + fallthrough + default: + return VariantFuture + } +} + +// Bytes returns a byte slice representation of the UUID. +func (u UUID) Bytes() []byte { + return u[:] +} + +// encodeCanonical encodes the canonical RFC-9562 form of UUID u into the +// first 36 bytes dst. +func encodeCanonical(dst []byte, u UUID) { + const hextable = "0123456789abcdef" + dst[8] = '-' + dst[13] = '-' + dst[18] = '-' + dst[23] = '-' + for i, x := range [16]byte{ + 0, 2, 4, 6, + 9, 11, + 14, 16, + 19, 21, + 24, 26, 28, 30, 32, 34, + } { + c := u[i] + dst[x] = hextable[c>>4] + dst[x+1] = hextable[c&0x0f] + } +} + +// String returns a canonical RFC-9562 string representation of the UUID: +// xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. +func (u UUID) String() string { + var buf [36]byte + encodeCanonical(buf[:], u) + return string(buf[:]) +} + +// Format implements fmt.Formatter for UUID values. +// +// The behavior is as follows: +// The 'x' and 'X' verbs output only the hex digits of the UUID, using a-f for 'x' and A-F for 'X'. +// The 'v', '+v', 's' and 'q' verbs return the canonical RFC-9562 string representation. +// The 'S' verb returns the RFC-9562 format, but with capital hex digits. +// The '#v' verb returns the "Go syntax" representation, which is a 16 byte array initializer. +// All other verbs not handled directly by the fmt package (like '%p') are unsupported and will return +// "%!verb(uuid.UUID=value)" as recommended by the fmt package. +func (u UUID) Format(f fmt.State, c rune) { + if c == 'v' && f.Flag('#') { + fmt.Fprintf(f, "%#v", [Size]byte(u)) + return + } + switch c { + case 'x', 'X': + b := make([]byte, 32) + hex.Encode(b, u[:]) + if c == 'X' { + toUpperHex(b) + } + _, _ = f.Write(b) + case 'v', 's', 'S': + b, _ := u.MarshalText() + if c == 'S' { + toUpperHex(b) + } + _, _ = f.Write(b) + case 'q': + b := make([]byte, 38) + b[0] = '"' + encodeCanonical(b[1:], u) + b[37] = '"' + _, _ = f.Write(b) + default: + // invalid/unsupported format verb + fmt.Fprintf(f, "%%!%c(uuid.UUID=%s)", c, u.String()) + } +} + +func toUpperHex(b []byte) { + for i, c := range b { + if 'a' <= c && c <= 'f' { + b[i] = c - ('a' - 'A') + } + } +} + +// SetVersion sets the version bits. +func (u *UUID) SetVersion(v byte) { + u[6] = (u[6] & 0x0f) | (v << 4) +} + +// SetVariant sets the variant bits. +func (u *UUID) SetVariant(v byte) { + switch v { + case VariantNCS: + u[8] = (u[8]&(0xff>>1) | (0x00 << 7)) + case VariantRFC9562: + u[8] = (u[8]&(0xff>>2) | (0x02 << 6)) + case VariantMicrosoft: + u[8] = (u[8]&(0xff>>3) | (0x06 << 5)) + case VariantFuture: + fallthrough + default: + u[8] = (u[8]&(0xff>>3) | (0x07 << 5)) + } +} + +// Must is a helper that wraps a call to a function returning (UUID, error) +// and panics if the error is non-nil. It is intended for use in variable +// initializations such as +// +// var packageUUID = uuid.Must(uuid.FromString("123e4567-e89b-12d3-a456-426655440000")) +func Must(u UUID, err error) UUID { + if err != nil { + panic(err) + } + return u +} diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/README.md b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/README.md deleted file mode 100644 index 4e6e57dad..000000000 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/README.md +++ /dev/null @@ -1,172 +0,0 @@ -# Gophercloud: an OpenStack SDK for Go -[![Coverage Status](https://coveralls.io/repos/github/gophercloud/gophercloud/badge.svg?branch=v1)](https://coveralls.io/github/gophercloud/gophercloud?branch=v1) - -Gophercloud is an OpenStack Go SDK. - -## Useful links - -* [Reference documentation](http://godoc.org/github.com/gophercloud/gophercloud) -* [Effective Go](https://golang.org/doc/effective_go.html) - -## How to install - -Reference a Gophercloud package in your code: - -```go -import "github.com/gophercloud/gophercloud" -``` - -Then update your `go.mod`: - -```shell -go mod tidy -``` - -## Getting started - -### Credentials - -Because you'll be hitting an API, you will need to retrieve your OpenStack -credentials and either store them in a `clouds.yaml` file, as environment -variables, or in your local Go files. The first method is recommended because -it decouples credential information from source code, allowing you to push the -latter to your version control system without any security risk. - -You will need to retrieve the following: - -* A valid Keystone identity URL -* Credentials. These can be a username/password combo, a set of Application - Credentials, a pre-generated token, or any other supported authentication - mechanism. - -For users who have the OpenStack dashboard installed, there's a shortcut. If -you visit the `project/api_access` path in Horizon and click on the -"Download OpenStack RC File" button at the top right hand corner, you can -download either a `clouds.yaml` file or an `openrc` bash file that exports all -of your access details to environment variables. To use the `clouds.yaml` file, -place it at `~/.config/openstack/clouds.yaml`. To use the `openrc` file, run -`source openrc` and you will be prompted for your password. - -### Authentication - -Once you have access to your credentials, you can begin plugging them into -Gophercloud. The next step is authentication, which is handled by a base -"Provider" struct. There are number of ways to construct such a struct. - -**With `gophercloud/utils`** - -The [github.com/gophercloud/utils](https://github.com/gophercloud/utils) -library provides the `clientconfig` package to simplify authentication. It -provides additional functionality, such as the ability to read `clouds.yaml` -files. To generate a "Provider" struct using the `clientconfig` package: - -```go -import ( - "github.com/gophercloud/utils/openstack/clientconfig" -) - -// You can also skip configuring this and instead set 'OS_CLOUD' in your -// environment -opts := new(clientconfig.ClientOpts) -opts.Cloud = "devstack-admin" - -provider, err := clientconfig.AuthenticatedClient(opts) -``` - -A provider client is a top-level client that all of your OpenStack service -clients derive from. The provider contains all of the authentication details -that allow your Go code to access the API - such as the base URL and token ID. - -Once we have a base Provider, we inject it as a dependency into each OpenStack -service. For example, in order to work with the Compute API, we need a Compute -service client. This can be created like so: - -```go -client, err := clientconfig.NewServiceClient("compute", opts) -``` - -**Without `gophercloud/utils`** - -> *Note* -> gophercloud doesn't provide support for `clouds.yaml` file so you need to -> implement this functionality yourself if you don't wish to use -> `gophercloud/utils`. - -You can also generate a "Provider" struct without using the `clientconfig` -package from `gophercloud/utils`. To do this, you can either pass in your -credentials explicitly or tell Gophercloud to use environment variables: - -```go -import ( - "github.com/gophercloud/gophercloud" - "github.com/gophercloud/gophercloud/openstack" -) - -// Option 1: Pass in the values yourself -opts := gophercloud.AuthOptions{ - IdentityEndpoint: "https://openstack.example.com:5000/v2.0", - Username: "{username}", - Password: "{password}", -} - -// Option 2: Use a utility function to retrieve all your environment variables -opts, err := openstack.AuthOptionsFromEnv() -``` - -Once you have the `opts` variable, you can pass it in and get back a -`ProviderClient` struct: - -```go -provider, err := openstack.AuthenticatedClient(opts) -``` - -As above, you can then use this provider client to generate a service client -for a particular OpenStack service: - -```go -client, err := openstack.NewComputeV2(provider, gophercloud.EndpointOpts{ - Region: os.Getenv("OS_REGION_NAME"), -}) -``` - -### Provision a server - -We can use the Compute service client generated above for any Compute API -operation we want. In our case, we want to provision a new server. To do this, -we invoke the `Create` method and pass in the flavor ID (hardware -specification) and image ID (operating system) we're interested in: - -```go -import "github.com/gophercloud/gophercloud/openstack/compute/v2/servers" - -server, err := servers.Create(client, servers.CreateOpts{ - Name: "My new server!", - FlavorRef: "flavor_id", - ImageRef: "image_id", -}).Extract() -``` - -The above code sample creates a new server with the parameters, and embodies the -new resource in the `server` variable (a -[`servers.Server`](http://godoc.org/github.com/gophercloud/gophercloud) struct). - -## Advanced Usage - -Have a look at the [FAQ](./docs/FAQ.md) for some tips on customizing the way Gophercloud works. - -## Backwards-Compatibility Guarantees - -Gophercloud versioning follows [semver](https://semver.org/spec/v2.0.0.html). - -Before `v1.0.0`, there were no guarantees. Starting with v1, there will be no breaking changes within a major release. - -See the [Release instructions](./RELEASE.md). - -## Contributing - -See the [contributing guide](./.github/CONTRIBUTING.md). - -## Help and feedback - -If you're struggling with something or have spotted a potential bug, feel free -to submit an issue to our [bug tracker](https://github.com/gophercloud/gophercloud/issues). diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/blockstorage/extensions/availabilityzones/doc.go b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/blockstorage/extensions/availabilityzones/doc.go deleted file mode 100644 index 29faa8dcb..000000000 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/blockstorage/extensions/availabilityzones/doc.go +++ /dev/null @@ -1,21 +0,0 @@ -/* -Package availabilityzones provides the ability to get lists of -available volume availability zones. - -Example of Get Availability Zone Information - - allPages, err := availabilityzones.List(volumeClient).AllPages() - if err != nil { - panic(err) - } - - availabilityZoneInfo, err := availabilityzones.ExtractAvailabilityZones(allPages) - if err != nil { - panic(err) - } - - for _, zoneInfo := range availabilityZoneInfo { - fmt.Printf("%+v\n", zoneInfo) - } -*/ -package availabilityzones diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/utils/choose_version.go b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/utils/choose_version.go deleted file mode 100644 index 27da19f91..000000000 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/utils/choose_version.go +++ /dev/null @@ -1,111 +0,0 @@ -package utils - -import ( - "fmt" - "strings" - - "github.com/gophercloud/gophercloud" -) - -// Version is a supported API version, corresponding to a vN package within the appropriate service. -type Version struct { - ID string - Suffix string - Priority int -} - -var goodStatus = map[string]bool{ - "current": true, - "supported": true, - "stable": true, -} - -// ChooseVersion queries the base endpoint of an API to choose the most recent non-experimental alternative from a service's -// published versions. -// It returns the highest-Priority Version among the alternatives that are provided, as well as its corresponding endpoint. -func ChooseVersion(client *gophercloud.ProviderClient, recognized []*Version) (*Version, string, error) { - type linkResp struct { - Href string `json:"href"` - Rel string `json:"rel"` - } - - type valueResp struct { - ID string `json:"id"` - Status string `json:"status"` - Links []linkResp `json:"links"` - } - - type versionsResp struct { - Values []valueResp `json:"values"` - } - - type response struct { - Versions versionsResp `json:"versions"` - } - - normalize := func(endpoint string) string { - if !strings.HasSuffix(endpoint, "/") { - return endpoint + "/" - } - return endpoint - } - identityEndpoint := normalize(client.IdentityEndpoint) - - // If a full endpoint is specified, check version suffixes for a match first. - for _, v := range recognized { - if strings.HasSuffix(identityEndpoint, v.Suffix) { - return v, identityEndpoint, nil - } - } - - var resp response - _, err := client.Request("GET", client.IdentityBase, &gophercloud.RequestOpts{ - JSONResponse: &resp, - OkCodes: []int{200, 300}, - }) - - if err != nil { - return nil, "", err - } - - var highest *Version - var endpoint string - - for _, value := range resp.Versions.Values { - href := "" - for _, link := range value.Links { - if link.Rel == "self" { - href = normalize(link.Href) - } - } - - for _, version := range recognized { - if strings.Contains(value.ID, version.ID) { - // Prefer a version that exactly matches the provided endpoint. - if href == identityEndpoint { - if href == "" { - return nil, "", fmt.Errorf("Endpoint missing in version %s response from %s", value.ID, client.IdentityBase) - } - return version, href, nil - } - - // Otherwise, find the highest-priority version with a whitelisted status. - if goodStatus[strings.ToLower(value.Status)] { - if highest == nil || version.Priority > highest.Priority { - highest = version - endpoint = href - } - } - } - } - } - - if highest == nil { - return nil, "", fmt.Errorf("No supported version available from endpoint %s", client.IdentityBase) - } - if endpoint == "" { - return nil, "", fmt.Errorf("Endpoint missing in version %s response from %s", highest.ID, client.IdentityBase) - } - - return highest, endpoint, nil -} diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/.gitignore b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/.gitignore similarity index 80% rename from legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/.gitignore rename to legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/.gitignore index d7a5e5293..8b1b79e61 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/.gitignore +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/.gitignore @@ -2,3 +2,4 @@ .idea .vscode testing_*.coverprofile +/cover.out diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/.golangci.yaml b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/.golangci.yaml new file mode 100644 index 000000000..828a099a4 --- /dev/null +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/.golangci.yaml @@ -0,0 +1,19 @@ +--- +linters: + disable-all: true + enable: + - errcheck + - gofmt + - goimports + - govet + - staticcheck + - unparam + - unused + +issues: + exclude: + - SA1006 # printf-style function with dynamic format string and no further arguments should use print-style function instead (staticcheck) + exclude-rules: + - linters: + - staticcheck + text: 'SA1019: (x509.EncryptPEMBlock|strings.Title)' diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/CHANGELOG.md b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/CHANGELOG.md similarity index 93% rename from legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/CHANGELOG.md rename to legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/CHANGELOG.md index 8f579884c..bae5109cf 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/CHANGELOG.md +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/CHANGELOG.md @@ -1,8 +1,56 @@ -## v1.13.0 (2024-07-08) +## v2.1.0 (2024-07-24) + +* [GH-3078](https://github.com/gophercloud/gophercloud/pull/3078) [networking]: add BGP VPNs support +* [GH-3086](https://github.com/gophercloud/gophercloud/pull/3086) build(deps): bump golang.org/x/crypto from 0.24.0 to 0.25.0 +* [GH-3090](https://github.com/gophercloud/gophercloud/pull/3090) Adding support for field dns_publish_fixed_ip in a subnet +* [GH-3092](https://github.com/gophercloud/gophercloud/pull/3092) [neutron]: introduce Stateful argument for the security groups +* [GH-3094](https://github.com/gophercloud/gophercloud/pull/3094) [neutron]: introduce Description argument for the portforwarding +* [GH-3106](https://github.com/gophercloud/gophercloud/pull/3106) clouds: Parse trust_id from clouds.yaml +* [GH-3131](https://github.com/gophercloud/gophercloud/pull/3131) Align ServiceFail provisioning state value with Ironic +* [GH-3136](https://github.com/gophercloud/gophercloud/pull/3136) Added node.Retired + +## v2.0.0 (2024-05-27) + +MAIN BREAKING CHANGES: + +* **Gophercloud now requires Go v1.22.** +* [GH-2821](https://github.com/gophercloud/gophercloud/pull/2821) Gophercloud now escapes container and object names in all `objects` and `containers` functions. If you were previously escaping names (with, for example: `url.PathEscape` or `url.QueryEscape`), then you should REMOVE that and pass the intended names to Gophercloud directly. +* [GH-2821](https://github.com/gophercloud/gophercloud/pull/2821) The `containers.ListOpts#Full` and `objects.ListOpts#Full` properties are REMOVED from the Gophercloud API. The reason for that is: plaintext listing is unfixably wrong and won't handle special characters reliably (i.e. `\n`). +* [GH-2821](https://github.com/gophercloud/gophercloud/pull/2821) Empty container names, container names containing a slash (`/`), and empty object names are now rejected in Gophercloud before any call to Swift. +* [GH-2821](https://github.com/gophercloud/gophercloud/pull/2821) In `objectstorage`: `containers.ErrInvalidContainerName` is now `v1.ErrInvalidContainerName`. +* [GH-2821](https://github.com/gophercloud/gophercloud/pull/2821) New name validation errors in `objectstorage`: + * `v1.ErrEmptyContainerName` + * `v1.ErrEmptyObjectName` +* [GH-2821](https://github.com/gophercloud/gophercloud/pull/2821) In `objects.Copy`: the `destination` field (e.g. `objects.CopyOpts#Destination`) must be in the form `/container/object`: the function will reject a destination path if it doesn't start with a slash (`/`). +* [GH-2560](https://github.com/gophercloud/gophercloud/pull/2560) loadbalancer: Use CreateMemberOpts instead of BatchUpdateMemberOpts in PoolCreateOpts +* [GH-2886](https://github.com/gophercloud/gophercloud/pull/2886) ports: Fix value_specs implementation +* [GH-2665](https://github.com/gophercloud/gophercloud/pull/2665) Cinder: Remove multiatttach request parameter +* [GH-2936](https://github.com/gophercloud/gophercloud/pull/2936) Make Gophercloud context-aware: all function signatures triggering an HTTP call now accept a context.Context for tracing and cancellation +* [GH-2970](https://github.com/gophercloud/gophercloud/pull/2970) Remove context from the Provider client +* [GH-2904](https://github.com/gophercloud/gophercloud/pull/2904) Remove error code types -* [GH-3044](https://github.com/gophercloud/gophercloud/pull/3044) [v1] Add ci jobs for openstack caracal -* [GH-3073](https://github.com/gophercloud/gophercloud/pull/3073) [v1] Adding missing QoS field for router -* [GH-3080](https://github.com/gophercloud/gophercloud/pull/3080) [networking]: add BGP VPNs support (backport to 1.x) +New features and improvements: + +* [GH-2486](https://github.com/gophercloud/gophercloud/pull/2486) Fix BareMetalV1 version +* [GH-2492](https://github.com/gophercloud/gophercloud/pull/2492) Add tags for loadbalancer l7policy and l7rule +* [GH-2560](https://github.com/gophercloud/gophercloud/pull/2560) loadbalancer: Use CreateMemberOpts instead of BatchUpdateMemberOpts in PoolCreateOpts +* [GH-2561](https://github.com/gophercloud/gophercloud/pull/2561) compute: add ext_specs to flavor +* [GH-2613](https://github.com/gophercloud/gophercloud/pull/2613) Migrate baremetal inventory to a common location +* [GH-2724](https://github.com/gophercloud/gophercloud/pull/2724) baremetal: introduce Node Inventory API +* [GH-2725](https://github.com/gophercloud/gophercloud/pull/2725) baremetal: finish moving common inventory bits +* [GH-2736](https://github.com/gophercloud/gophercloud/pull/2736) Composable templates +* [GH-2781](https://github.com/gophercloud/gophercloud/pull/2781) baremetal: support ironic native PluginData +* [GH-2791](https://github.com/gophercloud/gophercloud/pull/2791) Add microversion utilities +* [GH-2806](https://github.com/gophercloud/gophercloud/pull/2806) Fix list ports with multiple fixedip parameters +* [GH-2809](https://github.com/gophercloud/gophercloud/pull/2809) Remove code for CDN (poppy) +* [GH-2812](https://github.com/gophercloud/gophercloud/pull/2812) Revert "Fix baremetal jobs on Ubuntu 20.04" +* [GH-2821](https://github.com/gophercloud/gophercloud/pull/2821) objects: Escape names in Gophercloud +* [GH-2828](https://github.com/gophercloud/gophercloud/pull/2828) Octavia: Add tags to resources missing them +* [GH-2834](https://github.com/gophercloud/gophercloud/pull/2834) baremetal: implemented ParsedLLDP in the standard PluginData +* [GH-2866](https://github.com/gophercloud/gophercloud/pull/2866) loadbalancer additional_vips by snigle +* [GH-2881](https://github.com/gophercloud/gophercloud/pull/2881) Adding missing QoS field for router +* [GH-2883](https://github.com/gophercloud/gophercloud/pull/2883) Context-aware methods to ProviderClient and ServiceClient +* [GH-2892](https://github.com/gophercloud/gophercloud/pull/2892) Authenticate with a clouds.yaml ## v1.12.0 (2024-05-27) diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/LICENSE b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/LICENSE similarity index 100% rename from legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/LICENSE rename to legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/LICENSE diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/Makefile b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/Makefile new file mode 100644 index 000000000..128beec00 --- /dev/null +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/Makefile @@ -0,0 +1,109 @@ +undefine GOFLAGS + +GOLANGCI_LINT_VERSION?=v1.57.1 + +ifeq ($(shell command -v podman 2> /dev/null),) + RUNNER=docker +else + RUNNER=podman +endif + +# if the golangci-lint steps fails with the following error message: +# +# directory prefix . does not contain main module or its selected dependencies +# +# you probably have to fix the SELinux security context for root directory plus your cache +# +# chcon -Rt svirt_sandbox_file_t . +# chcon -Rt svirt_sandbox_file_t ~/.cache/golangci-lint +lint: + $(RUNNER) run -t --rm \ + -v $(shell pwd):/app \ + -v ~/.cache/golangci-lint/$(GOLANGCI_LINT_VERSION):/root/.cache \ + -w /app \ + -e GOFLAGS="-tags=acceptance" \ + golangci/golangci-lint:$(GOLANGCI_LINT_VERSION) golangci-lint run +.PHONY: lint + +unit: + go test ./... +.PHONY: unit + +coverage: + go test -covermode count -coverprofile cover.out -coverpkg=./... ./... +.PHONY: coverage + +acceptance: acceptance-baremetal acceptance-blockstorage acceptance-compute acceptance-container acceptance-containerinfra acceptance-db acceptance-dns acceptance-identity acceptance-imageservice acceptance-keymanager acceptance-loadbalancer acceptance-messaging acceptance-networking acceptance-objectstorage acceptance-orchestration acceptance-placement acceptance-sharedfilesystems acceptance-workflow +.PHONY: acceptance + +acceptance-baremetal: + go test -tags "fixtures acceptance" ./internal/acceptance/openstack/baremetal/... +.PHONY: acceptance-baremetal + +acceptance-blockstorage: + go test -tags "fixtures acceptance" ./internal/acceptance/openstack/blockstorage/... +.PHONY: acceptance-blockstorage + +acceptance-compute: + go test -tags "fixtures acceptance" ./internal/acceptance/openstack/compute/... +.PHONY: acceptance-compute + +acceptance-container: + go test -tags "fixtures acceptance" ./internal/acceptance/openstack/container/... +.PHONY: acceptance-container + +acceptance-containerinfra: + go test -tags "fixtures acceptance" ./internal/acceptance/openstack/containerinfra/... +.PHONY: acceptance-containerinfra + +acceptance-db: + go test -tags "fixtures acceptance" ./internal/acceptance/openstack/db/... +.PHONY: acceptance-db + +acceptance-dns: + go test -tags "fixtures acceptance" ./internal/acceptance/openstack/dns/... +.PHONY: acceptance-dns + +acceptance-identity: + go test -tags "fixtures acceptance" ./internal/acceptance/openstack/identity/... +.PHONY: acceptance-identity + +acceptance-image: + go test -tags "fixtures acceptance" ./internal/acceptance/openstack/imageservice/... +.PHONY: acceptance-image + +acceptance-keymanager: + go test -tags "fixtures acceptance" ./internal/acceptance/openstack/keymanager/... +.PHONY: acceptance-keymanager + +acceptance-loadbalancer: + go test -tags "fixtures acceptance" ./internal/acceptance/openstack/loadbalancer/... +.PHONY: acceptance-loadbalancer + +acceptance-messaging: + go test -tags "fixtures acceptance" ./internal/acceptance/openstack/messaging/... +.PHONY: acceptance-messaging + +acceptance-networking: + go test -tags "fixtures acceptance" ./internal/acceptance/openstack/networking/... +.PHONY: acceptance-networking + +acceptance-objectstorage: + go test -tags "fixtures acceptance" ./internal/acceptance/openstack/objectstorage/... +.PHONY: acceptance-objectstorage + +acceptance-orchestration: + go test -tags "fixtures acceptance" ./internal/acceptance/openstack/orchestration/... +.PHONY: acceptance-orchestration + +acceptance-placement: + go test -tags "fixtures acceptance" ./internal/acceptance/openstack/placement/... +.PHONY: acceptance-placement + +acceptance-sharedfilesystems: + go test -tags "fixtures acceptance" ./internal/acceptance/openstack/sharedfilesystems/... +.PHONY: acceptance-sharefilesystems + +acceptance-workflow: + go test -tags "fixtures acceptance" ./internal/acceptance/openstack/workflow/... +.PHONY: acceptance-workflow diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/README.md b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/README.md new file mode 100644 index 000000000..e9ba39bb7 --- /dev/null +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/README.md @@ -0,0 +1,254 @@ +# Gophercloud: an OpenStack SDK for Go +[![Coverage Status](https://coveralls.io/repos/github/gophercloud/gophercloud/badge.svg?branch=master)](https://coveralls.io/github/gophercloud/gophercloud?branch=master) + +[Reference documentation](http://godoc.org/github.com/gophercloud/gophercloud/v2) + +Gophercloud is a Go SDK for OpenStack. + +Join us on kubernetes slack, on [#gophercloud](https://kubernetes.slack.com/archives/C05G4NJ6P6X). Visit [slack.k8s.io](https://slack.k8s.io) for an invitation. + +> **Note** +> This branch contains the current stable branch of Gophercloud: `v2`. +> The legacy stable version can be found in the `v1` branch. + +## How to install + +Reference a Gophercloud package in your code: + +```go +import "github.com/gophercloud/gophercloud/v2" +``` + +Then update your `go.mod`: + +```shell +go mod tidy +``` + +## Getting started + +### Credentials + +Because you'll be hitting an API, you will need to retrieve your OpenStack +credentials and either store them in a `clouds.yaml` file, as environment +variables, or in your local Go files. The first method is recommended because +it decouples credential information from source code, allowing you to push the +latter to your version control system without any security risk. + +You will need to retrieve the following: + +* A valid Keystone identity URL +* Credentials. These can be a username/password combo, a set of Application + Credentials, a pre-generated token, or any other supported authentication + mechanism. + +For users who have the OpenStack dashboard installed, there's a shortcut. If +you visit the `project/api_access` path in Horizon and click on the +"Download OpenStack RC File" button at the top right hand corner, you can +download either a `clouds.yaml` file or an `openrc` bash file that exports all +of your access details to environment variables. To use the `clouds.yaml` file, +place it at `~/.config/openstack/clouds.yaml`. To use the `openrc` file, run +`source openrc` and you will be prompted for your password. + +### Gophercloud authentication + +Gophercloud authentication is organized into two layered abstractions: +* `ProviderClient` holds the authentication token and can be used to build a + `ServiceClient`. +* `ServiceClient` specializes against one specific OpenStack module and can + directly be used to make API calls. + +A provider client is a top-level client that all of your OpenStack service +clients derive from. The provider contains all of the authentication details +that allow your Go code to access the API - such as the base URL and token ID. + +One single Provider client can be used to build as many Service clients as needed. + +**With `clouds.yaml`** + +```go +package main + +import ( + "context" + + "github.com/gophercloud/gophercloud/v2/openstack" + "github.com/gophercloud/gophercloud/v2/openstack/config" + "github.com/gophercloud/gophercloud/v2/openstack/config/clouds" +) + +func main() { + ctx := context.Background() + + // Fetch coordinates from a `cloud.yaml` in the current directory, or + // in the well-known config directories (different for each operating + // system). + authOptions, endpointOptions, tlsConfig, err := clouds.Parse() + if err != nil { + panic(err) + } + + // Call Keystone to get an authentication token, and use it to + // construct a ProviderClient. All functions hitting the OpenStack API + // accept a `context.Context` to enable tracing and cancellation. + providerClient, err := config.NewProviderClient(ctx, authOptions, config.WithTLSConfig(tlsConfig)) + if err != nil { + panic(err) + } + + // Use the ProviderClient and the endpoint options fetched from + // `clouds.yaml` to build a service client: a compute client in this + // case. Note that the contructor does not accept a `context.Context`: + // no further call to the OpenStack API is needed at this stage. + computeClient, err := openstack.NewComputeV2(providerClient, endpointOptions) + if err != nil { + panic(err) + } + + // use the computeClient +} +``` + +**With environment variables (`openrc`)** + +Gophercloud can parse the environment variables set by running `source openrc`: + +```go +package main + +import ( + "context" + "os" + + "github.com/gophercloud/gophercloud/v2" + "github.com/gophercloud/gophercloud/v2/openstack" +) + +func main() { + ctx := context.Background() + + opts, err := openstack.AuthOptionsFromEnv() + if err != nil { + panic(err) + } + + providerClient, err := openstack.AuthenticatedClient(ctx, opts) + if err != nil { + panic(err) + } + + computeClient, err := openstack.NewComputeV2(providerClient, gophercloud.EndpointOpts{ + Region: os.Getenv("OS_REGION_NAME"), + }) + if err != nil { + panic(err) + } + + // use the computeClient +} +``` + +**Manually** + +You can also generate a "Provider" by passing in your credentials +explicitly: + +```go +package main + +import ( + "context" + + "github.com/gophercloud/gophercloud/v2" + "github.com/gophercloud/gophercloud/v2/openstack" +) + +func main() { + ctx := context.Background() + + providerClient, err := openstack.AuthenticatedClient(ctx, gophercloud.AuthOptions{ + IdentityEndpoint: "https://openstack.example.com:5000/v2.0", + Username: "username", + Password: "password", + }) + if err != nil { + panic(err) + } + + computeClient, err := openstack.NewComputeV2(providerClient, gophercloud.EndpointOpts{ + Region: "RegionName", + }) + if err != nil { + panic(err) + } + + // use the computeClient +} +``` + +### Provision a server + +We can use the Compute service client generated above for any Compute API +operation we want. In our case, we want to provision a new server. To do this, +we invoke the `Create` method and pass in the flavor ID (hardware +specification) and image ID (operating system) we're interested in: + +```go +import "github.com/gophercloud/gophercloud/v2/openstack/compute/v2/servers" + +func main() { + // [...] + + server, err := servers.Create(context.TODO(), computeClient, servers.CreateOpts{ + Name: "My new server!", + FlavorRef: "flavor_id", + ImageRef: "image_id", + }).Extract() + + // [...] +``` + +The above code sample creates a new server with the parameters, and returns a +[`servers.Server`](https://pkg.go.dev/github.com/gophercloud/gophercloud/v2/openstack/compute/v2/servers#Server). + +## Supported Services + +| **Service** | **Name** | **Module** | **1.x** | **2.x** | +|:------------------------:|------------------|:----------------------------------:|:-------:|:-------:| +| Baremetal | Ironic | `openstack/baremetal` | ✔ | ✔ | +| Baremetal Introspection | Ironic Inspector | `openstack/baremetalintrospection` | ✔ | ✔ | +| Block Storage | Cinder | `openstack/blockstorage` | ✔ | ✔ | +| Clustering | Senlin | `openstack/clustering` | ✔ | ✘ | +| Compute | Nova | `openstack/compute` | ✔ | ✔ | +| Container | Zun | `openstack/container` | ✔ | ✔ | +| Container Infrastructure | Magnum | `openstack/containerinfra` | ✔ | ✔ | +| Database | Trove | `openstack/db` | ✔ | ✔ | +| DNS | Designate | `openstack/dns` | ✔ | ✔ | +| Identity | Keystone | `openstack/identity` | ✔ | ✔ | +| Image | Glance | `openstack/image` | ✔ | ✔ | +| Key Management | Barbican | `openstack/keymanager` | ✔ | ✔ | +| Load Balancing | Octavia | `openstack/loadbalancer` | ✔ | ✔ | +| Messaging | Zaqar | `openstack/messaging` | ✔ | ✔ | +| Networking | Neutron | `openstack/networking` | ✔ | ✔ | +| Object Storage | Swift | `openstack/objectstorage` | ✔ | ✔ | + +## Advanced Usage + +Have a look at the [FAQ](./docs/FAQ.md) for some tips on customizing the way Gophercloud works. + +## Backwards-Compatibility Guarantees + +Gophercloud versioning follows [semver](https://semver.org/spec/v2.0.0.html). + +Before `v1.0.0`, there were no guarantees. Starting with v1, there will be no breaking changes within a major release. + +See the [Release instructions](./RELEASE.md). + +## Contributing + +See the [contributing guide](./.github/CONTRIBUTING.md). + +## Help and feedback + +If you're struggling with something or have spotted a potential bug, feel free +to submit an issue to our [bug tracker](https://github.com/gophercloud/gophercloud/issues). diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/RELEASE.md b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/RELEASE.md similarity index 100% rename from legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/RELEASE.md rename to legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/RELEASE.md diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/auth_options.go b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/auth_options.go similarity index 90% rename from legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/auth_options.go rename to legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/auth_options.go index 335ce8795..616919d00 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/auth_options.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/auth_options.go @@ -19,13 +19,13 @@ An example of manually providing authentication information: TenantID: "{tenant_id}", } - provider, err := openstack.AuthenticatedClient(opts) + provider, err := openstack.AuthenticatedClient(context.TODO(), opts) An example of using AuthOptionsFromEnv(), where the environment variables can be read from a file, such as a standard openrc file: opts, err := openstack.AuthOptionsFromEnv() - provider, err := openstack.AuthenticatedClient(opts) + provider, err := openstack.AuthenticatedClient(context.TODO(), opts) */ type AuthOptions struct { // IdentityEndpoint specifies the HTTP endpoint that is required to work with @@ -102,17 +102,18 @@ type AuthScope struct { DomainID string DomainName string System bool + TrustID string } // ToTokenV2CreateMap allows AuthOptions to satisfy the AuthOptionsBuilder // interface in the v2 tokens package -func (opts AuthOptions) ToTokenV2CreateMap() (map[string]interface{}, error) { +func (opts AuthOptions) ToTokenV2CreateMap() (map[string]any, error) { // Populate the request map. - authMap := make(map[string]interface{}) + authMap := make(map[string]any) if opts.Username != "" { if opts.Password != "" { - authMap["passwordCredentials"] = map[string]interface{}{ + authMap["passwordCredentials"] = map[string]any{ "username": opts.Username, "password": opts.Password, } @@ -120,7 +121,7 @@ func (opts AuthOptions) ToTokenV2CreateMap() (map[string]interface{}, error) { return nil, ErrMissingInput{Argument: "Password"} } } else if opts.TokenID != "" { - authMap["token"] = map[string]interface{}{ + authMap["token"] = map[string]any{ "id": opts.TokenID, } } else { @@ -134,23 +135,17 @@ func (opts AuthOptions) ToTokenV2CreateMap() (map[string]interface{}, error) { authMap["tenantName"] = opts.TenantName } - return map[string]interface{}{"auth": authMap}, nil + return map[string]any{"auth": authMap}, nil } // ToTokenV3CreateMap allows AuthOptions to satisfy the AuthOptionsBuilder // interface in the v3 tokens package -func (opts *AuthOptions) ToTokenV3CreateMap(scope map[string]interface{}) (map[string]interface{}, error) { +func (opts *AuthOptions) ToTokenV3CreateMap(scope map[string]any) (map[string]any, error) { type domainReq struct { ID *string `json:"id,omitempty"` Name *string `json:"name,omitempty"` } - type projectReq struct { - Domain *domainReq `json:"domain,omitempty"` - Name *string `json:"name,omitempty"` - ID *string `json:"id,omitempty"` - } - type userReq struct { ID *string `json:"id,omitempty"` Name *string `json:"name,omitempty"` @@ -397,7 +392,7 @@ func (opts *AuthOptions) ToTokenV3CreateMap(scope map[string]interface{}) (map[s } if len(scope) != 0 { - b["auth"].(map[string]interface{})["scope"] = scope + b["auth"].(map[string]any)["scope"] = scope } return b, nil @@ -405,7 +400,7 @@ func (opts *AuthOptions) ToTokenV3CreateMap(scope map[string]interface{}) (map[s // ToTokenV3ScopeMap builds a scope from AuthOptions and satisfies interface in // the v3 tokens package. -func (opts *AuthOptions) ToTokenV3ScopeMap() (map[string]interface{}, error) { +func (opts *AuthOptions) ToTokenV3ScopeMap() (map[string]any, error) { // For backwards compatibility. // If AuthOptions.Scope was not set, try to determine it. // This works well for common scenarios. @@ -423,13 +418,21 @@ func (opts *AuthOptions) ToTokenV3ScopeMap() (map[string]interface{}, error) { } if opts.Scope.System { - return map[string]interface{}{ - "system": map[string]interface{}{ + return map[string]any{ + "system": map[string]any{ "all": true, }, }, nil } + if opts.Scope.TrustID != "" { + return map[string]any{ + "OS-TRUST:trust": map[string]string{ + "id": opts.Scope.TrustID, + }, + }, nil + } + if opts.Scope.ProjectName != "" { // ProjectName provided: either DomainID or DomainName must also be supplied. // ProjectID may not be supplied. @@ -442,20 +445,20 @@ func (opts *AuthOptions) ToTokenV3ScopeMap() (map[string]interface{}, error) { if opts.Scope.DomainID != "" { // ProjectName + DomainID - return map[string]interface{}{ - "project": map[string]interface{}{ + return map[string]any{ + "project": map[string]any{ "name": &opts.Scope.ProjectName, - "domain": map[string]interface{}{"id": &opts.Scope.DomainID}, + "domain": map[string]any{"id": &opts.Scope.DomainID}, }, }, nil } if opts.Scope.DomainName != "" { // ProjectName + DomainName - return map[string]interface{}{ - "project": map[string]interface{}{ + return map[string]any{ + "project": map[string]any{ "name": &opts.Scope.ProjectName, - "domain": map[string]interface{}{"name": &opts.Scope.DomainName}, + "domain": map[string]any{"name": &opts.Scope.DomainName}, }, }, nil } @@ -469,8 +472,8 @@ func (opts *AuthOptions) ToTokenV3ScopeMap() (map[string]interface{}, error) { } // ProjectID - return map[string]interface{}{ - "project": map[string]interface{}{ + return map[string]any{ + "project": map[string]any{ "id": &opts.Scope.ProjectID, }, }, nil @@ -481,15 +484,15 @@ func (opts *AuthOptions) ToTokenV3ScopeMap() (map[string]interface{}, error) { } // DomainID - return map[string]interface{}{ - "domain": map[string]interface{}{ + return map[string]any{ + "domain": map[string]any{ "id": &opts.Scope.DomainID, }, }, nil } else if opts.Scope.DomainName != "" { // DomainName - return map[string]interface{}{ - "domain": map[string]interface{}{ + return map[string]any{ + "domain": map[string]any{ "name": &opts.Scope.DomainName, }, }, nil @@ -509,6 +512,6 @@ func (opts AuthOptions) CanReauth() bool { // ToTokenV3HeadersMap allows AuthOptions to satisfy the AuthOptionsBuilder // interface in the v3 tokens package. -func (opts *AuthOptions) ToTokenV3HeadersMap(map[string]interface{}) (map[string]string, error) { +func (opts *AuthOptions) ToTokenV3HeadersMap(map[string]any) (map[string]string, error) { return nil, nil } diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/auth_result.go b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/auth_result.go similarity index 87% rename from legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/auth_result.go rename to legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/auth_result.go index 2e4699b97..9a49cce8e 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/auth_result.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/auth_result.go @@ -12,9 +12,9 @@ The following types satisfy this interface: Usage example: import ( - "github.com/gophercloud/gophercloud" - tokens2 "github.com/gophercloud/gophercloud/openstack/identity/v2/tokens" - tokens3 "github.com/gophercloud/gophercloud/openstack/identity/v3/tokens" + "github.com/gophercloud/gophercloud/v2" + tokens2 "github.com/gophercloud/gophercloud/v2/openstack/identity/v2/tokens" + tokens3 "github.com/gophercloud/gophercloud/v2/openstack/identity/v3/tokens" ) func GetAuthenticatedUserID(providerClient *gophercloud.ProviderClient) (string, error) { diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/doc.go b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/doc.go similarity index 89% rename from legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/doc.go rename to legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/doc.go index 19b64d650..a755ecb18 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/doc.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/doc.go @@ -29,7 +29,7 @@ specified like so: TenantID: "{tenant_id}", } - provider, err := openstack.AuthenticatedClient(opts) + provider, err := openstack.AuthenticatedClient(context.TODO(), opts) You can authenticate with a token by doing: @@ -39,7 +39,7 @@ You can authenticate with a token by doing: TenantID: "{tenant_id}", } - provider, err := openstack.AuthenticatedClient(opts) + provider, err := openstack.AuthenticatedClient(context.TODO(), opts) You may also use the openstack.AuthOptionsFromEnv() helper function. This function reads in standard environment variables frequently found in an @@ -47,7 +47,7 @@ OpenStack `openrc` file. Again note that Gophercloud currently uses "tenant" instead of "project". opts, err := openstack.AuthOptionsFromEnv() - provider, err := openstack.AuthenticatedClient(opts) + provider, err := openstack.AuthenticatedClient(context.TODO(), opts) # Service Clients @@ -65,7 +65,7 @@ pass in the parent provider, like so: Resource structs are the domain models that services make use of in order to work with and represent the state of API resources: - server, err := servers.Get(client, "{serverId}").Extract() + server, err := servers.Get(context.TODO(), client, "{serverId}").Extract() Intermediate Result structs are returned for API operations, which allow generic access to the HTTP headers, response body, and any errors associated @@ -73,7 +73,7 @@ with the network transaction. To turn a result into a usable resource struct, you must call the Extract method which is chained to the response, or an Extract function from an applicable extension: - result := servers.Get(client, "{serverId}") + result := servers.Get(context.TODO(), client, "{serverId}") // Attempt to extract the disk configuration from the OS-DCF disk config // extension: @@ -85,7 +85,7 @@ Pager to handle each successive Page in a closure, then use the appropriate extraction method from that request's package to interpret that Page as a slice of results: - err := servers.List(client, nil).EachPage(func (page pagination.Page) (bool, error) { + err := servers.List(client, nil).EachPage(context.TODO(), func (_ context.Context, page pagination.Page) (bool, error) { s, err := servers.ExtractServers(page) if err != nil { return false, err @@ -100,7 +100,7 @@ of results: If you want to obtain the entire collection of pages without doing any intermediary processing on each page, you can use the AllPages method: - allPages, err := servers.List(client, nil).AllPages() + allPages, err := servers.List(client, nil).AllPages(context.TODO()) allServers, err := servers.ExtractServers(allPages) This top-level package contains utility functions and data types that are used diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/endpoint_search.go b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/endpoint_search.go similarity index 100% rename from legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/endpoint_search.go rename to legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/endpoint_search.go diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/errors.go b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/errors.go similarity index 61% rename from legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/errors.go rename to legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/errors.go index 8ab592ca4..2698c2039 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/errors.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/errors.go @@ -1,6 +1,8 @@ package gophercloud import ( + "bytes" + "errors" "fmt" "net/http" "strings" @@ -39,7 +41,7 @@ func (e ErrMissingInput) Error() string { // ErrInvalidInput is an error type used for most non-HTTP Gophercloud errors. type ErrInvalidInput struct { ErrMissingInput - Value interface{} + Value any } func (e ErrInvalidInput) Error() string { @@ -88,8 +90,8 @@ type ErrUnexpectedResponseCode struct { func (e ErrUnexpectedResponseCode) Error() string { e.DefaultErrString = fmt.Sprintf( - "Expected HTTP response code %v when accessing [%s %s], but got %d instead\n%s", - e.Expected, e.Method, e.URL, e.Actual, e.Body, + "Expected HTTP response code %v when accessing [%s %s], but got %d instead: %s", + e.Expected, e.Method, e.URL, e.Actual, bytes.TrimSpace(e.Body), ) return e.choseErrString() } @@ -99,244 +101,22 @@ func (e ErrUnexpectedResponseCode) GetStatusCode() int { return e.Actual } -// StatusCodeError is a convenience interface to easily allow access to the -// status code field of the various ErrDefault* types. +// ResponseCodeIs returns true if this error is or contains an ErrUnexpectedResponseCode reporting +// that the request failed with the given response code. For example, this checks if a request +// failed because of a 404 error: // -// By using this interface, you only have to make a single type cast of -// the returned error to err.(StatusCodeError) and then call GetStatusCode() -// instead of having a large switch statement checking for each of the -// ErrDefault* types. -type StatusCodeError interface { - Error() string - GetStatusCode() int -} - -// ErrDefault400 is the default error type returned on a 400 HTTP response code. -type ErrDefault400 struct { - ErrUnexpectedResponseCode -} - -func (e ErrDefault400) Unwrap() error { - return e.ErrUnexpectedResponseCode -} - -// ErrDefault401 is the default error type returned on a 401 HTTP response code. -type ErrDefault401 struct { - ErrUnexpectedResponseCode -} - -func (e ErrDefault401) Unwrap() error { - return e.ErrUnexpectedResponseCode -} - -// ErrDefault403 is the default error type returned on a 403 HTTP response code. -type ErrDefault403 struct { - ErrUnexpectedResponseCode -} - -func (e ErrDefault403) Unwrap() error { - return e.ErrUnexpectedResponseCode -} - -// ErrDefault404 is the default error type returned on a 404 HTTP response code. -type ErrDefault404 struct { - ErrUnexpectedResponseCode -} - -func (e ErrDefault404) Unwrap() error { - return e.ErrUnexpectedResponseCode -} - -// ErrDefault405 is the default error type returned on a 405 HTTP response code. -type ErrDefault405 struct { - ErrUnexpectedResponseCode -} - -func (e ErrDefault405) Unwrap() error { - return e.ErrUnexpectedResponseCode -} - -// ErrDefault408 is the default error type returned on a 408 HTTP response code. -type ErrDefault408 struct { - ErrUnexpectedResponseCode -} - -func (e ErrDefault408) Unwrap() error { - return e.ErrUnexpectedResponseCode -} - -// ErrDefault409 is the default error type returned on a 409 HTTP response code. -type ErrDefault409 struct { - ErrUnexpectedResponseCode -} - -func (e ErrDefault409) Unwrap() error { - return e.ErrUnexpectedResponseCode -} - -// ErrDefault429 is the default error type returned on a 429 HTTP response code. -type ErrDefault429 struct { - ErrUnexpectedResponseCode -} - -func (e ErrDefault429) Unwrap() error { - return e.ErrUnexpectedResponseCode -} - -// ErrDefault500 is the default error type returned on a 500 HTTP response code. -type ErrDefault500 struct { - ErrUnexpectedResponseCode -} - -func (e ErrDefault500) Unwrap() error { - return e.ErrUnexpectedResponseCode -} - -// ErrDefault502 is the default error type returned on a 502 HTTP response code. -type ErrDefault502 struct { - ErrUnexpectedResponseCode -} - -func (e ErrDefault502) Unwrap() error { - return e.ErrUnexpectedResponseCode -} - -// ErrDefault503 is the default error type returned on a 503 HTTP response code. -type ErrDefault503 struct { - ErrUnexpectedResponseCode -} - -func (e ErrDefault503) Unwrap() error { - return e.ErrUnexpectedResponseCode -} - -// ErrDefault504 is the default error type returned on a 504 HTTP response code. -type ErrDefault504 struct { - ErrUnexpectedResponseCode -} - -func (e ErrDefault504) Unwrap() error { - return e.ErrUnexpectedResponseCode -} - -func (e ErrDefault400) Error() string { - e.DefaultErrString = fmt.Sprintf( - "Bad request with: [%s %s], error message: %s", - e.Method, e.URL, e.Body, - ) - return e.choseErrString() -} -func (e ErrDefault401) Error() string { - return "Authentication failed" -} -func (e ErrDefault403) Error() string { - e.DefaultErrString = fmt.Sprintf( - "Request forbidden: [%s %s], error message: %s", - e.Method, e.URL, e.Body, - ) - return e.choseErrString() -} -func (e ErrDefault404) Error() string { - e.DefaultErrString = fmt.Sprintf( - "Resource not found: [%s %s], error message: %s", - e.Method, e.URL, e.Body, - ) - return e.choseErrString() -} -func (e ErrDefault405) Error() string { - return "Method not allowed" -} -func (e ErrDefault408) Error() string { - return "The server timed out waiting for the request" -} -func (e ErrDefault429) Error() string { - return "Too many requests have been sent in a given amount of time. Pause" + - " requests, wait up to one minute, and try again." -} -func (e ErrDefault500) Error() string { - return "Internal Server Error" -} -func (e ErrDefault502) Error() string { - return "Bad Gateway" -} -func (e ErrDefault503) Error() string { - return "The service is currently unable to handle the request due to a temporary" + - " overloading or maintenance. This is a temporary condition. Try again later." -} -func (e ErrDefault504) Error() string { - return "Gateway Timeout" -} - -// Err400er is the interface resource error types implement to override the error message -// from a 400 error. -type Err400er interface { - Error400(ErrUnexpectedResponseCode) error -} - -// Err401er is the interface resource error types implement to override the error message -// from a 401 error. -type Err401er interface { - Error401(ErrUnexpectedResponseCode) error -} - -// Err403er is the interface resource error types implement to override the error message -// from a 403 error. -type Err403er interface { - Error403(ErrUnexpectedResponseCode) error -} - -// Err404er is the interface resource error types implement to override the error message -// from a 404 error. -type Err404er interface { - Error404(ErrUnexpectedResponseCode) error -} - -// Err405er is the interface resource error types implement to override the error message -// from a 405 error. -type Err405er interface { - Error405(ErrUnexpectedResponseCode) error -} - -// Err408er is the interface resource error types implement to override the error message -// from a 408 error. -type Err408er interface { - Error408(ErrUnexpectedResponseCode) error -} - -// Err409er is the interface resource error types implement to override the error message -// from a 409 error. -type Err409er interface { - Error409(ErrUnexpectedResponseCode) error -} - -// Err429er is the interface resource error types implement to override the error message -// from a 429 error. -type Err429er interface { - Error429(ErrUnexpectedResponseCode) error -} - -// Err500er is the interface resource error types implement to override the error message -// from a 500 error. -type Err500er interface { - Error500(ErrUnexpectedResponseCode) error -} - -// Err502er is the interface resource error types implement to override the error message -// from a 502 error. -type Err502er interface { - Error502(ErrUnexpectedResponseCode) error -} - -// Err503er is the interface resource error types implement to override the error message -// from a 503 error. -type Err503er interface { - Error503(ErrUnexpectedResponseCode) error -} - -// Err504er is the interface resource error types implement to override the error message -// from a 504 error. -type Err504er interface { - Error504(ErrUnexpectedResponseCode) error +// allServers, err := servers.List(client, servers.ListOpts{}) +// if gophercloud.ResponseCodeIs(err, http.StatusNotFound) { +// handleNotFound() +// } +// +// It is safe to pass a nil error, in which case this function always returns false. +func ResponseCodeIs(err error, status int) bool { + var codeError ErrUnexpectedResponseCode + if errors.As(err, &codeError) { + return codeError.Actual == status + } + return false } // ErrTimeOut is the error type returned when an operations times out. diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/auth_env.go b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/auth_env.go similarity index 97% rename from legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/auth_env.go rename to legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/auth_env.go index 7c6d06f0c..893787b78 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/auth_env.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/auth_env.go @@ -3,7 +3,7 @@ package openstack import ( "os" - "github.com/gophercloud/gophercloud" + "github.com/gophercloud/gophercloud/v2" ) var nilOptions = gophercloud.AuthOptions{} @@ -31,7 +31,7 @@ To use this function, first set the OS_* environment variables (for example, by sourcing an `openrc` file), then: opts, err := openstack.AuthOptionsFromEnv() - provider, err := openstack.AuthenticatedClient(opts) + provider, err := openstack.AuthenticatedClient(context.TODO(), opts) */ func AuthOptionsFromEnv() (gophercloud.AuthOptions, error) { authURL := os.Getenv("OS_AUTH_URL") diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/blockstorage/v3/availabilityzones/doc.go b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/blockstorage/v3/availabilityzones/doc.go new file mode 100644 index 000000000..eb3903ad1 --- /dev/null +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/blockstorage/v3/availabilityzones/doc.go @@ -0,0 +1,21 @@ +/* +Package availabilityzones provides the ability to get lists of +available volume availability zones. + +Example of Get Availability Zone Information + + allPages, err := availabilityzones.List(volumeClient).AllPages(context.TODO()) + if err != nil { + panic(err) + } + + availabilityZoneInfo, err := availabilityzones.ExtractAvailabilityZones(allPages) + if err != nil { + panic(err) + } + + for _, zoneInfo := range availabilityZoneInfo { + fmt.Printf("%+v\n", zoneInfo) + } +*/ +package availabilityzones diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/blockstorage/extensions/availabilityzones/requests.go b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/blockstorage/v3/availabilityzones/requests.go similarity index 77% rename from legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/blockstorage/extensions/availabilityzones/requests.go rename to legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/blockstorage/v3/availabilityzones/requests.go index df10b856e..15f9c228b 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/blockstorage/extensions/availabilityzones/requests.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/blockstorage/v3/availabilityzones/requests.go @@ -1,8 +1,8 @@ package availabilityzones import ( - "github.com/gophercloud/gophercloud" - "github.com/gophercloud/gophercloud/pagination" + "github.com/gophercloud/gophercloud/v2" + "github.com/gophercloud/gophercloud/v2/pagination" ) // List will return the existing availability zones. diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/blockstorage/extensions/availabilityzones/results.go b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/blockstorage/v3/availabilityzones/results.go similarity index 94% rename from legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/blockstorage/extensions/availabilityzones/results.go rename to legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/blockstorage/v3/availabilityzones/results.go index 0e115411c..1e80451a3 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/blockstorage/extensions/availabilityzones/results.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/blockstorage/v3/availabilityzones/results.go @@ -1,7 +1,7 @@ package availabilityzones import ( - "github.com/gophercloud/gophercloud/pagination" + "github.com/gophercloud/gophercloud/v2/pagination" ) // ZoneState represents the current state of the availability zone. diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/blockstorage/extensions/availabilityzones/urls.go b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/blockstorage/v3/availabilityzones/urls.go similarity index 72% rename from legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/blockstorage/extensions/availabilityzones/urls.go rename to legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/blockstorage/v3/availabilityzones/urls.go index fb4cdcf4e..f78b7c8f9 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/blockstorage/extensions/availabilityzones/urls.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/blockstorage/v3/availabilityzones/urls.go @@ -1,6 +1,6 @@ package availabilityzones -import "github.com/gophercloud/gophercloud" +import "github.com/gophercloud/gophercloud/v2" func listURL(c *gophercloud.ServiceClient) string { return c.ServiceURL("os-availability-zone") diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/client.go b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/client.go similarity index 73% rename from legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/client.go rename to legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/client.go index 81c907c35..43b569d3b 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/client.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/client.go @@ -1,16 +1,17 @@ package openstack import ( + "context" "fmt" "reflect" "strings" - "github.com/gophercloud/gophercloud" - tokens2 "github.com/gophercloud/gophercloud/openstack/identity/v2/tokens" - "github.com/gophercloud/gophercloud/openstack/identity/v3/extensions/ec2tokens" - "github.com/gophercloud/gophercloud/openstack/identity/v3/extensions/oauth1" - tokens3 "github.com/gophercloud/gophercloud/openstack/identity/v3/tokens" - "github.com/gophercloud/gophercloud/openstack/utils" + "github.com/gophercloud/gophercloud/v2" + tokens2 "github.com/gophercloud/gophercloud/v2/openstack/identity/v2/tokens" + "github.com/gophercloud/gophercloud/v2/openstack/identity/v3/ec2tokens" + "github.com/gophercloud/gophercloud/v2/openstack/identity/v3/oauth1" + tokens3 "github.com/gophercloud/gophercloud/v2/openstack/identity/v3/tokens" + "github.com/gophercloud/gophercloud/v2/openstack/utils" ) const ( @@ -23,20 +24,18 @@ const ( v3 = "v3" ) -/* -NewClient prepares an unauthenticated ProviderClient instance. -Most users will probably prefer using the AuthenticatedClient function -instead. - -This is useful if you wish to explicitly control the version of the identity -service that's used for authentication explicitly, for example. - -A basic example of using this would be: - - ao, err := openstack.AuthOptionsFromEnv() - provider, err := openstack.NewClient(ao.IdentityEndpoint) - client, err := openstack.NewIdentityV3(provider, gophercloud.EndpointOpts{}) -*/ +// NewClient prepares an unauthenticated ProviderClient instance. +// Most users will probably prefer using the AuthenticatedClient function +// instead. +// +// This is useful if you wish to explicitly control the version of the identity +// service that's used for authentication explicitly, for example. +// +// A basic example of using this would be: +// +// ao, err := openstack.AuthOptionsFromEnv() +// provider, err := openstack.NewClient(ao.IdentityEndpoint) +// client, err := openstack.NewIdentityV3(provider, gophercloud.EndpointOpts{}) func NewClient(endpoint string) (*gophercloud.ProviderClient, error) { base, err := utils.BaseEndpoint(endpoint) if err != nil { @@ -54,57 +53,55 @@ func NewClient(endpoint string) (*gophercloud.ProviderClient, error) { return p, nil } -/* -AuthenticatedClient logs in to an OpenStack cloud found at the identity endpoint -specified by the options, acquires a token, and returns a Provider Client -instance that's ready to operate. - -If the full path to a versioned identity endpoint was specified (example: -http://example.com:5000/v3), that path will be used as the endpoint to query. - -If a versionless endpoint was specified (example: http://example.com:5000/), -the endpoint will be queried to determine which versions of the identity service -are available, then chooses the most recent or most supported version. - -Example: - - ao, err := openstack.AuthOptionsFromEnv() - provider, err := openstack.AuthenticatedClient(ao) - client, err := openstack.NewNetworkV2(provider, gophercloud.EndpointOpts{ - Region: os.Getenv("OS_REGION_NAME"), - }) -*/ -func AuthenticatedClient(options gophercloud.AuthOptions) (*gophercloud.ProviderClient, error) { +// AuthenticatedClient logs in to an OpenStack cloud found at the identity endpoint +// specified by the options, acquires a token, and returns a Provider Client +// instance that's ready to operate. +// +// If the full path to a versioned identity endpoint was specified (example: +// http://example.com:5000/v3), that path will be used as the endpoint to query. +// +// If a versionless endpoint was specified (example: http://example.com:5000/), +// the endpoint will be queried to determine which versions of the identity service +// are available, then chooses the most recent or most supported version. +// +// Example: +// +// ao, err := openstack.AuthOptionsFromEnv() +// provider, err := openstack.AuthenticatedClient(ctx, ao) +// client, err := openstack.NewNetworkV2(provider, gophercloud.EndpointOpts{ +// Region: os.Getenv("OS_REGION_NAME"), +// }) +func AuthenticatedClient(ctx context.Context, options gophercloud.AuthOptions) (*gophercloud.ProviderClient, error) { client, err := NewClient(options.IdentityEndpoint) if err != nil { return nil, err } - err = Authenticate(client, options) + err = Authenticate(ctx, client, options) if err != nil { return nil, err } return client, nil } -// Authenticate or re-authenticate against the most recent identity service -// supported at the provided endpoint. -func Authenticate(client *gophercloud.ProviderClient, options gophercloud.AuthOptions) error { +// Authenticate authenticates or re-authenticates against the most +// recent identity service supported at the provided endpoint. +func Authenticate(ctx context.Context, client *gophercloud.ProviderClient, options gophercloud.AuthOptions) error { versions := []*utils.Version{ {ID: v2, Priority: 20, Suffix: "/v2.0/"}, {ID: v3, Priority: 30, Suffix: "/v3/"}, } - chosen, endpoint, err := utils.ChooseVersion(client, versions) + chosen, endpoint, err := utils.ChooseVersion(ctx, client, versions) if err != nil { return err } switch chosen.ID { case v2: - return v2auth(client, endpoint, options, gophercloud.EndpointOpts{}) + return v2auth(ctx, client, endpoint, &options, gophercloud.EndpointOpts{}) case v3: - return v3auth(client, endpoint, &options, gophercloud.EndpointOpts{}) + return v3auth(ctx, client, endpoint, &options, gophercloud.EndpointOpts{}) default: // The switch statement must be out of date from the versions list. return fmt.Errorf("Unrecognized identity version: %s", chosen.ID) @@ -112,11 +109,17 @@ func Authenticate(client *gophercloud.ProviderClient, options gophercloud.AuthOp } // AuthenticateV2 explicitly authenticates against the identity v2 endpoint. -func AuthenticateV2(client *gophercloud.ProviderClient, options gophercloud.AuthOptions, eo gophercloud.EndpointOpts) error { - return v2auth(client, "", options, eo) +func AuthenticateV2(ctx context.Context, client *gophercloud.ProviderClient, options tokens2.AuthOptionsBuilder, eo gophercloud.EndpointOpts) error { + return v2auth(ctx, client, "", options, eo) } -func v2auth(client *gophercloud.ProviderClient, endpoint string, options gophercloud.AuthOptions, eo gophercloud.EndpointOpts) error { +type v2TokenNoReauth struct { + tokens2.AuthOptionsBuilder +} + +func (v2TokenNoReauth) CanReauth() bool { return false } + +func v2auth(ctx context.Context, client *gophercloud.ProviderClient, endpoint string, options tokens2.AuthOptionsBuilder, eo gophercloud.EndpointOpts) error { v2Client, err := NewIdentityV2(client, eo) if err != nil { return err @@ -126,17 +129,7 @@ func v2auth(client *gophercloud.ProviderClient, endpoint string, options gopherc v2Client.Endpoint = endpoint } - v2Opts := tokens2.AuthOptions{ - IdentityEndpoint: options.IdentityEndpoint, - Username: options.Username, - Password: options.Password, - TenantID: options.TenantID, - TenantName: options.TenantName, - AllowReauth: options.AllowReauth, - TokenID: options.TokenID, - } - - result := tokens2.Create(v2Client, v2Opts) + result := tokens2.Create(ctx, v2Client, options) err = client.SetTokenAndAuthResult(result) if err != nil { @@ -148,18 +141,19 @@ func v2auth(client *gophercloud.ProviderClient, endpoint string, options gopherc return err } - if options.AllowReauth { + if options.CanReauth() { // here we're creating a throw-away client (tac). it's a copy of the user's provider client, but // with the token and reauth func zeroed out. combined with setting `AllowReauth` to `false`, // this should retry authentication only once tac := *client tac.SetThrowaway(true) tac.ReauthFunc = nil - tac.SetTokenAndAuthResult(nil) - tao := options - tao.AllowReauth = false - client.ReauthFunc = func() error { - err := v2auth(&tac, endpoint, tao, eo) + err := tac.SetTokenAndAuthResult(nil) + if err != nil { + return err + } + client.ReauthFunc = func(ctx context.Context) error { + err := v2auth(ctx, &tac, endpoint, &v2TokenNoReauth{options}, eo) if err != nil { return err } @@ -175,11 +169,11 @@ func v2auth(client *gophercloud.ProviderClient, endpoint string, options gopherc } // AuthenticateV3 explicitly authenticates against the identity v3 service. -func AuthenticateV3(client *gophercloud.ProviderClient, options tokens3.AuthOptionsBuilder, eo gophercloud.EndpointOpts) error { - return v3auth(client, "", options, eo) +func AuthenticateV3(ctx context.Context, client *gophercloud.ProviderClient, options tokens3.AuthOptionsBuilder, eo gophercloud.EndpointOpts) error { + return v3auth(ctx, client, "", options, eo) } -func v3auth(client *gophercloud.ProviderClient, endpoint string, opts tokens3.AuthOptionsBuilder, eo gophercloud.EndpointOpts) error { +func v3auth(ctx context.Context, client *gophercloud.ProviderClient, endpoint string, opts tokens3.AuthOptionsBuilder, eo gophercloud.EndpointOpts) error { // Override the generated service endpoint with the one returned by the version endpoint. v3Client, err := NewIdentityV3(client, eo) if err != nil { @@ -211,7 +205,7 @@ func v3auth(client *gophercloud.ProviderClient, endpoint string, opts tokens3.Au } v3Client.SetToken(tokenID) - result := tokens3.Get(v3Client, tokenID) + result := tokens3.Get(ctx, v3Client, tokenID) if result.Err != nil { return result.Err } @@ -229,11 +223,11 @@ func v3auth(client *gophercloud.ProviderClient, endpoint string, opts tokens3.Au var result tokens3.CreateResult switch opts.(type) { case *ec2tokens.AuthOptions: - result = ec2tokens.Create(v3Client, opts) + result = ec2tokens.Create(ctx, v3Client, opts) case *oauth1.AuthOptions: - result = oauth1.Create(v3Client, opts) + result = oauth1.Create(ctx, v3Client, opts) default: - result = tokens3.Create(v3Client, opts) + result = tokens3.Create(ctx, v3Client, opts) } err = client.SetTokenAndAuthResult(result) @@ -254,7 +248,10 @@ func v3auth(client *gophercloud.ProviderClient, endpoint string, opts tokens3.Au tac := *client tac.SetThrowaway(true) tac.ReauthFunc = nil - tac.SetTokenAndAuthResult(nil) + err = tac.SetTokenAndAuthResult(nil) + if err != nil { + return err + } var tao tokens3.AuthOptionsBuilder switch ot := opts.(type) { case *gophercloud.AuthOptions: @@ -276,8 +273,8 @@ func v3auth(client *gophercloud.ProviderClient, endpoint string, opts tokens3.Au default: tao = opts } - client.ReauthFunc = func() error { - err := v3auth(&tac, endpoint, tao, eo) + client.ReauthFunc = func(ctx context.Context) error { + err := v3auth(ctx, &tac, endpoint, tao, eo) if err != nil { return err } @@ -363,7 +360,11 @@ func initClientOpts(client *gophercloud.ProviderClient, eo gophercloud.EndpointO // NewBareMetalV1 creates a ServiceClient that may be used with the v1 // bare metal package. func NewBareMetalV1(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error) { - return initClientOpts(client, eo, "baremetal") + sc, err := initClientOpts(client, eo, "baremetal") + if !strings.HasSuffix(strings.TrimSuffix(sc.Endpoint, "/"), "v1") { + sc.ResourceBase = sc.Endpoint + "v1/" + } + return sc, err } // NewBareMetalIntrospectionV1 creates a ServiceClient that may be used with the v1 @@ -414,12 +415,6 @@ func NewSharedFileSystemV2(client *gophercloud.ProviderClient, eo gophercloud.En return initClientOpts(client, eo, "sharev2") } -// NewCDNV1 creates a ServiceClient that may be used to access the OpenStack v1 -// CDN service. -func NewCDNV1(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error) { - return initClientOpts(client, eo, "cdn") -} - // NewOrchestrationV1 creates a ServiceClient that may be used to access the v1 // orchestration service. func NewOrchestrationV1(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error) { @@ -439,9 +434,9 @@ func NewDNSV2(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) ( return sc, err } -// NewImageServiceV2 creates a ServiceClient that may be used to access the v2 -// image service. -func NewImageServiceV2(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error) { +// NewImageV2 creates a ServiceClient that may be used to access the v2 image +// service. +func NewImageV2(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error) { sc, err := initClientOpts(client, eo, "image") sc.ResourceBase = sc.Endpoint + "v2/" return sc, err @@ -459,12 +454,6 @@ func NewLoadBalancerV2(client *gophercloud.ProviderClient, eo gophercloud.Endpoi return sc, err } -// NewClusteringV1 creates a ServiceClient that may be used with the v1 clustering -// package. -func NewClusteringV1(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error) { - return initClientOpts(client, eo, "clustering") -} - // NewMessagingV2 creates a ServiceClient that may be used with the v2 messaging // service. func NewMessagingV2(client *gophercloud.ProviderClient, clientID string, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error) { diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/availabilityzones/doc.go b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/compute/v2/availabilityzones/doc.go similarity index 63% rename from legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/availabilityzones/doc.go rename to legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/compute/v2/availabilityzones/doc.go index 13b6d9d42..59278fda3 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/availabilityzones/doc.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/compute/v2/availabilityzones/doc.go @@ -3,32 +3,9 @@ Package availabilityzones provides the ability to get lists and detailed availability zone information and to extend a server result with availability zone information. -Example of Extend server result with Availability Zone Information: - - type ServerWithAZ struct { - servers.Server - availabilityzones.ServerAvailabilityZoneExt - } - - var allServers []ServerWithAZ - - allPages, err := servers.List(client, nil).AllPages() - if err != nil { - panic("Unable to retrieve servers: %s", err) - } - - err = servers.ExtractServersInto(allPages, &allServers) - if err != nil { - panic("Unable to extract servers: %s", err) - } - - for _, server := range allServers { - fmt.Println(server.AvailabilityZone) - } - Example of Get Availability Zone Information - allPages, err := availabilityzones.List(computeClient).AllPages() + allPages, err := availabilityzones.List(computeClient).AllPages(context.TODO()) if err != nil { panic(err) } @@ -44,7 +21,7 @@ Example of Get Availability Zone Information Example of Get Detailed Availability Zone Information - allPages, err := availabilityzones.ListDetail(computeClient).AllPages() + allPages, err := availabilityzones.ListDetail(computeClient).AllPages(context.TODO()) if err != nil { panic(err) } diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/availabilityzones/requests.go b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/compute/v2/availabilityzones/requests.go similarity index 87% rename from legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/availabilityzones/requests.go rename to legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/compute/v2/availabilityzones/requests.go index f9a2e86e0..319e61978 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/availabilityzones/requests.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/compute/v2/availabilityzones/requests.go @@ -1,8 +1,8 @@ package availabilityzones import ( - "github.com/gophercloud/gophercloud" - "github.com/gophercloud/gophercloud/pagination" + "github.com/gophercloud/gophercloud/v2" + "github.com/gophercloud/gophercloud/v2/pagination" ) // List will return the existing availability zones. diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/availabilityzones/results.go b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/compute/v2/availabilityzones/results.go similarity index 84% rename from legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/availabilityzones/results.go rename to legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/compute/v2/availabilityzones/results.go index d48a0ea85..3c95a8a24 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/availabilityzones/results.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/compute/v2/availabilityzones/results.go @@ -4,16 +4,10 @@ import ( "encoding/json" "time" - "github.com/gophercloud/gophercloud" - "github.com/gophercloud/gophercloud/pagination" + "github.com/gophercloud/gophercloud/v2" + "github.com/gophercloud/gophercloud/v2/pagination" ) -// ServerAvailabilityZoneExt is an extension to the base Server object. -type ServerAvailabilityZoneExt struct { - // AvailabilityZone is the availabilty zone the server is in. - AvailabilityZone string `json:"OS-EXT-AZ:availability_zone"` -} - // ServiceState represents the state of a service in an AvailabilityZone. type ServiceState struct { Active bool `json:"active"` diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/availabilityzones/urls.go b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/compute/v2/availabilityzones/urls.go similarity index 83% rename from legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/availabilityzones/urls.go rename to legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/compute/v2/availabilityzones/urls.go index 9d99ec74b..88c748275 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/availabilityzones/urls.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/compute/v2/availabilityzones/urls.go @@ -1,6 +1,6 @@ package availabilityzones -import "github.com/gophercloud/gophercloud" +import "github.com/gophercloud/gophercloud/v2" func listURL(c *gophercloud.ServiceClient) string { return c.ServiceURL("os-availability-zone") diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/doc.go b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/doc.go similarity index 86% rename from legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/doc.go rename to legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/doc.go index af4bd512b..4d89fb5d0 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/doc.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/doc.go @@ -6,7 +6,7 @@ OpenStack cloud and for provisioning various service-level clients. Example of Creating a Service Client ao, err := openstack.AuthOptionsFromEnv() - provider, err := openstack.AuthenticatedClient(ao) + provider, err := openstack.AuthenticatedClient(context.TODO(), ao) client, err := openstack.NewNetworkV2(provider, gophercloud.EndpointOpts{ Region: os.Getenv("OS_REGION_NAME"), }) diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/endpoint_location.go b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/endpoint_location.go similarity index 95% rename from legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/endpoint_location.go rename to legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/endpoint_location.go index 509700790..2cdbd3e7f 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/endpoint_location.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/endpoint_location.go @@ -1,9 +1,9 @@ package openstack import ( - "github.com/gophercloud/gophercloud" - tokens2 "github.com/gophercloud/gophercloud/openstack/identity/v2/tokens" - tokens3 "github.com/gophercloud/gophercloud/openstack/identity/v3/tokens" + "github.com/gophercloud/gophercloud/v2" + tokens2 "github.com/gophercloud/gophercloud/v2/openstack/identity/v2/tokens" + tokens3 "github.com/gophercloud/gophercloud/v2/openstack/identity/v3/tokens" ) /* diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/errors.go b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/errors.go similarity index 97% rename from legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/errors.go rename to legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/errors.go index cba6ae5f0..f5273483e 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/errors.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/errors.go @@ -3,7 +3,7 @@ package openstack import ( "fmt" - "github.com/gophercloud/gophercloud" + "github.com/gophercloud/gophercloud/v2" ) // ErrEndpointNotFound is the error when no suitable endpoint can be found diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/identity/v2/tenants/doc.go b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/identity/v2/tenants/doc.go similarity index 81% rename from legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/identity/v2/tenants/doc.go rename to legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/identity/v2/tenants/doc.go index 348dd2083..b14d69a56 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/identity/v2/tenants/doc.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/identity/v2/tenants/doc.go @@ -12,7 +12,7 @@ Example to List Tenants Limit: 2, } - allPages, err := tenants.List(identityClient, listOpts).AllPages() + allPages, err := tenants.List(identityClient, listOpts).AllPages(context.TODO()) if err != nil { panic(err) } @@ -34,7 +34,7 @@ Example to Create a Tenant Enabled: gophercloud.Enabled, } - tenant, err := tenants.Create(identityClient, createOpts).Extract() + tenant, err := tenants.Create(context.TODO(), identityClient, createOpts).Extract() if err != nil { panic(err) } @@ -48,7 +48,7 @@ Example to Update a Tenant Enabled: gophercloud.Disabled, } - tenant, err := tenants.Update(identityClient, tenantID, updateOpts).Extract() + tenant, err := tenants.Update(context.TODO(), identityClient, tenantID, updateOpts).Extract() if err != nil { panic(err) } @@ -57,7 +57,7 @@ Example to Delete a Tenant tenantID := "e6db6ed6277c461a853458589063b295" - err := tenants.Delete(identitYClient, tenantID).ExtractErr() + err := tenants.Delete(context.TODO(), identitYClient, tenantID).ExtractErr() if err != nil { panic(err) } diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/identity/v2/tenants/requests.go b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/identity/v2/tenants/requests.go similarity index 72% rename from legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/identity/v2/tenants/requests.go rename to legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/identity/v2/tenants/requests.go index f16df38e5..a08980df2 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/identity/v2/tenants/requests.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/identity/v2/tenants/requests.go @@ -1,8 +1,10 @@ package tenants import ( - "github.com/gophercloud/gophercloud" - "github.com/gophercloud/gophercloud/pagination" + "context" + + "github.com/gophercloud/gophercloud/v2" + "github.com/gophercloud/gophercloud/v2/pagination" ) // ListOpts filters the Tenants that are returned by the List call. @@ -44,23 +46,23 @@ type CreateOpts struct { // CreateOptsBuilder enables extensions to add additional parameters to the // Create request. type CreateOptsBuilder interface { - ToTenantCreateMap() (map[string]interface{}, error) + ToTenantCreateMap() (map[string]any, error) } // ToTenantCreateMap assembles a request body based on the contents of // a CreateOpts. -func (opts CreateOpts) ToTenantCreateMap() (map[string]interface{}, error) { +func (opts CreateOpts) ToTenantCreateMap() (map[string]any, error) { return gophercloud.BuildRequestBody(opts, "tenant") } // Create is the operation responsible for creating new tenant. -func Create(client *gophercloud.ServiceClient, opts CreateOptsBuilder) (r CreateResult) { +func Create(ctx context.Context, client *gophercloud.ServiceClient, opts CreateOptsBuilder) (r CreateResult) { b, err := opts.ToTenantCreateMap() if err != nil { r.Err = err return } - resp, err := client.Post(createURL(client), b, &r.Body, &gophercloud.RequestOpts{ + resp, err := client.Post(ctx, createURL(client), b, &r.Body, &gophercloud.RequestOpts{ OkCodes: []int{200, 201}, }) _, r.Header, r.Err = gophercloud.ParseResponse(resp, err) @@ -68,8 +70,8 @@ func Create(client *gophercloud.ServiceClient, opts CreateOptsBuilder) (r Create } // Get requests details on a single tenant by ID. -func Get(client *gophercloud.ServiceClient, id string) (r GetResult) { - resp, err := client.Get(getURL(client, id), &r.Body, nil) +func Get(ctx context.Context, client *gophercloud.ServiceClient, id string) (r GetResult) { + resp, err := client.Get(ctx, getURL(client, id), &r.Body, nil) _, r.Header, r.Err = gophercloud.ParseResponse(resp, err) return } @@ -77,7 +79,7 @@ func Get(client *gophercloud.ServiceClient, id string) (r GetResult) { // UpdateOptsBuilder allows extensions to add additional parameters to the // Update request. type UpdateOptsBuilder interface { - ToTenantUpdateMap() (map[string]interface{}, error) + ToTenantUpdateMap() (map[string]any, error) } // UpdateOpts specifies the base attributes that may be updated on an existing @@ -94,18 +96,18 @@ type UpdateOpts struct { } // ToTenantUpdateMap formats an UpdateOpts structure into a request body. -func (opts UpdateOpts) ToTenantUpdateMap() (map[string]interface{}, error) { +func (opts UpdateOpts) ToTenantUpdateMap() (map[string]any, error) { return gophercloud.BuildRequestBody(opts, "tenant") } // Update is the operation responsible for updating exist tenants by their TenantID. -func Update(client *gophercloud.ServiceClient, id string, opts UpdateOptsBuilder) (r UpdateResult) { +func Update(ctx context.Context, client *gophercloud.ServiceClient, id string, opts UpdateOptsBuilder) (r UpdateResult) { b, err := opts.ToTenantUpdateMap() if err != nil { r.Err = err return } - resp, err := client.Put(updateURL(client, id), &b, &r.Body, &gophercloud.RequestOpts{ + resp, err := client.Put(ctx, updateURL(client, id), &b, &r.Body, &gophercloud.RequestOpts{ OkCodes: []int{200}, }) _, r.Header, r.Err = gophercloud.ParseResponse(resp, err) @@ -113,8 +115,8 @@ func Update(client *gophercloud.ServiceClient, id string, opts UpdateOptsBuilder } // Delete is the operation responsible for permanently deleting a tenant. -func Delete(client *gophercloud.ServiceClient, id string) (r DeleteResult) { - resp, err := client.Delete(deleteURL(client, id), nil) +func Delete(ctx context.Context, client *gophercloud.ServiceClient, id string) (r DeleteResult) { + resp, err := client.Delete(ctx, deleteURL(client, id), nil) _, r.Header, r.Err = gophercloud.ParseResponse(resp, err) return } diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/identity/v2/tenants/results.go b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/identity/v2/tenants/results.go similarity index 96% rename from legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/identity/v2/tenants/results.go rename to legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/identity/v2/tenants/results.go index 2daff9840..2569ffec0 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/identity/v2/tenants/results.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/identity/v2/tenants/results.go @@ -1,8 +1,8 @@ package tenants import ( - "github.com/gophercloud/gophercloud" - "github.com/gophercloud/gophercloud/pagination" + "github.com/gophercloud/gophercloud/v2" + "github.com/gophercloud/gophercloud/v2/pagination" ) // Tenant is a grouping of users in the identity service. diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/identity/v2/tenants/urls.go b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/identity/v2/tenants/urls.go similarity index 92% rename from legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/identity/v2/tenants/urls.go rename to legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/identity/v2/tenants/urls.go index 0f0266907..4c2aaf384 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/identity/v2/tenants/urls.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/identity/v2/tenants/urls.go @@ -1,6 +1,6 @@ package tenants -import "github.com/gophercloud/gophercloud" +import "github.com/gophercloud/gophercloud/v2" func listURL(client *gophercloud.ServiceClient) string { return client.ServiceURL("tenants") diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/identity/v2/tokens/doc.go b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/identity/v2/tokens/doc.go similarity index 76% rename from legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/identity/v2/tokens/doc.go rename to legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/identity/v2/tokens/doc.go index 5375eea87..7cfc36730 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/identity/v2/tokens/doc.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/identity/v2/tokens/doc.go @@ -12,7 +12,7 @@ Example to Create an Unscoped Token from a Password Password: "pass" } - token, err := tokens.Create(identityClient, authOpts).ExtractToken() + token, err := tokens.Create(context.TODO(), identityClient, authOpts).ExtractToken() if err != nil { panic(err) } @@ -25,7 +25,7 @@ Example to Create a Token from a Tenant ID and Password TenantID: "fc394f2ab2df4114bde39905f800dc57" } - token, err := tokens.Create(identityClient, authOpts).ExtractToken() + token, err := tokens.Create(context.TODO(), identityClient, authOpts).ExtractToken() if err != nil { panic(err) } @@ -38,7 +38,7 @@ Example to Create a Token from a Tenant Name and Password TenantName: "tenantname" } - token, err := tokens.Create(identityClient, authOpts).ExtractToken() + token, err := tokens.Create(context.TODO(), identityClient, authOpts).ExtractToken() if err != nil { panic(err) } diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/identity/v2/tokens/requests.go b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/identity/v2/tokens/requests.go similarity index 82% rename from legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/identity/v2/tokens/requests.go rename to legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/identity/v2/tokens/requests.go index 84f16c3fc..5afa8fd26 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/identity/v2/tokens/requests.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/identity/v2/tokens/requests.go @@ -1,6 +1,10 @@ package tokens -import "github.com/gophercloud/gophercloud" +import ( + "context" + + "github.com/gophercloud/gophercloud/v2" +) // PasswordCredentialsV2 represents the required options to authenticate // with a username and password. @@ -37,7 +41,8 @@ type AuthOptionsV2 struct { type AuthOptionsBuilder interface { // ToTokenCreateMap assembles the Create request body, returning an error // if parameters are missing or inconsistent. - ToTokenV2CreateMap() (map[string]interface{}, error) + ToTokenV2CreateMap() (map[string]any, error) + CanReauth() bool } // AuthOptions are the valid options for Openstack Identity v2 authentication. @@ -53,7 +58,7 @@ type AuthOptions struct { } // ToTokenV2CreateMap builds a token request body from the given AuthOptions. -func (opts AuthOptions) ToTokenV2CreateMap() (map[string]interface{}, error) { +func (opts AuthOptions) ToTokenV2CreateMap() (map[string]any, error) { v2Opts := AuthOptionsV2{ TenantID: opts.TenantID, TenantName: opts.TenantName, @@ -77,17 +82,21 @@ func (opts AuthOptions) ToTokenV2CreateMap() (map[string]interface{}, error) { return b, nil } +func (opts AuthOptions) CanReauth() bool { + return opts.AllowReauth +} + // Create authenticates to the identity service and attempts to acquire a Token. // Generally, rather than interact with this call directly, end users should // call openstack.AuthenticatedClient(), which abstracts all of the gory details // about navigating service catalogs and such. -func Create(client *gophercloud.ServiceClient, auth AuthOptionsBuilder) (r CreateResult) { +func Create(ctx context.Context, client *gophercloud.ServiceClient, auth AuthOptionsBuilder) (r CreateResult) { b, err := auth.ToTokenV2CreateMap() if err != nil { r.Err = err return } - resp, err := client.Post(CreateURL(client), b, &r.Body, &gophercloud.RequestOpts{ + resp, err := client.Post(ctx, CreateURL(client), b, &r.Body, &gophercloud.RequestOpts{ OkCodes: []int{200, 203}, OmitHeaders: []string{"X-Auth-Token"}, }) @@ -96,8 +105,8 @@ func Create(client *gophercloud.ServiceClient, auth AuthOptionsBuilder) (r Creat } // Get validates and retrieves information for user's token. -func Get(client *gophercloud.ServiceClient, token string) (r GetResult) { - resp, err := client.Get(GetURL(client, token), &r.Body, &gophercloud.RequestOpts{ +func Get(ctx context.Context, client *gophercloud.ServiceClient, token string) (r GetResult) { + resp, err := client.Get(ctx, GetURL(client, token), &r.Body, &gophercloud.RequestOpts{ OkCodes: []int{200, 203}, }) _, r.Header, r.Err = gophercloud.ParseResponse(resp, err) diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/identity/v2/tokens/results.go b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/identity/v2/tokens/results.go similarity index 97% rename from legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/identity/v2/tokens/results.go rename to legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/identity/v2/tokens/results.go index ee5da37f4..516371ee8 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/identity/v2/tokens/results.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/identity/v2/tokens/results.go @@ -3,8 +3,8 @@ package tokens import ( "time" - "github.com/gophercloud/gophercloud" - "github.com/gophercloud/gophercloud/openstack/identity/v2/tenants" + "github.com/gophercloud/gophercloud/v2" + "github.com/gophercloud/gophercloud/v2/openstack/identity/v2/tenants" ) // Token provides only the most basic information related to an authentication diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/identity/v2/tokens/urls.go b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/identity/v2/tokens/urls.go similarity index 87% rename from legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/identity/v2/tokens/urls.go rename to legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/identity/v2/tokens/urls.go index ee0a28f20..845cdb58b 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/identity/v2/tokens/urls.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/identity/v2/tokens/urls.go @@ -1,6 +1,6 @@ package tokens -import "github.com/gophercloud/gophercloud" +import "github.com/gophercloud/gophercloud/v2" // CreateURL generates the URL used to create new Tokens. func CreateURL(client *gophercloud.ServiceClient) string { diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/identity/v3/extensions/ec2tokens/doc.go b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/identity/v3/ec2tokens/doc.go similarity index 82% rename from legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/identity/v3/extensions/ec2tokens/doc.go rename to legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/identity/v3/ec2tokens/doc.go index a30d0faf3..bd74473da 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/identity/v3/extensions/ec2tokens/doc.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/identity/v3/ec2tokens/doc.go @@ -13,7 +13,7 @@ Example to Create a Token From an EC2 access and secret keys Secret: "18f4f6761ada4e3795fa5273c30349b9", } - token, err := ec2tokens.Create(identityClient, authOptions).ExtractToken() + token, err := ec2tokens.Create(context.TODO(), identityClient, authOptions).ExtractToken() if err != nil { panic(err) } @@ -32,7 +32,7 @@ Example to auth a client using EC2 access and secret keys AllowReauth: true, } - err = openstack.AuthenticateV3(client, authOptions, gophercloud.EndpointOpts{}) + err = openstack.AuthenticateV3(context.TODO(), client, authOptions, gophercloud.EndpointOpts{}) if err != nil { panic(err) } diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/identity/v3/extensions/ec2tokens/requests.go b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/identity/v3/ec2tokens/requests.go similarity index 88% rename from legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/identity/v3/extensions/ec2tokens/requests.go rename to legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/identity/v3/ec2tokens/requests.go index 32ba0e621..5b1f3d688 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/identity/v3/extensions/ec2tokens/requests.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/identity/v3/ec2tokens/requests.go @@ -1,19 +1,20 @@ package ec2tokens import ( + "context" "crypto/hmac" + "crypto/rand" "crypto/sha1" "crypto/sha256" "encoding/hex" "fmt" - "math/rand" "net/url" "sort" "strings" "time" - "github.com/gophercloud/gophercloud" - "github.com/gophercloud/gophercloud/openstack/identity/v3/tokens" + "github.com/gophercloud/gophercloud/v2" + "github.com/gophercloud/gophercloud/v2/openstack/identity/v3/tokens" ) const ( @@ -66,7 +67,7 @@ type AuthOptions struct { // Signature can be either a []byte (encoded to base64 automatically) or // a string. You can set the singature explicitly, when you already know // it. In this case default Params won't be automatically set. Optional. - Signature interface{} `json:"signature"` + Signature any `json:"signature"` // BodyHash is a HTTP request body sha256 hash. When nil and Signature // is not set, a random hash is generated. Optional. BodyHash *string `json:"body_hash"` @@ -204,13 +205,13 @@ func EC2CredentialsBuildAuthorizationHeaderV4(opts AuthOptions, signedHeaders st // ToTokenV3ScopeMap is a dummy method to satisfy tokens.AuthOptionsBuilder // interface. -func (opts *AuthOptions) ToTokenV3ScopeMap() (map[string]interface{}, error) { +func (opts *AuthOptions) ToTokenV3ScopeMap() (map[string]any, error) { return nil, nil } // ToTokenV3HeadersMap allows AuthOptions to satisfy the AuthOptionsBuilder // interface in the v3 tokens package. -func (opts *AuthOptions) ToTokenV3HeadersMap(map[string]interface{}) (map[string]string, error) { +func (opts *AuthOptions) ToTokenV3HeadersMap(map[string]any) (map[string]string, error) { return nil, nil } @@ -220,7 +221,7 @@ func (opts *AuthOptions) CanReauth() bool { } // ToTokenV3CreateMap formats an AuthOptions into a create request. -func (opts *AuthOptions) ToTokenV3CreateMap(map[string]interface{}) (map[string]interface{}, error) { +func (opts *AuthOptions) ToTokenV3CreateMap(map[string]any) (map[string]any, error) { b, err := gophercloud.BuildRequestBody(opts, "credentials") if err != nil { return nil, err @@ -231,18 +232,14 @@ func (opts *AuthOptions) ToTokenV3CreateMap(map[string]interface{}) (map[string] } // calculate signature, when it is not set - c, _ := b["credentials"].(map[string]interface{}) + c, _ := b["credentials"].(map[string]any) h := interfaceToMap(c, "headers") p := interfaceToMap(c, "params") // detect and process a signature v2 if v, ok := p["SignatureVersion"]; ok && v == "2" { - if _, ok := c["body_hash"]; ok { - delete(c, "body_hash") - } - if _, ok := c["headers"]; ok { - delete(c, "headers") - } + delete(c, "body_hash") + delete(c, "headers") if v, ok := p["SignatureMethod"]; ok { // params is a map of strings strToSign := EC2CredentialsBuildStringToSignV2(*opts) @@ -268,12 +265,16 @@ func (opts *AuthOptions) ToTokenV3CreateMap(map[string]interface{}) (map[string] if opts.Timestamp != nil { date = *opts.Timestamp } - if v, _ := c["body_hash"]; v == nil { + if v := c["body_hash"]; v == nil { // when body_hash is not set, generate a random one - c["body_hash"] = randomBodyHash() + bodyHash, err := randomBodyHash() + if err != nil { + return nil, fmt.Errorf("failed to generate random hash") + } + c["body_hash"] = bodyHash } - signedHeaders, _ := h["X-Amz-SignedHeaders"] + signedHeaders := h["X-Amz-SignedHeaders"] stringToSign := EC2CredentialsBuildStringToSignV4(*opts, signedHeaders, c["body_hash"].(string), date) key := EC2CredentialsBuildSignatureKeyV4(opts.Secret, opts.Region, opts.Service, date) @@ -288,7 +289,7 @@ func (opts *AuthOptions) ToTokenV3CreateMap(map[string]interface{}) (map[string] } // Create authenticates and either generates a new token from EC2 credentials -func Create(c *gophercloud.ServiceClient, opts tokens.AuthOptionsBuilder) (r tokens.CreateResult) { +func Create(ctx context.Context, c *gophercloud.ServiceClient, opts tokens.AuthOptionsBuilder) (r tokens.CreateResult) { b, err := opts.ToTokenV3CreateMap(nil) if err != nil { r.Err = err @@ -298,7 +299,7 @@ func Create(c *gophercloud.ServiceClient, opts tokens.AuthOptionsBuilder) (r tok // delete "token" element, since it is used in s3tokens deleteBodyElements(b, "token") - resp, err := c.Post(ec2tokensURL(c), b, &r.Body, &gophercloud.RequestOpts{ + resp, err := c.Post(ctx, ec2tokensURL(c), b, &r.Body, &gophercloud.RequestOpts{ MoreHeaders: map[string]string{"X-Auth-Token": ""}, OkCodes: []int{200}, }) @@ -308,7 +309,7 @@ func Create(c *gophercloud.ServiceClient, opts tokens.AuthOptionsBuilder) (r tok // ValidateS3Token authenticates an S3 request using EC2 credentials. Doesn't // generate a new token ID, but returns a tokens.CreateResult. -func ValidateS3Token(c *gophercloud.ServiceClient, opts tokens.AuthOptionsBuilder) (r tokens.CreateResult) { +func ValidateS3Token(ctx context.Context, c *gophercloud.ServiceClient, opts tokens.AuthOptionsBuilder) (r tokens.CreateResult) { b, err := opts.ToTokenV3CreateMap(nil) if err != nil { r.Err = err @@ -318,7 +319,7 @@ func ValidateS3Token(c *gophercloud.ServiceClient, opts tokens.AuthOptionsBuilde // delete unused element, since it is used in ec2tokens only deleteBodyElements(b, "body_hash", "headers", "host", "params", "path", "verb") - resp, err := c.Post(s3tokensURL(c), b, &r.Body, &gophercloud.RequestOpts{ + resp, err := c.Post(ctx, s3tokensURL(c), b, &r.Body, &gophercloud.RequestOpts{ MoreHeaders: map[string]string{"X-Auth-Token": ""}, OkCodes: []int{200}, }) @@ -343,18 +344,20 @@ func sumHMAC256(key []byte, data []byte) []byte { } // randomBodyHash is a func to generate a random sha256 hexdigest. -func randomBodyHash() string { +func randomBodyHash() (string, error) { h := make([]byte, 64) - rand.Read(h) - return hex.EncodeToString(h) + if _, err := rand.Read(h); err != nil { + return "", err + } + return hex.EncodeToString(h), nil } // interfaceToMap is a func used to represent a "credentials" map element as a // "map[string]string" -func interfaceToMap(c map[string]interface{}, key string) map[string]string { - // convert map[string]interface{} to map[string]string +func interfaceToMap(c map[string]any, key string) map[string]string { + // convert map[string]any to map[string]string m := make(map[string]string) - if v, _ := c[key].(map[string]interface{}); v != nil { + if v, _ := c[key].(map[string]any); v != nil { for k, v := range v { m[k] = v.(string) } @@ -366,12 +369,10 @@ func interfaceToMap(c map[string]interface{}, key string) map[string]string { } // deleteBodyElements deletes map body elements -func deleteBodyElements(b map[string]interface{}, elements ...string) { - if c, ok := b["credentials"].(map[string]interface{}); ok { +func deleteBodyElements(b map[string]any, elements ...string) { + if c, ok := b["credentials"].(map[string]any); ok { for _, k := range elements { - if _, ok := c[k]; ok { - delete(c, k) - } + delete(c, k) } } } diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/identity/v3/extensions/ec2tokens/urls.go b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/identity/v3/ec2tokens/urls.go similarity index 81% rename from legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/identity/v3/extensions/ec2tokens/urls.go rename to legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/identity/v3/ec2tokens/urls.go index 84b33b282..91add91eb 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/identity/v3/extensions/ec2tokens/urls.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/identity/v3/ec2tokens/urls.go @@ -1,6 +1,6 @@ package ec2tokens -import "github.com/gophercloud/gophercloud" +import "github.com/gophercloud/gophercloud/v2" func ec2tokensURL(c *gophercloud.ServiceClient) string { return c.ServiceURL("ec2tokens") diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/identity/v3/extensions/oauth1/doc.go b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/identity/v3/oauth1/doc.go similarity index 81% rename from legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/identity/v3/extensions/oauth1/doc.go rename to legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/identity/v3/oauth1/doc.go index 4294ef6c8..c0cfa924a 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/identity/v3/extensions/oauth1/doc.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/identity/v3/oauth1/doc.go @@ -6,7 +6,7 @@ Example to Create an OAuth1 Consumer createConsumerOpts := oauth1.CreateConsumerOpts{ Description: "My consumer", } - consumer, err := oauth1.CreateConsumer(identityClient, createConsumerOpts).Extract() + consumer, err := oauth1.CreateConsumer(context.TODO(), identityClient, createConsumerOpts).Extract() if err != nil { panic(err) } @@ -22,7 +22,7 @@ Example to Request an unauthorized OAuth1 token OAuthSignatureMethod: oauth1.HMACSHA1, RequestedProjectID: projectID, } - requestToken, err := oauth1.RequestToken(identityClient, requestTokenOpts).Extract() + requestToken, err := oauth1.RequestToken(context.TODO(), identityClient, requestTokenOpts).Extract() if err != nil { panic(err) } @@ -37,7 +37,7 @@ Example to Authorize an unauthorized OAuth1 token {Name: "member"}, }, } - authToken, err := oauth1.AuthorizeToken(identityClient, requestToken.OAuthToken, authorizeTokenOpts).Extract() + authToken, err := oauth1.AuthorizeToken(context.TODO(), identityClient, requestToken.OAuthToken, authorizeTokenOpts).Extract() if err != nil { panic(err) } @@ -54,7 +54,7 @@ Example to Create an OAuth1 Access Token OAuthVerifier: authToken.OAuthVerifier, OAuthSignatureMethod: oauth1.HMACSHA1, } - accessToken, err := oauth1.CreateAccessToken(identityClient, accessTokenOpts).Extract() + accessToken, err := oauth1.CreateAccessToken(context.TODO(), identityClient, accessTokenOpts).Extract() if err != nil { panic(err) } @@ -64,7 +64,7 @@ Example to Create an OAuth1 Access Token Example to List User's OAuth1 Access Tokens - allPages, err := oauth1.ListAccessTokens(identityClient, userID).AllPages() + allPages, err := oauth1.ListAccessTokens(identityClient, userID).AllPages(context.TODO()) if err != nil { panic(err) } @@ -93,7 +93,7 @@ Example to Authenticate a client using OAuth1 method OAuthTokenSecret: accessToken.OAuthTokenSecret, OAuthSignatureMethod: oauth1.HMACSHA1, } - err = openstack.AuthenticateV3(client, authOptions, gophercloud.EndpointOpts{}) + err = openstack.AuthenticateV3(context.TODO(), client, authOptions, gophercloud.EndpointOpts{}) if err != nil { panic(err) } @@ -114,7 +114,7 @@ Example to Create a Token using OAuth1 method OAuthTokenSecret: accessToken.OAuthTokenSecret, OAuthSignatureMethod: oauth1.HMACSHA1, } - err := tokens.Create(identityClient, createOpts).ExtractInto(&oauth1Token) + err := tokens.Create(context.TODO(), identityClient, createOpts).ExtractInto(&oauth1Token) if err != nil { panic(err) } diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/identity/v3/extensions/oauth1/requests.go b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/identity/v3/oauth1/requests.go similarity index 83% rename from legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/identity/v3/extensions/oauth1/requests.go rename to legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/identity/v3/oauth1/requests.go index 028b5a45b..8c66b36e2 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/identity/v3/extensions/oauth1/requests.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/identity/v3/oauth1/requests.go @@ -1,11 +1,12 @@ package oauth1 import ( + "context" "crypto/hmac" "crypto/sha1" "encoding/base64" "fmt" - "io/ioutil" + "io" "math/rand" "net/url" "sort" @@ -13,9 +14,9 @@ import ( "strings" "time" - "github.com/gophercloud/gophercloud" - "github.com/gophercloud/gophercloud/openstack/identity/v3/tokens" - "github.com/gophercloud/gophercloud/pagination" + "github.com/gophercloud/gophercloud/v2" + "github.com/gophercloud/gophercloud/v2/openstack/identity/v3/tokens" + "github.com/gophercloud/gophercloud/v2/pagination" ) // Type SignatureMethod is a OAuth1 SignatureMethod type. @@ -71,7 +72,7 @@ type AuthOptions struct { // ToTokenV3HeadersMap builds the headers required for an OAuth1-based create // request. -func (opts AuthOptions) ToTokenV3HeadersMap(headerOpts map[string]interface{}) (map[string]string, error) { +func (opts AuthOptions) ToTokenV3HeadersMap(headerOpts map[string]any) (map[string]string, error) { q, err := buildOAuth1QueryString(opts, opts.OAuthTimestamp, "") if err != nil { return nil, err @@ -96,7 +97,7 @@ func (opts AuthOptions) ToTokenV3HeadersMap(headerOpts map[string]interface{}) ( // ToTokenV3ScopeMap allows AuthOptions to satisfy the tokens.AuthOptionsBuilder // interface. -func (opts AuthOptions) ToTokenV3ScopeMap() (map[string]interface{}, error) { +func (opts AuthOptions) ToTokenV3ScopeMap() (map[string]any, error) { return nil, nil } @@ -107,7 +108,7 @@ func (opts AuthOptions) CanReauth() bool { } // ToTokenV3CreateMap builds a create request body. -func (opts AuthOptions) ToTokenV3CreateMap(map[string]interface{}) (map[string]interface{}, error) { +func (opts AuthOptions) ToTokenV3CreateMap(map[string]any) (map[string]any, error) { // identityReq defines the "identity" portion of an OAuth1-based authentication // create request body. type identityReq struct { @@ -133,16 +134,16 @@ func (opts AuthOptions) ToTokenV3CreateMap(map[string]interface{}) (map[string]i return gophercloud.BuildRequestBody(req, "") } -// Create authenticates and either generates a new OpenStack token from an -// OAuth1 token. -func Create(client *gophercloud.ServiceClient, opts tokens.AuthOptionsBuilder) (r tokens.CreateResult) { +// Create authenticates and either generates a new OpenStack token +// from an OAuth1 token. +func Create(ctx context.Context, client *gophercloud.ServiceClient, opts tokens.AuthOptionsBuilder) (r tokens.CreateResult) { b, err := opts.ToTokenV3CreateMap(nil) if err != nil { r.Err = err return } - headerOpts := map[string]interface{}{ + headerOpts := map[string]any{ "method": "POST", "url": authURL(client), } @@ -153,7 +154,7 @@ func Create(client *gophercloud.ServiceClient, opts tokens.AuthOptionsBuilder) ( return } - resp, err := client.Post(authURL(client), b, &r.Body, &gophercloud.RequestOpts{ + resp, err := client.Post(ctx, authURL(client), b, &r.Body, &gophercloud.RequestOpts{ MoreHeaders: h, OkCodes: []int{201}, }) @@ -164,7 +165,7 @@ func Create(client *gophercloud.ServiceClient, opts tokens.AuthOptionsBuilder) ( // CreateConsumerOptsBuilder allows extensions to add additional parameters to // the CreateConsumer request. type CreateConsumerOptsBuilder interface { - ToOAuth1CreateConsumerMap() (map[string]interface{}, error) + ToOAuth1CreateConsumerMap() (map[string]any, error) } // CreateConsumerOpts provides options used to create a new Consumer. @@ -174,27 +175,27 @@ type CreateConsumerOpts struct { } // ToOAuth1CreateConsumerMap formats a CreateConsumerOpts into a create request. -func (opts CreateConsumerOpts) ToOAuth1CreateConsumerMap() (map[string]interface{}, error) { +func (opts CreateConsumerOpts) ToOAuth1CreateConsumerMap() (map[string]any, error) { return gophercloud.BuildRequestBody(opts, "consumer") } -// Create creates a new Consumer. -func CreateConsumer(client *gophercloud.ServiceClient, opts CreateConsumerOptsBuilder) (r CreateConsumerResult) { +// CreateConsumer creates a new Consumer. +func CreateConsumer(ctx context.Context, client *gophercloud.ServiceClient, opts CreateConsumerOptsBuilder) (r CreateConsumerResult) { b, err := opts.ToOAuth1CreateConsumerMap() if err != nil { r.Err = err return } - resp, err := client.Post(consumersURL(client), b, &r.Body, &gophercloud.RequestOpts{ + resp, err := client.Post(ctx, consumersURL(client), b, &r.Body, &gophercloud.RequestOpts{ OkCodes: []int{201}, }) _, r.Header, r.Err = gophercloud.ParseResponse(resp, err) return } -// Delete deletes a Consumer. -func DeleteConsumer(client *gophercloud.ServiceClient, id string) (r DeleteConsumerResult) { - resp, err := client.Delete(consumerURL(client, id), nil) +// DeleteConsumer deletes a Consumer. +func DeleteConsumer(ctx context.Context, client *gophercloud.ServiceClient, id string) (r DeleteConsumerResult) { + resp, err := client.Delete(ctx, consumerURL(client, id), nil) _, r.Header, r.Err = gophercloud.ParseResponse(resp, err) return } @@ -207,8 +208,8 @@ func ListConsumers(client *gophercloud.ServiceClient) pagination.Pager { } // GetConsumer retrieves details on a single Consumer by ID. -func GetConsumer(client *gophercloud.ServiceClient, id string) (r GetConsumerResult) { - resp, err := client.Get(consumerURL(client, id), &r.Body, nil) +func GetConsumer(ctx context.Context, client *gophercloud.ServiceClient, id string) (r GetConsumerResult) { + resp, err := client.Get(ctx, consumerURL(client, id), &r.Body, nil) _, r.Header, r.Err = gophercloud.ParseResponse(resp, err) return } @@ -221,18 +222,18 @@ type UpdateConsumerOpts struct { // ToOAuth1UpdateConsumerMap formats an UpdateConsumerOpts into a consumer update // request. -func (opts UpdateConsumerOpts) ToOAuth1UpdateConsumerMap() (map[string]interface{}, error) { +func (opts UpdateConsumerOpts) ToOAuth1UpdateConsumerMap() (map[string]any, error) { return gophercloud.BuildRequestBody(opts, "consumer") } // UpdateConsumer updates an existing Consumer. -func UpdateConsumer(client *gophercloud.ServiceClient, id string, opts UpdateConsumerOpts) (r UpdateConsumerResult) { +func UpdateConsumer(ctx context.Context, client *gophercloud.ServiceClient, id string, opts UpdateConsumerOpts) (r UpdateConsumerResult) { b, err := opts.ToOAuth1UpdateConsumerMap() if err != nil { r.Err = err return } - resp, err := client.Patch(consumerURL(client, id), b, &r.Body, &gophercloud.RequestOpts{ + resp, err := client.Patch(ctx, consumerURL(client, id), b, &r.Body, &gophercloud.RequestOpts{ OkCodes: []int{200}, }) _, r.Header, r.Err = gophercloud.ParseResponse(resp, err) @@ -298,14 +299,14 @@ func (opts RequestTokenOpts) ToOAuth1RequestTokenHeaders(method, u string) (map[ } // RequestToken requests an unauthorized OAuth1 Token. -func RequestToken(client *gophercloud.ServiceClient, opts RequestTokenOptsBuilder) (r TokenResult) { +func RequestToken(ctx context.Context, client *gophercloud.ServiceClient, opts RequestTokenOptsBuilder) (r TokenResult) { h, err := opts.ToOAuth1RequestTokenHeaders("POST", requestTokenURL(client)) if err != nil { r.Err = err return } - resp, err := client.Post(requestTokenURL(client), nil, nil, &gophercloud.RequestOpts{ + resp, err := client.Post(ctx, requestTokenURL(client), nil, nil, &gophercloud.RequestOpts{ MoreHeaders: h, OkCodes: []int{201}, KeepResponseBody: true, @@ -319,14 +320,14 @@ func RequestToken(client *gophercloud.ServiceClient, opts RequestTokenOptsBuilde r.Err = fmt.Errorf("unsupported Content-Type: %q", v) return } - r.Body, r.Err = ioutil.ReadAll(resp.Body) + r.Body, r.Err = io.ReadAll(resp.Body) return } // AuthorizeTokenOptsBuilder allows extensions to add additional parameters to // the AuthorizeToken request. type AuthorizeTokenOptsBuilder interface { - ToOAuth1AuthorizeTokenMap() (map[string]interface{}, error) + ToOAuth1AuthorizeTokenMap() (map[string]any, error) } // AuthorizeTokenOpts provides options used to authorize a request token. @@ -342,7 +343,7 @@ type Role struct { // ToOAuth1AuthorizeTokenMap formats an AuthorizeTokenOpts into an authorize token // request. -func (opts AuthorizeTokenOpts) ToOAuth1AuthorizeTokenMap() (map[string]interface{}, error) { +func (opts AuthorizeTokenOpts) ToOAuth1AuthorizeTokenMap() (map[string]any, error) { for _, r := range opts.Roles { if r == (Role{}) { return nil, fmt.Errorf("role must not be empty") @@ -352,13 +353,13 @@ func (opts AuthorizeTokenOpts) ToOAuth1AuthorizeTokenMap() (map[string]interface } // AuthorizeToken authorizes an unauthorized consumer token. -func AuthorizeToken(client *gophercloud.ServiceClient, id string, opts AuthorizeTokenOptsBuilder) (r AuthorizeTokenResult) { +func AuthorizeToken(ctx context.Context, client *gophercloud.ServiceClient, id string, opts AuthorizeTokenOptsBuilder) (r AuthorizeTokenResult) { b, err := opts.ToOAuth1AuthorizeTokenMap() if err != nil { r.Err = err return } - resp, err := client.Put(authorizeTokenURL(client, id), b, &r.Body, &gophercloud.RequestOpts{ + resp, err := client.Put(ctx, authorizeTokenURL(client, id), b, &r.Body, &gophercloud.RequestOpts{ OkCodes: []int{200}, }) _, r.Header, r.Err = gophercloud.ParseResponse(resp, err) @@ -426,14 +427,14 @@ func (opts CreateAccessTokenOpts) ToOAuth1CreateAccessTokenHeaders(method, u str } // CreateAccessToken creates a new OAuth1 Access Token -func CreateAccessToken(client *gophercloud.ServiceClient, opts CreateAccessTokenOptsBuilder) (r TokenResult) { +func CreateAccessToken(ctx context.Context, client *gophercloud.ServiceClient, opts CreateAccessTokenOptsBuilder) (r TokenResult) { h, err := opts.ToOAuth1CreateAccessTokenHeaders("POST", createAccessTokenURL(client)) if err != nil { r.Err = err return } - resp, err := client.Post(createAccessTokenURL(client), nil, nil, &gophercloud.RequestOpts{ + resp, err := client.Post(ctx, createAccessTokenURL(client), nil, nil, &gophercloud.RequestOpts{ MoreHeaders: h, OkCodes: []int{201}, KeepResponseBody: true, @@ -447,20 +448,20 @@ func CreateAccessToken(client *gophercloud.ServiceClient, opts CreateAccessToken r.Err = fmt.Errorf("unsupported Content-Type: %q", v) return } - r.Body, r.Err = ioutil.ReadAll(resp.Body) + r.Body, r.Err = io.ReadAll(resp.Body) return } // GetAccessToken retrieves details on a single OAuth1 access token by an ID. -func GetAccessToken(client *gophercloud.ServiceClient, userID string, id string) (r GetAccessTokenResult) { - resp, err := client.Get(userAccessTokenURL(client, userID, id), &r.Body, nil) +func GetAccessToken(ctx context.Context, client *gophercloud.ServiceClient, userID string, id string) (r GetAccessTokenResult) { + resp, err := client.Get(ctx, userAccessTokenURL(client, userID, id), &r.Body, nil) _, r.Header, r.Err = gophercloud.ParseResponse(resp, err) return } // RevokeAccessToken revokes an OAuth1 access token. -func RevokeAccessToken(client *gophercloud.ServiceClient, userID string, id string) (r RevokeAccessTokenResult) { - resp, err := client.Delete(userAccessTokenURL(client, userID, id), nil) +func RevokeAccessToken(ctx context.Context, client *gophercloud.ServiceClient, userID string, id string) (r RevokeAccessTokenResult) { + resp, err := client.Delete(ctx, userAccessTokenURL(client, userID, id), nil) _, r.Header, r.Err = gophercloud.ParseResponse(resp, err) return } @@ -483,8 +484,8 @@ func ListAccessTokenRoles(client *gophercloud.ServiceClient, userID string, id s // GetAccessTokenRole retrieves details on a single OAuth1 access token role by // an ID. -func GetAccessTokenRole(client *gophercloud.ServiceClient, userID string, id string, roleID string) (r GetAccessTokenRoleResult) { - resp, err := client.Get(userAccessTokenRoleURL(client, userID, id, roleID), &r.Body, nil) +func GetAccessTokenRole(ctx context.Context, client *gophercloud.ServiceClient, userID string, id string, roleID string) (r GetAccessTokenRoleResult) { + resp, err := client.Get(ctx, userAccessTokenRoleURL(client, userID, id, roleID), &r.Body, nil) _, r.Header, r.Err = gophercloud.ParseResponse(resp, err) return } @@ -493,7 +494,7 @@ func GetAccessTokenRole(client *gophercloud.ServiceClient, userID string, id str // buildOAuth1QueryString builds a URLEncoded parameters string specific for // OAuth1-based requests. -func buildOAuth1QueryString(opts interface{}, timestamp *time.Time, callback string) (*url.URL, error) { +func buildOAuth1QueryString(opts any, timestamp *time.Time, callback string) (*url.URL, error) { q, err := gophercloud.BuildQueryString(opts) if err != nil { return nil, err diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/identity/v3/extensions/oauth1/results.go b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/identity/v3/oauth1/results.go similarity index 98% rename from legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/identity/v3/extensions/oauth1/results.go rename to legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/identity/v3/oauth1/results.go index 2a3706162..2ed75bd74 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/identity/v3/extensions/oauth1/results.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/identity/v3/oauth1/results.go @@ -5,8 +5,8 @@ import ( "net/url" "time" - "github.com/gophercloud/gophercloud" - "github.com/gophercloud/gophercloud/pagination" + "github.com/gophercloud/gophercloud/v2" + "github.com/gophercloud/gophercloud/v2/pagination" ) // Consumer represents a delegated authorization request between two diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/identity/v3/extensions/oauth1/urls.go b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/identity/v3/oauth1/urls.go similarity index 96% rename from legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/identity/v3/extensions/oauth1/urls.go rename to legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/identity/v3/oauth1/urls.go index 9b51d53b3..c8dc02e5d 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/identity/v3/extensions/oauth1/urls.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/identity/v3/oauth1/urls.go @@ -1,6 +1,6 @@ package oauth1 -import "github.com/gophercloud/gophercloud" +import "github.com/gophercloud/gophercloud/v2" func consumersURL(c *gophercloud.ServiceClient) string { return c.ServiceURL("OS-OAUTH1", "consumers") diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/identity/v3/tokens/doc.go b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/identity/v3/tokens/doc.go similarity index 74% rename from legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/identity/v3/tokens/doc.go rename to legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/identity/v3/tokens/doc.go index de74c82ec..c711d0c28 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/identity/v3/tokens/doc.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/identity/v3/tokens/doc.go @@ -12,7 +12,7 @@ Example to Create a Token From a Username and Password Password: "password", } - token, err := tokens.Create(identityClient, authOptions).ExtractToken() + token, err := tokens.Create(context.TODO(), identityClient, authOptions).ExtractToken() if err != nil { panic(err) } @@ -25,7 +25,7 @@ Example to Create a Token From a Username, Password, and Domain DomainID: "default", } - token, err := tokens.Create(identityClient, authOptions).ExtractToken() + token, err := tokens.Create(context.TODO(), identityClient, authOptions).ExtractToken() if err != nil { panic(err) } @@ -36,7 +36,7 @@ Example to Create a Token From a Username, Password, and Domain DomainName: "default", } - token, err = tokens.Create(identityClient, authOptions).ExtractToken() + token, err = tokens.Create(context.TODO(), identityClient, authOptions).ExtractToken() if err != nil { panic(err) } @@ -47,7 +47,7 @@ Example to Create a Token From a Token TokenID: "token_id", } - token, err := tokens.Create(identityClient, authOptions).ExtractToken() + token, err := tokens.Create(context.TODO(), identityClient, authOptions).ExtractToken() if err != nil { panic(err) } @@ -64,7 +64,7 @@ Example to Create a Token from a Username and Password with Project ID Scope Password: "password", } - token, err = tokens.Create(identityClient, authOptions).ExtractToken() + token, err = tokens.Create(context.TODO(), identityClient, authOptions).ExtractToken() if err != nil { panic(err) } @@ -81,7 +81,7 @@ Example to Create a Token from a Username and Password with Domain ID Scope Password: "password", } - token, err = tokens.Create(identityClient, authOptions).ExtractToken() + token, err = tokens.Create(context.TODO(), identityClient, authOptions).ExtractToken() if err != nil { panic(err) } @@ -99,7 +99,7 @@ Example to Create a Token from a Username and Password with Project Name Scope Password: "password", } - token, err = tokens.Create(identityClient, authOptions).ExtractToken() + token, err = tokens.Create(context.TODO(), identityClient, authOptions).ExtractToken() if err != nil { panic(err) } diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/identity/v3/tokens/requests.go b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/identity/v3/tokens/requests.go similarity index 80% rename from legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/identity/v3/tokens/requests.go rename to legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/identity/v3/tokens/requests.go index 1af55d813..fa8b925d0 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/identity/v3/tokens/requests.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/identity/v3/tokens/requests.go @@ -1,6 +1,10 @@ package tokens -import "github.com/gophercloud/gophercloud" +import ( + "context" + + "github.com/gophercloud/gophercloud/v2" +) // Scope allows a created token to be limited to a specific domain or project. type Scope struct { @@ -9,6 +13,7 @@ type Scope struct { DomainID string DomainName string System bool + TrustID string } // AuthOptionsBuilder provides the ability for extensions to add additional @@ -16,9 +21,9 @@ type Scope struct { type AuthOptionsBuilder interface { // ToTokenV3CreateMap assembles the Create request body, returning an error // if parameters are missing or inconsistent. - ToTokenV3CreateMap(map[string]interface{}) (map[string]interface{}, error) - ToTokenV3HeadersMap(map[string]interface{}) (map[string]string, error) - ToTokenV3ScopeMap() (map[string]interface{}, error) + ToTokenV3CreateMap(map[string]any) (map[string]any, error) + ToTokenV3HeadersMap(map[string]any) (map[string]string, error) + ToTokenV3ScopeMap() (map[string]any, error) CanReauth() bool } @@ -67,7 +72,7 @@ type AuthOptions struct { } // ToTokenV3CreateMap builds a request body from AuthOptions. -func (opts *AuthOptions) ToTokenV3CreateMap(scope map[string]interface{}) (map[string]interface{}, error) { +func (opts *AuthOptions) ToTokenV3CreateMap(scope map[string]any) (map[string]any, error) { gophercloudAuthOpts := gophercloud.AuthOptions{ Username: opts.Username, UserID: opts.UserID, @@ -86,7 +91,7 @@ func (opts *AuthOptions) ToTokenV3CreateMap(scope map[string]interface{}) (map[s } // ToTokenV3ScopeMap builds a scope request body from AuthOptions. -func (opts *AuthOptions) ToTokenV3ScopeMap() (map[string]interface{}, error) { +func (opts *AuthOptions) ToTokenV3ScopeMap() (map[string]any, error) { scope := gophercloud.AuthScope(opts.Scope) gophercloudAuthOpts := gophercloud.AuthOptions{ @@ -109,7 +114,7 @@ func (opts *AuthOptions) CanReauth() bool { // ToTokenV3HeadersMap allows AuthOptions to satisfy the AuthOptionsBuilder // interface in the v3 tokens package. -func (opts *AuthOptions) ToTokenV3HeadersMap(map[string]interface{}) (map[string]string, error) { +func (opts *AuthOptions) ToTokenV3HeadersMap(map[string]any) (map[string]string, error) { return nil, nil } @@ -121,7 +126,7 @@ func subjectTokenHeaders(subjectToken string) map[string]string { // Create authenticates and either generates a new token, or changes the Scope // of an existing token. -func Create(c *gophercloud.ServiceClient, opts AuthOptionsBuilder) (r CreateResult) { +func Create(ctx context.Context, c *gophercloud.ServiceClient, opts AuthOptionsBuilder) (r CreateResult) { scope, err := opts.ToTokenV3ScopeMap() if err != nil { r.Err = err @@ -134,7 +139,7 @@ func Create(c *gophercloud.ServiceClient, opts AuthOptionsBuilder) (r CreateResu return } - resp, err := c.Post(tokenURL(c), b, &r.Body, &gophercloud.RequestOpts{ + resp, err := c.Post(ctx, tokenURL(c), b, &r.Body, &gophercloud.RequestOpts{ OmitHeaders: []string{"X-Auth-Token"}, }) _, r.Header, r.Err = gophercloud.ParseResponse(resp, err) @@ -142,8 +147,8 @@ func Create(c *gophercloud.ServiceClient, opts AuthOptionsBuilder) (r CreateResu } // Get validates and retrieves information about another token. -func Get(c *gophercloud.ServiceClient, token string) (r GetResult) { - resp, err := c.Get(tokenURL(c), &r.Body, &gophercloud.RequestOpts{ +func Get(ctx context.Context, c *gophercloud.ServiceClient, token string) (r GetResult) { + resp, err := c.Get(ctx, tokenURL(c), &r.Body, &gophercloud.RequestOpts{ MoreHeaders: subjectTokenHeaders(token), OkCodes: []int{200, 203}, }) @@ -152,8 +157,8 @@ func Get(c *gophercloud.ServiceClient, token string) (r GetResult) { } // Validate determines if a specified token is valid or not. -func Validate(c *gophercloud.ServiceClient, token string) (bool, error) { - resp, err := c.Head(tokenURL(c), &gophercloud.RequestOpts{ +func Validate(ctx context.Context, c *gophercloud.ServiceClient, token string) (bool, error) { + resp, err := c.Head(ctx, tokenURL(c), &gophercloud.RequestOpts{ MoreHeaders: subjectTokenHeaders(token), OkCodes: []int{200, 204, 404}, }) @@ -165,8 +170,8 @@ func Validate(c *gophercloud.ServiceClient, token string) (bool, error) { } // Revoke immediately makes specified token invalid. -func Revoke(c *gophercloud.ServiceClient, token string) (r RevokeResult) { - resp, err := c.Delete(tokenURL(c), &gophercloud.RequestOpts{ +func Revoke(ctx context.Context, c *gophercloud.ServiceClient, token string) (r RevokeResult) { + resp, err := c.Delete(ctx, tokenURL(c), &gophercloud.RequestOpts{ MoreHeaders: subjectTokenHeaders(token), }) _, r.Header, r.Err = gophercloud.ParseResponse(resp, err) diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/identity/v3/tokens/results.go b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/identity/v3/tokens/results.go similarity index 89% rename from legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/identity/v3/tokens/results.go rename to legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/identity/v3/tokens/results.go index f1e17e9f7..bd61a9a67 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/identity/v3/tokens/results.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/identity/v3/tokens/results.go @@ -3,7 +3,7 @@ package tokens import ( "time" - "github.com/gophercloud/gophercloud" + "github.com/gophercloud/gophercloud/v2" ) // Endpoint represents a single API endpoint offered by a service. @@ -76,6 +76,18 @@ type Project struct { Name string `json:"name"` } +type TrustUser struct { + ID string `json:"id"` +} + +// Trust provides information about trust with which User is authorized. +type Trust struct { + ID string `json:"id"` + Impersonation bool `json:"impersonation"` + TrusteeUserID TrustUser `json:"trustee_user"` + TrustorUserID TrustUser `json:"trustor_user"` +} + // commonResult is the response from a request. A commonResult has various // methods which can be used to extract different details about the result. type commonResult struct { @@ -160,6 +172,15 @@ func (r commonResult) ExtractDomain() (*Domain, error) { return s.Domain, err } +// ExtractTrust returns Trust to which User is authorized. +func (r commonResult) ExtractTrust() (*Trust, error) { + var s struct { + Trust *Trust `json:"OS-TRUST:trust"` + } + err := r.ExtractInto(&s) + return s.Trust, err +} + // CreateResult is the response from a Create request. Use ExtractToken() // to interpret it as a Token, or ExtractServiceCatalog() to interpret it // as a service catalog. @@ -189,6 +210,6 @@ type Token struct { ExpiresAt time.Time `json:"expires_at"` } -func (r commonResult) ExtractInto(v interface{}) error { +func (r commonResult) ExtractInto(v any) error { return r.ExtractIntoStructPtr(v, "token") } diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/identity/v3/tokens/urls.go b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/identity/v3/tokens/urls.go similarity index 70% rename from legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/identity/v3/tokens/urls.go rename to legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/identity/v3/tokens/urls.go index 2f864a31c..2218c107f 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/identity/v3/tokens/urls.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/identity/v3/tokens/urls.go @@ -1,6 +1,6 @@ package tokens -import "github.com/gophercloud/gophercloud" +import "github.com/gophercloud/gophercloud/v2" func tokenURL(c *gophercloud.ServiceClient) string { return c.ServiceURL("auth", "tokens") diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/utils/base_endpoint.go b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/utils/base_endpoint.go similarity index 100% rename from legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/openstack/utils/base_endpoint.go rename to legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/utils/base_endpoint.go diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/utils/choose_version.go b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/utils/choose_version.go new file mode 100644 index 000000000..6c720e57e --- /dev/null +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/openstack/utils/choose_version.go @@ -0,0 +1,236 @@ +package utils + +import ( + "context" + "fmt" + "strconv" + "strings" + + "github.com/gophercloud/gophercloud/v2" +) + +// Version is a supported API version, corresponding to a vN package within the appropriate service. +type Version struct { + ID string + Suffix string + Priority int +} + +var goodStatus = map[string]bool{ + "current": true, + "supported": true, + "stable": true, +} + +// ChooseVersion queries the base endpoint of an API to choose the identity service version. +// It will pick a version among the recognized, taking into account the priority and avoiding +// experimental alternatives from the published versions. However, if the client specifies a full +// endpoint that is among the recognized versions, it will be used regardless of priority. +// It returns the highest-Priority Version, OR exact match with client endpoint, +// among the alternatives that are provided, as well as its corresponding endpoint. +func ChooseVersion(ctx context.Context, client *gophercloud.ProviderClient, recognized []*Version) (*Version, string, error) { + type linkResp struct { + Href string `json:"href"` + Rel string `json:"rel"` + } + + type valueResp struct { + ID string `json:"id"` + Status string `json:"status"` + Links []linkResp `json:"links"` + } + + type versionsResp struct { + Values []valueResp `json:"values"` + } + + type response struct { + Versions versionsResp `json:"versions"` + } + + normalize := func(endpoint string) string { + if !strings.HasSuffix(endpoint, "/") { + return endpoint + "/" + } + return endpoint + } + identityEndpoint := normalize(client.IdentityEndpoint) + + // If a full endpoint is specified, check version suffixes for a match first. + for _, v := range recognized { + if strings.HasSuffix(identityEndpoint, v.Suffix) { + return v, identityEndpoint, nil + } + } + + var resp response + _, err := client.Request(ctx, "GET", client.IdentityBase, &gophercloud.RequestOpts{ + JSONResponse: &resp, + OkCodes: []int{200, 300}, + }) + + if err != nil { + return nil, "", err + } + + var highest *Version + var endpoint string + + for _, value := range resp.Versions.Values { + href := "" + for _, link := range value.Links { + if link.Rel == "self" { + href = normalize(link.Href) + } + } + + for _, version := range recognized { + if strings.Contains(value.ID, version.ID) { + // Prefer a version that exactly matches the provided endpoint. + if href == identityEndpoint { + if href == "" { + return nil, "", fmt.Errorf("Endpoint missing in version %s response from %s", value.ID, client.IdentityBase) + } + return version, href, nil + } + + // Otherwise, find the highest-priority version with a whitelisted status. + if goodStatus[strings.ToLower(value.Status)] { + if highest == nil || version.Priority > highest.Priority { + highest = version + endpoint = href + } + } + } + } + } + + if highest == nil { + return nil, "", fmt.Errorf("No supported version available from endpoint %s", client.IdentityBase) + } + if endpoint == "" { + return nil, "", fmt.Errorf("Endpoint missing in version %s response from %s", highest.ID, client.IdentityBase) + } + + return highest, endpoint, nil +} + +type SupportedMicroversions struct { + MaxMajor int + MaxMinor int + MinMajor int + MinMinor int +} + +// GetSupportedMicroversions returns the minimum and maximum microversion that is supported by the ServiceClient Endpoint. +func GetSupportedMicroversions(ctx context.Context, client *gophercloud.ServiceClient) (SupportedMicroversions, error) { + type valueResp struct { + ID string `json:"id"` + Status string `json:"status"` + Version string `json:"version"` + MinVersion string `json:"min_version"` + } + + type response struct { + Version valueResp `json:"version"` + Versions []valueResp `json:"versions"` + } + var minVersion, maxVersion string + var supportedMicroversions SupportedMicroversions + var resp response + _, err := client.Get(ctx, client.Endpoint, &resp, &gophercloud.RequestOpts{ + OkCodes: []int{200, 300}, + }) + + if err != nil { + return supportedMicroversions, err + } + + if len(resp.Versions) > 0 { + // We are dealing with an unversioned endpoint + // We only handle the case when there is exactly one, and assume it is the correct one + if len(resp.Versions) > 1 { + return supportedMicroversions, fmt.Errorf("unversioned endpoint with multiple alternatives not supported") + } + minVersion = resp.Versions[0].MinVersion + maxVersion = resp.Versions[0].Version + } else { + minVersion = resp.Version.MinVersion + maxVersion = resp.Version.Version + } + + // Return early if the endpoint does not support microversions + if minVersion == "" && maxVersion == "" { + return supportedMicroversions, fmt.Errorf("microversions not supported by ServiceClient Endpoint") + } + + supportedMicroversions.MinMajor, supportedMicroversions.MinMinor, err = ParseMicroversion(minVersion) + if err != nil { + return supportedMicroversions, err + } + + supportedMicroversions.MaxMajor, supportedMicroversions.MaxMinor, err = ParseMicroversion(maxVersion) + if err != nil { + return supportedMicroversions, err + } + + return supportedMicroversions, nil +} + +// RequireMicroversion checks that the required microversion is supported and +// returns a ServiceClient with the microversion set. +func RequireMicroversion(ctx context.Context, client gophercloud.ServiceClient, required string) (gophercloud.ServiceClient, error) { + supportedMicroversions, err := GetSupportedMicroversions(ctx, &client) + if err != nil { + return client, fmt.Errorf("unable to determine supported microversions: %w", err) + } + supported, err := supportedMicroversions.IsSupported(required) + if err != nil { + return client, err + } + if !supported { + return client, fmt.Errorf("microversion %s not supported. Supported versions: %v", required, supportedMicroversions) + } + client.Microversion = required + return client, nil +} + +// IsSupported checks if a microversion falls in the supported interval. +// It returns true if the version is within the interval and false otherwise. +func (supported SupportedMicroversions) IsSupported(version string) (bool, error) { + // Parse the version X.Y into X and Y integers that are easier to compare. + vMajor, vMinor, err := ParseMicroversion(version) + if err != nil { + return false, err + } + + // Check that the major version number is supported. + if (vMajor < supported.MinMajor) || (vMajor > supported.MaxMajor) { + return false, nil + } + + // Check that the minor version number is supported + if (vMinor <= supported.MaxMinor) && (vMinor >= supported.MinMinor) { + return true, nil + } + + return false, nil +} + +// ParseMicroversion parses the version major.minor into separate integers major and minor. +// For example, "2.53" becomes 2 and 53. +func ParseMicroversion(version string) (major int, minor int, err error) { + parts := strings.Split(version, ".") + if len(parts) != 2 { + return 0, 0, fmt.Errorf("invalid microversion format: %q", version) + } + major, err = strconv.Atoi(parts[0]) + if err != nil { + return 0, 0, err + } + minor, err = strconv.Atoi(parts[1]) + if err != nil { + return 0, 0, err + } + return major, minor, nil +} diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/pagination/http.go b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/pagination/http.go similarity index 76% rename from legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/pagination/http.go rename to legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/pagination/http.go index 7845cda13..cf188b89b 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/pagination/http.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/pagination/http.go @@ -1,13 +1,14 @@ package pagination import ( + "context" "encoding/json" - "io/ioutil" + "io" "net/http" "net/url" "strings" - "github.com/gophercloud/gophercloud" + "github.com/gophercloud/gophercloud/v2" ) // PageResult stores the HTTP response that returned the current page of results. @@ -19,10 +20,10 @@ type PageResult struct { // PageResultFrom parses an HTTP response as JSON and returns a PageResult containing the // results, interpreting it as JSON if the content type indicates. func PageResultFrom(resp *http.Response) (PageResult, error) { - var parsedBody interface{} + var parsedBody any defer resp.Body.Close() - rawBody, err := ioutil.ReadAll(resp.Body) + rawBody, err := io.ReadAll(resp.Body) if err != nil { return PageResult{}, err } @@ -41,7 +42,7 @@ func PageResultFrom(resp *http.Response) (PageResult, error) { // PageResultFromParsed constructs a PageResult from an HTTP response that has already had its // body parsed as JSON (and closed). -func PageResultFromParsed(resp *http.Response, body interface{}) PageResult { +func PageResultFromParsed(resp *http.Response, body any) PageResult { return PageResult{ Result: gophercloud.Result{ Body: body, @@ -53,8 +54,8 @@ func PageResultFromParsed(resp *http.Response, body interface{}) PageResult { } // Request performs an HTTP request and extracts the http.Response from the result. -func Request(client *gophercloud.ServiceClient, headers map[string]string, url string) (*http.Response, error) { - return client.Get(url, nil, &gophercloud.RequestOpts{ +func Request(ctx context.Context, client *gophercloud.ServiceClient, headers map[string]string, url string) (*http.Response, error) { + return client.Get(ctx, url, nil, &gophercloud.RequestOpts{ MoreHeaders: headers, OkCodes: []int{200, 204, 300}, KeepResponseBody: true, diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/pagination/linked.go b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/pagination/linked.go similarity index 85% rename from legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/pagination/linked.go rename to legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/pagination/linked.go index a664e0567..7e4de4f7a 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/pagination/linked.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/pagination/linked.go @@ -4,7 +4,7 @@ import ( "fmt" "reflect" - "github.com/gophercloud/gophercloud" + "github.com/gophercloud/gophercloud/v2" ) // LinkedPageBase may be embedded to implement a page that provides navigational "Next" and "Previous" links within its result. @@ -31,10 +31,10 @@ func (current LinkedPageBase) NextPageURL() (string, error) { path = current.LinkPath } - submap, ok := current.Body.(map[string]interface{}) + submap, ok := current.Body.(map[string]any) if !ok { err := gophercloud.ErrUnexpectedType{} - err.Expected = "map[string]interface{}" + err.Expected = "map[string]any" err.Actual = fmt.Sprintf("%v", reflect.TypeOf(current.Body)) return "", err } @@ -48,10 +48,10 @@ func (current LinkedPageBase) NextPageURL() (string, error) { } if len(path) > 0 { - submap, ok = value.(map[string]interface{}) + submap, ok = value.(map[string]any) if !ok { err := gophercloud.ErrUnexpectedType{} - err.Expected = "map[string]interface{}" + err.Expected = "map[string]any" err.Actual = fmt.Sprintf("%v", reflect.TypeOf(value)) return "", err } @@ -76,17 +76,17 @@ func (current LinkedPageBase) NextPageURL() (string, error) { // IsEmpty satisifies the IsEmpty method of the Page interface func (current LinkedPageBase) IsEmpty() (bool, error) { - if b, ok := current.Body.([]interface{}); ok { + if b, ok := current.Body.([]any); ok { return len(b) == 0, nil } err := gophercloud.ErrUnexpectedType{} - err.Expected = "[]interface{}" + err.Expected = "[]any" err.Actual = fmt.Sprintf("%v", reflect.TypeOf(current.Body)) return true, err } // GetBody returns the linked page's body. This method is needed to satisfy the // Page interface. -func (current LinkedPageBase) GetBody() interface{} { +func (current LinkedPageBase) GetBody() any { return current.Body } diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/pagination/marker.go b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/pagination/marker.go similarity index 88% rename from legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/pagination/marker.go rename to legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/pagination/marker.go index 52e53bae8..1d101fe2d 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/pagination/marker.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/pagination/marker.go @@ -4,7 +4,7 @@ import ( "fmt" "reflect" - "github.com/gophercloud/gophercloud" + "github.com/gophercloud/gophercloud/v2" ) // MarkerPage is a stricter Page interface that describes additional functionality required for use with NewMarkerPager. @@ -42,17 +42,17 @@ func (current MarkerPageBase) NextPageURL() (string, error) { // IsEmpty satisifies the IsEmpty method of the Page interface func (current MarkerPageBase) IsEmpty() (bool, error) { - if b, ok := current.Body.([]interface{}); ok { + if b, ok := current.Body.([]any); ok { return len(b) == 0, nil } err := gophercloud.ErrUnexpectedType{} - err.Expected = "[]interface{}" + err.Expected = "[]any" err.Actual = fmt.Sprintf("%v", reflect.TypeOf(current.Body)) return true, err } // GetBody returns the linked page's body. This method is needed to satisfy the // Page interface. -func (current MarkerPageBase) GetBody() interface{} { +func (current MarkerPageBase) GetBody() any { return current.Body } diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/pagination/pager.go b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/pagination/pager.go similarity index 83% rename from legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/pagination/pager.go rename to legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/pagination/pager.go index 1dec2703e..358101256 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/pagination/pager.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/pagination/pager.go @@ -1,13 +1,14 @@ package pagination import ( + "context" "errors" "fmt" "net/http" "reflect" "strings" - "github.com/gophercloud/gophercloud" + "github.com/gophercloud/gophercloud/v2" ) var ( @@ -30,7 +31,7 @@ type Page interface { IsEmpty() (bool, error) // GetBody returns the Page Body. This is used in the `AllPages` method. - GetBody() interface{} + GetBody() any } // Pager knows how to advance through a specific resource collection, one page at a time. @@ -69,8 +70,8 @@ func (p Pager) WithPageCreator(createPage func(r PageResult) Page) Pager { } } -func (p Pager) fetchNextPage(url string) (Page, error) { - resp, err := Request(p.client, p.Headers, url) +func (p Pager) fetchNextPage(ctx context.Context, url string) (Page, error) { + resp, err := Request(ctx, p.client, p.Headers, url) if err != nil { return nil, err } @@ -83,9 +84,10 @@ func (p Pager) fetchNextPage(url string) (Page, error) { return p.createPage(remembered), nil } -// EachPage iterates over each page returned by a Pager, yielding one at a time to a handler function. -// Return "false" from the handler to prematurely stop iterating. -func (p Pager) EachPage(handler func(Page) (bool, error)) error { +// EachPage iterates over each page returned by a Pager, yielding one at a time +// to a handler function. Return "false" from the handler to prematurely stop +// iterating. +func (p Pager) EachPage(ctx context.Context, handler func(context.Context, Page) (bool, error)) error { if p.Err != nil { return p.Err } @@ -99,7 +101,7 @@ func (p Pager) EachPage(handler func(Page) (bool, error)) error { p.firstPage = nil } else { var err error - currentPage, err = p.fetchNextPage(currentURL) + currentPage, err = p.fetchNextPage(ctx, currentURL) if err != nil { return err } @@ -113,7 +115,7 @@ func (p Pager) EachPage(handler func(Page) (bool, error)) error { return nil } - ok, err := handler(currentPage) + ok, err := handler(ctx, currentPage) if err != nil { return err } @@ -133,17 +135,17 @@ func (p Pager) EachPage(handler func(Page) (bool, error)) error { // AllPages returns all the pages from a `List` operation in a single page, // allowing the user to retrieve all the pages at once. -func (p Pager) AllPages() (Page, error) { +func (p Pager) AllPages(ctx context.Context) (Page, error) { if p.Err != nil { return nil, p.Err } // pagesSlice holds all the pages until they get converted into as Page Body. - var pagesSlice []interface{} + var pagesSlice []any // body will contain the final concatenated Page body. var body reflect.Value // Grab a first page to ascertain the page body type. - firstPage, err := p.fetchNextPage(p.initialURL) + firstPage, err := p.fetchNextPage(ctx, p.initialURL) if err != nil { return nil, err } @@ -159,21 +161,21 @@ func (p Pager) AllPages() (Page, error) { // store the first page to avoid getting it twice p.firstPage = firstPage - // Switch on the page body type. Recognized types are `map[string]interface{}`, - // `[]byte`, and `[]interface{}`. + // Switch on the page body type. Recognized types are `map[string]any`, + // `[]byte`, and `[]any`. switch pb := firstPage.GetBody().(type) { - case map[string]interface{}: - // key is the map key for the page body if the body type is `map[string]interface{}`. + case map[string]any: + // key is the map key for the page body if the body type is `map[string]any`. var key string // Iterate over the pages to concatenate the bodies. - err = p.EachPage(func(page Page) (bool, error) { - b := page.GetBody().(map[string]interface{}) + err = p.EachPage(ctx, func(_ context.Context, page Page) (bool, error) { + b := page.GetBody().(map[string]any) for k, v := range b { // If it's a linked page, we don't want the `links`, we want the other one. if !strings.HasSuffix(k, "links") { - // check the field's type. we only want []interface{} (which is really []map[string]interface{}) + // check the field's type. we only want []any (which is really []map[string]any) switch vt := v.(type) { - case []interface{}: + case []any: key = k pagesSlice = append(pagesSlice, vt...) } @@ -184,12 +186,12 @@ func (p Pager) AllPages() (Page, error) { if err != nil { return nil, err } - // Set body to value of type `map[string]interface{}` + // Set body to value of type `map[string]any` body = reflect.MakeMap(reflect.MapOf(reflect.TypeOf(key), reflect.TypeOf(pagesSlice))) body.SetMapIndex(reflect.ValueOf(key), reflect.ValueOf(pagesSlice)) case []byte: // Iterate over the pages to concatenate the bodies. - err = p.EachPage(func(page Page) (bool, error) { + err = p.EachPage(ctx, func(_ context.Context, page Page) (bool, error) { b := page.GetBody().([]byte) pagesSlice = append(pagesSlice, b) // seperate pages with a comma @@ -211,24 +213,24 @@ func (p Pager) AllPages() (Page, error) { // Set body to value of type `bytes`. body = reflect.New(reflect.TypeOf(b)).Elem() body.SetBytes(b) - case []interface{}: + case []any: // Iterate over the pages to concatenate the bodies. - err = p.EachPage(func(page Page) (bool, error) { - b := page.GetBody().([]interface{}) + err = p.EachPage(ctx, func(_ context.Context, page Page) (bool, error) { + b := page.GetBody().([]any) pagesSlice = append(pagesSlice, b...) return true, nil }) if err != nil { return nil, err } - // Set body to value of type `[]interface{}` + // Set body to value of type `[]any` body = reflect.MakeSlice(reflect.TypeOf(pagesSlice), len(pagesSlice), len(pagesSlice)) for i, s := range pagesSlice { body.Index(i).Set(reflect.ValueOf(s)) } default: err := gophercloud.ErrUnexpectedType{} - err.Expected = "map[string]interface{}/[]byte/[]interface{}" + err.Expected = "map[string]any/[]byte/[]any" err.Actual = fmt.Sprintf("%T", pb) return nil, err } diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/pagination/pkg.go b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/pagination/pkg.go similarity index 100% rename from legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/pagination/pkg.go rename to legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/pagination/pkg.go diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/pagination/single.go b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/pagination/single.go similarity index 81% rename from legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/pagination/single.go rename to legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/pagination/single.go index 4251d6491..416621121 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/pagination/single.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/pagination/single.go @@ -4,7 +4,7 @@ import ( "fmt" "reflect" - "github.com/gophercloud/gophercloud" + "github.com/gophercloud/gophercloud/v2" ) // SinglePageBase may be embedded in a Page that contains all of the results from an operation at once. @@ -17,17 +17,17 @@ func (current SinglePageBase) NextPageURL() (string, error) { // IsEmpty satisifies the IsEmpty method of the Page interface func (current SinglePageBase) IsEmpty() (bool, error) { - if b, ok := current.Body.([]interface{}); ok { + if b, ok := current.Body.([]any); ok { return len(b) == 0, nil } err := gophercloud.ErrUnexpectedType{} - err.Expected = "[]interface{}" + err.Expected = "[]any" err.Actual = fmt.Sprintf("%v", reflect.TypeOf(current.Body)) return true, err } // GetBody returns the single page's body. This method is needed to satisfy the // Page interface. -func (current SinglePageBase) GetBody() interface{} { +func (current SinglePageBase) GetBody() any { return current.Body } diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/params.go b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/params.go similarity index 97% rename from legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/params.go rename to legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/params.go index 5abc2c558..09b322a6a 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/params.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/params.go @@ -32,7 +32,7 @@ BuildRequestBody is used within Gophercloud to more fully understand how it fits within the request process as a whole rather than use it directly as shown above. */ -func BuildRequestBody(opts interface{}, parent string) (map[string]interface{}, error) { +func BuildRequestBody(opts any, parent string) (map[string]any, error) { optsValue := reflect.ValueOf(opts) if optsValue.Kind() == reflect.Ptr { optsValue = optsValue.Elem() @@ -43,7 +43,7 @@ func BuildRequestBody(opts interface{}, parent string) (map[string]interface{}, optsType = optsType.Elem() } - optsMap := make(map[string]interface{}) + optsMap := make(map[string]any) if optsValue.Kind() == reflect.Struct { //fmt.Printf("optsValue.Kind() is a reflect.Struct: %+v\n", optsValue.Kind()) for i := 0; i < optsValue.NumField(); i++ { @@ -180,7 +180,7 @@ func BuildRequestBody(opts interface{}, parent string) (map[string]interface{}, //fmt.Printf("optsMap: %+v\n", optsMap) if parent != "" { - optsMap = map[string]interface{}{parent: optsMap} + optsMap = map[string]any{parent: optsMap} } //fmt.Printf("optsMap after parent added: %+v\n", optsMap) return optsMap, nil @@ -282,10 +282,7 @@ func isZero(v reflect.Value) bool { return z case reflect.Struct: if v.Type() == reflect.TypeOf(t) { - if v.Interface().(time.Time).IsZero() { - return true - } - return false + return v.Interface().(time.Time).IsZero() } z := true for i := 0; i < v.NumField(); i++ { @@ -328,7 +325,7 @@ Slice are handled in one of two ways: Baz []int `q:"baz" format="comma-separated"` // E.g. ?baz=1,2 } */ -func BuildQueryString(opts interface{}) (*url.URL, error) { +func BuildQueryString(opts any) (*url.URL, error) { optsValue := reflect.ValueOf(opts) if optsValue.Kind() == reflect.Ptr { optsValue = optsValue.Elem() @@ -434,7 +431,7 @@ will be converted into: Untagged fields and fields left at their zero values are skipped. Integers, booleans and string values are supported. */ -func BuildHeaders(opts interface{}) (map[string]string, error) { +func BuildHeaders(opts any) (map[string]string, error) { optsValue := reflect.ValueOf(opts) if optsValue.Kind() == reflect.Ptr { optsValue = optsValue.Elem() diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/provider_client.go b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/provider_client.go similarity index 79% rename from legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/provider_client.go rename to legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/provider_client.go index 5b9381b9b..a4a8dce51 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/provider_client.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/provider_client.go @@ -6,7 +6,6 @@ import ( "encoding/json" "errors" "io" - "io/ioutil" "net/http" "strings" "sync" @@ -14,7 +13,7 @@ import ( // DefaultUserAgent is the default User-Agent string set in the request header. const ( - DefaultUserAgent = "gophercloud/v1.13.0" + DefaultUserAgent = "gophercloud/v2.1.0" DefaultMaxBackoffRetries = 60 ) @@ -82,15 +81,12 @@ type ProviderClient struct { // ReauthFunc is the function used to re-authenticate the user if the request // fails with a 401 HTTP response code. This a needed because there may be multiple // authentication functions for different Identity service versions. - ReauthFunc func() error + ReauthFunc func(context.Context) error // Throwaway determines whether if this client is a throw-away client. It's a copy of user's provider client // with the token and reauth func zeroed. Such client can be used to perform reauthorization. Throwaway bool - // Context is the context passed to the HTTP request. - Context context.Context - // Retry backoff func is called when rate limited. RetryBackoffFunc RetryBackoffFunc @@ -269,13 +265,13 @@ func (client *ProviderClient) SetThrowaway(v bool) { // this case, the reauthentication can be skipped if another thread has already // reauthenticated in the meantime. If no previous token is known, an empty // string should be passed instead to force unconditional reauthentication. -func (client *ProviderClient) Reauthenticate(previousToken string) error { +func (client *ProviderClient) Reauthenticate(ctx context.Context, previousToken string) error { if client.ReauthFunc == nil { return nil } if client.reauthmut == nil { - return client.ReauthFunc() + return client.ReauthFunc(ctx) } future := newReauthFuture() @@ -296,7 +292,7 @@ func (client *ProviderClient) Reauthenticate(previousToken string) error { // Perform the actual reauthentication. var err error if previousToken == "" || client.TokenID == previousToken { - err = client.ReauthFunc() + err = client.ReauthFunc(ctx) } else { err = nil } @@ -315,13 +311,13 @@ type RequestOpts struct { // JSONBody, if provided, will be encoded as JSON and used as the body of the HTTP request. The // content type of the request will default to "application/json" unless overridden by MoreHeaders. // It's an error to specify both a JSONBody and a RawBody. - JSONBody interface{} + JSONBody any // RawBody contains an io.Reader that will be consumed by the request directly. No content-type // will be set unless one is provided explicitly by MoreHeaders. RawBody io.Reader // JSONResponse, if provided, will be populated with the contents of the response body parsed as // JSON. - JSONResponse interface{} + JSONResponse any // OkCodes contains a list of numeric HTTP status codes that should be interpreted as success. If // the response has a different code, an error will be returned. OkCodes []int @@ -331,9 +327,6 @@ type RequestOpts struct { // OmitHeaders specifies the HTTP headers which should be omitted. // OmitHeaders will override MoreHeaders OmitHeaders []string - // ErrorContext specifies the resource error type to return if an error is encountered. - // This lets resources override default error messages based on the response status code. - ErrorContext error // KeepResponseBody specifies whether to keep the HTTP response body. Usually used, when the HTTP // response body is considered for further use. Valid when JSONResponse is nil. KeepResponseBody bool @@ -352,15 +345,15 @@ type requestState struct { var applicationJSON = "application/json" -// Request performs an HTTP request using the ProviderClient's current HTTPClient. An authentication -// header will automatically be provided. -func (client *ProviderClient) Request(method, url string, options *RequestOpts) (*http.Response, error) { - return client.doRequest(method, url, options, &requestState{ +// Request performs an HTTP request using the ProviderClient's +// current HTTPClient. An authentication header will automatically be provided. +func (client *ProviderClient) Request(ctx context.Context, method, url string, options *RequestOpts) (*http.Response, error) { + return client.doRequest(ctx, method, url, options, &requestState{ hasReauthenticated: false, }) } -func (client *ProviderClient) doRequest(method, url string, options *RequestOpts, state *requestState) (*http.Response, error) { +func (client *ProviderClient) doRequest(ctx context.Context, method, url string, options *RequestOpts, state *requestState) (*http.Response, error) { var body io.Reader var contentType *string @@ -389,14 +382,10 @@ func (client *ProviderClient) doRequest(method, url string, options *RequestOpts body = options.RawBody } - // Construct the http.Request. - req, err := http.NewRequest(method, url, body) + req, err := http.NewRequestWithContext(ctx, method, url, body) if err != nil { return nil, err } - if client.Context != nil { - req = req.WithContext(client.Context) - } // Populate the request headers. // Apply options.MoreHeaders and options.OmitHeaders, to give the caller the chance to @@ -432,12 +421,12 @@ func (client *ProviderClient) doRequest(method, url string, options *RequestOpts if client.RetryFunc != nil { var e error state.retries = state.retries + 1 - e = client.RetryFunc(client.Context, method, url, options, err, state.retries) + e = client.RetryFunc(ctx, method, url, options, err, state.retries) if e != nil { return nil, e } - return client.doRequest(method, url, options, state) + return client.doRequest(ctx, method, url, options, state) } return nil, err } @@ -458,7 +447,7 @@ func (client *ProviderClient) doRequest(method, url string, options *RequestOpts } if !ok { - body, _ := ioutil.ReadAll(resp.Body) + body, _ := io.ReadAll(resp.Body) resp.Body.Close() respErr := ErrUnexpectedResponseCode{ URL: url, @@ -469,16 +458,10 @@ func (client *ProviderClient) doRequest(method, url string, options *RequestOpts ResponseHeader: resp.Header, } - errType := options.ErrorContext switch resp.StatusCode { - case http.StatusBadRequest: - err = ErrDefault400{respErr} - if error400er, ok := errType.(Err400er); ok { - err = error400er.Error400(respErr) - } case http.StatusUnauthorized: if client.ReauthFunc != nil && !state.hasReauthenticated { - err = client.Reauthenticate(prereqtok) + err = client.Reauthenticate(ctx, prereqtok) if err != nil { e := &ErrUnableToReauthenticate{} e.ErrOriginal = respErr @@ -487,60 +470,28 @@ func (client *ProviderClient) doRequest(method, url string, options *RequestOpts } if options.RawBody != nil { if seeker, ok := options.RawBody.(io.Seeker); ok { - seeker.Seek(0, 0) + if _, err := seeker.Seek(0, 0); err != nil { + return nil, err + } } } state.hasReauthenticated = true - resp, err = client.doRequest(method, url, options, state) + resp, err = client.doRequest(ctx, method, url, options, state) if err != nil { - switch err.(type) { + switch e := err.(type) { case *ErrUnexpectedResponseCode: - e := &ErrErrorAfterReauthentication{} - e.ErrOriginal = err.(*ErrUnexpectedResponseCode) - return nil, e + err := &ErrErrorAfterReauthentication{} + err.ErrOriginal = e + return nil, err default: - e := &ErrErrorAfterReauthentication{} - e.ErrOriginal = err - return nil, e + err := &ErrErrorAfterReauthentication{} + err.ErrOriginal = e + return nil, err } } return resp, nil } - err = ErrDefault401{respErr} - if error401er, ok := errType.(Err401er); ok { - err = error401er.Error401(respErr) - } - case http.StatusForbidden: - err = ErrDefault403{respErr} - if error403er, ok := errType.(Err403er); ok { - err = error403er.Error403(respErr) - } - case http.StatusNotFound: - err = ErrDefault404{respErr} - if error404er, ok := errType.(Err404er); ok { - err = error404er.Error404(respErr) - } - case http.StatusMethodNotAllowed: - err = ErrDefault405{respErr} - if error405er, ok := errType.(Err405er); ok { - err = error405er.Error405(respErr) - } - case http.StatusRequestTimeout: - err = ErrDefault408{respErr} - if error408er, ok := errType.(Err408er); ok { - err = error408er.Error408(respErr) - } - case http.StatusConflict: - err = ErrDefault409{respErr} - if error409er, ok := errType.(Err409er); ok { - err = error409er.Error409(respErr) - } case http.StatusTooManyRequests, 498: - err = ErrDefault429{respErr} - if error429er, ok := errType.(Err429er); ok { - err = error429er.Error429(respErr) - } - maxTries := client.MaxBackoffRetries if maxTries == 0 { maxTries = DefaultMaxBackoffRetries @@ -550,33 +501,13 @@ func (client *ProviderClient) doRequest(method, url string, options *RequestOpts var e error state.retries = state.retries + 1 - e = f(client.Context, &respErr, err, state.retries) + e = f(ctx, &respErr, err, state.retries) if e != nil { return resp, e } - return client.doRequest(method, url, options, state) - } - case http.StatusInternalServerError: - err = ErrDefault500{respErr} - if error500er, ok := errType.(Err500er); ok { - err = error500er.Error500(respErr) - } - case http.StatusBadGateway: - err = ErrDefault502{respErr} - if error502er, ok := errType.(Err502er); ok { - err = error502er.Error502(respErr) - } - case http.StatusServiceUnavailable: - err = ErrDefault503{respErr} - if error503er, ok := errType.(Err503er); ok { - err = error503er.Error503(respErr) - } - case http.StatusGatewayTimeout: - err = ErrDefault504{respErr} - if error504er, ok := errType.(Err504er); ok { - err = error504er.Error504(respErr) + return client.doRequest(ctx, method, url, options, state) } } @@ -587,12 +518,12 @@ func (client *ProviderClient) doRequest(method, url string, options *RequestOpts if err != nil && client.RetryFunc != nil { var e error state.retries = state.retries + 1 - e = client.RetryFunc(client.Context, method, url, options, err, state.retries) + e = client.RetryFunc(ctx, method, url, options, err, state.retries) if e != nil { return resp, e } - return client.doRequest(method, url, options, state) + return client.doRequest(ctx, method, url, options, state) } return resp, err @@ -604,19 +535,19 @@ func (client *ProviderClient) doRequest(method, url string, options *RequestOpts // Don't decode JSON when there is no content if resp.StatusCode == http.StatusNoContent { // read till EOF, otherwise the connection will be closed and cannot be reused - _, err = io.Copy(ioutil.Discard, resp.Body) + _, err = io.Copy(io.Discard, resp.Body) return resp, err } if err := json.NewDecoder(resp.Body).Decode(options.JSONResponse); err != nil { if client.RetryFunc != nil { var e error state.retries = state.retries + 1 - e = client.RetryFunc(client.Context, method, url, options, err, state.retries) + e = client.RetryFunc(ctx, method, url, options, err, state.retries) if e != nil { return resp, e } - return client.doRequest(method, url, options, state) + return client.doRequest(ctx, method, url, options, state) } return nil, err } @@ -626,7 +557,7 @@ func (client *ProviderClient) doRequest(method, url string, options *RequestOpts if !options.KeepResponseBody && options.JSONResponse == nil { defer resp.Body.Close() // read till EOF, otherwise the connection will be closed and cannot be reused - if _, err := io.Copy(ioutil.Discard, resp.Body); err != nil { + if _, err := io.Copy(io.Discard, resp.Body); err != nil { return nil, err } } diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/results.go b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/results.go similarity index 96% rename from legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/results.go rename to legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/results.go index b3ee9d568..9e6f630ab 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/results.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/results.go @@ -28,7 +28,7 @@ provider- or extension-specific information as well. type Result struct { // Body is the payload of the HTTP response from the server. In most cases, // this will be the deserialized JSON structure. - Body interface{} + Body any // StatusCode is the HTTP status code of the original response. Will be // one of the OkCodes defined on the gophercloud.RequestOpts that was @@ -46,7 +46,7 @@ type Result struct { // ExtractInto allows users to provide an object into which `Extract` will extract // the `Result.Body`. This would be useful for OpenStack providers that have // different fields in the response object than OpenStack proper. -func (r Result) ExtractInto(to interface{}) error { +func (r Result) ExtractInto(to any) error { if r.Err != nil { return r.Err } @@ -67,12 +67,12 @@ func (r Result) ExtractInto(to interface{}) error { return err } -func (r Result) extractIntoPtr(to interface{}, label string) error { +func (r Result) extractIntoPtr(to any, label string) error { if label == "" { return r.ExtractInto(&to) } - var m map[string]interface{} + var m map[string]any err := r.ExtractInto(&m) if err != nil { return err @@ -95,7 +95,7 @@ func (r Result) extractIntoPtr(to interface{}, label string) error { if typeOfV.NumField() > 0 && typeOfV.Field(0).Anonymous { newSlice := reflect.MakeSlice(reflect.SliceOf(typeOfV), 0, 0) - if mSlice, ok := m[label].([]interface{}); ok { + if mSlice, ok := m[label].([]any); ok { for _, v := range mSlice { // For each iteration of the slice, we create a new struct. // This is to work around a bug where elements of a slice @@ -171,7 +171,7 @@ func (r Result) extractIntoPtr(to interface{}, label string) error { } // ExtractIntoStructPtr will unmarshal the Result (r) into the provided -// interface{} (to). +// any (to). // // NOTE: For internal use only // @@ -179,7 +179,7 @@ func (r Result) extractIntoPtr(to interface{}, label string) error { // // If provided, `label` will be filtered out of the response // body prior to `r` being unmarshalled into `to`. -func (r Result) ExtractIntoStructPtr(to interface{}, label string) error { +func (r Result) ExtractIntoStructPtr(to any, label string) error { if r.Err != nil { return r.Err } @@ -197,7 +197,7 @@ func (r Result) ExtractIntoStructPtr(to interface{}, label string) error { } // ExtractIntoSlicePtr will unmarshal the Result (r) into the provided -// interface{} (to). +// any (to). // // NOTE: For internal use only // @@ -205,7 +205,7 @@ func (r Result) ExtractIntoStructPtr(to interface{}, label string) error { // // If provided, `label` will be filtered out of the response // body prior to `r` being unmarshalled into `to`. -func (r Result) ExtractIntoSlicePtr(to interface{}, label string) error { +func (r Result) ExtractIntoSlicePtr(to any, label string) error { if r.Err != nil { return r.Err } @@ -267,7 +267,7 @@ type HeaderResult struct { // ExtractInto allows users to provide an object into which `Extract` will // extract the http.Header headers of the result. -func (r HeaderResult) ExtractInto(to interface{}) error { +func (r HeaderResult) ExtractInto(to any) error { if r.Err != nil { return r.Err } diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/service_client.go b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/service_client.go similarity index 75% rename from legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/service_client.go rename to legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/service_client.go index 94a161e34..11b80108c 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/service_client.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/service_client.go @@ -1,6 +1,7 @@ package gophercloud import ( + "context" "io" "net/http" "strings" @@ -47,7 +48,7 @@ func (client *ServiceClient) ServiceURL(parts ...string) string { return client.ResourceBaseURL() + strings.Join(parts, "/") } -func (client *ServiceClient) initReqOpts(JSONBody interface{}, JSONResponse interface{}, opts *RequestOpts) { +func (client *ServiceClient) initReqOpts(JSONBody any, JSONResponse any, opts *RequestOpts) { if v, ok := (JSONBody).(io.Reader); ok { opts.RawBody = v } else if JSONBody != nil { @@ -60,57 +61,57 @@ func (client *ServiceClient) initReqOpts(JSONBody interface{}, JSONResponse inte } // Get calls `Request` with the "GET" HTTP verb. -func (client *ServiceClient) Get(url string, JSONResponse interface{}, opts *RequestOpts) (*http.Response, error) { +func (client *ServiceClient) Get(ctx context.Context, url string, JSONResponse any, opts *RequestOpts) (*http.Response, error) { if opts == nil { opts = new(RequestOpts) } client.initReqOpts(nil, JSONResponse, opts) - return client.Request("GET", url, opts) + return client.Request(ctx, "GET", url, opts) } // Post calls `Request` with the "POST" HTTP verb. -func (client *ServiceClient) Post(url string, JSONBody interface{}, JSONResponse interface{}, opts *RequestOpts) (*http.Response, error) { +func (client *ServiceClient) Post(ctx context.Context, url string, JSONBody any, JSONResponse any, opts *RequestOpts) (*http.Response, error) { if opts == nil { opts = new(RequestOpts) } client.initReqOpts(JSONBody, JSONResponse, opts) - return client.Request("POST", url, opts) + return client.Request(ctx, "POST", url, opts) } // Put calls `Request` with the "PUT" HTTP verb. -func (client *ServiceClient) Put(url string, JSONBody interface{}, JSONResponse interface{}, opts *RequestOpts) (*http.Response, error) { +func (client *ServiceClient) Put(ctx context.Context, url string, JSONBody any, JSONResponse any, opts *RequestOpts) (*http.Response, error) { if opts == nil { opts = new(RequestOpts) } client.initReqOpts(JSONBody, JSONResponse, opts) - return client.Request("PUT", url, opts) + return client.Request(ctx, "PUT", url, opts) } // Patch calls `Request` with the "PATCH" HTTP verb. -func (client *ServiceClient) Patch(url string, JSONBody interface{}, JSONResponse interface{}, opts *RequestOpts) (*http.Response, error) { +func (client *ServiceClient) Patch(ctx context.Context, url string, JSONBody any, JSONResponse any, opts *RequestOpts) (*http.Response, error) { if opts == nil { opts = new(RequestOpts) } client.initReqOpts(JSONBody, JSONResponse, opts) - return client.Request("PATCH", url, opts) + return client.Request(ctx, "PATCH", url, opts) } // Delete calls `Request` with the "DELETE" HTTP verb. -func (client *ServiceClient) Delete(url string, opts *RequestOpts) (*http.Response, error) { +func (client *ServiceClient) Delete(ctx context.Context, url string, opts *RequestOpts) (*http.Response, error) { if opts == nil { opts = new(RequestOpts) } client.initReqOpts(nil, nil, opts) - return client.Request("DELETE", url, opts) + return client.Request(ctx, "DELETE", url, opts) } // Head calls `Request` with the "HEAD" HTTP verb. -func (client *ServiceClient) Head(url string, opts *RequestOpts) (*http.Response, error) { +func (client *ServiceClient) Head(ctx context.Context, url string, opts *RequestOpts) (*http.Response, error) { if opts == nil { opts = new(RequestOpts) } client.initReqOpts(nil, nil, opts) - return client.Request("HEAD", url, opts) + return client.Request(ctx, "HEAD", url, opts) } func (client *ServiceClient) setMicroversionHeader(opts *RequestOpts) { @@ -133,7 +134,7 @@ func (client *ServiceClient) setMicroversionHeader(opts *RequestOpts) { } // Request carries out the HTTP operation for the service client -func (client *ServiceClient) Request(method, url string, options *RequestOpts) (*http.Response, error) { +func (client *ServiceClient) Request(ctx context.Context, method, url string, options *RequestOpts) (*http.Response, error) { if options.MoreHeaders == nil { options.MoreHeaders = make(map[string]string) } @@ -151,7 +152,7 @@ func (client *ServiceClient) Request(method, url string, options *RequestOpts) ( options.MoreHeaders[k] = v } } - return client.ProviderClient.Request(method, url, options) + return client.ProviderClient.Request(ctx, method, url, options) } // ParseResponse is a helper function to parse http.Response to constituents. diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/util.go b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/util.go similarity index 69% rename from legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/util.go rename to legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/util.go index 2740c301e..ad8a7dfaa 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/util.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/gophercloud/v2/util.go @@ -1,7 +1,7 @@ package gophercloud import ( - "fmt" + "context" "net/url" "path/filepath" "reflect" @@ -61,8 +61,8 @@ func NormalizeURL(url string) string { // // This is useful for determining the extra fields returned in response bodies // for resources that can contain an arbitrary or dynamic number of fields. -func RemainingKeys(s interface{}, m map[string]interface{}) (extras map[string]interface{}) { - extras = make(map[string]interface{}) +func RemainingKeys(s any, m map[string]any) (extras map[string]any) { + extras = make(map[string]any) for k, v := range m { extras[k] = v } @@ -83,48 +83,27 @@ func RemainingKeys(s interface{}, m map[string]interface{}) (extras map[string]i return } -// WaitFor polls a predicate function, once per second, up to a timeout limit. +// WaitFor polls a predicate function, once per second, up to a context cancellation. // This is useful to wait for a resource to transition to a certain state. -// To handle situations when the predicate might hang indefinitely, the -// predicate will be prematurely cancelled after the timeout. // Resource packages will wrap this in a more convenient function that's // specific to a certain resource, but it can also be useful on its own. -func WaitFor(timeout int, predicate func() (bool, error)) error { - type WaitForResult struct { - Success bool - Error error +func WaitFor(ctx context.Context, predicate func(context.Context) (bool, error)) error { + if done, err := predicate(ctx); done || err != nil { + return err } - start := time.Now().Unix() + ticker := time.NewTicker(1 * time.Second) + defer ticker.Stop() for { - // If a timeout is set, and that's been exceeded, shut it down. - if timeout >= 0 && time.Now().Unix()-start >= int64(timeout) { - return fmt.Errorf("A timeout occurred") - } - - time.Sleep(1 * time.Second) - - var result WaitForResult - ch := make(chan bool, 1) - go func() { - defer close(ch) - satisfied, err := predicate() - result.Success = satisfied - result.Error = err - }() - select { - case <-ch: - if result.Error != nil { - return result.Error - } - if result.Success { - return nil + case <-ticker.C: + if done, err := predicate(ctx); done || err != nil { + return err } - // If the predicate has not finished by the timeout, cancel it. - case <-time.After(time.Duration(timeout) * time.Second): - return fmt.Errorf("A timeout occurred") + + case <-ctx.Done(): + return ctx.Err() } } } diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/utils/LICENSE b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/utils/v2/LICENSE similarity index 100% rename from legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/utils/LICENSE rename to legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/utils/v2/LICENSE diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/utils/env/env.go b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/utils/v2/env/env.go similarity index 100% rename from legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/utils/env/env.go rename to legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/utils/v2/env/env.go diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/utils/env/env_windows.go b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/utils/v2/env/env_windows.go similarity index 100% rename from legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/utils/env/env_windows.go rename to legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/utils/v2/env/env_windows.go diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/utils/gnocchi/client.go b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/utils/v2/gnocchi/client.go similarity index 94% rename from legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/utils/gnocchi/client.go rename to legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/utils/v2/gnocchi/client.go index 1f73d3932..a8cc0ded4 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/utils/gnocchi/client.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/utils/v2/gnocchi/client.go @@ -1,7 +1,7 @@ package gnocchi import ( - "github.com/gophercloud/gophercloud" + "github.com/gophercloud/gophercloud/v2" ) func initClientOpts(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts, clientType string) (*gophercloud.ServiceClient, error) { diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/utils/gnocchi/results.go b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/utils/v2/gnocchi/results.go similarity index 100% rename from legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/utils/gnocchi/results.go rename to legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/utils/v2/gnocchi/results.go diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/utils/internal/pkg.go b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/utils/v2/internal/pkg.go similarity index 100% rename from legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/utils/internal/pkg.go rename to legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/utils/v2/internal/pkg.go diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/utils/internal/util.go b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/utils/v2/internal/util.go similarity index 100% rename from legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/utils/internal/util.go rename to legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/utils/v2/internal/util.go diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/utils/openstack/clientconfig/doc.go b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/utils/v2/openstack/clientconfig/doc.go similarity index 81% rename from legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/utils/openstack/clientconfig/doc.go rename to legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/utils/v2/openstack/clientconfig/doc.go index d052d090d..3f85b6731 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/utils/openstack/clientconfig/doc.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/utils/v2/openstack/clientconfig/doc.go @@ -10,7 +10,7 @@ Example to Create a Provider Client From clouds.yaml Cloud: "hawaii", } - pClient, err := clientconfig.AuthenticatedClient(opts) + pClient, err := clientconfig.AuthenticatedClient(ctx, opts) if err != nil { panic(err) } @@ -27,7 +27,7 @@ Example to Manually Create a Provider Client }, } - pClient, err := clientconfig.AuthenticatedClient(opts) + pClient, err := clientconfig.AuthenticatedClient(ctx, opts) if err != nil { panic(err) } @@ -38,7 +38,7 @@ Example to Create a Service Client from clouds.yaml Cloud: "hawaii", } - computeClient, err := clientconfig.NewServiceClient("compute", opts) + computeClient, err := clientconfig.NewServiceClient(ctx, "compute", opts) if err != nil { panic(err) } diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/utils/openstack/clientconfig/requests.go b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/utils/v2/openstack/clientconfig/requests.go similarity index 97% rename from legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/utils/openstack/clientconfig/requests.go rename to legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/utils/v2/openstack/clientconfig/requests.go index 7524dffcc..f3347748e 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/utils/openstack/clientconfig/requests.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/utils/v2/openstack/clientconfig/requests.go @@ -1,6 +1,7 @@ package clientconfig import ( + "context" "errors" "fmt" "net/http" @@ -8,14 +9,15 @@ import ( "reflect" "strings" - "github.com/gophercloud/gophercloud" - "github.com/gophercloud/gophercloud/openstack" - "github.com/gophercloud/utils/env" - "github.com/gophercloud/utils/gnocchi" - "github.com/gophercloud/utils/internal" + "github.com/gophercloud/gophercloud/v2" + "github.com/gophercloud/gophercloud/v2/openstack" + "github.com/gophercloud/utils/v2/env" + "github.com/gophercloud/utils/v2/gnocchi" + "github.com/gophercloud/utils/v2/internal" - "github.com/hashicorp/go-uuid" - yaml "gopkg.in/yaml.v2" + "github.com/gofrs/uuid/v5" + + yaml "gopkg.in/yaml.v3" ) // AuthType respresents a valid method of authentication. @@ -330,7 +332,7 @@ func GetCloudFromYAML(opts *ClientOpts) (*Cloud, error) { cloud.Interface = "" - return cloud, nil + return cloud, err } // AuthOptions creates a gophercloud.AuthOptions structure with the @@ -726,17 +728,17 @@ func v3auth(cloud *Cloud, opts *ClientOpts) (*gophercloud.AuthOptions, error) { // AuthenticatedClient is a convenience function to get a new provider client // based on a clouds.yaml entry. -func AuthenticatedClient(opts *ClientOpts) (*gophercloud.ProviderClient, error) { +func AuthenticatedClient(ctx context.Context, opts *ClientOpts) (*gophercloud.ProviderClient, error) { ao, err := AuthOptions(opts) if err != nil { return nil, err } - return openstack.AuthenticatedClient(*ao) + return openstack.AuthenticatedClient(ctx, *ao) } // NewServiceClient is a convenience function to get a new service client. -func NewServiceClient(service string, opts *ClientOpts) (*gophercloud.ServiceClient, error) { +func NewServiceClient(ctx context.Context, service string, opts *ClientOpts) (*gophercloud.ServiceClient, error) { cloud := new(Cloud) // If no opts were passed in, create an empty ClientOpts. @@ -838,7 +840,7 @@ func NewServiceClient(service string, opts *ClientOpts) (*gophercloud.ServiceCli pClient.HTTPClient = http.Client{Transport: transport} } - err = openstack.Authenticate(pClient, *ao) + err = openstack.Authenticate(ctx, pClient, *ao) if err != nil { return nil, err } @@ -889,8 +891,6 @@ func NewServiceClient(service string, opts *ClientOpts) (*gophercloud.ServiceCli return openstack.NewBareMetalV1(pClient, eo) case "baremetal-introspection": return openstack.NewBareMetalIntrospectionV1(pClient, eo) - case "clustering": - return openstack.NewClusteringV1(pClient, eo) case "compute": return openstack.NewComputeV2(pClient, eo) case "container": @@ -918,17 +918,17 @@ func NewServiceClient(service string, opts *ClientOpts) (*gophercloud.ServiceCli return nil, fmt.Errorf("invalid identity API version") } case "image": - return openstack.NewImageServiceV2(pClient, eo) + return openstack.NewImageV2(pClient, eo) case "key-manager": return openstack.NewKeyManagerV1(pClient, eo) case "load-balancer": return openstack.NewLoadBalancerV2(pClient, eo) case "messaging": - clientID, err := uuid.GenerateUUID() + clientID, err := uuid.NewV4() if err != nil { return nil, fmt.Errorf("failed to generate UUID: %w", err) } - return openstack.NewMessagingV2(pClient, clientID, eo) + return openstack.NewMessagingV2(pClient, clientID.String(), eo) case "network": return openstack.NewNetworkV2(pClient, eo) case "object-store": diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/utils/openstack/clientconfig/results.go b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/utils/v2/openstack/clientconfig/results.go similarity index 100% rename from legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/utils/openstack/clientconfig/results.go rename to legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/utils/v2/openstack/clientconfig/results.go diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/utils/openstack/clientconfig/utils.go b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/utils/v2/openstack/clientconfig/utils.go similarity index 97% rename from legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/utils/openstack/clientconfig/utils.go rename to legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/utils/v2/openstack/clientconfig/utils.go index 3082073ab..ec8a77a61 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/utils/openstack/clientconfig/utils.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/utils/v2/openstack/clientconfig/utils.go @@ -9,8 +9,8 @@ import ( "path/filepath" "reflect" - "github.com/gophercloud/gophercloud" - "github.com/gophercloud/utils/env" + "github.com/gophercloud/gophercloud/v2" + "github.com/gophercloud/utils/v2/env" ) // defaultIfEmpty is a helper function to make it cleaner to set default value @@ -46,6 +46,9 @@ func mergeClouds(override, cloud interface{}) (*Cloud, error) { var mergedCloud Cloud mergedInterface := mergeInterfaces(overrideInterface, cloudInterface) mergedJson, err := json.Marshal(mergedInterface) + if err != nil { + return nil, err + } err = json.Unmarshal(mergedJson, &mergedCloud) if err != nil { return nil, err diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/utils/openstack/compute/v2/availabilityzones/utils.go b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/utils/v2/openstack/compute/v2/availabilityzones/utils.go similarity index 61% rename from legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/utils/openstack/compute/v2/availabilityzones/utils.go rename to legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/utils/v2/openstack/compute/v2/availabilityzones/utils.go index a7cb94017..49fc54342 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/utils/openstack/compute/v2/availabilityzones/utils.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/gophercloud/utils/v2/openstack/compute/v2/availabilityzones/utils.go @@ -1,14 +1,16 @@ package availabilityzones import ( - "github.com/gophercloud/gophercloud" - "github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/availabilityzones" + "context" + + "github.com/gophercloud/gophercloud/v2" + "github.com/gophercloud/gophercloud/v2/openstack/compute/v2/availabilityzones" ) // ListAvailableAvailabilityZones is a convenience function that return a slice of available Availability Zones. -func ListAvailableAvailabilityZones(client *gophercloud.ServiceClient) ([]string, error) { +func ListAvailableAvailabilityZones(ctx context.Context, client *gophercloud.ServiceClient) ([]string, error) { var ret []string - allPages, err := availabilityzones.List(client).AllPages() + allPages, err := availabilityzones.List(client).AllPages(ctx) if err != nil { return ret, err } diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/hashicorp/go-uuid/.travis.yml b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/hashicorp/go-uuid/.travis.yml deleted file mode 100644 index 769849071..000000000 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/hashicorp/go-uuid/.travis.yml +++ /dev/null @@ -1,12 +0,0 @@ -language: go - -sudo: false - -go: - - 1.4 - - 1.5 - - 1.6 - - tip - -script: - - go test -bench . -benchmem -v ./... diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/hashicorp/go-uuid/LICENSE b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/hashicorp/go-uuid/LICENSE deleted file mode 100644 index a320b309c..000000000 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/hashicorp/go-uuid/LICENSE +++ /dev/null @@ -1,365 +0,0 @@ -Copyright © 2015-2022 HashiCorp, Inc. - -Mozilla Public License, version 2.0 - -1. Definitions - -1.1. "Contributor" - - means each individual or legal entity that creates, contributes to the - creation of, or owns Covered Software. - -1.2. "Contributor Version" - - means the combination of the Contributions of others (if any) used by a - Contributor and that particular Contributor's Contribution. - -1.3. "Contribution" - - means Covered Software of a particular Contributor. - -1.4. "Covered Software" - - means Source Code Form to which the initial Contributor has attached the - notice in Exhibit A, the Executable Form of such Source Code Form, and - Modifications of such Source Code Form, in each case including portions - thereof. - -1.5. "Incompatible With Secondary Licenses" - means - - a. that the initial Contributor has attached the notice described in - Exhibit B to the Covered Software; or - - b. that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the terms of - a Secondary License. - -1.6. "Executable Form" - - means any form of the work other than Source Code Form. - -1.7. "Larger Work" - - means a work that combines Covered Software with other material, in a - separate file or files, that is not Covered Software. - -1.8. "License" - - means this document. - -1.9. "Licensable" - - means having the right to grant, to the maximum extent possible, whether - at the time of the initial grant or subsequently, any and all of the - rights conveyed by this License. - -1.10. "Modifications" - - means any of the following: - - a. any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered Software; or - - b. any new file in Source Code Form that contains any Covered Software. - -1.11. "Patent Claims" of a Contributor - - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the License, - by the making, using, selling, offering for sale, having made, import, - or transfer of either its Contributions or its Contributor Version. - -1.12. "Secondary License" - - means either the GNU General Public License, Version 2.0, the GNU Lesser - General Public License, Version 2.1, the GNU Affero General Public - License, Version 3.0, or any later versions of those licenses. - -1.13. "Source Code Form" - - means the form of the work preferred for making modifications. - -1.14. "You" (or "Your") - - means an individual or a legal entity exercising rights under this - License. For legal entities, "You" includes any entity that controls, is - controlled by, or is under common control with You. For purposes of this - definition, "control" means (a) the power, direct or indirect, to cause - the direction or management of such entity, whether by contract or - otherwise, or (b) ownership of more than fifty percent (50%) of the - outstanding shares or beneficial ownership of such entity. - - -2. License Grants and Conditions - -2.1. Grants - - Each Contributor hereby grants You a world-wide, royalty-free, - non-exclusive license: - - a. under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and - - b. under Patent Claims of such Contributor to make, use, sell, offer for - sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -2.2. Effective Date - - The licenses granted in Section 2.1 with respect to any Contribution - become effective for each Contribution on the date the Contributor first - distributes such Contribution. - -2.3. Limitations on Grant Scope - - The licenses granted in this Section 2 are the only rights granted under - this License. No additional rights or licenses will be implied from the - distribution or licensing of Covered Software under this License. - Notwithstanding Section 2.1(b) above, no patent license is granted by a - Contributor: - - a. for any code that a Contributor has removed from Covered Software; or - - b. for infringements caused by: (i) Your and any other third party's - modifications of Covered Software, or (ii) the combination of its - Contributions with other software (except as part of its Contributor - Version); or - - c. under Patent Claims infringed by Covered Software in the absence of - its Contributions. - - This License does not grant any rights in the trademarks, service marks, - or logos of any Contributor (except as may be necessary to comply with - the notice requirements in Section 3.4). - -2.4. Subsequent Licenses - - No Contributor makes additional grants as a result of Your choice to - distribute the Covered Software under a subsequent version of this - License (see Section 10.2) or under the terms of a Secondary License (if - permitted under the terms of Section 3.3). - -2.5. Representation - - Each Contributor represents that the Contributor believes its - Contributions are its original creation(s) or it has sufficient rights to - grant the rights to its Contributions conveyed by this License. - -2.6. Fair Use - - This License is not intended to limit any rights You have under - applicable copyright doctrines of fair use, fair dealing, or other - equivalents. - -2.7. Conditions - - Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in - Section 2.1. - - -3. Responsibilities - -3.1. Distribution of Source Form - - All distribution of Covered Software in Source Code Form, including any - Modifications that You create or to which You contribute, must be under - the terms of this License. You must inform recipients that the Source - Code Form of the Covered Software is governed by the terms of this - License, and how they can obtain a copy of this License. You may not - attempt to alter or restrict the recipients' rights in the Source Code - Form. - -3.2. Distribution of Executable Form - - If You distribute Covered Software in Executable Form then: - - a. such Covered Software must also be made available in Source Code Form, - as described in Section 3.1, and You must inform recipients of the - Executable Form how they can obtain a copy of such Source Code Form by - reasonable means in a timely manner, at a charge no more than the cost - of distribution to the recipient; and - - b. You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter the - recipients' rights in the Source Code Form under this License. - -3.3. Distribution of a Larger Work - - You may create and distribute a Larger Work under terms of Your choice, - provided that You also comply with the requirements of this License for - the Covered Software. If the Larger Work is a combination of Covered - Software with a work governed by one or more Secondary Licenses, and the - Covered Software is not Incompatible With Secondary Licenses, this - License permits You to additionally distribute such Covered Software - under the terms of such Secondary License(s), so that the recipient of - the Larger Work may, at their option, further distribute the Covered - Software under the terms of either this License or such Secondary - License(s). - -3.4. Notices - - You may not remove or alter the substance of any license notices - (including copyright notices, patent notices, disclaimers of warranty, or - limitations of liability) contained within the Source Code Form of the - Covered Software, except that You may alter any license notices to the - extent required to remedy known factual inaccuracies. - -3.5. Application of Additional Terms - - You may choose to offer, and to charge a fee for, warranty, support, - indemnity or liability obligations to one or more recipients of Covered - Software. However, You may do so only on Your own behalf, and not on - behalf of any Contributor. You must make it absolutely clear that any - such warranty, support, indemnity, or liability obligation is offered by - You alone, and You hereby agree to indemnify every Contributor for any - liability incurred by such Contributor as a result of warranty, support, - indemnity or liability terms You offer. You may include additional - disclaimers of warranty and limitations of liability specific to any - jurisdiction. - -4. Inability to Comply Due to Statute or Regulation - - If it is impossible for You to comply with any of the terms of this License - with respect to some or all of the Covered Software due to statute, - judicial order, or regulation then You must: (a) comply with the terms of - this License to the maximum extent possible; and (b) describe the - limitations and the code they affect. Such description must be placed in a - text file included with all distributions of the Covered Software under - this License. Except to the extent prohibited by statute or regulation, - such description must be sufficiently detailed for a recipient of ordinary - skill to be able to understand it. - -5. Termination - -5.1. The rights granted under this License will terminate automatically if You - fail to comply with any of its terms. However, if You become compliant, - then the rights granted under this License from a particular Contributor - are reinstated (a) provisionally, unless and until such Contributor - explicitly and finally terminates Your grants, and (b) on an ongoing - basis, if such Contributor fails to notify You of the non-compliance by - some reasonable means prior to 60 days after You have come back into - compliance. Moreover, Your grants from a particular Contributor are - reinstated on an ongoing basis if such Contributor notifies You of the - non-compliance by some reasonable means, this is the first time You have - received notice of non-compliance with this License from such - Contributor, and You become compliant prior to 30 days after Your receipt - of the notice. - -5.2. If You initiate litigation against any entity by asserting a patent - infringement claim (excluding declaratory judgment actions, - counter-claims, and cross-claims) alleging that a Contributor Version - directly or indirectly infringes any patent, then the rights granted to - You by any and all Contributors for the Covered Software under Section - 2.1 of this License shall terminate. - -5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user - license agreements (excluding distributors and resellers) which have been - validly granted by You or Your distributors under this License prior to - termination shall survive termination. - -6. Disclaimer of Warranty - - Covered Software is provided under this License on an "as is" basis, - without warranty of any kind, either expressed, implied, or statutory, - including, without limitation, warranties that the Covered Software is free - of defects, merchantable, fit for a particular purpose or non-infringing. - The entire risk as to the quality and performance of the Covered Software - is with You. Should any Covered Software prove defective in any respect, - You (not any Contributor) assume the cost of any necessary servicing, - repair, or correction. This disclaimer of warranty constitutes an essential - part of this License. No use of any Covered Software is authorized under - this License except under this disclaimer. - -7. Limitation of Liability - - Under no circumstances and under no legal theory, whether tort (including - negligence), contract, or otherwise, shall any Contributor, or anyone who - distributes Covered Software as permitted above, be liable to You for any - direct, indirect, special, incidental, or consequential damages of any - character including, without limitation, damages for lost profits, loss of - goodwill, work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses, even if such party shall have been - informed of the possibility of such damages. This limitation of liability - shall not apply to liability for death or personal injury resulting from - such party's negligence to the extent applicable law prohibits such - limitation. Some jurisdictions do not allow the exclusion or limitation of - incidental or consequential damages, so this exclusion and limitation may - not apply to You. - -8. Litigation - - Any litigation relating to this License may be brought only in the courts - of a jurisdiction where the defendant maintains its principal place of - business and such litigation shall be governed by laws of that - jurisdiction, without reference to its conflict-of-law provisions. Nothing - in this Section shall prevent a party's ability to bring cross-claims or - counter-claims. - -9. Miscellaneous - - This License represents the complete agreement concerning the subject - matter hereof. If any provision of this License is held to be - unenforceable, such provision shall be reformed only to the extent - necessary to make it enforceable. Any law or regulation which provides that - the language of a contract shall be construed against the drafter shall not - be used to construe this License against a Contributor. - - -10. Versions of the License - -10.1. New Versions - - Mozilla Foundation is the license steward. Except as provided in Section - 10.3, no one other than the license steward has the right to modify or - publish new versions of this License. Each version will be given a - distinguishing version number. - -10.2. Effect of New Versions - - You may distribute the Covered Software under the terms of the version - of the License under which You originally received the Covered Software, - or under the terms of any subsequent version published by the license - steward. - -10.3. Modified Versions - - If you create software not governed by this License, and you want to - create a new license for such software, you may create and use a - modified version of this License if you rename the license and remove - any references to the name of the license steward (except to note that - such modified license differs from this License). - -10.4. Distributing Source Code Form that is Incompatible With Secondary - Licenses If You choose to distribute Source Code Form that is - Incompatible With Secondary Licenses under the terms of this version of - the License, the notice described in Exhibit B of this License must be - attached. - -Exhibit A - Source Code Form License Notice - - This Source Code Form is subject to the - terms of the Mozilla Public License, v. - 2.0. If a copy of the MPL was not - distributed with this file, You can - obtain one at - http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular file, -then You may include the notice in a location (such as a LICENSE file in a -relevant directory) where a recipient would be likely to look for such a -notice. - -You may add additional accurate notices of copyright ownership. - -Exhibit B - "Incompatible With Secondary Licenses" Notice - - This Source Code Form is "Incompatible - With Secondary Licenses", as defined by - the Mozilla Public License, v. 2.0. - diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/hashicorp/go-uuid/README.md b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/hashicorp/go-uuid/README.md deleted file mode 100644 index fbde8b9ae..000000000 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/hashicorp/go-uuid/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# uuid [![Build Status](https://travis-ci.org/hashicorp/go-uuid.svg?branch=master)](https://travis-ci.org/hashicorp/go-uuid) - -Generates UUID-format strings using high quality, _purely random_ bytes. It is **not** intended to be RFC compliant, merely to use a well-understood string representation of a 128-bit value. It can also parse UUID-format strings into their component bytes. - -Documentation -============= - -The full documentation is available on [Godoc](http://godoc.org/github.com/hashicorp/go-uuid). diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/hashicorp/go-uuid/uuid.go b/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/hashicorp/go-uuid/uuid.go deleted file mode 100644 index 0c10c4e9f..000000000 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/github.com/hashicorp/go-uuid/uuid.go +++ /dev/null @@ -1,83 +0,0 @@ -package uuid - -import ( - "crypto/rand" - "encoding/hex" - "fmt" - "io" -) - -// GenerateRandomBytes is used to generate random bytes of given size. -func GenerateRandomBytes(size int) ([]byte, error) { - return GenerateRandomBytesWithReader(size, rand.Reader) -} - -// GenerateRandomBytesWithReader is used to generate random bytes of given size read from a given reader. -func GenerateRandomBytesWithReader(size int, reader io.Reader) ([]byte, error) { - if reader == nil { - return nil, fmt.Errorf("provided reader is nil") - } - buf := make([]byte, size) - if _, err := io.ReadFull(reader, buf); err != nil { - return nil, fmt.Errorf("failed to read random bytes: %v", err) - } - return buf, nil -} - - -const uuidLen = 16 - -// GenerateUUID is used to generate a random UUID -func GenerateUUID() (string, error) { - return GenerateUUIDWithReader(rand.Reader) -} - -// GenerateUUIDWithReader is used to generate a random UUID with a given Reader -func GenerateUUIDWithReader(reader io.Reader) (string, error) { - if reader == nil { - return "", fmt.Errorf("provided reader is nil") - } - buf, err := GenerateRandomBytesWithReader(uuidLen, reader) - if err != nil { - return "", err - } - return FormatUUID(buf) -} - -func FormatUUID(buf []byte) (string, error) { - if buflen := len(buf); buflen != uuidLen { - return "", fmt.Errorf("wrong length byte slice (%d)", buflen) - } - - return fmt.Sprintf("%x-%x-%x-%x-%x", - buf[0:4], - buf[4:6], - buf[6:8], - buf[8:10], - buf[10:16]), nil -} - -func ParseUUID(uuid string) ([]byte, error) { - if len(uuid) != 2 * uuidLen + 4 { - return nil, fmt.Errorf("uuid string is wrong length") - } - - if uuid[8] != '-' || - uuid[13] != '-' || - uuid[18] != '-' || - uuid[23] != '-' { - return nil, fmt.Errorf("uuid is improperly formatted") - } - - hexStr := uuid[0:8] + uuid[9:13] + uuid[14:18] + uuid[19:23] + uuid[24:36] - - ret, err := hex.DecodeString(hexStr) - if err != nil { - return nil, err - } - if len(ret) != uuidLen { - return nil, fmt.Errorf("decoded hex is the wrong length") - } - - return ret, nil -} diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sync/LICENSE b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sync/LICENSE index 6a66aea5e..2a7cf70da 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sync/LICENSE +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sync/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2009 The Go Authors. All rights reserved. +Copyright 2009 The Go Authors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -10,7 +10,7 @@ notice, this list of conditions and the following disclaimer. copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - * Neither the name of Google Inc. nor the names of its + * Neither the name of Google LLC nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/LICENSE b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/LICENSE index 6a66aea5e..2a7cf70da 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/LICENSE +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2009 The Go Authors. All rights reserved. +Copyright 2009 The Go Authors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -10,7 +10,7 @@ notice, this list of conditions and the following disclaimer. copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - * Neither the name of Google Inc. nor the names of its + * Neither the name of Google LLC nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/cpu/cpu.go b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/cpu/cpu.go index 8fa707aa4..ec07aab05 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/cpu/cpu.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/cpu/cpu.go @@ -105,6 +105,8 @@ var ARM64 struct { HasSVE bool // Scalable Vector Extensions HasSVE2 bool // Scalable Vector Extensions 2 HasASIMDFHM bool // Advanced SIMD multiplication FP16 to FP32 + HasDIT bool // Data Independent Timing support + HasI8MM bool // Advanced SIMD Int8 matrix multiplication instructions _ CacheLinePad } diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/cpu/cpu_arm64.go b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/cpu/cpu_arm64.go index 0e27a21e1..af2aa99f9 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/cpu/cpu_arm64.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/cpu/cpu_arm64.go @@ -38,6 +38,8 @@ func initOptions() { {Name: "dcpop", Feature: &ARM64.HasDCPOP}, {Name: "asimddp", Feature: &ARM64.HasASIMDDP}, {Name: "asimdfhm", Feature: &ARM64.HasASIMDFHM}, + {Name: "dit", Feature: &ARM64.HasDIT}, + {Name: "i8mm", Feature: &ARM64.HasI8MM}, } } @@ -145,6 +147,11 @@ func parseARM64SystemRegisters(isar0, isar1, pfr0 uint64) { ARM64.HasLRCPC = true } + switch extractBits(isar1, 52, 55) { + case 1: + ARM64.HasI8MM = true + } + // ID_AA64PFR0_EL1 switch extractBits(pfr0, 16, 19) { case 0: @@ -168,6 +175,11 @@ func parseARM64SystemRegisters(isar0, isar1, pfr0 uint64) { parseARM64SVERegister(getzfr0()) } + + switch extractBits(pfr0, 48, 51) { + case 1: + ARM64.HasDIT = true + } } func parseARM64SVERegister(zfr0 uint64) { diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/cpu/cpu_linux_arm64.go b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/cpu/cpu_linux_arm64.go index 3d386d0fc..08f35ea17 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/cpu/cpu_linux_arm64.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/cpu/cpu_linux_arm64.go @@ -35,8 +35,10 @@ const ( hwcap_SHA512 = 1 << 21 hwcap_SVE = 1 << 22 hwcap_ASIMDFHM = 1 << 23 + hwcap_DIT = 1 << 24 hwcap2_SVE2 = 1 << 1 + hwcap2_I8MM = 1 << 13 ) // linuxKernelCanEmulateCPUID reports whether we're running @@ -106,9 +108,12 @@ func doinit() { ARM64.HasSHA512 = isSet(hwCap, hwcap_SHA512) ARM64.HasSVE = isSet(hwCap, hwcap_SVE) ARM64.HasASIMDFHM = isSet(hwCap, hwcap_ASIMDFHM) + ARM64.HasDIT = isSet(hwCap, hwcap_DIT) + // HWCAP2 feature bits ARM64.HasSVE2 = isSet(hwCap2, hwcap2_SVE2) + ARM64.HasI8MM = isSet(hwCap2, hwcap2_I8MM) } func isSet(hwc uint, value uint) bool { diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/mkerrors.sh b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/mkerrors.sh index 4ed2e488b..d07dd09eb 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/mkerrors.sh +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/mkerrors.sh @@ -58,6 +58,7 @@ includes_Darwin=' #define _DARWIN_USE_64_BIT_INODE #define __APPLE_USE_RFC_3542 #include +#include #include #include #include diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/syscall_darwin.go b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/syscall_darwin.go index 4cc7b0059..2d15200ad 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/syscall_darwin.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/syscall_darwin.go @@ -402,6 +402,18 @@ func IoctlSetIfreqMTU(fd int, ifreq *IfreqMTU) error { return ioctlPtr(fd, SIOCSIFMTU, unsafe.Pointer(ifreq)) } +//sys renamexNp(from string, to string, flag uint32) (err error) + +func RenamexNp(from string, to string, flag uint32) (err error) { + return renamexNp(from, to, flag) +} + +//sys renameatxNp(fromfd int, from string, tofd int, to string, flag uint32) (err error) + +func RenameatxNp(fromfd int, from string, tofd int, to string, flag uint32) (err error) { + return renameatxNp(fromfd, from, tofd, to, flag) +} + //sys sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) = SYS_SYSCTL func Uname(uname *Utsname) error { diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/syscall_linux.go b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/syscall_linux.go index 5682e2628..3f1d3d4cb 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/syscall_linux.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/syscall_linux.go @@ -2592,3 +2592,4 @@ func SchedGetAttr(pid int, flags uint) (*SchedAttr, error) { } //sys Cachestat(fd uint, crange *CachestatRange, cstat *Cachestat_t, flags uint) (err error) +//sys Mseal(b []byte, flags uint) (err error) diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/syscall_openbsd.go b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/syscall_openbsd.go index b25343c71..b86ded549 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/syscall_openbsd.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/syscall_openbsd.go @@ -293,6 +293,7 @@ func Uname(uname *Utsname) error { //sys Mkfifoat(dirfd int, path string, mode uint32) (err error) //sys Mknod(path string, mode uint32, dev int) (err error) //sys Mknodat(dirfd int, path string, mode uint32, dev int) (err error) +//sys Mount(fsType string, dir string, flags int, data unsafe.Pointer) (err error) //sys Nanosleep(time *Timespec, leftover *Timespec) (err error) //sys Open(path string, mode int, perm uint32) (fd int, err error) //sys Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error) diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zerrors_darwin_amd64.go b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zerrors_darwin_amd64.go index e40fa8524..4308ac177 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zerrors_darwin_amd64.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zerrors_darwin_amd64.go @@ -1169,6 +1169,11 @@ const ( PT_WRITE_D = 0x5 PT_WRITE_I = 0x4 PT_WRITE_U = 0x6 + RENAME_EXCL = 0x4 + RENAME_NOFOLLOW_ANY = 0x10 + RENAME_RESERVED1 = 0x8 + RENAME_SECLUDE = 0x1 + RENAME_SWAP = 0x2 RLIMIT_AS = 0x5 RLIMIT_CORE = 0x4 RLIMIT_CPU = 0x0 diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zerrors_darwin_arm64.go b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zerrors_darwin_arm64.go index bb02aa6c0..c8068a7a1 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zerrors_darwin_arm64.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zerrors_darwin_arm64.go @@ -1169,6 +1169,11 @@ const ( PT_WRITE_D = 0x5 PT_WRITE_I = 0x4 PT_WRITE_U = 0x6 + RENAME_EXCL = 0x4 + RENAME_NOFOLLOW_ANY = 0x10 + RENAME_RESERVED1 = 0x8 + RENAME_SECLUDE = 0x1 + RENAME_SWAP = 0x2 RLIMIT_AS = 0x5 RLIMIT_CORE = 0x4 RLIMIT_CPU = 0x0 diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zerrors_linux.go b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zerrors_linux.go index 877a62b47..01a70b246 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zerrors_linux.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zerrors_linux.go @@ -457,6 +457,7 @@ const ( B600 = 0x8 B75 = 0x2 B9600 = 0xd + BCACHEFS_SUPER_MAGIC = 0xca451a4e BDEVFS_MAGIC = 0x62646576 BINDERFS_SUPER_MAGIC = 0x6c6f6f70 BINFMTFS_MAGIC = 0x42494e4d @@ -928,6 +929,7 @@ const ( EPOLL_CTL_ADD = 0x1 EPOLL_CTL_DEL = 0x2 EPOLL_CTL_MOD = 0x3 + EPOLL_IOC_TYPE = 0x8a EROFS_SUPER_MAGIC_V1 = 0xe0f5e1e2 ESP_V4_FLOW = 0xa ESP_V6_FLOW = 0xc @@ -941,9 +943,6 @@ const ( ETHTOOL_FEC_OFF = 0x4 ETHTOOL_FEC_RS = 0x8 ETHTOOL_FLAG_ALL = 0x7 - ETHTOOL_FLAG_COMPACT_BITSETS = 0x1 - ETHTOOL_FLAG_OMIT_REPLY = 0x2 - ETHTOOL_FLAG_STATS = 0x4 ETHTOOL_FLASHDEV = 0x33 ETHTOOL_FLASH_MAX_FILENAME = 0x80 ETHTOOL_FWVERS_LEN = 0x20 @@ -1705,6 +1704,7 @@ const ( KEXEC_ARCH_S390 = 0x160000 KEXEC_ARCH_SH = 0x2a0000 KEXEC_ARCH_X86_64 = 0x3e0000 + KEXEC_CRASH_HOTPLUG_SUPPORT = 0x8 KEXEC_FILE_DEBUG = 0x8 KEXEC_FILE_NO_INITRAMFS = 0x4 KEXEC_FILE_ON_CRASH = 0x2 @@ -1780,6 +1780,7 @@ const ( KEY_SPEC_USER_KEYRING = -0x4 KEY_SPEC_USER_SESSION_KEYRING = -0x5 LANDLOCK_ACCESS_FS_EXECUTE = 0x1 + LANDLOCK_ACCESS_FS_IOCTL_DEV = 0x8000 LANDLOCK_ACCESS_FS_MAKE_BLOCK = 0x800 LANDLOCK_ACCESS_FS_MAKE_CHAR = 0x40 LANDLOCK_ACCESS_FS_MAKE_DIR = 0x80 @@ -1861,6 +1862,19 @@ const ( MAP_FILE = 0x0 MAP_FIXED = 0x10 MAP_FIXED_NOREPLACE = 0x100000 + MAP_HUGE_16GB = 0x88000000 + MAP_HUGE_16KB = 0x38000000 + MAP_HUGE_16MB = 0x60000000 + MAP_HUGE_1GB = 0x78000000 + MAP_HUGE_1MB = 0x50000000 + MAP_HUGE_256MB = 0x70000000 + MAP_HUGE_2GB = 0x7c000000 + MAP_HUGE_2MB = 0x54000000 + MAP_HUGE_32MB = 0x64000000 + MAP_HUGE_512KB = 0x4c000000 + MAP_HUGE_512MB = 0x74000000 + MAP_HUGE_64KB = 0x40000000 + MAP_HUGE_8MB = 0x5c000000 MAP_HUGE_MASK = 0x3f MAP_HUGE_SHIFT = 0x1a MAP_PRIVATE = 0x2 @@ -2498,6 +2512,23 @@ const ( PR_PAC_GET_ENABLED_KEYS = 0x3d PR_PAC_RESET_KEYS = 0x36 PR_PAC_SET_ENABLED_KEYS = 0x3c + PR_PPC_DEXCR_CTRL_CLEAR = 0x4 + PR_PPC_DEXCR_CTRL_CLEAR_ONEXEC = 0x10 + PR_PPC_DEXCR_CTRL_EDITABLE = 0x1 + PR_PPC_DEXCR_CTRL_MASK = 0x1f + PR_PPC_DEXCR_CTRL_SET = 0x2 + PR_PPC_DEXCR_CTRL_SET_ONEXEC = 0x8 + PR_PPC_DEXCR_IBRTPD = 0x1 + PR_PPC_DEXCR_NPHIE = 0x3 + PR_PPC_DEXCR_SBHE = 0x0 + PR_PPC_DEXCR_SRAPD = 0x2 + PR_PPC_GET_DEXCR = 0x48 + PR_PPC_SET_DEXCR = 0x49 + PR_RISCV_CTX_SW_FENCEI_OFF = 0x1 + PR_RISCV_CTX_SW_FENCEI_ON = 0x0 + PR_RISCV_SCOPE_PER_PROCESS = 0x0 + PR_RISCV_SCOPE_PER_THREAD = 0x1 + PR_RISCV_SET_ICACHE_FLUSH_CTX = 0x47 PR_RISCV_V_GET_CONTROL = 0x46 PR_RISCV_V_SET_CONTROL = 0x45 PR_RISCV_V_VSTATE_CTRL_CUR_MASK = 0x3 @@ -3192,6 +3223,7 @@ const ( STATX_MTIME = 0x40 STATX_NLINK = 0x4 STATX_SIZE = 0x200 + STATX_SUBVOL = 0x8000 STATX_TYPE = 0x1 STATX_UID = 0x8 STATX__RESERVED = 0x80000000 diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zerrors_linux_386.go b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zerrors_linux_386.go index e4bc0bd57..684a5168d 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zerrors_linux_386.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zerrors_linux_386.go @@ -78,6 +78,8 @@ const ( ECHOPRT = 0x400 EFD_CLOEXEC = 0x80000 EFD_NONBLOCK = 0x800 + EPIOCGPARAMS = 0x80088a02 + EPIOCSPARAMS = 0x40088a01 EPOLL_CLOEXEC = 0x80000 EXTPROC = 0x10000 FF1 = 0x8000 diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go index 689317afd..61d74b592 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go @@ -78,6 +78,8 @@ const ( ECHOPRT = 0x400 EFD_CLOEXEC = 0x80000 EFD_NONBLOCK = 0x800 + EPIOCGPARAMS = 0x80088a02 + EPIOCSPARAMS = 0x40088a01 EPOLL_CLOEXEC = 0x80000 EXTPROC = 0x10000 FF1 = 0x8000 diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go index 5cca668ac..a28c9e3e8 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go @@ -78,6 +78,8 @@ const ( ECHOPRT = 0x400 EFD_CLOEXEC = 0x80000 EFD_NONBLOCK = 0x800 + EPIOCGPARAMS = 0x80088a02 + EPIOCSPARAMS = 0x40088a01 EPOLL_CLOEXEC = 0x80000 EXTPROC = 0x10000 FF1 = 0x8000 diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go index 14270508b..ab5d1fe8e 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go @@ -78,6 +78,8 @@ const ( ECHOPRT = 0x400 EFD_CLOEXEC = 0x80000 EFD_NONBLOCK = 0x800 + EPIOCGPARAMS = 0x80088a02 + EPIOCSPARAMS = 0x40088a01 EPOLL_CLOEXEC = 0x80000 ESR_MAGIC = 0x45535201 EXTPROC = 0x10000 diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go index 28e39afdc..c523090e7 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go @@ -78,6 +78,8 @@ const ( ECHOPRT = 0x400 EFD_CLOEXEC = 0x80000 EFD_NONBLOCK = 0x800 + EPIOCGPARAMS = 0x80088a02 + EPIOCSPARAMS = 0x40088a01 EPOLL_CLOEXEC = 0x80000 EXTPROC = 0x10000 FF1 = 0x8000 diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go index cd66e92cb..01e6ea780 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go @@ -78,6 +78,8 @@ const ( ECHOPRT = 0x400 EFD_CLOEXEC = 0x80000 EFD_NONBLOCK = 0x80 + EPIOCGPARAMS = 0x40088a02 + EPIOCSPARAMS = 0x80088a01 EPOLL_CLOEXEC = 0x80000 EXTPROC = 0x10000 FF1 = 0x8000 diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go index c1595eba7..7aa610b1e 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go @@ -78,6 +78,8 @@ const ( ECHOPRT = 0x400 EFD_CLOEXEC = 0x80000 EFD_NONBLOCK = 0x80 + EPIOCGPARAMS = 0x40088a02 + EPIOCSPARAMS = 0x80088a01 EPOLL_CLOEXEC = 0x80000 EXTPROC = 0x10000 FF1 = 0x8000 diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go index ee9456b0d..92af771b4 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go @@ -78,6 +78,8 @@ const ( ECHOPRT = 0x400 EFD_CLOEXEC = 0x80000 EFD_NONBLOCK = 0x80 + EPIOCGPARAMS = 0x40088a02 + EPIOCSPARAMS = 0x80088a01 EPOLL_CLOEXEC = 0x80000 EXTPROC = 0x10000 FF1 = 0x8000 diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go index 8cfca81e1..b27ef5e6f 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go @@ -78,6 +78,8 @@ const ( ECHOPRT = 0x400 EFD_CLOEXEC = 0x80000 EFD_NONBLOCK = 0x80 + EPIOCGPARAMS = 0x40088a02 + EPIOCSPARAMS = 0x80088a01 EPOLL_CLOEXEC = 0x80000 EXTPROC = 0x10000 FF1 = 0x8000 diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go index 60b0deb3a..237a2cefb 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go @@ -78,6 +78,8 @@ const ( ECHOPRT = 0x20 EFD_CLOEXEC = 0x80000 EFD_NONBLOCK = 0x800 + EPIOCGPARAMS = 0x40088a02 + EPIOCSPARAMS = 0x80088a01 EPOLL_CLOEXEC = 0x80000 EXTPROC = 0x10000000 FF1 = 0x4000 diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go index f90aa7281..4a5c555a3 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go @@ -78,6 +78,8 @@ const ( ECHOPRT = 0x20 EFD_CLOEXEC = 0x80000 EFD_NONBLOCK = 0x800 + EPIOCGPARAMS = 0x40088a02 + EPIOCSPARAMS = 0x80088a01 EPOLL_CLOEXEC = 0x80000 EXTPROC = 0x10000000 FF1 = 0x4000 diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go index ba9e01503..a02fb49a5 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go @@ -78,6 +78,8 @@ const ( ECHOPRT = 0x20 EFD_CLOEXEC = 0x80000 EFD_NONBLOCK = 0x800 + EPIOCGPARAMS = 0x40088a02 + EPIOCSPARAMS = 0x80088a01 EPOLL_CLOEXEC = 0x80000 EXTPROC = 0x10000000 FF1 = 0x4000 diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go index 07cdfd6e9..e26a7c61b 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go @@ -78,6 +78,8 @@ const ( ECHOPRT = 0x400 EFD_CLOEXEC = 0x80000 EFD_NONBLOCK = 0x800 + EPIOCGPARAMS = 0x80088a02 + EPIOCSPARAMS = 0x40088a01 EPOLL_CLOEXEC = 0x80000 EXTPROC = 0x10000 FF1 = 0x8000 diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go index 2f1dd214a..c48f7c210 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go @@ -78,6 +78,8 @@ const ( ECHOPRT = 0x400 EFD_CLOEXEC = 0x80000 EFD_NONBLOCK = 0x800 + EPIOCGPARAMS = 0x80088a02 + EPIOCSPARAMS = 0x40088a01 EPOLL_CLOEXEC = 0x80000 EXTPROC = 0x10000 FF1 = 0x8000 diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go index f40519d90..ad4b9aace 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go @@ -82,6 +82,8 @@ const ( EFD_CLOEXEC = 0x400000 EFD_NONBLOCK = 0x4000 EMT_TAGOVF = 0x1 + EPIOCGPARAMS = 0x40088a02 + EPIOCSPARAMS = 0x80088a01 EPOLL_CLOEXEC = 0x400000 EXTPROC = 0x10000 FF1 = 0x8000 diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go index 07642c308..b622533ef 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go @@ -740,6 +740,54 @@ func ioctlPtr(fd int, req uint, arg unsafe.Pointer) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func renamexNp(from string, to string, flag uint32) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(from) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(to) + if err != nil { + return + } + _, _, e1 := syscall_syscall(libc_renamex_np_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flag)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_renamex_np_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_renamex_np renamex_np "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func renameatxNp(fromfd int, from string, tofd int, to string, flag uint32) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(from) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(to) + if err != nil { + return + } + _, _, e1 := syscall_syscall6(libc_renameatx_np_trampoline_addr, uintptr(fromfd), uintptr(unsafe.Pointer(_p0)), uintptr(tofd), uintptr(unsafe.Pointer(_p1)), uintptr(flag), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_renameatx_np_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_renameatx_np renameatx_np "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { var _p0 unsafe.Pointer if len(mib) > 0 { diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s index 923e08cb7..cfe6646ba 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s @@ -223,6 +223,16 @@ TEXT libc_ioctl_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_ioctl_trampoline_addr(SB), RODATA, $8 DATA ·libc_ioctl_trampoline_addr(SB)/8, $libc_ioctl_trampoline<>(SB) +TEXT libc_renamex_np_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_renamex_np(SB) +GLOBL ·libc_renamex_np_trampoline_addr(SB), RODATA, $8 +DATA ·libc_renamex_np_trampoline_addr(SB)/8, $libc_renamex_np_trampoline<>(SB) + +TEXT libc_renameatx_np_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_renameatx_np(SB) +GLOBL ·libc_renameatx_np_trampoline_addr(SB), RODATA, $8 +DATA ·libc_renameatx_np_trampoline_addr(SB)/8, $libc_renameatx_np_trampoline<>(SB) + TEXT libc_sysctl_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_sysctl(SB) GLOBL ·libc_sysctl_trampoline_addr(SB), RODATA, $8 diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go index 7d73dda64..13f624f69 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go @@ -740,6 +740,54 @@ func ioctlPtr(fd int, req uint, arg unsafe.Pointer) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func renamexNp(from string, to string, flag uint32) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(from) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(to) + if err != nil { + return + } + _, _, e1 := syscall_syscall(libc_renamex_np_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flag)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_renamex_np_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_renamex_np renamex_np "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func renameatxNp(fromfd int, from string, tofd int, to string, flag uint32) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(from) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(to) + if err != nil { + return + } + _, _, e1 := syscall_syscall6(libc_renameatx_np_trampoline_addr, uintptr(fromfd), uintptr(unsafe.Pointer(_p0)), uintptr(tofd), uintptr(unsafe.Pointer(_p1)), uintptr(flag), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_renameatx_np_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_renameatx_np renameatx_np "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { var _p0 unsafe.Pointer if len(mib) > 0 { diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s index 057700111..fe222b75d 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s @@ -223,6 +223,16 @@ TEXT libc_ioctl_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_ioctl_trampoline_addr(SB), RODATA, $8 DATA ·libc_ioctl_trampoline_addr(SB)/8, $libc_ioctl_trampoline<>(SB) +TEXT libc_renamex_np_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_renamex_np(SB) +GLOBL ·libc_renamex_np_trampoline_addr(SB), RODATA, $8 +DATA ·libc_renamex_np_trampoline_addr(SB)/8, $libc_renamex_np_trampoline<>(SB) + +TEXT libc_renameatx_np_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_renameatx_np(SB) +GLOBL ·libc_renameatx_np_trampoline_addr(SB), RODATA, $8 +DATA ·libc_renameatx_np_trampoline_addr(SB)/8, $libc_renameatx_np_trampoline<>(SB) + TEXT libc_sysctl_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_sysctl(SB) GLOBL ·libc_sysctl_trampoline_addr(SB), RODATA, $8 diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsyscall_linux.go b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsyscall_linux.go index 87d8612a1..1bc1a5adb 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsyscall_linux.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsyscall_linux.go @@ -2229,3 +2229,19 @@ func Cachestat(fd uint, crange *CachestatRange, cstat *Cachestat_t, flags uint) } return } + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Mseal(b []byte, flags uint) (err error) { + var _p0 unsafe.Pointer + if len(b) > 0 { + _p0 = unsafe.Pointer(&b[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall(SYS_MSEAL, uintptr(_p0), uintptr(len(b)), uintptr(flags)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go index 9dc42410b..1851df14e 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go @@ -1493,6 +1493,30 @@ var libc_mknodat_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Mount(fsType string, dir string, flags int, data unsafe.Pointer) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(fsType) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(dir) + if err != nil { + return + } + _, _, e1 := syscall_syscall6(libc_mount_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flags), uintptr(data), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_mount_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_mount mount "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Nanosleep(time *Timespec, leftover *Timespec) (err error) { _, _, e1 := syscall_syscall(libc_nanosleep_trampoline_addr, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0) if e1 != 0 { diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.s b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.s index 41b561731..0b43c6936 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.s +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.s @@ -463,6 +463,11 @@ TEXT libc_mknodat_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_mknodat_trampoline_addr(SB), RODATA, $4 DATA ·libc_mknodat_trampoline_addr(SB)/4, $libc_mknodat_trampoline<>(SB) +TEXT libc_mount_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_mount(SB) +GLOBL ·libc_mount_trampoline_addr(SB), RODATA, $4 +DATA ·libc_mount_trampoline_addr(SB)/4, $libc_mount_trampoline<>(SB) + TEXT libc_nanosleep_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_nanosleep(SB) GLOBL ·libc_nanosleep_trampoline_addr(SB), RODATA, $4 diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go index 0d3a0751c..e1ec0dbe4 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go @@ -1493,6 +1493,30 @@ var libc_mknodat_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Mount(fsType string, dir string, flags int, data unsafe.Pointer) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(fsType) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(dir) + if err != nil { + return + } + _, _, e1 := syscall_syscall6(libc_mount_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flags), uintptr(data), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_mount_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_mount mount "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Nanosleep(time *Timespec, leftover *Timespec) (err error) { _, _, e1 := syscall_syscall(libc_nanosleep_trampoline_addr, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0) if e1 != 0 { diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.s b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.s index 4019a656f..880c6d6e3 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.s +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.s @@ -463,6 +463,11 @@ TEXT libc_mknodat_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_mknodat_trampoline_addr(SB), RODATA, $8 DATA ·libc_mknodat_trampoline_addr(SB)/8, $libc_mknodat_trampoline<>(SB) +TEXT libc_mount_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_mount(SB) +GLOBL ·libc_mount_trampoline_addr(SB), RODATA, $8 +DATA ·libc_mount_trampoline_addr(SB)/8, $libc_mount_trampoline<>(SB) + TEXT libc_nanosleep_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_nanosleep(SB) GLOBL ·libc_nanosleep_trampoline_addr(SB), RODATA, $8 diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go index c39f7776d..7c8452a63 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go @@ -1493,6 +1493,30 @@ var libc_mknodat_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Mount(fsType string, dir string, flags int, data unsafe.Pointer) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(fsType) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(dir) + if err != nil { + return + } + _, _, e1 := syscall_syscall6(libc_mount_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flags), uintptr(data), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_mount_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_mount mount "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Nanosleep(time *Timespec, leftover *Timespec) (err error) { _, _, e1 := syscall_syscall(libc_nanosleep_trampoline_addr, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0) if e1 != 0 { diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.s b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.s index ac4af24f9..b8ef95b0f 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.s +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.s @@ -463,6 +463,11 @@ TEXT libc_mknodat_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_mknodat_trampoline_addr(SB), RODATA, $4 DATA ·libc_mknodat_trampoline_addr(SB)/4, $libc_mknodat_trampoline<>(SB) +TEXT libc_mount_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_mount(SB) +GLOBL ·libc_mount_trampoline_addr(SB), RODATA, $4 +DATA ·libc_mount_trampoline_addr(SB)/4, $libc_mount_trampoline<>(SB) + TEXT libc_nanosleep_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_nanosleep(SB) GLOBL ·libc_nanosleep_trampoline_addr(SB), RODATA, $4 diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go index 57571d072..2ffdf861f 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go @@ -1493,6 +1493,30 @@ var libc_mknodat_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Mount(fsType string, dir string, flags int, data unsafe.Pointer) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(fsType) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(dir) + if err != nil { + return + } + _, _, e1 := syscall_syscall6(libc_mount_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flags), uintptr(data), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_mount_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_mount mount "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Nanosleep(time *Timespec, leftover *Timespec) (err error) { _, _, e1 := syscall_syscall(libc_nanosleep_trampoline_addr, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0) if e1 != 0 { diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.s b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.s index f77d53212..2af3b5c76 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.s +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.s @@ -463,6 +463,11 @@ TEXT libc_mknodat_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_mknodat_trampoline_addr(SB), RODATA, $8 DATA ·libc_mknodat_trampoline_addr(SB)/8, $libc_mknodat_trampoline<>(SB) +TEXT libc_mount_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_mount(SB) +GLOBL ·libc_mount_trampoline_addr(SB), RODATA, $8 +DATA ·libc_mount_trampoline_addr(SB)/8, $libc_mount_trampoline<>(SB) + TEXT libc_nanosleep_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_nanosleep(SB) GLOBL ·libc_nanosleep_trampoline_addr(SB), RODATA, $8 diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go index e62963e67..1da08d526 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go @@ -1493,6 +1493,30 @@ var libc_mknodat_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Mount(fsType string, dir string, flags int, data unsafe.Pointer) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(fsType) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(dir) + if err != nil { + return + } + _, _, e1 := syscall_syscall6(libc_mount_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flags), uintptr(data), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_mount_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_mount mount "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Nanosleep(time *Timespec, leftover *Timespec) (err error) { _, _, e1 := syscall_syscall(libc_nanosleep_trampoline_addr, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0) if e1 != 0 { diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.s b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.s index fae140b62..b7a251353 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.s +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.s @@ -463,6 +463,11 @@ TEXT libc_mknodat_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_mknodat_trampoline_addr(SB), RODATA, $8 DATA ·libc_mknodat_trampoline_addr(SB)/8, $libc_mknodat_trampoline<>(SB) +TEXT libc_mount_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_mount(SB) +GLOBL ·libc_mount_trampoline_addr(SB), RODATA, $8 +DATA ·libc_mount_trampoline_addr(SB)/8, $libc_mount_trampoline<>(SB) + TEXT libc_nanosleep_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_nanosleep(SB) GLOBL ·libc_nanosleep_trampoline_addr(SB), RODATA, $8 diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.go b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.go index 00831354c..6e85b0aac 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.go @@ -1493,6 +1493,30 @@ var libc_mknodat_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Mount(fsType string, dir string, flags int, data unsafe.Pointer) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(fsType) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(dir) + if err != nil { + return + } + _, _, e1 := syscall_syscall6(libc_mount_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flags), uintptr(data), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_mount_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_mount mount "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Nanosleep(time *Timespec, leftover *Timespec) (err error) { _, _, e1 := syscall_syscall(libc_nanosleep_trampoline_addr, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0) if e1 != 0 { diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.s b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.s index 9d1e0ff06..f15dadf05 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.s +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.s @@ -555,6 +555,12 @@ TEXT libc_mknodat_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_mknodat_trampoline_addr(SB), RODATA, $8 DATA ·libc_mknodat_trampoline_addr(SB)/8, $libc_mknodat_trampoline<>(SB) +TEXT libc_mount_trampoline<>(SB),NOSPLIT,$0-0 + CALL libc_mount(SB) + RET +GLOBL ·libc_mount_trampoline_addr(SB), RODATA, $8 +DATA ·libc_mount_trampoline_addr(SB)/8, $libc_mount_trampoline<>(SB) + TEXT libc_nanosleep_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_nanosleep(SB) RET diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.go b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.go index 79029ed58..28b487df2 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.go @@ -1493,6 +1493,30 @@ var libc_mknodat_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func Mount(fsType string, dir string, flags int, data unsafe.Pointer) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(fsType) + if err != nil { + return + } + var _p1 *byte + _p1, err = BytePtrFromString(dir) + if err != nil { + return + } + _, _, e1 := syscall_syscall6(libc_mount_trampoline_addr, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flags), uintptr(data), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_mount_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_mount mount "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Nanosleep(time *Timespec, leftover *Timespec) (err error) { _, _, e1 := syscall_syscall(libc_nanosleep_trampoline_addr, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0) if e1 != 0 { diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.s b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.s index da115f9a4..1e7f321e4 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.s +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.s @@ -463,6 +463,11 @@ TEXT libc_mknodat_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_mknodat_trampoline_addr(SB), RODATA, $8 DATA ·libc_mknodat_trampoline_addr(SB)/8, $libc_mknodat_trampoline<>(SB) +TEXT libc_mount_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_mount(SB) +GLOBL ·libc_mount_trampoline_addr(SB), RODATA, $8 +DATA ·libc_mount_trampoline_addr(SB)/8, $libc_mount_trampoline<>(SB) + TEXT libc_nanosleep_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_nanosleep(SB) GLOBL ·libc_nanosleep_trampoline_addr(SB), RODATA, $8 diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go index 53aef5dc5..524b0820c 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go @@ -457,4 +457,5 @@ const ( SYS_LSM_GET_SELF_ATTR = 459 SYS_LSM_SET_SELF_ATTR = 460 SYS_LSM_LIST_MODULES = 461 + SYS_MSEAL = 462 ) diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go index 71d524763..d3e38f681 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go @@ -379,4 +379,5 @@ const ( SYS_LSM_GET_SELF_ATTR = 459 SYS_LSM_SET_SELF_ATTR = 460 SYS_LSM_LIST_MODULES = 461 + SYS_MSEAL = 462 ) diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go index c74770613..70b35bf3b 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go @@ -421,4 +421,5 @@ const ( SYS_LSM_GET_SELF_ATTR = 459 SYS_LSM_SET_SELF_ATTR = 460 SYS_LSM_LIST_MODULES = 461 + SYS_MSEAL = 462 ) diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go index f96e214f6..6c778c232 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go @@ -324,4 +324,5 @@ const ( SYS_LSM_GET_SELF_ATTR = 459 SYS_LSM_SET_SELF_ATTR = 460 SYS_LSM_LIST_MODULES = 461 + SYS_MSEAL = 462 ) diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go index 28425346c..37281cf51 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go @@ -318,4 +318,5 @@ const ( SYS_LSM_GET_SELF_ATTR = 459 SYS_LSM_SET_SELF_ATTR = 460 SYS_LSM_LIST_MODULES = 461 + SYS_MSEAL = 462 ) diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go index d0953018d..7e567f1ef 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go @@ -441,4 +441,5 @@ const ( SYS_LSM_GET_SELF_ATTR = 4459 SYS_LSM_SET_SELF_ATTR = 4460 SYS_LSM_LIST_MODULES = 4461 + SYS_MSEAL = 4462 ) diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go index 295c7f4b8..38ae55e5e 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go @@ -371,4 +371,5 @@ const ( SYS_LSM_GET_SELF_ATTR = 5459 SYS_LSM_SET_SELF_ATTR = 5460 SYS_LSM_LIST_MODULES = 5461 + SYS_MSEAL = 5462 ) diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go index d1a9eaca7..55e92e60a 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go @@ -371,4 +371,5 @@ const ( SYS_LSM_GET_SELF_ATTR = 5459 SYS_LSM_SET_SELF_ATTR = 5460 SYS_LSM_LIST_MODULES = 5461 + SYS_MSEAL = 5462 ) diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go index bec157c39..60658d6a0 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go @@ -441,4 +441,5 @@ const ( SYS_LSM_GET_SELF_ATTR = 4459 SYS_LSM_SET_SELF_ATTR = 4460 SYS_LSM_LIST_MODULES = 4461 + SYS_MSEAL = 4462 ) diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go index 7ee7bdc43..e203e8a7e 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go @@ -448,4 +448,5 @@ const ( SYS_LSM_GET_SELF_ATTR = 459 SYS_LSM_SET_SELF_ATTR = 460 SYS_LSM_LIST_MODULES = 461 + SYS_MSEAL = 462 ) diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go index fad1f25b4..5944b97d5 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go @@ -420,4 +420,5 @@ const ( SYS_LSM_GET_SELF_ATTR = 459 SYS_LSM_SET_SELF_ATTR = 460 SYS_LSM_LIST_MODULES = 461 + SYS_MSEAL = 462 ) diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go index 7d3e16357..c66d416da 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go @@ -420,4 +420,5 @@ const ( SYS_LSM_GET_SELF_ATTR = 459 SYS_LSM_SET_SELF_ATTR = 460 SYS_LSM_LIST_MODULES = 461 + SYS_MSEAL = 462 ) diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go index 0ed53ad9f..9889f6a55 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go @@ -325,4 +325,5 @@ const ( SYS_LSM_GET_SELF_ATTR = 459 SYS_LSM_SET_SELF_ATTR = 460 SYS_LSM_LIST_MODULES = 461 + SYS_MSEAL = 462 ) diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go index 2fba04ad5..01d86825b 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go @@ -386,4 +386,5 @@ const ( SYS_LSM_GET_SELF_ATTR = 459 SYS_LSM_SET_SELF_ATTR = 460 SYS_LSM_LIST_MODULES = 461 + SYS_MSEAL = 462 ) diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go index 621d00d74..7b703e77c 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go @@ -399,4 +399,5 @@ const ( SYS_LSM_GET_SELF_ATTR = 459 SYS_LSM_SET_SELF_ATTR = 460 SYS_LSM_LIST_MODULES = 461 + SYS_MSEAL = 462 ) diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/ztypes_linux.go b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/ztypes_linux.go index 4740b8348..7f1961b90 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/ztypes_linux.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/unix/ztypes_linux.go @@ -110,7 +110,8 @@ type Statx_t struct { Mnt_id uint64 Dio_mem_align uint32 Dio_offset_align uint32 - _ [12]uint64 + Subvol uint64 + _ [11]uint64 } type Fsid struct { @@ -3473,7 +3474,7 @@ const ( DEVLINK_PORT_FN_ATTR_STATE = 0x2 DEVLINK_PORT_FN_ATTR_OPSTATE = 0x3 DEVLINK_PORT_FN_ATTR_CAPS = 0x4 - DEVLINK_PORT_FUNCTION_ATTR_MAX = 0x5 + DEVLINK_PORT_FUNCTION_ATTR_MAX = 0x6 ) type FsverityDigest struct { @@ -3806,6 +3807,9 @@ const ( ETHTOOL_MSG_PSE_GET_REPLY = 0x25 ETHTOOL_MSG_RSS_GET_REPLY = 0x26 ETHTOOL_MSG_KERNEL_MAX = 0x2b + ETHTOOL_FLAG_COMPACT_BITSETS = 0x1 + ETHTOOL_FLAG_OMIT_REPLY = 0x2 + ETHTOOL_FLAG_STATS = 0x4 ETHTOOL_A_HEADER_UNSPEC = 0x0 ETHTOOL_A_HEADER_DEV_INDEX = 0x1 ETHTOOL_A_HEADER_DEV_NAME = 0x2 @@ -3975,7 +3979,7 @@ const ( ETHTOOL_A_TSINFO_TX_TYPES = 0x3 ETHTOOL_A_TSINFO_RX_FILTERS = 0x4 ETHTOOL_A_TSINFO_PHC_INDEX = 0x5 - ETHTOOL_A_TSINFO_MAX = 0x5 + ETHTOOL_A_TSINFO_MAX = 0x6 ETHTOOL_A_CABLE_TEST_UNSPEC = 0x0 ETHTOOL_A_CABLE_TEST_HEADER = 0x1 ETHTOOL_A_CABLE_TEST_MAX = 0x1 diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/windows/security_windows.go b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/windows/security_windows.go index 97651b5bd..b6e1ab76f 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/windows/security_windows.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/windows/security_windows.go @@ -1179,7 +1179,7 @@ type OBJECTS_AND_NAME struct { //sys makeSelfRelativeSD(absoluteSD *SECURITY_DESCRIPTOR, selfRelativeSD *SECURITY_DESCRIPTOR, selfRelativeSDSize *uint32) (err error) = advapi32.MakeSelfRelativeSD //sys setEntriesInAcl(countExplicitEntries uint32, explicitEntries *EXPLICIT_ACCESS, oldACL *ACL, newACL **ACL) (ret error) = advapi32.SetEntriesInAclW -//sys GetAce(acl *ACL, aceIndex uint32, pAce **ACCESS_ALLOWED_ACE) (ret error) = advapi32.GetAce +//sys GetAce(acl *ACL, aceIndex uint32, pAce **ACCESS_ALLOWED_ACE) (err error) = advapi32.GetAce // Control returns the security descriptor control bits. func (sd *SECURITY_DESCRIPTOR) Control() (control SECURITY_DESCRIPTOR_CONTROL, revision uint32, err error) { diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/windows/syscall_windows.go b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/windows/syscall_windows.go index 6525c62f3..1fa34fd17 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/windows/syscall_windows.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/windows/syscall_windows.go @@ -17,8 +17,10 @@ import ( "unsafe" ) -type Handle uintptr -type HWND uintptr +type ( + Handle uintptr + HWND uintptr +) const ( InvalidHandle = ^Handle(0) @@ -211,6 +213,10 @@ func NewCallbackCDecl(fn interface{}) uintptr { //sys OpenProcess(desiredAccess uint32, inheritHandle bool, processId uint32) (handle Handle, err error) //sys ShellExecute(hwnd Handle, verb *uint16, file *uint16, args *uint16, cwd *uint16, showCmd int32) (err error) [failretval<=32] = shell32.ShellExecuteW //sys GetWindowThreadProcessId(hwnd HWND, pid *uint32) (tid uint32, err error) = user32.GetWindowThreadProcessId +//sys LoadKeyboardLayout(name *uint16, flags uint32) (hkl Handle, err error) [failretval==0] = user32.LoadKeyboardLayoutW +//sys UnloadKeyboardLayout(hkl Handle) (err error) = user32.UnloadKeyboardLayout +//sys GetKeyboardLayout(tid uint32) (hkl Handle) = user32.GetKeyboardLayout +//sys ToUnicodeEx(vkey uint32, scancode uint32, keystate *byte, pwszBuff *uint16, cchBuff int32, flags uint32, hkl Handle) (ret int32) = user32.ToUnicodeEx //sys GetShellWindow() (shellWindow HWND) = user32.GetShellWindow //sys MessageBox(hwnd HWND, text *uint16, caption *uint16, boxtype uint32) (ret int32, err error) [failretval==0] = user32.MessageBoxW //sys ExitWindowsEx(flags uint32, reason uint32) (err error) = user32.ExitWindowsEx @@ -1368,9 +1374,11 @@ func SetsockoptLinger(fd Handle, level, opt int, l *Linger) (err error) { func SetsockoptInet4Addr(fd Handle, level, opt int, value [4]byte) (err error) { return Setsockopt(fd, int32(level), int32(opt), (*byte)(unsafe.Pointer(&value[0])), 4) } + func SetsockoptIPMreq(fd Handle, level, opt int, mreq *IPMreq) (err error) { return Setsockopt(fd, int32(level), int32(opt), (*byte)(unsafe.Pointer(mreq)), int32(unsafe.Sizeof(*mreq))) } + func SetsockoptIPv6Mreq(fd Handle, level, opt int, mreq *IPv6Mreq) (err error) { return syscall.EWINDOWS } diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/windows/types_windows.go b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/windows/types_windows.go index d8cb71db0..3f03b3d57 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/windows/types_windows.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/windows/types_windows.go @@ -2003,7 +2003,21 @@ const ( MOVEFILE_FAIL_IF_NOT_TRACKABLE = 0x20 ) -const GAA_FLAG_INCLUDE_PREFIX = 0x00000010 +// Flags for GetAdaptersAddresses, see +// https://learn.microsoft.com/en-us/windows/win32/api/iphlpapi/nf-iphlpapi-getadaptersaddresses. +const ( + GAA_FLAG_SKIP_UNICAST = 0x1 + GAA_FLAG_SKIP_ANYCAST = 0x2 + GAA_FLAG_SKIP_MULTICAST = 0x4 + GAA_FLAG_SKIP_DNS_SERVER = 0x8 + GAA_FLAG_INCLUDE_PREFIX = 0x10 + GAA_FLAG_SKIP_FRIENDLY_NAME = 0x20 + GAA_FLAG_INCLUDE_WINS_INFO = 0x40 + GAA_FLAG_INCLUDE_GATEWAYS = 0x80 + GAA_FLAG_INCLUDE_ALL_INTERFACES = 0x100 + GAA_FLAG_INCLUDE_ALL_COMPARTMENTS = 0x200 + GAA_FLAG_INCLUDE_TUNNEL_BINDINGORDER = 0x400 +) const ( IF_TYPE_OTHER = 1 @@ -2017,6 +2031,50 @@ const ( IF_TYPE_IEEE1394 = 144 ) +// Enum NL_PREFIX_ORIGIN for [IpAdapterUnicastAddress], see +// https://learn.microsoft.com/en-us/windows/win32/api/nldef/ne-nldef-nl_prefix_origin +const ( + IpPrefixOriginOther = 0 + IpPrefixOriginManual = 1 + IpPrefixOriginWellKnown = 2 + IpPrefixOriginDhcp = 3 + IpPrefixOriginRouterAdvertisement = 4 + IpPrefixOriginUnchanged = 1 << 4 +) + +// Enum NL_SUFFIX_ORIGIN for [IpAdapterUnicastAddress], see +// https://learn.microsoft.com/en-us/windows/win32/api/nldef/ne-nldef-nl_suffix_origin +const ( + NlsoOther = 0 + NlsoManual = 1 + NlsoWellKnown = 2 + NlsoDhcp = 3 + NlsoLinkLayerAddress = 4 + NlsoRandom = 5 + IpSuffixOriginOther = 0 + IpSuffixOriginManual = 1 + IpSuffixOriginWellKnown = 2 + IpSuffixOriginDhcp = 3 + IpSuffixOriginLinkLayerAddress = 4 + IpSuffixOriginRandom = 5 + IpSuffixOriginUnchanged = 1 << 4 +) + +// Enum NL_DAD_STATE for [IpAdapterUnicastAddress], see +// https://learn.microsoft.com/en-us/windows/win32/api/nldef/ne-nldef-nl_dad_state +const ( + NldsInvalid = 0 + NldsTentative = 1 + NldsDuplicate = 2 + NldsDeprecated = 3 + NldsPreferred = 4 + IpDadStateInvalid = 0 + IpDadStateTentative = 1 + IpDadStateDuplicate = 2 + IpDadStateDeprecated = 3 + IpDadStatePreferred = 4 +) + type SocketAddress struct { Sockaddr *syscall.RawSockaddrAny SockaddrLength int32 @@ -3404,3 +3462,14 @@ type DCB struct { EvtChar byte wReserved1 uint16 } + +// Keyboard Layout Flags. +// See https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-loadkeyboardlayoutw +const ( + KLF_ACTIVATE = 0x00000001 + KLF_SUBSTITUTE_OK = 0x00000002 + KLF_REORDER = 0x00000008 + KLF_REPLACELANG = 0x00000010 + KLF_NOTELLSHELL = 0x00000080 + KLF_SETFORPROCESS = 0x00000100 +) diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/windows/zsyscall_windows.go b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/windows/zsyscall_windows.go index eba761018..9bb979a3e 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/windows/zsyscall_windows.go +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/sys/windows/zsyscall_windows.go @@ -478,12 +478,16 @@ var ( procGetDesktopWindow = moduser32.NewProc("GetDesktopWindow") procGetForegroundWindow = moduser32.NewProc("GetForegroundWindow") procGetGUIThreadInfo = moduser32.NewProc("GetGUIThreadInfo") + procGetKeyboardLayout = moduser32.NewProc("GetKeyboardLayout") procGetShellWindow = moduser32.NewProc("GetShellWindow") procGetWindowThreadProcessId = moduser32.NewProc("GetWindowThreadProcessId") procIsWindow = moduser32.NewProc("IsWindow") procIsWindowUnicode = moduser32.NewProc("IsWindowUnicode") procIsWindowVisible = moduser32.NewProc("IsWindowVisible") + procLoadKeyboardLayoutW = moduser32.NewProc("LoadKeyboardLayoutW") procMessageBoxW = moduser32.NewProc("MessageBoxW") + procToUnicodeEx = moduser32.NewProc("ToUnicodeEx") + procUnloadKeyboardLayout = moduser32.NewProc("UnloadKeyboardLayout") procCreateEnvironmentBlock = moduserenv.NewProc("CreateEnvironmentBlock") procDestroyEnvironmentBlock = moduserenv.NewProc("DestroyEnvironmentBlock") procGetUserProfileDirectoryW = moduserenv.NewProc("GetUserProfileDirectoryW") @@ -789,6 +793,14 @@ func FreeSid(sid *SID) (err error) { return } +func GetAce(acl *ACL, aceIndex uint32, pAce **ACCESS_ALLOWED_ACE) (err error) { + r1, _, e1 := syscall.Syscall(procGetAce.Addr(), 3, uintptr(unsafe.Pointer(acl)), uintptr(aceIndex), uintptr(unsafe.Pointer(pAce))) + if r1 == 0 { + err = errnoErr(e1) + } + return +} + func GetLengthSid(sid *SID) (len uint32) { r0, _, _ := syscall.Syscall(procGetLengthSid.Addr(), 1, uintptr(unsafe.Pointer(sid)), 0, 0) len = uint32(r0) @@ -1225,14 +1237,6 @@ func setEntriesInAcl(countExplicitEntries uint32, explicitEntries *EXPLICIT_ACCE return } -func GetAce(acl *ACL, aceIndex uint32, pAce **ACCESS_ALLOWED_ACE) (ret error) { - r0, _, _ := syscall.Syscall(procGetAce.Addr(), 3, uintptr(unsafe.Pointer(acl)), uintptr(aceIndex), uintptr(unsafe.Pointer(pAce))) - if r0 == 0 { - ret = GetLastError() - } - return -} - func SetKernelObjectSecurity(handle Handle, securityInformation SECURITY_INFORMATION, securityDescriptor *SECURITY_DESCRIPTOR) (err error) { r1, _, e1 := syscall.Syscall(procSetKernelObjectSecurity.Addr(), 3, uintptr(handle), uintptr(securityInformation), uintptr(unsafe.Pointer(securityDescriptor))) if r1 == 0 { @@ -4082,6 +4086,12 @@ func GetGUIThreadInfo(thread uint32, info *GUIThreadInfo) (err error) { return } +func GetKeyboardLayout(tid uint32) (hkl Handle) { + r0, _, _ := syscall.Syscall(procGetKeyboardLayout.Addr(), 1, uintptr(tid), 0, 0) + hkl = Handle(r0) + return +} + func GetShellWindow() (shellWindow HWND) { r0, _, _ := syscall.Syscall(procGetShellWindow.Addr(), 0, 0, 0, 0) shellWindow = HWND(r0) @@ -4115,6 +4125,15 @@ func IsWindowVisible(hwnd HWND) (isVisible bool) { return } +func LoadKeyboardLayout(name *uint16, flags uint32) (hkl Handle, err error) { + r0, _, e1 := syscall.Syscall(procLoadKeyboardLayoutW.Addr(), 2, uintptr(unsafe.Pointer(name)), uintptr(flags), 0) + hkl = Handle(r0) + if hkl == 0 { + err = errnoErr(e1) + } + return +} + func MessageBox(hwnd HWND, text *uint16, caption *uint16, boxtype uint32) (ret int32, err error) { r0, _, e1 := syscall.Syscall6(procMessageBoxW.Addr(), 4, uintptr(hwnd), uintptr(unsafe.Pointer(text)), uintptr(unsafe.Pointer(caption)), uintptr(boxtype), 0, 0) ret = int32(r0) @@ -4124,6 +4143,20 @@ func MessageBox(hwnd HWND, text *uint16, caption *uint16, boxtype uint32) (ret i return } +func ToUnicodeEx(vkey uint32, scancode uint32, keystate *byte, pwszBuff *uint16, cchBuff int32, flags uint32, hkl Handle) (ret int32) { + r0, _, _ := syscall.Syscall9(procToUnicodeEx.Addr(), 7, uintptr(vkey), uintptr(scancode), uintptr(unsafe.Pointer(keystate)), uintptr(unsafe.Pointer(pwszBuff)), uintptr(cchBuff), uintptr(flags), uintptr(hkl), 0, 0) + ret = int32(r0) + return +} + +func UnloadKeyboardLayout(hkl Handle) (err error) { + r1, _, e1 := syscall.Syscall(procUnloadKeyboardLayout.Addr(), 1, uintptr(hkl), 0, 0) + if r1 == 0 { + err = errnoErr(e1) + } + return +} + func CreateEnvironmentBlock(block **uint16, token Token, inheritExisting bool) (err error) { var _p0 uint32 if inheritExisting { diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/text/LICENSE b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/text/LICENSE index 6a66aea5e..2a7cf70da 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/text/LICENSE +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/golang.org/x/text/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2009 The Go Authors. All rights reserved. +Copyright 2009 The Go Authors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -10,7 +10,7 @@ notice, this list of conditions and the following disclaimer. copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - * Neither the name of Google Inc. nor the names of its + * Neither the name of Google LLC nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. diff --git a/legacy/openstack-cinder-csi-driver-operator/vendor/modules.txt b/legacy/openstack-cinder-csi-driver-operator/vendor/modules.txt index 2a961c696..37bfedaa7 100644 --- a/legacy/openstack-cinder-csi-driver-operator/vendor/modules.txt +++ b/legacy/openstack-cinder-csi-driver-operator/vendor/modules.txt @@ -62,6 +62,9 @@ github.com/go-openapi/jsonreference/internal # github.com/go-openapi/swag v0.23.0 ## explicit; go 1.20 github.com/go-openapi/swag +# github.com/gofrs/uuid/v5 v5.3.0 +## explicit; go 1.19 +github.com/gofrs/uuid/v5 # github.com/gogo/protobuf v1.3.2 ## explicit; go 1.15 github.com/gogo/protobuf/gogoproto @@ -126,26 +129,26 @@ github.com/google/pprof/profile # github.com/google/uuid v1.6.0 ## explicit github.com/google/uuid -# github.com/gophercloud/gophercloud v1.13.0 -## explicit; go 1.14 -github.com/gophercloud/gophercloud -github.com/gophercloud/gophercloud/openstack -github.com/gophercloud/gophercloud/openstack/blockstorage/extensions/availabilityzones -github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/availabilityzones -github.com/gophercloud/gophercloud/openstack/identity/v2/tenants -github.com/gophercloud/gophercloud/openstack/identity/v2/tokens -github.com/gophercloud/gophercloud/openstack/identity/v3/extensions/ec2tokens -github.com/gophercloud/gophercloud/openstack/identity/v3/extensions/oauth1 -github.com/gophercloud/gophercloud/openstack/identity/v3/tokens -github.com/gophercloud/gophercloud/openstack/utils -github.com/gophercloud/gophercloud/pagination -# github.com/gophercloud/utils v0.0.0-20231010081019-80377eca5d56 -## explicit; go 1.15 -github.com/gophercloud/utils/env -github.com/gophercloud/utils/gnocchi -github.com/gophercloud/utils/internal -github.com/gophercloud/utils/openstack/clientconfig -github.com/gophercloud/utils/openstack/compute/v2/availabilityzones +# github.com/gophercloud/gophercloud/v2 v2.1.0 +## explicit; go 1.22 +github.com/gophercloud/gophercloud/v2 +github.com/gophercloud/gophercloud/v2/openstack +github.com/gophercloud/gophercloud/v2/openstack/blockstorage/v3/availabilityzones +github.com/gophercloud/gophercloud/v2/openstack/compute/v2/availabilityzones +github.com/gophercloud/gophercloud/v2/openstack/identity/v2/tenants +github.com/gophercloud/gophercloud/v2/openstack/identity/v2/tokens +github.com/gophercloud/gophercloud/v2/openstack/identity/v3/ec2tokens +github.com/gophercloud/gophercloud/v2/openstack/identity/v3/oauth1 +github.com/gophercloud/gophercloud/v2/openstack/identity/v3/tokens +github.com/gophercloud/gophercloud/v2/openstack/utils +github.com/gophercloud/gophercloud/v2/pagination +# github.com/gophercloud/utils/v2 v2.0.0-20240812072210-8ce1fc0f2894 +## explicit; go 1.22 +github.com/gophercloud/utils/v2/env +github.com/gophercloud/utils/v2/gnocchi +github.com/gophercloud/utils/v2/internal +github.com/gophercloud/utils/v2/openstack/clientconfig +github.com/gophercloud/utils/v2/openstack/compute/v2/availabilityzones # github.com/gorilla/websocket v1.5.1 ## explicit; go 1.20 # github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 @@ -156,9 +159,6 @@ github.com/grpc-ecosystem/go-grpc-prometheus github.com/grpc-ecosystem/grpc-gateway/v2/internal/httprule github.com/grpc-ecosystem/grpc-gateway/v2/runtime github.com/grpc-ecosystem/grpc-gateway/v2/utilities -# github.com/hashicorp/go-uuid v1.0.3 -## explicit -github.com/hashicorp/go-uuid # github.com/imdario/mergo v0.3.7 ## explicit github.com/imdario/mergo @@ -524,10 +524,10 @@ golang.org/x/net/websocket ## explicit; go 1.18 golang.org/x/oauth2 golang.org/x/oauth2/internal -# golang.org/x/sync v0.7.0 +# golang.org/x/sync v0.8.0 ## explicit; go 1.18 golang.org/x/sync/singleflight -# golang.org/x/sys v0.22.0 +# golang.org/x/sys v0.24.0 ## explicit; go 1.18 golang.org/x/sys/cpu golang.org/x/sys/plan9 @@ -537,7 +537,7 @@ golang.org/x/sys/windows/registry # golang.org/x/term v0.22.0 ## explicit; go 1.18 golang.org/x/term -# golang.org/x/text v0.16.0 +# golang.org/x/text v0.17.0 ## explicit; go 1.18 golang.org/x/text/encoding golang.org/x/text/encoding/charmap