Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] arm64: bad kubectl binary #516

Closed
disconn3ct opened this issue Aug 26, 2021 · 2 comments · Fixed by #517
Closed

[BUG] arm64: bad kubectl binary #516

disconn3ct opened this issue Aug 26, 2021 · 2 comments · Fixed by #517
Labels
bug Something isn't working

Comments

@disconn3ct
Copy link
Contributor

Describe the bug
Using ghcr.io/infracloudio/botkube:v0.12.2, commands on arm64 return fork/exec /usr/local/bin/kubectl: exec format error

To Reproduce
Steps to reproduce the behavior:

  1. Install botkube on arm64
  2. Send a command (botkube cluster-info)
  3. See error: fork/exec /usr/local/bin/kubectl: exec format error

Expected behavior
Kubectl uses the correct architecture

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

@disconn3ct disconn3ct added the bug Something isn't working label Aug 26, 2021
@disconn3ct
Copy link
Contributor Author

I'll try to get time this evening to send a pull but in short, it can be fixed by changing line 30 from bitnami to:

# Download the latest kubectl in the appropriate architecture. Currently handles aarch64 (arm64) and x86_64 (amd64).
RUN MACH=$(uname -m); if [[ ${MACH} == "aarch64" ]]; then ARCH=arm64; \
    elif [[ ${MACH} == "x86_64" ]]; then ARCH=amd64; \
    else echo "Unsupported arch: ${MACH}"; ARCH=${MACH}; fi; \
    wget -O /usr/local/bin/kubectl "https://dl.k8s.io/release/$(wget -qO - https://dl.k8s.io/release/stable.txt)/bin/linux/${ARCH}/kubectl" && \
    chmod +x /usr/local/bin/kubectl

@PrasadG193
Copy link
Collaborator

@disconn3ct we can do a quick release if you could fix this. Please let me know if I can help

@mergify mergify bot closed this as completed in #517 Sep 6, 2021
mergify bot pushed a commit that referenced this issue Sep 6, 2021
##### ISSUE TYPE
<!--- Pick one below and delete the rest: -->
 - Bug fix Pull Request

##### SUMMARY
<!--- Describe the change, including rationale and design decisions -->
This fetches the current latest stable kubectl directly from the upstream.

An alternate approach would be to copy from `rancher/kubectl` but that requires explicit versioning.

<!---
If you are fixing an existing issue, please include "Fixes #nnn" in your
PR comment; and describe briefly what the change does.
-->

<!--- Please list dependencies added with your change also -->

Fixes #516
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants