Commit graph

26 commits

Author SHA1 Message Date
Mads Jensen
a490bb3c20 Use errors.Is to check for io.EOF and gzip.ErrHeader
In GoLang, using the == operator to check for a certain error will not
unwrap the error chain, and therefore may hide the problem.

Signed-off-by: Mads Jensen <atombrella@users.noreply.github.com>
2025-12-14 08:54:11 +01:00
Terry Howe
b52b6615f0
Merge pull request #31207 from zyfy29/delete-unused-var
chore: delete unused var in installer.go
2025-12-13 08:27:37 -07:00
Terry Howe
d28853e206
Merge pull request #31624 from atombrella/feature/sloglint
Some checks are pending
build-test / build (push) Waiting to run
CodeQL / Analyze (push) Waiting to run
golangci-lint / golangci-lint (push) Waiting to run
govulncheck / govulncheck (push) Waiting to run
release / release (push) Waiting to run
release / canary-release (push) Waiting to run
Scorecard supply-chain security / Scorecard analysis (push) Waiting to run
Enable the `sloglint` linter
2025-12-12 08:04:45 -07:00
Terry Howe
642462e9fe
Merge pull request #11991 from twz123/no-bash-in-testscripts
Make test scripts run without /bin/bash
2025-12-12 07:57:37 -07:00
Mads Jensen
a18e59e465 Enable the sloglint linter
Signed-off-by: Mads Jensen <atombrella@users.noreply.github.com>
2025-12-09 08:24:36 +01:00
Matt Farina
a3db5f5667
Merge pull request #31408 from AndiDog/plugin-err-msg
Some checks are pending
build-test / build (push) Waiting to run
CodeQL / Analyze (push) Waiting to run
golangci-lint / golangci-lint (push) Waiting to run
release / release (push) Waiting to run
release / canary-release (push) Waiting to run
Scorecard supply-chain security / Scorecard analysis (push) Waiting to run
Improve error message when plugin source cannot be determined or a non-directory is passed
2025-10-21 15:52:54 -04:00
Andreas Sommer
b05411506a Improve error message when plugin source cannot be determined or a non-directory is passed
Signed-off-by: Andreas Sommer <andreas.sommer87@googlemail.com>
2025-10-20 15:25:59 +02:00
wyrapeseed
b9eadd3186 chore: fix some comment format
Signed-off-by: wyrapeseed <wyrapeseed@outlook.com>
2025-10-15 11:19:41 +08:00
George Jenkins
93c02523bb
Merge pull request #31249 from banjoh/em/additional-logging
chore: add additional logging to plugin installer
2025-09-24 18:48:52 -07:00
zyfy29
b24bfe4168
Merge branch 'main' into delete-unused-var
Signed-off-by: zyfy29 <wasuremono127@gmail.com>
2025-09-17 18:20:12 +09:00
Tom Wieczorek
6181e0a873
Make test scripts run without /bin/bash
The test scripts hardcoded #!/bin/bash while they are not really
requiring bash. Use the more portable #!/usr/bin/env sh instead, so that
they use the default shell.

Signed-off-by: Tom Wieczorek <twieczorek@mirantis.com>
2025-09-12 15:24:29 +02:00
yajianggroup
cfaf30083a refactor: use strings.CutPrefix
Signed-off-by: yajianggroup <yajianggroup@outlook.com>
2025-09-12 19:03:54 +08:00
Evans Mungai
3d23230ef8
chore: add additional logging to plugin installer
Signed-off-by: Evans Mungai <mbuevans@gmail.com>
2025-09-05 10:00:35 +01:00
George Jenkins
c35755a197 Remove legacy Command/Hooks from v1 Subprocess (#23)
Signed-off-by: George Jenkins <gvjenkins@gmail.com>
2025-08-31 22:24:31 -07:00
Scott Rigby
e814ff3c38
Remove unnecessary file i/o operations from signing and verifying
Signed-off-by: Scott Rigby <scott@r6by.com>
2025-08-30 17:28:16 -05:00
Scott Rigby
9ea35da0d0
[HIP-0026] Plugin packaging, signing, and verification (#31176)
* Plugin packaging, signing and verification

Signed-off-by: Scott Rigby <scott@r6by.com>

* wrap keyring read error with more explicit message

Co-authored-by: Jesse Simpson <jesse.simpson36@gmail.com>
Signed-off-by: Scott Rigby <scott@r6by.com>

* skip unnecessary check

Co-authored-by: Evans Mungai <mbuevans@gmail.com>
Signed-off-by: Scott Rigby <scott@r6by.com>

* Change behavior for installing plugin with missing .prov file (now warns and continues instead of failing)

Signed-off-by: Scott Rigby <scott@r6by.com>

* Add comprehensive plugin verification tests

- Test missing .prov files (warns but continues)
- Test invalid .prov file formats (fails verification)
- Test hash mismatches in .prov files (fails verification)
- Test .prov file access errors (fails appropriately)
- Test directory plugins don't support verification
- Test installation without verification enabled (succeeds)
- Test with valid .prov files (fails on empty keyring as expected)

---------

Signed-off-by: Scott Rigby <scott@r6by.com>
Co-authored-by: Jesse Simpson <jesse.simpson36@gmail.com>
Co-authored-by: Evans Mungai <mbuevans@gmail.com>
2025-08-30 13:25:28 -04:00
zyfy29
8068578266 chore: delete unused var in installer.go
Signed-off-by: zyfy29 <wasuremono127@gmail.com>
2025-08-28 09:32:45 +09:00
Scott Rigby
3d30112468 Fix LocalInstaller Path() to strip version from tarball filenames
Override Path() method to use existing stripPluginName function for archives

Signed-off-by: Scott Rigby <scott@r6by.com>
2025-08-25 23:17:42 -04:00
Scott Rigby
16924a51db Fix: Removed unsafe umask manipulation in tests
Problem: Tests used syscall.Umask(0000) which could leave your shell creating
files with 777 permissions if interrupted.

Solution: Instead of changing umask, tests now detect the current umask and
calculate expected permissions after it's applied.

Result: Same test coverage, but safe from system-wide side effects.

Co-authored-by: Jesse Simpson <jesse.simpson36@gmail.com>
Signed-off-by: Scott Rigby <scott@r6by.com>
2025-08-25 23:17:42 -04:00
Scott Rigby
5c663db853 Plugin tarball installer support for HTTP (fix) and local (feat)
Signed-off-by: Scott Rigby <scott@r6by.com>
2025-08-25 23:17:42 -04:00
Scott Rigby
d19130f69e Fix file handle management in tar extractors
Use defer outFile.Close() to avoid multiple close calls and ensure proper resource cleanup

Co-authored-by: Andrew Block <andy.block@gmail.com>
Signed-off-by: Scott Rigby <scott@r6by.com>
2025-08-25 23:04:01 -04:00
Scott Rigby
fd41fdd9c9 New registry plugin func GetPluginName. Re-use regsitry.reference
Signed-off-by: Scott Rigby <scott@r6by.com>
2025-08-25 23:04:01 -04:00
Scott Rigby
7d22bb25fa Plugin OCI installer
Signed-off-by: Scott Rigby <scott@r6by.com>
2025-08-25 23:04:01 -04:00
Scott Rigby
a7578fec74
Plugin types and plugin apiVersion v1
Co-authored-by: George Jenkins <gvjenkins@gmail.com>
Signed-off-by: Scott Rigby <scott@r6by.com>
2025-08-22 17:17:36 -04:00
Scott Rigby
be74ab72a0
[HIP-0026] Plugin runtime interface (#31145)
* Runtime abstraction to encapsulate subprocess code and enable future runtimes

Also fix race condition in TestPrepareCommandExtraArgs by replacing the shared variable modification with a local copy

Co-authored-by: George Jenkins <gvjenkins@gmail.com>
Signed-off-by: Scott Rigby <scott@r6by.com>

* Remove commented out code

Co-authored-by: Joe Julian <me@joejulian.name>
Signed-off-by: Scott Rigby <scott@r6by.com>

* Check test failure string

Co-authored-by: Jesse Simpson <jesse.simpson36@gmail.com>
Signed-off-by: Scott Rigby <scott@r6by.com>

---------

Signed-off-by: Scott Rigby <scott@r6by.com>
Co-authored-by: George Jenkins <gvjenkins@gmail.com>
Co-authored-by: Joe Julian <me@joejulian.name>
Co-authored-by: Jesse Simpson <jesse.simpson36@gmail.com>
2025-08-22 16:12:49 -04:00
George Jenkins
a1c84f9a4c Move pkg/plugin -> internal/plugin
Signed-off-by: George Jenkins <gvjenkins@gmail.com>
2025-08-16 22:58:54 -07:00