Skip to content

Commit

Permalink
fix function name
Browse files Browse the repository at this point in the history
Co-authored-by: Pugma <132571355+Pugma@users.noreply.github.com>
  • Loading branch information
pirosiki197 and Pugma committed Jan 14, 2025
1 parent 0e69d85 commit 5340ecf
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pkg/infrastructure/backend/dockerimpl/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,12 +181,12 @@ func (b *Backend) containerLabels(app *domain.Application) map[string]string {
appLabel: "true",
appIDLabel: app.ID,
appRestartedAtLabel: app.UpdatedAt.Format(time.RFC3339Nano),
"sablier.enable": lo.Ternary(b.useSablierMiddleware(app), "true", "false"),
"sablier.enable": lo.Ternary(b.useSablier(app), "true", "false"),
"sablier.group": sablierGroupName(app.ID),
})
}

func (b *Backend) useSablierMiddleware(app *domain.Application) bool {
func (b *Backend) useSablier(app *domain.Application) bool {
return b.config.Middleware.Sablier.Enable &&
app.DeployType == domain.DeployTypeRuntime &&
app.Config.BuildConfig.GetRuntimeConfig().AutoShutdown.Enabled
Expand Down
2 changes: 1 addition & 1 deletion pkg/infrastructure/backend/dockerimpl/ingress.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func (b *Backend) routerBase(app *domain.Application, website *domain.Website, s
log.Warnf("auth config not available for %s", website.FQDN)
}

if b.useSablierMiddleware(app) {
if b.useSablier(app) {
middlewareName := sablierMiddlewareName(app)
middlewareNames = append(middlewareNames, middlewareName)
middlewares[middlewareName] = b.sablierMiddleware(app)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func (b *Backend) syncAppContainer(ctx context.Context, app *domain.RuntimeDesir
RestartPolicy: container.RestartPolicy{
Name: "on-failure",
// sablier stops the container, so we don't need to restart it
MaximumRetryCount: lo.Ternary(b.useSablierMiddleware(app.App), 0, 5),
MaximumRetryCount: lo.Ternary(b.useSablier(app.App), 0, 5),
},
}
for _, p := range app.App.PortPublications {
Expand Down

0 comments on commit 5340ecf

Please sign in to comment.