Closed silverbp closed 3 weeks ago
You can grab the claim namespace from the XR's crossplane.io/claim-namespace
label.
Here's an example of creating an EnvironmentConfig
resource with a claim_namespace
key equal to the namespace the claim was deployed to:
{{ $claimNamespace := index $.observed.composite.resource.metadata.labels "crossplane.io/claim-namespace" }}
---
apiVersion: apiextensions.crossplane.io/v1alpha1
kind: EnvironmentConfig
metadata:
name: test
data:
claim_namespace: {{ $claimNamespace }}
---
AWESOME!
@silverbp is it ok to close this issue?
Yes, thanks
On Sep 4, 2024, at 8:10 PM, Bob Haddleton @.***> wrote:
@silverbp https://github.com/silverbp is it ok to close this issue?
— Reply to this email directly, view it on GitHub https://github.com/crossplane-contrib/function-go-templating/issues/97#issuecomment-2330407593, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADPG2RV3YQBQUIZYD7MDS3ZU6VRTAVCNFSM6AAAAABIAKO2D6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMZQGQYDONJZGM. You are receiving this because you were mentioned.
What problem are you facing?
Trying to figure out how I can get the namespace off the claim to be able to provision resources in the provider using the name of the namespace in the name.
How could this Function help solve your problem?
Is there a way to pull metadata properties from the claim, specifically the namespace using go-templating or do I need to take the namespace as a parameter?