Skip to content

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

Open
@Chasarr

Description

@Chasarr

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.lifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions