Skip to content

Commit

Permalink
update artifactory store to use getKey (#1017)
Browse files Browse the repository at this point in the history
* update artifactory store to use getKey

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
  • Loading branch information
mcalhoun and autofix-ci[bot] authored Feb 4, 2025
1 parent 59a666a commit bd66664
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions pkg/store/artifactory_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ func NewArtifactoryStore(options ArtifactoryStoreOptions) (Store, error) {
SetOverallRequestTimeout(1 * time.Minute).
SetHttpRetries(0).
Build()

if err != nil {
return nil, err
}
Expand All @@ -112,15 +111,9 @@ func (s *ArtifactoryStore) getKey(stack string, component string, key string) (s
return "", fmt.Errorf("stack delimiter is not set")
}

stackParts := strings.Split(stack, *s.stackDelimiter)
componentParts := strings.Split(component, "/")

parts := []string{s.repoName, s.prefix}
parts = append(parts, stackParts...)
parts = append(parts, componentParts...)
parts = append(parts, key)

return strings.ReplaceAll(strings.Join(parts, "/"), "//", "/"), nil
prefixParts := []string{s.repoName, s.prefix}
prefix := strings.Join(prefixParts, "/")
return getKey(prefix, *s.stackDelimiter, stack, component, key, "/")
}

func (s *ArtifactoryStore) Get(stack string, component string, key string) (interface{}, error) {
Expand Down

0 comments on commit bd66664

Please sign in to comment.