-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from AkihiroSuda/dev
Follow-up to `An initial support of Trivy plugin mode`
- Loading branch information
Showing
5 changed files
with
49 additions
and
12 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package trivypluginutil | ||
|
||
import ( | ||
"log/slog" | ||
"os" | ||
"strings" | ||
) | ||
|
||
// IsTrivyPluginMode returns whether the binary is being executed as a trivy plugin mode. | ||
// Not robust. | ||
func IsTrivyPluginMode() bool { | ||
exe, err := os.Executable() | ||
if err != nil { | ||
slog.Error("failed to call os.Executable()", "error", err) | ||
return false | ||
} | ||
return strings.Contains(exe, "/.trivy/plugins/vexllm") | ||
} |
This file contains 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