Skip to content

Commit 4c43b5b

Browse files
committed
kubectl: symlink is needed for snap
1 parent 04bc7e9 commit 4c43b5b

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

bin/kubectl

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ class App
8181
iopath = Pathname.new(io.path)
8282
iopath.chmod(0o755)
8383
iopath.rename exact_path
84+
else
85+
die "Don't know what to do with #{io.inspect}"
8486
end
8587

8688
path.delete if path.symlink?
@@ -96,9 +98,11 @@ class App
9698
.map { |pth| pth + 'kubectl' })
9799
.select(&:file?)
98100
.select(&:executable?)
99-
.map(&:realpath)
100-
.reject { |pth| PROGRAM_NAME == pth }
101-
.first || exit(127)
101+
.reject { |pth| PROGRAM_NAME == pth.realpath }
102+
.first || begin
103+
STDERR.puts "FATAL: At least one existing version of kubectl must be available."
104+
exit(127)
105+
end
102106
end.to_s
103107
end
104108

0 commit comments

Comments
 (0)