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

Fixed bug where tmp dir incorrectly set for Snap package manager #10372

Merged
merged 1 commit into from
Feb 5, 2021

Conversation

spowelljr
Copy link
Member

@spowelljr spowelljr commented Feb 5, 2021

Fixes: #10407

Background info:
The original issue was that starting minikube installed via Snap (package manager) would result in the error:

prepare kic ssh: copying pub key: docker copy /tmp/tmpf-memory-asset150446131 into minikube:/home/docker/.ssh/authorized_keys, output: lstat /tmp/tmpf-memory-asset150446131: no such file or directory

This is due to Snap only allowing packages to see their own view of the /tmp folder. In this case minikube copies a memory asset to the /tmp folder for Docker to later copy. Snap prevents Docker from seeing minikubes file and the above error occurs.

This PR:
This issue was attempted to be fixed in #10042, the correct way to solve this issue is to check if the binary is installed via Snap, and if it is, writes the memory asset to the users home directory instead. However, there was a bug included in the PR where instead of setting the tmp directory to the users home directory, it would try to find an env variable by the name of the users home directory and set that as the tmp directory. This env was not found and would return an empty string, passing an empty string to the function would fallback to using the default tmp directory and would fail. This fix simply removes the env check and sets the tmp directory to the users home directory.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Feb 5, 2021
@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Feb 5, 2021
@minikube-bot
Copy link
Collaborator

Can one of the admins verify this patch?

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: medyagh, spowelljr

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 5, 2021
@medyagh medyagh merged commit b387cf2 into kubernetes:master Feb 5, 2021
@spowelljr spowelljr changed the title fixed snap package manager bug Fixed bug where tmp dir incorrectly set for Snap package manager Feb 5, 2021
@spowelljr spowelljr deleted the fixSnapBug branch June 28, 2021 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create fix and write tests for Snap package manager bug
4 participants