Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove test/images/* from hack/.golint_failures #70781

Merged
merged 1 commit into from
Nov 29, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 0 additions & 8 deletions hack/.golint_failures
Original file line number Diff line number Diff line change
Expand Up @@ -746,14 +746,6 @@ test/e2e_node/environment
test/e2e_node/remote
test/e2e_node/runner/remote
test/e2e_node/services
test/images/net/nat
test/images/netexec
test/images/nettest
test/images/no-snat-test
test/images/no-snat-test-proxy
test/images/resource-consumer
test/images/resource-consumer/common
test/images/resource-consumer/controller
test/integration
test/integration/auth
test/integration/evictions
Expand Down
4 changes: 2 additions & 2 deletions test/images/net/nat/closewait.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import (
// connection assigned here.
var leakedConnection *net.TCPConn

// Server JSON options.
// CloseWaitServerOptions holds server JSON options.
type CloseWaitServerOptions struct {
// Address to bind for the test
LocalAddr string
Expand Down Expand Up @@ -110,7 +110,7 @@ func (server *closeWaitServer) Run(logger *log.Logger, rawOptions interface{}) e
return nil
}

// Client JSON options
// CloseWaitClientOptions holds client JSON options.
type CloseWaitClientOptions struct {
// RemoteAddr of the server to connect to.
RemoteAddr string
Expand Down
4 changes: 2 additions & 2 deletions test/images/netexec/netexec.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func main() {

func startHTTPServer(httpPort int) {
http.HandleFunc("/", rootHandler)
http.HandleFunc("/clientip", clientIpHandler)
http.HandleFunc("/clientip", clientIPHandler)
http.HandleFunc("/echo", echoHandler)
http.HandleFunc("/exit", exitHandler)
http.HandleFunc("/hostname", hostnameHandler)
Expand All @@ -104,7 +104,7 @@ func echoHandler(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "%s", r.FormValue("msg"))
}

func clientIpHandler(w http.ResponseWriter, r *http.Request) {
func clientIPHandler(w http.ResponseWriter, r *http.Request) {
log.Printf("GET /clientip")
fmt.Fprintf(w, r.RemoteAddr)
}
Expand Down
4 changes: 2 additions & 2 deletions test/images/nettest/nettest.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ func (s *State) serveWrite(w http.ResponseWriter, r *http.Request) {
if s.Received == nil {
s.Received = map[string]int{}
}
s.Received[wp.Source] += 1
s.Received[wp.Source]++
}
s.appendErr(json.NewEncoder(w).Encode(&WriteResp{Hostname: s.Hostname}))
}
Expand Down Expand Up @@ -164,7 +164,7 @@ func (s *State) appendSuccessfulSend(toHostname string) {
if s.Sent == nil {
s.Sent = map[string]int{}
}
s.Sent[toHostname] += 1
s.Sent[toHostname]++
}

var (
Expand Down
12 changes: 6 additions & 6 deletions test/images/no-snat-test-proxy/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,22 @@ import (

// This Pod's /checknosnat takes `target` and `ips` arguments, and queries {target}/checknosnat?ips={ips}

type MasqTestProxy struct {
type masqTestProxy struct {
Port string
}

func NewMasqTestProxy() *MasqTestProxy {
return &MasqTestProxy{
func newMasqTestProxy() *masqTestProxy {
return &masqTestProxy{
Port: "31235",
}
}

func (m *MasqTestProxy) AddFlags(fs *pflag.FlagSet) {
func (m *masqTestProxy) AddFlags(fs *pflag.FlagSet) {
fs.StringVar(&m.Port, "port", m.Port, "The port to serve /checknosnat endpoint on.")
}

func main() {
m := NewMasqTestProxy()
m := newMasqTestProxy()
m.AddFlags(pflag.CommandLine)

flag.InitFlags()
Expand All @@ -58,7 +58,7 @@ func main() {
}
}

func (m *MasqTestProxy) Run() error {
func (m *masqTestProxy) Run() error {
// register handler
http.HandleFunc("/checknosnat", checknosnat)

Expand Down
15 changes: 7 additions & 8 deletions test/images/no-snat-test/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,22 @@ import (
// pip = this pod's ip
// nip = this node's ip

type MasqTester struct {
type masqTester struct {
Port string
}

func NewMasqTester() *MasqTester {
return &MasqTester{
func newMasqTester() *masqTester {
return &masqTester{
Port: "8080",
}
}

func (m *MasqTester) AddFlags(fs *pflag.FlagSet) {
func (m *masqTester) AddFlags(fs *pflag.FlagSet) {
fs.StringVar(&m.Port, "port", m.Port, "The port to serve /checknosnat and /whoami endpoints on.")
}

func main() {
m := NewMasqTester()
m := newMasqTester()
m.AddFlags(pflag.CommandLine)

flag.InitFlags()
Expand All @@ -62,7 +62,7 @@ func main() {
}
}

func (m *MasqTester) Run() error {
func (m *masqTester) Run() error {
// pip is the current pod's IP and nip is the current node's IP
// pull the pip and nip out of the env
pip, ok := os.LookupEnv("POD_IP")
Expand Down Expand Up @@ -145,9 +145,8 @@ func check(ip string, pip string, nip string) error {
if rip != pip {
if rip == nip {
return fmt.Errorf("Returned ip %q != my Pod ip %q, == my Node ip %q - SNAT", rip, pip, nip)
} else {
return fmt.Errorf("Returned ip %q != my Pod ip %q or my Node ip %q - SNAT to unexpected ip (possible SNAT through unexpected interface on the way into another node)", rip, pip, nip)
}
return fmt.Errorf("Returned ip %q != my Pod ip %q or my Node ip %q - SNAT to unexpected ip (possible SNAT through unexpected interface on the way into another node)", rip, pip, nip)
}
return nil
}
1 change: 1 addition & 0 deletions test/images/resource-consumer/common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ limitations under the License.

package common

// Constants related to Prometheus metrics.
const (
ConsumeCPUAddress = "/ConsumeCPU"
ConsumeMemAddress = "/ConsumeMem"
Expand Down