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

chore: add cnpg plugin for kubectl #865

Merged
merged 1 commit into from
Mar 6, 2023

Conversation

sxd
Copy link
Contributor

@sxd sxd commented Mar 5, 2023

Add the cnpg plugin for kubectl to be used with CloudNativePG operator

Description

This PR aims to add the cnpg pluging for kubectl to be used with CloudNativePG operator, in a future
PR we hope to provide also a way to install this operator using arkade

Motivation and Context

The cnpg plugin can make use of Arkade to distribute the plugin

Issue #852

How Has This Been Tested?

Local laptop using amd64 and RaspberryPi B4 both to install the plugin both with Linux
Local laptop using amd64 with macOS

Are you a GitHub Sponsor yet (Yes/No?)

  • Yes
  • No

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Documentation

  • I have updated the list of tools in README.md if (required) with ./arkade get -o markdown
  • I have updated the list of apps in README.md if (required) with ./arkade install --help

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I've read the CONTRIBUTION guide
  • I have signed-off my commits with git commit -s
  • I have tested this on arm, or have added code to prevent deployment

@derek derek bot added the new-contributor label Mar 5, 2023
@sxd sxd marked this pull request as ready for review March 5, 2023 18:39
@alexellis
Copy link
Owner

@Jasstkn could you help out here with explaining how to do the checker script that shows the arch for each binary? The one we have in the contributing guide.

@Jasstkn
Copy link
Contributor

Jasstkn commented Mar 6, 2023

@sxd Hi! thanks for the contribution. Please, check our contribution guide to see how the code should be properly tested.
One of the mentioned ways is to use our test script. You can run it by executing the following:

./hack/test-tool.sh <tool_name>

The output of this should be added to the PR's description. It will speed up the review process 🚀

@sxd
Copy link
Contributor Author

sxd commented Mar 6, 2023

@alexellis @Jasstkn working on it! thank you!!! and sorry for wasting your time I thought that I followed all the contribution guide but clearly I didn't, my bad! fixing!

@sxd
Copy link
Contributor Author

sxd commented Mar 6, 2023

@Jasstkn here is the output:

./hack/test-tool.sh kubectl-cnpg
+ ./arkade get kubectl-cnpg --arch arm64 --os darwin --quiet
+ file /home/zeus/.arkade/bin/kubectl-cnpg
/home/zeus/.arkade/bin/kubectl-cnpg: Mach-O 64-bit arm64 executable, flags:<|DYLDLINK|PIE>
+ rm /home/zeus/.arkade/bin/kubectl-cnpg
+ echo

+ ./arkade get kubectl-cnpg --arch x86_64 --os darwin --quiet
+ file /home/zeus/.arkade/bin/kubectl-cnpg
/home/zeus/.arkade/bin/kubectl-cnpg: Mach-O 64-bit x86_64 executable
+ rm /home/zeus/.arkade/bin/kubectl-cnpg
+ echo

+ ./arkade get kubectl-cnpg --arch x86_64 --os linux --quiet
+ file /home/zeus/.arkade/bin/kubectl-cnpg
/home/zeus/.arkade/bin/kubectl-cnpg: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, Go BuildID=c8EnbaDLyYSH5tuhAN-I/0Xl4aey1cq1x8eY1BR2z/AT7ShFvoaMOD48e969WV/tIKr3LQQwdHlqO9VFZ0h, stripped
+ rm /home/zeus/.arkade/bin/kubectl-cnpg
+ echo

+ ./arkade get kubectl-cnpg --arch arm64 --os linux --quiet
+ file /home/zeus/.arkade/bin/kubectl-cnpg
/home/zeus/.arkade/bin/kubectl-cnpg: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, Go BuildID=leVwSvJ3d-6YzsMXcO1B/xnofTK4v6MCNdYr9wwHt/tPTd9mv1MB_orY3ZalS3/yknIaaHoN4vYgohfdfV5, stripped
+ rm /home/zeus/.arkade/bin/kubectl-cnpg
+ echo

+ ./arkade get kubectl-cnpg --arch x86_64 --os ming --quiet
+ file /home/zeus/.arkade/bin/kubectl-cnpg
/home/zeus/.arkade/bin/kubectl-cnpg: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, Go BuildID=leVwSvJ3d-6YzsMXcO1B/xnofTK4v6MCNdYr9wwHt/tPTd9mv1MB_orY3ZalS3/yknIaaHoN4vYgohfdfV5, stripped
+ rm /home/zeus/.arkade/bin/kubectl-cnpg
+ echo

I ran make e2e and I got an error:

    --- FAIL: Test_CheckTools/Download_of_kubeseal (0.47s)

I think it's not related but it's looking for a file that doesn't exists here:

=== NAME  Test_CheckTools/Download_of_kubeseal
    url_checker_test.go:51: Error with HTTP HEAD for kubeseal, https://github.com/bitnami-labs/sealed-secrets/releases/download/helm-v2.7.6/kubeseal-helm-v2.7.6-linux-amd64.tar.gz: status code: 404, body: 

@alexellis
Copy link
Owner

The e2e tests were failing but are now fixed in the master branch.

@Jasstkn can you give a review when you have time?

Add the cnpg plugin for kubectl to be used with CloudNativePG operator

Signed-off-by: Jonathan Gonzalez V <[email protected]>
@sxd
Copy link
Contributor Author

sxd commented Mar 6, 2023

I just rebased the PR on master branch so now it shouldn't fail

Copy link
Contributor

@Jasstkn Jasstkn left a comment

Choose a reason for hiding this comment

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

LGTM

@alexellis
Copy link
Owner

We just missed the update to the README which is part of the PR template.

You checked it but I don't think you added the file?

I have updated the list of tools in README.md if (required) with ./arkade get -o markdown

@alexellis alexellis merged commit bb7c6f3 into alexellis:master Mar 6, 2023
@alexellis
Copy link
Owner

I'll sort out the README for you.

Thanks for contributing to arkade and for being a sponsor too.

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

Successfully merging this pull request may close these issues.

3 participants