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

build node-image with Bazel fails when invoked outside of the Kubernetes source code #1910

Closed
pohly opened this issue Oct 27, 2020 · 1 comment · Fixed by #1911
Closed

build node-image with Bazel fails when invoked outside of the Kubernetes source code #1910

pohly opened this issue Oct 27, 2020 · 1 comment · Fixed by #1911
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@pohly
Copy link
Contributor

pohly commented Oct 27, 2020

What happened:

A node image build fails when using Bazel and kind is invoked with a current directory that isn't the Kubernetes source code root:

$ pwd
/nvme/gopath.tmp/src/github.com/kubernetes-csi/external-provisioner

$ kind build node-image --image csiprow/node:latest --type=bazel --kube-root /home/prow/go/pkg/csiprow.uS36SJL93u/src/kubernetes
...
ERROR: error building node image: command "docker cp bazel-out/k8-fastbuild/bin/cmd/kubelet/kubelet kind-build-1603796560-4097252:/usr/bin/kubelet" failed with error: exit status 1
Command Output: lstat /nvme/gopath.tmp/src/github.com/kubernetes-csi/external-provisioner/bazel-out: no such file or directory

Note that docker cp bazel-out is using a relative path.

What you expected to happen:

It should use an absolute path when accessing bazel-out.

How to reproduce it (as minimally and precisely as possible):

Check out Kubernetes master, build a node image while in some other directory.

Environment:

  • kind version: (use kind version): 0.9.0
@pohly pohly added the kind/bug Categorizes issue or PR as related to a bug. label Oct 27, 2020
pohly added a commit to pohly/external-provisioner that referenced this issue Oct 27, 2020
Kind 0.9.0 accesses the "bazel-out" directory with a relative path,
which only works when the command is invoked inside the Kubernetes
source code
directory (kubernetes-sigs/kind#1910).
@BenTheElder
Copy link
Member

#1841

pohly added a commit to pohly/csi-release-tools that referenced this issue Oct 27, 2020
Kind 0.9.0 accesses the "bazel-out" directory with a relative path,
which only works when the command is invoked inside the Kubernetes
source code
directory (kubernetes-sigs/kind#1910).
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.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants