Added more CLI commands and API endpoints
This commit is contained in:
parent
1e2e96ccb5
commit
d9c65872e8
24 changed files with 901 additions and 116 deletions
|
|
@ -1,9 +1,11 @@
|
|||
package sql
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"garm/params"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
uuid "github.com/satori/go.uuid"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
|
|
@ -73,6 +75,18 @@ func (s *sqlDatabase) sqlToCommonPool(pool Pool) params.Pool {
|
|||
Instances: make([]params.Instance, len(pool.Instances)),
|
||||
}
|
||||
|
||||
if pool.RepoID != uuid.Nil {
|
||||
ret.RepoID = pool.RepoID.String()
|
||||
if pool.Repository.Owner != "" && pool.Repository.Name != "" {
|
||||
ret.RepoName = fmt.Sprintf("%s/%s", pool.Repository.Owner, pool.Repository.Name)
|
||||
}
|
||||
}
|
||||
|
||||
if pool.OrgID != uuid.Nil && pool.Organization.Name != "" {
|
||||
ret.OrgID = pool.OrgID.String()
|
||||
ret.OrgName = pool.Organization.Name
|
||||
}
|
||||
|
||||
for idx, val := range pool.Tags {
|
||||
ret.Tags[idx] = s.sqlToCommonTags(*val)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue