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

References namespace matching #9

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

caruccio
Copy link
Contributor

@caruccio caruccio commented Dec 9, 2020

This PR adds new field References.NamespaceFieldPath in order to match objects from arbitrary namespaces.
It will only succeed if both name and namespace come in pairs.

The usage scenario is when one needs to fetch namespaced object reference from a different state object or cluster-wide objects like PersistentVolumes:

Referencing configmaps from namespace:

resources:
- group: ""
  version: v1
  kind: PersistentVolume
  reconciler:
    exec:
      command: /app/reconciler.py
  references:
  - group: ""
    version: v1
    kind: PersistentVolumeClaim
    nameFieldPath: ".spec.claimRef.name"
    namespaceFieldPath: ".spec.claimRef.namespace"

Referencing configmaps from other namespace:

resources:
- group: whitebox.summerwind.dev
  version: v1alpha1
  kind: Hello

  - group: ""
    version: v1
    kind: ConfigMap
    nameFieldPath: ".spec.configMapRef.name"
    namespaceFieldPath: ".spec.configMapRef..namespace"

@caruccio
Copy link
Contributor Author

Hey @summerwind, any chance for this PR to be merged?

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

Successfully merging this pull request may close these issues.

1 participant