Skip to content

Commit

Permalink
Merge pull request #78 from n1Z3R/master
Browse files Browse the repository at this point in the history
Add preemptible bool for nodegroups
  • Loading branch information
pavelpereyma authored Oct 17, 2024
2 parents fe2a6e9 + b48498c commit fa8e6c2
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
3 changes: 3 additions & 0 deletions pkg/v1/nodegroup/requests_opts.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ type CreateOpts struct {

// InstallNvidiaDevicePlugin indicates if nvidia device plugin installation was requested.
InstallNvidiaDevicePlugin *bool `json:"install_nvidia_device_plugin,omitempty"`

// Preemptible indicates if preemptible instances are used.
Preemptible *bool `json:"preemptible,omitempty"`
}

// ResizeOpts represents options for the nodegroup Resize request.
Expand Down
3 changes: 3 additions & 0 deletions pkg/v1/nodegroup/schemas.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ type BaseView struct {

// InstallNvidiaDevicePlugin indicates if nvidia device plugin installation was requested.
InstallNvidiaDevicePlugin bool `json:"install_nvidia_device_plugin"`

// Preemptible indicates if preemptible instances are used.
Preemptible bool `json:"preemptible"`
}

// ListView represents an unmarshalled nodegroup body from the list API response.
Expand Down
12 changes: 9 additions & 3 deletions pkg/v1/nodegroup/testing/fixtures.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ const testGetNodegroupResponseRaw = `
"autoscale_max_nodes": 0,
"nodegroup_type": "STANDARD",
"user_data": "IyEvYmluL2Jhc2ggLXYKYXB0IC15IHVwZGF0ZQphcHQgLXkgaW5zdGFsbCBtdHI=",
"install_nvidia_device_plugin": false
"install_nvidia_device_plugin": false,
"preemptible": false
}
}
`
Expand Down Expand Up @@ -92,6 +93,7 @@ var expectedGetNodegroupResponse = &nodegroup.GetView{
AutoscaleMaxNodes: 0,
NodegroupType: "STANDARD",
InstallNvidiaDevicePlugin: false,
Preemptible: false,
},
UserData: "IyEvYmluL2Jhc2ggLXYKYXB0IC15IHVwZGF0ZQphcHQgLXkgaW5zdGFsbCBtdHI=",
}
Expand Down Expand Up @@ -138,7 +140,8 @@ const testListNodegroupsResponseRaw = `
"available_additional_info": {
"user_data": true
},
"install_nvidia_device_plugin": false
"install_nvidia_device_plugin": false,
"preemptible": false
}
]
}
Expand Down Expand Up @@ -183,6 +186,7 @@ var expectedListNodegroupsResponse = []*nodegroup.ListView{
AutoscaleMaxNodes: 0,
NodegroupType: "STANDARD",
InstallNvidiaDevicePlugin: false,
Preemptible: false,
},
AvailableAdditionalInfo: map[string]bool{"user_data": true},
},
Expand Down Expand Up @@ -213,7 +217,8 @@ const testCreateNodegroupOptsRaw = `
"autoscale_min_nodes": 1,
"autoscale_max_nodes": 10,
"user_data": "IyEvYmluL2Jhc2ggLXYKYXB0IC15IHVwZGF0ZQphcHQgLXkgaW5zdGFsbCBtdHI=",
"install_nvidia_device_plugin": false
"install_nvidia_device_plugin": false,
"preemptible": false
}
}
`
Expand Down Expand Up @@ -242,6 +247,7 @@ var testCreateNodegroupOpts = &nodegroup.CreateOpts{
AutoscaleMaxNodes: testutils.IntToPtr(10),
UserData: "IyEvYmluL2Jhc2ggLXYKYXB0IC15IHVwZGF0ZQphcHQgLXkgaW5zdGFsbCBtdHI=",
InstallNvidiaDevicePlugin: testutils.BoolToPtr(false),
Preemptible: testutils.BoolToPtr(false),
}

// testUpdateNodegroupOptsRaw represents marshalled options for the Update request.
Expand Down

0 comments on commit fa8e6c2

Please sign in to comment.