github.com/openshift/installer@v1.4.17/pkg/asset/cluster/vsphere/vsphere.go (about) 1 package vsphere 2 3 import ( 4 "github.com/openshift/installer/pkg/types" 5 typesvsphere "github.com/openshift/installer/pkg/types/vsphere" 6 ) 7 8 // Metadata converts an install configuration to vSphere metadata. 9 func Metadata(config *types.InstallConfig) *typesvsphere.Metadata { 10 terraformPlatform := "vsphere" 11 12 metadata := &typesvsphere.Metadata{ 13 TerraformPlatform: terraformPlatform, 14 } 15 16 vcenterList := []typesvsphere.VCenters{} 17 for _, vcenter := range config.VSphere.VCenters { 18 vcenterDef := typesvsphere.VCenters{ 19 VCenter: vcenter.Server, 20 Username: vcenter.Username, 21 Password: vcenter.Password, 22 } 23 vcenterList = append(vcenterList, vcenterDef) 24 } 25 metadata.VCenters = vcenterList 26 27 return metadata 28 }