Skip to content

Conversation

@Sunnatillo
Copy link
Contributor

@Sunnatillo Sunnatillo commented Oct 14, 2025

This commit introduces DBG variable which is used to control including DWARF and symbol table for images/binaries

What this PR does / why we need it:
This PR removes DWARF and symbol table from binaries by default and introduces an option including them by setting DBG=1 .

Current images

kubeadm-control-plane-controller-amd64   97.4MB
kubeadm-bootstrap-controller-amd64      88.9MB
cluster-api-controller-amd64   		95.2MB

After removing DWARF and symbol table

kubeadm-control-plane-controller-amd64   67.7MB
kubeadm-bootstrap-controller-amd64      61.9MB
cluster-api-controller-amd64            66.3MB

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #
#12855

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Oct 14, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign enxebre for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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
Copy link
Contributor

This PR is currently missing an area label, which is used to identify the modified component when generating release notes.

Area labels can be added by org members by writing /area ${COMPONENT} in a comment

Please see the labels list for possible areas.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added the do-not-merge/needs-area PR is missing an area label label Oct 14, 2025
@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Oct 14, 2025
@Sunnatillo Sunnatillo force-pushed the Sunnatillo/decrease-image-size branch from 94918a9 to e8d6c73 Compare October 14, 2025 11:48
This commit introduces DBG variable which is used to control
including DWARF and symbol table for images/binaries
Signed-off-by: Sunnatillo <[email protected]>
@Sunnatillo Sunnatillo force-pushed the Sunnatillo/decrease-image-size branch from e8d6c73 to 4fbbc69 Compare October 14, 2025 11:53
add_ldflag "gitVersion" "${GIT_VERSION}"
add_ldflag "gitReleaseCommit" "${GIT_RELEASE_COMMIT}"

# The -ldflags parameter takes a single string, so join the output.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's check if that breaks using Tilt with the debugger. Probably not, but not entirely sure

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ldflags set in separate place for Tilt. it does not affect the tilt debugging.

build_cmd = "{build_env} go build {build_options} -gcflags '{gcflags}' -ldflags '{ldflags}' -o .tiltbuild/bin/{binary_name} {go_main}".format(

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also tested and working fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-area PR is missing an area label size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants