-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
roachprod: refactor gcp environment variable initialization #138711
Merged
craig
merged 1 commit into
cockroachdb:master
from
shailendra-patel:drtprod-initialization-fix
Jan 13, 2025
Merged
roachprod: refactor gcp environment variable initialization #138711
craig
merged 1 commit into
cockroachdb:master
from
shailendra-patel:drtprod-initialization-fix
Jan 13, 2025
Conversation
This file contains 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
Moved the initialization of default variables related to the GCP Project and DNS into the GCP provider Init function instead of initializing them during package initialization. Setting default variables as global variables caused issues when environment variables are modified before calling Init. Epic: none Release note: None
032f9ef
to
5fdced8
Compare
vidit-bhat
approved these changes
Jan 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
srosenberg
approved these changes
Jan 10, 2025
TFTR! bors r=vidit-bhat,srosenberg |
golgeek
added a commit
to golgeek/cockroach
that referenced
this pull request
Jan 13, 2025
This PR fixes a bug introduced in cockroachdb#138711 and also adds deletion of Prometheus targets at cluster wipe. Before cockroachdb#138711, the GCE provider defaults were defined during init(). This logic was moved to an init function to allow the `drtprod` command to define its own defaults via environment variables. This introduced a state in which where the promhelper client's defaults for `SupportedPromProject` is initialized with `gce.DefaultProject()` before this value is initialized, and no Prometheus targets are ever pushed. This PR removes the `promhelperclient.DefaultClient` that should not be used anymore, and computing the defaults in `NewPromClient()`. This PR also delegates the checks on whether or not providers and projects are supported to the promhelperclient package to simplify the logic in the callers. Also, prior to this PR, if an `insecure` cluster was reused as a `secure` cluster during a `roachtest` run, the promhelper client would delete the `secure` configuration during cluster destruction, but would leave the `insecure` configuration (as the promhelper clients tries to delete `secure` first, then `insecure` if not found). This was creating stale Prometheus targets. This PR introduces the deletion of the Prometheus targets at cluster wipe to fix this. Epic: none Release note: None Signed-off-by: Ludovic Leroux <[email protected]>
craig bot
pushed a commit
that referenced
this pull request
Jan 13, 2025
138960: roachprod: promhelper fix project and wipe r=srosenberg a=golgeek This PR fixes a bug introduced in #138711 and also adds deletion of Prometheus targets at cluster wipe. Before #138711, the GCE provider defaults were defined during init(). This logic was moved to an init function to allow the `drtprod` command to define its own defaults via environment variables. This introduced a state in which where the promhelper client's defaults for `SupportedPromProject` is initialized with `gce.DefaultProject()` before this value is initialized, and no Prometheus targets are ever pushed. This PR removes the `promhelperclient.DefaultClient` that should not be used anymore, and computing the defaults in `NewPromClient()`. This PR also delegates the checks on whether or not providers and projects are supported to the promhelperclient package to simplify the logic in the callers. Also, prior to this PR, if an `insecure` cluster was reused as a `secure` cluster during a `roachtest` run, the promhelper client would delete the `secure` configuration during cluster destruction, but would leave the `insecure` configuration (as the promhelper clients tries to delete `secure` first, then `insecure` if not found). This was creating stale Prometheus targets. This PR introduces the deletion of the Prometheus targets at cluster wipe to fix this. Epic: none Release note: None Co-authored-by: Ludovic Leroux <[email protected]>
blathers-crl bot
pushed a commit
that referenced
this pull request
Jan 13, 2025
This PR fixes a bug introduced in #138711 and also adds deletion of Prometheus targets at cluster wipe. Before #138711, the GCE provider defaults were defined during init(). This logic was moved to an init function to allow the `drtprod` command to define its own defaults via environment variables. This introduced a state in which where the promhelper client's defaults for `SupportedPromProject` is initialized with `gce.DefaultProject()` before this value is initialized, and no Prometheus targets are ever pushed. This PR removes the `promhelperclient.DefaultClient` that should not be used anymore, and computing the defaults in `NewPromClient()`. This PR also delegates the checks on whether or not providers and projects are supported to the promhelperclient package to simplify the logic in the callers. Also, prior to this PR, if an `insecure` cluster was reused as a `secure` cluster during a `roachtest` run, the promhelper client would delete the `secure` configuration during cluster destruction, but would leave the `insecure` configuration (as the promhelper clients tries to delete `secure` first, then `insecure` if not found). This was creating stale Prometheus targets. This PR introduces the deletion of the Prometheus targets at cluster wipe to fix this. Epic: none Release note: None Signed-off-by: Ludovic Leroux <[email protected]>
golgeek
added a commit
to golgeek/cockroach
that referenced
this pull request
Jan 13, 2025
This PR fixes a bug introduced in cockroachdb#138711 and also adds deletion of Prometheus targets at cluster wipe. Before cockroachdb#138711, the GCE provider defaults were defined during init(). This logic was moved to an init function to allow the `drtprod` command to define its own defaults via environment variables. This introduced a state in which where the promhelper client's defaults for `SupportedPromProject` is initialized with `gce.DefaultProject()` before this value is initialized, and no Prometheus targets are ever pushed. This PR removes the `promhelperclient.DefaultClient` that should not be used anymore, and computing the defaults in `NewPromClient()`. This PR also delegates the checks on whether or not providers and projects are supported to the promhelperclient package to simplify the logic in the callers. Also, prior to this PR, if an `insecure` cluster was reused as a `secure` cluster during a `roachtest` run, the promhelper client would delete the `secure` configuration during cluster destruction, but would leave the `insecure` configuration (as the promhelper clients tries to delete `secure` first, then `insecure` if not found). This was creating stale Prometheus targets. This PR introduces the deletion of the Prometheus targets at cluster wipe to fix this. Epic: none Release note: None ---- Release justification: test-only change Signed-off-by: Ludovic Leroux <[email protected]>
golgeek
added a commit
to golgeek/cockroach
that referenced
this pull request
Jan 13, 2025
This PR fixes a bug introduced in cockroachdb#138711 and also adds deletion of Prometheus targets at cluster wipe. Before cockroachdb#138711, the GCE provider defaults were defined during init(). This logic was moved to an init function to allow the `drtprod` command to define its own defaults via environment variables. This introduced a state in which where the promhelper client's defaults for `SupportedPromProject` is initialized with `gce.DefaultProject()` before this value is initialized, and no Prometheus targets are ever pushed. This PR removes the `promhelperclient.DefaultClient` that should not be used anymore, and computing the defaults in `NewPromClient()`. This PR also delegates the checks on whether or not providers and projects are supported to the promhelperclient package to simplify the logic in the callers. Also, prior to this PR, if an `insecure` cluster was reused as a `secure` cluster during a `roachtest` run, the promhelper client would delete the `secure` configuration during cluster destruction, but would leave the `insecure` configuration (as the promhelper clients tries to delete `secure` first, then `insecure` if not found). This was creating stale Prometheus targets. This PR introduces the deletion of the Prometheus targets at cluster wipe to fix this. Epic: none Release note: None ---- Release justification: test-only change Signed-off-by: Ludovic Leroux <[email protected]>
golgeek
added a commit
to golgeek/cockroach
that referenced
this pull request
Jan 13, 2025
This PR fixes a bug introduced in cockroachdb#138711 and also adds deletion of Prometheus targets at cluster wipe. Before cockroachdb#138711, the GCE provider defaults were defined during init(). This logic was moved to an init function to allow the `drtprod` command to define its own defaults via environment variables. This introduced a state in which where the promhelper client's defaults for `SupportedPromProject` is initialized with `gce.DefaultProject()` before this value is initialized, and no Prometheus targets are ever pushed. This PR removes the `promhelperclient.DefaultClient` that should not be used anymore, and computing the defaults in `NewPromClient()`. This PR also delegates the checks on whether or not providers and projects are supported to the promhelperclient package to simplify the logic in the callers. Also, prior to this PR, if an `insecure` cluster was reused as a `secure` cluster during a `roachtest` run, the promhelper client would delete the `secure` configuration during cluster destruction, but would leave the `insecure` configuration (as the promhelper clients tries to delete `secure` first, then `insecure` if not found). This was creating stale Prometheus targets. This PR introduces the deletion of the Prometheus targets at cluster wipe to fix this. Epic: none Release note: None ---- Release justification: test-only change Signed-off-by: Ludovic Leroux <[email protected]>
golgeek
added a commit
to golgeek/cockroach
that referenced
this pull request
Jan 13, 2025
This PR fixes a bug introduced in cockroachdb#138711 and also adds deletion of Prometheus targets at cluster wipe. Before cockroachdb#138711, the GCE provider defaults were defined during init(). This logic was moved to an init function to allow the `drtprod` command to define its own defaults via environment variables. This introduced a state in which where the promhelper client's defaults for `SupportedPromProject` is initialized with `gce.DefaultProject()` before this value is initialized, and no Prometheus targets are ever pushed. This PR removes the `promhelperclient.DefaultClient` that should not be used anymore, and computing the defaults in `NewPromClient()`. This PR also delegates the checks on whether or not providers and projects are supported to the promhelperclient package to simplify the logic in the callers. Also, prior to this PR, if an `insecure` cluster was reused as a `secure` cluster during a `roachtest` run, the promhelper client would delete the `secure` configuration during cluster destruction, but would leave the `insecure` configuration (as the promhelper clients tries to delete `secure` first, then `insecure` if not found). This was creating stale Prometheus targets. This PR introduces the deletion of the Prometheus targets at cluster wipe to fix this. Epic: none Release note: None ---- Release justification: test-only change Signed-off-by: Ludovic Leroux <[email protected]>
golgeek
added a commit
to golgeek/cockroach
that referenced
this pull request
Jan 14, 2025
This PR fixes a bug introduced in cockroachdb#138711 and also adds deletion of Prometheus targets at cluster wipe. Before cockroachdb#138711, the GCE provider defaults were defined during init(). This logic was moved to an init function to allow the `drtprod` command to define its own defaults via environment variables. This introduced a state in which where the promhelper client's defaults for `SupportedPromProject` is initialized with `gce.DefaultProject()` before this value is initialized, and no Prometheus targets are ever pushed. This PR removes the `promhelperclient.DefaultClient` that should not be used anymore, and computing the defaults in `NewPromClient()`. This PR also delegates the checks on whether or not providers and projects are supported to the promhelperclient package to simplify the logic in the callers. Also, prior to this PR, if an `insecure` cluster was reused as a `secure` cluster during a `roachtest` run, the promhelper client would delete the `secure` configuration during cluster destruction, but would leave the `insecure` configuration (as the promhelper clients tries to delete `secure` first, then `insecure` if not found). This was creating stale Prometheus targets. This PR introduces the deletion of the Prometheus targets at cluster wipe to fix this. Epic: none Release note: None --- Release justification: test-only change Signed-off-by: Ludovic Leroux <[email protected]>
InManuBytes
pushed a commit
to InManuBytes/cockroach
that referenced
this pull request
Jan 15, 2025
This PR fixes a bug introduced in cockroachdb#138711 and also adds deletion of Prometheus targets at cluster wipe. Before cockroachdb#138711, the GCE provider defaults were defined during init(). This logic was moved to an init function to allow the `drtprod` command to define its own defaults via environment variables. This introduced a state in which where the promhelper client's defaults for `SupportedPromProject` is initialized with `gce.DefaultProject()` before this value is initialized, and no Prometheus targets are ever pushed. This PR removes the `promhelperclient.DefaultClient` that should not be used anymore, and computing the defaults in `NewPromClient()`. This PR also delegates the checks on whether or not providers and projects are supported to the promhelperclient package to simplify the logic in the callers. Also, prior to this PR, if an `insecure` cluster was reused as a `secure` cluster during a `roachtest` run, the promhelper client would delete the `secure` configuration during cluster destruction, but would leave the `insecure` configuration (as the promhelper clients tries to delete `secure` first, then `insecure` if not found). This was creating stale Prometheus targets. This PR introduces the deletion of the Prometheus targets at cluster wipe to fix this. Epic: none Release note: None Signed-off-by: Ludovic Leroux <[email protected]>
mohini-crl
pushed a commit
to mohini-crl/cockroach
that referenced
this pull request
Jan 17, 2025
This PR fixes a bug introduced in cockroachdb#138711 and also adds deletion of Prometheus targets at cluster wipe. Before cockroachdb#138711, the GCE provider defaults were defined during init(). This logic was moved to an init function to allow the `drtprod` command to define its own defaults via environment variables. This introduced a state in which where the promhelper client's defaults for `SupportedPromProject` is initialized with `gce.DefaultProject()` before this value is initialized, and no Prometheus targets are ever pushed. This PR removes the `promhelperclient.DefaultClient` that should not be used anymore, and computing the defaults in `NewPromClient()`. This PR also delegates the checks on whether or not providers and projects are supported to the promhelperclient package to simplify the logic in the callers. Also, prior to this PR, if an `insecure` cluster was reused as a `secure` cluster during a `roachtest` run, the promhelper client would delete the `secure` configuration during cluster destruction, but would leave the `insecure` configuration (as the promhelper clients tries to delete `secure` first, then `insecure` if not found). This was creating stale Prometheus targets. This PR introduces the deletion of the Prometheus targets at cluster wipe to fix this. Epic: none Release note: None Signed-off-by: Ludovic Leroux <[email protected]>
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.
Moved the initialization of default variables related to the GCP Project and DNS into the GCP provider Init function instead of initializing them during package initialization. Setting default variables as global variables caused issues when environment variables are modified before calling Init.
Epic: none
Release note: None