Skip to content

Conversation

@michaelmdresser
Copy link
Contributor

How does this PR impact users? (This is the kind of thing that goes in release notes!)

  • Fix kubectl-cost crashing on systems without glibc by disabling CGO for all builds

Links to Issues or ZD tickets this PR addresses or fixes

How was this PR tested?

Before

→ make build      
cd cmd/kubectl-cost && govvv build

→ ldd cmd/kubectl-cost/kubectl-cost 
	linux-vdso.so.1 (0x00007fff9ada9000)
	libresolv.so.2 => /usr/lib/libresolv.so.2 (0x00007fc0aa7a5000)
	libc.so.6 => /usr/lib/libc.so.6 (0x00007fc0aa5be000)
	/lib64/ld-linux-x86-64.so.2 => /usr/lib64/ld-linux-x86-64.so.2 (0x00007fc0aa7cb000)

After

→ make build
cd cmd/kubectl-cost && CGO_ENABLED=0 govvv build

→ ldd cmd/kubectl-cost/kubectl-cost
	not a dynamic executable

This fixes an issue where kubectl-cost would fail to run on systems
without the glibc C runtime.

Signed-off-by: Michael Dresser <[email protected]>
@michaelmdresser michaelmdresser merged commit 218bf80 into main Mar 16, 2023
@michaelmdresser michaelmdresser deleted the mmd/disable-cgo branch March 16, 2023 23:00
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.

Error: GLIBC not found

2 participants