Skip to content

Commit

Permalink
better default description
Browse files Browse the repository at this point in the history
  • Loading branch information
jack-r-warren committed Jul 17, 2024
1 parent a8c7900 commit b088660
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions sherlock/internal/models/environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,11 +315,12 @@ func (e *Environment) setCreationDefaults(tx *gorm.DB) error {
}

if e.EnableJanitor == nil {
// BEEs may have been filled from templates already, but if not we default here
if e.Lifecycle == "dynamic" || e.Lifecycle == "template" {
e.EnableJanitor = utils.PointerTo(true)
} else {
// Yes there's a DB-level default but we don't want to rely on that for business logic
if e.Lifecycle == "static" {
e.EnableJanitor = utils.PointerTo(false)
} else {
// Templates, BEEs if somehow we missed them above
e.EnableJanitor = utils.PointerTo(true)
}
}

Expand Down

0 comments on commit b088660

Please sign in to comment.