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

Update end-to-end test server to implement resource detection scenario #396

Merged
merged 6 commits into from
May 20, 2022

Conversation

dashpole
Copy link
Contributor

@dashpole dashpole commented May 19, 2022

This PR:

  • Fixes the resource detection module name
  • Changes naming of resource detection functions to match semantic convention names
  • Adds a zone/region function for app engine
  • Falls-back to region when zone is not found (needed to pass resource detection tests).
  • Implements the detectResource scenario.

The e2e test below passes the resourceDetection scenario.

@dashpole dashpole force-pushed the resource_detection_test branch 2 times, most recently from 0138252 to d5bfdbf Compare May 19, 2022 16:29
@dashpole dashpole requested a review from aabmass May 19, 2022 16:54
@dashpole dashpole marked this pull request as ready for review May 19, 2022 16:54
@dashpole dashpole force-pushed the resource_detection_test branch 4 times, most recently from 25e3300 to 0be53ab Compare May 19, 2022 19:27
@dashpole
Copy link
Contributor Author

@aabmass where is "local" actually being run? It seems to be on GCP somewhere, as the metadata server is available, but it doesn't appear to be on GCE, since machine-type isn't being found as an attribute.

@aabmass
Copy link
Contributor

aabmass commented May 19, 2022

@aabmass where is "local" actually being run? It seems to be on GCP somewhere, as the metadata server is available, but it doesn't appear to be on GCE, since machine-type isn't being found as an attribute.

It just connects to the local docker daemon, so in CI it's running on Cloud Build. We are also setting the network so that the inner container can get ADC

See https://cloud.google.com/build/docs/build-config-file-schema#network.

@dashpole dashpole force-pushed the resource_detection_test branch 6 times, most recently from 55de392 to dfda8af Compare May 20, 2022 16:31
@dashpole
Copy link
Contributor Author

I ended up adding a function to detect when we are on GCE. That should help filter out other platforms (like cloud build) that we haven't implemented detection for.

@dashpole
Copy link
Contributor Author

All passing now!

e2e-test-server/endtoendserver/server.go Outdated Show resolved Hide resolved
@dashpole dashpole merged commit ce78357 into GoogleCloudPlatform:main May 20, 2022
@dashpole dashpole deleted the resource_detection_test branch May 20, 2022 20:01
This pull request was closed.
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.

2 participants