Bug 1358303

Summary: Container auto-tagging from labels breaks refresh on labels with empty value
Product: Red Hat CloudForms Management Engine Reporter: Chris Pelland <cpelland>
Component: ProvidersAssignee: Beni Paskin-Cherniavsky <cben>
Status: CLOSED ERRATA QA Contact: Tony <ashlifst>
Severity: high Docs Contact:
Priority: high    
Version: 5.6.0CC: cben, cpelland, dajohnso, dron, fsimonce, jfrey, jhardy, jprause, obarenbo
Target Milestone: GAKeywords: ZStream
Target Release: 5.6.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: container
Fixed In Version: 5.6.1.2 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1358257 Environment:
Last Closed: 2016-08-18 17:59:20 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1358257    
Bug Blocks:    

Comment 2 CFME Bot 2016-07-26 13:25:59 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/90155b96186a036c5e406ee5308921521c524535

commit 90155b96186a036c5e406ee5308921521c524535
Author:     Beni Cherniavsky-Paskin <cben>
AuthorDate: Mon Jul 25 20:00:51 2016 +0300
Commit:     Beni Cherniavsky-Paskin <cben>
CommitDate: Mon Jul 25 20:02:05 2016 +0300

    Fix auto-tagging to handle empty-value labels
    
    Given any-value mapping `foo` -> "Foo" category,
    `foo=` label will create "Foo : <empty value>" tag.
    
    Fixes #9713,
    https://bugzilla.redhat.com/show_bug.cgi?id=1358257
    https://bugzilla.redhat.com/show_bug.cgi?id=1358303

 app/models/container_label_tag_mapping.rb       | 11 +++++++++--
 spec/models/container_label_tag_mapping_spec.rb |  7 ++++---
 2 files changed, 13 insertions(+), 5 deletions(-)

Comment 3 Beni Paskin-Cherniavsky 2016-07-27 13:29:36 UTC
Forgot to mention in description:
after using `rails console` to create the mapping in the DB, 
should restart CFME to reload it.
(it's cached in memory indefinitely; the `ContainerLabelTagMapping.drop_cache` line above affects the rails console process but not an already running instance).

Comment 5 Tony 2016-07-31 11:29:05 UTC
Verified on CFME 5.6.1.0, succeeded attaching label with an empty value.

Comment 7 errata-xmlrpc 2016-08-18 17:59:20 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://rhn.redhat.com/errata/RHSA-2016-1634.html