Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add external dependencies fields to helm remote #263

Merged
merged 6 commits into from
Jan 10, 2022

Conversation

tenstad
Copy link
Contributor

@tenstad tenstad commented Jan 10, 2022

Closes #259

Tested with Artifactory 7.27.3

@github-actions
Copy link

github-actions bot commented Jan 10, 2022

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@tenstad tenstad force-pushed the helm-remote-external-dependencies branch from 97b87b9 to 8e55e8c Compare January 10, 2022 14:00
@tenstad
Copy link
Contributor Author

tenstad commented Jan 10, 2022

I have read the CLA Document and I hereby sign the CLA

@tenstad tenstad force-pushed the helm-remote-external-dependencies branch from 8e55e8c to e38cb7d Compare January 10, 2022 14:04
chb0github
chb0github previously approved these changes Jan 10, 2022
Copy link
Contributor

@chb0github chb0github left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Has my approval! Thanks for the PR

},
RequiredWith: []string{"external_dependencies_enabled"},
Description: "An Allow List of Ant-style path expressions that specify where external dependencies may be downloaded from. " +
"By default, this is set to ** which means that dependencies may be downloaded from any external source.",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we be explicit about the default here with Default: "**",?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we be explicit about the default here with Default: "**",?
I think so.

Copy link
Contributor Author

@tenstad tenstad Jan 10, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure how to add a default for a list, tried Default: []string{"**"},.

1 error occurred:
* resource artifactory_remote_helm_repository: external_dependencies_patterns: Default is not valid for lists or sets

hashicorp/terraform-plugin-sdk#142

Copy link
Member

@alexhung alexhung Jan 10, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks TF!

Artifactory schema documentation has no default value for externalDependenciesPatterns so is "**" the implicit default behavior from the API?

@tenstad tenstad force-pushed the helm-remote-external-dependencies branch from 8593e41 to 8e5e682 Compare January 10, 2022 18:45
alexhung
alexhung previously approved these changes Jan 10, 2022
Copy link
Member

@alexhung alexhung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@alexhung alexhung requested a review from chb0github January 10, 2022 18:54
@tenstad
Copy link
Contributor Author

tenstad commented Jan 10, 2022

Thanks for the quick review @alexhung @chb0github!

Made a final adjustment, so that the example pattern is equal to the one in https://www.jfrog.com/confluence/display/JFROG/Kubernetes+Helm+Chart+Repositories

@tenstad tenstad requested a review from alexhung January 10, 2022 19:06
Copy link
Member

@alexhung alexhung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the exception on the default value for externalDependenciesPatterns, this PR is good to go for me.

Since TF doesn't allow default value to be set for TypeList or TypeSet, the only question I have is why ** is mentioned in the original description. This suggests either an implicit behavior of Artifactory (or the API), or a mistake in the description.

@alexhung
Copy link
Member

Having said that, I just read the doc and it clearly states the ** default.

@alexhung alexhung merged commit 7272931 into jfrog:master Jan 10, 2022
@tenstad
Copy link
Contributor Author

tenstad commented Jan 10, 2022

I have been using https://github.com/tenstad/terraform-provider-artifactory/blob/tenstad/pkg/artifactory/resource_artifactory_remote_repository.go#L210-L215 for a while and checked my Artifactory insance. Found a lot of helm remotes with externalDependenciesPatterns: ["**"], where no value is configured in terraform.

When I now added a new helm remote with terraform (with the provider linked above), it got externalDependenciesPatterns: []. I think the default has been changed from ["**"] to [] in a semi-recent Artifactory release. However, when adding a remote helm repo in GUI, the default is still ["**"].

@alexhung should we update the description, and remove By default, this is set to ** which means that dependencies may be downloaded from any external source.?

Sorry for not discovering this earlier, I have been used to the ["**"] default, and as you say, the documentation also says so.

@alexhung
Copy link
Member

alexhung commented Jan 12, 2022

@tenstad I can confirm the API defaults the externalDependenciesPatterns attribute to []. So let's update the attribute description (in separate PR) to mention this discrepancy between the UI and API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add external_dependencies_patterns to artifactory_remote_helm_repository
3 participants