mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-31 15:25:57 +00:00
reverting deprecatin of vcenter port
This commit is contained in:
parent
3a0d8f8fea
commit
411a1a89d7
@ -332,8 +332,8 @@ func newVSphere(cfg VSphereConfig) (*VSphere, error) {
|
||||
if cfg.Global.RoundTripperCount == 0 {
|
||||
cfg.Global.RoundTripperCount = RoundTripperDefaultCount
|
||||
}
|
||||
if cfg.Global.VCenterPort != "" {
|
||||
glog.Warningf("port is a deprecated field in vsphere.conf and will be removed in future release.")
|
||||
if cfg.Global.VCenterPort == "" {
|
||||
cfg.Global.VCenterPort = "443"
|
||||
}
|
||||
|
||||
var c *govmomi.Client
|
||||
@ -382,7 +382,7 @@ func logout(vs *VSphere) {
|
||||
|
||||
func newClient(ctx context.Context, cfg *VSphereConfig) (*govmomi.Client, error) {
|
||||
// Parse URL from string
|
||||
u, err := url.Parse(fmt.Sprintf("https://%s/sdk", cfg.Global.VCenterIP))
|
||||
u, err := url.Parse(fmt.Sprintf("https://%s:%s/sdk", cfg.Global.VCenterIP, cfg.Global.VCenterPort))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -33,6 +33,7 @@ func configFromEnv() (cfg VSphereConfig, ok bool) {
|
||||
var InsecureFlag bool
|
||||
var err error
|
||||
cfg.Global.VCenterIP = os.Getenv("VSPHERE_VCENTER")
|
||||
cfg.Global.VCenterPort = os.Getenv("VSPHERE_VCENTER_PORT")
|
||||
cfg.Global.User = os.Getenv("VSPHERE_USER")
|
||||
cfg.Global.Password = os.Getenv("VSPHERE_PASSWORD")
|
||||
cfg.Global.Datacenter = os.Getenv("VSPHERE_DATACENTER")
|
||||
|
@ -61,6 +61,7 @@ func GetVSphere() (*VSphere, error) {
|
||||
func getVSphereConfig() *VSphereConfig {
|
||||
var cfg VSphereConfig
|
||||
cfg.Global.VCenterIP = os.Getenv("VSPHERE_VCENTER")
|
||||
cfg.Global.VCenterPort = os.Getenv("VSPHERE_VCENTER_PORT")
|
||||
cfg.Global.User = os.Getenv("VSPHERE_USER")
|
||||
cfg.Global.Password = os.Getenv("VSPHERE_PASSWORD")
|
||||
cfg.Global.Datacenter = os.Getenv("VSPHERE_DATACENTER")
|
||||
|
Loading…
Reference in New Issue
Block a user