Skip to content

Commit

Permalink
cmd/cycloid/catalog-repositories: refresh now returning ServiceCatalo…
Browse files Browse the repository at this point in the history
…gChanges
  • Loading branch information
sdurrheimer committed Feb 16, 2021
1 parent 0ec1328 commit de5cd51
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
11 changes: 5 additions & 6 deletions cmd/cycloid/catalog-repositories/refresh.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package catalogRepositories

import (
"fmt"
"time"

"github.com/cycloidio/cycloid-cli/cmd/cycloid/common"
"github.com/cycloidio/cycloid-cli/cmd/cycloid/middleware"
Expand Down Expand Up @@ -47,14 +46,14 @@ func refreshCatalogRepository(cmd *cobra.Command, args []string) error {
if err != nil {
return err
}
fmt.Printf("id: %d name: %s url: %s branch: %s credential_id: %d\n", *cr.ID, *cr.Name, *cr.URL, cr.Branch, cr.CredentialCanonical)
fmt.Printf("created_at: %v updated_at: %v\n", time.Unix(int64(*cr.CreatedAt), 0), time.Unix(int64(*cr.UpdatedAt), 0))
//fmt.Printf("id: %d name: %s url: %s branch: %s credential_id: %d\n", *cr.ID, *cr.Name, *cr.URL, cr.Branch, cr.CredentialCanonical)
//fmt.Printf("created_at: %v updated_at: %v\n", time.Unix(int64(*cr.CreatedAt), 0), time.Unix(int64(*cr.UpdatedAt), 0))

//TODO: Wait PR merged https://github.com/cycloidio/youdeploy-http-api/pull/2066
// output is not available yet
for stack := range cr.ServiceCatalogs {
_ = stack
}
//for stack := range cr.ServiceCatalogs {
// _ = stack
//}

fmt.Println(cr)
fmt.Printf("%+v\n", err)
Expand Down
2 changes: 1 addition & 1 deletion cmd/cycloid/middleware/catalog-repositories.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ func (m *middleware) UpdateCatalogRepository(org, catalogRepo string, name, url,
return d, err
}

func (m *middleware) RefreshCatalogRepository(org, catalogRepo string) (*models.ServiceCatalogSource, error) {
func (m *middleware) RefreshCatalogRepository(org, catalogRepo string) (*models.ServiceCatalogChanges, error) {

params := organization_service_catalog_sources.NewRefreshServiceCatalogSourceParams()
params.SetOrganizationCanonical(org)
Expand Down
2 changes: 1 addition & 1 deletion cmd/cycloid/middleware/middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ type Middleware interface {
DeleteCatalogRepository(org, catalogRepo string) error
GetCatalogRepository(org, catalogRepo string) (*models.ServiceCatalogSource, error)
ListCatalogRepositories(org string) ([]*models.ServiceCatalogSource, error)
RefreshCatalogRepository(org, catalogRepo string) (*models.ServiceCatalogSource, error)
RefreshCatalogRepository(org, catalogRepo string) (*models.ServiceCatalogChanges, error)
UpdateCatalogRepository(org, name, url, branch, catalogRepo, cred string) (*models.ServiceCatalogSource, error)

CreateConfigRepository(org, name, url, branch, cred string, setDefault bool) (*models.ConfigRepository, error)
Expand Down

0 comments on commit de5cd51

Please sign in to comment.