Fixed Golint errors in pkg/registry/core/pod

This commit is contained in:
Alexander Zimmermann
2020-02-06 11:40:37 +01:00
parent 641321c94c
commit 026ba54961
6 changed files with 32 additions and 31 deletions

View File

@@ -27,11 +27,13 @@ import (
"k8s.io/apiserver/pkg/registry/rest"
utilfeature "k8s.io/apiserver/pkg/util/feature"
api "k8s.io/kubernetes/pkg/apis/core"
_ "k8s.io/kubernetes/pkg/apis/core/install"
"k8s.io/kubernetes/pkg/apis/core/validation"
"k8s.io/kubernetes/pkg/features"
"k8s.io/kubernetes/pkg/kubelet/client"
"k8s.io/kubernetes/pkg/registry/core/pod"
// ensure types are installed
_ "k8s.io/kubernetes/pkg/apis/core/install"
)
// LogREST implements the log endpoint for a Pod
@@ -49,7 +51,7 @@ func (r *LogREST) New() runtime.Object {
return &api.Pod{}
}
// LogREST implements StorageMetadata
// ProducesMIMETypes is LogREST's implementation of the StorageMetadata interface
func (r *LogREST) ProducesMIMETypes(verb string) []string {
// Since the default list does not include "plain/text", we need to
// explicitly override ProducesMIMETypes, so that it gets added to
@@ -59,7 +61,7 @@ func (r *LogREST) ProducesMIMETypes(verb string) []string {
}
}
// LogREST implements StorageMetadata, return string as the generating object
// ProducesObject is LogREST's implementation of the StorageMetadata interface
func (r *LogREST) ProducesObject(verb string) interface{} {
return ""
}
@@ -77,7 +79,7 @@ func (r *LogREST) Get(ctx context.Context, name string, opts runtime.Object) (ru
if errs := validation.ValidatePodLogOptions(logOpts); len(errs) > 0 {
return nil, errors.NewInvalid(api.Kind("PodLogOptions"), name, errs)
}
location, transport, err := pod.LogLocation(r.Store, r.KubeletConn, ctx, name, logOpts)
location, transport, err := pod.LogLocation(ctx, r.Store, r.KubeletConn, name, logOpts)
if err != nil {
return nil, err
}