rules_k8s icon indicating copy to clipboard operation
rules_k8s copied to clipboard

.apply applies the same objects multiple times

Open steeve opened this issue 6 years ago • 3 comments

When running a bazel run //:target.apply, rules_k8s will apply some objects multiple times if they happen to be walked in the graph multiple times: For instance:

k8s_objects(
    name = "A",
    objects = [
        ":a_object",
        ":B",
        ":C",
    ],
)

k8s_objects(
    name = "B",
    objects = [
        ":b_object",
        ":C",
    ],
)

k8s_objects(
    name = "C",
    objects = [
        ":c_object",
    ],
)

Because A and B both depend on C, when running A.apply, C is applied twice, when it shouldn't.

steeve avatar May 10 '19 20:05 steeve

Hi @steeve, thanks for your PR! Could you run the buildifier to fix the lint issues. And could you add tests that verify this?

xingao267 avatar May 14 '19 17:05 xingao267

@xingao267 most welcome! that said, I'm not sure where to put the test ? also, I'm on macos, and test-e2e-local runs on linux only :(

steeve avatar May 14 '19 21:05 steeve

hi @steeve, left a comment in the PR with advice as to how to test this.

nlopezgi avatar May 16 '19 15:05 nlopezgi