Skip to content

Add UpstreamPulp.remote_policy for remotes created during replication - #8016

Open
pablomh wants to merge 2 commits into
pulp:mainfrom
pablomh:replica-remote-download-policy
Open

Add UpstreamPulp.remote_policy for remotes created during replication#8016
pablomh wants to merge 2 commits into
pulp:mainfrom
pablomh:replica-remote-download-policy

Conversation

@pablomh

@pablomh pablomh commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Remotes created by replicate() never received an explicit download policy, so they used Remote.policy's default (immediate) and downloaded all artifacts.
  • Add nullable UpstreamPulp.remote_policy (immediate / on_demand / streamed) and copy it onto remotes via _build_remote_settings() when set. Unset keeps today's default.
  • Distinct from UpstreamPulp.policy (all / labeled / nodelete). Katello can set remote_policy=on_demand for Capsules.

Dependency

  • This PR is currently stacked on top of #8013 because both changes touch the replication task setup in pulpcore/app/tasks/replica.py.
  • Once #8013 merges, this branch should be rebased onto main again so the PR contains only the remote_policy change.

Test plan

  • Unit: _build_remote_settings omits policy when unset and includes it when set to on_demand
  • Functional: regenerate client bindings, then test_replication_remote_policy (create with on_demand, update to streamed)
  • Confirm existing replicate without remote_policy still creates remotes with immediate
  • CI green on this PR

Made with Cursor

@pablomh
pablomh force-pushed the replica-remote-download-policy branch 2 times, most recently from fc37121 to 4745030 Compare August 27, 2026 08:31
Replication over HTTPS wrote the CA, client cert, and client key to NamedTemporaryFiles but only kept their paths, so CPython deleted earlier files before pulp-glue could load the upstream API with TLS verification. Keep those files alive for the duration of replicate(), pass the CA bundle path directly as verify_ssl, add regression coverage for the TLS handoff, and clean up the temp files on exit.

Assisted-By: Cursor
Co-authored-by: Cursor <cursoragent@cursor.com>
@pablomh
pablomh force-pushed the replica-remote-download-policy branch from 4745030 to 9b931ed Compare August 27, 2026 08:36
replicate() never set Remote.policy, so new remotes defaulted to immediate
and downloaded all artifacts. Let UpstreamPulp carry the intended download
policy so Capsules can replicate with on_demand.

Assisted-By: Cursor Grok 4.6
Co-authored-by: Cursor <cursoragent@cursor.com>
@pablomh
pablomh force-pushed the replica-remote-download-policy branch from 9b931ed to b45c5d5 Compare August 27, 2026 09:52
@pablomh

pablomh commented Aug 27, 2026

Copy link
Copy Markdown
Contributor Author

CI error seems unrelated and pre-existing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant