Repository: aquasecurity/starboard
Pull request #649 (2021-07-31 21:22:17)

chore(trivy): Rename properties to configure resource requirements and limits
Signed-off-by: Daniel Pacak <pacak.daniel@gmail.com>

codecov[bot]: # [Codecov](https://codecov.io/gh/aquasecurity/starboard/pull/649?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aquasecurity) Report
> Merging [#649](https://codecov.io/gh/aquasecurity/starboard/pull/649?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aquasecurity) (afb8fb4) into [main](https://codecov.io/gh/aquasecurity/starboard/commit/ffe3ed8e825a310aca5c54933f0157bdd461f1f8?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aquasecurity) (ffe3ed8) will **decrease** coverage by `22.14%`.
> The diff coverage is `100.00%`.

[![Impacted file tree graph](https://codecov.io/gh/aquasecurity/starboard/pull/649/graphs/tree.svg?width=650&height=150&src=pr&token=qqTGKAJ0Wb&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aquasecurity)](https://codecov.io/gh/aquasecurity/starboard/pull/649?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aquasecurity)

```diff
@@             Coverage Diff             @@
##             main     #649       +/-   ##
===========================================
- Coverage   68.10%   45.95%   -22.15%     
===========================================
  Files          58       41       -17     
  Lines        4543     3688      -855     
===========================================
- Hits         3094     1695     -1399     
- Misses       1079     1880      +801     
+ Partials      370      113      -257     
```


| [Impacted Files](https://codecov.io/gh/aquasecurity/starboard/pull/649?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aquasecurity) | Coverage Δ | |
|---|---|---|
| [pkg/plugin/trivy/plugin.go](https://codecov.io/gh/aquasecurity/starboard/pull/649/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aquasecurity#diff-cGtnL3BsdWdpbi90cml2eS9wbHVnaW4uZ28=) | `83.09% <100.00%> (-0.64%)` | :arrow_down: |
| [pkg/kubehunter/scanner.go](https://codecov.io/gh/aquasecurity/starboard/pull/649/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aquasecurity#diff-cGtnL2t1YmVodW50ZXIvc2Nhbm5lci5nbw==) | `0.00% <0.00%> (-80.51%)` | :arrow_down: |
| [pkg/plugin/factory.go](https://codecov.io/gh/aquasecurity/starboard/pull/649/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aquasecurity#diff-cGtnL3BsdWdpbi9mYWN0b3J5Lmdv) | `0.00% <0.00%> (-80.49%)` | :arrow_down: |
| [pkg/configauditreport/scanner.go](https://codecov.io/gh/aquasecurity/starboard/pull/649/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aquasecurity#diff-cGtnL2NvbmZpZ2F1ZGl0cmVwb3J0L3NjYW5uZXIuZ28=) | `0.00% <0.00%> (-70.77%)` | :arrow_down: |
| [pkg/vulnerabilityreport/scanner.go](https://codecov.io/gh/aquasecurity/starboard/pull/649/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aquasecurity#diff-cGtnL3Z1bG5lcmFiaWxpdHlyZXBvcnQvc2Nhbm5lci5nbw==) | `0.00% <0.00%> (-70.54%)` | :arrow_down: |
| [pkg/operator/controller/configauditreport.go](https://codecov.io/gh/aquasecurity/starboard/pull/649/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aquasecurity#diff-cGtnL29wZXJhdG9yL2NvbnRyb2xsZXIvY29uZmlnYXVkaXRyZXBvcnQuZ28=) | `0.00% <0.00%> (-65.28%)` | :arrow_down: |
| [pkg/operator/controller/vulnerabilityreport.go](https://codecov.io/gh/aquasecurity/starboard/pull/649/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aquasecurity#diff-cGtnL29wZXJhdG9yL2NvbnRyb2xsZXIvdnVsbmVyYWJpbGl0eXJlcG9ydC5nbw==) | `0.00% <0.00%> (-65.17%)` | :arrow_down: |
| [pkg/kube/runnable\_job.go](https://codecov.io/gh/aquasecurity/starboard/pull/649/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aquasecurity#diff-cGtnL2t1YmUvcnVubmFibGVfam9iLmdv) | `0.00% <0.00%> (-64.39%)` | :arrow_down: |
| [pkg/kubehunter/model.go](https://codecov.io/gh/aquasecurity/starboard/pull/649/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aquasecurity#diff-cGtnL2t1YmVodW50ZXIvbW9kZWwuZ28=) | `0.00% <0.00%> (-61.54%)` | :arrow_down: |
| [pkg/operator/controller/ciskubebenchreport.go](https://codecov.io/gh/aquasecurity/starboard/pull/649/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aquasecurity#diff-cGtnL29wZXJhdG9yL2NvbnRyb2xsZXIvY2lza3ViZWJlbmNocmVwb3J0Lmdv) | `0.00% <0.00%> (-60.64%)` | :arrow_down: |
| ... and [30 more](https://codecov.io/gh/aquasecurity/starboard/pull/649/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aquasecurity) | |

------

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


Patch:
diff --git a/deploy/helm/templates/config.yaml b/deploy/helm/templates/config.yaml
index 8a0abee..d33ff85 100644
--- a/deploy/helm/templates/config.yaml
+++ b/deploy/helm/templates/config.yaml
@@ -36,24 +36,23 @@ data:
   trivy.serverURL: "{{ .Values.trivy.serverURL }}"
   {{- end }}
   {{- with .Values.trivy.resources }}
-    {{- with .request }}
+    {{- with .requests }}
       {{- if .cpu }}
-  trivy.resources.request.cpu: {{ .cpu }}
+  trivy.resources.requests.cpu: {{ .cpu }}
       {{- end }}
       {{- if hasKey . "memory" }}
-  trivy.resources.request.memory: {{ .memory }}
+  trivy.resources.requests.memory: {{ .memory }}
       {{- end }}
     {{- end }}
-    {{- with .limit }}
+    {{- with .limits }}
       {{- if .cpu }}
-  trivy.resources.limit.cpu: {{ .cpu }}
+  trivy.resources.limits.cpu: {{ .cpu }}
       {{- end }}
       {{- if .memory }}
-  trivy.resources.limit.memory: {{ .memory }}
+  trivy.resources.limits.memory: {{ .memory }}
       {{- end }}
     {{- end }}
   {{- end }}
-
 ---
 apiVersion: v1
 kind: Secret
diff --git a/deploy/helm/values.yaml b/deploy/helm/values.yaml
index abeabd6..d391ca1 100644
--- a/deploy/helm/values.yaml
+++ b/deploy/helm/values.yaml
@@ -92,12 +92,12 @@ trivy:
   httpsProxy:
   noProxy:
   severity: UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL
-#k8s resource requests and limits
+  # resources resource requests and limits
   resources:
-    request:
+    requests:
       cpu: 100m
       memory: 100M
-    limit:
+    limits:
       cpu: 500m
       memory: 500M
 
diff --git a/deploy/static/05-starboard-operator.config.yaml b/deploy/static/05-starboard-operator.config.yaml
index a33e811..906a636 100644
--- a/deploy/static/05-starboard-operator.config.yaml
+++ b/deploy/static/05-starboard-operator.config.yaml
@@ -30,10 +30,10 @@ data:
   trivy.imageRef: docker.io/aquasec/trivy:0.16.0
   trivy.severity: UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL
   trivy.mode: Standalone
-  trivy.resources.request.cpu: 100m
-  trivy.resources.request.memory: 100M
-  trivy.resources.limit.cpu: 500m
-  trivy.resources.limit.memory: 500M
+  trivy.resources.requests.cpu: 100m
+  trivy.resources.requests.memory: 100M
+  trivy.resources.limits.cpu: 500m
+  trivy.resources.limits.memory: 500M
 ---
 apiVersion: v1
 kind: ConfigMap
diff --git a/docs/integrations/vulnerability-scanners/trivy.md b/docs/integrations/vulnerability-scanners/trivy.md
index a67260e..f1cf316 100644
--- a/docs/integrations/vulnerability-scanners/trivy.md
+++ b/docs/integrations/vulnerability-scanners/trivy.md
@@ -1,3 +1,5 @@
+# Trivy
+
 ## Standalone
 
 The default configuration settings enable Trivy `vulnerabilityReports.scanner` in [`Standalone`][trivy-standalone]
@@ -76,6 +78,34 @@ EOF
 
 ![](./../../images/design/trivy-clientserver.png)
 
+## Settings
+
+| CONFIGMAP KEY                      | DEFAULT                                                | DESCRIPTION |
+| ---------------------------------- | ------------------------------------------------------ | ----------- |
+| `trivy.imageRef`                   | `docker.io/aquasec/trivy:0.16.0`                       | Trivy image reference |
+| `trivy.mode`                       | `Standalone`                                           | Trivy client mode. Either `Standalone` or `ClientServer`. Depending on the active mode other settings might be applicable or required. |
+| `trivy.severity`                   | `UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL`                     | A comma separated list of severity levels reported by Trivy |
+| `trivy.ignoreUnfixed`              | N/A                                                    | Whether to show only fixed vulnerabilities in vulnerabilities reported by Trivy. Set to `"true"` to enable it. |
+| `trivy.skipFiles`                  | N/A                                                    | A comma separated list of file paths for Trivy to skip traversal. |
+| `trivy.skipDirs`                   | N/A                                                    | A comma separated list of directories for Trivy to skip traversal. |
+| `trivy.ignoreFile`                 | N/A                                                    | It specifies the `.trivyignore` file which contains a list of vulnerability IDs to be ignored from vulnerabilities reported by Trivy. |
+| `trivy.serverURL`                  | N/A                                                    | The endpoint URL of the Trivy server. Required in `ClientServer` mode. |
+| `trivy.serverTokenHeader`          | `Trivy-Token`                                          | The name of the HTTP header to send the authentication token to Trivy server. Only application in `ClientServer` mode when `trivy.serverToken` is specified. |
+| `trivy.insecureRegistry.<id>`      | N/A                                                    | The registry to which insecure connections are allowed. There can be multiple registries with different registry `<id>`. |
+| `trivy.httpProxy`                  | N/A                                                    | The HTTP proxy used by Trivy to download the vulnerabilities database from GitHub. |
+| `trivy.httpsProxy`                 | N/A                                                    | The HTTPS proxy used by Trivy to download the vulnerabilities database from GitHub. |
+| `trivy.noProxy`                    | N/A                                                    | A comma separated list of IPs and domain names that are not subject to proxy settings. |
+| `trivy.resources.requests.cpu`     | `100m`                                                 | The minimum amount of CPU required to run Trivy scanner pod. |
+| `trivy.resources.requests.memory`  | `100M`                                                 | The minimum amount of memory required to run Trivy scanner pod. |
+| `trivy.resources.limits.cpu`       | `500m`                                                 | The maximum amount of CPU allowed to run Trivy scanner pod. |
+| `trivy.resources.limits.memory`    | `500M`                                                 | The maximum amount of memory allowed to run Trivy scanner pod. |
+
+| SECRET KEY                  | DESCRIPTION |
+| --------------------------- | ----------- |
+| `trivy.githubToken`         | The GitHub access token used by Trivy to download the vulnerabilities database from GitHub. Only applicable in `Standalone` mode. |
+| `trivy.serverToken`         | The token to authenticate Trivy client with Trivy server. Only applicable in `ClientServer` mode. |
+| `trivy.serverCustomHeaders` | A comma-separated list of custom HTTP headers sent by Trivy client to Trivy server. Only applicable in `ClientServer` mode. |
+
 [trivy-standalone]: https://aquasecurity.github.io/trivy/latest/modes/standalone/
 [emptyDir-volume]: https://kubernetes.io/docs/concepts/storage/volumes/#emptydir
 [gh-rate-limiting]: https://docs.github.com/en/free-pro-team@latest/rest/overview/resources-in-the-rest-api#rate-limiting
diff --git a/docs/settings.md b/docs/settings.md
index e5d4d06..63eb8f2 100644
--- a/docs/settings.md
+++ b/docs/settings.md
@@ -60,23 +60,6 @@ The following tables list available configuration settings with their default va
 | ---------------------------------- | ------------------------------------------------------ | ----------- |
 | `vulnerabilityReports.scanner`     | `Trivy`                                                | The name of the plugin that generates vulnerability reports. Either `Trivy` or `Aqua`. |
 | `configAuditReports.scanner`       | `Polaris`                                              | The name of the plugin that generates config audit reports. Either `Polaris` or `Conftest`. |
-| `trivy.httpProxy`                  | N/A                                                    | The HTTP proxy used by Trivy to download the vulnerabilities database from GitHub. |
-| `trivy.httpsProxy`                 | N/A                                                    | The HTTPS proxy used by Trivy to download the vulnerabilities database from GitHub. |
-| `trivy.noProxy`                    | N/A                                                    | A comma separated list of IPs and domain names that are not subject to proxy settings. |
-| `trivy.severity`                   | `UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL`                     | A comma separated list of severity levels reported by Trivy |
-| `trivy.imageRef`                   | `docker.io/aquasec/trivy:0.16.0`                       | Trivy image reference |
-| `trivy.mode`                       | `Standalone`                                           | Trivy client mode. Either `Standalone` or `ClientServer`. Depending on the active mode other settings might be applicable or required. |
-| `trivy.ignoreUnfixed`              | N/A                                                    | Whether to show only fixed vulnerabilities in vulnerabilities reported by Trivy. Set to `"true"` to enable it. |
-| `trivy.skipFiles`                  | N/A                                                    | A comma separated list of file paths for Trivy to skip traversal. |
-| `trivy.skipDirs`                   | N/A                                                    | A comma separated list of directories for Trivy to skip traversal. |
-| `trivy.ignoreFile`                 | N/A                                                    | It specifies the `.trivyignore` file which contains a list of vulnerability IDs to be ignored from vulnerabilities reported by Trivy. |
-| `trivy.serverURL`                  | N/A                                                    | The endpoint URL of the Trivy server. Required in `ClientServer` mode. |
-| `trivy.serverTokenHeader`          | `Trivy-Token`                                          | The name of the HTTP header to send the authentication token to Trivy server. Only application in `ClientServer` mode when `trivy.serverToken` is specified. |
-| `trivy.insecureRegistry.<id>`      | N/A                                                    | The registry to which insecure connections are allowed. There can be multiple registries with different registry `<id>`. |
-| `trivy.resources.request.cpu`      | `100m`                                                 | The minimum amount of CPU required to run Trivy scanner pod. |
-| `trivy.resources.request.memory`   | `100M`                                                 | The minimum amount of memory required to run Trivy scanner pod. |
-| `trivy.resources.limit.cpu`        | `500m`                                                 | The maximum amount of CPU allowed to run Trivy scanner pod. |
-| `trivy.resources.limit.memory`     | `500M`                                                 | The maximum amount of memory allowed to run Trivy scanner pod. |
 | `aqua.imageRef`                    | `docker.io/aquasec/scanner:5.3`                        | Aqua scanner image reference. The tag determines the version of the `scanner` binary executable and it must be compatible with version of Aqua console. |
 | `aqua.serverURL`                   | N/A                                                    | The endpoint URL of Aqua management console |
 | `kube-bench.imageRef`              | `docker.io/aquasec/kube-bench:0.6.3`                   | kube-bench image reference |
@@ -94,9 +77,6 @@ The following tables list available configuration settings with their default va
 
 | SECRET KEY                  | DESCRIPTION |
 | --------------------------- | ----------- |
-| `trivy.githubToken`         | The GitHub access token used by Trivy to download the vulnerabilities database from GitHub. Only applicable in `Standalone` mode. |
-| `trivy.serverToken`         | The token to authenticate Trivy client with Trivy server. Only applicable in `ClientServer` mode. |
-| `trivy.serverCustomHeaders` | A comma-separated list of custom HTTP headers sent by Trivy client to Trivy server. Only applicable in `ClientServer` mode. |
 | `aqua.username`             | Aqua management console username |
 | `aqua.password`             | Aqua management console password |
 
diff --git a/pkg/plugin/trivy/plugin.go b/pkg/plugin/trivy/plugin.go
index 123ca7e..04e285a 100644
--- a/pkg/plugin/trivy/plugin.go
+++ b/pkg/plugin/trivy/plugin.go
@@ -43,10 +43,10 @@ const (
 	keyTrivyServerToken         = "trivy.serverToken"
 	keyTrivyServerCustomHeaders = "trivy.serverCustomHeaders"
 
-	keyTrivyResourcesRequestsCPU    = "trivy.resources.request.cpu"
-	keyTrivyResourcesRequestsMemory = "trivy.resources.request.memory"
-	keyTrivyResourcesLimitCPU       = "trivy.resources.limit.cpu"
-	keyTrivyResourcesLimitMemory    = "trivy.resources.limit.memory"
+	keyResourcesRequestsCPU    = "trivy.resources.requests.cpu"
+	keyResourcesRequestsMemory = "trivy.resources.requests.memory"
+	keyResourcesLimitsCPU      = "trivy.resources.limits.cpu"
+	keyResourcesLimitsMemory   = "trivy.resources.limits.memory"
 )
 
 // Mode describes mode in which Trivy client operates.
@@ -112,22 +112,22 @@ func (c Config) GetResourceRequirements() (corev1.ResourceRequirements, error) {
 		Limits:   corev1.ResourceList{},
 	}
 
-	err := c.setResourceLimit(keyTrivyResourcesRequestsCPU, &requirements.Requests, corev1.ResourceCPU)
+	err := c.setResourceLimit(keyResourcesRequestsCPU, &requirements.Requests, corev1.ResourceCPU)
 	if err != nil {
 		return requirements, err
 	}
 
-	err = c.setResourceLimit(keyTrivyResourcesRequestsMemory, &requirements.Requests, corev1.ResourceMemory)
+	err = c.setResourceLimit(keyResourcesRequestsMemory, &requirements.Requests, corev1.ResourceMemory)
 	if err != nil {
 		return requirements, err
 	}
 
-	err = c.setResourceLimit(keyTrivyResourcesLimitCPU, &requirements.Limits, corev1.ResourceCPU)
+	err = c.setResourceLimit(keyResourcesLimitsCPU, &requirements.Limits, corev1.ResourceCPU)
 	if err != nil {
 		return requirements, err
 	}
 
-	err = c.setResourceLimit(keyTrivyResourcesLimitMemory, &requirements.Limits, corev1.ResourceMemory)
+	err = c.setResourceLimit(keyResourcesLimitsMemory, &requirements.Limits, corev1.ResourceMemory)
 	if err != nil {
 		return requirements, err
 	}
@@ -175,10 +175,10 @@ func (p *plugin) Init(ctx starboard.PluginContext) error {
 			keyTrivySeverity: "UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL",
 			keyTrivyMode:     string(Standalone),
 
-			keyTrivyResourcesRequestsCPU:    "100m",
-			keyTrivyResourcesRequestsMemory: "100M",
-			keyTrivyResourcesLimitCPU:       "500m",
-			keyTrivyResourcesLimitMemory:    "500M",
+			keyResourcesRequestsCPU:    "100m",
+			keyResourcesRequestsMemory: "100M",
+			keyResourcesLimitsCPU:      "500m",
+			keyResourcesLimitsMemory:   "500M",
 		},
 	})
 }


Test patch:
diff --git a/pkg/plugin/trivy/plugin_test.go b/pkg/plugin/trivy/plugin_test.go
index ccdef35..3e3108c 100644
--- a/pkg/plugin/trivy/plugin_test.go
+++ b/pkg/plugin/trivy/plugin_test.go
@@ -119,13 +119,15 @@ func TestConfig_GetMode(t *testing.T) {
 func TestConfig_GetResourceRequirements(t *testing.T) {
 	testCases := []struct {
 		name                 string
-		configData           trivy.Config
+		config               trivy.Config
 		expectedError        string
 		expectedRequirements corev1.ResourceRequirements
 	}{
 		{
-			name:          "Should return empty requirements by default",
-			configData:    trivy.Config{PluginConfig: starboard.PluginConfig{}},
+			name: "Should return empty requirements by default",
+			config: trivy.Config{
+				PluginConfig: starboard.PluginConfig{},
+			},
 			expectedError: "",
 			expectedRequirements: corev1.ResourceRequirements{
 				Requests: corev1.ResourceList{},
@@ -134,14 +136,16 @@ func TestConfig_GetResourceRequirements(t *testing.T) {
 		},
 		{
 			name: "Should return configured resource requirement",
-			configData: trivy.Config{PluginConfig: starboard.PluginConfig{
-				Data: map[string]string{
-					"trivy.resources.request.cpu":    "800m",
-					"trivy.resources.request.memory": "200M",
-					"trivy.resources.limit.cpu":      "600m",
-					"trivy.resources.limit.memory":   "700M",
+			config: trivy.Config{
+				PluginConfig: starboard.PluginConfig{
+					Data: map[string]string{
+						"trivy.resources.requests.cpu":    "800m",
+						"trivy.resources.requests.memory": "200M",
+						"trivy.resources.limits.cpu":      "600m",
+						"trivy.resources.limits.memory":   "700M",
+					},
 				},
-			}},
+			},
 			expectedError: "",
 			expectedRequirements: corev1.ResourceRequirements{
 				Requests: corev1.ResourceList{
@@ -156,37 +160,25 @@ func TestConfig_GetResourceRequirements(t *testing.T) {
 		},
 		{
 			name: "Should return error if resource is not parseable",
-			configData: trivy.Config{PluginConfig: starboard.PluginConfig{
-				Data: map[string]string{
-					"trivy.resources.request.cpu":    "roughly 100",
-					"trivy.resources.request.memory": "200M",
-					"trivy.resources.limit.cpu":      "600m",
-					"trivy.resources.limit.memory":   "700M",
-				},
-			}},
-			expectedError: "parsing resource definition trivy.resources.request.cpu: roughly 100 quantities must match the regular expression '^([+-]?[0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$'",
-			expectedRequirements: corev1.ResourceRequirements{
-				Requests: corev1.ResourceList{
-					corev1.ResourceCPU:    resource.MustParse("800m"),
-					corev1.ResourceMemory: resource.MustParse("200M"),
-				},
-				Limits: corev1.ResourceList{
-					corev1.ResourceCPU:    resource.MustParse("600m"),
-					corev1.ResourceMemory: resource.MustParse("700M"),
+			config: trivy.Config{
+				PluginConfig: starboard.PluginConfig{
+					Data: map[string]string{
+						"trivy.resources.requests.cpu": "roughly 100",
+					},
 				},
 			},
+			expectedError: "parsing resource definition trivy.resources.requests.cpu: roughly 100 quantities must match the regular expression '^([+-]?[0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$'",
 		},
 	}
 	for _, tc := range testCases {
 		t.Run(tc.name, func(t *testing.T) {
-			resourceRequirement, err := tc.configData.GetResourceRequirements()
+			resourceRequirement, err := tc.config.GetResourceRequirements()
 			if tc.expectedError != "" {
 				require.EqualError(t, err, tc.expectedError)
 			} else {
 				require.NoError(t, err)
-				require.Equal(t, tc.expectedRequirements, resourceRequirement, tc.name)
+				assert.Equal(t, tc.expectedRequirements, resourceRequirement, tc.name)
 			}
-
 		})
 	}
 }
@@ -309,10 +301,10 @@ func TestPlugin_Init(t *testing.T) {
 				"trivy.severity": "UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL",
 				"trivy.mode":     "Standalone",
 
-				"trivy.resources.request.cpu":    "100m",
-				"trivy.resources.request.memory": "100M",
-				"trivy.resources.limit.cpu":      "500m",
-				"trivy.resources.limit.memory":   "500M",
+				"trivy.resources.requests.cpu":    "100m",
+				"trivy.resources.requests.memory": "100M",
+				"trivy.resources.limits.cpu":      "500m",
+				"trivy.resources.limits.memory":   "500M",
 			},
 		}, cm)
 	})
@@ -389,10 +381,10 @@ func TestPlugin_GetScanJobSpec(t *testing.T) {
 				"trivy.imageRef": "docker.io/aquasec/trivy:0.14.0",
 				"trivy.mode":     string(trivy.Standalone),
 
-				"trivy.resources.request.cpu":    "100m",
-				"trivy.resources.request.memory": "100M",
-				"trivy.resources.limit.cpu":      "500m",
-				"trivy.resources.limit.memory":   "500M",
+				"trivy.resources.requests.cpu":    "100m",
+				"trivy.resources.requests.memory": "100M",
+				"trivy.resources.limits.cpu":      "500m",
+				"trivy.resources.limits.memory":   "500M",
 			},
 			workloadSpec: corev1.PodSpec{
 				Containers: []corev1.Container{
@@ -638,10 +630,10 @@ func TestPlugin_GetScanJobSpec(t *testing.T) {
 				"trivy.mode":                         string(trivy.Standalone),
 				"trivy.insecureRegistry.pocRegistry": "poc.myregistry.harbor.com.pl",
 
-				"trivy.resources.request.cpu":    "100m",
-				"trivy.resources.request.memory": "100M",
-				"trivy.resources.limit.cpu":      "500m",
-				"trivy.resources.limit.memory":   "500M",
+				"trivy.resources.requests.cpu":    "100m",
+				"trivy.resources.requests.memory": "100M",
+				"trivy.resources.limits.cpu":      "500m",
+				"trivy.resources.limits.memory":   "500M",
 			},
 			workloadSpec: corev1.PodSpec{
 				Containers: []corev1.Container{
@@ -893,10 +885,10 @@ CVE-2018-14618
 
 # No impact in our settings
 CVE-2019-1543`,
-				"trivy.resources.request.cpu":    "100m",
-				"trivy.resources.request.memory": "100M",
-				"trivy.resources.limit.cpu":      "500m",
-				"trivy.resources.limit.memory":   "500M",
+				"trivy.resources.requests.cpu":    "100m",
+				"trivy.resources.requests.memory": "100M",
+				"trivy.resources.limits.cpu":      "500m",
+				"trivy.resources.limits.memory":   "500M",
 			},
 			workloadSpec: corev1.PodSpec{
 				Containers: []corev1.Container{
@@ -1166,10 +1158,10 @@ CVE-2019-1543`,
 				"trivy.imageRef":                 "docker.io/aquasec/trivy:0.14.0",
 				"trivy.mode":                     string(trivy.ClientServer),
 				"trivy.serverURL":                "http://trivy.trivy:4954",
-				"trivy.resources.request.cpu":    "100m",
-				"trivy.resources.request.memory": "100M",
-				"trivy.resources.limit.cpu":      "500m",
-				"trivy.resources.limit.memory":   "500M",
+				"trivy.resources.requests.cpu":    "100m",
+				"trivy.resources.requests.memory": "100M",
+				"trivy.resources.limits.cpu":      "500m",
+				"trivy.resources.limits.memory":   "500M",
 			},
 			workloadSpec: corev1.PodSpec{
 				Containers: []corev1.Container{
@@ -1343,10 +1335,10 @@ CVE-2019-1543`,
 				"trivy.mode":                         string(trivy.ClientServer),
 				"trivy.serverURL":                    "http://trivy.trivy:4954",
 				"trivy.insecureRegistry.pocRegistry": "poc.myregistry.harbor.com.pl",
-				"trivy.resources.request.cpu":        "100m",
-				"trivy.resources.request.memory":     "100M",
-				"trivy.resources.limit.cpu":          "500m",
-				"trivy.resources.limit.memory":       "500M",
+				"trivy.resources.requests.cpu":        "100m",
+				"trivy.resources.requests.memory":     "100M",
+				"trivy.resources.limits.cpu":          "500m",
+				"trivy.resources.limits.memory":       "500M",
 			},
 			workloadSpec: corev1.PodSpec{
 				Containers: []corev1.Container{
@@ -1528,10 +1520,10 @@ CVE-2018-14618
 
 # No impact in our settings
 CVE-2019-1543`,
-				"trivy.resources.request.cpu":    "100m",
-				"trivy.resources.request.memory": "100M",
-				"trivy.resources.limit.cpu":      "500m",
-				"trivy.resources.limit.memory":   "500M",
+				"trivy.resources.requests.cpu":    "100m",
+				"trivy.resources.requests.memory": "100M",
+				"trivy.resources.limits.cpu":      "500m",
+				"trivy.resources.limits.memory":   "500M",
 			},
 			workloadSpec: corev1.PodSpec{
 				Containers: []corev1.Container{