Skip to content
This repository has been archived by the owner on Nov 27, 2023. It is now read-only.

Commit

Permalink
Merge pull request #1821 from ndeloof/autoremove_restart_policy
Browse files Browse the repository at this point in the history
Don't apply restart_policy on `compose run`
  • Loading branch information
ndeloof authored Jun 21, 2021
2 parents 796d08d + 852aae0 commit 6bfdfa8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/compose/convergence.go
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,7 @@ func (s *composeService) startService(ctx context.Context, project *types.Projec
Filters: filters.NewArgs(
projectFilter(project.Name),
serviceFilter(service.Name),
oneOffFilter(false),
),
All: true,
})
Expand Down
4 changes: 4 additions & 0 deletions pkg/compose/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ func (s *composeService) RunOneOffContainer(ctx context.Context, project *types.
}
service.Scale = 1
service.StdinOpen = true
service.Restart = ""
if service.Deploy != nil {
service.Deploy.RestartPolicy = nil
}
service.Labels = service.Labels.Add(api.SlugLabel, slug)
service.Labels = service.Labels.Add(api.OneoffLabel, "True")

Expand Down

0 comments on commit 6bfdfa8

Please sign in to comment.