Skip to content

Conversation

@imeoer
Copy link
Collaborator

@imeoer imeoer commented Jan 28, 2026

Overview

Add HTTP API endpoints to update and query daemon configuration at
runtime without restarting nydusd. This is particularly useful for
refreshing registry credentials when tokens expire.

Key changes:

  • Add GET/PUT /api/v1/config endpoints for configuration management
  • Add config module in utils for centralized configuration updates
  • Add smoke test cases for hot reload configuration API
  • Update documentation with hot reload usage examples

Related Issues

containerd/nydus-snapshotter#690

Change Details

Please describe your changes in detail:

Test Results

If you have any relevant screenshots or videos that can help illustrate your changes, please add them here.

Change Type

Please select the type of change your pull request relates to:

  • Bug Fix
  • Feature Addition
  • Documentation Update
  • Code Refactoring
  • Performance Improvement
  • Other (please describe)

Self-Checklist

Before submitting a pull request, please ensure you have completed the following:

  • I have run a code style check and addressed any warnings/errors.
  • I have added appropriate comments to my code (if applicable).
  • I have updated the documentation (if applicable).
  • I have written appropriate unit tests.

@imeoer imeoer force-pushed the registry-auth-reload branch 2 times, most recently from 009e6db to 1c76116 Compare January 28, 2026 08:37
@codecov
Copy link

codecov bot commented Jan 28, 2026

Codecov Report

❌ Patch coverage is 78.05486% with 88 lines in your changes missing coverage. Please review.
✅ Project coverage is 56.72%. Comparing base (2e78348) to head (25bb400).

Files with missing lines Patch % Lines
api/src/http_endpoint_v1.rs 0.00% 19 Missing ⚠️
storage/src/backend/registry.rs 37.93% 18 Missing ⚠️
src/bin/nydusd/api_server_glue.rs 0.00% 16 Missing ⚠️
storage/src/factory.rs 18.75% 10 Missing and 3 partials ⚠️
rafs/src/fs.rs 52.94% 7 Missing and 1 partial ⚠️
utils/src/config.rs 98.61% 4 Missing ⚠️
src/bin/nydus-image/main.rs 0.00% 3 Missing ⚠️
storage/src/device.rs 62.50% 2 Missing and 1 partial ⚠️
service/src/fs_cache.rs 0.00% 2 Missing ⚠️
rafs/src/metadata/mod.rs 0.00% 1 Missing ⚠️
... and 1 more
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1864      +/-   ##
==========================================
+ Coverage   56.53%   56.72%   +0.18%     
==========================================
  Files         199      200       +1     
  Lines       52094    52438     +344     
  Branches    44897    45241     +344     
==========================================
+ Hits        29453    29745     +292     
- Misses      21156    21208      +52     
  Partials     1485     1485              
Files with missing lines Coverage Δ
api/src/http.rs 0.00% <ø> (ø)
api/src/http_handler.rs 53.08% <ø> (ø)
service/src/blob_cache.rs 82.71% <100.00%> (ø)
storage/src/cache/filecache/mod.rs 66.43% <ø> (ø)
storage/src/cache/fscache/mod.rs 74.46% <ø> (ø)
utils/src/lib.rs 98.78% <ø> (ø)
rafs/src/metadata/mod.rs 68.15% <0.00%> (ø)
service/src/fs_service.rs 38.86% <0.00%> (ø)
service/src/fs_cache.rs 28.09% <0.00%> (-0.05%) ⬇️
src/bin/nydus-image/main.rs 0.52% <0.00%> (ø)
... and 7 more

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@imeoer imeoer force-pushed the registry-auth-reload branch 2 times, most recently from 466d21f to 319eba9 Compare January 28, 2026 09:46
@imeoer imeoer marked this pull request as ready for review January 28, 2026 11:39
@imeoer imeoer requested review from BraveY and Zephyrcf January 28, 2026 11:43
Add HTTP API endpoints to update and query daemon configuration at
runtime without restarting nydusd. This is particularly useful for
refreshing registry credentials when tokens expire.

Key changes:
- Add GET/PUT /api/v1/config endpoints for configuration management
- Add config module in utils for centralized configuration updates
- Add smoke test cases for hot reload configuration API
- Update documentation with hot reload usage examples

Signed-off-by: imeoer <[email protected]>
@imeoer imeoer force-pushed the registry-auth-reload branch from 319eba9 to 25bb400 Compare January 28, 2026 11:53
@imeoer imeoer changed the title storage: add config mod for registry auth updates api: support hot reload of registry authentication Jan 28, 2026
Copy link
Contributor

@Fricounet Fricounet left a comment

Choose a reason for hiding this comment

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

LGTM in terms of doing what we need for the mentioned issue. I'm not a big rust expert though so take my review with a pinch of salt.
Nice documentation though!

Copy link
Member

@Zephyrcf Zephyrcf left a comment

Choose a reason for hiding this comment

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

LGTM!

impl Registry {
#[allow(clippy::useless_let_if_seq)]
pub fn new(config: &RegistryConfig, id: Option<&str>) -> Result<Registry> {
let id = id.ok_or_else(|| einval!("Registry backend requires blob_id"))?;
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like the id parameter now represents a mountpoint ID rather than a blob ID.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks, let me check this, the blob ID seems to be useless, it should be used as a mountpoint.

let registry = Registry {
connection,
state,
metrics: BackendMetrics::new(id, "registry"),
Copy link
Contributor

Choose a reason for hiding this comment

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

Because this id is no longer blobdid, the corresponding previous read and write statistics for blobid level no longer exist, this behavior change is very large, I think we need to consider adding a mountpoint id as a parameter, instead of directly changing the original blobid to mountpointid.

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.

4 participants