mirror of https://github.com/k3s-io/k3s
Merge pull request #70230 from qingsenLi/git181025
fix golint for /pkg/util/ipconfig and /pkg/util/resourcecontainerpull/58/head
commit
0be22d8ace
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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")
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue