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

Add microk8s.kubectl as an alias for kubectl #20

Closed
marcoceppi opened this issue May 22, 2018 · 3 comments

Comments

Projects
None yet
2 participants
@marcoceppi
Copy link
Member

commented May 22, 2018

This would make it so if kubectl wasn't installed microk8s.kubectl would become become linked to /snap/bin/kubectl

This would really help streamline adoption

@johnsca

This comment has been minimized.

Copy link
Collaborator

commented May 22, 2018

It was my understanding that aliases were (planned to be?) moved out of the snapcraft.yaml definition to become store-only metadata? Additionally, from my experience with the juju alias in conjure-up, if a snap provides an alias for a command that's already provided by another snap, it will prevent it from being installed. I would be happy to learn that I am wrong on one or both counts.

@johnsca

This comment has been minimized.

Copy link
Collaborator

commented May 22, 2018

Ok, doing some more research, it looks like the snap doesn't need to do anything to allow the user to do:

sudo snap alias microk8s.kubectl kubectl

We can also make a topic on the forum to request an auto-alias. If the microk8s.kubectl is aliased to kubectl, then trying to do

sudo snap install --classic kubectl

Will fail with:

error: cannot install "kubectl": snap "kubectl" command namespace conflicts with alias "kubectl"
       for "microk8s" snap

This behavior seems less than ideal, but at least the error message is clear, even if it doesn't explain exactly what to do to fix it. I am still not clear if it will fail in the other direction (i.e., if they already have the kubectl snap installed, if trying to install microk8s will fail if it has an auto-alias defined in the store), but I suspect it will just ignore the auto-alias. I'm not sure how to test that, though.

marcoceppi added a commit that referenced this issue May 22, 2018

@marcoceppi

This comment has been minimized.

Copy link
Member Author

commented May 22, 2018

I don't want an auto-alias, just an option for the user to alias it and documenting how to do it. I'll test with the current snap, but if it works today without modification this is just a documentation issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.