New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
adding rpm architecture of to our maps, for 32 bit and 64 bit rpms #1038
adding rpm architecture of to our maps, for 32 bit and 64 bit rpms #1038
Conversation
Skipping CI for Draft Pull Request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple of changes.
5449729
to
689c725
Compare
4062e33
to
caa3eff
Compare
@@ -241,7 +261,9 @@ func (p *HasModifiedFilesCheck) validate(ctx context.Context, layerIDs []string, | |||
|
|||
if (previousOsRelease && !currentOsRelease) || (previousPackage.Arch != currentPackage.Arch) { | |||
// If either of these differ, that's a fail | |||
return false, nil | |||
logger.V(log.DBG).Info("mismatch in package architecture", "file", modifiedFile) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this phrasing correct? This log line seems to imply only the arch could be wrong here. Should we ever hit this case for x86_64 || i686?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will not hit this case coded for the above code. This was the code block that was originally causing a failure and were never logging this and it caused confusion for cert-ops. I'd like to make this line better, but I need to re-read @bcrochet comments about what this if block covers and comment accordingly, that should yield a better log message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's make them more explicit. It makes sense to split these two so that we get a more granular message.
This is still valid. This is the case that someone replaced a Red Hat package with one of a different arch. OR, they did a rebuild, and the release changed.
EIther way, it shouldn't pass. But making it separate will make the code more readable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I split this into two different if
conditions and added a unit test to cover both cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems fine
/lgtm
caa3eff
to
84b4135
Compare
84b4135
to
e673ecf
Compare
582e8b5
to
c71ca4e
Compare
c71ca4e
to
b728d49
Compare
b728d49
to
4b8991d
Compare
4b8991d
to
552fb83
Compare
…not fail has modified files check Signed-off-by: Adam D. Cornett <adc@redhat.com>
552fb83
to
ea0aae1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: acornett21, bcrochet, komish The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
pkg.Arch
as a key value to our maps so we are comparing files on anarch
byarch
basis, and so we are not overwriting any map value, if multiple arch's of a given rpm exists in a given layer.installedFileMapWithExclusions
method to filter outdirectories
installedFileMapWithExclusions
to filter out files from the same rpm if onlyarchitecture
differs