fix: Ensure configFile volume is mounted for initContainer#2713
Merged
simar7 merged 9 commits intoaquasecurity:mainfrom Aug 22, 2025
Merged
fix: Ensure configFile volume is mounted for initContainer#2713simar7 merged 9 commits intoaquasecurity:mainfrom
simar7 merged 9 commits intoaquasecurity:mainfrom
Conversation
…itContainer decleration
adds updated tests
This was referenced Aug 18, 2025
Closed
afdesk
suggested changes
Aug 22, 2025
trivy-operator
Outdated
Contributor
There was a problem hiding this comment.
do we really need this file?
Contributor
There was a problem hiding this comment.
No, we do not. I do not know how it got through... It is removed now, thank you.
Contributor
|
@bananasplit393 thanks for your time and efforts |
Contributor
Hey, we just realized that our fork was 4 commits behind main, so we merged again - so we need a new review... 😅 |
Contributor
|
thank you guys! |
afdesk
approved these changes
Aug 22, 2025
Contributor
afdesk
left a comment
There was a problem hiding this comment.
LGTM!
Trivy-operator based on this branch works correctly.
checked on docker.io/afdesk/trivy-operator:fixTrivyConfig
simar7
approved these changes
Aug 22, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2711
This PR resolves a bug where the configFile feature is not properly implemented in the scan jobs created in Standalone mode.
Currently, the initContainer spec is defined before the GenerateConfigFileVolumeIfAvailable() function is called. As a result, the volume mount for the configFile is never added to the initContainer, preventing it from accessing any custom configuration.
This change moves the GenerateConfigFileVolumeIfAvailable() call to a position before the initContainers slice is defined. This ensures that the initContainer correctly receives the volume mount, making the configFile feature fully functional for all containers within the scan job pod.
Tests have been updated to mirror the code change.