Bug 1513769 - Wrong docker tags copied over on publish
Summary: Wrong docker tags copied over on publish
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Container Management
Version: 6.3.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium vote
Target Milestone: Unspecified
Assignee: Partha Aji
QA Contact: Jitendra Yejare
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-11-15 22:47 UTC by Partha Aji
Modified: 2019-08-12 14:03 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-02-21 16:54:37 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 21681 0 None None None 2017-11-15 22:48:02 UTC

Description Partha Aji 2017-11-15 22:47:59 UTC
# Create a docker hub account. (https://cloud.docker.com/) 
# Install docker on a machine
# Run the following commands 
<pre>
docker login -u <username> docker.io
docker pull alpine
docker tag docker.io/alpine:latest docker.io/<username>/alpine:latest
docker tag docker.io/alpine:latest docker.io/<username>/alpine:greatest
docker push docker.io/<username>/alpine
</pre>
# On your katello ui create a docker repo with the following data -> name: repo1,  feed: https://registry-1.docker.io , upstream: <username>/alpine
# Sync repo1. Make sure you see a repo with 2 tags 
# Now go to https://cloud.docker.com/swarm/<username>/repository/docker/<username>/alpine/tags and delete the "latest" tag
# On your katello ui create a docker repo with the following data -> name: repo2,  feed: https://registry-1.docker.io , upstream: <username>/alpine
# Sync repo2. Make sure you see a repo with 1 tag
# Finally create a content view 
# Add repo2 via Docker Content to the cv. Make sure its the repo that has 1 tag
# Create a Docker Content View Filter With the following data -> Type: Include
# Under Tags add a rule to only include the  "greatest"  tag
# Finally publish the content view and check out the published version

Expected:
A successful publish with 2 manifests and 1 Tag


Actual:
A successful publish but the manifest shows 2 Tags instead 


A further look at the publish task and expanding "13: Actions::Pulp::Repository::CopyDockerTag (success) [ 1.82s / 0.39s ]"

will show  the following clause.
<pre>
---
source_pulp_id: f93edc01-4915-45c8-a484-e926c561949f
target_pulp_id: 1-jonathan-v1_0-f93edc01-4915-45c8-a484-e926c561949f
clauses:
  "$or":
  - name:
      "$in":
      - latest
      - greatest
      - greatest
      - greatest
      - greatest
remote_user: admin
remote_cp_user: admin
locale: en
</pre>

So even though the content filter should have only published "greatest" since the source repo had only the 'greatest' tag, we are ending up copying both "greatest" and "latest"

Comment 1 Partha Aji 2017-11-15 22:48:04 UTC
Created from redmine issue http://projects.theforeman.org/issues/21681

Comment 2 Partha Aji 2017-11-15 22:48:08 UTC
Upstream bug assigned to paji@redhat.com

Comment 4 Satellite Program 2017-11-20 17:20:01 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/21681 has been resolved.

Comment 5 Evgeni Golov 2017-11-22 10:14:22 UTC
Hey Partha,

I tried to cherry pick this (https://gitlab.sat.lab.tlv.redhat.com/satellite6/katello/merge_requests/397) but the tests fail for me (https://satellite-jenkins.rhev-ci-vms.eng.rdu2.redhat.com/job/satellite6-unit-test-katello/906/)

My hunch is that this is because we don't have https://github.com/Katello/katello/commit/14128f7d6002733c3f2c4ae9c8e60da0bcab2d3f#diff-476f3ece1455157922b628e9c778b222 in 6.3, but I did not want to play more with the tests where I am not sure (besides the s/Bot/Girl/g to get it to work at all on 6.3).

Could you please have a look?

Comment 6 Partha Aji 2017-12-14 07:26:22 UTC
being tackled by https://gitlab.sat.lab.tlv.redhat.com/satellite6/katello/merge_requests/412 . You may close 397

Comment 7 Jitendra Yejare 2017-12-27 12:09:52 UTC
Verified !

@ Satellite 6.3 snap 29

Steps:

As per Description.

Observation:

The CV having docker filtered tags has correct count of manifest and tags. As per example in description its 2 manifests and 1 tag.


So changing the state to Verified!

Comment 8 Satellite Program 2018-02-21 16:54:37 UTC
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA.
> > 
> > For information on the advisory, and where to find the updated files, follow the link below.
> > 
> > If the solution does not work for you, open a new bug report.
> > 
> > https://access.redhat.com/errata/RHSA-2018:0336


Note You need to log in before you can comment on or make changes to this bug.