Skip to content

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.

None yet

1 participant