Project

General

Profile

Bug #21326

Delete DockerMetaTags when docker tags are deleted

Added by Partha Aji over 4 years ago. Updated almost 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Container
Target version:
Difficulty:
Triaged:
Bugzilla link:
Fixed in Releases:
Found in Releases:
Red Hat JIRA:

Description

DockerMetaTags are not getting deleted when docker tags are.

Deletion of docker tags only results in the nullification.
What we need to happen is some thing along
if dockerTag.deleted?
check if schema1 meta tag does Not have a schema2 entry and if so delete it.
check if schema2 meta tag does Not have a schema1 entry and if so delete it.
end

To see a good example try the following in a rails or foreman-rake console

>> dmt = ::Katello::DockerMetaTag.first
>> dmt.schema1.try(:destroy) ; dmt.schema2.try(:destroy)
>> dmt = ::Katello::DockerMetaTag.find(dmt.id) # reload
#Actual
<Katello::DockerMetaTag id: 4978, schema1_id: 5753, schema2_id: nil, name: "1.24.2-glibc", repository_id: 3>

#Expected
#ActiveRecord::RecordNotFound: Couldn't find Katello::DockerMetaTag with 'id'=4978
#This operation should fail because deleting the associated docker tags should wipe out the meta tag

Associated revisions

Revision abc060dd (diff)
Added by Partha Aji over 4 years ago

Fixes #21326 - DockerTag deletion cleansup MetaTag

This commit addresses the issue of stale MetaTag if docker tag got
deleted. Prior to this commit if one deleted a docker tag, the code
would only nullify the appropriate schema column in the docker meta
tag table.
What we need to happen is that the DockerMetaTag entries need to get
wiped out if both schema1 and schema2 columns are nil. This commit
addresses that issue.

History

#1 Updated by The Foreman Bot over 4 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/Katello/katello/pull/7005 added

#2 Updated by Eric Helms over 4 years ago

  • Legacy Backlogs Release (now unused) set to 284

#3 Updated by Partha Aji over 4 years ago

  • % Done changed from 0 to 100
  • Status changed from Ready For Testing to Closed

#4 Updated by Partha Aji over 4 years ago

  • Bugzilla link set to 1515287

#5 Updated by Andrew Kofink over 4 years ago

  • Legacy Backlogs Release (now unused) changed from 284 to 250

Also available in: Atom PDF