Actions
Bug #21326
closedDelete DockerMetaTags when docker tags are deleted
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
Actions