Commit f8173a4
feat: metadata support in the kubernetes_sync (#1905)
## This PR
- Preserve FeatureFlag metadata when syncing from Kubernetes by
marshalling `spec.flagSpec` directly from unstructured objects.
- Harden informer tombstone handling and watcher readiness for
Kubernetes sync.
- Add unit tests covering metadata preservation and tombstone unwrap.
### Related Issues
Fixes # #754 (CRD definition is not following the latest flagD
specifications) - in the
[open-feature-operator](https://github.com/open-feature/open-feature-operator)
already rased the pr for open-feature-operator CRD support for metaData
- (open-feature/open-feature-operator#808
that alone is not enough, so in Flagd also want to change. This PR
refers to that.
### Notes
- Architecture unchanged; only Kubernetes sync path touched.
- No dependency/version changes.
### Follow-up Tasks
- None.
This change keeps the Kubernetes sync path working with metadata by
treating FeatureFlag resources as unstructured objects and marshaling
spec.flagSpec directly. That avoids converting into typed CRDs (which
can drop unknown fields like metadata) and ensures delete tombstones are
handled safely, so the synced payload now preserves any metadata the CRD
allows.
### How to test
1) From repo root:
- `cd core && GOPATH=/tmp/go GOCACHE=/tmp/go-build go test
./pkg/sync/kubernetes`
2) (Optional) Build and run your existing workflow to confirm metadata
is present end-to-end.
---------
Signed-off-by: Nilushiya.K <Nilushiya.K@cloudsolutions.com.sa>
Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
Signed-off-by: Nilushiya Kaneshalingam <107831659+Nilushiya@users.noreply.github.com>
Co-authored-by: Nilushiya.K <Nilushiya.K@cloudsolutions.com.sa>
Co-authored-by: Todd Baert <todd.baert@dynatrace.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: Michael Beemer <beeme1mr@users.noreply.github.com>1 parent 5fa86c6 commit f8173a4
4 files changed
Lines changed: 144 additions & 166 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | | - | |
93 | 92 | | |
94 | 93 | | |
95 | 94 | | |
| |||
129 | 128 | | |
130 | 129 | | |
131 | 130 | | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | 131 | | |
136 | 132 | | |
137 | 133 | | |
| |||
159 | 155 | | |
160 | 156 | | |
161 | 157 | | |
162 | | - | |
163 | 158 | | |
164 | 159 | | |
165 | 160 | | |
166 | 161 | | |
167 | 162 | | |
168 | 163 | | |
169 | 164 | | |
170 | | - | |
171 | 165 | | |
172 | 166 | | |
173 | | - | |
174 | | - | |
| 167 | + | |
| 168 | + | |
175 | 169 | | |
176 | | - | |
| 170 | + | |
177 | 171 | | |
178 | 172 | | |
179 | 173 | | |
| |||
0 commit comments