From 07d28ef6f1ce597d961f9df603f79214fd2a72d2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 25 Oct 2023 21:22:19 +0000 Subject: [PATCH] build(deps): bump google.golang.org/grpc from 1.57.0 to 1.57.1 Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.57.0 to 1.57.1. - [Release notes](https://github.com/grpc/grpc-go/releases) - [Commits](https://github.com/grpc/grpc-go/compare/v1.57.0...v1.57.1) --- updated-dependencies: - dependency-name: google.golang.org/grpc dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- go.mod | 5 +- go.sum | 40 +---------- .../go/compute/metadata/metadata.go | 6 +- .../api/container/containerv1/clusters.go | 47 ++++++------- .../api/container/containerv1/openshift.go | 8 +-- .../bluemix-go/endpoints/endpoints.go | 4 +- .../IBM-Cloud/bluemix-go/helpers/file.go | 7 +- .../IBM-Cloud/bluemix-go/rest/client.go | 3 +- .../aws/aws-sdk-go/aws/client/logger.go | 3 +- .../aws-sdk-go/aws/corehandlers/handlers.go | 6 +- .../aws/credentials/processcreds/provider.go | 3 +- .../aws/credentials/ssocreds/provider.go | 4 +- .../stscreds/web_identity_provider.go | 4 +- .../aws/aws-sdk-go/aws/request/request.go | 3 +- .../aws/aws-sdk-go/aws/session/session.go | 7 +- .../aws/aws-sdk-go/aws/signer/v4/v4.go | 3 +- .../aws/aws-sdk-go/internal/ini/ini_lexer.go | 3 +- .../protocol/jsonrpc/unmarshal_error.go | 3 +- .../aws-sdk-go/private/protocol/payload.go | 3 +- .../private/protocol/rest/unmarshal.go | 11 +-- .../protocol/restjson/unmarshal_error.go | 3 +- .../aws-sdk-go/private/protocol/unmarshal.go | 3 +- vendor/github.com/go-openapi/swag/loading.go | 9 ++- .../protoc-gen-gogo/descriptor/descriptor.go | 4 +- .../golang/protobuf/descriptor/descriptor.go | 4 +- .../golang/protobuf/proto/registry.go | 4 +- .../google/gnostic/compiler/reader.go | 7 +- .../google/gnostic/extensions/extensions.go | 4 +- .../google/gnostic/jsonschema/reader.go | 5 +- .../grpc-gateway/runtime/marshal_proto.go | 6 +- .../grpc-gateway/utilities/readerfactory.go | 3 +- vendor/github.com/modern-go/concurrent/log.go | 4 +- .../prometheus/common/expfmt/text_create.go | 3 +- vendor/golang.org/x/net/websocket/hybi.go | 5 +- .../golang.org/x/net/websocket/websocket.go | 7 +- .../google/internal/externalaccount/aws.go | 11 +-- .../externalaccount/executablecredsource.go | 3 +- .../externalaccount/filecredsource.go | 3 +- .../internal/externalaccount/impersonate.go | 3 +- .../internal/externalaccount/sts_exchange.go | 3 +- .../internal/externalaccount/urlcredsource.go | 3 +- vendor/golang.org/x/oauth2/internal/token.go | 3 +- vendor/golang.org/x/oauth2/jwt/jwt.go | 3 +- .../appengine/internal/api.go | 6 +- .../appengine/internal/metadata.go | 4 +- .../appengine/urlfetch/urlfetch.go | 3 +- .../grpc/internal/transport/http2_server.go | 11 +-- vendor/google.golang.org/grpc/server.go | 69 +++++++++++++------ vendor/google.golang.org/grpc/version.go | 2 +- .../protobuf/internal/impl/legacy_file.go | 4 +- .../pkg/util/httpstream/spdy/roundtripper.go | 4 +- vendor/k8s.io/client-go/rest/config.go | 5 +- vendor/k8s.io/client-go/rest/request.go | 13 ++-- vendor/k8s.io/client-go/rest/with_retry.go | 3 +- .../k8s.io/client-go/tools/auth/clientauth.go | 4 +- .../client-go/tools/clientcmd/api/helpers.go | 3 +- .../client-go/tools/clientcmd/auth_loaders.go | 3 +- .../tools/clientcmd/client_config.go | 5 +- .../client-go/tools/clientcmd/loader.go | 9 +-- .../tools/remotecommand/errorstream.go | 3 +- .../client-go/tools/remotecommand/v1.go | 3 +- .../client-go/tools/remotecommand/v2.go | 7 +- .../client-go/transport/token_source.go | 6 +- .../k8s.io/client-go/transport/transport.go | 4 +- vendor/k8s.io/client-go/util/cert/cert.go | 10 +-- vendor/k8s.io/client-go/util/cert/io.go | 7 +- vendor/k8s.io/client-go/util/keyutil/key.go | 9 +-- vendor/modules.txt | 4 +- .../pkg/token/filecache.go | 5 +- .../aws-iam-authenticator/pkg/token/token.go | 4 +- 70 files changed, 257 insertions(+), 229 deletions(-) diff --git a/go.mod b/go.mod index c94d55d8..e37c40f0 100644 --- a/go.mod +++ b/go.mod @@ -14,8 +14,9 @@ require ( github.com/portworx/sched-ops v1.20.4-rc1.0.20230207140221-24ec094deec4 github.com/sirupsen/logrus v1.9.0 go.uber.org/multierr v1.7.0 + golang.org/x/net v0.10.0 golang.org/x/oauth2 v0.8.0 - google.golang.org/grpc v1.57.0 + google.golang.org/grpc v1.57.1 ) require ( @@ -44,7 +45,6 @@ require ( github.com/go-openapi/jsonreference v0.20.0 // indirect github.com/go-openapi/swag v0.19.14 // indirect github.com/gofrs/flock v0.8.1 // indirect - github.com/golang/glog v1.1.2 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/google/gnostic v0.5.7-v3refs // indirect github.com/google/go-cmp v0.5.9 // indirect @@ -66,7 +66,6 @@ require ( github.com/prometheus/procfs v0.8.0 // indirect github.com/spf13/pflag v1.0.5 // indirect go.uber.org/atomic v1.9.0 // indirect - golang.org/x/net v0.10.0 // indirect golang.org/x/sys v0.8.0 // indirect golang.org/x/term v0.8.0 // indirect golang.org/x/text v0.9.0 // indirect diff --git a/go.sum b/go.sum index bbfbb9d2..4ab0abe2 100644 --- a/go.sum +++ b/go.sum @@ -130,8 +130,6 @@ cloud.google.com/go/compute v1.10.0/go.mod h1:ER5CLbMxl90o2jtNbGSbtfOpQKR0t15FOt cloud.google.com/go/compute v1.12.0/go.mod h1:e8yNOBcBONZU1vJKCvCoDw/4JQsA0dpM4x/6PIIOocU= cloud.google.com/go/compute v1.12.1/go.mod h1:e8yNOBcBONZU1vJKCvCoDw/4JQsA0dpM4x/6PIIOocU= cloud.google.com/go/compute v1.13.0/go.mod h1:5aPTS0cUNMIc1CE546K+Th6weJUNQErARyZtRXDJ8GE= -cloud.google.com/go/compute v1.20.1 h1:6aKEtlUiwEpJzM001l0yFkpXmUVXaN8W+fbkb2AZNbg= -cloud.google.com/go/compute v1.20.1/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM= cloud.google.com/go/compute v1.23.0 h1:tP41Zoavr8ptEqaW6j+LQOnyBBhO7OkOMAGrgLopTwY= cloud.google.com/go/compute v1.23.0/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM= cloud.google.com/go/compute/metadata v0.1.0/go.mod h1:Z1VN+bulIf6bt4P/C37K4DyZYZEXYonfTBHHFPO/4UU= @@ -1344,10 +1342,6 @@ github.com/golang-sql/sqlexp v0.1.0/go.mod h1:J4ad9Vo8ZCWQ2GMrC4UCQy1JpCbwU9m3EO github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= -github.com/golang/glog v1.1.1 h1:jxpi2eWoU84wbX9iIEyAeeoac3FLuifZpY9tcNUD9kw= -github.com/golang/glog v1.1.1/go.mod h1:zR+okUeTbrL6EL3xHUDxZuEtGv04p5shwip1+mL/rLQ= -github.com/golang/glog v1.1.2 h1:DVjP2PbBOzHyzA+dn3WhHIq4NdVu3Q+pvivFICf/7fo= -github.com/golang/glog v1.1.2/go.mod h1:zR+okUeTbrL6EL3xHUDxZuEtGv04p5shwip1+mL/rLQ= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -3819,38 +3813,10 @@ google.golang.org/genproto v0.0.0-20221117204609-8f9c96812029/go.mod h1:rZS5c/ZV google.golang.org/genproto v0.0.0-20221118155620-16455021b5e6/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= google.golang.org/genproto v0.0.0-20221201164419-0e50fba7f41c/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= google.golang.org/genproto v0.0.0-20221205194025-8222ab48f5fc/go.mod h1:1dOng4TWOomJrDGhpXjfCD35wQC6jnC7HpRmOFRqEV0= -google.golang.org/genproto v0.0.0-20230711160842-782d3b101e98 h1:Z0hjGZePRE0ZBWotvtrwxFNrNE9CUAGtplaDK5NNI/g= -google.golang.org/genproto v0.0.0-20230711160842-782d3b101e98/go.mod h1:S7mY02OqCJTD0E1OiQy1F72PWFB4bZJ87cAtLPYgDR0= -google.golang.org/genproto v0.0.0-20230725213213-b022f6e96895 h1:f4HtRHVw5oEuUSMwhzcRW+w4X9++1iU+MZ9cRAHbWxk= -google.golang.org/genproto v0.0.0-20230725213213-b022f6e96895/go.mod h1:0ggbjUrZYpy1q+ANUS30SEoGZ53cdfwtbuG7Ptgy108= -google.golang.org/genproto v0.0.0-20230726155614-23370e0ffb3e h1:xIXmWJ303kJCuogpj0bHq+dcjcZHU+XFyc1I0Yl9cRg= -google.golang.org/genproto v0.0.0-20230726155614-23370e0ffb3e/go.mod h1:0ggbjUrZYpy1q+ANUS30SEoGZ53cdfwtbuG7Ptgy108= -google.golang.org/genproto v0.0.0-20230731193218-e0aa005b6bdf h1:v5Cf4E9+6tawYrs/grq1q1hFpGtzlGFzgWHqwt6NFiU= -google.golang.org/genproto v0.0.0-20230731193218-e0aa005b6bdf/go.mod h1:oH/ZOT02u4kWEp7oYBGYFFkCdKS/uYR9Z7+0/xuuFp8= -google.golang.org/genproto v0.0.0-20230822172742-b8732ec3820d h1:VBu5YqKPv6XiJ199exd8Br+Aetz+o08F+PLMnwJQHAY= -google.golang.org/genproto v0.0.0-20230822172742-b8732ec3820d/go.mod h1:yZTlhN0tQnXo3h00fuXNCxJdLdIdnVFVBaRJ5LWBbw4= -google.golang.org/genproto v0.0.0-20230911183012-2d3300fd4832 h1:/30npZKtUjXqju7ZA2MsvpkGKD4mQFtf+zPnZasABjg= -google.golang.org/genproto v0.0.0-20230911183012-2d3300fd4832/go.mod h1:yZTlhN0tQnXo3h00fuXNCxJdLdIdnVFVBaRJ5LWBbw4= google.golang.org/genproto v0.0.0-20230913181813-007df8e322eb h1:XFBgcDwm7irdHTbz4Zk2h7Mh+eis4nfJEFQFYzJzuIA= google.golang.org/genproto v0.0.0-20230913181813-007df8e322eb/go.mod h1:yZTlhN0tQnXo3h00fuXNCxJdLdIdnVFVBaRJ5LWBbw4= -google.golang.org/genproto/googleapis/api v0.0.0-20230711160842-782d3b101e98 h1:FmF5cCW94Ij59cfpoLiwTgodWmm60eEV0CjlsVg2fuw= -google.golang.org/genproto/googleapis/api v0.0.0-20230711160842-782d3b101e98/go.mod h1:rsr7RhLuwsDKL7RmgDDCUc6yaGr1iqceVb5Wv6f6YvQ= -google.golang.org/genproto/googleapis/api v0.0.0-20230725213213-b022f6e96895 h1:9rcwSXpqHEULy96NKetvTJMCLnvnod0LcF8A/ULEBxE= -google.golang.org/genproto/googleapis/api v0.0.0-20230725213213-b022f6e96895/go.mod h1:rsr7RhLuwsDKL7RmgDDCUc6yaGr1iqceVb5Wv6f6YvQ= -google.golang.org/genproto/googleapis/api v0.0.0-20230726155614-23370e0ffb3e h1:z3vDksarJxsAKM5dmEGv0GHwE2hKJ096wZra71Vs4sw= -google.golang.org/genproto/googleapis/api v0.0.0-20230726155614-23370e0ffb3e/go.mod h1:rsr7RhLuwsDKL7RmgDDCUc6yaGr1iqceVb5Wv6f6YvQ= -google.golang.org/genproto/googleapis/api v0.0.0-20230731193218-e0aa005b6bdf h1:xkVZ5FdZJF4U82Q/JS+DcZA83s/GRVL+QrFMlexk9Yo= -google.golang.org/genproto/googleapis/api v0.0.0-20230731193218-e0aa005b6bdf/go.mod h1:5DZzOUPCLYL3mNkQ0ms0F3EuUNZ7py1Bqeq6sxzI7/Q= -google.golang.org/genproto/googleapis/api v0.0.0-20230822172742-b8732ec3820d h1:DoPTO70H+bcDXcd39vOqb2viZxgqeBeSGtZ55yZU4/Q= -google.golang.org/genproto/googleapis/api v0.0.0-20230822172742-b8732ec3820d/go.mod h1:KjSP20unUpOx5kyQUFa7k4OJg0qeJ7DEZflGDu2p6Bk= -google.golang.org/genproto/googleapis/api v0.0.0-20230911183012-2d3300fd4832 h1:4E7rZzBdR5LmiZx6n47Dg4AjH8JLhMQWywsYqvXNLcs= -google.golang.org/genproto/googleapis/api v0.0.0-20230911183012-2d3300fd4832/go.mod h1:KjSP20unUpOx5kyQUFa7k4OJg0qeJ7DEZflGDu2p6Bk= google.golang.org/genproto/googleapis/api v0.0.0-20230913181813-007df8e322eb h1:lK0oleSc7IQsUxO3U5TjL9DWlsxpEBemh+zpB7IqhWI= google.golang.org/genproto/googleapis/api v0.0.0-20230913181813-007df8e322eb/go.mod h1:KjSP20unUpOx5kyQUFa7k4OJg0qeJ7DEZflGDu2p6Bk= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230706204954-ccb25ca9f130 h1:2FZP5XuJY9zQyGM5N0rtovnoXjiMUEIUMvw0m9wlpLc= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230706204954-ccb25ca9f130/go.mod h1:8mL13HKkDa+IuJ8yruA3ci0q+0vsUz4m//+ottjwS5o= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230731190214-cbb8c96f2d6d h1:pgIUhmqwKOUlnKna4r6amKdUngdL8DrkpFeV8+VBElY= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230731190214-cbb8c96f2d6d/go.mod h1:TUfxEVdsvPg18p6AslUXFoLdpED4oBnGwyqk3dV1XzM= google.golang.org/genproto/googleapis/rpc v0.0.0-20230803162519-f966b187b2e5 h1:eSaPbMR4T7WfH9FvABk36NBMacoTUKdWCvV0dx+KfOg= google.golang.org/genproto/googleapis/rpc v0.0.0-20230803162519-f966b187b2e5/go.mod h1:zBEcrKX2ZOcEkHWxBPAIvYUWOKKMIhYcmNiUIu2ji3I= google.golang.org/grpc v0.0.0-20160317175043-d3ddb4469d5a/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= @@ -3907,10 +3873,8 @@ google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCD google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.51.0/go.mod h1:wgNDFcnuBGmxLKI/qn4T+m5BtEBYXJPvibbUPsAIPww= -google.golang.org/grpc v1.56.2 h1:fVRFRnXvU+x6C4IlHZewvJOVHoOv1TUuQyoRsYnB4bI= -google.golang.org/grpc v1.56.2/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s= -google.golang.org/grpc v1.57.0 h1:kfzNeI/klCGD2YPMUlaGNT3pxvYfga7smW3Vth8Zsiw= -google.golang.org/grpc v1.57.0/go.mod h1:Sd+9RMTACXwmub0zcNY2c4arhtrbBYD1AUHI/dt16Mo= +google.golang.org/grpc v1.57.1 h1:upNTNqv0ES+2ZOOqACwVtS3Il8M12/+Hz41RCPzAjQg= +google.golang.org/grpc v1.57.1/go.mod h1:Sd+9RMTACXwmub0zcNY2c4arhtrbBYD1AUHI/dt16Mo= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= diff --git a/vendor/cloud.google.com/go/compute/metadata/metadata.go b/vendor/cloud.google.com/go/compute/metadata/metadata.go index d32262d4..c17faa14 100644 --- a/vendor/cloud.google.com/go/compute/metadata/metadata.go +++ b/vendor/cloud.google.com/go/compute/metadata/metadata.go @@ -23,7 +23,7 @@ import ( "context" "encoding/json" "fmt" - "io" + "io/ioutil" "net" "net/http" "net/url" @@ -197,7 +197,7 @@ func systemInfoSuggestsGCE() bool { // We don't have any non-Linux clues available, at least yet. return false } - slurp, _ := os.ReadFile("/sys/class/dmi/id/product_name") + slurp, _ := ioutil.ReadFile("/sys/class/dmi/id/product_name") name := strings.TrimSpace(string(slurp)) return name == "Google" || name == "Google Compute Engine" } @@ -336,7 +336,7 @@ func (c *Client) getETag(suffix string) (value, etag string, err error) { if res.StatusCode == http.StatusNotFound { return "", "", NotDefinedError(suffix) } - all, err := io.ReadAll(res.Body) + all, err := ioutil.ReadAll(res.Body) if err != nil { return "", "", err } diff --git a/vendor/github.com/IBM-Cloud/bluemix-go/api/container/containerv1/clusters.go b/vendor/github.com/IBM-Cloud/bluemix-go/api/container/containerv1/clusters.go index 92cdef79..10d9918e 100644 --- a/vendor/github.com/IBM-Cloud/bluemix-go/api/container/containerv1/clusters.go +++ b/vendor/github.com/IBM-Cloud/bluemix-go/api/container/containerv1/clusters.go @@ -5,6 +5,7 @@ import ( "errors" "fmt" "html/template" + "io/ioutil" "os" "path" "path/filepath" @@ -426,11 +427,11 @@ func (r *clusters) GetClusterConfig(name, dir string, admin bool, target Cluster } defer helpers.RemoveFilesWithPattern(resultDir, "[^(.yml)|(.pem)]$") var kubedir, kubeyml string - files, _ := os.ReadDir(resultDir) + files, _ := ioutil.ReadDir(resultDir) for _, f := range files { if f.IsDir() && strings.HasPrefix(f.Name(), "kube") { kubedir = filepath.Join(resultDir, f.Name()) - files, _ := os.ReadDir(kubedir) + files, _ := ioutil.ReadDir(kubedir) for _, f := range files { old := filepath.Join(kubedir, f.Name()) new := filepath.Join(kubedir, "../", f.Name()) @@ -461,14 +462,14 @@ func (r *clusters) GetClusterConfig(name, dir string, admin bool, target Cluster if clusterInfo.Type == "openshift" { trace.Logger.Println("Debug: type is openshift trying login to get token") var yamlConfig []byte - if yamlConfig, err = os.ReadFile(kubeyml); err != nil { + if yamlConfig, err = ioutil.ReadFile(kubeyml); err != nil { return "", err } yamlConfig, err = r.FetchOCTokenForKubeConfig(yamlConfig, &clusterInfo, clusterInfo.IsStagingSatelliteCluster()) if err != nil { return "", err } - err = os.WriteFile(kubeyml, yamlConfig, 0644) // 0644 is irrelevant here, since file already exists. + err = ioutil.WriteFile(kubeyml, yamlConfig, 0644) // 0644 is irrelevant here, since file already exists. if err != nil { return "", err } @@ -512,13 +513,13 @@ func (r *clusters) GetClusterConfigDetail(name, dir string, admin bool, target C } defer helpers.RemoveFilesWithPattern(resultDir, "[^(.yml)|(.pem)]$") var kubedir, kubeyml string - files, _ := os.ReadDir(resultDir) + files, _ := ioutil.ReadDir(resultDir) for _, f := range files { if f.IsDir() && strings.HasPrefix(f.Name(), "kube") { kubedir = filepath.Join(resultDir, f.Name()) - files, _ := os.ReadDir(kubedir) + files, _ := ioutil.ReadDir(kubedir) for _, f := range files { - fileContent, _ := os.ReadFile(kubedir + "/" + f.Name()) + fileContent, _ := ioutil.ReadFile(kubedir + "/" + f.Name()) if f.Name() == "admin-key.pem" { clusterkey.AdminKey = string(fileContent) } @@ -546,7 +547,7 @@ func (r *clusters) GetClusterConfigDetail(name, dir string, admin bool, target C return clusterkey, errors.New("Unable to locate kube config in zip archive") } - kubefile, _ := os.ReadFile(kubeyml) + kubefile, _ := ioutil.ReadFile(kubeyml) var yamlConfig ConfigFile err = yaml.Unmarshal(kubefile, &yamlConfig) if err != nil { @@ -571,18 +572,18 @@ func (r *clusters) GetClusterConfigDetail(name, dir string, admin bool, target C if clusterInfo.Type == "openshift" { trace.Logger.Println("Debug: type is openshift trying login to get token") var yamlConfig []byte - if yamlConfig, err = os.ReadFile(kubeyml); err != nil { + if yamlConfig, err = ioutil.ReadFile(kubeyml); err != nil { return clusterkey, err } yamlConfig, err = r.FetchOCTokenForKubeConfig(yamlConfig, &clusterInfo, clusterInfo.IsStagingSatelliteCluster()) if err != nil { return clusterkey, err } - err = os.WriteFile(kubeyml, yamlConfig, 0644) // 0644 is irrelevant here, since file already exists. + err = ioutil.WriteFile(kubeyml, yamlConfig, 0644) // 0644 is irrelevant here, since file already exists. if err != nil { return clusterkey, err } - openshiftyml, _ := os.ReadFile(kubeyml) + openshiftyml, _ := ioutil.ReadFile(kubeyml) var openshiftyaml ConfigFileOpenshift err = yaml.Unmarshal(openshiftyml, &openshiftyaml) if err != nil { @@ -646,7 +647,7 @@ func (r *clusters) StoreConfig(name, dir string, admin, createCalicoConfig bool, return "", "", err } trace.Logger.Println("Located unzipped directory: ", unzipConfigPath) - files, _ := os.ReadDir(unzipConfigPath) + files, _ := ioutil.ReadDir(unzipConfigPath) for _, f := range files { old := filepath.Join(unzipConfigPath, f.Name()) new := filepath.Join(unzipConfigPath, "../", f.Name()) @@ -660,7 +661,7 @@ func (r *clusters) StoreConfig(name, dir string, admin, createCalicoConfig bool, return "", "", err } // Locate the yaml file and return the new path - baseDirFiles, err := os.ReadDir(resultDir) + baseDirFiles, err := ioutil.ReadDir(resultDir) if err != nil { return "", "", err } @@ -694,14 +695,14 @@ func (r *clusters) StoreConfig(name, dir string, admin, createCalicoConfig bool, if clusterInfo.Type == "openshift" { trace.Logger.Println("Cluster Type is openshift trying login to get token") var yamlConfig []byte - if yamlConfig, err = os.ReadFile(kubeconfigFileName); err != nil { + if yamlConfig, err = ioutil.ReadFile(kubeconfigFileName); err != nil { return "", "", err } yamlConfig, err = r.FetchOCTokenForKubeConfig(yamlConfig, &clusterInfo, clusterInfo.IsStagingSatelliteCluster()) if err != nil { return "", "", err } - err = os.WriteFile(kubeconfigFileName, yamlConfig, 0644) // check about permissions and truncate + err = ioutil.WriteFile(kubeconfigFileName, yamlConfig, 0644) // check about permissions and truncate if err != nil { return "", "", err } @@ -752,9 +753,9 @@ func (r *clusters) StoreConfigDetail(name, dir string, admin, createCalicoConfig return "", clusterkey, err } trace.Logger.Println("Located unzipped directory: ", unzipConfigPath) - files, _ := os.ReadDir(unzipConfigPath) + files, _ := ioutil.ReadDir(unzipConfigPath) for _, f := range files { - fileContent, _ := os.ReadFile(unzipConfigPath + "/" + f.Name()) + fileContent, _ := ioutil.ReadFile(unzipConfigPath + "/" + f.Name()) if f.Name() == "admin-key.pem" { clusterkey.AdminKey = string(fileContent) } @@ -776,7 +777,7 @@ func (r *clusters) StoreConfigDetail(name, dir string, admin, createCalicoConfig return "", clusterkey, err } // Locate the yaml file and return the new path - baseDirFiles, err := os.ReadDir(resultDir) + baseDirFiles, err := ioutil.ReadDir(resultDir) if err != nil { return "", clusterkey, err } @@ -798,7 +799,7 @@ func (r *clusters) StoreConfigDetail(name, dir string, admin, createCalicoConfig if kubeconfigFileName == "" { return "", clusterkey, errors.New("Unable to locate kube config in zip archive") } - kubefile, _ := os.ReadFile(kubeconfigFileName) + kubefile, _ := ioutil.ReadFile(kubeconfigFileName) var yamlConfig ConfigFile err = yaml.Unmarshal(kubefile, &yamlConfig) if err != nil { @@ -823,18 +824,18 @@ func (r *clusters) StoreConfigDetail(name, dir string, admin, createCalicoConfig if clusterInfo.Type == "openshift" { trace.Logger.Println("Cluster Type is openshift trying login to get token") var yamlConfig []byte - if yamlConfig, err = os.ReadFile(kubeconfigFileName); err != nil { + if yamlConfig, err = ioutil.ReadFile(kubeconfigFileName); err != nil { return "", clusterkey, err } yamlConfig, err = r.FetchOCTokenForKubeConfig(yamlConfig, &clusterInfo, clusterInfo.IsStagingSatelliteCluster()) if err != nil { return "", clusterkey, err } - err = os.WriteFile(kubeconfigFileName, yamlConfig, 0644) // check about permissions and truncate + err = ioutil.WriteFile(kubeconfigFileName, yamlConfig, 0644) // check about permissions and truncate if err != nil { return "", clusterkey, err } - openshiftyml, _ := os.ReadFile(kubeconfigFileName) + openshiftyml, _ := ioutil.ReadFile(kubeconfigFileName) var openshiftyaml ConfigFileOpenshift err = yaml.Unmarshal(openshiftyml, &openshiftyaml) if err != nil { @@ -858,7 +859,7 @@ func (r *clusters) StoreConfigDetail(name, dir string, admin, createCalicoConfig //kubeConfigDir ... func kubeConfigDir(baseDir string) (string, error) { - baseDirFiles, err := os.ReadDir(baseDir) + baseDirFiles, err := ioutil.ReadDir(baseDir) if err != nil { return "", err } diff --git a/vendor/github.com/IBM-Cloud/bluemix-go/api/container/containerv1/openshift.go b/vendor/github.com/IBM-Cloud/bluemix-go/api/container/containerv1/openshift.go index ad897303..06c87856 100644 --- a/vendor/github.com/IBM-Cloud/bluemix-go/api/container/containerv1/openshift.go +++ b/vendor/github.com/IBM-Cloud/bluemix-go/api/container/containerv1/openshift.go @@ -19,7 +19,7 @@ import ( "encoding/base64" "errors" "fmt" - "io" + "io/ioutil" "net/http" "net/url" "regexp" @@ -144,7 +144,7 @@ func (r *clusters) FetchOCTokenForKubeConfig(kubecfg []byte, cMeta *ClusterInfo, } defer resp.Body.Close() if resp.StatusCode > 299 { - msg, _ := io.ReadAll(resp.Body) + msg, _ := ioutil.ReadAll(resp.Body) return nil, fmt.Errorf("Bad status code [%d] returned when fetching Cluster authentication endpoints: %s", resp.StatusCode, msg) } auth.ServerURL = meta.ServerURL @@ -222,7 +222,7 @@ func (r *clusters) openShiftAuthorizePasscode(authEP *authEndpoints, passcode st defer resp.Body.Close() if resp.StatusCode > 399 { if try >= 3 { - msg, _ := io.ReadAll(resp.Body) + msg, _ := ioutil.ReadAll(resp.Body) return "", "", fmt.Errorf("Bad status code [%d] returned when openshift login: %s", resp.StatusCode, string(msg)) } time.Sleep(200 * time.Millisecond) @@ -259,7 +259,7 @@ func (r *clusters) getOpenShiftUser(authEP *authEndpoints, token string) (string } defer resp.Body.Close() if resp.StatusCode > 299 { - msg, _ := io.ReadAll(resp.Body) + msg, _ := ioutil.ReadAll(resp.Body) return "", fmt.Errorf("Bad status code [%d] returned when fetching OpenShift user Details: %s", resp.StatusCode, string(msg)) } diff --git a/vendor/github.com/IBM-Cloud/bluemix-go/endpoints/endpoints.go b/vendor/github.com/IBM-Cloud/bluemix-go/endpoints/endpoints.go index 344e95b2..fa806b6a 100644 --- a/vendor/github.com/IBM-Cloud/bluemix-go/endpoints/endpoints.go +++ b/vendor/github.com/IBM-Cloud/bluemix-go/endpoints/endpoints.go @@ -3,7 +3,7 @@ package endpoints import ( "encoding/json" "fmt" - "io" + "io/ioutil" "log" "os" @@ -115,7 +115,7 @@ func NewEndpointLocator(region, visibility, file string) EndpointLocator { log.Fatalf("Unable to open endpoints file %s", err) } defer jsonFile.Close() - bytes, err := io.ReadAll(jsonFile) + bytes, err := ioutil.ReadAll(jsonFile) if err != nil { log.Fatalf("Unable to read endpoints file %s", err) } diff --git a/vendor/github.com/IBM-Cloud/bluemix-go/helpers/file.go b/vendor/github.com/IBM-Cloud/bluemix-go/helpers/file.go index 54c88840..4ad260fb 100644 --- a/vendor/github.com/IBM-Cloud/bluemix-go/helpers/file.go +++ b/vendor/github.com/IBM-Cloud/bluemix-go/helpers/file.go @@ -3,6 +3,7 @@ package helpers import ( "fmt" "io" + "io/ioutil" "os" "path/filepath" "regexp" @@ -67,7 +68,7 @@ func CopyDir(src string, dest string) (err error) { return fmt.Errorf("Destination %s already exists.", dest) } - entries, err := os.ReadDir(src) + entries, err := ioutil.ReadDir(src) if err != nil { return } @@ -81,7 +82,7 @@ func CopyDir(src string, dest string) (err error) { srcPath := filepath.Join(src, entry.Name()) destPath := filepath.Join(dest, entry.Name()) - if entry.IsDir() { + if entry.Mode().IsDir() { err = CopyDir(srcPath, destPath) } else { err = CopyFile(srcPath, destPath) @@ -100,7 +101,7 @@ func RemoveFilesWithPattern(targetDir, pattern string) error { if err != nil { return err } - files, err := os.ReadDir(targetDir) + files, err := ioutil.ReadDir(targetDir) if err != nil { return err } diff --git a/vendor/github.com/IBM-Cloud/bluemix-go/rest/client.go b/vendor/github.com/IBM-Cloud/bluemix-go/rest/client.go index 18f0726f..aee550dc 100644 --- a/vendor/github.com/IBM-Cloud/bluemix-go/rest/client.go +++ b/vendor/github.com/IBM-Cloud/bluemix-go/rest/client.go @@ -47,6 +47,7 @@ import ( "encoding/json" "fmt" "io" + "io/ioutil" "net/http" "reflect" @@ -104,7 +105,7 @@ func (c *Client) Do(r *Request, respV interface{}, errV interface{}) (*http.Resp defer resp.Body.Close() if resp.StatusCode < 200 || resp.StatusCode > 299 { - raw, err := io.ReadAll(resp.Body) + raw, err := ioutil.ReadAll(resp.Body) if err != nil { return resp, fmt.Errorf("Error reading response: %v", err) } diff --git a/vendor/github.com/aws/aws-sdk-go/aws/client/logger.go b/vendor/github.com/aws/aws-sdk-go/aws/client/logger.go index 588addbe..5ac5c24a 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/client/logger.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/client/logger.go @@ -4,6 +4,7 @@ import ( "bytes" "fmt" "io" + "io/ioutil" "net/http/httputil" "github.com/aws/aws-sdk-go/aws" @@ -159,7 +160,7 @@ func logResponse(r *request.Request) { req.ClientInfo.ServiceName, req.Operation.Name, string(b))) if logBody { - b, err := io.ReadAll(lw.buf) + b, err := ioutil.ReadAll(lw.buf) if err != nil { lw.Logger.Log(fmt.Sprintf(logRespErrMsg, req.ClientInfo.ServiceName, req.Operation.Name, err)) diff --git a/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/handlers.go b/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/handlers.go index e39bd9cb..36a915ef 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/handlers.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/corehandlers/handlers.go @@ -3,7 +3,7 @@ package corehandlers import ( "bytes" "fmt" - "io" + "io/ioutil" "net/http" "net/url" "regexp" @@ -145,7 +145,7 @@ func handleSendError(r *request.Request, err error) { r.HTTPResponse = &http.Response{ StatusCode: int(code), Status: http.StatusText(int(code)), - Body: io.NopCloser(bytes.NewReader([]byte{})), + Body: ioutil.NopCloser(bytes.NewReader([]byte{})), } return } @@ -156,7 +156,7 @@ func handleSendError(r *request.Request, err error) { r.HTTPResponse = &http.Response{ StatusCode: int(0), Status: http.StatusText(int(0)), - Body: io.NopCloser(bytes.NewReader([]byte{})), + Body: ioutil.NopCloser(bytes.NewReader([]byte{})), } } // Catch all request errors, and let the default retrier determine diff --git a/vendor/github.com/aws/aws-sdk-go/aws/credentials/processcreds/provider.go b/vendor/github.com/aws/aws-sdk-go/aws/credentials/processcreds/provider.go index 6040445b..e6248360 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/credentials/processcreds/provider.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/credentials/processcreds/provider.go @@ -81,6 +81,7 @@ import ( "encoding/json" "fmt" "io" + "io/ioutil" "os" "os/exec" "runtime" @@ -415,7 +416,7 @@ func executeCommand(cmd exec.Cmd, exec chan error) { func readInput(r io.Reader, w io.Writer, read chan error) { tee := io.TeeReader(r, w) - _, err := io.ReadAll(tee) + _, err := ioutil.ReadAll(tee) if err == io.EOF { err = nil diff --git a/vendor/github.com/aws/aws-sdk-go/aws/credentials/ssocreds/provider.go b/vendor/github.com/aws/aws-sdk-go/aws/credentials/ssocreds/provider.go index 3cd74851..6eda2a55 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/credentials/ssocreds/provider.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/credentials/ssocreds/provider.go @@ -5,7 +5,7 @@ import ( "encoding/hex" "encoding/json" "fmt" - "os" + "io/ioutil" "path/filepath" "strings" "time" @@ -159,7 +159,7 @@ func loadTokenFile(startURL string) (t token, err error) { return token{}, awserr.New(ErrCodeSSOProviderInvalidToken, invalidTokenMessage, err) } - fileBytes, err := os.ReadFile(filepath.Join(defaultCacheLocation(), key)) + fileBytes, err := ioutil.ReadFile(filepath.Join(defaultCacheLocation(), key)) if err != nil { return token{}, awserr.New(ErrCodeSSOProviderInvalidToken, invalidTokenMessage, err) } diff --git a/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/web_identity_provider.go b/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/web_identity_provider.go index f9ce5a9c..19ad619a 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/web_identity_provider.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/web_identity_provider.go @@ -2,7 +2,7 @@ package stscreds import ( "fmt" - "os" + "io/ioutil" "strconv" "time" @@ -38,7 +38,7 @@ type FetchTokenPath string // FetchToken returns a token by reading from the filesystem func (f FetchTokenPath) FetchToken(ctx credentials.Context) ([]byte, error) { - data, err := os.ReadFile(string(f)) + data, err := ioutil.ReadFile(string(f)) if err != nil { errMsg := fmt.Sprintf("unable to read file at %s", f) return nil, awserr.New(ErrCodeWebIdentity, errMsg, err) diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/request.go b/vendor/github.com/aws/aws-sdk-go/aws/request/request.go index 06fe32a8..636d9ec9 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/request/request.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/request/request.go @@ -4,6 +4,7 @@ import ( "bytes" "fmt" "io" + "io/ioutil" "net/http" "net/url" "reflect" @@ -530,7 +531,7 @@ func (r *Request) Send() error { if r.HTTPResponse == nil { r.HTTPResponse = &http.Response{ Header: http.Header{}, - Body: io.NopCloser(&bytes.Buffer{}), + Body: ioutil.NopCloser(&bytes.Buffer{}), } } // Regardless of success or failure of the request trigger the Complete diff --git a/vendor/github.com/aws/aws-sdk-go/aws/session/session.go b/vendor/github.com/aws/aws-sdk-go/aws/session/session.go index 1a292faa..4293dbe1 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/session/session.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/session/session.go @@ -5,6 +5,7 @@ import ( "crypto/x509" "fmt" "io" + "io/ioutil" "net/http" "os" "strings" @@ -659,7 +660,7 @@ func loadCustomCABundle(client *http.Client, bundle io.Reader) error { } func loadCertPool(r io.Reader) (*x509.CertPool, error) { - b, err := io.ReadAll(r) + b, err := ioutil.ReadAll(r) if err != nil { return nil, awserr.New(ErrCodeLoadCustomCABundle, "failed to read custom CA bundle PEM file", err) @@ -681,13 +682,13 @@ func loadClientTLSCert(client *http.Client, certFile, keyFile io.Reader) error { "unable to get usable HTTP transport from client", err) } - cert, err := io.ReadAll(certFile) + cert, err := ioutil.ReadAll(certFile) if err != nil { return awserr.New(ErrCodeLoadClientTLSCert, "unable to get read client TLS cert file", err) } - key, err := io.ReadAll(keyFile) + key, err := ioutil.ReadAll(keyFile) if err != nil { return awserr.New(ErrCodeLoadClientTLSCert, "unable to get read client TLS key file", err) diff --git a/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/v4.go b/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/v4.go index 16f3ad2c..4d78162c 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/v4.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/v4.go @@ -60,6 +60,7 @@ import ( "encoding/hex" "fmt" "io" + "io/ioutil" "net/http" "net/url" "sort" @@ -359,7 +360,7 @@ func (v4 Signer) signWithBody(r *http.Request, body io.ReadSeeker, service, regi if body != nil { var ok bool if reader, ok = body.(io.ReadCloser); !ok { - reader = io.NopCloser(body) + reader = ioutil.NopCloser(body) } } r.Body = reader diff --git a/vendor/github.com/aws/aws-sdk-go/internal/ini/ini_lexer.go b/vendor/github.com/aws/aws-sdk-go/internal/ini/ini_lexer.go index 4b077c64..582c024a 100644 --- a/vendor/github.com/aws/aws-sdk-go/internal/ini/ini_lexer.go +++ b/vendor/github.com/aws/aws-sdk-go/internal/ini/ini_lexer.go @@ -3,6 +3,7 @@ package ini import ( "bytes" "io" + "io/ioutil" "github.com/aws/aws-sdk-go/aws/awserr" ) @@ -56,7 +57,7 @@ type iniLexer struct{} // Tokenize will return a list of tokens during lexical analysis of the // io.Reader. func (l *iniLexer) Tokenize(r io.Reader) ([]Token, error) { - b, err := io.ReadAll(r) + b, err := ioutil.ReadAll(r) if err != nil { return nil, awserr.New(ErrCodeUnableToReadFile, "unable to read file", err) } diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/jsonrpc/unmarshal_error.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/jsonrpc/unmarshal_error.go index f0787e8a..c0c52e2d 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/jsonrpc/unmarshal_error.go +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/jsonrpc/unmarshal_error.go @@ -3,6 +3,7 @@ package jsonrpc import ( "bytes" "io" + "io/ioutil" "net/http" "strings" @@ -41,7 +42,7 @@ func (u *UnmarshalTypedError) UnmarshalError( if err != nil { return nil, err } - body := io.NopCloser(&buf) + body := ioutil.NopCloser(&buf) // Code may be separated by hash(#), with the last element being the code // used by the SDK. diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/payload.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/payload.go index 6d77fd28..0ea0647a 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/payload.go +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/payload.go @@ -2,6 +2,7 @@ package protocol import ( "io" + "io/ioutil" "net/http" "github.com/aws/aws-sdk-go/aws" @@ -31,7 +32,7 @@ func (h HandlerPayloadUnmarshal) UnmarshalPayload(r io.Reader, v interface{}) er HTTPResponse: &http.Response{ StatusCode: 200, Header: http.Header{}, - Body: io.NopCloser(r), + Body: ioutil.NopCloser(r), }, Data: v, } diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/unmarshal.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/unmarshal.go index e0df942f..79fcf169 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/unmarshal.go +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/rest/unmarshal.go @@ -5,6 +5,7 @@ import ( "encoding/base64" "fmt" "io" + "io/ioutil" "math" "net/http" "reflect" @@ -67,7 +68,7 @@ func unmarshalBody(r *request.Request, v reflect.Value) error { switch payload.Interface().(type) { case []byte: defer r.HTTPResponse.Body.Close() - b, err := io.ReadAll(r.HTTPResponse.Body) + b, err := ioutil.ReadAll(r.HTTPResponse.Body) if err != nil { return awserr.New(request.ErrCodeSerialization, "failed to decode REST response", err) } @@ -76,7 +77,7 @@ func unmarshalBody(r *request.Request, v reflect.Value) error { case *string: defer r.HTTPResponse.Body.Close() - b, err := io.ReadAll(r.HTTPResponse.Body) + b, err := ioutil.ReadAll(r.HTTPResponse.Body) if err != nil { return awserr.New(request.ErrCodeSerialization, "failed to decode REST response", err) } @@ -90,15 +91,15 @@ func unmarshalBody(r *request.Request, v reflect.Value) error { payload.Set(reflect.ValueOf(r.HTTPResponse.Body)) case "io.ReadSeeker": - b, err := io.ReadAll(r.HTTPResponse.Body) + b, err := ioutil.ReadAll(r.HTTPResponse.Body) if err != nil { return awserr.New(request.ErrCodeSerialization, "failed to read response body", err) } - payload.Set(reflect.ValueOf(io.NopCloser(bytes.NewReader(b)))) + payload.Set(reflect.ValueOf(ioutil.NopCloser(bytes.NewReader(b)))) default: - io.Copy(io.Discard, r.HTTPResponse.Body) + io.Copy(ioutil.Discard, r.HTTPResponse.Body) r.HTTPResponse.Body.Close() return awserr.New(request.ErrCodeSerialization, "failed to decode REST response", diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/restjson/unmarshal_error.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/restjson/unmarshal_error.go index 16e9634f..d756d8cc 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/restjson/unmarshal_error.go +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/restjson/unmarshal_error.go @@ -3,6 +3,7 @@ package restjson import ( "bytes" "io" + "io/ioutil" "net/http" "strings" @@ -55,7 +56,7 @@ func (u *UnmarshalTypedError) UnmarshalError( return nil, err } - body = io.NopCloser(&buf) + body = ioutil.NopCloser(&buf) code = jsonErr.Code msg = jsonErr.Message } diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/unmarshal.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/unmarshal.go index 6be29423..f614ef89 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/unmarshal.go +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/unmarshal.go @@ -2,6 +2,7 @@ package protocol import ( "io" + "io/ioutil" "github.com/aws/aws-sdk-go/aws/request" ) @@ -15,7 +16,7 @@ func UnmarshalDiscardBody(r *request.Request) { return } - io.Copy(io.Discard, r.HTTPResponse.Body) + io.Copy(ioutil.Discard, r.HTTPResponse.Body) r.HTTPResponse.Body.Close() } diff --git a/vendor/github.com/go-openapi/swag/loading.go b/vendor/github.com/go-openapi/swag/loading.go index 2ac8e50a..9a604097 100644 --- a/vendor/github.com/go-openapi/swag/loading.go +++ b/vendor/github.com/go-openapi/swag/loading.go @@ -16,7 +16,7 @@ package swag import ( "fmt" - "io" + "io/ioutil" "log" "net/http" "net/url" @@ -24,7 +24,6 @@ import ( "runtime" "strings" "time" - "os" ) // LoadHTTPTimeout the default timeout for load requests @@ -41,13 +40,13 @@ var LoadHTTPCustomHeaders = map[string]string{} // LoadFromFileOrHTTP loads the bytes from a file or a remote http server based on the path passed in func LoadFromFileOrHTTP(path string) ([]byte, error) { - return LoadStrategy(path, os.ReadFile, loadHTTPBytes(LoadHTTPTimeout))(path) + return LoadStrategy(path, ioutil.ReadFile, loadHTTPBytes(LoadHTTPTimeout))(path) } // LoadFromFileOrHTTPWithTimeout loads the bytes from a file or a remote http server based on the path passed in // timeout arg allows for per request overriding of the request timeout func LoadFromFileOrHTTPWithTimeout(path string, timeout time.Duration) ([]byte, error) { - return LoadStrategy(path, os.ReadFile, loadHTTPBytes(timeout))(path) + return LoadStrategy(path, ioutil.ReadFile, loadHTTPBytes(timeout))(path) } // LoadStrategy returns a loader function for a given path or uri @@ -116,6 +115,6 @@ func loadHTTPBytes(timeout time.Duration) func(path string) ([]byte, error) { return nil, fmt.Errorf("could not access document at %q [%s] ", path, resp.Status) } - return io.ReadAll(resp.Body) + return ioutil.ReadAll(resp.Body) } } diff --git a/vendor/github.com/gogo/protobuf/protoc-gen-gogo/descriptor/descriptor.go b/vendor/github.com/gogo/protobuf/protoc-gen-gogo/descriptor/descriptor.go index 106e8df7..a85bf198 100644 --- a/vendor/github.com/gogo/protobuf/protoc-gen-gogo/descriptor/descriptor.go +++ b/vendor/github.com/gogo/protobuf/protoc-gen-gogo/descriptor/descriptor.go @@ -40,7 +40,7 @@ import ( "bytes" "compress/gzip" "fmt" - "io" + "io/ioutil" "github.com/gogo/protobuf/proto" ) @@ -53,7 +53,7 @@ func extractFile(gz []byte) (*FileDescriptorProto, error) { } defer r.Close() - b, err := io.ReadAll(r) + b, err := ioutil.ReadAll(r) if err != nil { return nil, fmt.Errorf("failed to uncompress descriptor: %v", err) } diff --git a/vendor/github.com/golang/protobuf/descriptor/descriptor.go b/vendor/github.com/golang/protobuf/descriptor/descriptor.go index 072d92db..ffde8a65 100644 --- a/vendor/github.com/golang/protobuf/descriptor/descriptor.go +++ b/vendor/github.com/golang/protobuf/descriptor/descriptor.go @@ -13,7 +13,7 @@ package descriptor import ( "bytes" "compress/gzip" - "io" + "io/ioutil" "sync" "github.com/golang/protobuf/proto" @@ -129,7 +129,7 @@ func deriveFileDescriptor(rawDesc []byte) *descriptorpb.FileDescriptorProto { if err != nil { panic(err) } - b, err := io.ReadAll(zr) + b, err := ioutil.ReadAll(zr) if err != nil { panic(err) } diff --git a/vendor/github.com/golang/protobuf/proto/registry.go b/vendor/github.com/golang/protobuf/proto/registry.go index 337cadc2..066b4323 100644 --- a/vendor/github.com/golang/protobuf/proto/registry.go +++ b/vendor/github.com/golang/protobuf/proto/registry.go @@ -8,7 +8,7 @@ import ( "bytes" "compress/gzip" "fmt" - "io" + "io/ioutil" "reflect" "strings" "sync" @@ -37,7 +37,7 @@ func RegisterFile(s filePath, d fileDescGZIP) { if err != nil { panic(fmt.Sprintf("proto: invalid compressed file descriptor: %v", err)) } - b, err := io.ReadAll(zr) + b, err := ioutil.ReadAll(zr) if err != nil { panic(fmt.Sprintf("proto: invalid compressed file descriptor: %v", err)) } diff --git a/vendor/github.com/google/gnostic/compiler/reader.go b/vendor/github.com/google/gnostic/compiler/reader.go index 74919aed..be0e8b40 100644 --- a/vendor/github.com/google/gnostic/compiler/reader.go +++ b/vendor/github.com/google/gnostic/compiler/reader.go @@ -16,14 +16,13 @@ package compiler import ( "fmt" - "io" + "io/ioutil" "log" "net/http" "net/url" "path/filepath" "strings" "sync" - "os" yaml "gopkg.in/yaml.v3" ) @@ -169,7 +168,7 @@ func fetchFile(fileurl string) ([]byte, error) { if response.StatusCode != 200 { return nil, fmt.Errorf("Error downloading %s: %s", fileurl, response.Status) } - bytes, err = io.ReadAll(response.Body) + bytes, err = ioutil.ReadAll(response.Body) if fileCacheEnable && err == nil { fileCache[fileurl] = bytes } @@ -195,7 +194,7 @@ func readBytesForFile(filename string) ([]byte, error) { return bytes, nil } // no, it's a local filename - bytes, err := os.ReadFile(filename) + bytes, err := ioutil.ReadFile(filename) if err != nil { return nil, err } diff --git a/vendor/github.com/google/gnostic/extensions/extensions.go b/vendor/github.com/google/gnostic/extensions/extensions.go index ca6bd5cb..ec8afd00 100644 --- a/vendor/github.com/google/gnostic/extensions/extensions.go +++ b/vendor/github.com/google/gnostic/extensions/extensions.go @@ -15,7 +15,7 @@ package gnostic_extension_v1 import ( - "io" + "io/ioutil" "log" "os" @@ -28,7 +28,7 @@ type extensionHandler func(name string, yamlInput string) (bool, proto.Message, // Main implements the main program of an extension handler. func Main(handler extensionHandler) { // unpack the request - data, err := io.ReadAll(os.Stdin) + data, err := ioutil.ReadAll(os.Stdin) if err != nil { log.Println("File error:", err.Error()) os.Exit(1) diff --git a/vendor/github.com/google/gnostic/jsonschema/reader.go b/vendor/github.com/google/gnostic/jsonschema/reader.go index 185db2ee..b8583d46 100644 --- a/vendor/github.com/google/gnostic/jsonschema/reader.go +++ b/vendor/github.com/google/gnostic/jsonschema/reader.go @@ -18,8 +18,9 @@ package jsonschema import ( "fmt" + "io/ioutil" "strconv" - "os" + "gopkg.in/yaml.v3" ) @@ -44,7 +45,7 @@ func NewBaseSchema() (schema *Schema, err error) { // NewSchemaFromFile reads a schema from a file. // Currently this assumes that schemas are stored in the source distribution of this project. func NewSchemaFromFile(filename string) (schema *Schema, err error) { - file, err := os.ReadFile(filename) + file, err := ioutil.ReadFile(filename) if err != nil { return nil, err } diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshal_proto.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshal_proto.go index 3384e691..f65d1a26 100644 --- a/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshal_proto.go +++ b/vendor/github.com/grpc-ecosystem/grpc-gateway/runtime/marshal_proto.go @@ -1,9 +1,11 @@ package runtime import ( + "io" + "errors" "github.com/golang/protobuf/proto" - "io" + "io/ioutil" ) // ProtoMarshaller is a Marshaller which marshals/unmarshals into/from serialize proto bytes @@ -35,7 +37,7 @@ func (*ProtoMarshaller) Unmarshal(data []byte, value interface{}) error { // NewDecoder returns a Decoder which reads proto stream from "reader". func (marshaller *ProtoMarshaller) NewDecoder(reader io.Reader) Decoder { return DecoderFunc(func(value interface{}) error { - buffer, err := io.ReadAll(reader) + buffer, err := ioutil.ReadAll(reader) if err != nil { return err } diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/utilities/readerfactory.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/utilities/readerfactory.go index 01d26eda..6dd38546 100644 --- a/vendor/github.com/grpc-ecosystem/grpc-gateway/utilities/readerfactory.go +++ b/vendor/github.com/grpc-ecosystem/grpc-gateway/utilities/readerfactory.go @@ -3,12 +3,13 @@ package utilities import ( "bytes" "io" + "io/ioutil" ) // IOReaderFactory takes in an io.Reader and returns a function that will allow you to create a new reader that begins // at the start of the stream func IOReaderFactory(r io.Reader) (func() io.Reader, error) { - b, err := io.ReadAll(r) + b, err := ioutil.ReadAll(r) if err != nil { return nil, err } diff --git a/vendor/github.com/modern-go/concurrent/log.go b/vendor/github.com/modern-go/concurrent/log.go index 73951c9e..9756fcc7 100644 --- a/vendor/github.com/modern-go/concurrent/log.go +++ b/vendor/github.com/modern-go/concurrent/log.go @@ -3,11 +3,11 @@ package concurrent import ( "os" "log" - "io" + "io/ioutil" ) // ErrorLogger is used to print out error, can be set to writer other than stderr var ErrorLogger = log.New(os.Stderr, "", 0) // InfoLogger is used to print informational message, default to off -var InfoLogger = log.New(io.Discard, "", 0) \ No newline at end of file +var InfoLogger = log.New(ioutil.Discard, "", 0) \ No newline at end of file diff --git a/vendor/github.com/prometheus/common/expfmt/text_create.go b/vendor/github.com/prometheus/common/expfmt/text_create.go index 2946b8f1..5ba503b0 100644 --- a/vendor/github.com/prometheus/common/expfmt/text_create.go +++ b/vendor/github.com/prometheus/common/expfmt/text_create.go @@ -17,6 +17,7 @@ import ( "bufio" "fmt" "io" + "io/ioutil" "math" "strconv" "strings" @@ -43,7 +44,7 @@ const ( var ( bufPool = sync.Pool{ New: func() interface{} { - return bufio.NewWriter(io.Discard) + return bufio.NewWriter(ioutil.Discard) }, } numBufPool = sync.Pool{ diff --git a/vendor/golang.org/x/net/websocket/hybi.go b/vendor/golang.org/x/net/websocket/hybi.go index dda74346..48a069e1 100644 --- a/vendor/golang.org/x/net/websocket/hybi.go +++ b/vendor/golang.org/x/net/websocket/hybi.go @@ -16,6 +16,7 @@ import ( "encoding/binary" "fmt" "io" + "io/ioutil" "net/http" "net/url" "strings" @@ -278,7 +279,7 @@ func (handler *hybiFrameHandler) HandleFrame(frame frameReader) (frameReader, er } } if header := frame.HeaderReader(); header != nil { - io.Copy(io.Discard, header) + io.Copy(ioutil.Discard, header) } switch frame.PayloadType() { case ContinuationFrame: @@ -293,7 +294,7 @@ func (handler *hybiFrameHandler) HandleFrame(frame frameReader) (frameReader, er if err != nil && err != io.EOF && err != io.ErrUnexpectedEOF { return nil, err } - io.Copy(io.Discard, frame) + io.Copy(ioutil.Discard, frame) if frame.PayloadType() == PingFrame { if _, err := handler.WritePong(b[:n]); err != nil { return nil, err diff --git a/vendor/golang.org/x/net/websocket/websocket.go b/vendor/golang.org/x/net/websocket/websocket.go index 923a5780..90a2257c 100644 --- a/vendor/golang.org/x/net/websocket/websocket.go +++ b/vendor/golang.org/x/net/websocket/websocket.go @@ -17,6 +17,7 @@ import ( "encoding/json" "errors" "io" + "io/ioutil" "net" "net/http" "net/url" @@ -207,7 +208,7 @@ again: n, err = ws.frameReader.Read(msg) if err == io.EOF { if trailer := ws.frameReader.TrailerReader(); trailer != nil { - io.Copy(io.Discard, trailer) + io.Copy(ioutil.Discard, trailer) } ws.frameReader = nil goto again @@ -329,7 +330,7 @@ func (cd Codec) Receive(ws *Conn, v interface{}) (err error) { ws.rio.Lock() defer ws.rio.Unlock() if ws.frameReader != nil { - _, err = io.Copy(io.Discard, ws.frameReader) + _, err = io.Copy(ioutil.Discard, ws.frameReader) if err != nil { return err } @@ -361,7 +362,7 @@ again: return ErrFrameTooLarge } payloadType := frame.PayloadType() - data, err := io.ReadAll(frame) + data, err := ioutil.ReadAll(frame) if err != nil { return err } diff --git a/vendor/golang.org/x/oauth2/google/internal/externalaccount/aws.go b/vendor/golang.org/x/oauth2/google/internal/externalaccount/aws.go index 1ad74a83..2bf3202b 100644 --- a/vendor/golang.org/x/oauth2/google/internal/externalaccount/aws.go +++ b/vendor/golang.org/x/oauth2/google/internal/externalaccount/aws.go @@ -14,6 +14,7 @@ import ( "errors" "fmt" "io" + "io/ioutil" "net/http" "net/url" "os" @@ -163,7 +164,7 @@ func requestDataHash(req *http.Request) (string, error) { } defer requestBody.Close() - requestData, err = io.ReadAll(io.LimitReader(requestBody, 1<<20)) + requestData, err = ioutil.ReadAll(io.LimitReader(requestBody, 1<<20)) if err != nil { return "", err } @@ -442,7 +443,7 @@ func (cs *awsCredentialSource) getAWSSessionToken() (string, error) { } defer resp.Body.Close() - respBody, err := io.ReadAll(io.LimitReader(resp.Body, 1<<20)) + respBody, err := ioutil.ReadAll(io.LimitReader(resp.Body, 1<<20)) if err != nil { return "", err } @@ -481,7 +482,7 @@ func (cs *awsCredentialSource) getRegion(headers map[string]string) (string, err } defer resp.Body.Close() - respBody, err := io.ReadAll(io.LimitReader(resp.Body, 1<<20)) + respBody, err := ioutil.ReadAll(io.LimitReader(resp.Body, 1<<20)) if err != nil { return "", err } @@ -548,7 +549,7 @@ func (cs *awsCredentialSource) getMetadataSecurityCredentials(roleName string, h } defer resp.Body.Close() - respBody, err := io.ReadAll(io.LimitReader(resp.Body, 1<<20)) + respBody, err := ioutil.ReadAll(io.LimitReader(resp.Body, 1<<20)) if err != nil { return result, err } @@ -581,7 +582,7 @@ func (cs *awsCredentialSource) getMetadataRoleName(headers map[string]string) (s } defer resp.Body.Close() - respBody, err := io.ReadAll(io.LimitReader(resp.Body, 1<<20)) + respBody, err := ioutil.ReadAll(io.LimitReader(resp.Body, 1<<20)) if err != nil { return "", err } diff --git a/vendor/golang.org/x/oauth2/google/internal/externalaccount/executablecredsource.go b/vendor/golang.org/x/oauth2/google/internal/externalaccount/executablecredsource.go index 7e8f85b2..579bcce5 100644 --- a/vendor/golang.org/x/oauth2/google/internal/externalaccount/executablecredsource.go +++ b/vendor/golang.org/x/oauth2/google/internal/externalaccount/executablecredsource.go @@ -11,6 +11,7 @@ import ( "errors" "fmt" "io" + "io/ioutil" "os" "os/exec" "regexp" @@ -253,7 +254,7 @@ func (cs executableCredentialSource) getTokenFromOutputFile() (token string, err } defer file.Close() - data, err := io.ReadAll(io.LimitReader(file, 1<<20)) + data, err := ioutil.ReadAll(io.LimitReader(file, 1<<20)) if err != nil || len(data) == 0 { // Cachefile exists, but no data found. Get new credential. return "", nil diff --git a/vendor/golang.org/x/oauth2/google/internal/externalaccount/filecredsource.go b/vendor/golang.org/x/oauth2/google/internal/externalaccount/filecredsource.go index 30107afe..e953ddb4 100644 --- a/vendor/golang.org/x/oauth2/google/internal/externalaccount/filecredsource.go +++ b/vendor/golang.org/x/oauth2/google/internal/externalaccount/filecredsource.go @@ -10,6 +10,7 @@ import ( "errors" "fmt" "io" + "io/ioutil" "os" ) @@ -24,7 +25,7 @@ func (cs fileCredentialSource) subjectToken() (string, error) { return "", fmt.Errorf("oauth2/google: failed to open credential file %q", cs.File) } defer tokenFile.Close() - tokenBytes, err := io.ReadAll(io.LimitReader(tokenFile, 1<<20)) + tokenBytes, err := ioutil.ReadAll(io.LimitReader(tokenFile, 1<<20)) if err != nil { return "", fmt.Errorf("oauth2/google: failed to read credential file: %v", err) } diff --git a/vendor/golang.org/x/oauth2/google/internal/externalaccount/impersonate.go b/vendor/golang.org/x/oauth2/google/internal/externalaccount/impersonate.go index 89fcb544..54c8f209 100644 --- a/vendor/golang.org/x/oauth2/google/internal/externalaccount/impersonate.go +++ b/vendor/golang.org/x/oauth2/google/internal/externalaccount/impersonate.go @@ -10,6 +10,7 @@ import ( "encoding/json" "fmt" "io" + "io/ioutil" "net/http" "time" @@ -80,7 +81,7 @@ func (its ImpersonateTokenSource) Token() (*oauth2.Token, error) { return nil, fmt.Errorf("oauth2/google: unable to generate access token: %v", err) } defer resp.Body.Close() - body, err := io.ReadAll(io.LimitReader(resp.Body, 1<<20)) + body, err := ioutil.ReadAll(io.LimitReader(resp.Body, 1<<20)) if err != nil { return nil, fmt.Errorf("oauth2/google: unable to read body: %v", err) } diff --git a/vendor/golang.org/x/oauth2/google/internal/externalaccount/sts_exchange.go b/vendor/golang.org/x/oauth2/google/internal/externalaccount/sts_exchange.go index 72fad624..e6fcae5f 100644 --- a/vendor/golang.org/x/oauth2/google/internal/externalaccount/sts_exchange.go +++ b/vendor/golang.org/x/oauth2/google/internal/externalaccount/sts_exchange.go @@ -9,6 +9,7 @@ import ( "encoding/json" "fmt" "io" + "io/ioutil" "net/http" "net/url" "strconv" @@ -63,7 +64,7 @@ func exchangeToken(ctx context.Context, endpoint string, request *stsTokenExchan } defer resp.Body.Close() - body, err := io.ReadAll(io.LimitReader(resp.Body, 1<<20)) + body, err := ioutil.ReadAll(io.LimitReader(resp.Body, 1<<20)) if err != nil { return nil, err } diff --git a/vendor/golang.org/x/oauth2/google/internal/externalaccount/urlcredsource.go b/vendor/golang.org/x/oauth2/google/internal/externalaccount/urlcredsource.go index 8eadae4f..16dca654 100644 --- a/vendor/golang.org/x/oauth2/google/internal/externalaccount/urlcredsource.go +++ b/vendor/golang.org/x/oauth2/google/internal/externalaccount/urlcredsource.go @@ -10,6 +10,7 @@ import ( "errors" "fmt" "io" + "io/ioutil" "net/http" "golang.org/x/oauth2" @@ -39,7 +40,7 @@ func (cs urlCredentialSource) subjectToken() (string, error) { } defer resp.Body.Close() - respBody, err := io.ReadAll(io.LimitReader(resp.Body, 1<<20)) + respBody, err := ioutil.ReadAll(io.LimitReader(resp.Body, 1<<20)) if err != nil { return "", fmt.Errorf("oauth2/google: invalid body in subject token URL query: %v", err) } diff --git a/vendor/golang.org/x/oauth2/internal/token.go b/vendor/golang.org/x/oauth2/internal/token.go index d9621573..58901bda 100644 --- a/vendor/golang.org/x/oauth2/internal/token.go +++ b/vendor/golang.org/x/oauth2/internal/token.go @@ -10,6 +10,7 @@ import ( "errors" "fmt" "io" + "io/ioutil" "math" "mime" "net/http" @@ -236,7 +237,7 @@ func doTokenRoundTrip(ctx context.Context, req *http.Request) (*Token, error) { if err != nil { return nil, err } - body, err := io.ReadAll(io.LimitReader(r.Body, 1<<20)) + body, err := ioutil.ReadAll(io.LimitReader(r.Body, 1<<20)) r.Body.Close() if err != nil { return nil, fmt.Errorf("oauth2: cannot fetch token: %v", err) diff --git a/vendor/golang.org/x/oauth2/jwt/jwt.go b/vendor/golang.org/x/oauth2/jwt/jwt.go index b4f6d957..b2bf1829 100644 --- a/vendor/golang.org/x/oauth2/jwt/jwt.go +++ b/vendor/golang.org/x/oauth2/jwt/jwt.go @@ -13,6 +13,7 @@ import ( "encoding/json" "fmt" "io" + "io/ioutil" "net/http" "net/url" "strings" @@ -135,7 +136,7 @@ func (js jwtSource) Token() (*oauth2.Token, error) { return nil, fmt.Errorf("oauth2: cannot fetch token: %v", err) } defer resp.Body.Close() - body, err := io.ReadAll(io.LimitReader(resp.Body, 1<<20)) + body, err := ioutil.ReadAll(io.LimitReader(resp.Body, 1<<20)) if err != nil { return nil, fmt.Errorf("oauth2: cannot fetch token: %v", err) } diff --git a/vendor/google.golang.org/appengine/internal/api.go b/vendor/google.golang.org/appengine/internal/api.go index 4935931b..721053c2 100644 --- a/vendor/google.golang.org/appengine/internal/api.go +++ b/vendor/google.golang.org/appengine/internal/api.go @@ -10,7 +10,7 @@ import ( "bytes" "errors" "fmt" - "io" + "io/ioutil" "log" "net" "net/http" @@ -394,7 +394,7 @@ func (c *context) post(body []byte, timeout time.Duration) (b []byte, err error) apiContentType: apiContentTypeValue, apiDeadlineHeader: []string{strconv.FormatFloat(timeout.Seconds(), 'f', -1, 64)}, }, - Body: io.NopCloser(bytes.NewReader(body)), + Body: ioutil.NopCloser(bytes.NewReader(body)), ContentLength: int64(len(body)), Host: c.apiURL.Host, } @@ -428,7 +428,7 @@ func (c *context) post(body []byte, timeout time.Duration) (b []byte, err error) } } defer hresp.Body.Close() - hrespBody, err := io.ReadAll(hresp.Body) + hrespBody, err := ioutil.ReadAll(hresp.Body) if hresp.StatusCode != 200 { return nil, &CallError{ Detail: fmt.Sprintf("service bridge returned HTTP %d (%q)", hresp.StatusCode, hrespBody), diff --git a/vendor/google.golang.org/appengine/internal/metadata.go b/vendor/google.golang.org/appengine/internal/metadata.go index 0409e8eb..c4ba63bb 100644 --- a/vendor/google.golang.org/appengine/internal/metadata.go +++ b/vendor/google.golang.org/appengine/internal/metadata.go @@ -11,7 +11,7 @@ package internal import ( "fmt" - "io" + "io/ioutil" "net/http" "net/url" ) @@ -56,5 +56,5 @@ func getMetadata(key string) ([]byte, error) { if resp.StatusCode != 200 { return nil, fmt.Errorf("metadata server returned HTTP %d", resp.StatusCode) } - return io.ReadAll(resp.Body) + return ioutil.ReadAll(resp.Body) } diff --git a/vendor/google.golang.org/appengine/urlfetch/urlfetch.go b/vendor/google.golang.org/appengine/urlfetch/urlfetch.go index ab82d1b3..6ffe1e6d 100644 --- a/vendor/google.golang.org/appengine/urlfetch/urlfetch.go +++ b/vendor/google.golang.org/appengine/urlfetch/urlfetch.go @@ -10,6 +10,7 @@ import ( "errors" "fmt" "io" + "io/ioutil" "net/http" "net/url" "strconv" @@ -157,7 +158,7 @@ func (t *Transport) RoundTrip(req *http.Request) (res *http.Response, err error) }: freq.Payload = b.Bytes() default: - freq.Payload, err = io.ReadAll(req.Body) + freq.Payload, err = ioutil.ReadAll(req.Body) if err != nil { return nil, err } diff --git a/vendor/google.golang.org/grpc/internal/transport/http2_server.go b/vendor/google.golang.org/grpc/internal/transport/http2_server.go index f9606401..0bc7a7d5 100644 --- a/vendor/google.golang.org/grpc/internal/transport/http2_server.go +++ b/vendor/google.golang.org/grpc/internal/transport/http2_server.go @@ -171,15 +171,10 @@ func NewServerTransport(conn net.Conn, config *ServerConfig) (_ ServerTransport, ID: http2.SettingMaxFrameSize, Val: http2MaxFrameLen, }} - // TODO(zhaoq): Have a better way to signal "no limit" because 0 is - // permitted in the HTTP2 spec. - maxStreams := config.MaxStreams - if maxStreams == 0 { - maxStreams = math.MaxUint32 - } else { + if config.MaxStreams != math.MaxUint32 { isettings = append(isettings, http2.Setting{ ID: http2.SettingMaxConcurrentStreams, - Val: maxStreams, + Val: config.MaxStreams, }) } dynamicWindow := true @@ -258,7 +253,7 @@ func NewServerTransport(conn net.Conn, config *ServerConfig) (_ ServerTransport, framer: framer, readerDone: make(chan struct{}), writerDone: make(chan struct{}), - maxStreams: maxStreams, + maxStreams: config.MaxStreams, inTapHandle: config.InTapHandle, fc: &trInFlow{limit: uint32(icwz)}, state: reachable, diff --git a/vendor/google.golang.org/grpc/server.go b/vendor/google.golang.org/grpc/server.go index e076ec71..b44c7e86 100644 --- a/vendor/google.golang.org/grpc/server.go +++ b/vendor/google.golang.org/grpc/server.go @@ -115,12 +115,6 @@ type serviceInfo struct { mdata interface{} } -type serverWorkerData struct { - st transport.ServerTransport - wg *sync.WaitGroup - stream *transport.Stream -} - // Server is a gRPC server to serve RPC requests. type Server struct { opts serverOptions @@ -145,7 +139,7 @@ type Server struct { channelzID *channelz.Identifier czData *channelzData - serverWorkerChannel chan *serverWorkerData + serverWorkerChannel chan func() } type serverOptions struct { @@ -178,6 +172,7 @@ type serverOptions struct { } var defaultServerOptions = serverOptions{ + maxConcurrentStreams: math.MaxUint32, maxReceiveMessageSize: defaultServerMaxReceiveMessageSize, maxSendMessageSize: defaultServerMaxSendMessageSize, connectionTimeout: 120 * time.Second, @@ -389,6 +384,9 @@ func MaxSendMsgSize(m int) ServerOption { // MaxConcurrentStreams returns a ServerOption that will apply a limit on the number // of concurrent streams to each ServerTransport. func MaxConcurrentStreams(n uint32) ServerOption { + if n == 0 { + n = math.MaxUint32 + } return newFuncServerOption(func(o *serverOptions) { o.maxConcurrentStreams = n }) @@ -590,24 +588,19 @@ const serverWorkerResetThreshold = 1 << 16 // [1] https://github.com/golang/go/issues/18138 func (s *Server) serverWorker() { for completed := 0; completed < serverWorkerResetThreshold; completed++ { - data, ok := <-s.serverWorkerChannel + f, ok := <-s.serverWorkerChannel if !ok { return } - s.handleSingleStream(data) + f() } go s.serverWorker() } -func (s *Server) handleSingleStream(data *serverWorkerData) { - defer data.wg.Done() - s.handleStream(data.st, data.stream, s.traceInfo(data.st, data.stream)) -} - // initServerWorkers creates worker goroutines and a channel to process incoming // connections to reduce the time spent overall on runtime.morestack. func (s *Server) initServerWorkers() { - s.serverWorkerChannel = make(chan *serverWorkerData) + s.serverWorkerChannel = make(chan func()) for i := uint32(0); i < s.opts.numServerWorkers; i++ { go s.serverWorker() } @@ -966,21 +959,26 @@ func (s *Server) serveStreams(st transport.ServerTransport) { defer st.Close(errors.New("finished serving streams for the server transport")) var wg sync.WaitGroup + streamQuota := newHandlerQuota(s.opts.maxConcurrentStreams) st.HandleStreams(func(stream *transport.Stream) { wg.Add(1) + + streamQuota.acquire() + f := func() { + defer streamQuota.release() + defer wg.Done() + s.handleStream(st, stream, s.traceInfo(st, stream)) + } + if s.opts.numServerWorkers > 0 { - data := &serverWorkerData{st: st, wg: &wg, stream: stream} select { - case s.serverWorkerChannel <- data: + case s.serverWorkerChannel <- f: return default: // If all stream workers are busy, fallback to the default code path. } } - go func() { - defer wg.Done() - s.handleStream(st, stream, s.traceInfo(st, stream)) - }() + go f() }, func(ctx context.Context, method string) context.Context { if !EnableTracing { return ctx @@ -2075,3 +2073,32 @@ func validateSendCompressor(name, clientCompressors string) error { } return fmt.Errorf("client does not support compressor %q", name) } + +// atomicSemaphore implements a blocking, counting semaphore. acquire should be +// called synchronously; release may be called asynchronously. +type atomicSemaphore struct { + n int64 // accessed atomically + wait chan struct{} +} + +func (q *atomicSemaphore) acquire() { + if atomic.AddInt64(&q.n, -1) < 0 { + // We ran out of quota. Block until a release happens. + <-q.wait + } +} + +func (q *atomicSemaphore) release() { + // N.B. the "<= 0" check below should allow for this to work with multiple + // concurrent calls to acquire, but also note that with synchronous calls to + // acquire, as our system does, n will never be less than -1. There are + // fairness issues (queuing) to consider if this was to be generalized. + if atomic.AddInt64(&q.n, -1) <= 0 { + // An acquire was waiting on us. Unblock it. + q.wait <- struct{}{} + } +} + +func newHandlerQuota(n uint32) *atomicSemaphore { + return &atomicSemaphore{n: int64(n), wait: make(chan struct{}, 1)} +} diff --git a/vendor/google.golang.org/grpc/version.go b/vendor/google.golang.org/grpc/version.go index 353cfd52..12a5a9d0 100644 --- a/vendor/google.golang.org/grpc/version.go +++ b/vendor/google.golang.org/grpc/version.go @@ -19,4 +19,4 @@ package grpc // Version is the current grpc version. -const Version = "1.57.0" +const Version = "1.57.1" diff --git a/vendor/google.golang.org/protobuf/internal/impl/legacy_file.go b/vendor/google.golang.org/protobuf/internal/impl/legacy_file.go index b649f112..9ab09108 100644 --- a/vendor/google.golang.org/protobuf/internal/impl/legacy_file.go +++ b/vendor/google.golang.org/protobuf/internal/impl/legacy_file.go @@ -7,7 +7,7 @@ package impl import ( "bytes" "compress/gzip" - "io" + "io/ioutil" "sync" "google.golang.org/protobuf/internal/filedesc" @@ -51,7 +51,7 @@ func legacyLoadFileDesc(b []byte) protoreflect.FileDescriptor { if err != nil { panic(err) } - b2, err := io.ReadAll(zr) + b2, err := ioutil.ReadAll(zr) if err != nil { panic(err) } diff --git a/vendor/k8s.io/apimachinery/pkg/util/httpstream/spdy/roundtripper.go b/vendor/k8s.io/apimachinery/pkg/util/httpstream/spdy/roundtripper.go index 0cc944f6..ea048179 100644 --- a/vendor/k8s.io/apimachinery/pkg/util/httpstream/spdy/roundtripper.go +++ b/vendor/k8s.io/apimachinery/pkg/util/httpstream/spdy/roundtripper.go @@ -23,7 +23,7 @@ import ( "encoding/base64" "errors" "fmt" - "io" + "io/ioutil" "net" "net/http" "net/http/httputil" @@ -333,7 +333,7 @@ func (s *SpdyRoundTripper) NewConnection(resp *http.Response) (httpstream.Connec if (resp.StatusCode != http.StatusSwitchingProtocols) || !strings.Contains(connectionHeader, strings.ToLower(httpstream.HeaderUpgrade)) || !strings.Contains(upgradeHeader, strings.ToLower(HeaderSpdy31)) { defer resp.Body.Close() responseError := "" - responseErrorBytes, err := io.ReadAll(resp.Body) + responseErrorBytes, err := ioutil.ReadAll(resp.Body) if err != nil { responseError = "unable to read error from server response" } else { diff --git a/vendor/k8s.io/client-go/rest/config.go b/vendor/k8s.io/client-go/rest/config.go index d61ca203..4909dc53 100644 --- a/vendor/k8s.io/client-go/rest/config.go +++ b/vendor/k8s.io/client-go/rest/config.go @@ -20,6 +20,7 @@ import ( "context" "errors" "fmt" + "io/ioutil" "net" "net/http" "net/url" @@ -518,7 +519,7 @@ func InClusterConfig() (*Config, error) { return nil, ErrNotInCluster } - token, err := os.ReadFile(tokenFile) + token, err := ioutil.ReadFile(tokenFile) if err != nil { return nil, err } @@ -584,7 +585,7 @@ func dataFromSliceOrFile(data []byte, file string) ([]byte, error) { return data, nil } if len(file) > 0 { - fileData, err := os.ReadFile(file) + fileData, err := ioutil.ReadFile(file) if err != nil { return []byte{}, err } diff --git a/vendor/k8s.io/client-go/rest/request.go b/vendor/k8s.io/client-go/rest/request.go index cf41431e..acf31136 100644 --- a/vendor/k8s.io/client-go/rest/request.go +++ b/vendor/k8s.io/client-go/rest/request.go @@ -22,6 +22,7 @@ import ( "encoding/hex" "fmt" "io" + "io/ioutil" "mime" "net/http" "net/url" @@ -31,7 +32,7 @@ import ( "strings" "sync" "time" - "os" + "golang.org/x/net/http2" "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -436,7 +437,7 @@ func (r *Request) Body(obj interface{}) *Request { } switch t := obj.(type) { case string: - data, err := os.ReadFile(t) + data, err := ioutil.ReadFile(t) if err != nil { r.err = err return r @@ -825,7 +826,7 @@ func (r *Request) Stream(ctx context.Context) (io.ReadCloser, error) { return nil, err } if r.body != nil { - req.Body = io.NopCloser(r.body) + req.Body = ioutil.NopCloser(r.body) } resp, err := client.Do(req) updateURLMetrics(ctx, r, resp, err) @@ -1017,7 +1018,7 @@ func (r *Request) Do(ctx context.Context) Result { func (r *Request) DoRaw(ctx context.Context) ([]byte, error) { var result Result err := r.request(ctx, func(req *http.Request, resp *http.Response) { - result.body, result.err = io.ReadAll(resp.Body) + result.body, result.err = ioutil.ReadAll(resp.Body) glogBody("Response Body", result.body) if resp.StatusCode < http.StatusOK || resp.StatusCode > http.StatusPartialContent { result.err = r.transformUnstructuredResponseError(resp, req, result.body) @@ -1036,7 +1037,7 @@ func (r *Request) DoRaw(ctx context.Context) ([]byte, error) { func (r *Request) transformResponse(resp *http.Response, req *http.Request) Result { var body []byte if resp.Body != nil { - data, err := io.ReadAll(resp.Body) + data, err := ioutil.ReadAll(resp.Body) switch err.(type) { case nil: body = data @@ -1178,7 +1179,7 @@ const maxUnstructuredResponseTextBytes = 2048 // TODO: introduce transformation of generic http.Client.Do() errors that separates 4. func (r *Request) transformUnstructuredResponseError(resp *http.Response, req *http.Request, body []byte) error { if body == nil && resp.Body != nil { - if data, err := io.ReadAll(&io.LimitedReader{R: resp.Body, N: maxUnstructuredResponseTextBytes}); err == nil { + if data, err := ioutil.ReadAll(&io.LimitedReader{R: resp.Body, N: maxUnstructuredResponseTextBytes}); err == nil { body = data } } diff --git a/vendor/k8s.io/client-go/rest/with_retry.go b/vendor/k8s.io/client-go/rest/with_retry.go index b04e3e9e..bdcc6f3a 100644 --- a/vendor/k8s.io/client-go/rest/with_retry.go +++ b/vendor/k8s.io/client-go/rest/with_retry.go @@ -20,6 +20,7 @@ import ( "context" "fmt" "io" + "io/ioutil" "net/http" "net/url" "time" @@ -344,7 +345,7 @@ func readAndCloseResponseBody(resp *http.Response) { defer resp.Body.Close() if resp.ContentLength <= maxBodySlurpSize { - io.Copy(io.Discard, &io.LimitedReader{R: resp.Body, N: maxBodySlurpSize}) + io.Copy(ioutil.Discard, &io.LimitedReader{R: resp.Body, N: maxBodySlurpSize}) } } diff --git a/vendor/k8s.io/client-go/tools/auth/clientauth.go b/vendor/k8s.io/client-go/tools/auth/clientauth.go index 2fcdc7c3..ac30271f 100644 --- a/vendor/k8s.io/client-go/tools/auth/clientauth.go +++ b/vendor/k8s.io/client-go/tools/auth/clientauth.go @@ -65,7 +65,9 @@ package auth // TODO: need a way to rotate Tokens. Therefore, need a way for client object to be reset when the authcfg is updated. import ( "encoding/json" + "io/ioutil" "os" + restclient "k8s.io/client-go/rest" ) @@ -88,7 +90,7 @@ func LoadFromFile(path string) (*Info, error) { if _, err := os.Stat(path); os.IsNotExist(err) { return nil, err } - data, err := os.ReadFile(path) + data, err := ioutil.ReadFile(path) if err != nil { return nil, err } diff --git a/vendor/k8s.io/client-go/tools/clientcmd/api/helpers.go b/vendor/k8s.io/client-go/tools/clientcmd/api/helpers.go index 1b4fefdb..d677d651 100644 --- a/vendor/k8s.io/client-go/tools/clientcmd/api/helpers.go +++ b/vendor/k8s.io/client-go/tools/clientcmd/api/helpers.go @@ -20,6 +20,7 @@ import ( "encoding/base64" "errors" "fmt" + "io/ioutil" "os" "path" "path/filepath" @@ -151,7 +152,7 @@ func FlattenContent(path *string, contents *[]byte, baseDir string) error { var err error absPath := ResolvePath(*path, baseDir) - *contents, err = os.ReadFile(absPath) + *contents, err = ioutil.ReadFile(absPath) if err != nil { return err } diff --git a/vendor/k8s.io/client-go/tools/clientcmd/auth_loaders.go b/vendor/k8s.io/client-go/tools/clientcmd/auth_loaders.go index ce951e88..5153a95a 100644 --- a/vendor/k8s.io/client-go/tools/clientcmd/auth_loaders.go +++ b/vendor/k8s.io/client-go/tools/clientcmd/auth_loaders.go @@ -20,6 +20,7 @@ import ( "encoding/json" "fmt" "io" + "io/ioutil" "os" "golang.org/x/term" @@ -58,7 +59,7 @@ func (a *PromptingAuthLoader) LoadAuth(path string) (*clientauth.Info, error) { if err != nil { return &auth, err } - err = os.WriteFile(path, data, 0600) + err = ioutil.WriteFile(path, data, 0600) return &auth, err } authPtr, err := clientauth.LoadFromFile(path) diff --git a/vendor/k8s.io/client-go/tools/clientcmd/client_config.go b/vendor/k8s.io/client-go/tools/clientcmd/client_config.go index 6f06e2db..cc37c9fb 100644 --- a/vendor/k8s.io/client-go/tools/clientcmd/client_config.go +++ b/vendor/k8s.io/client-go/tools/clientcmd/client_config.go @@ -19,6 +19,7 @@ package clientcmd import ( "fmt" "io" + "io/ioutil" "net/http" "net/url" "os" @@ -245,7 +246,7 @@ func (config *DirectClientConfig) getUserIdentificationPartialConfig(configAuthI mergedConfig.BearerToken = configAuthInfo.Token mergedConfig.BearerTokenFile = configAuthInfo.TokenFile } else if len(configAuthInfo.TokenFile) > 0 { - tokenBytes, err := os.ReadFile(configAuthInfo.TokenFile) + tokenBytes, err := ioutil.ReadFile(configAuthInfo.TokenFile) if err != nil { return nil, err } @@ -585,7 +586,7 @@ func (config *inClusterClientConfig) Namespace() (string, bool, error) { } // Fall back to the namespace associated with the service account token, if available - if data, err := os.ReadFile("/var/run/secrets/kubernetes.io/serviceaccount/namespace"); err == nil { + if data, err := ioutil.ReadFile("/var/run/secrets/kubernetes.io/serviceaccount/namespace"); err == nil { if ns := strings.TrimSpace(string(data)); len(ns) > 0 { return ns, false, nil } diff --git a/vendor/k8s.io/client-go/tools/clientcmd/loader.go b/vendor/k8s.io/client-go/tools/clientcmd/loader.go index 44de1d41..4e301332 100644 --- a/vendor/k8s.io/client-go/tools/clientcmd/loader.go +++ b/vendor/k8s.io/client-go/tools/clientcmd/loader.go @@ -18,6 +18,7 @@ package clientcmd import ( "fmt" + "io/ioutil" "os" "path/filepath" "reflect" @@ -282,12 +283,12 @@ func (rules *ClientConfigLoadingRules) Migrate() error { return fmt.Errorf("cannot migrate %v to %v because it is a directory", source, destination) } - data, err := os.ReadFile(source) + data, err := ioutil.ReadFile(source) if err != nil { return err } // destination is created with mode 0666 before umask - err = os.WriteFile(destination, data, 0666) + err = ioutil.WriteFile(destination, data, 0666) if err != nil { return err } @@ -362,7 +363,7 @@ func (rules *ClientConfigLoadingRules) IsDefaultConfig(config *restclient.Config // LoadFromFile takes a filename and deserializes the contents into Config object func LoadFromFile(filename string) (*clientcmdapi.Config, error) { - kubeconfigBytes, err := os.ReadFile(filename) + kubeconfigBytes, err := ioutil.ReadFile(filename) if err != nil { return nil, err } @@ -428,7 +429,7 @@ func WriteToFile(config clientcmdapi.Config, filename string) error { } } - if err := os.WriteFile(filename, content, 0600); err != nil { + if err := ioutil.WriteFile(filename, content, 0600); err != nil { return err } return nil diff --git a/vendor/k8s.io/client-go/tools/remotecommand/errorstream.go b/vendor/k8s.io/client-go/tools/remotecommand/errorstream.go index e60dd7cd..360276b6 100644 --- a/vendor/k8s.io/client-go/tools/remotecommand/errorstream.go +++ b/vendor/k8s.io/client-go/tools/remotecommand/errorstream.go @@ -19,6 +19,7 @@ package remotecommand import ( "fmt" "io" + "io/ioutil" "k8s.io/apimachinery/pkg/util/runtime" ) @@ -38,7 +39,7 @@ func watchErrorStream(errorStream io.Reader, d errorStreamDecoder) chan error { go func() { defer runtime.HandleCrash() - message, err := io.ReadAll(errorStream) + message, err := ioutil.ReadAll(errorStream) switch { case err != nil && err != io.EOF: errorChan <- fmt.Errorf("error reading from error stream: %s", err) diff --git a/vendor/k8s.io/client-go/tools/remotecommand/v1.go b/vendor/k8s.io/client-go/tools/remotecommand/v1.go index 53509c30..ff0fbd2d 100644 --- a/vendor/k8s.io/client-go/tools/remotecommand/v1.go +++ b/vendor/k8s.io/client-go/tools/remotecommand/v1.go @@ -19,6 +19,7 @@ package remotecommand import ( "fmt" "io" + "io/ioutil" "net/http" "k8s.io/api/core/v1" @@ -110,7 +111,7 @@ func (p *streamProtocolV1) stream(conn streamCreator) error { // always read from errorStream go func() { - message, err := io.ReadAll(p.errorStream) + message, err := ioutil.ReadAll(p.errorStream) if err != nil && err != io.EOF { errorChan <- fmt.Errorf("Error reading from error stream: %s", err) return diff --git a/vendor/k8s.io/client-go/tools/remotecommand/v2.go b/vendor/k8s.io/client-go/tools/remotecommand/v2.go index d54612f4..2f5561c9 100644 --- a/vendor/k8s.io/client-go/tools/remotecommand/v2.go +++ b/vendor/k8s.io/client-go/tools/remotecommand/v2.go @@ -19,6 +19,7 @@ package remotecommand import ( "fmt" "io" + "io/ioutil" "net/http" "sync" @@ -125,7 +126,7 @@ func (p *streamProtocolV2) copyStdin() { // this "copy" doesn't actually read anything - it's just here to wait for // the server to close remoteStdin. - if _, err := io.Copy(io.Discard, p.remoteStdin); err != nil { + if _, err := io.Copy(ioutil.Discard, p.remoteStdin); err != nil { runtime.HandleError(err) } }() @@ -144,7 +145,7 @@ func (p *streamProtocolV2) copyStdout(wg *sync.WaitGroup) { // make sure, packet in queue can be consumed. // block in queue may lead to deadlock in conn.server // issue: https://github.com/kubernetes/kubernetes/issues/96339 - defer io.Copy(io.Discard, p.remoteStdout) + defer io.Copy(ioutil.Discard, p.remoteStdout) if _, err := io.Copy(p.Stdout, p.remoteStdout); err != nil { runtime.HandleError(err) @@ -161,7 +162,7 @@ func (p *streamProtocolV2) copyStderr(wg *sync.WaitGroup) { go func() { defer runtime.HandleCrash() defer wg.Done() - defer io.Copy(io.Discard, p.remoteStderr) + defer io.Copy(ioutil.Discard, p.remoteStderr) if _, err := io.Copy(p.Stderr, p.remoteStderr); err != nil { runtime.HandleError(err) diff --git a/vendor/k8s.io/client-go/transport/token_source.go b/vendor/k8s.io/client-go/transport/token_source.go index a431b0cc..68a0a704 100644 --- a/vendor/k8s.io/client-go/transport/token_source.go +++ b/vendor/k8s.io/client-go/transport/token_source.go @@ -18,14 +18,16 @@ package transport import ( "fmt" + "io/ioutil" "net/http" "strings" "sync" "time" + "golang.org/x/oauth2" + utilnet "k8s.io/apimachinery/pkg/util/net" "k8s.io/klog/v2" - "os" ) // TokenSourceWrapTransport returns a WrapTransport that injects bearer tokens @@ -130,7 +132,7 @@ type fileTokenSource struct { var _ = oauth2.TokenSource(&fileTokenSource{}) func (ts *fileTokenSource) Token() (*oauth2.Token, error) { - tokb, err := os.ReadFile(ts.path) + tokb, err := ioutil.ReadFile(ts.path) if err != nil { return nil, fmt.Errorf("failed to read token file %q: %v", ts.path, err) } diff --git a/vendor/k8s.io/client-go/transport/transport.go b/vendor/k8s.io/client-go/transport/transport.go index fc6a0a11..eabfce72 100644 --- a/vendor/k8s.io/client-go/transport/transport.go +++ b/vendor/k8s.io/client-go/transport/transport.go @@ -22,7 +22,7 @@ import ( "crypto/x509" "encoding/pem" "fmt" - "os" + "io/ioutil" "net/http" "reflect" "sync" @@ -195,7 +195,7 @@ func dataFromSliceOrFile(data []byte, file string) ([]byte, error) { return data, nil } if len(file) > 0 { - fileData, err := os.ReadFile(file) + fileData, err := ioutil.ReadFile(file) if err != nil { return []byte{}, err } diff --git a/vendor/k8s.io/client-go/util/cert/cert.go b/vendor/k8s.io/client-go/util/cert/cert.go index 69dbdc52..75143ec0 100644 --- a/vendor/k8s.io/client-go/util/cert/cert.go +++ b/vendor/k8s.io/client-go/util/cert/cert.go @@ -25,7 +25,7 @@ import ( "crypto/x509/pkix" "encoding/pem" "fmt" - "os" + "io/ioutil" "math/big" "net" "path/filepath" @@ -101,9 +101,9 @@ func GenerateSelfSignedCertKeyWithFixtures(host string, alternateIPs []net.IP, a certFixturePath := filepath.Join(fixtureDirectory, baseName+".crt") keyFixturePath := filepath.Join(fixtureDirectory, baseName+".key") if len(fixtureDirectory) > 0 { - cert, err := os.ReadFile(certFixturePath) + cert, err := ioutil.ReadFile(certFixturePath) if err == nil { - key, err := os.ReadFile(keyFixturePath) + key, err := ioutil.ReadFile(keyFixturePath) if err == nil { return cert, key, nil } @@ -188,10 +188,10 @@ func GenerateSelfSignedCertKeyWithFixtures(host string, alternateIPs []net.IP, a } if len(fixtureDirectory) > 0 { - if err := os.WriteFile(certFixturePath, certBuffer.Bytes(), 0644); err != nil { + if err := ioutil.WriteFile(certFixturePath, certBuffer.Bytes(), 0644); err != nil { return nil, nil, fmt.Errorf("failed to write cert fixture to %s: %v", certFixturePath, err) } - if err := os.WriteFile(keyFixturePath, keyBuffer.Bytes(), 0644); err != nil { + if err := ioutil.WriteFile(keyFixturePath, keyBuffer.Bytes(), 0644); err != nil { return nil, nil, fmt.Errorf("failed to write key fixture to %s: %v", certFixturePath, err) } } diff --git a/vendor/k8s.io/client-go/util/cert/io.go b/vendor/k8s.io/client-go/util/cert/io.go index a70e5132..35fde68a 100644 --- a/vendor/k8s.io/client-go/util/cert/io.go +++ b/vendor/k8s.io/client-go/util/cert/io.go @@ -19,6 +19,7 @@ package cert import ( "crypto/x509" "fmt" + "io/ioutil" "os" "path/filepath" ) @@ -65,13 +66,13 @@ func WriteCert(certPath string, data []byte) error { if err := os.MkdirAll(filepath.Dir(certPath), os.FileMode(0755)); err != nil { return err } - return os.WriteFile(certPath, data, os.FileMode(0644)) + return ioutil.WriteFile(certPath, data, os.FileMode(0644)) } // NewPool returns an x509.CertPool containing the certificates in the given PEM-encoded file. // Returns an error if the file could not be read, a certificate could not be parsed, or if the file does not contain any certificates func NewPool(filename string) (*x509.CertPool, error) { - pemBlock, err := os.ReadFile(filename) + pemBlock, err := ioutil.ReadFile(filename) if err != nil { return nil, err } @@ -100,7 +101,7 @@ func NewPoolFromBytes(pemBlock []byte) (*x509.CertPool, error) { // CertsFromFile returns the x509.Certificates contained in the given PEM-encoded file. // Returns an error if the file could not be read, a certificate could not be parsed, or if the file does not contain any certificates func CertsFromFile(file string) ([]*x509.Certificate, error) { - pemBlock, err := os.ReadFile(file) + pemBlock, err := ioutil.ReadFile(file) if err != nil { return nil, err } diff --git a/vendor/k8s.io/client-go/util/keyutil/key.go b/vendor/k8s.io/client-go/util/keyutil/key.go index ecd3e471..83c2c625 100644 --- a/vendor/k8s.io/client-go/util/keyutil/key.go +++ b/vendor/k8s.io/client-go/util/keyutil/key.go @@ -26,6 +26,7 @@ import ( "crypto/x509" "encoding/pem" "fmt" + "io/ioutil" "os" "path/filepath" ) @@ -68,13 +69,13 @@ func WriteKey(keyPath string, data []byte) error { if err := os.MkdirAll(filepath.Dir(keyPath), os.FileMode(0755)); err != nil { return err } - return os.WriteFile(keyPath, data, os.FileMode(0600)) + return ioutil.WriteFile(keyPath, data, os.FileMode(0600)) } // LoadOrGenerateKeyFile looks for a key in the file at the given path. If it // can't find one, it will generate a new key and store it there. func LoadOrGenerateKeyFile(keyPath string) (data []byte, wasGenerated bool, err error) { - loadedData, err := os.ReadFile(keyPath) + loadedData, err := ioutil.ReadFile(keyPath) // Call verifyKeyData to ensure the file wasn't empty/corrupt. if err == nil && verifyKeyData(loadedData) { return loadedData, false, err @@ -121,7 +122,7 @@ func MarshalPrivateKeyToPEM(privateKey crypto.PrivateKey) ([]byte, error) { // PrivateKeyFromFile returns the private key in rsa.PrivateKey or ecdsa.PrivateKey format from a given PEM-encoded file. // Returns an error if the file could not be read or if the private key could not be parsed. func PrivateKeyFromFile(file string) (interface{}, error) { - data, err := os.ReadFile(file) + data, err := ioutil.ReadFile(file) if err != nil { return nil, err } @@ -135,7 +136,7 @@ func PrivateKeyFromFile(file string) (interface{}, error) { // PublicKeysFromFile returns the public keys in rsa.PublicKey or ecdsa.PublicKey format from a given PEM-encoded file. // Reads public keys from both public and private key files. func PublicKeysFromFile(file string) ([]interface{}, error) { - data, err := os.ReadFile(file) + data, err := ioutil.ReadFile(file) if err != nil { return nil, err } diff --git a/vendor/modules.txt b/vendor/modules.txt index d4cf1176..ae23e1e6 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -107,8 +107,6 @@ github.com/gogo/protobuf/proto github.com/gogo/protobuf/protoc-gen-gogo/descriptor github.com/gogo/protobuf/sortkeys github.com/gogo/protobuf/types -# github.com/golang/glog v1.1.2 -## explicit; go 1.19 # github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da ## explicit github.com/golang/groupcache/lru @@ -284,7 +282,7 @@ google.golang.org/genproto/googleapis/api/httpbody # google.golang.org/genproto/googleapis/rpc v0.0.0-20230803162519-f966b187b2e5 ## explicit; go 1.19 google.golang.org/genproto/googleapis/rpc/status -# google.golang.org/grpc v1.57.0 +# google.golang.org/grpc v1.57.1 ## explicit; go 1.17 google.golang.org/grpc google.golang.org/grpc/attributes diff --git a/vendor/sigs.k8s.io/aws-iam-authenticator/pkg/token/filecache.go b/vendor/sigs.k8s.io/aws-iam-authenticator/pkg/token/filecache.go index 09a37fc8..f1e893c2 100644 --- a/vendor/sigs.k8s.io/aws-iam-authenticator/pkg/token/filecache.go +++ b/vendor/sigs.k8s.io/aws-iam-authenticator/pkg/token/filecache.go @@ -8,6 +8,7 @@ import ( "github.com/gofrs/flock" "gopkg.in/yaml.v2" "io/fs" + "io/ioutil" "os" "path/filepath" "runtime" @@ -35,11 +36,11 @@ func (osFS) Stat(filename string) (os.FileInfo, error) { } func (osFS) ReadFile(filename string) ([]byte, error) { - return os.ReadFile(filename) + return ioutil.ReadFile(filename) } func (osFS) WriteFile(filename string, data []byte, perm os.FileMode) error { - return os.WriteFile(filename, data, perm) + return ioutil.WriteFile(filename, data, perm) } func (osFS) MkdirAll(path string, perm os.FileMode) error { diff --git a/vendor/sigs.k8s.io/aws-iam-authenticator/pkg/token/token.go b/vendor/sigs.k8s.io/aws-iam-authenticator/pkg/token/token.go index e6cff512..f34e06ea 100644 --- a/vendor/sigs.k8s.io/aws-iam-authenticator/pkg/token/token.go +++ b/vendor/sigs.k8s.io/aws-iam-authenticator/pkg/token/token.go @@ -20,7 +20,7 @@ import ( "encoding/base64" "encoding/json" "fmt" - "io" + "io/ioutil" "net/http" "net/url" "os" @@ -520,7 +520,7 @@ func (v tokenVerifier) Verify(token string) (*Identity, error) { } defer response.Body.Close() - responseBody, err := io.ReadAll(response.Body) + responseBody, err := ioutil.ReadAll(response.Body) if err != nil { return nil, NewSTSError(fmt.Sprintf("error reading HTTP result: %v", err)) }