Add ability to add environment variables to the collector container. …#4187
Merged
dsessler7 merged 1 commit intoMay 29, 2025
Merged
Conversation
benjaminjb
reviewed
May 28, 2025
benjaminjb
reviewed
May 28, 2025
benjaminjb
reviewed
May 29, 2025
| // EnvironmentVariables allows the user to add environment variables to the | ||
| // collector container. | ||
| // --- | ||
| // +kubebuilder:validation:MinItems=1 |
Contributor
There was a problem hiding this comment.
What does this CEL rule do for an optional field? Is it, like, if you put this field in, it can't be blank? (Have you tested with clusters that have and don't have any custom env vars?)
Collaborator
Author
There was a problem hiding this comment.
Exactly. If it's optional you can of course omit it, but if you do include it then there must be at least one item in the array.
Collaborator
Author
There was a problem hiding this comment.
I tried to add a UniqueItems validation as well, but it said that it increased the runtime complexity too much:
Error from server (Invalid): CustomResourceDefinition.apiextensions.k8s.io "postgresclusters.postgres-operator.crunchydata.com" is invalid: spec.validation.openAPIV3Schema.properties[spec].properties[instrumentation].properties[config].properties[environmentVariables].uniqueItems: Forbidden: uniqueItems cannot be set to true since the runtime complexity becomes quadratic
benjaminjb
approved these changes
May 29, 2025
…Allows users to authenticate exporters with major cloud providers.
f777fa2 to
0128cad
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…Allows users to authenticate exporters with major cloud providers.
Checklist:
Type of Changes:
What is the current behavior (link to any open issues here)?
User is unable to add environment variables to collector container.
What is the new behavior (if this is a feature change)?
User can now add environment variables to the collector container via the
instrumentationspec. This feature was added primarily to allow users to set cloud provider authentication variables, such asGOOGLE_APPLICATION_CREDENTIALS, so that the cloud specific exporters can authenticate.Other Information: