Skip to content

Move pgbackrest-restore test to Kyverno Chainsaw #4228

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

cbandy
Copy link
Member

@cbandy cbandy commented Aug 1, 2025

Checklist:

  • Have you added an explanation of what your changes do and why you'd like them to be included?
  • Have you updated or added documentation for the change, as applicable?
  • Have you tested your changes on all related environments with successful results, as applicable?
    • Have you added automated tests?

Type of Changes:

  • Testing enhancement

Other Information:

This test failed in this other PR, and the KUTTL logs did not give me enough information to diagnose the cause. Chainsaw did much better and unblocked me over there.

cbandy added 3 commits August 1, 2025 14:54
This test has a number of scripts and jobs that pass and share data.
Chainsaw's bindings and templates are a nice way to break this test up,
and its "catch" operations provide good context when a step fails.

Tested with Kyverno Chainsaw 0.2.12

See: https://kyverno.github.io/chainsaw/main
This helped me reproduce a race in "pg_ctl start" during Postgres recovery.

Issue: PGO-1945
Copy link
Contributor

@ValClarkson ValClarkson left a comment

Choose a reason for hiding this comment

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

LGTM

use: { template: '21-lose-data.yaml' }

- name: 'Point-In-Time Restore'
use: { template: '22-point-in-time-restore.yaml' }
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it worth it to regularize the file/template names? I always liked the numbered files because you can just read through a directory (well, could, before we started to use the subdir files), but if Chainsaw uses this file to sequence the tests, maybe another convention is worth talking about (at a later date!)

Copy link
Member Author

Choose a reason for hiding this comment

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

Definitely. I think I started with numbers close to the KUTTL ones to ease review/migration, but where I landed is not that!

I like the filenames going in a similar order as the test, too, but now they can get reused so... 🤷🏻

Maybe something more like "scenario one," "... two," 🤔 🌱

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, if the templates are being reused (hopefully!), then putting them in order doesn't make sense. Maybe descriptive titles could make it easier to read?

run: |
curl -Lo /usr/local/bin/kubectl-kuttl https://github.com/kudobuilder/kuttl/releases/download/v0.13.0/kubectl-kuttl_0.13.0_linux_x86_64
chmod +x /usr/local/bin/kubectl-kuttl

Copy link
Contributor

Choose a reason for hiding this comment

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

We don't need to install KUTTL any longer?

Copy link
Member Author

@cbandy cbandy Aug 1, 2025

Choose a reason for hiding this comment

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

The Make targets do go run ...@latest by default. The binary download is faster, but not as easy to latest.

I'm on the fence. Do you have a preference?

Confirm that data was restored to the point-in-time and the cluster is healthy
use: { template: '23-verify-primary.yaml' }

- name: 'Confirm Replica'
Copy link
Contributor

Choose a reason for hiding this comment

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

Again: not for today, but I wonder if we could templatize a verify step and reuse it in our 4 verify steps. Note: this is the longest sustained look I've had at chainsaw

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm. I thought I was reusing verify 02 and 12, but i see each only once.

Should those be like this?

  1. Create Data [A] on [one]
  2. Verify Data [A] on [one] <-- new
  3. Clone [one] to [two]
  4. Verify Data [A] on [two]

@@ -0,0 +1,62 @@
apiVersion: chainsaw.kyverno.io/v1alpha1
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this file getting called?

Copy link
Member Author

Choose a reason for hiding this comment

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

It is not. I used it while diagnosing a bug about parameters in the WAL stream a long time ago.

I called this multiple times from the main test to... 🤔 raise and lower max_connections maybe. 44b1847

Copy link
Member Author

Choose a reason for hiding this comment

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

🔧 If the file stays, it deserves a comment explaining what it does and why it isn't currently used.

Copy link
Member Author

Choose a reason for hiding this comment

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

This is looking a lot like 11 ...

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.

3 participants