Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add --unique-zone-app-wide flag to volume create and fork #4238

Merged
merged 2 commits into from
Feb 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
6 changes: 6 additions & 0 deletions internal/command/volumes/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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")),
Expand Down
6 changes: 6 additions & 0 deletions internal/command/volumes/fork.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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,
Expand Down
Loading