kubecost / kubectl-cost

CLI for determining the cost of Kubernetes workloads
Apache License 2.0
872 stars 55 forks source link

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

Closed michaelmdresser closed 1 year ago

michaelmdresser commented 1 year ago

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

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