mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 03:41:45 +00:00
Merge pull request #87485 from gavinfish/kubectl_pkg_config
Staticcheck: vendor/k8s.io/kubectl/pkg/cmd/exec|config|certificates
This commit is contained in:
commit
665c6648eb
@ -92,10 +92,7 @@ vendor/k8s.io/client-go/restmapper
|
||||
vendor/k8s.io/client-go/tools/leaderelection
|
||||
vendor/k8s.io/client-go/transport
|
||||
vendor/k8s.io/component-base/metrics
|
||||
vendor/k8s.io/kubectl/pkg/cmd/certificates
|
||||
vendor/k8s.io/kubectl/pkg/cmd/config
|
||||
vendor/k8s.io/kubectl/pkg/cmd/edit
|
||||
vendor/k8s.io/kubectl/pkg/cmd/exec
|
||||
vendor/k8s.io/kubectl/pkg/cmd/get
|
||||
vendor/k8s.io/kubectl/pkg/cmd/scale
|
||||
vendor/k8s.io/kubectl/pkg/cmd/set
|
||||
|
@ -234,7 +234,7 @@ func (o *CertificateOptions) modifyCertificateCondition(builder *resource.Builde
|
||||
csr := info.Object.(*certificatesv1beta1.CertificateSigningRequest)
|
||||
csr, hasCondition := modify(csr)
|
||||
if !hasCondition || force {
|
||||
csr, err = clientSet.CertificateSigningRequests().UpdateApproval(csr)
|
||||
_, err = clientSet.CertificateSigningRequests().UpdateApproval(csr)
|
||||
if errors.IsConflict(err) && i < 10 {
|
||||
if err := info.Get(); err != nil {
|
||||
return err
|
||||
|
@ -37,7 +37,6 @@ import (
|
||||
type createAuthInfoOptions struct {
|
||||
configAccess clientcmd.ConfigAccess
|
||||
name string
|
||||
authPath cliflag.StringFlag
|
||||
clientCertificate cliflag.StringFlag
|
||||
clientKey cliflag.StringFlag
|
||||
token cliflag.StringFlag
|
||||
|
@ -92,13 +92,6 @@ func (s *navigationSteps) pop() navigationStep {
|
||||
return navigationStep{}
|
||||
}
|
||||
|
||||
func (s *navigationSteps) peek() navigationStep {
|
||||
if s.moreStepsRemaining() {
|
||||
return s.steps[s.currentStepIndex]
|
||||
}
|
||||
return navigationStep{}
|
||||
}
|
||||
|
||||
func (s *navigationSteps) moreStepsRemaining() bool {
|
||||
return len(s.steps) > s.currentStepIndex
|
||||
}
|
||||
|
@ -125,6 +125,9 @@ func (test unsetConfigTest) run(t *testing.T) {
|
||||
if err == nil {
|
||||
err = opts.run(buf)
|
||||
}
|
||||
if test.expectedErr == "" && err != nil {
|
||||
t.Fatalf("unexpected error: %v", err)
|
||||
}
|
||||
config, err := clientcmd.LoadFromFile(fakeKubeFile.Name())
|
||||
if err != nil {
|
||||
t.Fatalf("unexpected error loading kubeconfig file: %v", err)
|
||||
|
@ -65,8 +65,6 @@ var (
|
||||
|
||||
# Get the password for the e2e user
|
||||
kubectl config view -o jsonpath='{.users[?(@.name == "e2e")].user.password}'`)
|
||||
|
||||
defaultOutputFormat = "yaml"
|
||||
)
|
||||
|
||||
// NewCmdConfigView returns a Command instance for 'config view' sub command
|
||||
|
@ -148,6 +148,9 @@ func TestPodAndContainer(t *testing.T) {
|
||||
options.ErrOut = bytes.NewBuffer([]byte{})
|
||||
options.Out = bytes.NewBuffer([]byte{})
|
||||
err = options.Complete(tf, cmd, test.args, test.argsLenAtDash)
|
||||
if !test.expectError && err != nil {
|
||||
t.Errorf("%s: unexpected error: %v", test.name, err)
|
||||
}
|
||||
err = options.Validate()
|
||||
|
||||
if test.expectError && err == nil {
|
||||
@ -160,7 +163,7 @@ func TestPodAndContainer(t *testing.T) {
|
||||
return
|
||||
}
|
||||
|
||||
pod, err := options.ExecutablePodFn(tf, test.obj, defaultPodExecTimeout)
|
||||
pod, _ := options.ExecutablePodFn(tf, test.obj, defaultPodExecTimeout)
|
||||
if pod.Name != test.expectedPod {
|
||||
t.Errorf("%s: expected: %s, got: %s", test.name, test.expectedPod, options.PodName)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user