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

fix: remove newlines from VPA recommendations #7575

Merged
merged 2 commits into from
Dec 6, 2024

Conversation

omerap12
Copy link
Member

@omerap12 omerap12 commented Dec 6, 2024

What type of PR is this?

/kind bug

What this PR does / why we need it:

Originally reported by @adrianmoisey, this PR fixes a logging issue in the VPA updater where multi-line log entries were causing structured log output to be split and harder to read. When logging pod recommendations, newline characters were causing the output to span multiple lines:

"Pod accepted for update" pod="vertical-pod-autoscaling-7847/hamster-795f8c8794-7p52p" updatePriority=1.3449756180899484 processedRecommendations=
hamster: target: 587805k 247m; uncappedTarget: 587805k 247m;
>

The fix modifies the recommendation formatting to keep everything on a single line for better readability:

"Pod accepted for update" pod="vertical-pod-autoscaling-7847/hamster-795f8c8794-7p52p" updatePriority=1.3449756180899484 processedRecommendations="hamster: target: 587805k 247m; uncappedTarget: 587805k 247m;"

Additional tests were added to verify the logging format for single and multiple container scenarios.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?

NONE

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

NONE

Signed-off-by: Omer Aplatony <omerap12@gmail.com>
@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. area/vertical-pod-autoscaler labels Dec 6, 2024
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Dec 6, 2024
Signed-off-by: Omer Aplatony <omerap12@gmail.com>
@adrianmoisey
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 6, 2024
@raywainman
Copy link
Contributor

/lgtm

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: omerap12, raywainman

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 6, 2024
@k8s-ci-robot k8s-ci-robot merged commit a994301 into kubernetes:master Dec 6, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/vertical-pod-autoscaler cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants