<p>I have an argocd ApplicationSet created. I have the following merge keys setup:</p>
<pre><code>    generators:
      - merge:
          mergeKeys:
            - path
          generators:
            - matrix:
                generators:
                  - git:
                      directories:
                        - path: aws-ebs-csi-driver
                        - path: cluster-autoscaler
                      repoURL: &gt;-
                        ...
                      revision: master
                  - clusters:
                      selector:
                        matchLabels:
                          argocd.argoproj.io/secret-type: cluster
            - list:
                elements:
                  - path: aws-ebs-csi-driver
                    namespace: system
                  - path: cluster-autoscaler
                    namespace: system

</code></pre>
<p>Syncing the application set however generates:</p>
<pre><code>    - lastTransitionTime: &quot;2022-08-08T21:54:05Z&quot;
      message: the parameters from a generator were not unique by the given mergeKeys,
        Merge requires all param sets to be unique. Duplicate key was {&quot;path&quot;:&quot;aws-ebs-csi-driver&quot;}
      reason: ApplicationGenerationFromParamsError
      status: &quot;True&quot;
</code></pre>
<p>Any help is appreciated.</p>

sebastian
<p>The matrix generator is producing one set of parameters for each combination of directory and cluster.</p>
<p>If there is more than one cluster, then there will be one parameter set with <code>path: aws-ebs-csi-driver</code> for each cluster.</p>
<p>The merge generator requires that each parameter used as a merge key be completely unique. That mode was the original design of the merge generator, but more modes may be supported in the future.</p>
<p>Argo CD v2.5 will support <a href="https://argo-cd.readthedocs.io/en/latest/operator-manual/applicationset/GoTemplate/" rel="nofollow noreferrer">go templated ApplicationSets</a>, which might provide an easier way to solve your problem.</p>
