rules_k8s
rules_k8s copied to clipboard
.apply applies the same objects multiple times
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.
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 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 :(
hi @steeve, left a comment in the PR with advice as to how to test this.