Skip to content
This repository has been archived by the owner on May 11, 2022. It is now read-only.

Commit

Permalink
sort deps and fixup engine dump
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilsk committed Sep 10, 2020
1 parent aae8921 commit 6d87578
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions sdk/paas/app.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package paas

import "sort"

// An Application contains configuration for a service.
type Application struct {
Specification `toml:",omitempty,squash"`
Expand All @@ -14,6 +16,7 @@ func (app *Application) Merge(apps ...Application) {

for _, src := range apps {
app.Specification.Merge(&(src.Specification))
sort.Sort(app.Specification.Dependencies)

if app.Envs == nil && len(src.Envs) > 0 {
app.Envs = make(map[string]*Specification)
Expand All @@ -23,6 +26,7 @@ func (app *Application) Merge(apps ...Application) {
app.Envs[env] = new(Specification)
}
app.Envs[env].Merge(spec)
sort.Sort(app.Envs[env].Dependencies)
}
}
}
6 changes: 3 additions & 3 deletions sdk/paas/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ package paas

// A Engine contains configuration for a service engine.
type Engine struct {
Name string `toml:"name"`
Version string `toml:"version"`
Size string `toml:"size"`
Name string `toml:"name,omitempty"`
Version string `toml:"version,omitempty"`
Size string `toml:"size,omitempty"`
Resources *Resources `toml:"resources,omitempty"`
}

Expand Down

0 comments on commit 6d87578

Please sign in to comment.