Skip to content
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

repo_config gpgcheck value lost ? (mirror_complete option) #3462

Closed
olwins opened this issue Mar 11, 2024 · 2 comments · Fixed by #3471
Closed

repo_config gpgcheck value lost ? (mirror_complete option) #3462

olwins opened this issue Mar 11, 2024 · 2 comments · Fixed by #3471

Comments

@olwins
Copy link

olwins commented Mar 11, 2024

Version
{
"component": "core",
"version": "3.49.0",
"package": "pulpcore",
"module": "pulpcore.app",
"domain_compatible": true

{
  "component": "rpm",
  "version": "3.25.1",
  "package": "pulp-rpm",
  "module": "pulp_rpm.app",
  "domain_compatible": true
},

Describe the bug

(first time user, so i hope it's a real bug, and not a mistake of my part)

I have created a rpm repository for redhat, using the new option "repo_config", to activate the gpgcheck value to 1
That seems to work

But later, when I sync (mirror_complete option), the publication that is automatically created has a repo_config param with gpgcheck set to 0

Same in the distribution, if i use the generate_repo_config option, gpgcheck it is set to 0

Is that wanted ?
I expected the publication/distribution to inherit the value set at the repository level.
As I'm using the mirror_complete option, the publication is automatically created during the sync, I can't specify the value there.

To Reproduce
pulp rpm remote create --name TEST --url https://cdn.redhat.com/content/dist/rhel9/9/x86_64/baseos/os --policy on_demand --ca-cert @/opt/pulp3/settings/sslcacert-redhat.pem --client-key @/opt/pulp3/settings/sslclientkey-redhat.pem --client-cert @/opt/pulp3/settings/sslclientcert-redhat.pem

pulp rpm repository create --name TEST --remote TEST --retain-repo-versions 3 --repo-config '{ "gpgcheck":1,"repo_gpgcheck":0 }'

Return
"repo_config": {
"gpgcheck": 1,
"repo_gpgcheck": 0
},

pulp rpm repository sync --name TEST --sync-policy mirror_complete

"created_resources": [
"/pulp/api/v3/repositories/rpm/rpm/018e2fc5-faa7-73d2-9ff3-a60800e1666d/versions/1/",
"/pulp/api/v3/publications/rpm/rpm/018e2fc7-2d04-7059-91e1-4724e8dbf285/"
],

pulp rpm publication show --href /pulp/api/v3/publications/rpm/rpm/018e2fc7-2d04-7059-91e1-4724e8dbf285/

"repo_config": {
"gpgcheck": 0,
"repo_gpgcheck": false
},

Expected behavior
for the publication that is automatically created with the mirror_complete option, I expected the repo_config value to be the same than the one define for the repository

Additional context

@olwins olwins changed the title id_repo gppcheck value lost ? (mirror_complete option) repo_config gppcheck value lost ? (mirror_complete option) Mar 11, 2024
@olwins olwins changed the title repo_config gppcheck value lost ? (mirror_complete option) repo_config gpgcheck value lost ? (mirror_complete option) Mar 11, 2024
@pedro-psb
Copy link
Member

The mirror_complete option implies that the user shouldn't customize the publication, otherwise, the publication would risk not being "mirror complete". But still, something is odd.

I found that Pulp uses the following defaults for when it has to mirror the metadata on the sync task:

publication.repo_config = {"repo_gpgcheck": has_repomd_signature, "gpgcheck": 0}

In your case, the remote repository doesn't contain a .repo file to be mirrored, so from a mirror perspective its not clear what to set there. Maybe in this case the user option could take precedence.

@dralley
Copy link
Contributor

dralley commented Mar 19, 2024

gpgcheck means "check the GPG signatures of packages" whereas repo_gpgcheck means "check the GPG signatures of repository metadata"

Like @pedro-psb mentioned, mirror_complete mode means "sync the repo exactly as it is and make no changes", so it's really just filling in the values with what it can infer directly from the sync rather than setting them from the user-provided repoconfig.

Since there's no reasonable way to infer gpgcheck from the sync though, we should probably just pull it directly from the user-provided repoconfig (the state of it at the moment of the sync).

dralley added a commit to dralley/pulp_rpm that referenced this issue Mar 19, 2024
On publications created by `mirror_complete` sync.

closes pulp#3462
dralley added a commit to dralley/pulp_rpm that referenced this issue Mar 19, 2024
On publications created by `mirror_complete` sync.

closes pulp#3462
dralley added a commit to dralley/pulp_rpm that referenced this issue Mar 19, 2024
On publications created by `mirror_complete` sync.

closes pulp#3462
dralley added a commit to dralley/pulp_rpm that referenced this issue Mar 20, 2024
On publications created by `mirror_complete` sync.

closes pulp#3462
dralley added a commit to dralley/pulp_rpm that referenced this issue Mar 20, 2024
On publications created by `mirror_complete` sync.

closes pulp#3462
dralley added a commit to dralley/pulp_rpm that referenced this issue Mar 20, 2024
On publications created by `mirror_complete` sync.

closes pulp#3462
dralley added a commit to dralley/pulp_rpm that referenced this issue Mar 20, 2024
On publications created by `mirror_complete` sync.

closes pulp#3462
dralley added a commit to dralley/pulp_rpm that referenced this issue Mar 20, 2024
On publications created by `mirror_complete` sync.

closes pulp#3462
dralley added a commit to dralley/pulp_rpm that referenced this issue Mar 20, 2024
On publications created by `mirror_complete` sync.

closes pulp#3462
dralley added a commit to dralley/pulp_rpm that referenced this issue Mar 21, 2024
On publications created by `mirror_complete` sync.

closes pulp#3462
dralley added a commit to dralley/pulp_rpm that referenced this issue Mar 21, 2024
On publications created by `mirror_complete` sync.

closes pulp#3462
dralley added a commit to dralley/pulp_rpm that referenced this issue Mar 21, 2024
On publications created by `mirror_complete` sync.

closes pulp#3462
dralley added a commit to dralley/pulp_rpm that referenced this issue Mar 21, 2024
On publications created by `mirror_complete` sync.

closes pulp#3462
dralley added a commit to dralley/pulp_rpm that referenced this issue Mar 22, 2024
On publications created by `mirror_complete` sync.

closes pulp#3462
dralley added a commit that referenced this issue Mar 22, 2024
On publications created by `mirror_complete` sync.

closes #3462
patchback bot pushed a commit that referenced this issue Mar 22, 2024
On publications created by `mirror_complete` sync.

closes #3462

(cherry picked from commit 2f8a477)
dralley added a commit that referenced this issue Mar 22, 2024
On publications created by `mirror_complete` sync.

closes #3462

(cherry picked from commit 2f8a477)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants