rules_k8s icon indicating copy to clipboard operation
rules_k8s copied to clipboard

k8s_objects is not usable without defining cluster

Open muff1nman opened this issue 4 years ago • 1 comments

The intent is to just render a manifest using k8s_objects:

k8s_objects(
    name = "stable",
    objects = [
        ":serviceaccount",
        ":deployment",
        ":role",
        ":rolebinding",
    ],
)

k8s_object(
    name = "role",
    kind = "role",
    template = ":role.yaml",
)

...

However this leads to an error as cluster was not defined and hence k8s_objects is missing some targets it thinks it depends on (targets that I'm not interested in using):

no such target '//:role.create': target 'role.create' not declared in package '...' defined by ...BUILD.bazel and referenced by '//:stable.create'

Is it possible to conditionally add the create, apply, etc targets for k8s_objects if the collection of k8s_object did not define those targets?

muff1nman avatar Mar 28 '20 20:03 muff1nman

I think this is the same as issue #270

mariusgrigoriu avatar Jul 17 '20 04:07 mariusgrigoriu