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

feat(plugin): add support for nested archives #6845

Merged
merged 2 commits into from
Jun 7, 2024

Conversation

knqyf263
Copy link
Collaborator

@knqyf263 knqyf263 commented Jun 3, 2024

Description

It now works with archives with a root directory, such as GitHub repository archives (cf. #6824 (comment)).

$ wget https://github.com/aquasecurity/trivy-plugin-referrer/archive/refs/heads/main.zip 
$ unzip main.zip
Archive:  main.zip
383f3f879f103f9f9e587e7dcf475a4f19c4dcf3
   creating: trivy-plugin-referrer-main/
   creating: trivy-plugin-referrer-main/.github/
   creating: trivy-plugin-referrer-main/.github/workflows/
  inflating: trivy-plugin-referrer-main/.github/workflows/release.yaml
  inflating: trivy-plugin-referrer-main/.gitignore
  inflating: trivy-plugin-referrer-main/LICENSE
  inflating: trivy-plugin-referrer-main/README.md
  inflating: trivy-plugin-referrer-main/get.go
  inflating: trivy-plugin-referrer-main/go.mod
  inflating: trivy-plugin-referrer-main/go.sum
  inflating: trivy-plugin-referrer-main/goreleaser.yml
  inflating: trivy-plugin-referrer-main/list.go
  inflating: trivy-plugin-referrer-main/main.go
  inflating: trivy-plugin-referrer-main/plugin.yaml
  inflating: trivy-plugin-referrer-main/put.go
  inflating: trivy-plugin-referrer-main/tree.go
  inflating: trivy-plugin-referrer-main/types.go

Before

$ trivy plugin install https://github.com/aquasecurity/trivy-plugin-referrer/archive/refs/heads/main.zip
2024-06-03T21:50:12+04:00       INFO    [plugin] Installing the plugin...       src="https://github.com/aquasecurity/trivy-plugin-referrer/archive/refs/heads/main.zip"
2024-06-03T21:50:13+04:00       FATAL   Fatal error     plugin install error: failed to load the plugin metadata: file open error: open /var/folders/9_/3y18vrrs5bz6gbkq0kc_4fv80000gn/T/trivy-plugin4290039740/plugin.yaml: no such file or directory

After

$ trivy plugin install https://github.com/aquasecurity/trivy-plugin-referrer/archive/refs/heads/main.zip
2024-06-03T21:49:12+04:00       INFO    [plugin] Installing the plugin...       src="https://github.com/aquasecurity/trivy-plugin-referrer/archive/refs/heads/main.zip"
2024-06-03T21:49:16+04:00       INFO    [plugin] Plugin successfully installed  name="referrer" version="0.3.1"

Checklist

  • I've read the guidelines for contributing to this repository.
  • I've followed the conventions in the PR title.
  • I've added tests that prove my fix is effective or that my feature works.
  • I've updated the documentation with the relevant information (if needed).
  • I've added usage information (if the PR introduces new options)
  • I've included a "before" and "after" example to the description (if the PR is a user interface change).

Signed-off-by: knqyf263 <knqyf263@gmail.com>
@knqyf263 knqyf263 self-assigned this Jun 3, 2024
Signed-off-by: knqyf263 <knqyf263@gmail.com>
@knqyf263 knqyf263 marked this pull request as ready for review June 4, 2024 05:08
Copy link
Contributor

@DmitriyLewen DmitriyLewen left a comment

Choose a reason for hiding this comment

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

LGTM

@knqyf263 knqyf263 added this pull request to the merge queue Jun 7, 2024
Merged via the queue into aquasecurity:main with commit 622c67b Jun 7, 2024
18 checks passed
@knqyf263 knqyf263 deleted the test/plugin_zip branch June 7, 2024 09:50
@aqua-bot aqua-bot mentioned this pull request Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants