mirror of
https://github.com/kubernetes/client-go.git
synced 2025-06-23 13:47:19 +00:00
Merge pull request #111235 from Abirdcfly/220719
fix a possible panic because of taking the address of nil Kubernetes-commit: e234917e0a3e4bb384ef14c198742643a7e170fd
This commit is contained in:
commit
267b6570f5
@ -51,10 +51,10 @@ func (a *PromptingAuthLoader) LoadAuth(path string) (*clientauth.Info, error) {
|
|||||||
// Prompt for user/pass and write a file if none exists.
|
// Prompt for user/pass and write a file if none exists.
|
||||||
if _, err := os.Stat(path); os.IsNotExist(err) {
|
if _, err := os.Stat(path); os.IsNotExist(err) {
|
||||||
authPtr, err := a.Prompt()
|
authPtr, err := a.Prompt()
|
||||||
auth := *authPtr
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
auth := *authPtr
|
||||||
data, err := json.Marshal(auth)
|
data, err := json.Marshal(auth)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return &auth, err
|
return &auth, err
|
||||||
|
Loading…
Reference in New Issue
Block a user