mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-21 21:18:54 +00:00
FC: Removed redundant RescanBlockDevice
action
Firecracker has removed RescanBlockDevice from the /actions API. Related PR: https://github.com/firecracker-microvm/firecracker/pull/1542. We need to remove according settings in kata-containers. Fixes: #2504 Signed-off-by: Penny Zheng <penny.zheng@arm.com>
This commit is contained in:
parent
37b91b3378
commit
d2cae59ec7
@ -934,20 +934,6 @@ func (fc *firecracker) fcUpdateBlockDrive(path, id string) error {
|
||||
return err
|
||||
}
|
||||
|
||||
// Rescan needs to used only if the VM is running
|
||||
if fc.vmRunning() {
|
||||
actionParams := ops.NewCreateSyncActionParams()
|
||||
actionType := "BlockDeviceRescan"
|
||||
actionInfo := &models.InstanceActionInfo{
|
||||
ActionType: &actionType,
|
||||
Payload: id,
|
||||
}
|
||||
actionParams.SetInfo(actionInfo)
|
||||
if _, err := fc.client().Operations.CreateSyncAction(actionParams); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -21,11 +21,8 @@ type InstanceActionInfo struct {
|
||||
|
||||
// Enumeration indicating what type of action is contained in the payload
|
||||
// Required: true
|
||||
// Enum: [BlockDeviceRescan FlushMetrics InstanceStart SendCtrlAltDel]
|
||||
// Enum: [FlushMetrics InstanceStart SendCtrlAltDel]
|
||||
ActionType *string `json:"action_type"`
|
||||
|
||||
// payload
|
||||
Payload string `json:"payload,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this instance action info
|
||||
@ -46,7 +43,7 @@ var instanceActionInfoTypeActionTypePropEnum []interface{}
|
||||
|
||||
func init() {
|
||||
var res []string
|
||||
if err := json.Unmarshal([]byte(`["BlockDeviceRescan","FlushMetrics","InstanceStart","SendCtrlAltDel"]`), &res); err != nil {
|
||||
if err := json.Unmarshal([]byte(`["FlushMetrics","InstanceStart","SendCtrlAltDel"]`), &res); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
for _, v := range res {
|
||||
@ -56,9 +53,6 @@ func init() {
|
||||
|
||||
const (
|
||||
|
||||
// InstanceActionInfoActionTypeBlockDeviceRescan captures enum value "BlockDeviceRescan"
|
||||
InstanceActionInfoActionTypeBlockDeviceRescan string = "BlockDeviceRescan"
|
||||
|
||||
// InstanceActionInfoActionTypeFlushMetrics captures enum value "FlushMetrics"
|
||||
InstanceActionInfoActionTypeFlushMetrics string = "FlushMetrics"
|
||||
|
||||
|
@ -449,12 +449,9 @@ definitions:
|
||||
description: Enumeration indicating what type of action is contained in the payload
|
||||
type: string
|
||||
enum:
|
||||
- BlockDeviceRescan
|
||||
- FlushMetrics
|
||||
- InstanceStart
|
||||
- SendCtrlAltDel
|
||||
payload:
|
||||
type: string
|
||||
|
||||
InstanceInfo:
|
||||
type: object
|
||||
|
Loading…
Reference in New Issue
Block a user