Repository: aquasecurity/starboard
Pull request #427 (2021-03-11 20:48:48)

refactor: Move trivy package under pkg/plugin
Signed-off-by: Daniel Pacak <pacak.daniel@gmail.com>

codecov[bot]: # [Codecov](https://codecov.io/gh/aquasecurity/starboard/pull/427?src=pr&el=h1) Report
> Merging [#427](https://codecov.io/gh/aquasecurity/starboard/pull/427?src=pr&el=desc) (785d501) into [main](https://codecov.io/gh/aquasecurity/starboard/commit/a54ed60ee335913bf2819ebe42a8bea8d662bcb9?el=desc) (a54ed60) will **decrease** coverage by `37.38%`.
> The diff coverage is `n/a`.

[![Impacted file tree graph](https://codecov.io/gh/aquasecurity/starboard/pull/427/graphs/tree.svg?width=650&height=150&src=pr&token=qqTGKAJ0Wb)](https://codecov.io/gh/aquasecurity/starboard/pull/427?src=pr&el=tree)

```diff
@@             Coverage Diff             @@
##             main     #427       +/-   ##
===========================================
- Coverage   66.91%   29.53%   -37.39%     
===========================================
  Files          59       58        -1     
  Lines        3406     3305      -101     
===========================================
- Hits         2279      976     -1303     
- Misses        847     2268     +1421     
+ Partials      280       61      -219     
```


| [Impacted Files](https://codecov.io/gh/aquasecurity/starboard/pull/427?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pkg/plugin/factory.go](https://codecov.io/gh/aquasecurity/starboard/pull/427/diff?src=pr&el=tree#diff-cGtnL3BsdWdpbi9mYWN0b3J5Lmdv) | `0.00% <ø> (-50.00%)` | :arrow_down: |
| [pkg/plugin/trivy/converter.go](https://codecov.io/gh/aquasecurity/starboard/pull/427/diff?src=pr&el=tree#diff-cGtnL3BsdWdpbi90cml2eS9jb252ZXJ0ZXIuZ28=) | `81.25% <ø> (ø)` | |
| [pkg/plugin/trivy/plugin.go](https://codecov.io/gh/aquasecurity/starboard/pull/427/diff?src=pr&el=tree#diff-cGtnL3BsdWdpbi90cml2eS9wbHVnaW4uZ28=) | `73.77% <ø> (ø)` | |
| [pkg/cmd/get.go](https://codecov.io/gh/aquasecurity/starboard/pull/427/diff?src=pr&el=tree#diff-cGtnL2NtZC9nZXQuZ28=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [pkg/cmd/find.go](https://codecov.io/gh/aquasecurity/starboard/pull/427/diff?src=pr&el=tree#diff-cGtnL2NtZC9maW5kLmdv) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [pkg/cmd/root.go](https://codecov.io/gh/aquasecurity/starboard/pull/427/diff?src=pr&el=tree#diff-cGtnL2NtZC9yb290Lmdv) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [pkg/cmd/scan.go](https://codecov.io/gh/aquasecurity/starboard/pull/427/diff?src=pr&el=tree#diff-cGtnL2NtZC9zY2FuLmdv) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [pkg/cmd/polaris.go](https://codecov.io/gh/aquasecurity/starboard/pull/427/diff?src=pr&el=tree#diff-cGtnL2NtZC9wb2xhcmlzLmdv) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [pkg/cmd/version.go](https://codecov.io/gh/aquasecurity/starboard/pull/427/diff?src=pr&el=tree#diff-cGtnL2NtZC92ZXJzaW9uLmdv) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| [pkg/cmd/kube\_bench.go](https://codecov.io/gh/aquasecurity/starboard/pull/427/diff?src=pr&el=tree#diff-cGtnL2NtZC9rdWJlX2JlbmNoLmdv) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
| ... and [37 more](https://codecov.io/gh/aquasecurity/starboard/pull/427/diff?src=pr&el=tree-more) | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/aquasecurity/starboard/pull/427?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/aquasecurity/starboard/pull/427?src=pr&el=footer). Last update [a54ed60...785d501](https://codecov.io/gh/aquasecurity/starboard/pull/427?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).


Patch:
diff --git a/Makefile b/Makefile
index b3233f2..16be3e4 100644
--- a/Makefile
+++ b/Makefile
@@ -72,7 +72,7 @@ itests-starboard: check-env get-ginkgo
 	github.com/aquasecurity/starboard/pkg/kube/pod,\
 	github.com/aquasecurity/starboard/pkg/kubebench,\
 	github.com/aquasecurity/starboard/pkg/kubehunter,\
-	github.com/aquasecurity/starboard/pkg/trivy,\
+	github.com/aquasecurity/starboard/pkg/plugin/trivy,\
 	github.com/aquasecurity/starboard/pkg/plugin/polaris,\
 	github.com/aquasecurity/starboard/pkg/configauditreport,\
 	github.com/aquasecurity/starboard/pkg/vulnerabilityreport \
@@ -90,7 +90,7 @@ itests-starboard-operator: check-env get-ginkgo
 	github.com/aquasecurity/starboard/pkg/operator/controller,\
 	github.com/aquasecurity/starboard/pkg/plugin,\
 	github.com/aquasecurity/starboard/pkg/resources,\
-	github.com/aquasecurity/starboard/pkg/trivy,\
+	github.com/aquasecurity/starboard/pkg/plugin/trivy,\
 	github.com/aquasecurity/starboard/pkg/plugin/polaris,\
 	github.com/aquasecurity/starboard/pkg/configauditreport,\
 	github.com/aquasecurity/starboard/pkg/vulnerabilityreport,\
diff --git a/pkg/plugin/factory.go b/pkg/plugin/factory.go
index f7d4faa..e24e040 100644
--- a/pkg/plugin/factory.go
+++ b/pkg/plugin/factory.go
@@ -7,8 +7,8 @@ import (
 	"github.com/aquasecurity/starboard/pkg/ext"
 	"github.com/aquasecurity/starboard/pkg/plugin/aqua"
 	"github.com/aquasecurity/starboard/pkg/plugin/polaris"
+	"github.com/aquasecurity/starboard/pkg/plugin/trivy"
 	"github.com/aquasecurity/starboard/pkg/starboard"
-	"github.com/aquasecurity/starboard/pkg/trivy"
 	"github.com/aquasecurity/starboard/pkg/vulnerabilityreport"
 )
 


Test patch:
diff --git a/pkg/trivy/converter.go b/pkg/plugin/trivy/converter.go
similarity index 100%
rename from pkg/trivy/converter.go
rename to pkg/plugin/trivy/converter.go
diff --git a/pkg/trivy/converter_test.go b/pkg/plugin/trivy/converter_test.go
similarity index 98%
rename from pkg/trivy/converter_test.go
rename to pkg/plugin/trivy/converter_test.go
index 5de3577..4391d4c 100644
--- a/pkg/trivy/converter_test.go
+++ b/pkg/plugin/trivy/converter_test.go
@@ -7,8 +7,8 @@ import (
 	"time"
 
 	"github.com/aquasecurity/starboard/pkg/apis/aquasecurity/v1alpha1"
+	"github.com/aquasecurity/starboard/pkg/plugin/trivy"
 	"github.com/aquasecurity/starboard/pkg/starboard"
-	"github.com/aquasecurity/starboard/pkg/trivy"
 	"github.com/stretchr/testify/assert"
 	"github.com/stretchr/testify/require"
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
diff --git a/pkg/trivy/doc.go b/pkg/plugin/trivy/doc.go
similarity index 100%
rename from pkg/trivy/doc.go
rename to pkg/plugin/trivy/doc.go
diff --git a/pkg/trivy/model.go b/pkg/plugin/trivy/model.go
similarity index 100%
rename from pkg/trivy/model.go
rename to pkg/plugin/trivy/model.go
diff --git a/pkg/trivy/model_test.go b/pkg/plugin/trivy/model_test.go
similarity index 100%
rename from pkg/trivy/model_test.go
rename to pkg/plugin/trivy/model_test.go
diff --git a/pkg/trivy/plugin.go b/pkg/plugin/trivy/plugin.go
similarity index 100%
rename from pkg/trivy/plugin.go
rename to pkg/plugin/trivy/plugin.go
diff --git a/pkg/trivy/plugin_test.go b/pkg/plugin/trivy/plugin_test.go
similarity index 99%
rename from pkg/trivy/plugin_test.go
rename to pkg/plugin/trivy/plugin_test.go
index 2d450aa..078633f 100644
--- a/pkg/trivy/plugin_test.go
+++ b/pkg/plugin/trivy/plugin_test.go
@@ -4,8 +4,8 @@ import (
 	"testing"
 
 	"github.com/aquasecurity/starboard/pkg/ext"
+	"github.com/aquasecurity/starboard/pkg/plugin/trivy"
 	"github.com/aquasecurity/starboard/pkg/starboard"
-	"github.com/aquasecurity/starboard/pkg/trivy"
 	"github.com/stretchr/testify/assert"
 	"github.com/stretchr/testify/require"
 	corev1 "k8s.io/api/core/v1"