-
Notifications
You must be signed in to change notification settings - Fork 15
NETOBSERV-1554 Add CLI to Krew index #27
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
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #27 +/- ##
==========================================
+ Coverage 0.00% 31.25% +31.25%
==========================================
Files 5 5
Lines 898 944 +46
==========================================
+ Hits 0 295 +295
+ Misses 898 629 -269
- Partials 0 20 +20
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
commands/netobserv
Outdated
echo " version Print software version." | ||
echo | ||
exit 0 | ||
elif [ "$1" = "version" ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pls change this to
case "$1" in
"version")
echo "Netobserv CLI version $version"
exit 0 ;;
"flows")
;;
"packets")
;;
"cleanup")
;;
esac
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll give a try ! Thanks for the tips !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done in 4e9ea0b
Makefile
Outdated
tar-commands: clean ## Generate tar.gz containing krew plugin | ||
$(MAKE) KREW_PLUGIN=true kubectl-commands | ||
tar -czf netobserv-cli.tar.gz LICENSE ./build/netobserv | ||
sha256sum netobserv-cli.tar.gz |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not clear to me how the above tar ball will include krew plugin ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just creating a tarball and showing sha256
for now.
After that we need to publish the tar.gz to a release (in github for upstream) where a downloadable link is available
Finally we need to publish a krew index containing the link + sha in https://github.com/kubernetes-sigs/krew-index
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added a script to generate index according to version ad143ad
tar -czf netobserv-cli.tar.gz LICENSE ./build/netobserv | ||
@echo "### Generating krew index yaml" | ||
VERSION=$(VERSION) \ | ||
./scripts/krew.sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't we need this operation to be arch aware and generate tar ball for each arch ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to test it on different arch first. It may work out of box; else maybe just tweaking around the script.
On top, krew index allow you to point different binaries for each platform if needed
echo "TODO: | ||
- Submit updated index to https://github.com/kubernetes-sigs/krew-index to update plugin: | ||
\`\`\`yaml${indexYaml}\`\`\` | ||
- Click on 'generate release notes' above and publish" > ./tmp/release.md |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do u need to add ./tmp/release.md to .gitignore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tmp
folder is already there
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED Approval requirements bypassed by manually added approval. This pull-request has been approved by: The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Description
This is a preparatory work for krew index creation:
bin
entryrelease
target to generate krew package and prepare github releasekubectl
oroc
Here is a krew index sample:
https://gist.github.com/jpinsonneau/a34785c85a20c3899ec91f266ff33823
You can test it using:
The krew index will be automatically generated by github
release
job and appened to body release notes as draft.Dependencies
n/a
Checklist
If you are not familiar with our processes or don't know what to answer in the list below, let us know in a comment: the maintainers will take care of that.