Include Reg into microk8s - #453
Conversation
|
@ktsakalozos , the tests are failing any idea why? |
| source $SNAP/actions/common/utils.sh | ||
|
|
||
| read -ra ARGUMENTS <<< "$1" | ||
| argz=("${ARGUMENTS[@]/#/--}") |
There was a problem hiding this comment.
I do not think you are doing anything with argz so lets simplify the code by removing these two lines.
|
|
||
| source $SNAP/actions/common/utils.sh | ||
|
|
||
| echo "Disabling Reg" |
There was a problem hiding this comment.
I think a single message should be enough. :)
| REG_VERSION="${REG_VERSION:-v0.16.0}" | ||
| echo "Fetching reg version $REG_VERSION." | ||
| sudo mkdir -p "$SNAP_DATA/bin" | ||
| sudo "${SNAP}/usr/bin/curl" -L https://github.com/genuinetools/reg/releases/download/${REG_VERSION}/reg-linux-amd64 -o "$SNAP_DATA/bin/reg" |
There was a problem hiding this comment.
MicroK8s ships for amd64 adn arm64, so we should use the $SNAP_ARCH to get the right binary from the releases. Something like this should work: https://github.com/genuinetools/reg/releases/download/${REG_VERSION}/reg-linux-${SNAP_ARCH}.
|
@etheleon thank you for this PR. I left a few comments. It would be great if you could somehow add a test for this addon. Here is how to do that:
If you follow the instruction and build MicroK8s from source https://github.com/ubuntu/microk8s#building-from-source you should see that you do not have a It would have been better if the fist time you try the |
|
@ktsakalozos Thanks for the detailed write up on writing the test! Let me get started on it! :) |
- snapcraft: add reg as app - validator: include validator for `reg` * tags busybox * push to local registry * assets presence of image * deletes tag - microk8s.reg wrapper: installs reg if binary not found - microk8s.enable reg: installs reg (might be duplicate)
71ebed9 to
44a3218
Compare
|
Hi @ktsakalozos, made the following changes:
|
|
@etheleon are you able to see this: https://travis-ci.org/ubuntu/microk8s/builds/534665856?utm_source=github_status&utm_medium=notification ? I believe you are missing an import. |
|
@etheleon now we have: I should document how to run the tests locally, (they are run with pytest). |
|
|
||
|
|
||
| try: | ||
| enable = microk8s_enable("reg") |
There was a problem hiding this comment.
Can you please add a timeout_insec=30 when enabling the add-on. If we do not set a timeout enabling tries for too long and tests on travis timeout.
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
|
Closing this PR due to inactivity. |
As suggested in this thread, reg will be a good addition to enable users to easily interact with local registry