Skip to content

Commit

Permalink
Fix ListSchedulerLocks function
Browse files Browse the repository at this point in the history
  • Loading branch information
Luiz Felipe Takakura committed Aug 19, 2019
1 parent 0ac6bad commit d11276e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions models/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,17 @@ func (c *Scheduler) Load(db interfaces.DB) error {
return err
}

// LoadWithVersionStatus loads a scheduler from the database using the scheduler name
// and also loads its RollingUpdateStatus
func (c *Scheduler) LoadWithVersionStatus(db interfaces.DB) error {
_, err := db.Query(c, "SELECT * FROM schedulers WHERE name = ?", c.Name)
if c.Version == "" {
c.Version = "v1.0"
}
_, err = db.Query(c, "SELECT rolling_update_status FROM scheduler_versions WHERE name = ? AND version = ?", c.Name, c.Version)
return err
}

// LoadSchedulers loads a slice of schedulers from database by names
func LoadSchedulers(db interfaces.DB, names []string) ([]Scheduler, error) {
var schedulers []Scheduler
Expand Down

0 comments on commit d11276e

Please sign in to comment.