Project

Profile

Help

Issue #9434

closed

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

Added by sskracic@redhat.com over 2 years ago. Updated over 2 years ago.

Status:
CLOSED - CURRENTRELEASE
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.

Actions #1

Updated by ipanova@redhat.com over 2 years ago

  • Triaged changed from No to Yes
Actions #2

Updated by ipanova@redhat.com over 2 years ago

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

Validation happens in core.

Actions #3

Updated by ipanova@redhat.com over 2 years ago

  • Sprint set to Sprint 106
Actions #4

Updated by ipanova@redhat.com over 2 years ago

  • Project changed from Pulp to Container Support
Actions #5

Updated by pulpbot over 2 years ago

  • Status changed from ASSIGNED to POST
Actions #6

Updated by ipanova@redhat.com over 2 years ago

  • Project changed from Container Support to Pulp
Actions #7

Updated by rchan over 2 years ago

  • Sprint changed from Sprint 106 to Sprint 107

Added by ipanova@redhat.com over 2 years ago

Revision ebaeb638 | View on GitHub

Fixed DistibutorSerializer validation for repository/repo_version/publication.

closes #9434

Actions #8

Updated by ipanova@redhat.com over 2 years ago

  • Status changed from POST to MODIFIED
Actions #9

Updated by pulpbot over 2 years ago

  • Sprint/Milestone set to 3.17.0
Actions #10

Updated by pulpbot over 2 years ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

Also available in: Atom PDF