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

Use parent resource name as a value in a child resource #18

Closed
lander2k2 opened this issue Jun 8, 2022 · 0 comments
Closed

Use parent resource name as a value in a child resource #18

lander2k2 opened this issue Jun 8, 2022 · 0 comments

Comments

@lander2k2
Copy link
Contributor

We don't currently have a way to do this. Consider this custom resource that is the parent:

apiVersion: v1alpha1
kind: WebApp
metadata:
  name: intance-x
spec:
  env: dev

Suppose we want to deploy n number of these webapps to a single cluster - each into their own namespace. Suppose we shove this resource into operator-builder...

apiVersion: v1
kind: Namespace
metadata:
  name: webapp-placeholder  # +operator-builder:field:name=parent.metadata.name,type=string,replace="placeholder"

So, given the WebApp resource above, this would produce a namespace with name webapp-instance-x.

And if a WebApp with name instance-y was created the result would be a namespace called webapp-instance-y.

scottd018 added a commit that referenced this issue Jun 14, 2022
…source

Signed-off-by: Dustin Scott <dustin.scott18@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant