Search command return just the last property in case the property has more than one value
package generic
import (
- "github.com/jfrog/jfrog-cli-go/jfrog-cli/artifactory/utils"
"github.com/jfrog/jfrog-cli-go/jfrog-cli/artifactory/spec"
+ "github.com/jfrog/jfrog-cli-go/jfrog-cli/artifactory/utils"
"github.com/jfrog/jfrog-cli-go/jfrog-cli/utils/config"
clientutils "github.com/jfrog/jfrog-cli-go/jfrog-client/artifactory/services/utils"
"github.com/jfrog/jfrog-cli-go/jfrog-client/utils/log"
@@ -10,7 +10,7 @@ import (
type SearchResult struct {
Path string `json:"path,omitempty"`
- Props map[string]string `json:"props,omitempty"`
+ Props map[string][]string `json:"props,omitempty"`
}
func Search(searchSpec *spec.SpecFiles, artDetails *config.ArtifactoryDetails) ([]SearchResult, error) {
@@ -46,9 +46,9 @@ func aqlResultToSearchResult(aqlResult []clientutils.ResultItem) (result []Searc
} else {
tempResult.Path = v.Repo + "/" + v.Name
}
- tempResult.Props = make(map[string]string, len(v.Properties))
+ tempResult.Props = make(map[string][]string, len(v.Properties))
for _, prop := range v.Properties {
- tempResult.Props[prop.Key] = prop.Value
+ tempResult.Props[prop.Key] = append(tempResult.Props[prop.Key], prop.Value)
}
result[i] = *tempResult
}
