Skip to content

Commit

Permalink
Add external dependencies rewrite parameters for helm remote repos
Browse files Browse the repository at this point in the history
  • Loading branch information
fabianrindlisbacher authored and Fabian Rindlisbacher committed Nov 3, 2022
1 parent adc3175 commit a8d9ece
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion artifactory/services/remoterepository.go
Expand Up @@ -367,7 +367,9 @@ func NewGradleRemoteRepositoryParams() GradleRemoteRepositoryParams {

type HelmRemoteRepositoryParams struct {
RemoteRepositoryBaseParams
ChartsBaseUrl string `json:"chartsBaseUrl,omitempty"`
ChartsBaseUrl string `json:"chartsBaseUrl,omitempty"`
ExternalDependenciesEnabled bool `json:"externalDependenciesEnabled,omitempty"`
ExternalDependenciesPatterns []string `json:"externalDependenciesPatterns,omitempty"`
}

func NewHelmRemoteRepositoryParams() HelmRemoteRepositoryParams {
Expand Down
4 changes: 4 additions & 0 deletions tests/artifactoryremoterepository_test.go
Expand Up @@ -531,6 +531,8 @@ func remoteHelmTest(t *testing.T) {
hrp.Url = "https://storage.googleapis.com/kubernetes-charts"
setRemoteRepositoryBaseParams(&hrp.RemoteRepositoryBaseParams, false)
hrp.ChartsBaseUrl = "charts"
hrp.ExternalDependenciesEnabled = true
hrp.ExternalDependenciesPatterns = []string{"https://github.com/**"}

err := testsCreateRemoteRepositoryService.Helm(hrp)
if !assert.NoError(t, err, "Failed to create "+repoKey) {
Expand All @@ -543,6 +545,8 @@ func remoteHelmTest(t *testing.T) {

setRemoteRepositoryBaseParams(&hrp.RemoteRepositoryBaseParams, true)
hrp.ChartsBaseUrl = ""
hrp.ExternalDependenciesEnabled = false
hrp.ExternalDependenciesPatterns = []string{}

err = testsUpdateRemoteRepositoryService.Helm(hrp)
assert.NoError(t, err, "Failed to update "+repoKey)
Expand Down

0 comments on commit a8d9ece

Please sign in to comment.