diff --git a/go.mod b/go.mod index 848ca8eeb3..b60e1c859a 100644 --- a/go.mod +++ b/go.mod @@ -75,7 +75,7 @@ require ( github.com/spf13/pflag v1.0.6 github.com/spf13/viper v1.19.0 github.com/stretchr/testify v1.10.0 - github.com/superfly/fly-go v0.1.40 + github.com/superfly/fly-go v0.1.41 github.com/superfly/graphql v0.2.5 github.com/superfly/lfsc-go v0.1.1 github.com/superfly/macaroon v0.2.14-0.20240819201738-61a02aa53648 diff --git a/go.sum b/go.sum index a858a596e2..5c20755a47 100644 --- a/go.sum +++ b/go.sum @@ -633,8 +633,8 @@ github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOf github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= -github.com/superfly/fly-go v0.1.40 h1:/s8vbjj/16aPlxdM2sU0uoIAjDqJ2OrkVrqMTX0I6dY= -github.com/superfly/fly-go v0.1.40/go.mod h1:lad5/CIMPpYvuAYQSwT8C154xuZPgBmhbkLwgau5V+o= +github.com/superfly/fly-go v0.1.41 h1:ca4LOCwI2b9jQKBkanXrsall5pBeEkQqnKHUjGL9SbI= +github.com/superfly/fly-go v0.1.41/go.mod h1:lad5/CIMPpYvuAYQSwT8C154xuZPgBmhbkLwgau5V+o= github.com/superfly/graphql v0.2.5 h1:61TUt5MrWxlOpdipfYNl9TsG0dXnvb3tkkn/Dre2GcA= github.com/superfly/graphql v0.2.5/go.mod h1:CVfDl31srm8HnJ9udwLu6hFNUW/P6GUM2dKcG1YQ8jc= github.com/superfly/lfsc-go v0.1.1 h1:dGjLgt81D09cG+aR9lJZIdmonjZSR5zYCi7s54+ZU2Q= diff --git a/internal/command/volumes/create.go b/internal/command/volumes/create.go index f56250d6c5..8791f78818 100644 --- a/internal/command/volumes/create.go +++ b/internal/command/volumes/create.go @@ -58,6 +58,11 @@ func newCreate() *cobra.Command { Description: "Place the volume in a separate hardware zone from existing volumes to help ensure availability", Default: true, }, + flag.Bool{ + Name: "unique-zone-app-wide", + Description: "Checks all volumes in app for unique zone handling, instead of only volumes with the same name (which is the default)", + Default: false, + }, flag.String{ Name: "snapshot-id", Description: "Create the volume from the specified snapshot", @@ -151,6 +156,7 @@ func runCreate(ctx context.Context) error { SizeGb: fly.Pointer(flag.GetInt(ctx, "size")), Encrypted: fly.Pointer(!flag.GetBool(ctx, "no-encryption")), RequireUniqueZone: fly.Pointer(flag.GetBool(ctx, "require-unique-zone")), + UniqueZoneAppWide: fly.Pointer(flag.GetBool(ctx, "unique-zone-app-wide")), SnapshotID: snapshotID, ComputeRequirements: computeRequirements, SnapshotRetention: fly.Pointer(flag.GetInt(ctx, "snapshot-retention")), diff --git a/internal/command/volumes/fork.go b/internal/command/volumes/fork.go index 3464490df1..896a3e3877 100644 --- a/internal/command/volumes/fork.go +++ b/internal/command/volumes/fork.go @@ -46,6 +46,11 @@ func newFork() *cobra.Command { Description: "Place the volume in a separate hardware zone from existing volumes. This is the default.", Default: true, }, + flag.Bool{ + Name: "unique-zone-app-wide", + Description: "Checks all volumes in app for unique zone handling, instead of only volumes with the same name (which is the default)", + Default: false, + }, flag.String{ Name: "region", Shorthand: "r", @@ -116,6 +121,7 @@ func runFork(ctx context.Context) error { input := fly.CreateVolumeRequest{ Name: name, RequireUniqueZone: fly.Pointer(flag.GetBool(ctx, "require-unique-zone")), + UniqueZoneAppWide: fly.Pointer(flag.GetBool(ctx, "unique-zone-app-wide")), SourceVolumeID: &vol.ID, ComputeRequirements: computeRequirements, ComputeImage: attachedMachineImage,