Bug 1513769

Summary: Wrong docker tags copied over on publish
Product: Red Hat Satellite Reporter: Partha Aji <paji>
Component: Container ManagementAssignee: Partha Aji <paji>
Status: CLOSED ERRATA QA Contact: Jitendra Yejare <jyejare>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.3.0CC: bbuckingham, egolov, jyejare, paji, sgraessl, zhunting
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-21 16:54:37 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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

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