diff --git a/cmd/images-list.go b/cmd/images-list.go index f61a31d..d8ec816 100644 --- a/cmd/images-list.go +++ b/cmd/images-list.go @@ -10,8 +10,9 @@ import ( type ImagesListOutput []ImagesListOutput_Item type ImagesListOutput_Item struct { - Source string `json:"source"` - Name string `json:"name"` + Source string `json:"source"` + Name string `json:"name"` + SourcePath string `json:"source-path"` } var imagesListCmd = &cobra.Command{ @@ -34,14 +35,19 @@ var imagesListCmd = &cobra.Command{ if !outputJson { fmt.Printf("Images:\n") for _, image := range images { - fmt.Printf(" %s [Source: %s]\n", image.Name, image.Source) + if image.SourcePath != "" { + fmt.Printf(" %s [Source: %s, Source Path: %s]\n", image.Name, image.Source, image.SourcePath) + } else { + fmt.Printf(" %s [Source: %s]\n", image.Name, image.Source) + } } } else { var out ImagesListOutput for _, image := range images { out = append(out, ImagesListOutput_Item{ - Source: image.Source, - Name: image.Name, + Source: image.Source, + Name: image.Name, + SourcePath: image.SourcePath, }) } helper.OutputJson(out) diff --git a/cmd/images-search.go b/cmd/images-search.go index 3066f4e..1da7293 100644 --- a/cmd/images-search.go +++ b/cmd/images-search.go @@ -13,8 +13,9 @@ import ( type ImagesSearchOutput []ImagesSearchOutput_Item type ImagesSearchOutput_Item struct { - Source string `json:"source"` - Name string `json:"name"` + Source string `json:"source"` + Name string `json:"name"` + SourcePath string `json:"source-path"` } var imagesSearchCmd = &cobra.Command{ @@ -61,7 +62,11 @@ var imagesSearchCmd = &cobra.Command{ break } - fmt.Printf(" %s [Source: %s]\n", image.Name, image.Source) + if image.SourcePath != "" { + fmt.Printf(" %s [Source: %s, Source Path: %s]\n", image.Name, image.Source, image.SourcePath) + } else { + fmt.Printf(" %s [Source: %s]\n", image.Name, image.Source) + } } } else { var out ImagesSearchOutput @@ -71,8 +76,9 @@ var imagesSearchCmd = &cobra.Command{ } out = append(out, ImagesSearchOutput_Item{ - Source: image.Source, - Name: image.Name, + Source: image.Source, + Name: image.Name, + SourcePath: image.SourcePath, }) } helper.OutputJson(out) diff --git a/deployment/deployer.go b/deployment/deployer.go index 195ccd7..c97bc1b 100644 --- a/deployment/deployer.go +++ b/deployment/deployer.go @@ -63,8 +63,9 @@ type CollectionInfo struct { } type Image struct { - Source string - Name string + Source string + Name string + SourcePath string } type BlockNodeTrafficType string diff --git a/deployment/dockerdeploy/dockerhubimageprovider.go b/deployment/dockerdeploy/dockerhubimageprovider.go index ed7d447..593376d 100644 --- a/deployment/dockerdeploy/dockerhubimageprovider.go +++ b/deployment/dockerdeploy/dockerhubimageprovider.go @@ -65,8 +65,9 @@ func (p *DockerHubImageProvider) ListImages(ctx context.Context) ([]deployment.I versionName := tagParts[1] images = append(images, deployment.Image{ - Source: "dockerhub", - Name: versionName, + Source: "dockerhub", + Name: versionName, + SourcePath: fmt.Sprintf("couchbase:%s", versionName), }) } } @@ -111,8 +112,9 @@ func (p *DockerHubImageProvider) SearchImages(ctx context.Context, version strin } images = append(images, deployment.Image{ - Source: "dockerhub", - Name: versionName, + Source: "dockerhub", + Name: versionName, + SourcePath: fmt.Sprintf("couchbase:%s", versionName), }) } diff --git a/deployment/dockerdeploy/ghcrimageprovider.go b/deployment/dockerdeploy/ghcrimageprovider.go index 1ac3838..466dc5c 100644 --- a/deployment/dockerdeploy/ghcrimageprovider.go +++ b/deployment/dockerdeploy/ghcrimageprovider.go @@ -98,8 +98,9 @@ func (p *GhcrImageProvider) ListImages(ctx context.Context) ([]deployment.Image, } images = append(images, deployment.Image{ - Source: "ghcr", - Name: versionName, + Source: "ghcr", + Name: versionName, + SourcePath: fmt.Sprintf("ghcr.io/cb-vanilla/server:%s", versionName), }) } } @@ -140,8 +141,9 @@ func (p *GhcrImageProvider) SearchImages(ctx context.Context, version string) ([ } images = append(images, deployment.Image{ - Source: "ghcr", - Name: versionName, + Source: "ghcr", + Name: versionName, + SourcePath: fmt.Sprintf("ghcr.io/cb-vanilla/server:%s", versionName), }) }