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 dependency on service enablement. #387

Merged
merged 5 commits into from
Mar 4, 2020

Conversation

mattcary
Copy link
Contributor

@mattcary mattcary commented Mar 2, 2020

Adds a dependency on project services to the output project id and
number. This prevents a race for using a robot account based on the
project id or number, as the robot accounts can be created only when
the service enabling is finished.

Fixes #386

Adds a dependency on project services to the output project id and
number.  This prevents a race for using a robot account based on the
project id or number, as the robot accounts can be created only when
the service enabling is finished.
@mattcary
Copy link
Contributor Author

mattcary commented Mar 2, 2020

Fixes #386

@mattcary
Copy link
Contributor Author

mattcary commented Mar 2, 2020

I've run make docker_test_integration manually and everything was ok (except for the destroy step).

Copy link
Contributor

@morgante morgante left a comment

Choose a reason for hiding this comment

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

Looks good! Just need to format (so make docker_test_lint doesn't complain):

-  depends_on = [ module.project_services ]
+  depends_on = [module.project_services]
 }
 
 output "project_number" {
-  value = google_project.main.number
-  depends_on = [ module.project_services ]
+  value      = google_project.main.number
+  depends_on = [module.project_services]
 }

@mattcary
Copy link
Contributor Author

mattcary commented Mar 2, 2020

Thanks, done.

Should I try to add anything to testing? It looks like the full test fixture already enables the container services and mucks about with service accounts, so I could just add a project iam binding there.

But I'm not sure if you want to keep the tests more focused or whatever.

@morgante
Copy link
Contributor

morgante commented Mar 2, 2020

Adding an additional IAM grant to the full fixture should be sufficient (and adding a test that verify it was granted).

@mattcary
Copy link
Contributor Author

mattcary commented Mar 2, 2020

Super. I'll do that and ping here when finished.

@mattcary
Copy link
Contributor Author

mattcary commented Mar 3, 2020

As discussed offline, I couldn't add tests to the full fixture as it isn't working. I added them to minimal instead (making it somewhat less minimal, but oh well...).

LMK if this isn't what you had in mind.

Thanks!

Copy link
Contributor

@morgante morgante left a comment

Choose a reason for hiding this comment

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

Thanks! This approach looks fine, please just run make generate_docs to regenerate docs and make Cloud Build stop complaining.

@mattcary
Copy link
Contributor Author

mattcary commented Mar 3, 2020

Done, thanks.

I can't see the cloud build output or errors, digging into the details I don't have a cloudbuild.builds.get permission. Is there something to be added to, or are there any other errors in the build?

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.

Race condition with adding bindings to GKE robot on new project
2 participants