Open phisco opened 2 months ago
misses an example, I'll try to find a meaningful one.
misses an example, I'll try to find a meaningful one.
If you want an example the ability to provision an s3 bucket external to the composition (in a composition of its own or not) and be able to add bucket notifications from another composition would be a good way to demonstrate a one to many relationship.
Often one bucket will have a dozen notification handlers into SQS queues etc.
Comments from my day of using this branch:
Ideas to track, if they should become issues or not is up to you:
Otherwise it's worked as advertised and enabled the workflows I hoped it would!
Is it planned to merge this one soon?
Can you provide a full working example? I can't get this running ...
OK - you have to use Crossplane > 15 in order to use extraResources :-/
My problem is, that I am able to retrieve extraResources with the function, but it's not possible to use them as described:
cannot compose resources: pipeline step "go-templating" returned a fatal result: cannot execute template: template: manifests:10:26: executing "manifests" at <index .extraResources "namespaces">
with this template:
apiVersion: 'meta.gotemplating.fn.crossplane.io/v1alpha1'
kind: 'ExtraResources'
requirements:
namespaces:
apiVersion: 'kubernetes.crossplane.io/v1alpha2'
kind: 'Object'
matchLabels:
'something/claimRefNamespace': 'string'
---
{{ $someExtraResources := index .extraResources "namespaces" }}
{{- range $i, $extraResource := $someExtraResources.items }}
apiVersion: kubernetes.crossplane.io/v1alpha1
kind: Object
metadata:
annotations:
gotemplating.fn.crossplane.io/composition-resource-name: default-serviceaccount-prod
spec:
forProvider:
manifest:
apiVersion: v1
kind: Configmap
metadata:
name: $extraResource.resource.metadata.name
namespace: default
data:
somekey: value
providerConfigRef:
name: "kubernetes"
{{- end }}
So we do encapsulate everything in {{ with .extreResources }} to make it work
So all in all - nice work - in our tests this just works.
This seems super useful! Will this be merged soon?
Sorry - have the question, does this PR has any future?
Yes, @markussiebert, I only have to find the time to refine it a bit further.
Description of your changes
Fixes #77
I have: