Update dependency go modules for k8s v1.26.0-rc.0
This commit is contained in:
10
vendor/k8s.io/client-go/rest/config.go
generated
vendored
10
vendor/k8s.io/client-go/rest/config.go
generated
vendored
@@ -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
|
||||
}
|
||||
@@ -572,10 +571,7 @@ func LoadTLSFiles(c *Config) error {
|
||||
}
|
||||
|
||||
c.KeyData, err = dataFromSliceOrFile(c.KeyData, c.KeyFile)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
return err
|
||||
}
|
||||
|
||||
// dataFromSliceOrFile returns data from the slice (if non-empty), or from the file,
|
||||
@@ -585,7 +581,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
|
||||
}
|
||||
|
4
vendor/k8s.io/client-go/rest/exec.go
generated
vendored
4
vendor/k8s.io/client-go/rest/exec.go
generated
vendored
@@ -55,6 +55,7 @@ func ConfigToExecCluster(config *Config) (*clientauthenticationapi.Cluster, erro
|
||||
InsecureSkipTLSVerify: config.Insecure,
|
||||
CertificateAuthorityData: caData,
|
||||
ProxyURL: proxyURL,
|
||||
DisableCompression: config.DisableCompression,
|
||||
Config: config.ExecProvider.Config,
|
||||
}, nil
|
||||
}
|
||||
@@ -79,6 +80,7 @@ func ExecClusterToConfig(cluster *clientauthenticationapi.Cluster) (*Config, err
|
||||
ServerName: cluster.TLSServerName,
|
||||
CAData: cluster.CertificateAuthorityData,
|
||||
},
|
||||
Proxy: proxy,
|
||||
Proxy: proxy,
|
||||
DisableCompression: cluster.DisableCompression,
|
||||
}, nil
|
||||
}
|
||||
|
20
vendor/k8s.io/client-go/rest/request.go
generated
vendored
20
vendor/k8s.io/client-go/rest/request.go
generated
vendored
@@ -22,10 +22,10 @@ import (
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"mime"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"os"
|
||||
"path"
|
||||
"reflect"
|
||||
"strconv"
|
||||
@@ -437,7 +437,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 +826,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 +1018,7 @@ func (r *Request) Do(ctx context.Context) Result {
|
||||
func (r *Request) DoRaw(ctx context.Context) ([]byte, error) {
|
||||
var result Result
|
||||
err := r.request(ctx, func(req *http.Request, resp *http.Response) {
|
||||
result.body, result.err = 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 +1037,7 @@ func (r *Request) DoRaw(ctx context.Context) ([]byte, error) {
|
||||
func (r *Request) transformResponse(resp *http.Response, req *http.Request) Result {
|
||||
var body []byte
|
||||
if resp.Body != nil {
|
||||
data, err := ioutil.ReadAll(resp.Body)
|
||||
data, err := io.ReadAll(resp.Body)
|
||||
switch err.(type) {
|
||||
case nil:
|
||||
body = data
|
||||
@@ -1179,7 +1179,7 @@ const maxUnstructuredResponseTextBytes = 2048
|
||||
// TODO: introduce transformation of generic http.Client.Do() errors that separates 4.
|
||||
func (r *Request) transformUnstructuredResponseError(resp *http.Response, req *http.Request, body []byte) error {
|
||||
if body == nil && resp.Body != nil {
|
||||
if data, err := 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
|
||||
}
|
||||
}
|
||||
@@ -1288,6 +1288,14 @@ func (r Result) StatusCode(statusCode *int) Result {
|
||||
return r
|
||||
}
|
||||
|
||||
// ContentType returns the "Content-Type" response header into the passed
|
||||
// string, returning the Result for possible chaining. (Only valid if no
|
||||
// error code was returned.)
|
||||
func (r Result) ContentType(contentType *string) Result {
|
||||
*contentType = r.contentType
|
||||
return r
|
||||
}
|
||||
|
||||
// Into stores the result into obj, if possible. If obj is nil it is ignored.
|
||||
// If the returned object is of type Status and has .Status != StatusSuccess, the
|
||||
// additional information in Status will be used to enrich the error.
|
||||
|
5
vendor/k8s.io/client-go/rest/transport.go
generated
vendored
5
vendor/k8s.io/client-go/rest/transport.go
generated
vendored
@@ -108,10 +108,13 @@ func (c *Config) TransportConfig() (*transport.Config, error) {
|
||||
Groups: c.Impersonate.Groups,
|
||||
Extra: c.Impersonate.Extra,
|
||||
},
|
||||
Dial: c.Dial,
|
||||
Proxy: c.Proxy,
|
||||
}
|
||||
|
||||
if c.Dial != nil {
|
||||
conf.DialHolder = &transport.DialHolder{Dial: c.Dial}
|
||||
}
|
||||
|
||||
if c.ExecProvider != nil && c.AuthProvider != nil {
|
||||
return nil, errors.New("execProvider and authProvider cannot be used in combination")
|
||||
}
|
||||
|
3
vendor/k8s.io/client-go/rest/with_retry.go
generated
vendored
3
vendor/k8s.io/client-go/rest/with_retry.go
generated
vendored
@@ -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})
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user