CentOS-PaaS-SIG / ci-pipeline

There are many projects that are concentrated on CI for Atomic Openshift. This is focused on complete CI testing of all Atomic and Base Runtime components for a new Atomic deliverable that comes from Fedora sources.
GNU General Public License v3.0
23 stars 35 forks source link

virt-customize: incorrectly not installing conflicting RPM #795

Closed mike-nguyen closed 5 years ago

mike-nguyen commented 5 years ago

The ignition package has recently separated out a subpackage called ignition-validate. ignition-validate can run stand alone but is only validates ignition config files from ignition > 0.31.0-3 so there is a conflict with ignition < 0.31.0-3. I believe this is the proper use of conflicts vs requires for this package.

During the setup of the test environment, even though ignition is from koji is > 0.31.0-3 , it is not being installed [1]. I think the problem is in virt-customize.sh [0] where it queries for a conflict but only looks at the package name to determine to install it or not. virt-customize.sh should look at the entire query output and determine if the package to be installed is actually at a version that conflicts.

[0] https://github.com/CentOS-PaaS-SIG/ci-pipeline/blob/0b06c15e2204dab344d89178024990c8392a25c2/config/Dockerfiles/cloud-image-compose/virt-customize.sh#L112-L114

[1] snippet from pipeline.log


[2019-03-22T21:57:05.391Z] + '[' rpms '!=' tests ']'
[2019-03-22T21:57:05.391Z] ++ repoquery -q '--disablerepo=*' --enablerepo=ignition --repofrompath=ignition,/workDir/workspace/fedora-rawhide-pr-pipeline/ignition_repo --all '--qf=%{ARCH}:%{NAME}'
[2019-03-22T21:57:05.391Z] ++ sed -e '/^src:/d;/-debug\(info\|source\)$/d;s/.\+://'
[2019-03-22T21:57:05.391Z] ++ sort -u
[2019-03-22T21:57:05.647Z] BDB2053 Freeing read locks for locker 0xc0: 105/140149436913792
[2019-03-22T21:57:05.647Z] BDB2053 Freeing read locks for locker 0xc2: 105/140149436913792
[2019-03-22T21:57:05.647Z] BDB2053 Freeing read locks for locker 0xc3: 105/140149436913792
[2019-03-22T21:57:05.647Z] BDB2053 Freeing read locks for locker 0xc4: 105/140149436913792
[2019-03-22T21:57:05.647Z] + for pkg in '$(repoquery -q --disablerepo=\* --enablerepo=${package} --repofrompath=${package},${rpm_repo} --all --qf="%{ARCH}:%{NAME}" | sed -e "/^src:/d;/-debug\(info\|source\)\$/d;s/.\+://" | sort -u)'
[2019-03-22T21:57:05.647Z] ++ repoquery -q '--disablerepo=*' --enablerepo=ignition --repofrompath=ignition,/workDir/workspace/fedora-rawhide-pr-pipeline/ignition_repo --conflict ignition
[2019-03-22T21:57:05.647Z] ++ awk '{print$1}'
[2019-03-22T21:57:05.903Z] + conflict=
[2019-03-22T21:57:05.903Z] + found_conflict=0
[2019-03-22T21:57:05.903Z] + '[' '!' -z '' ']'
[2019-03-22T21:57:05.903Z] + RPM_LIST=' ignition'
[2019-03-22T21:57:05.903Z] + for pkg in '$(repoquery -q --disablerepo=\* --enablerepo=${package} --repofrompath=${package},${rpm_repo} --all --qf="%{ARCH}:%{NAME}" | sed -e "/^src:/d;/-debug\(info\|source\)\$/d;s/.\+://" | sort -u)'
[2019-03-22T21:57:05.903Z] ++ repoquery -q '--disablerepo=*' --enablerepo=ignition --repofrompath=ignition,/workDir/workspace/fedora-rawhide-pr-pipeline/ignition_repo --conflict ignition-validate
[2019-03-22T21:57:05.903Z] ++ awk '{print$1}'
[2019-03-22T21:57:06.159Z] + conflict=ignition
[2019-03-22T21:57:06.159Z] + found_conflict=0
[2019-03-22T21:57:06.159Z] + '[' '!' -z ignition ']'
[2019-03-22T21:57:06.159Z] + '[' '!' -z ' ignition' ']'
[2019-03-22T21:57:06.159Z] + for rpm_pkg in '${RPM_LIST}'
[2019-03-22T21:57:06.159Z] + '[' ignition == ignition ']'
[2019-03-22T21:57:06.159Z] + found_conflict=1
[2019-03-22T21:57:06.159Z] + continue
[2019-03-22T21:57:06.159Z] + '[' 1 ']'
[2019-03-22T21:57:06.159Z] + echo 'INFO: will not install ignition-validate as it conflicts with ignition.'
[2019-03-22T21:57:06.159Z] INFO: will not install ignition-validate as it conflicts with ignition.
dustymabe commented 5 years ago

@johnbieren - do you think you could take a look at this?

johnbieren commented 5 years ago

Yeah, I'll make sure we get this fixed

johnbieren commented 5 years ago

@mike-nguyen So what you are saying is that the --conflicts command returns ignition < 0.31.0-3 which means ignition-validate conflicts with ignition only if version-release is < 0.31.0-3 and because the PR presents ignition with version-release 0.31.0-7, it should go ahead and install it?

mike-nguyen commented 5 years ago

@mike-nguyen So what you are saying is that the --conflicts command returns ignition < 0.31.0-3 which means ignition-validate conflicts with ignition only if version-release is < 0.31.0-3 and because the PR presents ignition with version-release 0.31.0-7, it should go ahead and install it?

@johnbieren Yes because the version does not conflict.

johnbieren commented 5 years ago

https://github.com/CentOS-PaaS-SIG/ci-pipeline/pull/797

johnbieren commented 5 years ago

https://github.com/CentOS-PaaS-SIG/ci-pipeline/pull/798