Skip to content

Commit

Permalink
Fix depreciated typo
Browse files Browse the repository at this point in the history
  • Loading branch information
2uasimojo authored and openshift-cherrypick-robot committed Jan 19, 2024
1 parent 8cdb231 commit 2438bde
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
10 changes: 5 additions & 5 deletions pkg/types/vsphere/conversion/installconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func ConvertInstallConfig(config *types.InstallConfig) error {

// Scenario: legacy UPI or IPI
if len(platform.FailureDomains) == 0 {
localLogger.Warn("vsphere topology fields are now depreciated please use failureDomains")
localLogger.Warn("vsphere topology fields are now deprecated; please use failureDomains")

platform.FailureDomains = make([]vsphere.FailureDomain, 1)
platform.FailureDomains[0].Name = "generated-failure-domain"
Expand All @@ -74,30 +74,30 @@ func ConvertInstallConfig(config *types.InstallConfig) error {

func setComputeClusterPath(cluster, datacenter string) string {
if cluster != "" && !strings.HasPrefix(cluster, "/") {
localLogger.Warnf("computeCluster as a non-path is now depreciated please use the form: /%s/host/%s", datacenter, cluster)
localLogger.Warnf("computeCluster as a non-path is now deprecated; please use the form: /%s/host/%s", datacenter, cluster)
return fmt.Sprintf("/%s/host/%s", datacenter, cluster)
}
return cluster
}

func setDatastorePath(datastore, datacenter string) string {
if datastore != "" && !strings.HasPrefix(datastore, "/") {
localLogger.Warnf("datastore as a non-path is now depreciated please use the form: /%s/datastore/%s", datacenter, datastore)
localLogger.Warnf("datastore as a non-path is now deprecated; please use the form: /%s/datastore/%s", datacenter, datastore)
return fmt.Sprintf("/%s/datastore/%s", datacenter, datastore)
}
return datastore
}

func setFolderPath(folder, datacenter string) string {
if folder != "" && !strings.HasPrefix(folder, "/") {
localLogger.Warnf("folder as a non-path is now depreciated please use the form: /%s/vm/%s", datacenter, folder)
localLogger.Warnf("folder as a non-path is now deprecated; please use the form: /%s/vm/%s", datacenter, folder)
return fmt.Sprintf("/%s/vm/%s", datacenter, folder)
}
return folder
}

func createVCenters(platform *vsphere.Platform) {
localLogger.Warn("vsphere authentication fields are now depreciated please use vcenters")
localLogger.Warn("vsphere authentication fields are now deprecated; please use vcenters")

platform.VCenters = make([]vsphere.VCenter, 1)
platform.VCenters[0].Server = platform.DeprecatedVCenter
Expand Down
30 changes: 15 additions & 15 deletions pkg/types/vsphere/conversion/installconfig_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -390,9 +390,9 @@ func TestConvertInstallConfig(t *testing.T) {
expectInstallConfig: convertedLegacyUpiInstallConfig,
expectLevel: logrus.WarnLevel,
expectWarn: []string{
"vsphere authentication fields are now depreciated please use vcenters",
"vsphere topology fields are now depreciated please use failureDomains",
"datastore as a non-path is now depreciated please use the form: /test-datacenter/datastore/test-datastore",
"vsphere authentication fields are now deprecated; please use vcenters",
"vsphere topology fields are now deprecated; please use failureDomains",
"datastore as a non-path is now deprecated; please use the form: /test-datacenter/datastore/test-datastore",
},
},
{
Expand All @@ -401,10 +401,10 @@ func TestConvertInstallConfig(t *testing.T) {
expectInstallConfig: convertedLegacyIpiInstallConfig,
expectLevel: logrus.WarnLevel,
expectWarn: []string{
"vsphere authentication fields are now depreciated please use vcenters",
"vsphere topology fields are now depreciated please use failureDomains",
"computeCluster as a non-path is now depreciated please use the form: /test-datacenter/host/test-cluster",
"datastore as a non-path is now depreciated please use the form: /test-datacenter/datastore/test-datastore",
"vsphere authentication fields are now deprecated; please use vcenters",
"vsphere topology fields are now deprecated; please use failureDomains",
"computeCluster as a non-path is now deprecated; please use the form: /test-datacenter/host/test-cluster",
"datastore as a non-path is now deprecated; please use the form: /test-datacenter/datastore/test-datastore",
},
},
{
Expand All @@ -413,11 +413,11 @@ func TestConvertInstallConfig(t *testing.T) {
expectInstallConfig: convertedLegacyIpiZonalInstallConfig,
expectLevel: logrus.WarnLevel,
expectWarn: []string{
"vsphere authentication fields are now depreciated please use vcenters",
"datastore as a non-path is now depreciated please use the form: /test-datacenter/datastore/datastore1",
"datastore as a non-path is now depreciated please use the form: /test-datacenter/datastore/datastore2",
"datastore as a non-path is now depreciated please use the form: /test-datacenter/datastore/datastore3",
"datastore as a non-path is now depreciated please use the form: /test-datacenter4/datastore/datastore4",
"vsphere authentication fields are now deprecated; please use vcenters",
"datastore as a non-path is now deprecated; please use the form: /test-datacenter/datastore/datastore1",
"datastore as a non-path is now deprecated; please use the form: /test-datacenter/datastore/datastore2",
"datastore as a non-path is now deprecated; please use the form: /test-datacenter/datastore/datastore3",
"datastore as a non-path is now deprecated; please use the form: /test-datacenter4/datastore/datastore4",
},
},
{
Expand Down Expand Up @@ -479,7 +479,7 @@ func Test_setComputeClusterPath(t *testing.T) {
computeCluster: "C1",
datacenter: "DC1",
expectLevel: `warning`,
expectWarn: `computeCluster as a non-path is now depreciated please use the form: /DC1/host/C1`,
expectWarn: `computeCluster as a non-path is now deprecated; please use the form: /DC1/host/C1`,
expectCluster: "/DC1/host/C1",
},
}
Expand Down Expand Up @@ -525,7 +525,7 @@ func Test_setDatastorePath(t *testing.T) {
datastore: "DS1",
datacenter: "DC1",
expectLevel: `warning`,
expectWarn: `datastore as a non-path is now depreciated please use the form: /DC1/datastore/DS1`,
expectWarn: `datastore as a non-path is now deprecated; please use the form: /DC1/datastore/DS1`,
expectDatstore: "/DC1/datastore/DS1",
},
}
Expand Down Expand Up @@ -571,7 +571,7 @@ func Test_setFolderPath(t *testing.T) {
folder: "Folder1",
datacenter: "DC1",
expectLevel: `warning`,
expectWarn: `folder as a non-path is now depreciated please use the form: /DC1/vm/Folder1`,
expectWarn: `folder as a non-path is now deprecated; please use the form: /DC1/vm/Folder1`,
expectFolder: "/DC1/vm/Folder1",
},
}
Expand Down

0 comments on commit 2438bde

Please sign in to comment.