Skip to content

[pre-check] knative/func#3904 rebased (format scale annotations) - #266

Open
lkingland wants to merge 2 commits into
mainfrom
pr-3904-rebased
Open

lkingland wants to merge 2 commits into
mainfrom
pr-3904-rebased

Conversation

@lkingland

Copy link
Copy Markdown
Owner

Fork-internal pre-check of the rebased contributor branch for knative#3904 (author: @Elvand-Lie; authorship of the original commit preserved).

Purpose: run the full Actions suite on our fork before any force-push to the contributor's branch. Not for merge — close once the upstream push happens.

Tip: 47b58e5d5a8e

On top of the rebased contributor commit (%g), one commit of ours switches both Target and Utilization formatting to strconv.FormatFloat(v, 'f', -1, 64) so values stay decimal without trailing zeros or exponent form (100, 70.5, 1000000). Tests cover those cases. No other %f/%g autoscaling annotation formatting found in pkg/knative or pkg/k8s.

Elvand-Lie and others added 2 commits October 30, 2026 20:30
setServiceOptions used fmt.Sprintf(%%f, ...) to format autoscaling
Target and Utilization annotations, producing values like 100.000000
instead of 100. Knative autoscaler expects clean numeric strings.

Changed to %%g which strips trailing zeros (100.0 -> 100, 70.5 -> 70.5).

Also adds regression test TestSetServiceOptions_ScaleAnnotationFormat.

Fixes knative#3901
%f leaves trailing zeros ("100.000000"); %g switches to exponent form
at >= 1e6 ("1e+06"). FormatFloat with 'f' and prec -1 yields the clean
decimal Knative expects ("100", "70.5", "1000000").

Signed-off-by: Luke Kingland <luke@lukekingland.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants