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 regression from port forwarding #1616

Merged
merged 1 commit into from
Feb 6, 2019
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/skaffold/kubernetes/port_forward.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ func portAvailable(p int32, forwardedPorts map[int32]string) (bool, error) {

// Key is an identifier for the lock on a port during the skaffold dev cycle.
func (p *portForwardEntry) key() string {
return fmt.Sprintf("%s-%s-%d", p.podName, p.containerName, p.port)
return fmt.Sprintf("%s-%d", p.containerName, p.port)
}

// String is a utility function that returns the port forward entry as a user-readable string
Expand Down
16 changes: 8 additions & 8 deletions pkg/skaffold/kubernetes/port_forward_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func TestPortForwardPod(t *testing.T) {
},
availablePorts: []int32{8080},
expectedEntries: map[string]*portForwardEntry{
"podname-containername-8080": {
"containername-8080": {
resourceVersion: 1,
podName: "podname",
containerName: "containername",
Expand Down Expand Up @@ -136,7 +136,7 @@ func TestPortForwardPod(t *testing.T) {
9000: true,
},
expectedEntries: map[string]*portForwardEntry{
"podname-containername-8080": {
"containername-8080": {
resourceVersion: 1,
podName: "podname",
containerName: "containername",
Expand Down Expand Up @@ -202,7 +202,7 @@ func TestPortForwardPod(t *testing.T) {
shouldErr: true,
availablePorts: []int32{8080},
expectedEntries: map[string]*portForwardEntry{
"podname-containername-8080": {
"containername-8080": {
resourceVersion: 1,
podName: "podname",
containerName: "containername",
Expand Down Expand Up @@ -239,14 +239,14 @@ func TestPortForwardPod(t *testing.T) {
},
availablePorts: []int32{8080, 50051},
expectedEntries: map[string]*portForwardEntry{
"podname-containername-8080": {
"containername-8080": {
resourceVersion: 1,
podName: "podname",
containerName: "containername",
port: 8080,
localPort: 8080,
},
"podname2-containername2-50051": {
"containername2-50051": {
resourceVersion: 1,
podName: "podname2",
containerName: "containername2",
Expand Down Expand Up @@ -301,14 +301,14 @@ func TestPortForwardPod(t *testing.T) {
},
availablePorts: []int32{8080, 9000},
expectedEntries: map[string]*portForwardEntry{
"podname-containername-8080": {
"containername-8080": {
resourceVersion: 1,
podName: "podname",
containerName: "containername",
port: 8080,
localPort: 8080,
},
"podname2-containername2-8080": {
"containername2-8080": {
resourceVersion: 1,
podName: "podname2",
containerName: "containername2",
Expand Down Expand Up @@ -362,7 +362,7 @@ func TestPortForwardPod(t *testing.T) {
},
availablePorts: []int32{8080},
expectedEntries: map[string]*portForwardEntry{
"podname-containername-8080": {
"containername-8080": {
resourceVersion: 2,
podName: "podname",
containerName: "containername",
Expand Down