Skip to content

Commit

Permalink
Fix odo describe not listing all the ports after first url is created
Browse files Browse the repository at this point in the history
This PR fixes redhat-developer#3201.

Signed-off-by: Denis Golovin dgolovin@redhat.com
  • Loading branch information
dgolovin committed May 20, 2020
1 parent b061f34 commit 3e3c4b2
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions pkg/component/component.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"io"
"os"
"path/filepath"
"strconv"
"strings"

"github.com/openshift/odo/pkg/devfile/adapters/common"
Expand Down Expand Up @@ -898,17 +897,7 @@ func GetComponentFromConfig(localConfig *config.LocalConfigInfo) (Component, err

urls := localConfig.GetURL()
if len(urls) > 0 {
// We will clean up the existing value of ports and re-populate it so that we don't panic in `odo describe` and don't show inconsistent info
// This will also help in the case where there are more URLs created than the number of ports exposed by a component #2776
oldPortsProtocol, err := getPortsProtocolMapping(component.Spec.Ports)
if err != nil {
return Component{}, err
}
component.Spec.Ports = []string{}

for _, url := range urls {
port := strconv.Itoa(url.Port)
component.Spec.Ports = append(component.Spec.Ports, fmt.Sprintf("%s/%s", port, oldPortsProtocol[port]))
component.Spec.URL = append(component.Spec.URL, url.Name)
}
}
Expand Down

0 comments on commit 3e3c4b2

Please sign in to comment.