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

Feature Request: ignore specific test but keep the error presented #371

Open
devopsmash opened this issue May 26, 2021 · 1 comment
Open

Comments

@devopsmash
Copy link

Hi!

I'm using the kube-score to check my k8s objects/resources and it will be awesome if you can present the error even if I ignored that test but still exit without error.

Example without ignore

helm template mychart . | kube-score score

# output
apps/v1/Deployment appclient                                                  💥
    [CRITICAL] Deployment targeted by HPA does not have replicas configured
        · The deployment is targeted by a HPA, but a static replica count is configured in the DeploymentSpec
            When replicas is both statically set and managed by the HPA, the
            replicas will be changed to the statically configured count when the
            spec is applied, even if the HPA wants the replica count to be
            higher.
autoscaling/v2beta2/HorizontalPodAutoscaler appclient                         ✅
networking.k8s.io/v1beta1/Ingress appclient                                   ✅
v1/Service appclient                                                          ✅


# exit 1

with ignore

helm template mychart . | kube-score score --ignore-test deployment-targeted-by-hpa-does-not-have-replicas-configured

# output:
apps/v1/Deployment appclient                                                  ✅
autoscaling/v2beta2/HorizontalPodAutoscaler appclient                         ✅
networking.k8s.io/v1beta1/Ingress appclient                                   ✅
v1/Service appclient                                                          ✅

# exit 0

suggestion --show-ignored-test-error :

helm template mychart . | kube-score score --show-ignored-test-error --ignore-test deployment-targeted-by-hpa-does-not-have-replicas-configured

# output:
apps/v1/Deployment appclient                                                  💥
    [CRITICAL] Deployment targeted by HPA does not have replicas configured
        · The deployment is targeted by a HPA, but a static replica count is configured in the DeploymentSpec
            When replicas is both statically set and managed by the HPA, the
            replicas will be changed to the statically configured count when the
            spec is applied, even if the HPA wants the replica count to be
            higher.
autoscaling/v2beta2/HorizontalPodAutoscaler appclient                         ✅
networking.k8s.io/v1beta1/Ingress appclient                                   ✅
v1/Service appclient                                                          ✅

# exit 0

Thank you for your great work!

@hans-d
Copy link

hans-d commented Jul 1, 2021

Yes, showing as warning instead of error would be great.

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

No branches or pull requests

2 participants