Suppress successful autogrow PATCH response logs - #4537
Open
aymeric-ld wants to merge 1 commit into
Open
Conversation
Autogrow sidecar scripts patch Pod annotations using curl. Successful Kubernetes PATCH responses include the full Pod JSON, which curl writes to stdout by default. Since these scripts run in containers, that response is collected as sidecar logs and can repeat while volume expansion is pending. Discard successful response bodies while preserving curl error output. Apply the same behavior to Postgres instance and pgBackRest autogrow annotation scripts. Issue: CrunchyData#4391
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.
Checklist:
Type of Changes:
What is the current behavior (link to any open issues here)?
In some autogrow scenarios,
replication-cert-copycan generate a large amount of sidecar log output while a volume remains above the configured usage threshold. This was already raised in #4391.In the reported environment, two replicas generated roughly 2 GiB of logs per day while the volume remained above the autogrow threshold.
The generated
replication-cert-copyscript checks volume usage every five seconds and PATCHes the Pod annotation when autogrow should be triggered. A successful Pod PATCH returns the updated Pod JSON, andcurlwrites that response body to stdout by default. While expansion is pending or blocked, that full JSON response is logged repeatedly.While checking the reported path, I found the same successful-response logging pattern in the pgBackRest autogrow script, so this change updates both autogrow PATCH paths.
What is the new behavior (if this is a feature change)?
Successful autogrow PATCH response bodies are discarded with
--output /dev/null. Curl progress output is suppressed with--silent, while curl error output is preserved with--show-error.Autogrow behavior is unchanged: annotations are still patched, and operator events/status/PVC state remain the source of autogrow diagnostics.
This intentionally does not change the repeated PATCH behavior or autogrow decision logic. It only prevents successful Kubernetes API response bodies from being emitted to sidecar stdout.
No user-facing documentation was added because this removes unintended successful response output without changing user-facing configuration or behavior.
Other Information:
Tested with:
These tests cover the generated sidecar command strings, shellcheck validation for the generated scripts, and the affected golden Pod/StatefulSet output. That is the relevant validation for this change because the PR changes the generated
curlinvocation only; it does not change autogrow sizing or reconciliation logic.