diff --git a/hive/handlers/ec2/image/service_impl.go b/hive/handlers/ec2/image/service_impl.go index 5882391f6..ae1b1cfa7 100644 --- a/hive/handlers/ec2/image/service_impl.go +++ b/hive/handlers/ec2/image/service_impl.go @@ -17,6 +17,9 @@ import ( "github.com/mulgadc/viperblock/viperblock" ) +// Ensure ImageServiceImpl implements ImageService +var _ ImageService = (*ImageServiceImpl)(nil) + // ImageServiceImpl handles AMI image operations with S3 storage type ImageServiceImpl struct { config *config.Config diff --git a/hive/handlers/ec2/key/service_impl.go b/hive/handlers/ec2/key/service_impl.go index 050169212..04f44c357 100644 --- a/hive/handlers/ec2/key/service_impl.go +++ b/hive/handlers/ec2/key/service_impl.go @@ -27,6 +27,9 @@ import ( "github.com/mulgadc/hive/hive/utils" ) +// Ensure KeyServiceImpl implements KeyService +var _ KeyService = (*KeyServiceImpl)(nil) + // KeyServiceImpl handles key pair operations with ssh-keygen and S3 storage type KeyServiceImpl struct { config *config.Config diff --git a/hive/handlers/ec2/snapshot/service_impl.go b/hive/handlers/ec2/snapshot/service_impl.go index 5138aff9f..6ab4c5b0f 100644 --- a/hive/handlers/ec2/snapshot/service_impl.go +++ b/hive/handlers/ec2/snapshot/service_impl.go @@ -16,6 +16,7 @@ import ( "github.com/mulgadc/hive/hive/awserrors" "github.com/mulgadc/hive/hive/config" "github.com/mulgadc/hive/hive/objectstore" + "github.com/mulgadc/hive/hive/utils" "github.com/mulgadc/viperblock/viperblock" ) @@ -179,7 +180,7 @@ func (s *SnapshotServiceImpl) CreateSnapshot(input *ec2.CreateSnapshotInput) (*e snapshotCfg := &SnapshotConfig{ SnapshotID: snapshotID, VolumeID: volumeID, - VolumeSize: int64(volumeConfig.VolumeMetadata.SizeGiB), + VolumeSize: utils.SafeUint64ToInt64(volumeConfig.VolumeMetadata.SizeGiB), State: "completed", Progress: "100%", StartTime: now, diff --git a/hive/handlers/ec2/volume/service_impl.go b/hive/handlers/ec2/volume/service_impl.go index 9872d5f24..6c623e46f 100644 --- a/hive/handlers/ec2/volume/service_impl.go +++ b/hive/handlers/ec2/volume/service_impl.go @@ -27,6 +27,9 @@ import ( const defaultGP3IOPS = 3000 +// Ensure VolumeServiceImpl implements VolumeService +var _ VolumeService = (*VolumeServiceImpl)(nil) + // VolumeServiceImpl handles EBS volume operations with S3 storage type VolumeServiceImpl struct { config *config.Config