Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to grab the namespace off the claim #97

Closed
silverbp opened this issue May 20, 2024 · 4 comments
Closed

Ability to grab the namespace off the claim #97

silverbp opened this issue May 20, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@silverbp
Copy link

silverbp commented May 20, 2024

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?

@silverbp silverbp added the enhancement New feature or request label May 20, 2024
@jaylevin
Copy link
Contributor

jaylevin commented May 20, 2024

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 }}
---

@silverbp
Copy link
Author

AWESOME!

@bobh66
Copy link
Contributor

bobh66 commented Sep 5, 2024

@silverbp is it ok to close this issue?

@silverbp
Copy link
Author

silverbp commented Sep 5, 2024 via email

@phisco phisco closed this as completed Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants