mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 17:30:00 +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 {
|
if cfg.Global.RoundTripperCount == 0 {
|
||||||
cfg.Global.RoundTripperCount = RoundTripperDefaultCount
|
cfg.Global.RoundTripperCount = RoundTripperDefaultCount
|
||||||
}
|
}
|
||||||
if cfg.Global.VCenterPort != "" {
|
if cfg.Global.VCenterPort == "" {
|
||||||
glog.Warningf("port is a deprecated field in vsphere.conf and will be removed in future release.")
|
cfg.Global.VCenterPort = "443"
|
||||||
}
|
}
|
||||||
|
|
||||||
var c *govmomi.Client
|
var c *govmomi.Client
|
||||||
@ -382,7 +382,7 @@ func logout(vs *VSphere) {
|
|||||||
|
|
||||||
func newClient(ctx context.Context, cfg *VSphereConfig) (*govmomi.Client, error) {
|
func newClient(ctx context.Context, cfg *VSphereConfig) (*govmomi.Client, error) {
|
||||||
// Parse URL from string
|
// 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 {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
@ -33,6 +33,7 @@ func configFromEnv() (cfg VSphereConfig, ok bool) {
|
|||||||
var InsecureFlag bool
|
var InsecureFlag bool
|
||||||
var err error
|
var err error
|
||||||
cfg.Global.VCenterIP = os.Getenv("VSPHERE_VCENTER")
|
cfg.Global.VCenterIP = os.Getenv("VSPHERE_VCENTER")
|
||||||
|
cfg.Global.VCenterPort = os.Getenv("VSPHERE_VCENTER_PORT")
|
||||||
cfg.Global.User = os.Getenv("VSPHERE_USER")
|
cfg.Global.User = os.Getenv("VSPHERE_USER")
|
||||||
cfg.Global.Password = os.Getenv("VSPHERE_PASSWORD")
|
cfg.Global.Password = os.Getenv("VSPHERE_PASSWORD")
|
||||||
cfg.Global.Datacenter = os.Getenv("VSPHERE_DATACENTER")
|
cfg.Global.Datacenter = os.Getenv("VSPHERE_DATACENTER")
|
||||||
|
@ -61,6 +61,7 @@ func GetVSphere() (*VSphere, error) {
|
|||||||
func getVSphereConfig() *VSphereConfig {
|
func getVSphereConfig() *VSphereConfig {
|
||||||
var cfg VSphereConfig
|
var cfg VSphereConfig
|
||||||
cfg.Global.VCenterIP = os.Getenv("VSPHERE_VCENTER")
|
cfg.Global.VCenterIP = os.Getenv("VSPHERE_VCENTER")
|
||||||
|
cfg.Global.VCenterPort = os.Getenv("VSPHERE_VCENTER_PORT")
|
||||||
cfg.Global.User = os.Getenv("VSPHERE_USER")
|
cfg.Global.User = os.Getenv("VSPHERE_USER")
|
||||||
cfg.Global.Password = os.Getenv("VSPHERE_PASSWORD")
|
cfg.Global.Password = os.Getenv("VSPHERE_PASSWORD")
|
||||||
cfg.Global.Datacenter = os.Getenv("VSPHERE_DATACENTER")
|
cfg.Global.Datacenter = os.Getenv("VSPHERE_DATACENTER")
|
||||||
|
Loading…
Reference in New Issue
Block a user