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

Exit codes not working since 5.12 #507

Closed
2 tasks done
tmsdce opened this issue Sep 4, 2023 · 3 comments · Fixed by #508
Closed
2 tasks done

Exit codes not working since 5.12 #507

tmsdce opened this issue Sep 4, 2023 · 3 comments · Fixed by #508
Assignees
Labels
bug Something isn't working

Comments

@tmsdce
Copy link

tmsdce commented Sep 4, 2023

What happened?

Starting with version 5.12, exit codes don't behave as they used to. Detection still works but exit code seems to be always 0 which is problematic especially in CI context.

What did you expect to happen?

Exit codes should work as before as stated in the documentation here

How can we reproduce this?

  • Create a simple test.yaml file with the following content
apiVersion: policy/v1beta1
kind: PodDisruptionBudget
metadata:
  name: test
  namespace: test
spec:
  minAvailable: 1
  selector:
    matchLabels:
      app: test
  • Use pluto 5.12 or higher (5.18 is also affected) to check for APIs deprecation/removal
$ pluto detect test.yaml --target-versions k8s=v1.26.0

NAME   KIND                  VERSION          REPLACEMENT   REMOVED   DEPRECATED  
test   PodDisruptionBudget   policy/v1beta1   policy/v1     true      true        



Want more? Automate Pluto for free with Fairwinds Insights!
 🚀 https://fairwinds.com/insights-signup/pluto 🚀 

$ echo $?
0
  • If you use pluto 5.11.2 or less, everything works fine
$ pluto detect test.yaml --target-versions k8s=v1.26.0

NAME   KIND                  VERSION          REPLACEMENT   REMOVED   DEPRECATED  
test   PodDisruptionBudget   policy/v1beta1   policy/v1     true      true

$ echo $?
3

I also tried to disable the footer with --no-footer with no success. I believe that this behavior comes from 04a8af3 if I compare commits between 5.11.2 and 5.12

Version

5.12

Search

  • I did search for other open and closed issues before opening this.

Code of Conduct

  • I agree to follow this project's Code of Conduct

Additional context

No response

@tmsdce tmsdce added bug Something isn't working triage This bug needs triage labels Sep 4, 2023
@sudermanjr
Copy link
Member

Yikes, great catch. Looks like this PR (https://github.com/FairwindsOps/pluto/pull/427/files) is the likely culprit, having touched the exit code logic. I think we're still calculating it, just not actually exiting.

Also, the e2e tests should have caught this.... 🤔

@sudermanjr sudermanjr removed the triage This bug needs triage label Sep 5, 2023
@sudermanjr sudermanjr self-assigned this Sep 5, 2023
@sudermanjr
Copy link
Member

Looking closer, it may only be the raw detect command that is doing this, not the others, which may explain the tests not catching it. I'll look at adding additional tests too

@sudermanjr sudermanjr mentioned this issue Sep 5, 2023
2 tasks
@tmsdce
Copy link
Author

tmsdce commented Sep 6, 2023

Thanks for your prompt reply @sudermanjr 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants