-
Notifications
You must be signed in to change notification settings - Fork 3
feat: flexible manifests #164
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
Changes from all commits
394d8bf
af4c98e
cbd9d8e
7787485
e8d9924
21961df
68b4428
6eb3787
205bcb7
2546e63
d43d268
e0b15ba
17339c0
078276a
53d1d0d
25b7dc8
4b0daa9
655950a
29db5c8
27ba3db
7bd1f32
135820b
815f7e8
24457fb
d6e174b
eb0478a
7267aa2
1522c97
6527f7e
c407fa4
46df450
b0f971a
148d377
9e7c787
354978c
9e30d37
11f14dc
68dfd1a
35a0ab2
9af75d4
cea1501
57d391d
167a800
f08ce97
39e02a6
c2d3ce8
7b15e2d
30f9243
40ea764
b10515a
c3433cd
c8dcffa
f9227fc
a0ee87e
1a7ae1e
0f34d50
ce301fa
8610c02
428b5e7
24bd060
401d194
f529a87
72df204
1bd8af7
4682b74
e3f0bd8
18bed75
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -42,19 +42,42 @@ type GitProviderReference struct { | |||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| // GitTargetSpec defines the desired state of GitTarget. | ||||||||||||||
| // | ||||||||||||||
| // The destination fields — providerRef, branch, and path — are immutable. A | ||||||||||||||
| // GitTarget materializes the watched resources at exactly one (provider, branch, | ||||||||||||||
| // folder); changing where it writes would orphan the old materialization and require | ||||||||||||||
| // migrating manifests between repositories/branches/folders. Instead of reconciling | ||||||||||||||
| // that move, the destination is fixed: to relocate a GitTarget, delete it and create a | ||||||||||||||
| // new one. This keeps the one-owner-per-folder invariant and the initial-snapshot gate | ||||||||||||||
| // simple — a successful snapshot can never be silently invalidated by a destination | ||||||||||||||
| // change. | ||||||||||||||
| // | ||||||||||||||
| // +kubebuilder:validation:XValidation:rule="self.providerRef == oldSelf.providerRef",message="spec.providerRef is immutable; delete and recreate the GitTarget to change its destination" | ||||||||||||||
| // +kubebuilder:validation:XValidation:rule="self.branch == oldSelf.branch",message="spec.branch is immutable; delete and recreate the GitTarget to change its destination" | ||||||||||||||
| // +kubebuilder:validation:XValidation:rule="self.path == oldSelf.path",message="spec.path is immutable; delete and recreate the GitTarget to change its destination" | ||||||||||||||
| type GitTargetSpec struct { | ||||||||||||||
| // ProviderRef references the GitProvider or Flux GitRepository. | ||||||||||||||
| // Immutable: delete and recreate the GitTarget to change its destination. | ||||||||||||||
| // +required | ||||||||||||||
| ProviderRef GitProviderReference `json:"providerRef"` | ||||||||||||||
|
|
||||||||||||||
| // Branch to use for this target. | ||||||||||||||
| // Must be one of the allowed branches in the provider. | ||||||||||||||
| // Immutable: delete and recreate the GitTarget to change its destination. | ||||||||||||||
| // +required | ||||||||||||||
| Branch string `json:"branch"` | ||||||||||||||
|
|
||||||||||||||
| // Path within the repository to write resources to. | ||||||||||||||
| // +optional | ||||||||||||||
| Path string `json:"path,omitempty"` | ||||||||||||||
| // Path within the repository to write resources to, relative to the repository | ||||||||||||||
| // root. Required and must be non-empty — there is no default, so a GitTarget can | ||||||||||||||
| // never silently write to the repository root. To deliberately target the | ||||||||||||||
| // repository root, set it to "." (the ArgoCD/Flux convention); an empty string is | ||||||||||||||
| // rejected because it is too easy to leave blank by accident to be a deliberate | ||||||||||||||
| // root choice. Any leading slash (absolute path) and ".." are rejected, and a | ||||||||||||||
| // trailing slash is normalized away. | ||||||||||||||
| // Immutable: delete and recreate the GitTarget to change its destination. | ||||||||||||||
| // +required | ||||||||||||||
| // +kubebuilder:validation:MinLength=1 | ||||||||||||||
| Path string `json:"path"` | ||||||||||||||
|
Comment on lines
+78
to
+80
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This change can reject updates (including status updates) for pre-existing 🛠️ Safer rollout approach- // +required
- // +kubebuilder:validation:MinLength=1
- Path string `json:"path"`
+ // +optional
+ // TEMPORARY: keep optional for one migration window; enforce required after backfill.
+ Path string `json:"path,omitempty"`Then run a migration/backfill to set explicit values (e.g. 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||
|
|
||||||||||||||
| // Encryption defines encryption settings for Secret resource writes. | ||||||||||||||
| // +optional | ||||||||||||||
|
|
||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: ConfigButler/gitops-reverser
Length of output: 115
🏁 Script executed:
Repository: ConfigButler/gitops-reverser
Length of output: 1524
🏁 Script executed:
Repository: ConfigButler/gitops-reverser
Length of output: 124
🏁 Script executed:
Repository: ConfigButler/gitops-reverser
Length of output: 2188
Verify valkey-cli artifact integrity before installation.
Lines 142-144 download and extract
valkey-cliwithout checksum/signature verification, unlike nearby installs that validate SHA256 checksums. This weakens supply-chain guarantees for the dev/CI image.🔒 Suggested hardening pattern
🤖 Prompt for AI Agents