mirror of
https://github.com/mulgadc/spinifex.git
synced 2026-10-16 01:22:00 +00:00
chore: fmt
This commit is contained in:
+1
-1
@@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
|
||||
@@ -627,4 +627,3 @@ func ParsePredastoreNodeIDFromConfig(tomlContent string, ip string) int {
|
||||
}
|
||||
return FindNodeIDByIP(cfg.DB, ip)
|
||||
}
|
||||
|
||||
|
||||
@@ -127,9 +127,9 @@ type EBSSyncRequest struct {
|
||||
}
|
||||
|
||||
type EBSSyncResponse struct {
|
||||
Volume string
|
||||
Synced bool
|
||||
Error string
|
||||
Volume string
|
||||
Synced bool
|
||||
Error string
|
||||
}
|
||||
|
||||
type EBSDeleteRequest struct {
|
||||
|
||||
@@ -31,8 +31,8 @@ import (
|
||||
handlers_ec2_key "github.com/mulgadc/hive/hive/handlers/ec2/key"
|
||||
handlers_ec2_snapshot "github.com/mulgadc/hive/hive/handlers/ec2/snapshot"
|
||||
handlers_ec2_tags "github.com/mulgadc/hive/hive/handlers/ec2/tags"
|
||||
"github.com/mulgadc/hive/hive/objectstore"
|
||||
handlers_ec2_volume "github.com/mulgadc/hive/hive/handlers/ec2/volume"
|
||||
"github.com/mulgadc/hive/hive/objectstore"
|
||||
"github.com/mulgadc/hive/hive/qmp"
|
||||
"github.com/mulgadc/hive/hive/utils"
|
||||
"github.com/mulgadc/hive/hive/vm"
|
||||
@@ -865,7 +865,6 @@ func (d *Daemon) WriteState() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
// LoadState loads the instance state from JetStream KV store (required)
|
||||
func (d *Daemon) LoadState() error {
|
||||
if d.jsManager == nil {
|
||||
@@ -883,7 +882,6 @@ func (d *Daemon) LoadState() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
func (d *Daemon) SendQMPCommand(q *qmp.QMPClient, cmd qmp.QMPCommand, instanceId string) (*qmp.QMPResponse, error) {
|
||||
|
||||
// Confirm QMP client is initialized
|
||||
@@ -954,8 +952,6 @@ func (d *Daemon) SendQMPCommand(q *qmp.QMPClient, cmd qmp.QMPCommand, instanceId
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
func (d *Daemon) stopInstance(instances map[string]*vm.VM, deleteVolume bool) error {
|
||||
|
||||
// Signal to shutdown each VM
|
||||
@@ -1764,4 +1760,3 @@ func (rm *ResourceManager) deallocate(instanceType *ec2.InstanceTypeInfo) {
|
||||
rm.allocatedVCPU -= int(vCPUs)
|
||||
rm.allocatedMem -= memoryGB
|
||||
}
|
||||
|
||||
|
||||
@@ -15,8 +15,8 @@ import (
|
||||
"github.com/aws/aws-sdk-go/service/ec2"
|
||||
"github.com/mulgadc/hive/hive/config"
|
||||
handlers_ec2_instance "github.com/mulgadc/hive/hive/handlers/ec2/instance"
|
||||
"github.com/mulgadc/hive/hive/objectstore"
|
||||
handlers_ec2_volume "github.com/mulgadc/hive/hive/handlers/ec2/volume"
|
||||
"github.com/mulgadc/hive/hive/objectstore"
|
||||
"github.com/mulgadc/hive/hive/qmp"
|
||||
"github.com/mulgadc/hive/hive/vm"
|
||||
"github.com/nats-io/nats-server/v2/server"
|
||||
|
||||
@@ -153,4 +153,3 @@ func TestParseRunInstances(t *testing.T) {
|
||||
// Additional test
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -51,4 +51,3 @@ func TestValidateCreateKeyPairInput(t *testing.T) {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -149,7 +149,7 @@ func (s *InstanceServiceImpl) RunInstance(input *ec2.RunInstancesInput) (*vm.VM,
|
||||
func (s *InstanceServiceImpl) GenerateVolumes(input *ec2.RunInstancesInput, instance *vm.VM) ([]VolumeInfo, error) {
|
||||
|
||||
var size int = 4 * 1024 * 1024 * 1024 // 4GB default size
|
||||
var deviceName = "/dev/xvda" // Default device name
|
||||
var deviceName = "/dev/xvda" // Default device name
|
||||
var volumeType string
|
||||
var iops int
|
||||
var imageId string
|
||||
|
||||
@@ -360,4 +360,3 @@ func (s *SnapshotServiceImpl) CopySnapshot(input *ec2.CopySnapshotInput) (*ec2.C
|
||||
SnapshotId: aws.String(newSnapshotID),
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
||||
@@ -317,4 +317,3 @@ func TestCopySnapshot_PreservesTags(t *testing.T) {
|
||||
assert.Equal(t, "Environment", *result.Snapshots[0].Tags[0].Key)
|
||||
assert.Equal(t, "test", *result.Snapshots[0].Tags[0].Value)
|
||||
}
|
||||
|
||||
|
||||
@@ -250,4 +250,3 @@ func TestDescribeVolumeStatus_WithVolumeIDs(t *testing.T) {
|
||||
require.Error(t, err)
|
||||
assert.Equal(t, awserrors.ErrorInvalidVolumeNotFound, err.Error())
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -8,8 +8,8 @@ import (
|
||||
)
|
||||
|
||||
type NBDKitConfig struct {
|
||||
Port int `json:"port"` // TCP port (when using TCP transport)
|
||||
Socket string `json:"socket"` // Unix socket path (when using socket transport)
|
||||
Port int `json:"port"` // TCP port (when using TCP transport)
|
||||
Socket string `json:"socket"` // Unix socket path (when using socket transport)
|
||||
PidFile string `json:"pid_file"`
|
||||
PluginPath string `json:"plugin_path"`
|
||||
Verbose bool `json:"verbose"`
|
||||
|
||||
@@ -316,13 +316,13 @@ func TestValidateErrorPayload(t *testing.T) {
|
||||
|
||||
func TestParseNBDURI(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
uri string
|
||||
wantType string
|
||||
wantPath string
|
||||
wantHost string
|
||||
wantPort int
|
||||
wantErr bool
|
||||
name string
|
||||
uri string
|
||||
wantType string
|
||||
wantPath string
|
||||
wantHost string
|
||||
wantPort int
|
||||
wantErr bool
|
||||
}{
|
||||
{
|
||||
name: "Unix socket",
|
||||
|
||||
+6
-6
@@ -32,13 +32,13 @@ qemu-system-x86_64 \
|
||||
*/
|
||||
|
||||
type VM struct {
|
||||
ID string `json:"id"`
|
||||
PID int `json:"pid"`
|
||||
PTS int `json:"pts"`
|
||||
Running bool `json:"running"`
|
||||
ID string `json:"id"`
|
||||
PID int `json:"pid"`
|
||||
PTS int `json:"pts"`
|
||||
Running bool `json:"running"`
|
||||
Status InstanceState `json:"status"`
|
||||
InstanceType string `json:"instance_type"`
|
||||
Config Config `json:"config"`
|
||||
InstanceType string `json:"instance_type"`
|
||||
Config Config `json:"config"`
|
||||
|
||||
EBSRequests config.EBSRequests `json:"ebs_requests"`
|
||||
|
||||
|
||||
Reference in New Issue
Block a user