Merge pull request #70230 from qingsenLi/git181025

fix golint for /pkg/util/ipconfig and /pkg/util/resourcecontainer
pull/58/head
k8s-ci-robot 2018-10-31 11:50:23 -07:00 committed by GitHub
commit 0be22d8ace
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 9 additions and 10 deletions

View File

@ -380,7 +380,6 @@ pkg/util/env
pkg/util/file
pkg/util/goroutinemap/exponentialbackoff
pkg/util/initsystem
pkg/util/ipconfig
pkg/util/iptables
pkg/util/iptables/testing
pkg/util/labels
@ -391,7 +390,6 @@ pkg/util/oom
pkg/util/parsers
pkg/util/procfs
pkg/util/removeall
pkg/util/resourcecontainer
pkg/util/rlimit
pkg/util/selinux
pkg/util/sysctl

View File

@ -505,7 +505,7 @@ func (udp *udpProxySocket) ProxyLoop(service ServicePortPortalName, myInfo *serv
dnsSearch = []string{"", namespaceServiceDomain, serviceDomain, clusterDomain}
execer := exec.New()
ipconfigInterface := ipconfig.New(execer)
suffixList, err := ipconfigInterface.GetDnsSuffixSearchList()
suffixList, err := ipconfigInterface.GetDNSSuffixSearchList()
if err == nil {
for _, suffix := range suffixList {
dnsSearch = append(dnsSearch, suffix)

View File

@ -28,8 +28,8 @@ import (
// Interface is an injectable interface for running ipconfig commands. Implementations must be goroutine-safe.
type Interface interface {
// GetDnsSuffixSearchList returns the list of DNS suffix to search
GetDnsSuffixSearchList() ([]string, error)
// GetDNSSuffixSearchList returns the list of DNS suffix to search
GetDNSSuffixSearchList() ([]string, error)
}
const (
@ -54,8 +54,8 @@ func New(exec utilexec.Interface) Interface {
return runner
}
// GetDnsSuffixSearchList returns the list of DNS suffix to search
func (runner *runner) GetDnsSuffixSearchList() ([]string, error) {
// GetDNSSuffixSearchList returns the list of DNS suffix to search
func (runner *runner) GetDNSSuffixSearchList() ([]string, error) {
// Parse the DNS suffix search list from ipconfig output
// ipconfig /all on Windows displays the entry of DNS suffix search list
// An example output contains:

View File

@ -22,11 +22,11 @@ import (
"k8s.io/utils/exec"
)
func TestGetDnsSuffixSearchList(t *testing.T) {
func TestGetDNSSuffixSearchList(t *testing.T) {
// Simple test
ipconfigInterface := New(exec.New())
_, err := ipconfigInterface.GetDnsSuffixSearchList()
_, err := ipconfigInterface.GetDNSSuffixSearchList()
if err != nil {
t.Errorf("expected success, got %v", err)
}

View File

@ -25,7 +25,7 @@ import (
"github.com/opencontainers/runc/libcontainer/configs"
)
// Creates resource-only containerName if it does not already exist and moves
// RunInResourceContainer creates resource-only containerName if it does not already exist and moves
// the current process to it.
//
// containerName must be an absolute container name.

View File

@ -22,6 +22,7 @@ import (
"errors"
)
// RunInResourceContainer creates resource-only containerName unsupported.
func RunInResourceContainer(containerName string) error {
return errors.New("resource-only containers unsupported in this platform")
}