Repository: aquasecurity/starboard
Pull request #962 (2022-02-16 10:27:59)

refactor: move plugin constants from generic starboard config
Signed-off-by: Daniel Pacak <pacak.daniel@gmail.com>

codecov[bot]: # [Codecov](https://codecov.io/gh/aquasecurity/starboard/pull/962?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aquasecurity) Report
> Merging [#962](https://codecov.io/gh/aquasecurity/starboard/pull/962?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aquasecurity) (fa4aa15) into [main](https://codecov.io/gh/aquasecurity/starboard/commit/283f269ba35311c238bb6fff9bf85f5c3375de44?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aquasecurity) (283f269) will **decrease** coverage by `18.60%`.
> The diff coverage is `50.00%`.

[![Impacted file tree graph](https://codecov.io/gh/aquasecurity/starboard/pull/962/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/962?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aquasecurity)

```diff
@@             Coverage Diff             @@
##             main     #962       +/-   ##
===========================================
- Coverage   64.76%   46.15%   -18.61%     
===========================================
  Files          59       42       -17     
  Lines        6982     5780     -1202     
===========================================
- Hits         4522     2668     -1854     
- Misses       2001     2948      +947     
+ Partials      459      164      -295     
```


| [Impacted Files](https://codecov.io/gh/aquasecurity/starboard/pull/962?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aquasecurity) | Coverage Δ | |
|---|---|---|
| [itest/matcher/matcher.go](https://codecov.io/gh/aquasecurity/starboard/pull/962/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aquasecurity#diff-aXRlc3QvbWF0Y2hlci9tYXRjaGVyLmdv) | `74.16% <0.00%> (ø)` | |
| [pkg/plugin/factory.go](https://codecov.io/gh/aquasecurity/starboard/pull/962/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%> (-81.14%)` | :arrow_down: |
| [pkg/plugin/polaris/plugin.go](https://codecov.io/gh/aquasecurity/starboard/pull/962/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aquasecurity#diff-cGtnL3BsdWdpbi9wb2xhcmlzL3BsdWdpbi5nbw==) | `80.85% <ø> (-1.71%)` | :arrow_down: |
| [pkg/starboard/config.go](https://codecov.io/gh/aquasecurity/starboard/pull/962/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aquasecurity#diff-cGtnL3N0YXJib2FyZC9jb25maWcuZ28=) | `77.65% <100.00%> (-1.35%)` | :arrow_down: |
| [pkg/kubehunter/scanner.go](https://codecov.io/gh/aquasecurity/starboard/pull/962/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%> (-74.49%)` | :arrow_down: |
| [pkg/operator/controller/configauditreport.go](https://codecov.io/gh/aquasecurity/starboard/pull/962/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.51%)` | :arrow_down: |
| [pkg/kube/runnable\_job.go](https://codecov.io/gh/aquasecurity/starboard/pull/962/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%> (-63.73%)` | :arrow_down: |
| [pkg/kubehunter/model.go](https://codecov.io/gh/aquasecurity/starboard/pull/962/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%> (-62.86%)` | :arrow_down: |
| [pkg/operator/controller/vulnerabilityreport.go](https://codecov.io/gh/aquasecurity/starboard/pull/962/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%> (-60.64%)` | :arrow_down: |
| ... and [34 more](https://codecov.io/gh/aquasecurity/starboard/pull/962/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/962?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/962?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aquasecurity). Last update [f1a9360...fa4aa15](https://codecov.io/gh/aquasecurity/starboard/pull/962?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/pkg/plugin/factory.go b/pkg/plugin/factory.go
index 6480096..2087dbb 100644
--- a/pkg/plugin/factory.go
+++ b/pkg/plugin/factory.go
@@ -14,6 +14,13 @@ import (
 	"sigs.k8s.io/controller-runtime/pkg/client"
 )
 
+const (
+	Trivy    starboard.Scanner = "Trivy"
+	Aqua     starboard.Scanner = "Aqua"
+	Polaris  starboard.Scanner = "Polaris"
+	Conftest starboard.Scanner = "Conftest"
+)
+
 type Resolver struct {
 	buildInfo          starboard.BuildInfo
 	config             starboard.ConfigData
@@ -71,9 +78,9 @@ func (r *Resolver) GetVulnerabilityPlugin() (vulnerabilityreport.Plugin, starboa
 		Get()
 
 	switch scanner {
-	case starboard.Trivy:
+	case Trivy:
 		return trivy.NewPlugin(ext.NewSystemClock(), ext.NewGoogleUUIDGenerator(), r.client), pluginContext, nil
-	case starboard.Aqua:
+	case Aqua:
 		return aqua.NewPlugin(ext.NewGoogleUUIDGenerator(), r.buildInfo), pluginContext, nil
 	}
 	return nil, nil, fmt.Errorf("unsupported vulnerability scanner plugin: %s", scanner)
@@ -98,9 +105,9 @@ func (r *Resolver) GetConfigAuditPlugin() (configauditreport.Plugin, starboard.P
 		Get()
 
 	switch scanner {
-	case starboard.Polaris:
+	case Polaris:
 		return polaris.NewPlugin(ext.NewSystemClock()), pluginContext, nil
-	case starboard.Conftest:
+	case Conftest:
 		return conftest.NewPlugin(ext.NewGoogleUUIDGenerator(), ext.NewSystemClock()), pluginContext, nil
 	}
 	return nil, nil, fmt.Errorf("unsupported configuration audit scanner plugin: %s", scanner)
diff --git a/pkg/plugin/polaris/plugin.go b/pkg/plugin/polaris/plugin.go
index bbe759c..1616117 100644
--- a/pkg/plugin/polaris/plugin.go
+++ b/pkg/plugin/polaris/plugin.go
@@ -18,6 +18,11 @@ import (
 	"sigs.k8s.io/controller-runtime/pkg/client"
 )
 
+const (
+	// Plugin the name of this plugin.
+	Plugin = "Polaris"
+)
+
 const (
 	polarisContainerName = "polaris"
 	configVolume         = "config"
diff --git a/pkg/starboard/config.go b/pkg/starboard/config.go
index ca1c51d..61a3e8c 100644
--- a/pkg/starboard/config.go
+++ b/pkg/starboard/config.go
@@ -35,8 +35,8 @@ func NewScheme() *runtime.Scheme {
 	return scheme
 }
 
-// BuildInfo holds build info such as Git revision, Git SHA-1,
-// build datetime, and the name of the executable binary.
+// BuildInfo holds build info such as Git revision, Git SHA-1, build datetime,
+// and the name of the executable binary.
 type BuildInfo struct {
 	Version    string
 	Commit     string
@@ -47,13 +47,6 @@ type BuildInfo struct {
 // Scanner represents unique, human-readable identifier of a security scanner.
 type Scanner string
 
-const (
-	Trivy    Scanner = "Trivy"
-	Aqua     Scanner = "Aqua"
-	Polaris  Scanner = "Polaris"
-	Conftest Scanner = "Conftest"
-)
-
 const (
 	keyVulnerabilityReportsScanner = "vulnerabilityReports.scanner"
 	keyConfigAuditReportsScanner   = "configAuditReports.scanner"
@@ -65,8 +58,8 @@ const (
 	keyScanJobPodTemplateLabels    = "scanJob.podTemplateLabels"
 )
 
-// ConfigData holds Starboard configuration settings as a set
-// of key-value pairs.
+// ConfigData holds Starboard configuration settings as a set of key-value
+// pairs.
 type ConfigData map[string]string
 
 // ConfigManager defines methods for managing ConfigData.
@@ -79,8 +72,8 @@ type ConfigManager interface {
 // GetDefaultConfig returns the default configuration settings.
 func GetDefaultConfig() ConfigData {
 	return map[string]string{
-		keyVulnerabilityReportsScanner: string(Trivy),
-		keyConfigAuditReportsScanner:   string(Polaris),
+		keyVulnerabilityReportsScanner: "Trivy",
+		keyConfigAuditReportsScanner:   "Polaris",
 
 		"kube-bench.imageRef":  "docker.io/aquasec/kube-bench:v0.6.5",
 		"kube-hunter.imageRef": "docker.io/aquasec/kube-hunter:0.6.3",
@@ -94,16 +87,7 @@ func (c ConfigData) GetVulnerabilityReportsScanner() (Scanner, error) {
 	if value, ok = c[keyVulnerabilityReportsScanner]; !ok {
 		return "", fmt.Errorf("property %s not set", keyVulnerabilityReportsScanner)
 	}
-
-	switch Scanner(value) {
-	case Trivy:
-		return Trivy, nil
-	case Aqua:
-		return Aqua, nil
-	}
-
-	return "", fmt.Errorf("invalid value (%s) of %s; allowed values (%s, %s)",
-		value, keyVulnerabilityReportsScanner, Trivy, Aqua)
+	return Scanner(value), nil
 }
 
 func (c ConfigData) GetConfigAuditReportsScanner() (Scanner, error) {
@@ -112,15 +96,7 @@ func (c ConfigData) GetConfigAuditReportsScanner() (Scanner, error) {
 	if value, ok = c[keyConfigAuditReportsScanner]; !ok {
 		return "", fmt.Errorf("property %s not set", keyConfigAuditReportsScanner)
 	}
-
-	switch Scanner(value) {
-	case Polaris:
-		return Polaris, nil
-	case Conftest:
-		return Conftest, nil
-	}
-	return "", fmt.Errorf("invalid value (%s) of %s; allowed values (%s, %s)",
-		value, keyConfigAuditReportsScanner, Polaris, Conftest)
+	return Scanner(value), nil
 }
 
 func (c ConfigData) GetScanJobTolerations() ([]corev1.Toleration, error) {
@@ -199,7 +175,8 @@ func (c ConfigData) GetRequiredData(key string) (string, error) {
 	return value, nil
 }
 
-// GetVersionFromImageRef returns the image identifier for the specified image reference.
+// GetVersionFromImageRef returns the image identifier for the specified image
+// reference.
 func GetVersionFromImageRef(imageRef string) (string, error) {
 	ref, err := name.ParseReference(imageRef)
 	if err != nil {
@@ -298,7 +275,7 @@ func (c *configManager) Delete(ctx context.Context) error {
 	if err != nil && !apierrors.IsNotFound(err) {
 		return err
 	}
-	err = c.client.CoreV1().ConfigMaps(c.namespace).Delete(ctx, GetPluginConfigMapName(string(Polaris)), metav1.DeleteOptions{})
+	err = c.client.CoreV1().ConfigMaps(c.namespace).Delete(ctx, GetPluginConfigMapName("Polaris"), metav1.DeleteOptions{})
 	if err != nil && !apierrors.IsNotFound(err) {
 		return err
 	}


Test patch:
diff --git a/itest/matcher/matcher.go b/itest/matcher/matcher.go
index eef08df..8ef8c4e 100644
--- a/itest/matcher/matcher.go
+++ b/itest/matcher/matcher.go
@@ -8,6 +8,7 @@ import (
 
 	"github.com/aquasecurity/starboard/pkg/apis/aquasecurity/v1alpha1"
 	"github.com/aquasecurity/starboard/pkg/kube"
+	"github.com/aquasecurity/starboard/pkg/plugin"
 	"github.com/aquasecurity/starboard/pkg/starboard"
 	"github.com/onsi/gomega/types"
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -161,7 +162,7 @@ func (m *configAuditReportMatcher) Match(actual interface{}) (bool, error) {
 	}
 
 	scanner := polarisScanner
-	if m.scanner == starboard.Conftest {
+	if m.scanner == plugin.Conftest {
 		scanner = conftestScanner
 	}
 
diff --git a/itest/matcher/matcher_test.go b/itest/matcher/matcher_test.go
index 2618d04..1fb48ad 100644
--- a/itest/matcher/matcher_test.go
+++ b/itest/matcher/matcher_test.go
@@ -7,6 +7,7 @@ import (
 
 	"github.com/aquasecurity/starboard/itest/matcher"
 	"github.com/aquasecurity/starboard/pkg/apis/aquasecurity/v1alpha1"
+	"github.com/aquasecurity/starboard/pkg/plugin"
 	"github.com/aquasecurity/starboard/pkg/starboard"
 	appsv1 "k8s.io/api/apps/v1"
 	corev1 "k8s.io/api/core/v1"
@@ -71,7 +72,7 @@ func TestConfigAuditReportMatcher(t *testing.T) {
 
 	t.Run("Should return error when actual is not ConfigAuditReport", func(t *testing.T) {
 		g := NewGomegaWithT(t)
-		instance := matcher.IsConfigAuditReportOwnedBy(&appsv1.ReplicaSet{}, starboard.Polaris)
+		instance := matcher.IsConfigAuditReportOwnedBy(&appsv1.ReplicaSet{}, plugin.Polaris)
 		_, err := instance.Match("I AM INVALID ACTUAL")
 		g.Expect(err).To(MatchError("matcher.configAuditReportMatcher expects a v1alpha1.ConfigAuditReport"))
 	})
@@ -84,7 +85,7 @@ func TestConfigAuditReportMatcher(t *testing.T) {
 				Namespace: "default",
 				UID:       "494b2727-5d52-4057-9a9b-8b508c753fea",
 			},
-		}, starboard.Polaris)
+		}, plugin.Polaris)
 		success, err := instance.Match(v1alpha1.ConfigAuditReport{
 			ObjectMeta: metav1.ObjectMeta{
 				Name:      "replicaset-nginx-6d4cf56db6",
diff --git a/itest/starboard/starboard_cli_test.go b/itest/starboard/starboard_cli_test.go
index f0b428f..9763523 100644
--- a/itest/starboard/starboard_cli_test.go
+++ b/itest/starboard/starboard_cli_test.go
@@ -15,6 +15,7 @@ import (
 	"github.com/aquasecurity/starboard/pkg/apis/aquasecurity/v1alpha1"
 	"github.com/aquasecurity/starboard/pkg/cmd"
 	"github.com/aquasecurity/starboard/pkg/kube"
+	"github.com/aquasecurity/starboard/pkg/plugin"
 	"github.com/aquasecurity/starboard/pkg/starboard"
 	"github.com/aquasecurity/starboard/pkg/vulnerabilityreport"
 	appsv1 "k8s.io/api/apps/v1"
@@ -1097,11 +1098,11 @@ var _ = Describe("Starboard CLI", func() {
 			})
 
 			Context("with Polaris as scanner", func() {
-				assertConfigAuditReportCreated(starboard.Polaris, kube.KindPod)
+				assertConfigAuditReportCreated(plugin.Polaris, kube.KindPod)
 			})
 
 			Context("with Conftest as scanner", func() {
-				assertConfigAuditReportCreated(starboard.Conftest, kube.KindPod)
+				assertConfigAuditReportCreated(plugin.Conftest, kube.KindPod)
 			})
 
 			AfterEach(func() {
@@ -1127,11 +1128,11 @@ var _ = Describe("Starboard CLI", func() {
 			})
 
 			Context("with Polaris as scanner", func() {
-				assertConfigAuditReportCreated(starboard.Polaris, kube.KindPod)
+				assertConfigAuditReportCreated(plugin.Polaris, kube.KindPod)
 			})
 
 			Context("with Conftest as scanner", func() {
-				assertConfigAuditReportCreated(starboard.Conftest, kube.KindPod)
+				assertConfigAuditReportCreated(plugin.Conftest, kube.KindPod)
 			})
 
 			AfterEach(func() {
@@ -1180,11 +1181,11 @@ var _ = Describe("Starboard CLI", func() {
 			})
 
 			Context("with Polaris as scanner", func() {
-				assertConfigAuditReportCreated(starboard.Polaris, kube.KindCronJob)
+				assertConfigAuditReportCreated(plugin.Polaris, kube.KindCronJob)
 			})
 
 			Context("with Conftest as scanner", func() {
-				assertConfigAuditReportCreated(starboard.Conftest, kube.KindCronJob)
+				assertConfigAuditReportCreated(plugin.Conftest, kube.KindCronJob)
 			})
 
 			AfterEach(func() {
diff --git a/pkg/plugin/conftest/plugin_test.go b/pkg/plugin/conftest/plugin_test.go
index e6ae811..1eba29a 100644
--- a/pkg/plugin/conftest/plugin_test.go
+++ b/pkg/plugin/conftest/plugin_test.go
@@ -257,7 +257,7 @@ func TestPlugin_Init(t *testing.T) {
 		instance := conftest.NewPlugin(ext.NewSimpleIDGenerator(), fixedClock)
 
 		pluginContext := starboard.NewPluginContext().
-			WithName(string(starboard.Conftest)).
+			WithName(conftest.Plugin).
 			WithNamespace("starboard-ns").
 			WithServiceAccountName("starboard-sa").
 			WithClient(client).
@@ -347,7 +347,7 @@ func TestPlugin_GetScanJobSpec(t *testing.T) {
 	g := NewGomegaWithT(t)
 	sequence := ext.NewSimpleIDGenerator()
 	pluginContext := starboard.NewPluginContext().
-		WithName(string(starboard.Conftest)).
+		WithName(conftest.Plugin).
 		WithNamespace("starboard-ns").
 		WithServiceAccountName("starboard-sa").
 		WithClient(fake.NewClientBuilder().WithObjects(&corev1.ConfigMap{
@@ -598,7 +598,7 @@ func TestPlugin_ParseConfigAuditReportData(t *testing.T) {
 ]`))
 
 	pluginContext := starboard.NewPluginContext().
-		WithName(string(starboard.Conftest)).
+		WithName(conftest.Plugin).
 		WithNamespace("starboard-ns").
 		WithServiceAccountName("starboard-sa").
 		WithClient(fake.NewClientBuilder().WithObjects(&corev1.ConfigMap{
diff --git a/pkg/plugin/polaris/plugin_test.go b/pkg/plugin/polaris/plugin_test.go
index c80449b..c4e6018 100644
--- a/pkg/plugin/polaris/plugin_test.go
+++ b/pkg/plugin/polaris/plugin_test.go
@@ -110,7 +110,7 @@ func TestPlugin_IsApplicable(t *testing.T) {
 		client := fake.NewClientBuilder().Build()
 
 		pluginContext := starboard.NewPluginContext().
-			WithName(string(starboard.Polaris)).
+			WithName(polaris.Plugin).
 			WithNamespace("starboard-ns").
 			WithServiceAccountName("starboard-sa").
 			WithClient(client).
@@ -131,7 +131,7 @@ func TestPlugin_Init(t *testing.T) {
 		client := fake.NewClientBuilder().Build()
 
 		pluginContext := starboard.NewPluginContext().
-			WithName(string(starboard.Polaris)).
+			WithName(polaris.Plugin).
 			WithNamespace("starboard-ns").
 			WithServiceAccountName("starboard-sa").
 			WithClient(client).
@@ -188,7 +188,7 @@ func TestPlugin_Init(t *testing.T) {
 		}).Build()
 
 		pluginContext := starboard.NewPluginContext().
-			WithName(string(starboard.Polaris)).
+			WithName(polaris.Plugin).
 			WithNamespace("starboard-ns").
 			WithServiceAccountName("starboard-sa").
 			WithClient(client).
@@ -263,7 +263,7 @@ func TestPlugin_GetScanJobSpec(t *testing.T) {
 						VolumeSource: corev1.VolumeSource{
 							ConfigMap: &corev1.ConfigMapVolumeSource{
 								LocalObjectReference: corev1.LocalObjectReference{
-									Name: starboard.GetPluginConfigMapName(string(starboard.Polaris)),
+									Name: starboard.GetPluginConfigMapName(polaris.Plugin),
 								},
 							},
 						},
@@ -316,7 +316,7 @@ func TestPlugin_GetScanJobSpec(t *testing.T) {
 			g := NewGomegaWithT(t)
 
 			pluginContext := starboard.NewPluginContext().
-				WithName(string(starboard.Polaris)).
+				WithName(polaris.Plugin).
 				WithNamespace("starboard-ns").
 				WithServiceAccountName("starboard-sa").
 				WithClient(fake.NewClientBuilder().WithObjects(&corev1.ConfigMap{
@@ -353,7 +353,7 @@ func TestPlugin_ParseConfigAuditReportData(t *testing.T) {
 	}()
 
 	pluginContext := starboard.NewPluginContext().
-		WithName(string(starboard.Polaris)).
+		WithName(polaris.Plugin).
 		WithNamespace("starboard-ns").
 		WithServiceAccountName("starboard-sa").
 		WithClient(fake.NewClientBuilder().WithObjects(&corev1.ConfigMap{
@@ -422,7 +422,7 @@ func TestPlugin_ConfigHash(t *testing.T) {
 
 	newPluginContextWithConfigData := func(data map[string]string) starboard.PluginContext {
 		return starboard.NewPluginContext().
-			WithName(string(starboard.Polaris)).
+			WithName(polaris.Plugin).
 			WithNamespace("starboard-ns").
 			WithClient(fake.NewClientBuilder().
 				WithObjects(&corev1.ConfigMap{
diff --git a/pkg/starboard/config_test.go b/pkg/starboard/config_test.go
index 29cd3d6..5d741dc 100644
--- a/pkg/starboard/config_test.go
+++ b/pkg/starboard/config_test.go
@@ -27,27 +27,20 @@ func TestConfigData_GetVulnerabilityReportsScanner(t *testing.T) {
 			configData: starboard.ConfigData{
 				"vulnerabilityReports.scanner": "Trivy",
 			},
-			expectedScanner: starboard.Trivy,
+			expectedScanner: "Trivy",
 		},
 		{
 			name: "Should return Aqua",
 			configData: starboard.ConfigData{
 				"vulnerabilityReports.scanner": "Aqua",
 			},
-			expectedScanner: starboard.Aqua,
+			expectedScanner: "Aqua",
 		},
 		{
 			name:          "Should return error when value is not set",
 			configData:    starboard.ConfigData{},
 			expectedError: "property vulnerabilityReports.scanner not set",
 		},
-		{
-			name: "Should return error when value is not allowed",
-			configData: starboard.ConfigData{
-				"vulnerabilityReports.scanner": "Clair",
-			},
-			expectedError: "invalid value (Clair) of vulnerabilityReports.scanner; allowed values (Trivy, Aqua)",
-		},
 	}
 	for _, tc := range testCases {
 		t.Run(tc.name, func(t *testing.T) {
@@ -74,27 +67,20 @@ func TestConfigData_GetConfigAuditReportsScanner(t *testing.T) {
 			configData: starboard.ConfigData{
 				"configAuditReports.scanner": "Polaris",
 			},
-			expectedScanner: starboard.Polaris,
+			expectedScanner: "Polaris",
 		},
 		{
 			name: "Should return Conftest",
 			configData: starboard.ConfigData{
 				"configAuditReports.scanner": "Conftest",
 			},
-			expectedScanner: starboard.Conftest,
+			expectedScanner: "Conftest",
 		},
 		{
 			name:          "Should return error when value is not set",
 			configData:    starboard.ConfigData{},
 			expectedError: "property configAuditReports.scanner not set",
 		},
-		{
-			name: "Should return error when value is not allowed",
-			configData: starboard.ConfigData{
-				"configAuditReports.scanner": "KubeScan",
-			},
-			expectedError: "invalid value (KubeScan) of configAuditReports.scanner; allowed values (Polaris, Conftest)",
-		},
 	}
 	for _, tc := range testCases {
 		t.Run(tc.name, func(t *testing.T) {
@@ -498,7 +484,7 @@ func TestConfigManager_EnsureDefault(t *testing.T) {
 				},
 				Data: map[string]string{
 					"foo":                        "bar",
-					"configAuditReports.scanner": string(starboard.Conftest),
+					"configAuditReports.scanner": "Conftest",
 				},
 			},
 			&corev1.Secret{
@@ -513,7 +499,7 @@ func TestConfigManager_EnsureDefault(t *testing.T) {
 			&corev1.ConfigMap{
 				ObjectMeta: metav1.ObjectMeta{
 					Namespace: namespace,
-					Name:      starboard.GetPluginConfigMapName(string(starboard.Conftest)),
+					Name:      starboard.GetPluginConfigMapName("Conftest"),
 				},
 				Data: map[string]string{
 					"conftest.policy.my-check.rego": "<REGO>",
@@ -540,14 +526,14 @@ func TestConfigManager_EnsureDefault(t *testing.T) {
 		}))
 
 		pluginConfig, err := clientset.CoreV1().ConfigMaps(namespace).
-			Get(context.TODO(), starboard.GetPluginConfigMapName(string(starboard.Conftest)), metav1.GetOptions{})
+			Get(context.TODO(), starboard.GetPluginConfigMapName("Conftest"), metav1.GetOptions{})
 		g.Expect(err).ToNot(gomega.HaveOccurred())
 		g.Expect(pluginConfig.Data).To(gomega.Equal(map[string]string{
 			"conftest.policy.my-check.rego": "<REGO>",
 		}))
 
 		_, err = clientset.CoreV1().ConfigMaps(namespace).
-			Get(context.TODO(), starboard.GetPluginConfigMapName(string(starboard.Polaris)), metav1.GetOptions{})
+			Get(context.TODO(), starboard.GetPluginConfigMapName("Polaris"), metav1.GetOptions{})
 		g.Expect(err).To(gomega.MatchError(`configmaps "starboard-polaris-config" not found`))
 	})