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

Fix golint failure in e2e/common/util.go #78378

Merged
merged 1 commit into from
Jun 20, 2019
Merged
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
9 changes: 8 additions & 1 deletion test/e2e/common/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,17 @@ import (
"github.com/onsi/ginkgo"
)

// Suite represents test suite.
type Suite string

const (
E2E Suite = "e2e"
// E2E represents a test suite for e2e.
E2E Suite = "e2e"
// NodeE2E represents a test suite for node e2e.
NodeE2E Suite = "node e2e"
)

// CurrentSuite represents current test suite.
var CurrentSuite Suite

// CommonImageWhiteList is the list of images used in common test. These images should be prepulled
Expand Down Expand Up @@ -96,6 +100,7 @@ func init() {
}
}

// SubstituteImageName replaces image name in content.
func SubstituteImageName(content string) string {
contentWithImageName := new(bytes.Buffer)
tmpl, err := template.New("imagemanifest").Parse(content)
Expand Down Expand Up @@ -127,6 +132,7 @@ func svcByName(name string, port int) *v1.Service {
}
}

// NewSVCByName creates a service by name.
func NewSVCByName(c clientset.Interface, ns, name string) error {
const testPort = 9376
_, err := c.CoreV1().Services(ns).Create(svcByName(name, testPort))
Expand All @@ -140,6 +146,7 @@ func NewRCByName(c clientset.Interface, ns, name string, replicas int32, gracePe
name, replicas, framework.ServeHostnameImage, 9376, v1.ProtocolTCP, map[string]string{}, gracePeriod))
}

// RestartNodes restarts specific nodes.
func RestartNodes(c clientset.Interface, nodes []v1.Node) error {
// Build mapping from zone to nodes in that zone.
nodeNamesByZone := make(map[string][]string)
Expand Down