Skip to content

Cert file naming makes Copy function in ssh_runner.go break #20080

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

Open
Chasarr opened this issue Dec 10, 2024 · 2 comments · May be fixed by #20636
Open

Cert file naming makes Copy function in ssh_runner.go break #20080

Chasarr opened this issue Dec 10, 2024 · 2 comments · May be fixed by #20636
Labels
kind/bug Categorizes issue or PR as related to a bug. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.

Comments

@Chasarr
Copy link

Chasarr commented Dec 10, 2024

What Happened?

The problem occurs when running minikube start --embed-certs

One of my certificates used on my system is called my_cert(1).crt. This naming does not work, since the Copy function in ssh_runner.go tries to run scp += fmt.Sprintf(" && sudo touch -d \"%s\" %s", mtime.Format(layout), dst). This makes Bash run sudo touch -d "2024-12-10 14:39:09.586983523 +0100" /usr/share/ca-certificates/my_cert(1).pem, which is an invalid command, since the parenthesis needs to be preceded by a backslash like this:
sudo touch -d "2024-12-10 14:39:09.586983523 +0100" /usr/share/ca-certificates/my_cert\(1\).pem

This can of course be resolved by changing the name of the cert file.

I would attempt to fix this myself, but I am unfortunately not a go developer.

Attach the log file

I don't think the entire log is necessary to paste here due to me finding out the cause of the bug myself, and I don't feel like sanitizing the output from secret environment variables and such. The line with the error goes as follows:

❌ Exiting due to GUEST_CERT: Failed to setup certs: Copy /home/chasar/.minikube/certs/my_cert(1).crt: sudo mkdir -p /usr/share/ca-certificates && sudo scp -t /usr/share/ca-certificates && sudo touch -d "2024-12-10 14:39:09.586983523 +0100" /usr/share/ca-certificates/my_cert(1).pem: Process exited with status 2
output: bash: -c: line 1: syntax error near unexpected token (' bash: -c: line 1: sudo mkdir -p /usr/share/ca-certificates && sudo scp -t /usr/share/ca-certificates && sudo touch -d "2024-12-10 14:39:09.586983523 +0100" /usr/share/ca-certificates/my_cert(1).pem'

Operating System

Other

Driver

None

@Ritikaa96
Copy link

cert files are important and need to have valid name, I think if we follow recommended approach this can be avoided.. Still this can create some issues and need to be looked at.
/kind bug

@k8s-ci-robot k8s-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Dec 11, 2024
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle stale
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Apr 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants