Sitelet https://github.com/kubernetes/kops/pull/18690
Skip to content

upup/pkg/fi: use literal method names for task dispatch - #18690

Merged
kubernetes-prow[bot] merged 1 commit into
kubernetes:masterfrom
hakman:fi-constant-method-names
Aug 14, 2026
Merged

kubernetes-prow[bot] merged 1 commit into
kubernetes:masterfrom
hakman:fi-constant-method-names

Conversation

@hakman

@hakman hakman commented Aug 14, 2026

Copy link
Copy Markdown
Member

The task engine dispatched Find, CheckChanges, ShouldCreate and the per-target Render* methods via reflect method enumeration and MethodByName with variable names. The compiler marks such call sites REFLECTMETHOD, which makes the linker keep every exported method of every reachable type.

Call MethodByName with string literals only: the compiler then emits R_USENAMEDMETHOD and the linker keeps just the named methods. Render dispatch probes a fixed list of renderer names; signature matching and renderer selection are unchanged. Remove reflectutils.InvokeMethod, whose string parameter reintroduced the non-constant lookup.

With no other REFLECTMETHOD symbols reachable, nodeup shrinks from 46.7 MB to 31.3 MB (linux/arm64, -trimpath, -s -w). kops and kops-controller still reach text/template and need separate fixes.

/cc @rifelpet @justinsb

The task engine dispatched Find, CheckChanges, ShouldCreate and the
per-target Render methods via reflect method enumeration and
MethodByName with variable names. The compiler marks such call sites
REFLECTMETHOD, which makes the linker keep every exported method of
every reachable type.

Call MethodByName with string literals only: the compiler then emits
R_USENAMEDMETHOD and the linker keeps just the named methods. Render
dispatch probes a fixed list of renderer names; signature matching and
renderer selection are unchanged. Remove reflectutils.InvokeMethod,
whose string parameter reintroduced the non-constant lookup.

With no other REFLECTMETHOD symbols reachable, nodeup shrinks from
46.7 MB to 31.3 MB (linux/arm64, -trimpath, -s -w). kops and
kops-controller still reach text/template and need separate fixes.
@kubernetes-prow
kubernetes-prow Bot requested review from justinsb and rifelpet August 14, 2026 11:59
@kubernetes-prow kubernetes-prow Bot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 14, 2026
@hakman

hakman commented Aug 14, 2026

Copy link
Copy Markdown
Member Author

/retest

@kubernetes-prow kubernetes-prow Bot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 14, 2026
@kubernetes-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rifelpet

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

The pull request process is described here

Details 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

@kubernetes-prow kubernetes-prow Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 14, 2026
@kubernetes-prow
kubernetes-prow Bot merged commit 1f17295 into kubernetes:master Aug 14, 2026
26 checks passed
@hakman
hakman deleted the fi-constant-method-names branch August 14, 2026 17:37
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants