commit:     a8f27fb47af5420070b018e4cac9bbe402b27aeb
Author:     James Le Cuirot <chewi <AT> gentoo <DOT> org>
AuthorDate: Sun Feb  8 10:37:38 2026 +0000
Commit:     William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Fri Feb 13 17:27:50 2026 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a8f27fb4

sys-cluster/kube-controller-manager: Fix cross-compiling, add shell completion

Closes: https://github.com/gentoo/gentoo/pull/45684

Signed-off-by: James Le Cuirot <chewi <AT> gentoo.org>
Signed-off-by: William Hubbs <williamh <AT> gentoo.org>

 .../kube-controller-manager-1.35.0.ebuild             | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

diff --git 
a/sys-cluster/kube-controller-manager/kube-controller-manager-1.35.0.ebuild 
b/sys-cluster/kube-controller-manager/kube-controller-manager-1.35.0.ebuild
index b50842d0a5e4..ba67b9050efe 100644
--- a/sys-cluster/kube-controller-manager/kube-controller-manager-1.35.0.ebuild
+++ b/sys-cluster/kube-controller-manager/kube-controller-manager-1.35.0.ebuild
@@ -3,7 +3,7 @@
 
 EAPI=8
 
-inherit go-module systemd
+inherit go-env go-module shell-completion sysroot systemd
 
 DESCRIPTION="Kubernetes Controller Manager"
 HOMEPAGE="https://kubernetes.io";
@@ -26,13 +26,28 @@ BDEPEND=">=dev-lang/go-1.25.4"
 QA_PRESTRIPPED=usr/bin/kube-controller-manager
 
 src_compile() {
+       local GOOS=$(go-env_goos)
+
        CGO_LDFLAGS="$(usex hardened '-fno-PIC ' '')" \
                emake -j1 GOFLAGS="${GOFLAGS}" GOLDFLAGS="" LDFLAGS="" 
FORCE_HOST_GO=yes \
+               KUBE_BUILD_PLATFORMS="${GOOS}/${GOARCH}" 
KUBE_${GOOS@U}_${GOARCH@U}_CC="${CC}" \
                WHAT=cmd/${PN}
+
+       bin=_output/local/bin/${GOOS}/${GOARCH}/${PN}
+
+       einfo "generating shell completion files"
+       sysroot_try_run_prefixed ${bin} completion bash > ${PN}.bash || die
+       sysroot_try_run_prefixed ${bin} completion zsh > ${PN}.zsh || die
+       sysroot_try_run_prefixed ${bin} completion fish > ${PN}.fish || die
 }
 
 src_install() {
-       dobin _output/bin/${PN}
+       dobin ${bin}
+
+       [[ -s ${PN}.bash ]] && newbashcomp ${PN}.bash ${PN}
+       [[ -s ${PN}.zsh ]] && newzshcomp ${PN}.zsh _${PN}
+       [[ -s ${PN}.fish ]] && dofishcomp ${PN}.fish
+
        newinitd "${FILESDIR}"/${PN}.initd ${PN}
        newconfd "${FILESDIR}"/${PN}.confd ${PN}
        systemd_dounit "${FILESDIR}"/${PN}.service

Reply via email to