Bug 976583

Summary: certain values for setup_rewritten in cartridge's managed_files.yml does not remove the files expected
Product: OKD Reporter: Hiro Asari <hasari>
Component: ContainersAssignee: Jhon Honce <jhonce>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.xCC: bmeng, jkeck
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-06-24 14:47:40 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:

Description Hiro Asari 2013-06-20 22:28:20 UTC
Description of problem:
Assume we have:

    setup_rewritten:
    - versions/*

in metadata/managed_files.yml in a cartridge.

When migrating this cartridge, an existing directory /var/lib/openshift/<UUID>/<CARTRIDGE>/versions/* are not deleted

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. create an application from a cartridge with the above manifest requirement
2. bump up a cartridge version in the manifest, install it
3. migrate the application created in step 1.

Actual results:
/var/lib/openshift/<UUID>/<CARTRIDGE>/versions/* still exists
(Be sure that the cartridge does not put new files in the same place during the migration.)

Expected results:
/var/lib/openshift/<UUID>/<CARTRIDGE>/versions/* is cleaned up appropriately.

Additional info:

Comment 1 Jhon Honce 2013-06-20 23:23:37 UTC
Fixed in https://github.com/openshift/li/pull/1665

Comment 2 openshift-github-bot 2013-06-21 00:59:15 UTC
Commit pushed to master at https://github.com/openshift/li

https://github.com/openshift/li/commit/7a5f70293c6c9831cdfe8078e79467da498b447d
Bug 976583 - migration did not handle directories from setup_versions

Comment 3 Meng Bo 2013-06-21 11:21:04 UTC
Checked on devenv_3398,

1. Modify the managed_file.yml as the comment#0
2. Upgrade the packages and modify the 
/usr/libexec/openshift/cartridges/v2/php/version/shared/configuration/etc/php.ini.erb
and
/usr/libexec/openshift/cartridges/v2/php/version/shared/configuration/etc/conf/httpd.conf
to reflect the fix.
3. Run rhc-admin-migrate script with option --ignore-cartridge-version
4. After migrate, check the $OPENSHIFT_PHP_DIR/versions/shared/configuration/etc

[root@ip-10-114-219-87 etc]# cat php.ini |grep MIGRATE
AFTER_MIGRATE

[root@ip-10-114-219-87 etc]# cat conf/httpd.conf |grep MIGRATE
#AFTERMIGRATE


The managed_file versions/* have been rewrited.

Move bug to verified.