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

audit check specific checks when passing checks args #737

Merged
merged 3 commits into from
Apr 7, 2022

Conversation

krrrr38
Copy link
Contributor

@krrrr38 krrrr38 commented Mar 31, 2022

Signed-off-by: krrrr38 k.kaizu38@gmail.com

Checklist

  • I have signed the CLA
  • I have updated/added any relevant documentation

Description

What's the goal of this PR?

audit command should check only specific checks

What changes did you make?

In #712, added new checks args into audit command, but not used.

I change it as string slice variable and change check severity as Ignored when passing checks args.

What alternative solution should we consider, if any?

N/A

QA

before: not filtered checks
> go run main.go audit -f pretty --audit-path /path/to/templatesNodeSelectorNodeTypeWorkflowTemplate/success.yaml --config /path/to/.polaris.yaml --set-exit-code-on-danger --log-level error --checks templatesNodeSelectorNodeTypeWorkflowTemplate,b --checks a

Polaris audited Path /path/to/templatesNodeSelectorNodeTypeWorkflowTemplate/success.yaml at 2022-03-31T09:11:39+09:00
    Nodes: 0 | Namespaces: 0 | Controllers: 0
    Final score: 50

WorkflowTemplate single-template-success
    templatesNodeSelectorNodeTypeWorkflowTemplate 🎉 Success
        Reliability - Workflow must on on nodeSelector.node-type:batch
    workflowMetadataLabelsWorkflowTemplate ❌ Danger
        Reliability - Should have all required labels [owner, workflow-name, tenant-id, client-id]

WorkflowTemplate multiple-template-success
    templatesNodeSelectorNodeTypeWorkflowTemplate 🎉 Success
        Reliability - Workflow must on on nodeSelector.node-type:batch
    workflowMetadataLabelsWorkflowTemplate ❌ Danger
        Reliability - Should have all required labels [owner, workflow-name, tenant-id, client-id]

exit status 3
after: filtered checks
> go run main.go audit -f pretty --audit-path /path/to/templatesNodeSelectorNodeTypeWorkflowTemplate/success.yaml --config /path/to/.polaris.yaml --set-exit-code-on-danger --log-level error --checks templatesNodeSelectorNodeTypeWorkflowTemplate,b --checks a


Polaris audited Path /path/to/templatesNodeSelectorNodeTypeWorkflowTemplate/success.yaml at 2022-03-31T09:10:24+09:00
    Nodes: 0 | Namespaces: 0 | Controllers: 0
    Final score: 100

WorkflowTemplate single-template-success
    templatesNodeSelectorNodeTypeWorkflowTemplate 🎉 Success
        Reliability - Workflow must on on nodeSelector.node-type:batch

WorkflowTemplate multiple-template-success
    templatesNodeSelectorNodeTypeWorkflowTemplate 🎉 Success
        Reliability - Workflow must on on nodeSelector.node-type:batch

Signed-off-by: krrrr38 <k.kaizu38@gmail.com>
@CLAassistant
Copy link

CLAassistant commented Mar 31, 2022

CLA assistant check
All committers have signed the CLA.

@rbren
Copy link
Contributor

rbren commented Mar 31, 2022

LGTM! @makoscafee can you take a look?

Copy link
Contributor

@makoscafee makoscafee left a comment

Choose a reason for hiding this comment

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

LGTM

@rbren rbren merged commit 1841b74 into FairwindsOps:master Apr 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants