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

terraform-providers: handle go modules #104667

Merged
merged 5 commits into from Dec 1, 2020

Conversation

zimbatm
Copy link
Member

@zimbatm zimbatm commented Nov 23, 2020

terraform-providers: handle go modules

More and more terraform providers are switching from vendored
dependencies to Go modules.

Let's say that you update the "aws" provider and it fails. You can run
it again with:

./update-provider aws --vendor

Any package that has the "vendorSha256" key will be considered as a go
module package.

The script now also supports adding new providers by using the
/ format. Eg:

 ./update-provider hetznercloud/hcloud --vendor
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@zimbatm
Copy link
Member Author

zimbatm commented Nov 23, 2020

Result of nixpkgs-review pr 104667 1

8 packages built:
  • terraform-full
  • terraform-providers.aws
  • terraform-providers.cloudfoundry
  • terraform-providers.hcloud
  • terraform-providers.keycloak
  • terraform-providers.linuxbox
  • terraform-providers.shell
  • terraform_0_11-full

@kalbasit
Copy link
Member

Duplicate of #103822

Copy link
Contributor

@timstott timstott left a comment

Choose a reason for hiding this comment

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

Some recommendations based on similar work I did 😉

More and more terraform providers are switching from vendored
dependencies to Go modules.

Let's say that you update the "aws" provider and it fails. You can run
it again with:

    ./update-provider aws --vendor

Any package that has the "vendorSha256" key will be considered as a go
module package.

The script now also supports adding new providers by using the
<owner>/<repo> format. Eg:

     ./update-provider hetznercloud/hcloud --vendor
@lblasc lblasc self-requested a review November 29, 2020 06:14
@zimbatm zimbatm merged commit 5851c31 into NixOS:master Dec 1, 2020
@zimbatm zimbatm deleted the terraform-providers-modules branch December 1, 2020 10:05
anandsuresh pushed a commit to anandsuresh/nixpkgs that referenced this pull request Jan 27, 2021
* terraform-providers: handle go modules

More and more terraform providers are switching from vendored
dependencies to Go modules.

Let's say that you update the "aws" provider and it fails. You can run
it again with:

    ./update-provider aws --vendor

Any package that has the "vendorSha256" key will be considered as a go
module package.

The script now also supports adding new providers by using the
<owner>/<repo> format. Eg:

     ./update-provider hetznercloud/hcloud --vendor

* address comment

Fixes NixOS#104667 (comment)

* support the null use-case

* escape provider name as well

* fix typo

(cherry picked from commit 5851c31)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants