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

add optional reconcile policy configuration to ResourceSync #11

Open
lukebond opened this issue Apr 13, 2023 · 0 comments
Open

add optional reconcile policy configuration to ResourceSync #11

lukebond opened this issue Apr 13, 2023 · 0 comments

Comments

@lukebond
Copy link
Contributor

there are some use-cases where we want the sinker to copy across resources once, or whenever the source changes, and never delete the target. e.g. configmaps and secrets. stale information is probably better than it going missing later when we want it.

there are other use-cases where we want the sinker to remove the target when the source is removed, e.g. live status information. we don't want to retain stale status information that could lead to us erroneously reporting a healthy status for something that is gone.

currently it won't ever delete the target, so we have case one only.

a suggested format:

apiVersion: sinker.influxdata.io/v1alpha1
kind: ResourceSync
metadata:
  name: cluster-0001-kustomization-status
  namespace: customer-0001
spec:
  mappings:
  - fromFieldPath: status
    toFieldPath: spec
  - fromFieldPath: metadata.labels
    toFieldPath: metadata.labels
  reconcilePolicy:
    mode: Reconcile
    prune: true
  source:
    cluster:
      kubeConfig:
        secretRef:
          key: value
          name: cluster-0001-kubeconfig
      namespace: iox
    resourceRef:
      apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
      kind: Kustomization
      name: iox-manifests
  target:
    resourceRef:
      apiVersion: tubernetes.influxdata.io/v1beta2
      kind: FluxcdKustomizationStatus
      name: iox-manifests

to give just the relevant section:

  reconcilePolicy:
    mode: Reconcile
    prune: true

the Reconcile policy is what we do now. i can't think of another mode but we may come up with some later. prune means "if the source is gone, delete the target". it should default to false so that current syncs have no change of behaviour, and it's possibly what people would expect as default.

@cannonpalms i feel you had another example in our call that might give us another mode but i can't remember it right now.

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