Update k8s apis to release-1.14 and update all of vendor
This commit is contained in:
44
vendor/k8s.io/client-go/tools/clientcmd/api/types.go
generated
vendored
44
vendor/k8s.io/client-go/tools/clientcmd/api/types.go
generated
vendored
@@ -17,6 +17,8 @@ limitations under the License.
|
||||
package api
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
@@ -150,6 +152,25 @@ type AuthProviderConfig struct {
|
||||
Config map[string]string `json:"config,omitempty"`
|
||||
}
|
||||
|
||||
var _ fmt.Stringer = new(AuthProviderConfig)
|
||||
var _ fmt.GoStringer = new(AuthProviderConfig)
|
||||
|
||||
// GoString implements fmt.GoStringer and sanitizes sensitive fields of
|
||||
// AuthProviderConfig to prevent accidental leaking via logs.
|
||||
func (c AuthProviderConfig) GoString() string {
|
||||
return c.String()
|
||||
}
|
||||
|
||||
// String implements fmt.Stringer and sanitizes sensitive fields of
|
||||
// AuthProviderConfig to prevent accidental leaking via logs.
|
||||
func (c AuthProviderConfig) String() string {
|
||||
cfg := "<nil>"
|
||||
if c.Config != nil {
|
||||
cfg = "--- REDACTED ---"
|
||||
}
|
||||
return fmt.Sprintf("api.AuthProviderConfig{Name: %q, Config: map[string]string{%s}}", c.Name, cfg)
|
||||
}
|
||||
|
||||
// ExecConfig specifies a command to provide client credentials. The command is exec'd
|
||||
// and outputs structured stdout holding credentials.
|
||||
//
|
||||
@@ -172,6 +193,29 @@ type ExecConfig struct {
|
||||
APIVersion string `json:"apiVersion,omitempty"`
|
||||
}
|
||||
|
||||
var _ fmt.Stringer = new(ExecConfig)
|
||||
var _ fmt.GoStringer = new(ExecConfig)
|
||||
|
||||
// GoString implements fmt.GoStringer and sanitizes sensitive fields of
|
||||
// ExecConfig to prevent accidental leaking via logs.
|
||||
func (c ExecConfig) GoString() string {
|
||||
return c.String()
|
||||
}
|
||||
|
||||
// String implements fmt.Stringer and sanitizes sensitive fields of ExecConfig
|
||||
// to prevent accidental leaking via logs.
|
||||
func (c ExecConfig) String() string {
|
||||
var args []string
|
||||
if len(c.Args) > 0 {
|
||||
args = []string{"--- REDACTED ---"}
|
||||
}
|
||||
env := "[]ExecEnvVar(nil)"
|
||||
if len(c.Env) > 0 {
|
||||
env = "[]ExecEnvVar{--- REDACTED ---}"
|
||||
}
|
||||
return fmt.Sprintf("api.AuthProviderConfig{Command: %q, Args: %#v, Env: %s, APIVersion: %q}", c.Command, args, env, c.APIVersion)
|
||||
}
|
||||
|
||||
// ExecEnvVar is used for setting environment variables when executing an exec-based
|
||||
// credential plugin.
|
||||
type ExecEnvVar struct {
|
||||
|
7
vendor/k8s.io/client-go/tools/clientcmd/client_config.go
generated
vendored
7
vendor/k8s.io/client-go/tools/clientcmd/client_config.go
generated
vendored
@@ -229,11 +229,12 @@ func (config *DirectClientConfig) getUserIdentificationPartialConfig(configAuthI
|
||||
if len(configAuthInfo.Token) > 0 {
|
||||
mergedConfig.BearerToken = configAuthInfo.Token
|
||||
} else if len(configAuthInfo.TokenFile) > 0 {
|
||||
ts := restclient.NewCachedFileTokenSource(configAuthInfo.TokenFile)
|
||||
if _, err := ts.Token(); err != nil {
|
||||
tokenBytes, err := ioutil.ReadFile(configAuthInfo.TokenFile)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
mergedConfig.WrapTransport = restclient.TokenSourceWrapTransport(ts)
|
||||
mergedConfig.BearerToken = string(tokenBytes)
|
||||
mergedConfig.BearerTokenFile = configAuthInfo.TokenFile
|
||||
}
|
||||
if len(configAuthInfo.Impersonate) > 0 {
|
||||
mergedConfig.Impersonate = restclient.ImpersonationConfig{
|
||||
|
7
vendor/k8s.io/client-go/tools/clientcmd/merged_client_builder.go
generated
vendored
7
vendor/k8s.io/client-go/tools/clientcmd/merged_client_builder.go
generated
vendored
@@ -150,7 +150,12 @@ func (config *DeferredLoadingClientConfig) Namespace() (string, bool, error) {
|
||||
|
||||
// if we got a default namespace, determine whether it was explicit or implicit
|
||||
if raw, err := mergedKubeConfig.RawConfig(); err == nil {
|
||||
if context := raw.Contexts[raw.CurrentContext]; context != nil && len(context.Namespace) > 0 {
|
||||
// determine the current context
|
||||
currentContext := raw.CurrentContext
|
||||
if config.overrides != nil && len(config.overrides.CurrentContext) > 0 {
|
||||
currentContext = config.overrides.CurrentContext
|
||||
}
|
||||
if context := raw.Contexts[currentContext]; context != nil && len(context.Namespace) > 0 {
|
||||
return ns, false, nil
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user