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

sendStartEvaluationEvent evaluates 0 as a negative number, incorrectly #120

Open
popecruzdt opened this issue Oct 5, 2022 · 0 comments
Open

Comments

@popecruzdt
Copy link

sendStartEvaluationEvent evaluates 0 as a negative number

Environment

  • keptn-jenkins-library version: 6.1.0
  • Keptn Version (keptn version): 16.X (although it shouldn't be relevant)
  • Kubernetes Cloud Provider (e.g., GKE, AKS): N/A
  • Kubernetes version (kubectl version): N/A
  • Client OS (e.g., Linux, macOS, Windows): N/A
  • Client Browser: N/A

Affected Component
keptn-jenkins-library only

To Reproduce
Within Jenkins pipeline, call sendStartEvaluationEvent and pass argument(s) startime or endtime with a value of 0.

def keptnContext = keptn.sendStartEvaluationEvent starttime:"600", endtime:"0"

Results in a failure and the output of:

echo "No negative numbers allowed for endtime!"

The issue is with these code blocks:

591: if (seconds > 0) {
601: if (seconds > 0) {

The operator should be seconds >= 0 so that it includes 0, as 0 is neither positive nor negative, and a valid parameter for this function.

Expected behavior
Treat 0 as a valid parameter for this function.

Current behavior
Does not treat 0 as a valid parameter for this function.

Screenshots
N/A

Additional context
N/A

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

1 participant