mirror of
https://github.com/mulgadc/spinifex.git
synced 2026-10-15 09:01:31 +00:00
fix: match new viperblock err type
This commit is contained in:
@@ -36,7 +36,7 @@ import (
|
||||
"github.com/mulgadc/hive/hive/utils"
|
||||
"github.com/mulgadc/viperblock/viperblock"
|
||||
"github.com/mulgadc/viperblock/viperblock/backends/s3"
|
||||
vutils "github.com/mulgadc/viperblock/viperblock/utils"
|
||||
"github.com/mulgadc/viperblock/viperblock/v_utils"
|
||||
"github.com/pelletier/go-toml/v2"
|
||||
"github.com/pterm/pterm"
|
||||
"github.com/spf13/cobra"
|
||||
@@ -409,7 +409,7 @@ func runimagesImportCmd(cmd *cobra.Command, args []string) {
|
||||
VolumeConfig: manifest,
|
||||
}
|
||||
|
||||
err = vutils.ImportDiskImage(&s3Config, &vbConfig, extractedImagePath)
|
||||
err = v_utils.ImportDiskImage(&s3Config, &vbConfig, extractedImagePath)
|
||||
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Could not import image to predastore: %v\n", err)
|
||||
|
||||
@@ -8,7 +8,7 @@ require (
|
||||
github.com/google/uuid v1.6.0
|
||||
github.com/kdomanski/iso9660 v0.4.0
|
||||
github.com/mulgadc/predastore v0.1.5
|
||||
github.com/mulgadc/viperblock v0.1.3
|
||||
github.com/mulgadc/viperblock v0.1.4
|
||||
github.com/nats-io/nats-server/v2 v2.11.6
|
||||
github.com/nats-io/nats.go v1.43.0
|
||||
github.com/pelletier/go-toml/v2 v2.2.4
|
||||
|
||||
@@ -128,6 +128,8 @@ github.com/mulgadc/predastore v0.1.5 h1:7SySkQQ5MQ1NTcKcB14pCUIJipq0YVgCJZeKM6yt
|
||||
github.com/mulgadc/predastore v0.1.5/go.mod h1:BhMymRV3zMTu2S+5pJnNDDm5+AGakjhSc/PKX0q8Xfg=
|
||||
github.com/mulgadc/viperblock v0.1.3 h1:xooK1uTUI0RLK23PHAuVInirC3TrBo6/6ezkt+1vMJo=
|
||||
github.com/mulgadc/viperblock v0.1.3/go.mod h1:eFolZVfX4iBFBnHAfOoYILfiIjNoI/NhmKht3OIPRR8=
|
||||
github.com/mulgadc/viperblock v0.1.4 h1:YnRHEC6XNbhnSk6S+ET3X7DTMRezdO3o1O3nO/R9Syg=
|
||||
github.com/mulgadc/viperblock v0.1.4/go.mod h1:JNooDHb6ZuPvNPWaf0gChlft/D8xs5jHJFln+P3B9lQ=
|
||||
github.com/nats-io/jwt/v2 v2.7.4 h1:jXFuDDxs/GQjGDZGhNgH4tXzSUK6WQi2rsj4xmsNOtI=
|
||||
github.com/nats-io/jwt/v2 v2.7.4/go.mod h1:me11pOkwObtcBNR8AiMrUbtVOUGkqYjMQZ6jnSdVUIA=
|
||||
github.com/nats-io/nats-server/v2 v2.11.6 h1:4VXRjbTUFKEB+7UoaKL3F5Y83xC7MxPoIONOnGgpkHw=
|
||||
|
||||
@@ -346,7 +346,7 @@ func (s *InstanceServiceImpl) cloneAMIToVolume(input *ec2.RunInstancesInput, siz
|
||||
|
||||
// Read 1MB
|
||||
data, err := amiVb.ReadAt(block*uint64(destVb.BlockSize), uint64(destVb.BlockSize)*1024)
|
||||
if err != nil && err != viperblock.ZeroBlock {
|
||||
if err != nil && err != viperblock.ErrZeroBlock {
|
||||
slog.Error("Failed to read block from AMI source", "err", err)
|
||||
return errors.New(awserrors.ErrorServerInternal)
|
||||
}
|
||||
|
||||
@@ -242,7 +242,7 @@ func formatFingerprint(hash []byte, algorithm string) string {
|
||||
// generateKeyPairID generates a unique key pair ID (similar to AWS key-xxxxx format)
|
||||
func generateKeyPairID() string {
|
||||
hash := sha1.New() //#nosec G401 - need sha1 for AWS compatibility
|
||||
hash.Write([]byte(fmt.Sprintf("%d", time.Now().UnixNano())))
|
||||
hash.Write(fmt.Appendf(nil, "%d", time.Now().UnixNano()))
|
||||
return fmt.Sprintf("%x", hash.Sum(nil))[:16]
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user