Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Conftest): Upgrade Conftest from v0.23.0 to v0.25.0 and use --no-fail flag #557

Merged
merged 1 commit into from
May 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion deploy/helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ polaris:

conftest:
# imageRef the image reference
imageRef: docker.io/openpolicyagent/conftest:v0.23.0
imageRef: docker.io/openpolicyagent/conftest:v0.25.0

rbac:
create: true
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 @@ -12,7 +12,7 @@ data:
trivy.mode: Standalone
trivy.serverURL: http://trivy-server.trivy-server:4954
polaris.imageRef: quay.io/fairwinds/polaris:3.2
conftest.imageRef: openpolicyagent/conftest:v0.23.0
conftest.imageRef: openpolicyagent/conftest:v0.25.0
kube-bench.imageRef: docker.io/aquasec/kube-bench:0.5.0
---
apiVersion: v1
Expand Down
2 changes: 1 addition & 1 deletion docs/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ The following tables list available configuration settings with their default va
| `kube-hunter.quick` | `"false"` | Whether to use kube-hunter's "quick" scanning mode (subnet 24). Set to `"true"` to enable. |
| `polaris.imageRef` | `quay.io/fairwinds/polaris:3.2` | Polaris image reference |
| `polaris.config.yaml` | [Check the default value here][default-polaris-config] | Polaris configuration file |
| `conftest.imageRef` | `docker.io/openpolicyagent/conftest:v0.23.0` | Conftest image reference |
| `conftest.imageRef` | `docker.io/openpolicyagent/conftest:v0.25.0` | Conftest image reference |

| SECRET KEY | DESCRIPTION |
| --------------------------- | ----------- |
Expand Down
2 changes: 1 addition & 1 deletion itest/matcher/matcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ var (
conftestScanner = v1alpha1.Scanner{
Name: "Conftest",
Vendor: "Open Policy Agent",
Version: "v0.23.0",
Version: "v0.25.0",
}
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ var _ = BeforeSuite(func() {
},
Data: map[string]string{
"configAuditReports.scanner": "Conftest",
"conftest.imageRef": "docker.io/openpolicyagent/conftest:v0.23.0",
"conftest.imageRef": "docker.io/openpolicyagent/conftest:v0.25.0",
},
}
err = kubeClient.Create(context.Background(), starboardCM)
Expand Down
2 changes: 1 addition & 1 deletion pkg/plugin/conftest/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ func (p *plugin) GetScanJobSpec(ctx starboard.PluginContext, obj client.Object)
// TODO Follow up with Conftest maintainers to allow returning 0 exit code in case of failures
Args: []string{
"-c",
"conftest test --output json --all-namespaces --policy /project/policy /project/workload.yaml || true",
"conftest test --no-fail --output json --all-namespaces --policy /project/policy /project/workload.yaml",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Finally, we ca fix the hack used for the POC

},
SecurityContext: &corev1.SecurityContext{
Privileged: pointer.BoolPtr(false),
Expand Down
2 changes: 1 addition & 1 deletion pkg/plugin/conftest/plugin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ func TestPlugin_GetScanJobSpec(t *testing.T) {
}),
"Args": Equal([]string{
"-c",
"conftest test --output json --all-namespaces --policy /project/policy /project/workload.yaml || true",
"conftest test --no-fail --output json --all-namespaces --policy /project/policy /project/workload.yaml",
}),
"SecurityContext": Equal(&corev1.SecurityContext{
Privileged: pointer.BoolPtr(false),
Expand Down
2 changes: 1 addition & 1 deletion pkg/starboard/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ func GetDefaultConfig() ConfigData {

"polaris.imageRef": "quay.io/fairwinds/polaris:3.2",

"conftest.imageRef": "openpolicyagent/conftest:v0.23.0",
"conftest.imageRef": "openpolicyagent/conftest:v0.25.0",
}
}

Expand Down