Fix golint failures in some pkg/kubelet packages
Fixed: - pkg/kubelet/pod - pkg/kubelet/metrics - pkg/kubelet/configmap - pkg/kubelet/config
This commit is contained in:
@@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Common logic used by both http and file channels.
|
||||
package config
|
||||
|
||||
import (
|
||||
@@ -30,11 +29,11 @@ import (
|
||||
utilyaml "k8s.io/apimachinery/pkg/util/yaml"
|
||||
api "k8s.io/kubernetes/pkg/apis/core"
|
||||
"k8s.io/kubernetes/pkg/apis/core/helper"
|
||||
|
||||
// TODO: remove this import if
|
||||
// api.Registry.GroupOrDie(v1.GroupName).GroupVersion.String() is changed
|
||||
// to "v1"?
|
||||
"k8s.io/kubernetes/pkg/api/legacyscheme"
|
||||
_ "k8s.io/kubernetes/pkg/apis/core/install"
|
||||
k8s_api_v1 "k8s.io/kubernetes/pkg/apis/core/v1"
|
||||
"k8s.io/kubernetes/pkg/apis/core/validation"
|
||||
kubetypes "k8s.io/kubernetes/pkg/kubelet/types"
|
||||
@@ -110,6 +109,7 @@ func getSelfLink(name, namespace string) string {
|
||||
|
||||
type defaultFunc func(pod *api.Pod) error
|
||||
|
||||
// tryDecodeSinglePod takes data and tries to extract valid Pod config information from it.
|
||||
func tryDecodeSinglePod(data []byte, defaultFn defaultFunc) (parsed bool, pod *v1.Pod, err error) {
|
||||
// JSON is valid YAML, so this should work for everything.
|
||||
json, err := utilyaml.ToJSON(data)
|
||||
|
Reference in New Issue
Block a user