Transformer arugments can clash each other
In kubernetes transformers, the following sample uses appName and serviceAccountName as arugments which will eventually be part of the component model and these names can not be used across any other transformer.
https://github.com/devopzilla/guku-devx/blob/5743b77354638b7fe4e592ddaf83df47e6691a19/pkg/guku.io/devx/v1/transformers/kubernetes/transformers.cue#L35-L36
As a suggestion, I would add some annotations field to $metadata and use it as a freemap then use it to define arguments, for example:
#SomeTransformer: v1.#Transformer & {
v1.#Component
…
$metadata: annotations: kubernetes: deployment: appName: string | *$metadata.id
}
On a second thought. This will disallow using the same transformer twice, e.g. you can’t use #AddDeployment twice in the environment unless the match different components. We need to somehow record the transformer arguments in a unique key/label.
P.S. whether or not it makes sense to use a transformer twice in a single environment does not have a clear decision yet.