Skip to content

Commit e9b87e6

Browse files
authored
limit shell app names to 63 chars (#4296)
1 parent 66ee8f5 commit e9b87e6

File tree

1 file changed

+4
-3
lines changed
  • internal/command/machine

1 file changed

+4
-3
lines changed

internal/command/machine/run.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -530,12 +530,13 @@ func getOrCreateEphemeralShellApp(ctx context.Context, client flyutil.Client) (*
530530
}
531531

532532
if appc == nil {
533+
shellAppName := fmt.Sprintf("flyctl-interactive-shells-%s-%d", strings.ToLower(org.ID), rand.Intn(1_000_000))
534+
shellAppName = strings.TrimRight(shellAppName[:min(len(shellAppName), 63)], "-")
533535
appc, err = client.CreateApp(ctx, fly.CreateAppInput{
534536
OrganizationID: org.ID,
535-
// i'll never find love again like the kind you give like the kind you send
536-
Name: fmt.Sprintf("flyctl-interactive-shells-%s-%d", strings.ToLower(org.ID), rand.Intn(1_000_000)),
537+
// I'll never find love again like the kind you give like the kind you send
538+
Name: shellAppName,
537539
})
538-
539540
if err != nil {
540541
return nil, fmt.Errorf("create interactive shell app: %w", err)
541542
}

0 commit comments

Comments
 (0)