Project

Profile

Help

Issue #9434

Unable to switch distribution from repository to repo version and vice versa

Added by sskracic@redhat.com 29 days ago. Updated 14 days ago.

Status:
MODIFIED
Priority:
Normal
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Platform Release:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Sprint 107
Quarter:

Description

pulp_core: 3.14.5
pulp_container: 2.7.1

In RHUI workflow we support pre-syncing the content and then making it available (say at GA) with by simply repointing the distribution. This works correctly in pulp_rpm, but pulp_container raises an error when a REST request is issued to update a distribution. Given this distribution:

{
    "base_path": "base_path",
    "content_guard": "/pulp/api/v3/contentguards/container/content_redirect/5fbef8f9-cfce-4bca-a376-c46403fcafc5/",
    "description": null,
    "name": "name",
    "namespace": "/pulp/api/v3/pulp_container/namespaces/2c0429a6-faf4-46fd-9cbe-c441da1ac5e9/",
    "private": false,
    "pulp_created": "2021-09-22T14:18:23.653633Z",
    "pulp_href": "/pulp/api/v3/distributions/container/container/3a8537e8-6e16-498c-bea2-ee4837bcf768/",
    "pulp_labels": {},
    "registry_path": "localhost:24817/base_path",
    "repository": null,
    "repository_version": "/pulp/api/v3/repositories/container/container/cadd407b-411c-4597-9b2a-ab278a480dca/versions/1/"
}

Now, I want to change this distribution to always point to the latest repository version instead of a fixed one, so I'm trying to populate the repository field:

curl -u admin:****** -X PUT -H 'Content-type: application/json' -d '{"name": "name", "base_path": "base_path", "repository": "/pulp/api/v3/repositories/container/container/cadd407b-411c-4597-9b2a-ab278a480dca/"}'  http://localhost:24817/pulp/api/v3/distributions/container/container/3a8537e8-6e16-498c-bea2-ee4837bcf768/

{"non_field_errors":["Only one of the attributes 'repository' and 'repository_version' may be used simultaneously."]}[

It doesn't make a difference if I supply "repository_version": null in the request body, or when using PATCH HTTP method.

Associated revisions

Revision ebaeb638 View on GitHub
Added by ipanova@redhat.com 14 days ago

Fixed DistibutorSerializer validation for repository/repo_version/publication.

closes #9434

History

#1 Updated by ipanova@redhat.com 29 days ago

  • Triaged changed from No to Yes

#2 Updated by ipanova@redhat.com 21 days ago

  • Project changed from Container Support to Pulp
  • Status changed from NEW to ASSIGNED
  • Assignee set to ipanova@redhat.com

Validation happens in core.

#3 Updated by ipanova@redhat.com 21 days ago

  • Sprint set to Sprint 106

#4 Updated by ipanova@redhat.com 16 days ago

  • Project changed from Pulp to Container Support

#5 Updated by pulpbot 16 days ago

  • Status changed from ASSIGNED to POST

#6 Updated by ipanova@redhat.com 15 days ago

  • Project changed from Container Support to Pulp

#7 Updated by rchan 14 days ago

  • Sprint changed from Sprint 106 to Sprint 107

#8 Updated by ipanova@redhat.com 14 days ago

  • Status changed from POST to MODIFIED

Please register to edit this issue

Also available in: Atom PDF