Skip to content

Commit

Permalink
Don't blow away metadata on deploy (superfly#1571)
Browse files Browse the repository at this point in the history
* Don't blow away metadata on deploy

* Remove this
  • Loading branch information
davissp14 authored Jan 12, 2023
1 parent 938dbc8 commit 8a55d40
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion internal/command/deploy/machines.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,6 @@ func DeployMachinesApp(ctx context.Context, app *api.AppCompact, strategy string
spin := spinner.Run(io, msg)
defer spin.StopWithSuccess()

machineConfig.Metadata = map[string]string{"process_group": "app"}
machineConfig.Init.Cmd = nil

launchInput := api.LaunchMachineInput{
Expand Down Expand Up @@ -261,6 +260,18 @@ func DeployMachinesApp(ctx context.Context, app *api.AppCompact, strategy string

launchInput.Region = machine.Region

machineConfig.Metadata = machine.Config.Metadata

if machineConfig.Metadata == nil {
machineConfig.Metadata = map[string]string{
"process_group": "app",
}
}

if app.IsPostgresApp() {
machineConfig.Metadata["fly-managed-postgres"] = "true"
}

if launchInput.Config.Env["PRIMARY_REGION"] == "" {
launchInput.Config.Env["PRIMARY_REGION"] = machine.Config.Env["PRIMARY_REGION"]
}
Expand Down

0 comments on commit 8a55d40

Please sign in to comment.