Skip to content

Commit

Permalink
Merge pull request #3727 from openshift-cherrypick-robot/cherry-pick-…
Browse files Browse the repository at this point in the history
…3718-to-release-4.5

[release-4.5] Bug 1844709: allow OpaqueNetwork type in vSphere wizard
  • Loading branch information
openshift-merge-robot committed Jun 9, 2020
2 parents 5a90620 + a5e3330 commit ac35366
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions pkg/asset/installconfig/vsphere/vsphere.go
Expand Up @@ -13,15 +13,14 @@ import (
"github.com/vmware/govmomi/vapi/rest"
"github.com/vmware/govmomi/vim25"
"gopkg.in/AlecAivazis/survey.v1"
"k8s.io/apimachinery/pkg/util/sets"

"github.com/openshift/installer/pkg/types/vsphere"
vspheretypes "github.com/openshift/installer/pkg/types/vsphere"
"github.com/openshift/installer/pkg/validate"
)

const root = "/..."
const distributedVirtualPortGroupType = "DistributedVirtualPortgroup"
const networkType = "Network"

// vCenterClient contains the login info/creds and client for the vCenter.
// They are contained in a single struct to facilitate client creation
Expand Down Expand Up @@ -305,9 +304,15 @@ func getNetwork(ctx context.Context, path string, finder *find.Finder, client *v
return n.Name(), nil
}

validNetworkTypes := sets.NewString(
"DistributedVirtualPortgroup",
"Network",
"OpaqueNetwork",
)

var networkChoices []string
for _, network := range networks {
if network.Reference().Type == distributedVirtualPortGroupType || network.Reference().Type == networkType {
if validNetworkTypes.Has(network.Reference().Type) {
n := network.(networkNamer)
networkChoices = append(networkChoices, n.Name())
}
Expand Down

0 comments on commit ac35366

Please sign in to comment.