-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Fix setting resources in fluentd-gcp plugin #55950
Fix setting resources in fluentd-gcp plugin #55950
Conversation
dd9096b
to
9da2d25
Compare
/approve no-issue I can't review until later. |
cluster/gce/gci/configure-helper.sh
Outdated
--containers=fluentd-gcp -o yaml > ${temp_fluentd_gcp_yaml}; then | ||
mv ${temp_fluentd_gcp_yaml} ${fluentd_gcp_yaml} | ||
else | ||
rm ${temp_fluentd_gcp_yaml} |
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.
Maybe keep this file for debugging purposes? Also, how about logging to stderr that setting fluentd resources failed?
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.
Maybe keep this file for debugging purposes?
I don't want to leave this file in the same directory, to avoid addon-manager picking it up accidentally
Also, how about logging to stderr that setting fluentd resources failed?
Makes sense, done
cluster/gce/gci/configure-helper.sh
Outdated
if [[ -n "${request_resources}" ]]; then | ||
request_resources="${request_resources}," | ||
fi | ||
request_resources="memory=${FLUENTD_GCP_MEMORY_LIMIT}" |
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.
Shouldn't this be REQUEST?
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.
Done, thanks
cluster/gce/gci/configure-helper.sh
Outdated
fi | ||
local request_resources="" | ||
if [[ -n "${FLUENTD_GCP_CPU_REQUEST:-}" ]]; then | ||
request_resources="cpu=${FLUENTD_GCP_MEMORY_LIMIT}" |
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.
FLUENTD_GCP_CPU_REQUEST?
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.
Done, thanks
9da2d25
to
375cef1
Compare
@x13n Thanks! PTAL |
fi | ||
request_resources="memory=${FLUENTD_GCP_MEMORY_REQUEST}" | ||
fi | ||
if [[ -n "${request_resources}" ]]; then |
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.
This will be always set to true, since this var is set in line 1951. Maybe use -z instead of -n? Same in similar condition above.
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.
No, [[ -n "" ]]
evaluates to false
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.
Hm, you're right :-)
cluster/gce/gci/configure-helper.sh
Outdated
--containers=fluentd-gcp -o yaml > ${temp_fluentd_gcp_yaml}; then | ||
mv ${temp_fluentd_gcp_yaml} ${fluentd_gcp_yaml} | ||
else | ||
echo "Failed to update fluentd resources" |
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.
Maybe add ">&2" to use stderr instead of stdout? Also, if the yaml file is going to be deleted, maybe just print its contents as well? It will be easier to figure out what went wrong if this fails.
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.
SG, thanks
Signed-off-by: Mik Vyatskov <vmik@google.com>
375cef1
to
e9322b9
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: crassirostris, mikedanese, x13n Associated issue requirement bypassed by: mikedanese The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
[MILESTONENOTIFIER] Milestone Pull Request Current @crassirostris @mikedanese @roberthbailey @x13n Note: This pull request is marked as Example update:
Pull Request Labels
|
Automatic merge from submit-queue (batch tested with PRs 56207, 55950). If you want to cherry-pick this change to another branch, please follow the instructions here. |
Currently if some of the variables are not set, scripts prints error, which is not critical, since the function is executed in a separate process, but it leads to the wrong resulting values
/cc @piosz @x13n
/assign @roberthbailey @mikedanese
Could you please approve?