Skip to content

Commit

Permalink
targets: Include docker-apps when listing targets
Browse files Browse the repository at this point in the history
Signed-off-by: Andy Doan <[email protected]>
  • Loading branch information
doanac committed Sep 16, 2019
1 parent 3343b76 commit ba82fb1
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
13 changes: 9 additions & 4 deletions client/foundries.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,16 @@ type DeviceList struct {
Next *string `json:"next"`
}

type DockerApp struct {
FileName string `json:"filename"`
}

type TufCustom struct {
HardwareIds []string `json:"hardwareIds,omitempty"`
Tags []string `json:"tags,omitempty"`
TargetFormat string `json:"targetFormat,omitempty"`
Version string `json:"version,omitempty"`
HardwareIds []string `json:"hardwareIds,omitempty"`
Tags []string `json:"tags,omitempty"`
TargetFormat string `json:"targetFormat,omitempty"`
Version string `json:"version,omitempty"`
DockerApps map[string]DockerApp `json:"docker_apps,omitempty"`
}

func NewApiClient(serverUrl, apiToken string) *Api {
Expand Down
12 changes: 12 additions & 0 deletions cmd/targets_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,17 @@ func doTargetsList(cmd *cobra.Command, args []string) {
if len(custom.Tags) > 0 {
fmt.Printf("\ttags:%s\n", strings.Join(custom.Tags, ","))
}
if len(custom.DockerApps) > 0 {
fmt.Printf("\tdocker-apps:")
idx := 0
for name, app := range custom.DockerApps {
if idx > 0 {
fmt.Printf(",")
}
fmt.Printf("%s=%s", name, app.FileName)
idx += 1
}
fmt.Printf("\n")
}
}
}

0 comments on commit ba82fb1

Please sign in to comment.