Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
ca74d32e
Commit
ca74d32e
authored
Oct 26, 2018
by
qingsenLi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix golint for /pkg/util/ipconfig and /pkg/util/resourcecontainer-2
parent
0df5462d
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
9 additions
and
10 deletions
+9
-10
.golint_failures
hack/.golint_failures
+0
-2
proxysocket.go
pkg/proxy/winuserspace/proxysocket.go
+1
-1
ipconfig.go
pkg/util/ipconfig/ipconfig.go
+4
-4
ipconfig_test.go
pkg/util/ipconfig/ipconfig_test.go
+2
-2
resource_container_linux.go
pkg/util/resourcecontainer/resource_container_linux.go
+1
-1
resource_container_unsupported.go
pkg/util/resourcecontainer/resource_container_unsupported.go
+1
-0
No files found.
hack/.golint_failures
View file @
ca74d32e
...
@@ -380,7 +380,6 @@ pkg/util/env
...
@@ -380,7 +380,6 @@ pkg/util/env
pkg/util/file
pkg/util/file
pkg/util/goroutinemap/exponentialbackoff
pkg/util/goroutinemap/exponentialbackoff
pkg/util/initsystem
pkg/util/initsystem
pkg/util/ipconfig
pkg/util/iptables
pkg/util/iptables
pkg/util/iptables/testing
pkg/util/iptables/testing
pkg/util/labels
pkg/util/labels
...
@@ -391,7 +390,6 @@ pkg/util/oom
...
@@ -391,7 +390,6 @@ pkg/util/oom
pkg/util/parsers
pkg/util/parsers
pkg/util/procfs
pkg/util/procfs
pkg/util/removeall
pkg/util/removeall
pkg/util/resourcecontainer
pkg/util/rlimit
pkg/util/rlimit
pkg/util/selinux
pkg/util/selinux
pkg/util/sysctl
pkg/util/sysctl
...
...
pkg/proxy/winuserspace/proxysocket.go
View file @
ca74d32e
...
@@ -505,7 +505,7 @@ func (udp *udpProxySocket) ProxyLoop(service ServicePortPortalName, myInfo *serv
...
@@ -505,7 +505,7 @@ func (udp *udpProxySocket) ProxyLoop(service ServicePortPortalName, myInfo *serv
dnsSearch
=
[]
string
{
""
,
namespaceServiceDomain
,
serviceDomain
,
clusterDomain
}
dnsSearch
=
[]
string
{
""
,
namespaceServiceDomain
,
serviceDomain
,
clusterDomain
}
execer
:=
exec
.
New
()
execer
:=
exec
.
New
()
ipconfigInterface
:=
ipconfig
.
New
(
execer
)
ipconfigInterface
:=
ipconfig
.
New
(
execer
)
suffixList
,
err
:=
ipconfigInterface
.
GetD
ns
SuffixSearchList
()
suffixList
,
err
:=
ipconfigInterface
.
GetD
NS
SuffixSearchList
()
if
err
==
nil
{
if
err
==
nil
{
for
_
,
suffix
:=
range
suffixList
{
for
_
,
suffix
:=
range
suffixList
{
dnsSearch
=
append
(
dnsSearch
,
suffix
)
dnsSearch
=
append
(
dnsSearch
,
suffix
)
...
...
pkg/util/ipconfig/ipconfig.go
View file @
ca74d32e
...
@@ -28,8 +28,8 @@ import (
...
@@ -28,8 +28,8 @@ import (
// Interface is an injectable interface for running ipconfig commands. Implementations must be goroutine-safe.
// Interface is an injectable interface for running ipconfig commands. Implementations must be goroutine-safe.
type
Interface
interface
{
type
Interface
interface
{
// GetD
ns
SuffixSearchList returns the list of DNS suffix to search
// GetD
NS
SuffixSearchList returns the list of DNS suffix to search
GetD
ns
SuffixSearchList
()
([]
string
,
error
)
GetD
NS
SuffixSearchList
()
([]
string
,
error
)
}
}
const
(
const
(
...
@@ -54,8 +54,8 @@ func New(exec utilexec.Interface) Interface {
...
@@ -54,8 +54,8 @@ func New(exec utilexec.Interface) Interface {
return
runner
return
runner
}
}
// GetD
ns
SuffixSearchList returns the list of DNS suffix to search
// GetD
NS
SuffixSearchList returns the list of DNS suffix to search
func
(
runner
*
runner
)
GetD
ns
SuffixSearchList
()
([]
string
,
error
)
{
func
(
runner
*
runner
)
GetD
NS
SuffixSearchList
()
([]
string
,
error
)
{
// Parse the DNS suffix search list from ipconfig output
// Parse the DNS suffix search list from ipconfig output
// ipconfig /all on Windows displays the entry of DNS suffix search list
// ipconfig /all on Windows displays the entry of DNS suffix search list
// An example output contains:
// An example output contains:
...
...
pkg/util/ipconfig/ipconfig_test.go
View file @
ca74d32e
...
@@ -22,11 +22,11 @@ import (
...
@@ -22,11 +22,11 @@ import (
"k8s.io/utils/exec"
"k8s.io/utils/exec"
)
)
func
TestGetD
ns
SuffixSearchList
(
t
*
testing
.
T
)
{
func
TestGetD
NS
SuffixSearchList
(
t
*
testing
.
T
)
{
// Simple test
// Simple test
ipconfigInterface
:=
New
(
exec
.
New
())
ipconfigInterface
:=
New
(
exec
.
New
())
_
,
err
:=
ipconfigInterface
.
GetD
ns
SuffixSearchList
()
_
,
err
:=
ipconfigInterface
.
GetD
NS
SuffixSearchList
()
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Errorf
(
"expected success, got %v"
,
err
)
t
.
Errorf
(
"expected success, got %v"
,
err
)
}
}
...
...
pkg/util/resourcecontainer/resource_container_linux.go
View file @
ca74d32e
...
@@ -25,7 +25,7 @@ import (
...
@@ -25,7 +25,7 @@ import (
"github.com/opencontainers/runc/libcontainer/configs"
"github.com/opencontainers/runc/libcontainer/configs"
)
)
//
C
reates resource-only containerName if it does not already exist and moves
//
RunInResourceContainer c
reates resource-only containerName if it does not already exist and moves
// the current process to it.
// the current process to it.
//
//
// containerName must be an absolute container name.
// containerName must be an absolute container name.
...
...
pkg/util/resourcecontainer/resource_container_unsupported.go
View file @
ca74d32e
...
@@ -22,6 +22,7 @@ import (
...
@@ -22,6 +22,7 @@ import (
"errors"
"errors"
)
)
// RunInResourceContainer creates resource-only containerName unsupported.
func
RunInResourceContainer
(
containerName
string
)
error
{
func
RunInResourceContainer
(
containerName
string
)
error
{
return
errors
.
New
(
"resource-only containers unsupported in this platform"
)
return
errors
.
New
(
"resource-only containers unsupported in this platform"
)
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment