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

feat: CLI argument for custom registry URL was introduced #93

Merged
merged 2 commits into from
Oct 12, 2022
Merged

feat: CLI argument for custom registry URL was introduced #93

merged 2 commits into from
Oct 12, 2022

Conversation

misterku
Copy link
Contributor

@misterku misterku commented Oct 5, 2022

What does this do / why do we need it?

Sometimes it is necessary to override default terraform registry with other registry. This PR introduces new CLI argument to do it.

How this PR fixes the problem?

PR introduces argument custom-terraform-registry-url (or -u) which can override default terraform registry URL and use provided instead.

Check lists

  • Test passed
  • Coding style (indentation, etc)

Copy link
Contributor

@Junkern Junkern left a comment

Choose a reason for hiding this comment

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

Thanks a lot for the contribution and great idea!

I am not so happy about passing the custom-terraform-registry-url through all the different methods, though. IMHO it should be set as a new value in the app.Config. Default value should be the normal registry URL and when the flag is set, a new method setTerraformRegistryUrl is called which sets the app.Config.TerraformRegistryUrl to its new value. The getProviderData simply accesses app.Config.TerraformRegistryUrl

What do you think about that?

internal/app/install.go Outdated Show resolved Hide resolved
internal/app/install.go Outdated Show resolved Hide resolved
@coveralls
Copy link

coveralls commented Oct 11, 2022

Pull Request Test Coverage Report for Build 3230244250

  • 3 of 10 (30.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.7%) to 64.128%

Changes Missing Coverage Covered Lines Changed/Added Lines %
internal/app/app.go 1 4 25.0%
internal/app/install.go 2 6 33.33%
Totals Coverage Status
Change from base Build 3119110509: -0.7%
Covered Lines: 320
Relevant Lines: 499

💛 - Coveralls

@misterku
Copy link
Contributor Author

Thank you for the feedback. Yes, I agree that using app.Config would be better. I've updated the PR with changes based on your suggestions.

@misterku misterku requested a review from Junkern October 11, 2022 21:11
@Junkern Junkern merged commit 3759eb5 into kreuzwerker:main Oct 12, 2022
@misterku misterku deleted the add-custom-provider-url branch October 12, 2022 18:55
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.

3 participants