Skip to content

Commit

Permalink
chore(polaris): upgrade polaris from v3.2 to v4.0 (#654)
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Pacak <pacak.daniel@gmail.com>
  • Loading branch information
danielpacak authored Aug 2, 2021
1 parent 47c73dd commit d8a5e4e
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 13 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ jobs:
files: ./coverage.txt
itest-starboard:
name: Run integration tests / Starboard CLI
needs:
- unit-tests
runs-on: ubuntu-18.04
steps:
- name: Setup Go
Expand Down Expand Up @@ -90,6 +92,8 @@ jobs:
files: ./itest/starboard/coverage.txt
itest-starboard-operator:
name: Run integration tests / Starboard Operator
needs:
- unit-tests
runs-on: ubuntu-18.04
steps:
- name: Setup Go
Expand Down Expand Up @@ -128,6 +132,8 @@ jobs:
files: ./itest/starboard-operator/coverage.txt
integration-operator-conftest:
name: Integration / Operator / Conftest
needs:
- unit-tests
runs-on: ubuntu-18.04
steps:
- name: Setup Go
Expand Down
2 changes: 1 addition & 1 deletion deploy/helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ kubeBench:
imageRef: docker.io/aquasec/kube-bench:0.6.3

polaris:
imageRef: quay.io/fairwinds/polaris:3.2
imageRef: quay.io/fairwinds/polaris:4.0
# resources resource requests and limits
resources:
requests:
Expand Down
2 changes: 1 addition & 1 deletion deploy/static/05-starboard-operator.config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ metadata:
labels:
"app.kubernetes.io/managed-by": "starboard"
data:
polaris.imageRef: quay.io/fairwinds/polaris:3.2
polaris.imageRef: quay.io/fairwinds/polaris:4.0
polaris.resources.requests.cpu: "50m"
polaris.resources.requests.memory: "50M"
polaris.resources.limits.cpu: "300m"
Expand Down
2 changes: 1 addition & 1 deletion docs/integrations/config-checkers/polaris.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The [default][config-default] Polaris [configuration] can be customized to do th

| CONFIGMAP KEY | DEFAULT | DESCRIPTION |
| ------------------------------------ | ------------------------------------------------------ | ----------- |
| `polaris.imageRef` | `quay.io/fairwinds/polaris:3.2` | Polaris image reference |
| `polaris.imageRef` | `quay.io/fairwinds/polaris:4.0` | Polaris image reference |
| `polaris.config.yaml` | [Check the default value here][default-polaris-config] | Polaris configuration file |
| `polaris.resources.request.cpu` | `50m` | The minimum amount of CPU required to run Polaris scanner pod. |
| `polaris.resources.request.memory` | `50M` | The minimum amount of memory required to run Polaris scanner pod. |
Expand Down
2 changes: 1 addition & 1 deletion itest/matcher/matcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ var (
polarisScanner = v1alpha1.Scanner{
Name: "Polaris",
Vendor: "Fairwinds Ops",
Version: "3.2",
Version: "4.0",
}
conftestScanner = v1alpha1.Scanner{
Name: "Conftest",
Expand Down
2 changes: 1 addition & 1 deletion itest/matcher/matcher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ func TestConfigAuditReportMatcher(t *testing.T) {
Scanner: v1alpha1.Scanner{
Name: "Polaris",
Vendor: "Fairwinds Ops",
Version: "3.2",
Version: "4.0",
},
},
})
Expand Down
2 changes: 1 addition & 1 deletion pkg/plugin/polaris/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ func NewPlugin(clock ext.Clock) configauditreport.Plugin {
func (p *plugin) Init(ctx starboard.PluginContext) error {
return ctx.EnsureConfig(starboard.PluginConfig{
Data: map[string]string{
keyImageRef: "quay.io/fairwinds/polaris:3.2",
keyImageRef: "quay.io/fairwinds/polaris:4.0",
keyConfigYaml: DefaultConfigYAML,
keyResourcesRequestsCPU: "50m",
keyResourcesRequestsMemory: "50M",
Expand Down
14 changes: 7 additions & 7 deletions pkg/plugin/polaris/plugin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ func TestPlugin_Init(t *testing.T) {
ResourceVersion: "1",
},
Data: map[string]string{
"polaris.imageRef": "quay.io/fairwinds/polaris:3.2",
"polaris.imageRef": "quay.io/fairwinds/polaris:4.0",
"polaris.config.yaml": polaris.DefaultConfigYAML,
"polaris.resources.requests.cpu": "50m",
"polaris.resources.requests.memory": "50M",
Expand All @@ -158,7 +158,7 @@ func TestPlugin_Init(t *testing.T) {
ResourceVersion: "0",
},
Data: map[string]string{
"polaris.imageRef": "quay.io/fairwinds/polaris:3.2",
"polaris.imageRef": "quay.io/fairwinds/polaris:4.0",
"polaris.config.yaml": `checks:
cpuRequestsMissing: warning`,
},
Expand Down Expand Up @@ -192,7 +192,7 @@ func TestPlugin_Init(t *testing.T) {
ResourceVersion: "0",
},
Data: map[string]string{
"polaris.imageRef": "quay.io/fairwinds/polaris:3.2",
"polaris.imageRef": "quay.io/fairwinds/polaris:4.0",
"polaris.config.yaml": `checks:
cpuRequestsMissing: warning`,
},
Expand All @@ -213,7 +213,7 @@ func TestPlugin_GetScanJobSpec(t *testing.T) {
{
name: "Should return job spec for Deployment",
config: map[string]string{
"polaris.imageRef": "quay.io/fairwinds/polaris:3.2",
"polaris.imageRef": "quay.io/fairwinds/polaris:4.0",
"polaris.resources.requests.cpu": "50m",
"polaris.resources.requests.memory": "50M",
"polaris.resources.limits.cpu": "300m",
Expand Down Expand Up @@ -249,7 +249,7 @@ func TestPlugin_GetScanJobSpec(t *testing.T) {
Containers: []corev1.Container{
{
Name: "polaris",
Image: "quay.io/fairwinds/polaris:3.2",
Image: "quay.io/fairwinds/polaris:4.0",
ImagePullPolicy: corev1.PullIfNotPresent,
TerminationMessagePolicy: corev1.TerminationMessageFallbackToLogsOnError,
Resources: corev1.ResourceRequirements{
Expand Down Expand Up @@ -339,7 +339,7 @@ func TestPlugin_ParseConfigAuditReportData(t *testing.T) {
Namespace: "starboard-ns",
},
Data: map[string]string{
"polaris.imageRef": "quay.io/fairwinds/polaris:3.2",
"polaris.imageRef": "quay.io/fairwinds/polaris:4.0",
},
}).Build()).
Get()
Expand All @@ -351,7 +351,7 @@ func TestPlugin_ParseConfigAuditReportData(t *testing.T) {
g.Expect(result.Scanner).To(Equal(v1alpha1.Scanner{
Name: "Polaris",
Vendor: "Fairwinds Ops",
Version: "3.2",
Version: "4.0",
}))
g.Expect(result.Summary).To(Equal(v1alpha1.ConfigAuditSummary{
PassCount: 2,
Expand Down

0 comments on commit d8a5e4e

Please sign in to comment.