Unverified Commit d7db405b authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #65099 from sttts/sttts-apiserver-auth-error-context

Automatic merge from submit-queue (batch tested with PRs 65116, 61718, 65140, 65128, 65099). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. apiserver: add context to authn/authz kubeconfig errors Before this the user only saw messages about in-cluster config, but didn't know which.
parents 570760db 99eda24d
...@@ -266,7 +266,7 @@ func (s *DelegatingAuthenticationOptions) getRequestHeader() (*RequestHeaderAuth ...@@ -266,7 +266,7 @@ func (s *DelegatingAuthenticationOptions) getRequestHeader() (*RequestHeaderAuth
func (s *DelegatingAuthenticationOptions) lookupInClusterClientCA() (*ClientCertAuthenticationOptions, error) { func (s *DelegatingAuthenticationOptions) lookupInClusterClientCA() (*ClientCertAuthenticationOptions, error) {
clientConfig, err := s.getClientConfig() clientConfig, err := s.getClientConfig()
if err != nil { if err != nil {
return nil, err return nil, fmt.Errorf("failed to get delegated authentication kubeconfig: %v", err)
} }
client, err := coreclient.NewForConfig(clientConfig) client, err := coreclient.NewForConfig(clientConfig)
if err != nil { if err != nil {
......
...@@ -17,6 +17,7 @@ limitations under the License. ...@@ -17,6 +17,7 @@ limitations under the License.
package options package options
import ( import (
"fmt"
"time" "time"
"github.com/spf13/pflag" "github.com/spf13/pflag"
...@@ -125,7 +126,7 @@ func (s *DelegatingAuthorizationOptions) newSubjectAccessReview() (authorization ...@@ -125,7 +126,7 @@ func (s *DelegatingAuthorizationOptions) newSubjectAccessReview() (authorization
clientConfig, err = rest.InClusterConfig() clientConfig, err = rest.InClusterConfig()
} }
if err != nil { if err != nil {
return nil, err return nil, fmt.Errorf("failed to get delegated authorization kubeconfig: %v", err)
} }
// set high qps/burst limits since this will effectively limit API server responsiveness // set high qps/burst limits since this will effectively limit API server responsiveness
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment