Skip to content

Commit

Permalink
linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Priya Wadhwa committed Aug 14, 2019
1 parent 3bedf5c commit 45a4416
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions pkg/skaffold/kubernetes/portforward/entry_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ func TestNewEntryManager(t *testing.T) {
}

func TestStop(t *testing.T) {
pfe1 := NewPortForwardEntry(0, latest.PortForwardResource{
pfe1 := newPortForwardEntry(0, latest.PortForwardResource{
Type: constants.Pod,
Name: "resource",
Namespace: "default",
}, "", "", "", 9000, false)

pfe2 := NewPortForwardEntry(0, latest.PortForwardResource{
pfe2 := newPortForwardEntry(0, latest.PortForwardResource{
Type: constants.Pod,
Name: "resource2",
Namespace: "default",
Expand Down
2 changes: 1 addition & 1 deletion pkg/skaffold/kubernetes/portforward/pod_forwarder.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ func (p *WatchingPodForwarder) podForwardingEntry(resourceVersion, containerName
if err != nil {
return nil, errors.Wrap(err, "converting resource version to integer")
}
entry := NewPortForwardEntry(rv, resource, resource.Name, containerName, portName, 0, true)
entry := newPortForwardEntry(rv, resource, resource.Name, containerName, portName, 0, true)

// If we have, return the current entry
oldEntry, ok := p.forwardedResources.Load(entry.key())
Expand Down
4 changes: 2 additions & 2 deletions pkg/skaffold/kubernetes/portforward/port_forward_entry.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ type portForwardEntry struct {
cancel context.CancelFunc
}

// NewPortForwardEntry returns a port forward entry.
func NewPortForwardEntry(resourceVersion int, resource latest.PortForwardResource, podName, containerName, portName string, localPort int, automaticPodForwarding bool) *portForwardEntry {
// newPortForwardEntry returns a port forward entry.
func newPortForwardEntry(resourceVersion int, resource latest.PortForwardResource, podName, containerName, portName string, localPort int, automaticPodForwarding bool) *portForwardEntry {
return &portForwardEntry{
resourceVersion: resourceVersion,
resource: resource,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func TestPortForwardEntryKey(t *testing.T) {
}{
{
description: "entry for pod",
pfe: NewPortForwardEntry(0, latest.PortForwardResource{
pfe: newPortForwardEntry(0, latest.PortForwardResource{
Type: "pod",
Name: "podName",
Namespace: "default",
Expand All @@ -41,7 +41,7 @@ func TestPortForwardEntryKey(t *testing.T) {
expected: "pod-podName-default-8080",
}, {
description: "entry for deploy",
pfe: NewPortForwardEntry(0, latest.PortForwardResource{
pfe: newPortForwardEntry(0, latest.PortForwardResource{
Type: "deployment",
Name: "depName",
Namespace: "namespace",
Expand Down Expand Up @@ -74,7 +74,7 @@ func TestAutomaticPodForwardingKey(t *testing.T) {
}{
{
description: "entry for automatically port forwarded pod",
pfe: NewPortForwardEntry(0, latest.PortForwardResource{
pfe: newPortForwardEntry(0, latest.PortForwardResource{
Type: "pod",
Name: "podName",
Namespace: "default",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func WhiteBoxPortForwardCycle(t *testing.T, kubectlCLI *kubectl.CLI, namespace s
portForwardEvent = func(entry *portForwardEntry) {}
ctx := context.Background()
localPort := retrieveAvailablePort(9000, em.forwardedPorts)
pfe := NewPortForwardEntry(0, latest.PortForwardResource{
pfe := newPortForwardEntry(0, latest.PortForwardResource{
Type: "deployment",
Name: "leeroy-web",
Namespace: namespace,
Expand Down
2 changes: 1 addition & 1 deletion pkg/skaffold/kubernetes/portforward/resource_forwarder.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func (p *ResourceForwarder) portForwardResource(ctx context.Context, resource la

func (p *ResourceForwarder) getCurrentEntry(resource latest.PortForwardResource) *portForwardEntry {
// determine if we have seen this before
entry := NewPortForwardEntry(0, resource, "", "", "", 0, false)
entry := newPortForwardEntry(0, resource, "", "", "", 0, false)

// If we have, return the current entry
oldEntry, ok := p.forwardedResources.Load(entry.key())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ func TestGetCurrentEntryFunc(t *testing.T) {
Port: 8080,
},
availablePorts: []int{8080},
expected: NewPortForwardEntry(0, latest.PortForwardResource{}, "", "", "", 8080, false),
expected: newPortForwardEntry(0, latest.PortForwardResource{}, "", "", "", 8080, false),
}, {
description: "port forward existing deployment",
resource: latest.PortForwardResource{
Expand All @@ -174,7 +174,7 @@ func TestGetCurrentEntryFunc(t *testing.T) {
localPort: 9000,
},
},
expected: NewPortForwardEntry(0, latest.PortForwardResource{}, "", "", "", 9000, false),
expected: newPortForwardEntry(0, latest.PortForwardResource{}, "", "", "", 9000, false),
},
}

Expand Down

0 comments on commit 45a4416

Please sign in to comment.