open-cluster-management-io / policy-generator-plugin

A Kustomize generator plugin to generate Open Cluster Management policies
Apache License 2.0
29 stars 31 forks source link

Reusing PlacementRule files across multiple Generators fails in ArgoCD #50

Closed brian-jarvis closed 2 years ago

brian-jarvis commented 2 years ago

Attempting to use ArgoCD to manage ACM Policies. Running kustomize where multiple generators set placementRulePath to the same file results in this error.

rpc error: code = Unknown desc = Manifest generation error (cached): kustomize build .acm-configuration/operators --enable-alpha-plugins failed exit status 1: Error: accumulating resources: accumulation err='accumulating resources from 'dynatrace': '.acm-configuration/operators/dynatrace' must resolve to a file': recursed merging from path '.acm-configuration/operators/dynatrace': may not add resource with an already registered id: apps.open-cluster-management.io_v1_PlacementRule|smbc-acm-policies|placement-dev-apps-cluster

Steps to reproduce: 1) Setup two Policy Generators that deploy to the same namespace and both point to the same file for placementRulePath. 2) Run kustomize build command against kustomization.yaml which includes both resources from step 1

Reproducer available https://github.com/brian-jarvis/test-placement