Skip to content

Commit bd66664

Browse files
update artifactory store to use getKey (#1017)
* 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>
1 parent 59a666a commit bd66664

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

pkg/store/artifactory_store.go

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ func NewArtifactoryStore(options ArtifactoryStoreOptions) (Store, error) {
8989
SetOverallRequestTimeout(1 * time.Minute).
9090
SetHttpRetries(0).
9191
Build()
92-
9392
if err != nil {
9493
return nil, err
9594
}
@@ -112,15 +111,9 @@ func (s *ArtifactoryStore) getKey(stack string, component string, key string) (s
112111
return "", fmt.Errorf("stack delimiter is not set")
113112
}
114113

115-
stackParts := strings.Split(stack, *s.stackDelimiter)
116-
componentParts := strings.Split(component, "/")
117-
118-
parts := []string{s.repoName, s.prefix}
119-
parts = append(parts, stackParts...)
120-
parts = append(parts, componentParts...)
121-
parts = append(parts, key)
122-
123-
return strings.ReplaceAll(strings.Join(parts, "/"), "//", "/"), nil
114+
prefixParts := []string{s.repoName, s.prefix}
115+
prefix := strings.Join(prefixParts, "/")
116+
return getKey(prefix, *s.stackDelimiter, stack, component, key, "/")
124117
}
125118

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

0 commit comments

Comments
 (0)