Skip to content

WIP: etcd backups - #2952

Draft
bhperry wants to merge 1 commit into
openshift:masterfrom
bhperry:etcd-backups
Draft

WIP: etcd backups#2952
bhperry wants to merge 1 commit into
openshift:masterfrom
bhperry:etcd-backups

Conversation

@bhperry

@bhperry bhperry commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 24, 2026
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: LGTM mode

@openshift-ci

openshift-ci Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci

openshift-ci Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Hello @bhperry! Some important instructions when contributing to openshift/api:
API design plays an important part in the user experience of OpenShift and as such API PRs are subject to a high level of scrutiny to ensure they follow our best practices. If you haven't already done so, please review the OpenShift API Conventions and ensure that your proposed changes are compliant. Following these conventions will help expedite the api review process for your PR.

@openshift-ci openshift-ci Bot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Jul 24, 2026
@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 26fbc846-9acd-4566-9541-ba75ee511f51

📥 Commits

Reviewing files that changed from the base of the PR and between b01bf67 and 8887fba.

⛔ Files ignored due to path filters (16)
  • config/v1alpha1/zz_generated.crd-manifests/0000_10_config-operator_01_backups.crd.yaml is excluded by !**/zz_generated.crd-manifests/*
  • config/v1alpha1/zz_generated.deepcopy.go is excluded by !**/zz_generated*
  • config/v1alpha1/zz_generated.featuregated-crd-manifests.yaml is excluded by !**/zz_generated*
  • config/v1alpha1/zz_generated.featuregated-crd-manifests/backups.config.openshift.io/AutomatedEtcdBackup.yaml is excluded by !**/zz_generated.featuregated-crd-manifests/**
  • config/v1alpha1/zz_generated.model_name.go is excluded by !**/zz_generated*
  • config/v1alpha1/zz_generated.swagger_doc_generated.go is excluded by !**/zz_generated*
  • openapi/generated_openapi/zz_generated.openapi.go is excluded by !openapi/**, !**/zz_generated*
  • openapi/openapi.json is excluded by !openapi/**
  • operator/v1alpha1/zz_generated.crd-manifests/0000_10_etcd_01_etcdbackuppolicies.crd.yaml is excluded by !**/zz_generated.crd-manifests/*
  • operator/v1alpha1/zz_generated.crd-manifests/0000_10_etcd_01_etcdbackups.crd.yaml is excluded by !**/zz_generated.crd-manifests/*
  • operator/v1alpha1/zz_generated.deepcopy.go is excluded by !**/zz_generated*
  • operator/v1alpha1/zz_generated.featuregated-crd-manifests.yaml is excluded by !**/zz_generated*
  • operator/v1alpha1/zz_generated.featuregated-crd-manifests/etcdbackuppolicies.operator.openshift.io/AutomatedEtcdBackup.yaml is excluded by !**/zz_generated.featuregated-crd-manifests/**
  • operator/v1alpha1/zz_generated.featuregated-crd-manifests/etcdbackups.operator.openshift.io/AutomatedEtcdBackup.yaml is excluded by !**/zz_generated.featuregated-crd-manifests/**
  • operator/v1alpha1/zz_generated.model_name.go is excluded by !**/zz_generated*
  • operator/v1alpha1/zz_generated.swagger_doc_generated.go is excluded by !**/zz_generated*
📒 Files selected for processing (7)
  • config/v1alpha1/register.go
  • config/v1alpha1/types_backup.go
  • operator/v1alpha1/register.go
  • operator/v1alpha1/types_etcdbackup.go
  • operator/v1alpha1/types_etcdbackuppolicy.go
  • payload-manifests/crds/0000_10_config-operator_01_backups.crd.yaml
  • payload-manifests/crds/0000_10_etcd_01_etcdbackups.crd.yaml
💤 Files with no reviewable changes (2)
  • config/v1alpha1/types_backup.go
  • config/v1alpha1/register.go
🚧 Files skipped from review as they are similar to previous changes (5)
  • payload-manifests/crds/0000_10_config-operator_01_backups.crd.yaml
  • operator/v1alpha1/register.go
  • payload-manifests/crds/0000_10_etcd_01_etcdbackups.crd.yaml
  • operator/v1alpha1/types_etcdbackuppolicy.go
  • operator/v1alpha1/types_etcdbackup.go

📝 Walkthrough

Walkthrough

The change replaces EtcdBackup PVC-only configuration with PVC or local storage, adds node and backup file status fields, and introduces typed job references. It adds the cluster-scoped EtcdBackupPolicy API with scheduling, node selection, storage, retention, and status fields. Matching CRD schemas and scheme registrations are updated, while config backup types are removed from config API registration and CRI-O credential provider types are registered.

🚥 Pre-merge checks | ✅ 14 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive No pull request description was provided, so its relevance to the changeset can't be meaningfully assessed. Add a short description summarizing the purpose and scope of the etcd backup changes.
✅ Passed checks (14 passed)
Check name Status Explanation
Title check ✅ Passed The title names the main area of change, etcd backups, though it is prefixed with WIP.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed No changed *_test.go files or Ginkgo title declarations appear in the diff; the modified files are API/CRD generators, not tests.
Test Structure And Quality ✅ Passed No test files or Ginkgo/Eventually/Expect blocks changed in this PR, so the test-quality check is not applicable.
Microshift Test Compatibility ✅ Passed No new Ginkgo tests were added; the patch only updates API types/CRDs and generated manifests, so MicroShift compatibility isn’t implicated.
Single Node Openshift (Sno) Test Compatibility ✅ Passed No *_test.go files or Ginkgo test additions were changed; the PR only touches API/CRD/type-registration files.
Topology-Aware Scheduling Compatibility ✅ Passed PASS: The PR only changes API/CRD schemas; no Deployment/Pod specs, replicas, affinity, or topology checks were added, so no topology-sensitive scheduling logic was introduced.
Ote Binary Stdout Contract ✅ Passed Changed files are API types/CRDs only; no main/init/TestMain/suite setup or stdout logging writes were added.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed No new Ginkgo/e2e tests were added; the diff is limited to API types/CRDs and generated docs, with no test files or IPv4/external connectivity assumptions.
No-Weak-Crypto ✅ Passed Changed files are API/CRD schema only; scans found no md5/sha1/des/rc4/3DES/Blowfish/ECB, crypto imports, or secret comparisons.
Container-Privileges ✅ Passed Changed files are API types/CRDs only; exact searches found no privileged, hostPID, hostNetwork, hostIPC, SYS_ADMIN, or allowPrivilegeEscalation settings.
No-Sensitive-Data-In-Logs ✅ Passed Changed files only update API types/CRDs; no logger/printf calls or sensitive-data logging patterns appear in the diff.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (2.12.2)

Error: build linters: unable to load custom analyzer "kubeapilinter": tools/_output/bin/kube-api-linter.so, plugin: not implemented
The command is terminated due to an error: build linters: unable to load custom analyzer "kubeapilinter": tools/_output/bin/kube-api-linter.so, plugin: not implemented


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.

@openshift-ci

openshift-ci Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign joelspeed for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🧹 Nitpick comments (1)
operator/v1alpha1/types_etcdbackuppolicy.go (1)

34-44: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

No format validation for Schedule (cron) or TimeZone, unlike the legacy Backup CRD it supersedes.

The pre-existing config.openshift.io Backup.spec.etcd.schedule/timeZone fields enforced cron and IANA-timezone patterns; the new EtcdBackupPolicySpec fields have no equivalent, so invalid cron expressions can be persisted.
[recommended_refactor_low_effort_note]

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@operator/v1alpha1/types_etcdbackuppolicy.go` around lines 34 - 44, Add
equivalent validation markers to EtcdBackupPolicySpec.Schedule and TimeZone,
enforcing valid cron expressions for Schedule and valid IANA time-zone names for
TimeZone as the superseded Backup CRD did. Preserve Schedule as required and
TimeZone as optional while ensuring invalid values are rejected during CRD
validation.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@operator/v1alpha1/types_etcdbackup.go`:
- Around line 90-94: Update the kubebuilder XValidation message on the Path
field to say “path is immutable once set” instead of referring to “name”; leave
the immutability rule and other field metadata unchanged.

In `@operator/v1alpha1/types_etcdbackuppolicy.go`:
- Around line 52-55: Add non-negative validation for both NodeCount and
MaxQuantity using the appropriate Kubernetes validation markers, while
preserving NodeCount’s zero behavior for selecting all nodes. Mark NodeCount
with +optional consistently with its sibling fields, and update the
corresponding field declarations/documentation so generated CRD schemas reject
negative values.
- Around line 70-95: Update EtcdBackupPolicyRetentionRule to make the
discriminator enum accept both MaxQuantity and MaxSize. Add the corresponding
+unionMember tags to MaxQuantity and MaxSize, and add conditional XValidation
rules matching the EtcdBackupStorage union pattern so the field selected by Type
is required while the other is unset.

In `@payload-manifests/crds/0000_10_etcd_01_etcdbackups.crd.yaml`:
- Around line 88-94: Regenerate this CRD after correcting the kubebuilder
validation marker for the Path field in the EtcdBackup Go type, so the generated
validation message identifies “path” rather than “name.” Do not edit the
generated YAML directly.

---

Nitpick comments:
In `@operator/v1alpha1/types_etcdbackuppolicy.go`:
- Around line 34-44: Add equivalent validation markers to
EtcdBackupPolicySpec.Schedule and TimeZone, enforcing valid cron expressions for
Schedule and valid IANA time-zone names for TimeZone as the superseded Backup
CRD did. Preserve Schedule as required and TimeZone as optional while ensuring
invalid values are rejected during CRD validation.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: b85840b1-9249-43dc-8ef7-89d067ce8593

📥 Commits

Reviewing files that changed from the base of the PR and between 967cc4c and f0c10e6.

⛔ Files ignored due to path filters (16)
  • config/v1alpha1/zz_generated.crd-manifests/0000_10_config-operator_01_backups.crd.yaml is excluded by !**/zz_generated.crd-manifests/*
  • config/v1alpha1/zz_generated.deepcopy.go is excluded by !**/zz_generated*
  • config/v1alpha1/zz_generated.featuregated-crd-manifests.yaml is excluded by !**/zz_generated*
  • config/v1alpha1/zz_generated.featuregated-crd-manifests/backups.config.openshift.io/AutomatedEtcdBackup.yaml is excluded by !**/zz_generated.featuregated-crd-manifests/**
  • config/v1alpha1/zz_generated.model_name.go is excluded by !**/zz_generated*
  • config/v1alpha1/zz_generated.swagger_doc_generated.go is excluded by !**/zz_generated*
  • openapi/generated_openapi/zz_generated.openapi.go is excluded by !openapi/**, !**/zz_generated*
  • openapi/openapi.json is excluded by !openapi/**
  • operator/v1alpha1/zz_generated.crd-manifests/0000_10_etcd_01_etcdbackuppolicies.crd.yaml is excluded by !**/zz_generated.crd-manifests/*
  • operator/v1alpha1/zz_generated.crd-manifests/0000_10_etcd_01_etcdbackups.crd.yaml is excluded by !**/zz_generated.crd-manifests/*
  • operator/v1alpha1/zz_generated.deepcopy.go is excluded by !**/zz_generated*
  • operator/v1alpha1/zz_generated.featuregated-crd-manifests.yaml is excluded by !**/zz_generated*
  • operator/v1alpha1/zz_generated.featuregated-crd-manifests/etcdbackuppolicies.operator.openshift.io/AutomatedEtcdBackup.yaml is excluded by !**/zz_generated.featuregated-crd-manifests/**
  • operator/v1alpha1/zz_generated.featuregated-crd-manifests/etcdbackups.operator.openshift.io/AutomatedEtcdBackup.yaml is excluded by !**/zz_generated.featuregated-crd-manifests/**
  • operator/v1alpha1/zz_generated.model_name.go is excluded by !**/zz_generated*
  • operator/v1alpha1/zz_generated.swagger_doc_generated.go is excluded by !**/zz_generated*
📒 Files selected for processing (7)
  • config/v1alpha1/register.go
  • config/v1alpha1/types_backup.go
  • operator/v1alpha1/register.go
  • operator/v1alpha1/types_etcdbackup.go
  • operator/v1alpha1/types_etcdbackuppolicy.go
  • payload-manifests/crds/0000_10_config-operator_01_backups.crd.yaml
  • payload-manifests/crds/0000_10_etcd_01_etcdbackups.crd.yaml
💤 Files with no reviewable changes (2)
  • config/v1alpha1/types_backup.go
  • config/v1alpha1/register.go

Comment thread operator/v1alpha1/types_etcdbackup.go
Comment thread operator/v1alpha1/types_etcdbackuppolicy.go
Comment thread operator/v1alpha1/types_etcdbackuppolicy.go
Comment thread payload-manifests/crds/0000_10_etcd_01_etcdbackups.crd.yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant