Skip to content
This repository has been archived by the owner on Sep 26, 2022. It is now read-only.

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

Open
lander2k2 opened this issue Jan 12, 2022 · 0 comments
Open

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

lander2k2 opened this issue Jan 12, 2022 · 0 comments
Labels
enhancement New feature or request

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant