Skip to content
This repository has been archived by the owner on Feb 6, 2024. It is now read-only.

io_kubernetes_build seems to not exist? #688

Open
ptarjan opened this issue Mar 2, 2022 · 3 comments
Open

io_kubernetes_build seems to not exist? #688

ptarjan opened this issue Mar 2, 2022 · 3 comments

Comments

@ptarjan
Copy link

ptarjan commented Mar 2, 2022

I already have rules_k8s working using the simple:

load("@io_bazel_rules_k8s//k8s:k8s.bzl", "k8s_repositories")

k8s_repositories()

load("@io_bazel_rules_k8s//k8s:k8s_go_deps.bzl", k8s_go_deps = "deps")

k8s_go_deps()

I'm trying to follow the directions to get rid of the debug message:

    (17:31:25) DEBUG: /cache/bazel/6fadd30f776596320f945376fa05bc65/external/io_bazel_rules_k8s/toolchains/kubectl/kubectl_toolchain.bzl:28:14: No kubectl tool was found or built, executing run for rules_k8s targets might not work.

By adding this before:


+load("@io_bazel_rules_k8s//toolchains/kubectl:kubectl_configure.bzl", "kubectl_configure")
+
+kubectl_configure(
+    name = "k8s_config",
+    build_srcs = True,
+)
+

but then when I run this I get:

$ bazel build @io_kubernetes//...
INFO: Invocation ID: 3657c8df-3d63-4e15-9ce9-daf082813d8d
ERROR: Skipping '@io_kubernetes//...': error loading package under directory '': error loading package '@io_kubernetes//cluster/gce': Unable to find package for @io_kubernetes_build//defs:pkg.bzl: The repository '@io_kubernetes_build' could not be resolved: Repository '@io_kubernetes_build' is not defined.
WARNING: Target pattern parsing failed.
ERROR: error loading package under directory '': error loading package '@io_kubernetes//cluster/gce': Unable to find package for @io_kubernetes_build//defs:pkg.bzl: The repository '@io_kubernetes_build' could not be resolved: Repository '@io_kubernetes_build' is not defined.
INFO: Elapsed time: 0.904s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)
    currently loading: @io_kubernetes//cluster/gce ... (7 packages)

I see a reference in the readme

https://github.com/kubernetes/kubernetes/blob/{k8s_commit}/build/root/WORKSPACE
about it but when I visit that directory https://github.com/kubernetes/kubernetes/tree/master/build/root I don't see a WORKSPACE file.

Can we update the docs for how to do this please?

@jvolkman
Copy link

jvolkman commented Apr 8, 2022

Probably due to #677

@loeffel-io
Copy link

same here

@loeffel-io
Copy link

this is a pretty good alternative:

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_file")

http_file(
    name = "k8s_binary",
    downloaded_file_path = "kubectl",
    executable = True,
    sha256 = "da340d96f1d2f6932a888f1f44646a5817edd8512a4aa793a20267524d2900df",
    urls = ["https://storage.googleapis.com/kubernetes-release/release/v1.23.8/bin/darwin/arm64/kubectl"],
)

kubectl_configure(
    name = "k8s_config",
    kubectl_path = "@k8s_binary//file",
)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants