-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Add Nutanix-specific platform types #5603
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
openshift-merge-robot
merged 5 commits into
openshift:master
from
nutanix-cloud-native:ntnx-2
Mar 16, 2022
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
3205b00
Add Nutanix specific data structures in pkg/types/nutanix
thunderboltsid 3e1a3b6
Add the package defaults for Nutanix platform
thunderboltsid 88fdcce
Add validations for Nutanix platform structs
thunderboltsid 70a60cd
Add generated installconfigs
thunderboltsid 06c7bc8
Update printer_test.go
thunderboltsid File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,7 @@ | ||
| # See the OWNERS docs: https://git.k8s.io/community/contributors/guide/owners.md | ||
| # This file just uses aliases defined in OWNERS_ALIASES. | ||
|
|
||
| approvers: | ||
| - nutanix-approvers | ||
| reviewers: | ||
| - nutanix-reviewers | ||
This file contains hidden or 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,8 @@ | ||
| package defaults | ||
|
|
||
| import ( | ||
| "github.com/openshift/installer/pkg/types/nutanix" | ||
| ) | ||
|
|
||
| // SetPlatformDefaults sets the defaults for the platform. | ||
| func SetPlatformDefaults(p *nutanix.Platform) {} |
This file contains hidden or 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,34 @@ | ||
| package defaults | ||
|
|
||
| import ( | ||
| "testing" | ||
|
|
||
| "github.com/openshift/installer/pkg/types/nutanix" | ||
| "github.com/stretchr/testify/assert" | ||
| ) | ||
|
|
||
| const testClusterName = "test-cluster" | ||
|
|
||
| func defaultPlatform() *nutanix.Platform { | ||
| return &nutanix.Platform{} | ||
| } | ||
|
|
||
| func TestSetPlatformDefaults(t *testing.T) { | ||
| cases := []struct { | ||
| name string | ||
| platform *nutanix.Platform | ||
| expected *nutanix.Platform | ||
| }{ | ||
| { | ||
| name: "empty", | ||
| platform: &nutanix.Platform{}, | ||
| expected: defaultPlatform(), | ||
| }, | ||
| } | ||
| for _, tc := range cases { | ||
| t.Run(tc.name, func(t *testing.T) { | ||
| SetPlatformDefaults(tc.platform) | ||
| assert.Equal(t, tc.expected, tc.platform, "unexpected platform") | ||
| }) | ||
| } | ||
| } |
This file contains hidden or 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,6 @@ | ||
| // Package nutanix contains Nutanix-specific structures for installer | ||
| // configuration and management. | ||
| package nutanix | ||
|
|
||
| // Name is the platform in the package | ||
| const Name = "nutanix" |
This file contains hidden or 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,57 @@ | ||
| package nutanix | ||
|
|
||
| // MachinePool stores the configuration for a machine pool installed | ||
| // on Nutanix. | ||
| type MachinePool struct { | ||
| // NumCPUs is the total number of virtual processor cores to assign a vm. | ||
| // | ||
| // +optional | ||
| NumCPUs int64 `json:"cpus,omitempty"` | ||
|
|
||
| // NumCoresPerSocket is the number of cores per socket in a vm. The number | ||
| // of vCPUs on the vm will be NumCPUs/NumCoresPerSocket. | ||
| // | ||
| // +optional | ||
| NumCoresPerSocket int64 `json:"coresPerSocket,omitempty"` | ||
|
|
||
| // Memory is the size of a VM's memory in MiB. | ||
| // | ||
| // +optional | ||
| MemoryMiB int64 `json:"memoryMiB,omitempty"` | ||
|
|
||
| // OSDisk defines the storage for instance. | ||
| // | ||
| // +optional | ||
| OSDisk `json:"osDisk,omitempty"` | ||
| } | ||
|
|
||
| // OSDisk defines the disk for a virtual machine. | ||
| type OSDisk struct { | ||
| // DiskSizeMiB defines the size of disk in MiB. | ||
| // | ||
| // +optional | ||
| DiskSizeMiB int64 `json:"diskSizeMiB,omitempty"` | ||
| } | ||
|
|
||
| // Set sets the values from `required` to `p`. | ||
| func (p *MachinePool) Set(required *MachinePool) { | ||
| if required == nil || p == nil { | ||
| return | ||
| } | ||
|
|
||
| if required.NumCPUs != 0 { | ||
| p.NumCPUs = required.NumCPUs | ||
| } | ||
|
|
||
| if required.NumCoresPerSocket != 0 { | ||
| p.NumCoresPerSocket = required.NumCoresPerSocket | ||
| } | ||
|
|
||
| if required.MemoryMiB != 0 { | ||
| p.MemoryMiB = required.MemoryMiB | ||
| } | ||
|
|
||
| if required.OSDisk.DiskSizeMiB != 0 { | ||
| p.OSDisk.DiskSizeMiB = required.OSDisk.DiskSizeMiB | ||
| } | ||
| } |
This file contains hidden or 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,13 @@ | ||
| package nutanix | ||
|
|
||
| // Metadata contains Nutanix metadata (e.g. for uninstalling the cluster). | ||
| type Metadata struct { | ||
| // PrismCentral is the domain name or IP address of the Prism Central. | ||
| PrismCentral string `json:"prismCentral"` | ||
| // Username is the name of the user to use to connect to the Prism Central. | ||
| Username string `json:"username"` | ||
| // Password is the password for the user to use to connect to the Prism Central. | ||
| Password string `json:"password"` | ||
| // Port is the port used to connect to the Prism Central. | ||
| Port string `json:"port"` | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.