Skip to content
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

🐛 fix find files for tar #4974

Merged
merged 2 commits into from
Dec 12, 2024
Merged

🐛 fix find files for tar #4974

merged 2 commits into from
Dec 12, 2024

Conversation

imilchev
Copy link
Member

Fixes #4894

Copy link
Contributor

github-actions bot commented Dec 12, 2024

Test Results

3 162 tests   3 161 ✅  1m 24s ⏱️
  372 suites      1 💤
   28 files        0 ❌

Results for commit d6d54a4.

♻️ This comment has been updated with latest results.

Signed-off-by: Ivan Milchev <ivan@mondoo.com>
@czunker
Copy link
Contributor

czunker commented Dec 12, 2024

I don't get the error anymore, but it does not find files:

cnquery run container image nginx:1-alpine -c "files.find(from: '/etc', name: 'os-release')"
...
files.find.list: []

vs.

docker run -ti nginx:1-alpine find /etc -name os-release
/etc/os-release

Signed-off-by: Ivan Milchev <ivan@mondoo.com>
@imilchev
Copy link
Member Author

That seems like a different bug. Name filtering never worked for fs find. I fixed it too.

@imilchev imilchev requested a review from czunker December 12, 2024 12:59
Copy link
Contributor

@czunker czunker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both work now:

cnquery run container image nginx:1-alpine -c "files.find(from: '/etc', name: 'os-release')" 

files.find.list: [
  0: file path="/etc/os-release" size=188 permissions.string="-rw-r--r--"
]
cnquery run container image nginx:1-alpine -c "files.find(from: '/etc', regex: '.*release')"
files.find.list: [
  0: file path="/etc/alpine-release" size=7 permissions.string="-rw-r--r--"
  1: file path="/etc/os-release" size=188 permissions.string="-rw-r--r--"
]

Thanks @imilchev

@imilchev imilchev merged commit ccf731d into main Dec 12, 2024
15 of 16 checks passed
@imilchev imilchev deleted the ivan/fix-fs-find branch December 12, 2024 14:17
@github-actions github-actions bot locked and limited conversation to collaborators Dec 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Find is failing on a debian based container that has find
2 participants