mirror of https://github.com/k3s-io/k3s
Fixed crash when path has multiple leading slashes
parent
8406a547d4
commit
52f02c42e6
|
@ -378,11 +378,8 @@ func untarAll(reader io.Reader, destFile, prefix string) error {
|
|||
}
|
||||
|
||||
func getPrefix(file string) string {
|
||||
if file[0] == '/' {
|
||||
// tar strips the leading '/' if it's there, so we will too
|
||||
return file[1:]
|
||||
}
|
||||
return file
|
||||
// tar strips the leading '/' if it's there, so we will too
|
||||
return strings.TrimLeft(file, "/")
|
||||
}
|
||||
|
||||
func execute(f cmdutil.Factory, cmd *cobra.Command, options *ExecOptions) error {
|
||||
|
|
Loading…
Reference in New Issue