Skip to content

Move kube-save-var-lib under vault#5745

Merged
eriknordmark merged 1 commit into
lf-edge:masterfrom
andrewd-zededa:eve-k-save-var-lib-vault
Apr 25, 2026
Merged

Move kube-save-var-lib under vault#5745
eriknordmark merged 1 commit into
lf-edge:masterfrom
andrewd-zededa:eve-k-save-var-lib-vault

Conversation

@andrewd-zededa
Copy link
Copy Markdown
Contributor

@andrewd-zededa andrewd-zededa commented Apr 3, 2026

In kube service container startup (setup_prereqs), after vault is ready begin
migrating kube-save-var-lib with the same process used to snapshot and restore
it currently.

Cannot perform a simple rename as src and dest can be on separate fs.
Copy with archive to preserve mode, ownership and timestamps.

PR dependencies

None

How to test and validate this PR

  • Deploy eve-k node before this change, wait until /var/lib/all_components_initialized visible (after eve enter kube)
  • confirm /persist/kube-save-var-lib exists
  • upgrade to release including this
  • Confirm /persist/kube-save-var-lib no longer exists, and is moved to /persist/vault/kube-save-var-lib

Changelog notes

PR Backports

  • 16.0-stable: To be backported.
  • 14.5-stable: No, as the feature is not available there.
  • 13.4-stable: No, as the feature is not available there.

Checklist

  • I've provided a proper description
  • I've added the proper documentation
  • I've tested my PR on amd64 device
  • I've tested my PR on arm64 device
  • I've written the test verification instructions
  • I've set the proper labels to this PR

And the last but not least:

  • I've checked the boxes above, or I've provided a good reason why I didn't
    check them.

Please, check the boxes above after submitting the PR in interactive mode.

@andrewd-zededa
Copy link
Copy Markdown
Contributor Author

Can someone add stable label?

@andrewd-zededa andrewd-zededa force-pushed the eve-k-save-var-lib-vault branch from 3118513 to e8f11e4 Compare April 3, 2026 22:43
@andrewd-zededa andrewd-zededa marked this pull request as ready for review April 3, 2026 22:53
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 24.36%. Comparing base (2281599) to head (ae227de).
⚠️ Report is 589 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5745      +/-   ##
==========================================
+ Coverage   19.52%   24.36%   +4.83%     
==========================================
  Files          19       24       +5     
  Lines        3021     5314    +2293     
==========================================
+ Hits          590     1295     +705     
- Misses       2310     3799    +1489     
- Partials      121      220      +99     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

@naiming-zededa naiming-zededa left a comment

Choose a reason for hiding this comment

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

LGTM

@eriknordmark eriknordmark added the stable Should be backported to stable release(s) label Apr 5, 2026
Comment thread pkg/pillar/cmd/upgradeconverter/movekubesavevarlib.go Outdated
Copy link
Copy Markdown
Contributor

@eriknordmark eriknordmark left a comment

Choose a reason for hiding this comment

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

LGTM

@andrewd-zededa
Copy link
Copy Markdown
Contributor Author

Hold on this merge, seeing an issue in testing.

@andrewd-zededa andrewd-zededa marked this pull request as draft April 6, 2026 17:56
@andrewd-zededa andrewd-zededa force-pushed the eve-k-save-var-lib-vault branch from e8f11e4 to d0c10db Compare April 6, 2026 21:06
Comment thread pkg/pillar/cmd/upgradeconverter/movekubesavevarlib.go Fixed
Comment thread pkg/pillar/cmd/upgradeconverter/movekubesavevarlib.go Fixed
@andrewd-zededa andrewd-zededa force-pushed the eve-k-save-var-lib-vault branch 4 times, most recently from b6008d1 to 625ec66 Compare April 7, 2026 18:05
In kube service container startup (setup_prereqs), after vault is ready begin
migrating kube-save-var-lib with the same process used to snapshot and restore
it currently.

Cannot perform a simple rename as src and dest can be on separate fs.
Copy with archive to preserve mode, ownership and timestamps.

Signed-off-by: Andrew Durbin <andrewd@zededa.com>
@andrewd-zededa andrewd-zededa force-pushed the eve-k-save-var-lib-vault branch from 625ec66 to ae227de Compare April 21, 2026 19:32
@andrewd-zededa andrewd-zededa marked this pull request as ready for review April 21, 2026 19:33
@andrewd-zededa
Copy link
Copy Markdown
Contributor Author

Moved this to a migration function in the kube service container to simplify

Copy link
Copy Markdown
Contributor

@eriknordmark eriknordmark left a comment

Choose a reason for hiding this comment

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

Can't this be done using pkg/pillar/cmd/upgradeconverter?

Also, there is a list of path names in /persist/ we use for 1) reporting memory usage and 2) freeing up space to avoid failing to boot.
Is the new directory in those lists? (First one is in zedagent or volumemgr, second one in one of the scripts - I think storage-init).

@andrewd-zededa
Copy link
Copy Markdown
Contributor Author

Can't this be done using pkg/pillar/cmd/upgradeconverter?

Also, there is a list of path names in /persist/ we use for 1) reporting memory usage and 2) freeing up space to avoid failing to boot. Is the new directory in those lists? (First one is in zedagent or volumemgr, second one in one of the scripts - I think storage-init).

I had an attempt at implementing it in the upgradeconverter and ended up reimplementing a lot of copy path to handle the odd files in the save-var-lib bundle like some sockets and ownership/permissions. cp -a was one line instead. I see your point about the directory paths to report space, I will look into that.

@eriknordmark eriknordmark merged commit 647a03b into lf-edge:master Apr 25, 2026
40 of 47 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stable Should be backported to stable release(s)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants