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

adding in IAP Tunnel API to the beta provider #1719

Conversation

reechar-goog
Copy link
Contributor

This is an implementation for the google-beta terraform provider. This adds in a new beta API (https://godoc.org/google.golang.org/api/iap/v1beta1). It isn't a full implementation of the full API, but it does add support for this feature/workflow: https://cloud.google.com/iap/docs/using-tcp-forwarding.

This addresses this open issue: hashicorp/terraform-provider-google#2916


[all]

[terraform]

[terraform-beta]

[ansible]

[inspec]

@modular-magician
Copy link
Collaborator

Hello! I am a robot who works on Magic Modules PRs.

I have detected that you are a community contributor, so your PR will be assigned to someone with a commit-bit on this repo for initial review. They will authorize it to run through our CI pipeline, which will generate downstream PRs.

Thanks for your contribution! A human will be with you soon.

@reechar-goog reechar-goog changed the title adding in IAP Tunnnel API to the beta provider adding in IAP Tunnel API to the beta provider May 6, 2019
@reechar-goog
Copy link
Contributor Author

@rileykarson any updates/can I get a reviewer?

@rileykarson rileykarson self-requested a review May 6, 2019 21:31
@rileykarson
Copy link
Member

Ah yup, I was just about to start taking a look.

Copy link
Member

@rileykarson rileykarson left a comment

Choose a reason for hiding this comment

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

Generally looking good! Left some comments inline- mainly, I'm curious why we're using the project # and I think a lot of scaffolding in the tests can be eliminated.

third_party/terraform/utils/config.go.erb Outdated Show resolved Hide resolved
third_party/terraform/utils/provider.go.erb Show resolved Hide resolved
third_party/terraform/utils/iam_iap_tunnel.go.erb Outdated Show resolved Hide resolved
third_party/terraform/utils/iam_iap_tunnel.go.erb Outdated Show resolved Hide resolved
third_party/terraform/utils/iam_iap_tunnel.go.erb Outdated Show resolved Hide resolved
@reechar-goog
Copy link
Contributor Author

Generally looking good! Left some comments inline- mainly, I'm curious why we're using the project # and I think a lot of scaffolding in the tests can be eliminated.

Working around the project number was a pain. This is due to the IAP API doing things inconsistent with the rest of the google cloud APIs. Check out this page, and flip the toggle from console to API: https://cloud.google.com/iap/docs/using-tcp-forwarding#ssh_tunneling

Specifically: You'll see the API path is:
export PROJECT_NUM=PROJECT_NUMBER
export IAP_BASE_URL=https://iap.googleapis.com/v1beta1/projects/${PROJECT_NUMBER}/iap_tunnel

Copy link
Member

@rileykarson rileykarson left a comment

Choose a reason for hiding this comment

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

Generally looks good- some spacing got changed, so ideally we'll preserve the old tab indentation & we need to add docs similar to hashicorp/terraform-provider-google#3551

third_party/terraform/utils/config.go.erb Outdated Show resolved Hide resolved
third_party/terraform/utils/provider.go.erb Outdated Show resolved Hide resolved
@reechar-goog
Copy link
Contributor Author

@rileykarson is there a linter or some sort pre flight/commit script that the team uses?

@rileykarson
Copy link
Member

We lint the provider, but have no linting MM-side. If you generate into a provider repo locally and then run make lint (make tools will install dependencies if necessary) it will run a few checks.

@rileykarson
Copy link
Member

Ah- the tests during generation are failing because we need to update the dependencies in the beta repo. Sorry about that! We just had to remove the automatic vendoring behaviour because it slowed down builds by a lot. What you'll need to do is;

  • Check out master in terraform-provider-google-beta
  • git checkout -b update-vendor
  • Generate into the provider using your branch, and commit the result.
  • GO111MODULE=on go mod tidy && go mod vendor
  • Commit the result.
  • Rebase away the first commit, so we only apply the new vendoring changes.
  • Submit the update-vendor branch as a PR to the beta repo

Go Module vendoring behaviour requires us to have code actually using the dependency present to vendor the code necessary, and since we're making changes in two parts we need to trick it by generating locally and only staging the vendor changes.

@reechar-goog
Copy link
Contributor Author

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician, I work on Magic Modules.
This PR seems not to have generated downstream PRs before, as of 068b088523235407ed5018bc0a2eee8a622c8b6e.

Pull request statuses

No diff detected in Ansible.
No diff detected in Inspec.

New Pull Requests

I built this PR into one or more new PRs on other repositories, and when those are closed, this PR will also be merged and closed.
depends: hashicorp/terraform-provider-google-beta#687
depends: GoogleCloudPlatform/terraform-google-conversion#74
depends: hashicorp/terraform-provider-google#3593

Copy link
Member

@rileykarson rileykarson left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution @reechar-goog!

@rileykarson
Copy link
Member

Ah, looks like our merge script hit a speed bump during the merge step; it performs a rebase followed by a squash, so sometimes it gets unhappy with interim commits and I think the spacing changes are conflicting with #1740.

Do you mind squashing the changes into a single commit, and rebasing off master? git pull --rebase origin master should work, assuming this repo is origin for you.

(If you're uncomfortable with rebasing, just let me know and I can perform it instead.)

@reechar-goog reechar-goog force-pushed the feature/iap-tunnel-beta branch from 068b088 to 6c4f479 Compare May 8, 2019 21:49
@reechar-goog
Copy link
Contributor Author

there seemed to be some funny merging during the rebasing. But I did squash all the commits down, hopefully the force push doesn't make things too angry.

@rileykarson
Copy link
Member

Rebase + force-pushing (to feature branches exclusively!) is generally our practice on the MM repo, merges are actually generally the ones that make it angry.

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician, I work on Magic Modules.
I see that this PR has already had some downstream PRs generated. Any open downstreams are already updated to your most recent commit, 6c4f479.

Pull request statuses

No diff detected in Ansible.
No diff detected in Inspec.

New Pull Requests

I built this PR into one or more new PRs on other repositories, and when those are closed, this PR will also be merged and closed.
depends: hashicorp/terraform-provider-google-beta#693
depends: GoogleCloudPlatform/terraform-google-conversion#76
depends: hashicorp/terraform-provider-google#3599

@rileykarson
Copy link
Member

All of those are spurious downstreams and can be ignored; it looks like we hit 2 different PRs whose patches were applied and then the MM PR merged at once.

Tracked submodules are build/terraform-beta build/terraform-mapper build/terraform build/ansible build/inspec.
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.

4 participants