Skip to content

feat: remove empty properties from etcd-cluster spec to avoid ArgoCD drifting - #301

Closed
Arturo (apenen) wants to merge 216 commits into
cozystack:mainfrom
apenen:patch-1
Closed

feat: remove empty properties from etcd-cluster spec to avoid ArgoCD drifting#301
Arturo (apenen) wants to merge 216 commits into
cozystack:mainfrom
apenen:patch-1

Conversation

@apenen

@apenen Arturo (apenen) commented Dec 3, 2025

Copy link
Copy Markdown

ArgoCD keeps detecting pending changes because Kubernetes omits empty fields on apply. Removing these fields from the spec prevents unnecessary diffs.

Summary by CodeRabbit

  • Schema Updates
    • Updated the etcd-operator CRD: validation for pod template specification has been relaxed to accept a broader set of fields while retaining the requirement for container definitions and preserving unknown fields. This enables more flexible pod template configurations without changing required structural elements.

✏️ Tip: You can customize this high-level summary in your review settings.

Andrei Kvapil (kvaps) and others added 30 commits March 7, 2024 16:21
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
Update kubebuilder to v3.14.0
Generated and wrote the most basic EtcdCluster custom resource.
See cozystack#9
Fixes from comments cozystack#15 
- Fix API group name for custom resources
- remove unnecessary comment lines
1. Union argument layers and copy source code.
2. Changed layers order final image for grow cache hit
fixes: cozystack#10

Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
- Added basic validating and defaulting webhooks
- Added simple test for defaulting webhook
Controller now can successfully bootstrap etcd cluster :)

Controller creates Service, ConfigMap and StatefulSet based on
EtcdCluster CR
Only EmptyDir storage is supported
Initialized status is being set and updated
Proof that it works:
https://github.com/hiddenmarten/etcd-operator/pull/1

After that just changed the name of the label, to the easier one.
Update cluster Ready status according to StatefulSet status and update
ConfigMap cluster state to `existing` after first time STS is ready
fixes cozystack#24
fixes cozystack#23 
fixes cozystack#30

---------

Co-authored-by: Kirill Ilin <stitch14@yandex.ru>
Co-authored-by: Kirill Garbar <kirill@garbar.pro>
The auxiliary GH action to setup release drafts and update change log
accordingly. Configured with autolabeler, so the PRs will be labeled
according to the PR branch name and/or files changed:

| Branch name  | Files changed | Resulting label |
| ------------- | ------------- | ------------- |
| deps/*  |  | `dependencies`  |
| chore/*  |  | `chore`  |
| docs/* | **/*.md | `documentation` |
| enh/* |  | `enhancement` |
| feature/* |  | `feature` |
| fix/* |  | `bugfix` |
| bugfix/* |  | `bugfix` |
|  | /api/* | `api-change` |
|  | /internal/* | `controllers` |

Based on labels release draft will be updated with 'Features', 'Bug
Fixes' and 'Maintenance' categories which will include corresponding
PR's title.
It's also possible to manage release draft's version by applying
`major`, `minor` and `patch` labels on PR. By default the version will
be the next patch version after the last release, v0.0.1 if none.

---------

Signed-off-by: Artem Bortnikov <artem.bortnikov@telekom.com>
Explicit RW permissions for content and pull requests required, due to
repository settings, which grants to workflows only read permissions in
the repository for the contents and packages scopes.

- RW for content is required for release draft creation
(release-drafter).
- RW for pull-requests is required for adding labels to PRs
(auto-labeler).

Signed-off-by: Artem Bortnikov <artem.bortnikov@telekom.com>
…ck#44)

in order to access cluster from clients using one IP we decided to use
ClusterIP Service
Created basic docs site and filled content for main pages
This is important when scaling cluster up for this operation to be zero down time
fixes cozystack#25
In case error happens during status update request, reconcile will not
be requeued. So, this call should be moved ouside `defer` function
fixes cozystack#36
Just an idea to create `CODEOWNERS` to automatically assign reviewers
when changing specific part of code.
Is there anybody who would like to keep informed about updates?

Aproove from codeowners is required to merge every specific change.
Subj. Without such import, there is auth error:

```
Error setting up etcd client: error creating Kubernetes client: no Auth Provider found for name "oidc"
```

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **New Features**
- Introduced commands for managing etcd pods, including status checks,
defragmentation, compaction, alarm management, and member management.
  
- **Bug Fixes**
- Standardized error handling for improved user feedback during command
execution.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
* We create several etcd clients in the reconciliation loop, but never
  had a defer .Close() for them.
* We erroneously try to configure these clients with etcd-0 instead of
  etcd-0.etcd-headless.namespace as the url.

Now fixed.

Signed-off-by: Timofei Larkin <lllamnyp@gmail.com>
Signed-off-by: Timofei Larkin <lllamnyp@gmail.com>
Signed-off-by: Timofei Larkin <lllamnyp@gmail.com>
* Several `defer c.Close()` added to clean up etcd clients after reconciliation.
* DNS names targeting etcd cluster members fixed to resolve properly.
* TLS capability added to etcd clients created during reconciliation.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Documentation**
- Added Kirill Klinchenkov and Timofei Larkin as new maintainers in the
maintainers list.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Resolves cozystack#273

Signed-off-by: Timofei Larkin <lllamnyp@gmail.com>
…drifting

ArgoCD keeps detecting pending changes because Kubernetes omits empty fields on apply. Removing these fields from the spec prevents unnecessary diffs.
@coderabbitai

coderabbitai Bot commented Dec 3, 2025

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b0b0bb31-6fa0-4515-86b6-a4068cd8ab5c

📥 Commits

Reviewing files that changed from the base of the PR and between 0570ab0 and 4891761.

📒 Files selected for processing (1)
  • charts/etcd-operator/crds/etcd-cluster.yaml
💤 Files with no reviewable changes (1)
  • charts/etcd-operator/crds/etcd-cluster.yaml

📝 Walkthrough

Walkthrough

Removed an empty properties: {} entry from spec.podTemplate.spec in the EtcdCluster CRD schema, leaving required: [containers] and x-kubernetes-preserve-unknown-fields: true intact to allow additional pod spec fields.

Changes

Cohort / File(s) Summary
CRD Schema Loosening
charts/etcd-operator/crds/etcd-cluster.yaml
Deleted an explicit empty properties: {} under spec.podTemplate.spec in the OpenAPIV3Schema, loosening validation while preserving required: [containers] and x-kubernetes-preserve-unknown-fields: true.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 I nudged a brace and set schema free,
The podTemplate breathes a little more glee.
Empty boxes gone, fields may roam,
Containers still needed — they anchor the home. 🥕

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: removing empty properties from the etcd-cluster spec to prevent ArgoCD drifting issues.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sircthulhu

Copy link
Copy Markdown
Collaborator

Hi, Arturo (@apenen)! This change will be overriden by commands

make manifests
make helm-crd-copy

So changes need to be made to api/v1alpha1/etcdcluster_types.go

Andrei Kvapil (kvaps) and others added 4 commits March 13, 2026 13:07
…ystack#308)

## Summary
- Replace deprecated `gcr.io/kubebuilder/kube-rbac-proxy:v0.16.0` with
`quay.io/brancz/kube-rbac-proxy:v0.18.1`
- The GCR-hosted image became unavailable after March 18, 2025
- The new image is from the original upstream author (brancz)

Fixes cozystack#271

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Chores**
* Updated authentication proxy image to
quay.io/brancz/kube-rbac-proxy:v0.18.1 across deployment configs and
Helm chart values.

* **Documentation**
* API reference updated to mark numerous embedded and top-level fields
as optional, clarifying optionality for specs like replicas, storage,
security, TLS, metadata, and pod disruption settings.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
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.