influxdata / influxdata/sinker

add optional reconcile policy configuration to ResourceSync

Open
#11 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
10
Forks
0
Avg merge
2d 13h
Merged PRs (30d)
13

Description

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:

```yaml
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:

```yaml
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.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the ResourceSync specification and the current sinker reconciliation path. Verify how the existing Reconcile behavior handles source removal, then define tests for the optional mode and prune setting, including the default false behavior and deletion when pruning is enabled.

Written by the indexing model from the issue text.

Assessment

Tech stack
kubernetes, rust
Domain
devops, infrastructure
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.