-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pkg/asset/installconfig/platform: Drop *PlatformType for types.{platf…
…orm}.Name The old *PlatformType are from cccbb37 (Generate installation assets via a dependency graph, 2018-08-10, #120), but since 476be07 (pkg/asset: use vendored cluster-api instead of go templates, 2018-10-30, #573), we've had variables for the name strings in the more central pkg/types. With this commit, we drop the more peripheral forms. I've also pushed the types.PlatformName{Platform} variables down into types.{platform}.Name at Ahbinav's suggestion [1]. I've added a unit test to enforce sorting in PlatformNames, because the order is required by sort.SearchStrings in queryUserForPlatform. [1]: #659 (comment)
- Loading branch information
Showing
11 changed files
with
55 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
// Package aws contains AWS-specific structures for installer | ||
// configuration and management. | ||
package aws | ||
|
||
// Name is name for the AWS platform. | ||
const Name string = "aws" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package types | ||
|
||
import ( | ||
"sort" | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestPlatformNamesSorted(t *testing.T) { | ||
sorted := make([]string, len(PlatformNames)) | ||
copy(sorted, PlatformNames) | ||
sort.Strings(sorted) | ||
assert.Equal(t, sorted, PlatformNames) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
// Package libvirt contains libvirt-specific structures for | ||
// installer configuration and management. | ||
package libvirt | ||
|
||
// Name is the name for the libvirt platform. | ||
const Name string = "libvirt" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
// Package openstack contains OpenStack-specific structures for | ||
// installer configuration and management. | ||
package openstack | ||
|
||
// Name is the name for the Openstack platform. | ||
const Name string = "openstack" |