diff --git a/staging/src/k8s.io/legacy-cloud-providers/vsphere/vclib/connection.go b/staging/src/k8s.io/legacy-cloud-providers/vsphere/vclib/connection.go index 44d8f4a9dcd..c4a49dc1078 100644 --- a/staging/src/k8s.io/legacy-cloud-providers/vsphere/vclib/connection.go +++ b/staging/src/k8s.io/legacy-cloud-providers/vsphere/vclib/connection.go @@ -218,16 +218,12 @@ func (connection *VSphereConnection) NewClient(ctx context.Context) (*vim25.Clie connection.RoundTripperCount = RoundTripperDefaultCount } client.RoundTripper = vim25.Retry(client.RoundTripper, vim25.TemporaryNetworkError(int(connection.RoundTripperCount))) - vcdeprecated, err := isvCenterDeprecated(client.ServiceContent.About.Version, client.ServiceContent.About.ApiVersion) + vcNotSupported, err := isvCenterNotSupported(client.ServiceContent.About.Version, client.ServiceContent.About.ApiVersion) if err != nil { - klog.Errorf("failed to check if vCenter version:%v and api version: %s is deprecated. Error: %v", client.ServiceContent.About.Version, client.ServiceContent.About.ApiVersion, err) + klog.Errorf("failed to check if vCenter version:%v and api version: %s is supported. Error: %v", client.ServiceContent.About.Version, client.ServiceContent.About.ApiVersion, err) } - if vcdeprecated { - // After this deprecation, vSphere 6.5 support period is extended to October 15, 2022 as - // https://blogs.vmware.com/vsphere/2021/03/announcing-limited-extension-of-vmware-vsphere-6-5-general-support-period.html - // In addition, the external vSphere cloud provider does not support vSphere 6.5. - // Please keep vSphere 6.5 support til the period. - klog.Warningf("vCenter is deprecated. version: %s, api verson: %s Please consider upgrading vCenter and ESXi servers to 6.7u3 or higher", client.ServiceContent.About.Version, client.ServiceContent.About.ApiVersion) + if vcNotSupported { + klog.Warningf("vCenter version is not supported. version: %s, api verson: %s Please consider upgrading vCenter and ESXi servers to 7.0u2 or higher", client.ServiceContent.About.Version, client.ServiceContent.About.ApiVersion) } return client, nil } diff --git a/staging/src/k8s.io/legacy-cloud-providers/vsphere/vclib/utils.go b/staging/src/k8s.io/legacy-cloud-providers/vsphere/vclib/utils.go index 3662248d596..cab9caa6d32 100644 --- a/staging/src/k8s.io/legacy-cloud-providers/vsphere/vclib/utils.go +++ b/staging/src/k8s.io/legacy-cloud-providers/vsphere/vclib/utils.go @@ -201,8 +201,9 @@ func VerifyVolumePathsForVMDevices(vmDevices object.VirtualDeviceList, volPaths } -// isvCenterDeprecated takes vCenter version and vCenter API version as input and return true if vCenter is deprecated -func isvCenterDeprecated(vCenterVersion string, vCenterAPIVersion string) (bool, error) { +// isvCenterNotSupported takes vCenter version and vCenter API version as input and return true if vCenter is no longer +// supported by VMware for in-tree vSphere volume plugin +func isvCenterNotSupported(vCenterVersion string, vCenterAPIVersion string) (bool, error) { var vcversion, vcapiversion, minvcversion vcVersion var err error err = vcversion.parse(vCenterVersion) diff --git a/staging/src/k8s.io/legacy-cloud-providers/vsphere/vclib/utils_test.go b/staging/src/k8s.io/legacy-cloud-providers/vsphere/vclib/utils_test.go index 6328834b136..6e8f213cf03 100644 --- a/staging/src/k8s.io/legacy-cloud-providers/vsphere/vclib/utils_test.go +++ b/staging/src/k8s.io/legacy-cloud-providers/vsphere/vclib/utils_test.go @@ -70,11 +70,11 @@ func TestUtils(t *testing.T) { } } -func TestIsvCenterDeprecated(t *testing.T) { +func TestIsvCenterNotSupported(t *testing.T) { type testsData struct { - vcVersion string - vcAPIVersion string - isDeprecated bool + vcVersion string + vcAPIVersion string + isNotSupported bool } testdataArray := []testsData{ {"8.0.0", "8.0.0.0", false}, @@ -90,16 +90,16 @@ func TestIsvCenterDeprecated(t *testing.T) { } for _, test := range testdataArray { - deprecated, err := isvCenterDeprecated(test.vcVersion, test.vcAPIVersion) + notsupported, err := isvCenterNotSupported(test.vcVersion, test.vcAPIVersion) if err != nil { t.Fatal(err) } - if deprecated != test.isDeprecated { - t.Fatalf("deprecation test failed for vc version: %q and vc API version: %q", + if notsupported != test.isNotSupported { + t.Fatalf("test failed for vc version: %q and vc API version: %q", test.vcVersion, test.vcAPIVersion) } else { - t.Logf("deprecation test for vc version: %q and vc API version: %q passed. Is Deprecated : %v", - test.vcAPIVersion, test.vcAPIVersion, deprecated) + t.Logf("test for vc version: %q and vc API version: %q passed. Is Not Supported : %v", + test.vcAPIVersion, test.vcAPIVersion, notsupported) } } }