From 91bf42b104179630fbfcf9e643675eed5c214974 Mon Sep 17 00:00:00 2001 From: Aishwarya Date: Tue, 10 Oct 2023 17:57:30 +0530 Subject: [PATCH] Add updated vendor files Update vendor file to remove deprecated libraries --- .../go/compute/internal/version.go | 2 +- .../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/attributes/attributes.go | 28 +++- vendor/google.golang.org/grpc/clientconn.go | 91 +++++++++-- vendor/google.golang.org/grpc/dialoptions.go | 23 +++ .../grpc/internal/envconfig/envconfig.go | 3 + .../grpc/internal/grpcrand/grpcrand.go | 7 + .../grpc/internal/grpcsync/pubsub.go | 136 ++++++++++++++++ .../internal/resolver/dns/dns_resolver.go | 74 +++++---- .../grpc/internal/transport/http2_server.go | 2 +- .../grpc/resolver/resolver.go | 8 +- vendor/google.golang.org/grpc/rpc_util.go | 27 +-- vendor/google.golang.org/grpc/server.go | 27 ++- .../grpc/shared_buffer_pool.go | 154 ++++++++++++++++++ vendor/google.golang.org/grpc/stream.go | 4 +- 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 | 12 +- .../pkg/token/filecache.go | 5 +- .../aws-iam-authenticator/pkg/token/token.go | 4 +- 80 files changed, 678 insertions(+), 277 deletions(-) create mode 100644 vendor/google.golang.org/grpc/internal/grpcsync/pubsub.go create mode 100644 vendor/google.golang.org/grpc/shared_buffer_pool.go diff --git a/vendor/cloud.google.com/go/compute/internal/version.go b/vendor/cloud.google.com/go/compute/internal/version.go index e939b9f5..63955370 100644 --- a/vendor/cloud.google.com/go/compute/internal/version.go +++ b/vendor/cloud.google.com/go/compute/internal/version.go @@ -15,4 +15,4 @@ package internal // Version is the current tagged release of the library. -const Version = "1.20.1" +const Version = "1.23.0" diff --git a/vendor/cloud.google.com/go/compute/metadata/metadata.go b/vendor/cloud.google.com/go/compute/metadata/metadata.go index c17faa14..d32262d4 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/ioutil" + "io" "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, _ := ioutil.ReadFile("/sys/class/dmi/id/product_name") + slurp, _ := os.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 := ioutil.ReadAll(res.Body) + all, err := io.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 10d9918e..92cdef79 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,7 +5,6 @@ import ( "errors" "fmt" "html/template" - "io/ioutil" "os" "path" "path/filepath" @@ -427,11 +426,11 @@ func (r *clusters) GetClusterConfig(name, dir string, admin bool, target Cluster } defer helpers.RemoveFilesWithPattern(resultDir, "[^(.yml)|(.pem)]$") var kubedir, kubeyml string - files, _ := ioutil.ReadDir(resultDir) + files, _ := os.ReadDir(resultDir) for _, f := range files { if f.IsDir() && strings.HasPrefix(f.Name(), "kube") { kubedir = filepath.Join(resultDir, f.Name()) - files, _ := ioutil.ReadDir(kubedir) + files, _ := os.ReadDir(kubedir) for _, f := range files { old := filepath.Join(kubedir, f.Name()) new := filepath.Join(kubedir, "../", f.Name()) @@ -462,14 +461,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 = ioutil.ReadFile(kubeyml); err != nil { + if yamlConfig, err = os.ReadFile(kubeyml); err != nil { return "", err } yamlConfig, err = r.FetchOCTokenForKubeConfig(yamlConfig, &clusterInfo, clusterInfo.IsStagingSatelliteCluster()) if err != nil { return "", err } - err = ioutil.WriteFile(kubeyml, yamlConfig, 0644) // 0644 is irrelevant here, since file already exists. + err = os.WriteFile(kubeyml, yamlConfig, 0644) // 0644 is irrelevant here, since file already exists. if err != nil { return "", err } @@ -513,13 +512,13 @@ func (r *clusters) GetClusterConfigDetail(name, dir string, admin bool, target C } defer helpers.RemoveFilesWithPattern(resultDir, "[^(.yml)|(.pem)]$") var kubedir, kubeyml string - files, _ := ioutil.ReadDir(resultDir) + files, _ := os.ReadDir(resultDir) for _, f := range files { if f.IsDir() && strings.HasPrefix(f.Name(), "kube") { kubedir = filepath.Join(resultDir, f.Name()) - files, _ := ioutil.ReadDir(kubedir) + files, _ := os.ReadDir(kubedir) for _, f := range files { - fileContent, _ := ioutil.ReadFile(kubedir + "/" + f.Name()) + fileContent, _ := os.ReadFile(kubedir + "/" + f.Name()) if f.Name() == "admin-key.pem" { clusterkey.AdminKey = string(fileContent) } @@ -547,7 +546,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, _ := ioutil.ReadFile(kubeyml) + kubefile, _ := os.ReadFile(kubeyml) var yamlConfig ConfigFile err = yaml.Unmarshal(kubefile, &yamlConfig) if err != nil { @@ -572,18 +571,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 = ioutil.ReadFile(kubeyml); err != nil { + if yamlConfig, err = os.ReadFile(kubeyml); err != nil { return clusterkey, err } yamlConfig, err = r.FetchOCTokenForKubeConfig(yamlConfig, &clusterInfo, clusterInfo.IsStagingSatelliteCluster()) if err != nil { return clusterkey, err } - err = ioutil.WriteFile(kubeyml, yamlConfig, 0644) // 0644 is irrelevant here, since file already exists. + err = os.WriteFile(kubeyml, yamlConfig, 0644) // 0644 is irrelevant here, since file already exists. if err != nil { return clusterkey, err } - openshiftyml, _ := ioutil.ReadFile(kubeyml) + openshiftyml, _ := os.ReadFile(kubeyml) var openshiftyaml ConfigFileOpenshift err = yaml.Unmarshal(openshiftyml, &openshiftyaml) if err != nil { @@ -647,7 +646,7 @@ func (r *clusters) StoreConfig(name, dir string, admin, createCalicoConfig bool, return "", "", err } trace.Logger.Println("Located unzipped directory: ", unzipConfigPath) - files, _ := ioutil.ReadDir(unzipConfigPath) + files, _ := os.ReadDir(unzipConfigPath) for _, f := range files { old := filepath.Join(unzipConfigPath, f.Name()) new := filepath.Join(unzipConfigPath, "../", f.Name()) @@ -661,7 +660,7 @@ func (r *clusters) StoreConfig(name, dir string, admin, createCalicoConfig bool, return "", "", err } // Locate the yaml file and return the new path - baseDirFiles, err := ioutil.ReadDir(resultDir) + baseDirFiles, err := os.ReadDir(resultDir) if err != nil { return "", "", err } @@ -695,14 +694,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 = ioutil.ReadFile(kubeconfigFileName); err != nil { + if yamlConfig, err = os.ReadFile(kubeconfigFileName); err != nil { return "", "", err } yamlConfig, err = r.FetchOCTokenForKubeConfig(yamlConfig, &clusterInfo, clusterInfo.IsStagingSatelliteCluster()) if err != nil { return "", "", err } - err = ioutil.WriteFile(kubeconfigFileName, yamlConfig, 0644) // check about permissions and truncate + err = os.WriteFile(kubeconfigFileName, yamlConfig, 0644) // check about permissions and truncate if err != nil { return "", "", err } @@ -753,9 +752,9 @@ func (r *clusters) StoreConfigDetail(name, dir string, admin, createCalicoConfig return "", clusterkey, err } trace.Logger.Println("Located unzipped directory: ", unzipConfigPath) - files, _ := ioutil.ReadDir(unzipConfigPath) + files, _ := os.ReadDir(unzipConfigPath) for _, f := range files { - fileContent, _ := ioutil.ReadFile(unzipConfigPath + "/" + f.Name()) + fileContent, _ := os.ReadFile(unzipConfigPath + "/" + f.Name()) if f.Name() == "admin-key.pem" { clusterkey.AdminKey = string(fileContent) } @@ -777,7 +776,7 @@ func (r *clusters) StoreConfigDetail(name, dir string, admin, createCalicoConfig return "", clusterkey, err } // Locate the yaml file and return the new path - baseDirFiles, err := ioutil.ReadDir(resultDir) + baseDirFiles, err := os.ReadDir(resultDir) if err != nil { return "", clusterkey, err } @@ -799,7 +798,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, _ := ioutil.ReadFile(kubeconfigFileName) + kubefile, _ := os.ReadFile(kubeconfigFileName) var yamlConfig ConfigFile err = yaml.Unmarshal(kubefile, &yamlConfig) if err != nil { @@ -824,18 +823,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 = ioutil.ReadFile(kubeconfigFileName); err != nil { + if yamlConfig, err = os.ReadFile(kubeconfigFileName); err != nil { return "", clusterkey, err } yamlConfig, err = r.FetchOCTokenForKubeConfig(yamlConfig, &clusterInfo, clusterInfo.IsStagingSatelliteCluster()) if err != nil { return "", clusterkey, err } - err = ioutil.WriteFile(kubeconfigFileName, yamlConfig, 0644) // check about permissions and truncate + err = os.WriteFile(kubeconfigFileName, yamlConfig, 0644) // check about permissions and truncate if err != nil { return "", clusterkey, err } - openshiftyml, _ := ioutil.ReadFile(kubeconfigFileName) + openshiftyml, _ := os.ReadFile(kubeconfigFileName) var openshiftyaml ConfigFileOpenshift err = yaml.Unmarshal(openshiftyml, &openshiftyaml) if err != nil { @@ -859,7 +858,7 @@ func (r *clusters) StoreConfigDetail(name, dir string, admin, createCalicoConfig //kubeConfigDir ... func kubeConfigDir(baseDir string) (string, error) { - baseDirFiles, err := ioutil.ReadDir(baseDir) + baseDirFiles, err := os.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 06c87856..ad897303 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/ioutil" + "io" "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, _ := ioutil.ReadAll(resp.Body) + msg, _ := io.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, _ := ioutil.ReadAll(resp.Body) + msg, _ := io.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, _ := ioutil.ReadAll(resp.Body) + msg, _ := io.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 fa806b6a..344e95b2 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/ioutil" + "io" "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 := ioutil.ReadAll(jsonFile) + bytes, err := io.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 4ad260fb..54c88840 100644 --- a/vendor/github.com/IBM-Cloud/bluemix-go/helpers/file.go +++ b/vendor/github.com/IBM-Cloud/bluemix-go/helpers/file.go @@ -3,7 +3,6 @@ package helpers import ( "fmt" "io" - "io/ioutil" "os" "path/filepath" "regexp" @@ -68,7 +67,7 @@ func CopyDir(src string, dest string) (err error) { return fmt.Errorf("Destination %s already exists.", dest) } - entries, err := ioutil.ReadDir(src) + entries, err := os.ReadDir(src) if err != nil { return } @@ -82,7 +81,7 @@ func CopyDir(src string, dest string) (err error) { srcPath := filepath.Join(src, entry.Name()) destPath := filepath.Join(dest, entry.Name()) - if entry.Mode().IsDir() { + if entry.IsDir() { err = CopyDir(srcPath, destPath) } else { err = CopyFile(srcPath, destPath) @@ -101,7 +100,7 @@ func RemoveFilesWithPattern(targetDir, pattern string) error { if err != nil { return err } - files, err := ioutil.ReadDir(targetDir) + files, err := os.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 aee550dc..18f0726f 100644 --- a/vendor/github.com/IBM-Cloud/bluemix-go/rest/client.go +++ b/vendor/github.com/IBM-Cloud/bluemix-go/rest/client.go @@ -47,7 +47,6 @@ import ( "encoding/json" "fmt" "io" - "io/ioutil" "net/http" "reflect" @@ -105,7 +104,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 := ioutil.ReadAll(resp.Body) + raw, err := io.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 5ac5c24a..588addbe 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,7 +4,6 @@ import ( "bytes" "fmt" "io" - "io/ioutil" "net/http/httputil" "github.com/aws/aws-sdk-go/aws" @@ -160,7 +159,7 @@ func logResponse(r *request.Request) { req.ClientInfo.ServiceName, req.Operation.Name, string(b))) if logBody { - b, err := ioutil.ReadAll(lw.buf) + b, err := io.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 36a915ef..e39bd9cb 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/ioutil" + "io" "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: ioutil.NopCloser(bytes.NewReader([]byte{})), + Body: io.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: ioutil.NopCloser(bytes.NewReader([]byte{})), + Body: io.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 e6248360..6040445b 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,7 +81,6 @@ import ( "encoding/json" "fmt" "io" - "io/ioutil" "os" "os/exec" "runtime" @@ -416,7 +415,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 := ioutil.ReadAll(tee) + _, err := io.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 6eda2a55..3cd74851 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" - "io/ioutil" + "os" "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 := ioutil.ReadFile(filepath.Join(defaultCacheLocation(), key)) + fileBytes, err := os.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 19ad619a..f9ce5a9c 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" - "io/ioutil" + "os" "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 := ioutil.ReadFile(string(f)) + data, err := os.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 636d9ec9..06fe32a8 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,7 +4,6 @@ import ( "bytes" "fmt" "io" - "io/ioutil" "net/http" "net/url" "reflect" @@ -531,7 +530,7 @@ func (r *Request) Send() error { if r.HTTPResponse == nil { r.HTTPResponse = &http.Response{ Header: http.Header{}, - Body: ioutil.NopCloser(&bytes.Buffer{}), + Body: io.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 4293dbe1..1a292faa 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,7 +5,6 @@ import ( "crypto/x509" "fmt" "io" - "io/ioutil" "net/http" "os" "strings" @@ -660,7 +659,7 @@ func loadCustomCABundle(client *http.Client, bundle io.Reader) error { } func loadCertPool(r io.Reader) (*x509.CertPool, error) { - b, err := ioutil.ReadAll(r) + b, err := io.ReadAll(r) if err != nil { return nil, awserr.New(ErrCodeLoadCustomCABundle, "failed to read custom CA bundle PEM file", err) @@ -682,13 +681,13 @@ func loadClientTLSCert(client *http.Client, certFile, keyFile io.Reader) error { "unable to get usable HTTP transport from client", err) } - cert, err := ioutil.ReadAll(certFile) + cert, err := io.ReadAll(certFile) if err != nil { return awserr.New(ErrCodeLoadClientTLSCert, "unable to get read client TLS cert file", err) } - key, err := ioutil.ReadAll(keyFile) + key, err := io.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 4d78162c..16f3ad2c 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,7 +60,6 @@ import ( "encoding/hex" "fmt" "io" - "io/ioutil" "net/http" "net/url" "sort" @@ -360,7 +359,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 = ioutil.NopCloser(body) + reader = io.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 582c024a..4b077c64 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,7 +3,6 @@ package ini import ( "bytes" "io" - "io/ioutil" "github.com/aws/aws-sdk-go/aws/awserr" ) @@ -57,7 +56,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 := ioutil.ReadAll(r) + b, err := io.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 c0c52e2d..f0787e8a 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,7 +3,6 @@ package jsonrpc import ( "bytes" "io" - "io/ioutil" "net/http" "strings" @@ -42,7 +41,7 @@ func (u *UnmarshalTypedError) UnmarshalError( if err != nil { return nil, err } - body := ioutil.NopCloser(&buf) + body := io.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 0ea0647a..6d77fd28 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,7 +2,6 @@ package protocol import ( "io" - "io/ioutil" "net/http" "github.com/aws/aws-sdk-go/aws" @@ -32,7 +31,7 @@ func (h HandlerPayloadUnmarshal) UnmarshalPayload(r io.Reader, v interface{}) er HTTPResponse: &http.Response{ StatusCode: 200, Header: http.Header{}, - Body: ioutil.NopCloser(r), + Body: io.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 79fcf169..e0df942f 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,7 +5,6 @@ import ( "encoding/base64" "fmt" "io" - "io/ioutil" "math" "net/http" "reflect" @@ -68,7 +67,7 @@ func unmarshalBody(r *request.Request, v reflect.Value) error { switch payload.Interface().(type) { case []byte: defer r.HTTPResponse.Body.Close() - b, err := ioutil.ReadAll(r.HTTPResponse.Body) + b, err := io.ReadAll(r.HTTPResponse.Body) if err != nil { return awserr.New(request.ErrCodeSerialization, "failed to decode REST response", err) } @@ -77,7 +76,7 @@ func unmarshalBody(r *request.Request, v reflect.Value) error { case *string: defer r.HTTPResponse.Body.Close() - b, err := ioutil.ReadAll(r.HTTPResponse.Body) + b, err := io.ReadAll(r.HTTPResponse.Body) if err != nil { return awserr.New(request.ErrCodeSerialization, "failed to decode REST response", err) } @@ -91,15 +90,15 @@ func unmarshalBody(r *request.Request, v reflect.Value) error { payload.Set(reflect.ValueOf(r.HTTPResponse.Body)) case "io.ReadSeeker": - b, err := ioutil.ReadAll(r.HTTPResponse.Body) + b, err := io.ReadAll(r.HTTPResponse.Body) if err != nil { return awserr.New(request.ErrCodeSerialization, "failed to read response body", err) } - payload.Set(reflect.ValueOf(ioutil.NopCloser(bytes.NewReader(b)))) + payload.Set(reflect.ValueOf(io.NopCloser(bytes.NewReader(b)))) default: - io.Copy(ioutil.Discard, r.HTTPResponse.Body) + io.Copy(io.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 d756d8cc..16e9634f 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,7 +3,6 @@ package restjson import ( "bytes" "io" - "io/ioutil" "net/http" "strings" @@ -56,7 +55,7 @@ func (u *UnmarshalTypedError) UnmarshalError( return nil, err } - body = ioutil.NopCloser(&buf) + body = io.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 f614ef89..6be29423 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,7 +2,6 @@ package protocol import ( "io" - "io/ioutil" "github.com/aws/aws-sdk-go/aws/request" ) @@ -16,7 +15,7 @@ func UnmarshalDiscardBody(r *request.Request) { return } - io.Copy(ioutil.Discard, r.HTTPResponse.Body) + io.Copy(io.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 9a604097..2ac8e50a 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/ioutil" + "io" "log" "net/http" "net/url" @@ -24,6 +24,7 @@ import ( "runtime" "strings" "time" + "os" ) // LoadHTTPTimeout the default timeout for load requests @@ -40,13 +41,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, ioutil.ReadFile, loadHTTPBytes(LoadHTTPTimeout))(path) + return LoadStrategy(path, os.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, ioutil.ReadFile, loadHTTPBytes(timeout))(path) + return LoadStrategy(path, os.ReadFile, loadHTTPBytes(timeout))(path) } // LoadStrategy returns a loader function for a given path or uri @@ -115,6 +116,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 ioutil.ReadAll(resp.Body) + return io.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 a85bf198..106e8df7 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/ioutil" + "io" "github.com/gogo/protobuf/proto" ) @@ -53,7 +53,7 @@ func extractFile(gz []byte) (*FileDescriptorProto, error) { } defer r.Close() - b, err := ioutil.ReadAll(r) + b, err := io.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 ffde8a65..072d92db 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/ioutil" + "io" "sync" "github.com/golang/protobuf/proto" @@ -129,7 +129,7 @@ func deriveFileDescriptor(rawDesc []byte) *descriptorpb.FileDescriptorProto { if err != nil { panic(err) } - b, err := ioutil.ReadAll(zr) + b, err := io.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 066b4323..337cadc2 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/ioutil" + "io" "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 := ioutil.ReadAll(zr) + b, err := io.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 be0e8b40..74919aed 100644 --- a/vendor/github.com/google/gnostic/compiler/reader.go +++ b/vendor/github.com/google/gnostic/compiler/reader.go @@ -16,13 +16,14 @@ package compiler import ( "fmt" - "io/ioutil" + "io" "log" "net/http" "net/url" "path/filepath" "strings" "sync" + "os" yaml "gopkg.in/yaml.v3" ) @@ -168,7 +169,7 @@ func fetchFile(fileurl string) ([]byte, error) { if response.StatusCode != 200 { return nil, fmt.Errorf("Error downloading %s: %s", fileurl, response.Status) } - bytes, err = ioutil.ReadAll(response.Body) + bytes, err = io.ReadAll(response.Body) if fileCacheEnable && err == nil { fileCache[fileurl] = bytes } @@ -194,7 +195,7 @@ func readBytesForFile(filename string) ([]byte, error) { return bytes, nil } // no, it's a local filename - bytes, err := ioutil.ReadFile(filename) + bytes, err := os.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 ec8afd00..ca6bd5cb 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/ioutil" + "io" "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 := ioutil.ReadAll(os.Stdin) + data, err := io.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 b8583d46..185db2ee 100644 --- a/vendor/github.com/google/gnostic/jsonschema/reader.go +++ b/vendor/github.com/google/gnostic/jsonschema/reader.go @@ -18,9 +18,8 @@ package jsonschema import ( "fmt" - "io/ioutil" "strconv" - + "os" "gopkg.in/yaml.v3" ) @@ -45,7 +44,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 := ioutil.ReadFile(filename) + file, err := os.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 f65d1a26..3384e691 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,11 +1,9 @@ package runtime import ( - "io" - "errors" "github.com/golang/protobuf/proto" - "io/ioutil" + "io" ) // ProtoMarshaller is a Marshaller which marshals/unmarshals into/from serialize proto bytes @@ -37,7 +35,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 := ioutil.ReadAll(reader) + buffer, err := io.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 6dd38546..01d26eda 100644 --- a/vendor/github.com/grpc-ecosystem/grpc-gateway/utilities/readerfactory.go +++ b/vendor/github.com/grpc-ecosystem/grpc-gateway/utilities/readerfactory.go @@ -3,13 +3,12 @@ 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 := ioutil.ReadAll(r) + b, err := io.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 9756fcc7..73951c9e 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/ioutil" + "io" ) // 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(ioutil.Discard, "", 0) \ No newline at end of file +var InfoLogger = log.New(io.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 5ba503b0..2946b8f1 100644 --- a/vendor/github.com/prometheus/common/expfmt/text_create.go +++ b/vendor/github.com/prometheus/common/expfmt/text_create.go @@ -17,7 +17,6 @@ import ( "bufio" "fmt" "io" - "io/ioutil" "math" "strconv" "strings" @@ -44,7 +43,7 @@ const ( var ( bufPool = sync.Pool{ New: func() interface{} { - return bufio.NewWriter(ioutil.Discard) + return bufio.NewWriter(io.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 48a069e1..dda74346 100644 --- a/vendor/golang.org/x/net/websocket/hybi.go +++ b/vendor/golang.org/x/net/websocket/hybi.go @@ -16,7 +16,6 @@ import ( "encoding/binary" "fmt" "io" - "io/ioutil" "net/http" "net/url" "strings" @@ -279,7 +278,7 @@ func (handler *hybiFrameHandler) HandleFrame(frame frameReader) (frameReader, er } } if header := frame.HeaderReader(); header != nil { - io.Copy(ioutil.Discard, header) + io.Copy(io.Discard, header) } switch frame.PayloadType() { case ContinuationFrame: @@ -294,7 +293,7 @@ func (handler *hybiFrameHandler) HandleFrame(frame frameReader) (frameReader, er if err != nil && err != io.EOF && err != io.ErrUnexpectedEOF { return nil, err } - io.Copy(ioutil.Discard, frame) + io.Copy(io.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 90a2257c..923a5780 100644 --- a/vendor/golang.org/x/net/websocket/websocket.go +++ b/vendor/golang.org/x/net/websocket/websocket.go @@ -17,7 +17,6 @@ import ( "encoding/json" "errors" "io" - "io/ioutil" "net" "net/http" "net/url" @@ -208,7 +207,7 @@ again: n, err = ws.frameReader.Read(msg) if err == io.EOF { if trailer := ws.frameReader.TrailerReader(); trailer != nil { - io.Copy(ioutil.Discard, trailer) + io.Copy(io.Discard, trailer) } ws.frameReader = nil goto again @@ -330,7 +329,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(ioutil.Discard, ws.frameReader) + _, err = io.Copy(io.Discard, ws.frameReader) if err != nil { return err } @@ -362,7 +361,7 @@ again: return ErrFrameTooLarge } payloadType := frame.PayloadType() - data, err := ioutil.ReadAll(frame) + data, err := io.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 2bf3202b..1ad74a83 100644 --- a/vendor/golang.org/x/oauth2/google/internal/externalaccount/aws.go +++ b/vendor/golang.org/x/oauth2/google/internal/externalaccount/aws.go @@ -14,7 +14,6 @@ import ( "errors" "fmt" "io" - "io/ioutil" "net/http" "net/url" "os" @@ -164,7 +163,7 @@ func requestDataHash(req *http.Request) (string, error) { } defer requestBody.Close() - requestData, err = ioutil.ReadAll(io.LimitReader(requestBody, 1<<20)) + requestData, err = io.ReadAll(io.LimitReader(requestBody, 1<<20)) if err != nil { return "", err } @@ -443,7 +442,7 @@ func (cs *awsCredentialSource) getAWSSessionToken() (string, error) { } defer resp.Body.Close() - respBody, err := ioutil.ReadAll(io.LimitReader(resp.Body, 1<<20)) + respBody, err := io.ReadAll(io.LimitReader(resp.Body, 1<<20)) if err != nil { return "", err } @@ -482,7 +481,7 @@ func (cs *awsCredentialSource) getRegion(headers map[string]string) (string, err } defer resp.Body.Close() - respBody, err := ioutil.ReadAll(io.LimitReader(resp.Body, 1<<20)) + respBody, err := io.ReadAll(io.LimitReader(resp.Body, 1<<20)) if err != nil { return "", err } @@ -549,7 +548,7 @@ func (cs *awsCredentialSource) getMetadataSecurityCredentials(roleName string, h } defer resp.Body.Close() - respBody, err := ioutil.ReadAll(io.LimitReader(resp.Body, 1<<20)) + respBody, err := io.ReadAll(io.LimitReader(resp.Body, 1<<20)) if err != nil { return result, err } @@ -582,7 +581,7 @@ func (cs *awsCredentialSource) getMetadataRoleName(headers map[string]string) (s } defer resp.Body.Close() - respBody, err := ioutil.ReadAll(io.LimitReader(resp.Body, 1<<20)) + respBody, err := io.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 579bcce5..7e8f85b2 100644 --- a/vendor/golang.org/x/oauth2/google/internal/externalaccount/executablecredsource.go +++ b/vendor/golang.org/x/oauth2/google/internal/externalaccount/executablecredsource.go @@ -11,7 +11,6 @@ import ( "errors" "fmt" "io" - "io/ioutil" "os" "os/exec" "regexp" @@ -254,7 +253,7 @@ func (cs executableCredentialSource) getTokenFromOutputFile() (token string, err } defer file.Close() - data, err := ioutil.ReadAll(io.LimitReader(file, 1<<20)) + data, err := io.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 e953ddb4..30107afe 100644 --- a/vendor/golang.org/x/oauth2/google/internal/externalaccount/filecredsource.go +++ b/vendor/golang.org/x/oauth2/google/internal/externalaccount/filecredsource.go @@ -10,7 +10,6 @@ import ( "errors" "fmt" "io" - "io/ioutil" "os" ) @@ -25,7 +24,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 := ioutil.ReadAll(io.LimitReader(tokenFile, 1<<20)) + tokenBytes, err := io.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 54c8f209..89fcb544 100644 --- a/vendor/golang.org/x/oauth2/google/internal/externalaccount/impersonate.go +++ b/vendor/golang.org/x/oauth2/google/internal/externalaccount/impersonate.go @@ -10,7 +10,6 @@ import ( "encoding/json" "fmt" "io" - "io/ioutil" "net/http" "time" @@ -81,7 +80,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 := ioutil.ReadAll(io.LimitReader(resp.Body, 1<<20)) + body, err := io.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 e6fcae5f..72fad624 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,7 +9,6 @@ import ( "encoding/json" "fmt" "io" - "io/ioutil" "net/http" "net/url" "strconv" @@ -64,7 +63,7 @@ func exchangeToken(ctx context.Context, endpoint string, request *stsTokenExchan } defer resp.Body.Close() - body, err := ioutil.ReadAll(io.LimitReader(resp.Body, 1<<20)) + body, err := io.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 16dca654..8eadae4f 100644 --- a/vendor/golang.org/x/oauth2/google/internal/externalaccount/urlcredsource.go +++ b/vendor/golang.org/x/oauth2/google/internal/externalaccount/urlcredsource.go @@ -10,7 +10,6 @@ import ( "errors" "fmt" "io" - "io/ioutil" "net/http" "golang.org/x/oauth2" @@ -40,7 +39,7 @@ func (cs urlCredentialSource) subjectToken() (string, error) { } defer resp.Body.Close() - respBody, err := ioutil.ReadAll(io.LimitReader(resp.Body, 1<<20)) + respBody, err := io.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 58901bda..d9621573 100644 --- a/vendor/golang.org/x/oauth2/internal/token.go +++ b/vendor/golang.org/x/oauth2/internal/token.go @@ -10,7 +10,6 @@ import ( "errors" "fmt" "io" - "io/ioutil" "math" "mime" "net/http" @@ -237,7 +236,7 @@ func doTokenRoundTrip(ctx context.Context, req *http.Request) (*Token, error) { if err != nil { return nil, err } - body, err := ioutil.ReadAll(io.LimitReader(r.Body, 1<<20)) + body, err := io.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 b2bf1829..b4f6d957 100644 --- a/vendor/golang.org/x/oauth2/jwt/jwt.go +++ b/vendor/golang.org/x/oauth2/jwt/jwt.go @@ -13,7 +13,6 @@ import ( "encoding/json" "fmt" "io" - "io/ioutil" "net/http" "net/url" "strings" @@ -136,7 +135,7 @@ func (js jwtSource) Token() (*oauth2.Token, error) { return nil, fmt.Errorf("oauth2: cannot fetch token: %v", err) } defer resp.Body.Close() - body, err := ioutil.ReadAll(io.LimitReader(resp.Body, 1<<20)) + body, err := io.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 721053c2..4935931b 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/ioutil" + "io" "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: ioutil.NopCloser(bytes.NewReader(body)), + Body: io.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 := ioutil.ReadAll(hresp.Body) + hrespBody, err := io.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 c4ba63bb..0409e8eb 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/ioutil" + "io" "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 ioutil.ReadAll(resp.Body) + return io.ReadAll(resp.Body) } diff --git a/vendor/google.golang.org/appengine/urlfetch/urlfetch.go b/vendor/google.golang.org/appengine/urlfetch/urlfetch.go index 6ffe1e6d..ab82d1b3 100644 --- a/vendor/google.golang.org/appengine/urlfetch/urlfetch.go +++ b/vendor/google.golang.org/appengine/urlfetch/urlfetch.go @@ -10,7 +10,6 @@ import ( "errors" "fmt" "io" - "io/ioutil" "net/http" "net/url" "strconv" @@ -158,7 +157,7 @@ func (t *Transport) RoundTrip(req *http.Request) (res *http.Response, err error) }: freq.Payload = b.Bytes() default: - freq.Payload, err = ioutil.ReadAll(req.Body) + freq.Payload, err = io.ReadAll(req.Body) if err != nil { return nil, err } diff --git a/vendor/google.golang.org/grpc/attributes/attributes.go b/vendor/google.golang.org/grpc/attributes/attributes.go index 3efca459..49712aca 100644 --- a/vendor/google.golang.org/grpc/attributes/attributes.go +++ b/vendor/google.golang.org/grpc/attributes/attributes.go @@ -112,19 +112,31 @@ func (a *Attributes) String() string { sb.WriteString("{") first := true for k, v := range a.m { - var key, val string - if str, ok := k.(interface{ String() string }); ok { - key = str.String() - } - if str, ok := v.(interface{ String() string }); ok { - val = str.String() - } if !first { sb.WriteString(", ") } - sb.WriteString(fmt.Sprintf("%q: %q, ", key, val)) + sb.WriteString(fmt.Sprintf("%q: %q ", str(k), str(v))) first = false } sb.WriteString("}") return sb.String() } + +func str(x interface{}) string { + if v, ok := x.(fmt.Stringer); ok { + return v.String() + } else if v, ok := x.(string); ok { + return v + } + return fmt.Sprintf("<%p>", x) +} + +// MarshalJSON helps implement the json.Marshaler interface, thereby rendering +// the Attributes correctly when printing (via pretty.JSON) structs containing +// Attributes as fields. +// +// Is it impossible to unmarshal attributes from a JSON representation and this +// method is meant only for debugging purposes. +func (a *Attributes) MarshalJSON() ([]byte, error) { + return []byte(a.String()), nil +} diff --git a/vendor/google.golang.org/grpc/clientconn.go b/vendor/google.golang.org/grpc/clientconn.go index 95a7459b..bfd7555a 100644 --- a/vendor/google.golang.org/grpc/clientconn.go +++ b/vendor/google.golang.org/grpc/clientconn.go @@ -37,6 +37,7 @@ import ( "google.golang.org/grpc/internal/backoff" "google.golang.org/grpc/internal/channelz" "google.golang.org/grpc/internal/grpcsync" + "google.golang.org/grpc/internal/pretty" iresolver "google.golang.org/grpc/internal/resolver" "google.golang.org/grpc/internal/transport" "google.golang.org/grpc/keepalive" @@ -867,6 +868,20 @@ func (cc *ClientConn) handleSubConnStateChange(sc balancer.SubConn, s connectivi cc.balancerWrapper.updateSubConnState(sc, s, err) } +// Makes a copy of the input addresses slice and clears out the balancer +// attributes field. Addresses are passed during subconn creation and address +// update operations. In both cases, we will clear the balancer attributes by +// calling this function, and therefore we will be able to use the Equal method +// provided by the resolver.Address type for comparison. +func copyAddressesWithoutBalancerAttributes(in []resolver.Address) []resolver.Address { + out := make([]resolver.Address, len(in)) + for i := range in { + out[i] = in[i] + out[i].BalancerAttributes = nil + } + return out +} + // newAddrConn creates an addrConn for addrs and adds it to cc.conns. // // Caller needs to make sure len(addrs) > 0. @@ -874,7 +889,7 @@ func (cc *ClientConn) newAddrConn(addrs []resolver.Address, opts balancer.NewSub ac := &addrConn{ state: connectivity.Idle, cc: cc, - addrs: addrs, + addrs: copyAddressesWithoutBalancerAttributes(addrs), scopts: opts, dopts: cc.dopts, czData: new(channelzData), @@ -995,8 +1010,9 @@ func equalAddresses(a, b []resolver.Address) bool { // connections or connection attempts. func (ac *addrConn) updateAddrs(addrs []resolver.Address) { ac.mu.Lock() - channelz.Infof(logger, ac.channelzID, "addrConn: updateAddrs curAddr: %v, addrs: %v", ac.curAddr, addrs) + channelz.Infof(logger, ac.channelzID, "addrConn: updateAddrs curAddr: %v, addrs: %v", pretty.ToJSON(ac.curAddr), pretty.ToJSON(addrs)) + addrs = copyAddressesWithoutBalancerAttributes(addrs) if equalAddresses(ac.addrs, addrs) { ac.mu.Unlock() return @@ -1807,19 +1823,70 @@ func (cc *ClientConn) parseTargetAndFindResolver() error { } // parseTarget uses RFC 3986 semantics to parse the given target into a -// resolver.Target struct containing scheme, authority and url. Query -// params are stripped from the endpoint. +// resolver.Target struct containing url. Query params are stripped from the +// endpoint. func parseTarget(target string) (resolver.Target, error) { u, err := url.Parse(target) if err != nil { return resolver.Target{}, err } - return resolver.Target{ - Scheme: u.Scheme, - Authority: u.Host, - URL: *u, - }, nil + return resolver.Target{URL: *u}, nil +} + +func encodeAuthority(authority string) string { + const upperhex = "0123456789ABCDEF" + + // Return for characters that must be escaped as per + // Valid chars are mentioned here: + // https://datatracker.ietf.org/doc/html/rfc3986#section-3.2 + shouldEscape := func(c byte) bool { + // Alphanum are always allowed. + if 'a' <= c && c <= 'z' || 'A' <= c && c <= 'Z' || '0' <= c && c <= '9' { + return false + } + switch c { + case '-', '_', '.', '~': // Unreserved characters + return false + case '!', '$', '&', '\'', '(', ')', '*', '+', ',', ';', '=': // Subdelim characters + return false + case ':', '[', ']', '@': // Authority related delimeters + return false + } + // Everything else must be escaped. + return true + } + + hexCount := 0 + for i := 0; i < len(authority); i++ { + c := authority[i] + if shouldEscape(c) { + hexCount++ + } + } + + if hexCount == 0 { + return authority + } + + required := len(authority) + 2*hexCount + t := make([]byte, required) + + j := 0 + // This logic is a barebones version of escape in the go net/url library. + for i := 0; i < len(authority); i++ { + switch c := authority[i]; { + case shouldEscape(c): + t[j] = '%' + t[j+1] = upperhex[c>>4] + t[j+2] = upperhex[c&15] + j += 3 + default: + t[j] = authority[i] + j++ + } + } + return string(t) } // Determine channel authority. The order of precedence is as follows: @@ -1872,7 +1939,11 @@ func (cc *ClientConn) determineAuthority() error { // the channel authority given the user's dial target. For resolvers // which don't implement this interface, we will use the endpoint from // "scheme://authority/endpoint" as the default authority. - cc.authority = endpoint + // Escape the endpoint to handle use cases where the endpoint + // might not be a valid authority by default. + // For example an endpoint which has multiple paths like + // 'a/b/c', which is not a valid authority by default. + cc.authority = encodeAuthority(endpoint) } channelz.Infof(logger, cc.channelzID, "Channel authority set to %q", cc.authority) return nil diff --git a/vendor/google.golang.org/grpc/dialoptions.go b/vendor/google.golang.org/grpc/dialoptions.go index 15a3d510..23ea9523 100644 --- a/vendor/google.golang.org/grpc/dialoptions.go +++ b/vendor/google.golang.org/grpc/dialoptions.go @@ -78,6 +78,7 @@ type dialOptions struct { defaultServiceConfigRawJSON *string resolvers []resolver.Builder idleTimeout time.Duration + recvBufferPool SharedBufferPool } // DialOption configures how we set up the connection. @@ -628,6 +629,7 @@ func defaultDialOptions() dialOptions { ReadBufferSize: defaultReadBufSize, UseProxy: true, }, + recvBufferPool: nopBufferPool{}, } } @@ -676,3 +678,24 @@ func WithIdleTimeout(d time.Duration) DialOption { o.idleTimeout = d }) } + +// WithRecvBufferPool returns a DialOption that configures the ClientConn +// to use the provided shared buffer pool for parsing incoming messages. Depending +// on the application's workload, this could result in reduced memory allocation. +// +// If you are unsure about how to implement a memory pool but want to utilize one, +// begin with grpc.NewSharedBufferPool. +// +// Note: The shared buffer pool feature will not be active if any of the following +// options are used: WithStatsHandler, EnableTracing, or binary logging. In such +// cases, the shared buffer pool will be ignored. +// +// # Experimental +// +// Notice: This API is EXPERIMENTAL and may be changed or removed in a +// later release. +func WithRecvBufferPool(bufferPool SharedBufferPool) DialOption { + return newFuncDialOption(func(o *dialOptions) { + o.recvBufferPool = bufferPool + }) +} diff --git a/vendor/google.golang.org/grpc/internal/envconfig/envconfig.go b/vendor/google.golang.org/grpc/internal/envconfig/envconfig.go index 80fd5c7d..77c2c0b8 100644 --- a/vendor/google.golang.org/grpc/internal/envconfig/envconfig.go +++ b/vendor/google.golang.org/grpc/internal/envconfig/envconfig.go @@ -40,6 +40,9 @@ var ( // pick_first LB policy, which can be enabled by setting the environment // variable "GRPC_EXPERIMENTAL_PICKFIRST_LB_CONFIG" to "true". PickFirstLBConfig = boolFromEnv("GRPC_EXPERIMENTAL_PICKFIRST_LB_CONFIG", false) + // ALTSMaxConcurrentHandshakes is the maximum number of concurrent ALTS + // handshakes that can be performed. + ALTSMaxConcurrentHandshakes = uint64FromEnv("GRPC_ALTS_MAX_CONCURRENT_HANDSHAKES", 100, 1, 100) ) func boolFromEnv(envVar string, def bool) bool { diff --git a/vendor/google.golang.org/grpc/internal/grpcrand/grpcrand.go b/vendor/google.golang.org/grpc/internal/grpcrand/grpcrand.go index d08e3e90..aa97273e 100644 --- a/vendor/google.golang.org/grpc/internal/grpcrand/grpcrand.go +++ b/vendor/google.golang.org/grpc/internal/grpcrand/grpcrand.go @@ -80,6 +80,13 @@ func Uint32() uint32 { return r.Uint32() } +// ExpFloat64 implements rand.ExpFloat64 on the grpcrand global source. +func ExpFloat64() float64 { + mu.Lock() + defer mu.Unlock() + return r.ExpFloat64() +} + // Shuffle implements rand.Shuffle on the grpcrand global source. var Shuffle = func(n int, f func(int, int)) { mu.Lock() diff --git a/vendor/google.golang.org/grpc/internal/grpcsync/pubsub.go b/vendor/google.golang.org/grpc/internal/grpcsync/pubsub.go new file mode 100644 index 00000000..f58b5ffa --- /dev/null +++ b/vendor/google.golang.org/grpc/internal/grpcsync/pubsub.go @@ -0,0 +1,136 @@ +/* + * + * Copyright 2023 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package grpcsync + +import ( + "context" + "sync" +) + +// Subscriber represents an entity that is subscribed to messages published on +// a PubSub. It wraps the callback to be invoked by the PubSub when a new +// message is published. +type Subscriber interface { + // OnMessage is invoked when a new message is published. Implementations + // must not block in this method. + OnMessage(msg interface{}) +} + +// PubSub is a simple one-to-many publish-subscribe system that supports +// messages of arbitrary type. It guarantees that messages are delivered in +// the same order in which they were published. +// +// Publisher invokes the Publish() method to publish new messages, while +// subscribers interested in receiving these messages register a callback +// via the Subscribe() method. +// +// Once a PubSub is stopped, no more messages can be published, and +// it is guaranteed that no more subscriber callback will be invoked. +type PubSub struct { + cs *CallbackSerializer + cancel context.CancelFunc + + // Access to the below fields are guarded by this mutex. + mu sync.Mutex + msg interface{} + subscribers map[Subscriber]bool + stopped bool +} + +// NewPubSub returns a new PubSub instance. +func NewPubSub() *PubSub { + ctx, cancel := context.WithCancel(context.Background()) + return &PubSub{ + cs: NewCallbackSerializer(ctx), + cancel: cancel, + subscribers: map[Subscriber]bool{}, + } +} + +// Subscribe registers the provided Subscriber to the PubSub. +// +// If the PubSub contains a previously published message, the Subscriber's +// OnMessage() callback will be invoked asynchronously with the existing +// message to begin with, and subsequently for every newly published message. +// +// The caller is responsible for invoking the returned cancel function to +// unsubscribe itself from the PubSub. +func (ps *PubSub) Subscribe(sub Subscriber) (cancel func()) { + ps.mu.Lock() + defer ps.mu.Unlock() + + if ps.stopped { + return func() {} + } + + ps.subscribers[sub] = true + + if ps.msg != nil { + msg := ps.msg + ps.cs.Schedule(func(context.Context) { + ps.mu.Lock() + defer ps.mu.Unlock() + if !ps.subscribers[sub] { + return + } + sub.OnMessage(msg) + }) + } + + return func() { + ps.mu.Lock() + defer ps.mu.Unlock() + delete(ps.subscribers, sub) + } +} + +// Publish publishes the provided message to the PubSub, and invokes +// callbacks registered by subscribers asynchronously. +func (ps *PubSub) Publish(msg interface{}) { + ps.mu.Lock() + defer ps.mu.Unlock() + + if ps.stopped { + return + } + + ps.msg = msg + for sub := range ps.subscribers { + s := sub + ps.cs.Schedule(func(context.Context) { + ps.mu.Lock() + defer ps.mu.Unlock() + if !ps.subscribers[s] { + return + } + s.OnMessage(msg) + }) + } +} + +// Stop shuts down the PubSub and releases any resources allocated by it. +// It is guaranteed that no subscriber callbacks would be invoked once this +// method returns. +func (ps *PubSub) Stop() { + ps.mu.Lock() + defer ps.mu.Unlock() + ps.stopped = true + + ps.cancel() +} diff --git a/vendor/google.golang.org/grpc/internal/resolver/dns/dns_resolver.go b/vendor/google.golang.org/grpc/internal/resolver/dns/dns_resolver.go index 09a667f3..99e1e5b3 100644 --- a/vendor/google.golang.org/grpc/internal/resolver/dns/dns_resolver.go +++ b/vendor/google.golang.org/grpc/internal/resolver/dns/dns_resolver.go @@ -62,7 +62,8 @@ const ( defaultPort = "443" defaultDNSSvrPort = "53" golang = "GO" - // txtPrefix is the prefix string to be prepended to the host name for txt record lookup. + // txtPrefix is the prefix string to be prepended to the host name for txt + // record lookup. txtPrefix = "_grpc_config." // In DNS, service config is encoded in a TXT record via the mechanism // described in RFC-1464 using the attribute name grpc_config. @@ -86,14 +87,14 @@ var ( minDNSResRate = 30 * time.Second ) -var customAuthorityDialler = func(authority string) func(ctx context.Context, network, address string) (net.Conn, error) { - return func(ctx context.Context, network, address string) (net.Conn, error) { +var addressDialer = func(address string) func(context.Context, string, string) (net.Conn, error) { + return func(ctx context.Context, network, _ string) (net.Conn, error) { var dialer net.Dialer - return dialer.DialContext(ctx, network, authority) + return dialer.DialContext(ctx, network, address) } } -var customAuthorityResolver = func(authority string) (netResolver, error) { +var newNetResolver = func(authority string) (netResolver, error) { host, port, err := parseTarget(authority, defaultDNSSvrPort) if err != nil { return nil, err @@ -103,7 +104,7 @@ var customAuthorityResolver = func(authority string) (netResolver, error) { return &net.Resolver{ PreferGo: true, - Dial: customAuthorityDialler(authorityWithPort), + Dial: addressDialer(authorityWithPort), }, nil } @@ -114,7 +115,8 @@ func NewBuilder() resolver.Builder { type dnsBuilder struct{} -// Build creates and starts a DNS resolver that watches the name resolution of the target. +// Build creates and starts a DNS resolver that watches the name resolution of +// the target. func (b *dnsBuilder) Build(target resolver.Target, cc resolver.ClientConn, opts resolver.BuildOptions) (resolver.Resolver, error) { host, port, err := parseTarget(target.Endpoint(), defaultPort) if err != nil { @@ -143,7 +145,7 @@ func (b *dnsBuilder) Build(target resolver.Target, cc resolver.ClientConn, opts if target.URL.Host == "" { d.resolver = defaultResolver } else { - d.resolver, err = customAuthorityResolver(target.URL.Host) + d.resolver, err = newNetResolver(target.URL.Host) if err != nil { return nil, err } @@ -180,19 +182,22 @@ type dnsResolver struct { ctx context.Context cancel context.CancelFunc cc resolver.ClientConn - // rn channel is used by ResolveNow() to force an immediate resolution of the target. + // rn channel is used by ResolveNow() to force an immediate resolution of the + // target. rn chan struct{} - // wg is used to enforce Close() to return after the watcher() goroutine has finished. - // Otherwise, data race will be possible. [Race Example] in dns_resolver_test we - // replace the real lookup functions with mocked ones to facilitate testing. - // If Close() doesn't wait for watcher() goroutine finishes, race detector sometimes - // will warns lookup (READ the lookup function pointers) inside watcher() goroutine - // has data race with replaceNetFunc (WRITE the lookup function pointers). + // wg is used to enforce Close() to return after the watcher() goroutine has + // finished. Otherwise, data race will be possible. [Race Example] in + // dns_resolver_test we replace the real lookup functions with mocked ones to + // facilitate testing. If Close() doesn't wait for watcher() goroutine + // finishes, race detector sometimes will warns lookup (READ the lookup + // function pointers) inside watcher() goroutine has data race with + // replaceNetFunc (WRITE the lookup function pointers). wg sync.WaitGroup disableServiceConfig bool } -// ResolveNow invoke an immediate resolution of the target that this dnsResolver watches. +// ResolveNow invoke an immediate resolution of the target that this +// dnsResolver watches. func (d *dnsResolver) ResolveNow(resolver.ResolveNowOptions) { select { case d.rn <- struct{}{}: @@ -220,8 +225,8 @@ func (d *dnsResolver) watcher() { var timer *time.Timer if err == nil { - // Success resolving, wait for the next ResolveNow. However, also wait 30 seconds at the very least - // to prevent constantly re-resolving. + // Success resolving, wait for the next ResolveNow. However, also wait 30 + // seconds at the very least to prevent constantly re-resolving. backoffIndex = 1 timer = newTimerDNSResRate(minDNSResRate) select { @@ -231,7 +236,8 @@ func (d *dnsResolver) watcher() { case <-d.rn: } } else { - // Poll on an error found in DNS Resolver or an error received from ClientConn. + // Poll on an error found in DNS Resolver or an error received from + // ClientConn. timer = newTimer(backoff.DefaultExponential.Backoff(backoffIndex)) backoffIndex++ } @@ -278,7 +284,8 @@ func (d *dnsResolver) lookupSRV() ([]resolver.Address, error) { } func handleDNSError(err error, lookupType string) error { - if dnsErr, ok := err.(*net.DNSError); ok && !dnsErr.IsTimeout && !dnsErr.IsTemporary { + dnsErr, ok := err.(*net.DNSError) + if ok && !dnsErr.IsTimeout && !dnsErr.IsTemporary { // Timeouts and temporary errors should be communicated to gRPC to // attempt another DNS query (with backoff). Other errors should be // suppressed (they may represent the absence of a TXT record). @@ -307,10 +314,12 @@ func (d *dnsResolver) lookupTXT() *serviceconfig.ParseResult { res += s } - // TXT record must have "grpc_config=" attribute in order to be used as service config. + // TXT record must have "grpc_config=" attribute in order to be used as + // service config. if !strings.HasPrefix(res, txtAttribute) { logger.Warningf("dns: TXT record %v missing %v attribute", res, txtAttribute) - // This is not an error; it is the equivalent of not having a service config. + // This is not an error; it is the equivalent of not having a service + // config. return nil } sc := canaryingSC(strings.TrimPrefix(res, txtAttribute)) @@ -352,9 +361,10 @@ func (d *dnsResolver) lookup() (*resolver.State, error) { return &state, nil } -// formatIP returns ok = false if addr is not a valid textual representation of an IP address. -// If addr is an IPv4 address, return the addr and ok = true. -// If addr is an IPv6 address, return the addr enclosed in square brackets and ok = true. +// formatIP returns ok = false if addr is not a valid textual representation of +// an IP address. If addr is an IPv4 address, return the addr and ok = true. +// If addr is an IPv6 address, return the addr enclosed in square brackets and +// ok = true. func formatIP(addr string) (addrIP string, ok bool) { ip := net.ParseIP(addr) if ip == nil { @@ -366,10 +376,10 @@ func formatIP(addr string) (addrIP string, ok bool) { return "[" + addr + "]", true } -// parseTarget takes the user input target string and default port, returns formatted host and port info. -// If target doesn't specify a port, set the port to be the defaultPort. -// If target is in IPv6 format and host-name is enclosed in square brackets, brackets -// are stripped when setting the host. +// parseTarget takes the user input target string and default port, returns +// formatted host and port info. If target doesn't specify a port, set the port +// to be the defaultPort. If target is in IPv6 format and host-name is enclosed +// in square brackets, brackets are stripped when setting the host. // examples: // target: "www.google.com" defaultPort: "443" returns host: "www.google.com", port: "443" // target: "ipv4-host:80" defaultPort: "443" returns host: "ipv4-host", port: "80" @@ -385,12 +395,14 @@ func parseTarget(target, defaultPort string) (host, port string, err error) { } if host, port, err = net.SplitHostPort(target); err == nil { if port == "" { - // If the port field is empty (target ends with colon), e.g. "[::1]:", this is an error. + // If the port field is empty (target ends with colon), e.g. "[::1]:", + // this is an error. return "", "", errEndsWithColon } // target has port, i.e ipv4-host:port, [ipv6-host]:port, host-name:port if host == "" { - // Keep consistent with net.Dial(): If the host is empty, as in ":80", the local system is assumed. + // Keep consistent with net.Dial(): If the host is empty, as in ":80", + // the local system is assumed. host = "localhost" } return host, port, nil 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 79e86ba0..f9606401 100644 --- a/vendor/google.golang.org/grpc/internal/transport/http2_server.go +++ b/vendor/google.golang.org/grpc/internal/transport/http2_server.go @@ -238,7 +238,7 @@ func NewServerTransport(conn net.Conn, config *ServerConfig) (_ ServerTransport, kp.Timeout = defaultServerKeepaliveTimeout } if kp.Time != infinity { - if err = syscall.SetTCPUserTimeout(conn, kp.Timeout); err != nil { + if err = syscall.SetTCPUserTimeout(rawConn, kp.Timeout); err != nil { return nil, connectionErrorf(false, err, "transport: failed to set TCP_USER_TIMEOUT: %v", err) } } diff --git a/vendor/google.golang.org/grpc/resolver/resolver.go b/vendor/google.golang.org/grpc/resolver/resolver.go index 353c10b6..d8db6f5d 100644 --- a/vendor/google.golang.org/grpc/resolver/resolver.go +++ b/vendor/google.golang.org/grpc/resolver/resolver.go @@ -142,6 +142,10 @@ type Address struct { // Equal returns whether a and o are identical. Metadata is compared directly, // not with any recursive introspection. +// +// This method compares all fields of the address. When used to tell apart +// addresses during subchannel creation or connection establishment, it might be +// more appropriate for the caller to implement custom equality logic. func (a Address) Equal(o Address) bool { return a.Addr == o.Addr && a.ServerName == o.ServerName && a.Attributes.Equal(o.Attributes) && @@ -264,10 +268,6 @@ type ClientConn interface { // - "unknown_scheme://authority/endpoint" // Target{Scheme: resolver.GetDefaultScheme(), Endpoint: "unknown_scheme://authority/endpoint"} type Target struct { - // Deprecated: use URL.Scheme instead. - Scheme string - // Deprecated: use URL.Host instead. - Authority string // URL contains the parsed dial target with an optional default scheme added // to it if the original dial target contained no scheme or contained an // unregistered scheme. Any query params specified in the original dial diff --git a/vendor/google.golang.org/grpc/rpc_util.go b/vendor/google.golang.org/grpc/rpc_util.go index 2030736a..a844d28f 100644 --- a/vendor/google.golang.org/grpc/rpc_util.go +++ b/vendor/google.golang.org/grpc/rpc_util.go @@ -577,6 +577,9 @@ type parser struct { // The header of a gRPC message. Find more detail at // https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md header [5]byte + + // recvBufferPool is the pool of shared receive buffers. + recvBufferPool SharedBufferPool } // recvMsg reads a complete gRPC message from the stream. @@ -610,9 +613,7 @@ func (p *parser) recvMsg(maxReceiveMessageSize int) (pf payloadFormat, msg []byt if int(length) > maxReceiveMessageSize { return 0, nil, status.Errorf(codes.ResourceExhausted, "grpc: received message larger than max (%d vs. %d)", length, maxReceiveMessageSize) } - // TODO(bradfitz,zhaoq): garbage. reuse buffer after proto decoding instead - // of making it for each message: - msg = make([]byte, int(length)) + msg = p.recvBufferPool.Get(int(length)) if _, err := p.r.Read(msg); err != nil { if err == io.EOF { err = io.ErrUnexpectedEOF @@ -726,12 +727,12 @@ type payloadInfo struct { } func recvAndDecompress(p *parser, s *transport.Stream, dc Decompressor, maxReceiveMessageSize int, payInfo *payloadInfo, compressor encoding.Compressor) ([]byte, error) { - pf, d, err := p.recvMsg(maxReceiveMessageSize) + pf, buf, err := p.recvMsg(maxReceiveMessageSize) if err != nil { return nil, err } if payInfo != nil { - payInfo.compressedLength = len(d) + payInfo.compressedLength = len(buf) } if st := checkRecvPayload(pf, s.RecvCompress(), compressor != nil || dc != nil); st != nil { @@ -743,10 +744,10 @@ func recvAndDecompress(p *parser, s *transport.Stream, dc Decompressor, maxRecei // To match legacy behavior, if the decompressor is set by WithDecompressor or RPCDecompressor, // use this decompressor as the default. if dc != nil { - d, err = dc.Do(bytes.NewReader(d)) - size = len(d) + buf, err = dc.Do(bytes.NewReader(buf)) + size = len(buf) } else { - d, size, err = decompress(compressor, d, maxReceiveMessageSize) + buf, size, err = decompress(compressor, buf, maxReceiveMessageSize) } if err != nil { return nil, status.Errorf(codes.Internal, "grpc: failed to decompress the received message: %v", err) @@ -757,7 +758,7 @@ func recvAndDecompress(p *parser, s *transport.Stream, dc Decompressor, maxRecei return nil, status.Errorf(codes.ResourceExhausted, "grpc: received message after decompression larger than max (%d vs. %d)", size, maxReceiveMessageSize) } } - return d, nil + return buf, nil } // Using compressor, decompress d, returning data and size. @@ -792,15 +793,17 @@ func decompress(compressor encoding.Compressor, d []byte, maxReceiveMessageSize // dc takes precedence over compressor. // TODO(dfawley): wrap the old compressor/decompressor using the new API? func recv(p *parser, c baseCodec, s *transport.Stream, dc Decompressor, m interface{}, maxReceiveMessageSize int, payInfo *payloadInfo, compressor encoding.Compressor) error { - d, err := recvAndDecompress(p, s, dc, maxReceiveMessageSize, payInfo, compressor) + buf, err := recvAndDecompress(p, s, dc, maxReceiveMessageSize, payInfo, compressor) if err != nil { return err } - if err := c.Unmarshal(d, m); err != nil { + if err := c.Unmarshal(buf, m); err != nil { return status.Errorf(codes.Internal, "grpc: failed to unmarshal the received message: %v", err) } if payInfo != nil { - payInfo.uncompressedBytes = d + payInfo.uncompressedBytes = buf + } else { + p.recvBufferPool.Put(&buf) } return nil } diff --git a/vendor/google.golang.org/grpc/server.go b/vendor/google.golang.org/grpc/server.go index 81969e7c..e076ec71 100644 --- a/vendor/google.golang.org/grpc/server.go +++ b/vendor/google.golang.org/grpc/server.go @@ -174,6 +174,7 @@ type serverOptions struct { maxHeaderListSize *uint32 headerTableSize *uint32 numServerWorkers uint32 + recvBufferPool SharedBufferPool } var defaultServerOptions = serverOptions{ @@ -182,6 +183,7 @@ var defaultServerOptions = serverOptions{ connectionTimeout: 120 * time.Second, writeBufferSize: defaultWriteBufSize, readBufferSize: defaultReadBufSize, + recvBufferPool: nopBufferPool{}, } var globalServerOptions []ServerOption @@ -552,6 +554,27 @@ func NumStreamWorkers(numServerWorkers uint32) ServerOption { }) } +// RecvBufferPool returns a ServerOption that configures the server +// to use the provided shared buffer pool for parsing incoming messages. Depending +// on the application's workload, this could result in reduced memory allocation. +// +// If you are unsure about how to implement a memory pool but want to utilize one, +// begin with grpc.NewSharedBufferPool. +// +// Note: The shared buffer pool feature will not be active if any of the following +// options are used: StatsHandler, EnableTracing, or binary logging. In such +// cases, the shared buffer pool will be ignored. +// +// # Experimental +// +// Notice: This API is EXPERIMENTAL and may be changed or removed in a +// later release. +func RecvBufferPool(bufferPool SharedBufferPool) ServerOption { + return newFuncServerOption(func(o *serverOptions) { + o.recvBufferPool = bufferPool + }) +} + // serverWorkerResetThreshold defines how often the stack must be reset. Every // N requests, by spawning a new goroutine in its place, a worker can reset its // stack so that large stacks don't live in memory forever. 2^16 should allow @@ -1296,7 +1319,7 @@ func (s *Server) processUnaryRPC(t transport.ServerTransport, stream *transport. if len(shs) != 0 || len(binlogs) != 0 { payInfo = &payloadInfo{} } - d, err := recvAndDecompress(&parser{r: stream}, stream, dc, s.opts.maxReceiveMessageSize, payInfo, decomp) + d, err := recvAndDecompress(&parser{r: stream, recvBufferPool: s.opts.recvBufferPool}, stream, dc, s.opts.maxReceiveMessageSize, payInfo, decomp) if err != nil { if e := t.WriteStatus(stream, status.Convert(err)); e != nil { channelz.Warningf(logger, s.channelzID, "grpc: Server.processUnaryRPC failed to write status: %v", e) @@ -1506,7 +1529,7 @@ func (s *Server) processStreamingRPC(t transport.ServerTransport, stream *transp ctx: ctx, t: t, s: stream, - p: &parser{r: stream}, + p: &parser{r: stream, recvBufferPool: s.opts.recvBufferPool}, codec: s.getCodec(stream.ContentSubtype()), maxReceiveMessageSize: s.opts.maxReceiveMessageSize, maxSendMessageSize: s.opts.maxSendMessageSize, diff --git a/vendor/google.golang.org/grpc/shared_buffer_pool.go b/vendor/google.golang.org/grpc/shared_buffer_pool.go new file mode 100644 index 00000000..c3a5a9ac --- /dev/null +++ b/vendor/google.golang.org/grpc/shared_buffer_pool.go @@ -0,0 +1,154 @@ +/* + * + * Copyright 2023 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package grpc + +import "sync" + +// SharedBufferPool is a pool of buffers that can be shared, resulting in +// decreased memory allocation. Currently, in gRPC-go, it is only utilized +// for parsing incoming messages. +// +// # Experimental +// +// Notice: This API is EXPERIMENTAL and may be changed or removed in a +// later release. +type SharedBufferPool interface { + // Get returns a buffer with specified length from the pool. + // + // The returned byte slice may be not zero initialized. + Get(length int) []byte + + // Put returns a buffer to the pool. + Put(*[]byte) +} + +// NewSharedBufferPool creates a simple SharedBufferPool with buckets +// of different sizes to optimize memory usage. This prevents the pool from +// wasting large amounts of memory, even when handling messages of varying sizes. +// +// # Experimental +// +// Notice: This API is EXPERIMENTAL and may be changed or removed in a +// later release. +func NewSharedBufferPool() SharedBufferPool { + return &simpleSharedBufferPool{ + pools: [poolArraySize]simpleSharedBufferChildPool{ + newBytesPool(level0PoolMaxSize), + newBytesPool(level1PoolMaxSize), + newBytesPool(level2PoolMaxSize), + newBytesPool(level3PoolMaxSize), + newBytesPool(level4PoolMaxSize), + newBytesPool(0), + }, + } +} + +// simpleSharedBufferPool is a simple implementation of SharedBufferPool. +type simpleSharedBufferPool struct { + pools [poolArraySize]simpleSharedBufferChildPool +} + +func (p *simpleSharedBufferPool) Get(size int) []byte { + return p.pools[p.poolIdx(size)].Get(size) +} + +func (p *simpleSharedBufferPool) Put(bs *[]byte) { + p.pools[p.poolIdx(cap(*bs))].Put(bs) +} + +func (p *simpleSharedBufferPool) poolIdx(size int) int { + switch { + case size <= level0PoolMaxSize: + return level0PoolIdx + case size <= level1PoolMaxSize: + return level1PoolIdx + case size <= level2PoolMaxSize: + return level2PoolIdx + case size <= level3PoolMaxSize: + return level3PoolIdx + case size <= level4PoolMaxSize: + return level4PoolIdx + default: + return levelMaxPoolIdx + } +} + +const ( + level0PoolMaxSize = 16 // 16 B + level1PoolMaxSize = level0PoolMaxSize * 16 // 256 B + level2PoolMaxSize = level1PoolMaxSize * 16 // 4 KB + level3PoolMaxSize = level2PoolMaxSize * 16 // 64 KB + level4PoolMaxSize = level3PoolMaxSize * 16 // 1 MB +) + +const ( + level0PoolIdx = iota + level1PoolIdx + level2PoolIdx + level3PoolIdx + level4PoolIdx + levelMaxPoolIdx + poolArraySize +) + +type simpleSharedBufferChildPool interface { + Get(size int) []byte + Put(interface{}) +} + +type bufferPool struct { + sync.Pool + + defaultSize int +} + +func (p *bufferPool) Get(size int) []byte { + bs := p.Pool.Get().(*[]byte) + + if cap(*bs) < size { + p.Pool.Put(bs) + + return make([]byte, size) + } + + return (*bs)[:size] +} + +func newBytesPool(size int) simpleSharedBufferChildPool { + return &bufferPool{ + Pool: sync.Pool{ + New: func() interface{} { + bs := make([]byte, size) + return &bs + }, + }, + defaultSize: size, + } +} + +// nopBufferPool is a buffer pool just makes new buffer without pooling. +type nopBufferPool struct { +} + +func (nopBufferPool) Get(length int) []byte { + return make([]byte, length) +} + +func (nopBufferPool) Put(*[]byte) { +} diff --git a/vendor/google.golang.org/grpc/stream.go b/vendor/google.golang.org/grpc/stream.go index 10092685..de32a759 100644 --- a/vendor/google.golang.org/grpc/stream.go +++ b/vendor/google.golang.org/grpc/stream.go @@ -507,7 +507,7 @@ func (a *csAttempt) newStream() error { return toRPCErr(nse.Err) } a.s = s - a.p = &parser{r: s} + a.p = &parser{r: s, recvBufferPool: a.cs.cc.dopts.recvBufferPool} return nil } @@ -1270,7 +1270,7 @@ func newNonRetryClientStream(ctx context.Context, desc *StreamDesc, method strin return nil, err } as.s = s - as.p = &parser{r: s} + as.p = &parser{r: s, recvBufferPool: ac.dopts.recvBufferPool} ac.incrCallsStarted() if desc != unaryStreamDesc { // Listen on stream context to cleanup when the stream context is diff --git a/vendor/google.golang.org/grpc/version.go b/vendor/google.golang.org/grpc/version.go index 59b51358..353cfd52 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.56.2" +const Version = "1.57.0" 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 9ab09108..b649f112 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/ioutil" + "io" "sync" "google.golang.org/protobuf/internal/filedesc" @@ -51,7 +51,7 @@ func legacyLoadFileDesc(b []byte) protoreflect.FileDescriptor { if err != nil { panic(err) } - b2, err := ioutil.ReadAll(zr) + b2, err := io.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 ea048179..0cc944f6 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/ioutil" + "io" "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 := ioutil.ReadAll(resp.Body) + responseErrorBytes, err := io.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 4909dc53..d61ca203 100644 --- a/vendor/k8s.io/client-go/rest/config.go +++ b/vendor/k8s.io/client-go/rest/config.go @@ -20,7 +20,6 @@ import ( "context" "errors" "fmt" - "io/ioutil" "net" "net/http" "net/url" @@ -519,7 +518,7 @@ func InClusterConfig() (*Config, error) { return nil, ErrNotInCluster } - token, err := ioutil.ReadFile(tokenFile) + token, err := os.ReadFile(tokenFile) if err != nil { return nil, err } @@ -585,7 +584,7 @@ func dataFromSliceOrFile(data []byte, file string) ([]byte, error) { return data, nil } if len(file) > 0 { - fileData, err := ioutil.ReadFile(file) + fileData, err := os.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 acf31136..cf41431e 100644 --- a/vendor/k8s.io/client-go/rest/request.go +++ b/vendor/k8s.io/client-go/rest/request.go @@ -22,7 +22,6 @@ import ( "encoding/hex" "fmt" "io" - "io/ioutil" "mime" "net/http" "net/url" @@ -32,7 +31,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" @@ -437,7 +436,7 @@ func (r *Request) Body(obj interface{}) *Request { } switch t := obj.(type) { case string: - data, err := ioutil.ReadFile(t) + data, err := os.ReadFile(t) if err != nil { r.err = err return r @@ -826,7 +825,7 @@ func (r *Request) Stream(ctx context.Context) (io.ReadCloser, error) { return nil, err } if r.body != nil { - req.Body = ioutil.NopCloser(r.body) + req.Body = io.NopCloser(r.body) } resp, err := client.Do(req) updateURLMetrics(ctx, r, resp, err) @@ -1018,7 +1017,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 = ioutil.ReadAll(resp.Body) + result.body, result.err = io.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) @@ -1037,7 +1036,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 := ioutil.ReadAll(resp.Body) + data, err := io.ReadAll(resp.Body) switch err.(type) { case nil: body = data @@ -1179,7 +1178,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 := ioutil.ReadAll(&io.LimitedReader{R: resp.Body, N: maxUnstructuredResponseTextBytes}); err == nil { + if data, err := io.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 bdcc6f3a..b04e3e9e 100644 --- a/vendor/k8s.io/client-go/rest/with_retry.go +++ b/vendor/k8s.io/client-go/rest/with_retry.go @@ -20,7 +20,6 @@ import ( "context" "fmt" "io" - "io/ioutil" "net/http" "net/url" "time" @@ -345,7 +344,7 @@ func readAndCloseResponseBody(resp *http.Response) { defer resp.Body.Close() if resp.ContentLength <= maxBodySlurpSize { - io.Copy(ioutil.Discard, &io.LimitedReader{R: resp.Body, N: maxBodySlurpSize}) + io.Copy(io.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 ac30271f..2fcdc7c3 100644 --- a/vendor/k8s.io/client-go/tools/auth/clientauth.go +++ b/vendor/k8s.io/client-go/tools/auth/clientauth.go @@ -65,9 +65,7 @@ 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" ) @@ -90,7 +88,7 @@ func LoadFromFile(path string) (*Info, error) { if _, err := os.Stat(path); os.IsNotExist(err) { return nil, err } - data, err := ioutil.ReadFile(path) + data, err := os.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 d677d651..1b4fefdb 100644 --- a/vendor/k8s.io/client-go/tools/clientcmd/api/helpers.go +++ b/vendor/k8s.io/client-go/tools/clientcmd/api/helpers.go @@ -20,7 +20,6 @@ import ( "encoding/base64" "errors" "fmt" - "io/ioutil" "os" "path" "path/filepath" @@ -152,7 +151,7 @@ func FlattenContent(path *string, contents *[]byte, baseDir string) error { var err error absPath := ResolvePath(*path, baseDir) - *contents, err = ioutil.ReadFile(absPath) + *contents, err = os.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 5153a95a..ce951e88 100644 --- a/vendor/k8s.io/client-go/tools/clientcmd/auth_loaders.go +++ b/vendor/k8s.io/client-go/tools/clientcmd/auth_loaders.go @@ -20,7 +20,6 @@ import ( "encoding/json" "fmt" "io" - "io/ioutil" "os" "golang.org/x/term" @@ -59,7 +58,7 @@ func (a *PromptingAuthLoader) LoadAuth(path string) (*clientauth.Info, error) { if err != nil { return &auth, err } - err = ioutil.WriteFile(path, data, 0600) + err = os.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 cc37c9fb..6f06e2db 100644 --- a/vendor/k8s.io/client-go/tools/clientcmd/client_config.go +++ b/vendor/k8s.io/client-go/tools/clientcmd/client_config.go @@ -19,7 +19,6 @@ package clientcmd import ( "fmt" "io" - "io/ioutil" "net/http" "net/url" "os" @@ -246,7 +245,7 @@ func (config *DirectClientConfig) getUserIdentificationPartialConfig(configAuthI mergedConfig.BearerToken = configAuthInfo.Token mergedConfig.BearerTokenFile = configAuthInfo.TokenFile } else if len(configAuthInfo.TokenFile) > 0 { - tokenBytes, err := ioutil.ReadFile(configAuthInfo.TokenFile) + tokenBytes, err := os.ReadFile(configAuthInfo.TokenFile) if err != nil { return nil, err } @@ -586,7 +585,7 @@ func (config *inClusterClientConfig) Namespace() (string, bool, error) { } // Fall back to the namespace associated with the service account token, if available - if data, err := ioutil.ReadFile("/var/run/secrets/kubernetes.io/serviceaccount/namespace"); err == nil { + if data, err := os.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 4e301332..44de1d41 100644 --- a/vendor/k8s.io/client-go/tools/clientcmd/loader.go +++ b/vendor/k8s.io/client-go/tools/clientcmd/loader.go @@ -18,7 +18,6 @@ package clientcmd import ( "fmt" - "io/ioutil" "os" "path/filepath" "reflect" @@ -283,12 +282,12 @@ func (rules *ClientConfigLoadingRules) Migrate() error { return fmt.Errorf("cannot migrate %v to %v because it is a directory", source, destination) } - data, err := ioutil.ReadFile(source) + data, err := os.ReadFile(source) if err != nil { return err } // destination is created with mode 0666 before umask - err = ioutil.WriteFile(destination, data, 0666) + err = os.WriteFile(destination, data, 0666) if err != nil { return err } @@ -363,7 +362,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 := ioutil.ReadFile(filename) + kubeconfigBytes, err := os.ReadFile(filename) if err != nil { return nil, err } @@ -429,7 +428,7 @@ func WriteToFile(config clientcmdapi.Config, filename string) error { } } - if err := ioutil.WriteFile(filename, content, 0600); err != nil { + if err := os.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 360276b6..e60dd7cd 100644 --- a/vendor/k8s.io/client-go/tools/remotecommand/errorstream.go +++ b/vendor/k8s.io/client-go/tools/remotecommand/errorstream.go @@ -19,7 +19,6 @@ package remotecommand import ( "fmt" "io" - "io/ioutil" "k8s.io/apimachinery/pkg/util/runtime" ) @@ -39,7 +38,7 @@ func watchErrorStream(errorStream io.Reader, d errorStreamDecoder) chan error { go func() { defer runtime.HandleCrash() - message, err := ioutil.ReadAll(errorStream) + message, err := io.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 ff0fbd2d..53509c30 100644 --- a/vendor/k8s.io/client-go/tools/remotecommand/v1.go +++ b/vendor/k8s.io/client-go/tools/remotecommand/v1.go @@ -19,7 +19,6 @@ package remotecommand import ( "fmt" "io" - "io/ioutil" "net/http" "k8s.io/api/core/v1" @@ -111,7 +110,7 @@ func (p *streamProtocolV1) stream(conn streamCreator) error { // always read from errorStream go func() { - message, err := ioutil.ReadAll(p.errorStream) + message, err := io.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 2f5561c9..d54612f4 100644 --- a/vendor/k8s.io/client-go/tools/remotecommand/v2.go +++ b/vendor/k8s.io/client-go/tools/remotecommand/v2.go @@ -19,7 +19,6 @@ package remotecommand import ( "fmt" "io" - "io/ioutil" "net/http" "sync" @@ -126,7 +125,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(ioutil.Discard, p.remoteStdin); err != nil { + if _, err := io.Copy(io.Discard, p.remoteStdin); err != nil { runtime.HandleError(err) } }() @@ -145,7 +144,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(ioutil.Discard, p.remoteStdout) + defer io.Copy(io.Discard, p.remoteStdout) if _, err := io.Copy(p.Stdout, p.remoteStdout); err != nil { runtime.HandleError(err) @@ -162,7 +161,7 @@ func (p *streamProtocolV2) copyStderr(wg *sync.WaitGroup) { go func() { defer runtime.HandleCrash() defer wg.Done() - defer io.Copy(ioutil.Discard, p.remoteStderr) + defer io.Copy(io.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 68a0a704..a431b0cc 100644 --- a/vendor/k8s.io/client-go/transport/token_source.go +++ b/vendor/k8s.io/client-go/transport/token_source.go @@ -18,16 +18,14 @@ 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 @@ -132,7 +130,7 @@ type fileTokenSource struct { var _ = oauth2.TokenSource(&fileTokenSource{}) func (ts *fileTokenSource) Token() (*oauth2.Token, error) { - tokb, err := ioutil.ReadFile(ts.path) + tokb, err := os.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 eabfce72..fc6a0a11 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" - "io/ioutil" + "os" "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 := ioutil.ReadFile(file) + fileData, err := os.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 75143ec0..69dbdc52 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" - "io/ioutil" + "os" "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 := ioutil.ReadFile(certFixturePath) + cert, err := os.ReadFile(certFixturePath) if err == nil { - key, err := ioutil.ReadFile(keyFixturePath) + key, err := os.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 := ioutil.WriteFile(certFixturePath, certBuffer.Bytes(), 0644); err != nil { + if err := os.WriteFile(certFixturePath, certBuffer.Bytes(), 0644); err != nil { return nil, nil, fmt.Errorf("failed to write cert fixture to %s: %v", certFixturePath, err) } - if err := ioutil.WriteFile(keyFixturePath, keyBuffer.Bytes(), 0644); err != nil { + if err := os.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 35fde68a..a70e5132 100644 --- a/vendor/k8s.io/client-go/util/cert/io.go +++ b/vendor/k8s.io/client-go/util/cert/io.go @@ -19,7 +19,6 @@ package cert import ( "crypto/x509" "fmt" - "io/ioutil" "os" "path/filepath" ) @@ -66,13 +65,13 @@ func WriteCert(certPath string, data []byte) error { if err := os.MkdirAll(filepath.Dir(certPath), os.FileMode(0755)); err != nil { return err } - return ioutil.WriteFile(certPath, data, os.FileMode(0644)) + return os.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 := ioutil.ReadFile(filename) + pemBlock, err := os.ReadFile(filename) if err != nil { return nil, err } @@ -101,7 +100,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 := ioutil.ReadFile(file) + pemBlock, err := os.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 83c2c625..ecd3e471 100644 --- a/vendor/k8s.io/client-go/util/keyutil/key.go +++ b/vendor/k8s.io/client-go/util/keyutil/key.go @@ -26,7 +26,6 @@ import ( "crypto/x509" "encoding/pem" "fmt" - "io/ioutil" "os" "path/filepath" ) @@ -69,13 +68,13 @@ func WriteKey(keyPath string, data []byte) error { if err := os.MkdirAll(filepath.Dir(keyPath), os.FileMode(0755)); err != nil { return err } - return ioutil.WriteFile(keyPath, data, os.FileMode(0600)) + return os.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 := ioutil.ReadFile(keyPath) + loadedData, err := os.ReadFile(keyPath) // Call verifyKeyData to ensure the file wasn't empty/corrupt. if err == nil && verifyKeyData(loadedData) { return loadedData, false, err @@ -122,7 +121,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 := ioutil.ReadFile(file) + data, err := os.ReadFile(file) if err != nil { return nil, err } @@ -136,7 +135,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 := ioutil.ReadFile(file) + data, err := os.ReadFile(file) if err != nil { return nil, err } diff --git a/vendor/modules.txt b/vendor/modules.txt index 25ebc5d9..d4cf1176 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1,4 +1,4 @@ -# cloud.google.com/go/compute v1.20.1 +# cloud.google.com/go/compute v1.23.0 ## explicit; go 1.19 cloud.google.com/go/compute/internal # cloud.google.com/go/compute/metadata v0.2.3 @@ -107,6 +107,8 @@ 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 @@ -273,16 +275,16 @@ google.golang.org/appengine/internal/modules google.golang.org/appengine/internal/remote_api google.golang.org/appengine/internal/urlfetch google.golang.org/appengine/urlfetch -# google.golang.org/genproto v0.0.0-20230711160842-782d3b101e98 +# google.golang.org/genproto v0.0.0-20230913181813-007df8e322eb ## explicit; go 1.19 google.golang.org/genproto/protobuf/field_mask -# google.golang.org/genproto/googleapis/api v0.0.0-20230711160842-782d3b101e98 +# google.golang.org/genproto/googleapis/api v0.0.0-20230913181813-007df8e322eb ## explicit; go 1.19 google.golang.org/genproto/googleapis/api/httpbody -# google.golang.org/genproto/googleapis/rpc v0.0.0-20230706204954-ccb25ca9f130 +# 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.56.2 +# google.golang.org/grpc v1.57.0 ## 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 f1e893c2..09a37fc8 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,7 +8,6 @@ import ( "github.com/gofrs/flock" "gopkg.in/yaml.v2" "io/fs" - "io/ioutil" "os" "path/filepath" "runtime" @@ -36,11 +35,11 @@ func (osFS) Stat(filename string) (os.FileInfo, error) { } func (osFS) ReadFile(filename string) ([]byte, error) { - return ioutil.ReadFile(filename) + return os.ReadFile(filename) } func (osFS) WriteFile(filename string, data []byte, perm os.FileMode) error { - return ioutil.WriteFile(filename, data, perm) + return os.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 f34e06ea..e6cff512 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/ioutil" + "io" "net/http" "net/url" "os" @@ -520,7 +520,7 @@ func (v tokenVerifier) Verify(token string) (*Identity, error) { } defer response.Body.Close() - responseBody, err := ioutil.ReadAll(response.Body) + responseBody, err := io.ReadAll(response.Body) if err != nil { return nil, NewSTSError(fmt.Sprintf("error reading HTTP result: %v", err)) }