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

resource detection for 2nd gen of Cloud Functions works incorrectly #989

Closed
minherz opened this issue Jul 8, 2022 · 1 comment
Closed
Assignees
Labels
api: logging Issues related to the googleapis/java-logging API. lang: java Issues specific to Java. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@minherz
Copy link
Contributor

minherz commented Jul 8, 2022

The current version of the library (3.10.0) incorrect detects resource as Cloud Run when the code runs on the 2nd generation of the Cloud Functions.

The problem is that in 2nd generation the environment has full set of Cloud Run environment variables which does not happened when running 1st generation of the Cloud Functions. As a result, the code detects Cloud Run before it reaches to if that detects Cloud Functions.

@minherz minherz added type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. priority: p2 Moderately-important priority. Fix may not be included in next release. api: logging Issues related to the googleapis/java-logging API. lang: java Issues specific to Java. labels Jul 8, 2022
@minherz minherz self-assigned this Jul 8, 2022
@minherz
Copy link
Contributor Author

minherz commented Jul 8, 2022

A quick fix would be to enforce the order in detecting resource type by validating for Cloud Functions before Cloud Run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: logging Issues related to the googleapis/java-logging API. lang: java Issues specific to Java. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

2 participants