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(kuma-cp): intOrString as decimal in the API #5768

Merged

Conversation

jakubdyszkiewicz
Copy link
Contributor

@jakubdyszkiewicz jakubdyszkiewicz commented Jan 19, 2023

Use IntOrString in API for decimal.

Checklist prior to review

  • Link to docs PR or issue --
  • Link to UI issue or PR --
  • Is the issue worked on linked? --
  • The PR does not hardcode values that might break projects that depend on kuma (e.g. "kumahq" as a image registry) --
  • The PR will work for both Linux and Windows, system specific functions like syscall.Mkfifo have equivalent implementation on the other OS --
  • Unit Tests --
  • E2E Tests --
  • Manual Universal Tests --
  • Manual Kubernetes Tests --
  • Do you need to update UPGRADE.md? --
  • Does it need to be backported according to the backporting policy? --
  • Do you need to explicitly set a > Changelog: entry here or add a ci/ label to run fewer/more tests?

feat(policy): intOrString as decimal in the API

Signed-off-by: Jakub Dyszkiewicz <jakub.dyszkiewicz@gmail.com>
@jakubdyszkiewicz jakubdyszkiewicz force-pushed the chore/percentage-intorstr branch from 173f5ce to f286b0e Compare January 19, 2023 11:24
@jakubdyszkiewicz jakubdyszkiewicz marked this pull request as ready for review January 19, 2023 14:08
@jakubdyszkiewicz jakubdyszkiewicz requested review from a team, slonka and Automaat and removed request for a team January 19, 2023 14:08
@@ -159,8 +159,13 @@ func configureSuccessRate(
}

if conf.StandardDeviationFactor != nil {
outlierDetection.SuccessRateStdevFactor = util_proto.UInt32(*conf.StandardDeviationFactor)
dec, err := v1alpha1.NewDecimalFromIntOrString(*conf.StandardDeviationFactor)
Copy link
Contributor

Choose a reason for hiding this comment

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

Ideally we'd have a type in between here to avoid dealing with these impossible errors. Maybe we could even panic here? It has been validated after all...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't know how could we introduce type in between because of #5768 (comment)

It's a good question whether we should panic or not after we validate in the first place.
In this PR I'd like to keep the err, but I'd love to resume a discussion in form of the issue, MADR or offline discussion within the team.

@jakubdyszkiewicz jakubdyszkiewicz merged commit 00aefce into kumahq:master Jan 20, 2023
@jakubdyszkiewicz jakubdyszkiewicz deleted the chore/percentage-intorstr branch January 20, 2023 12:11
@lahabana
Copy link
Contributor

This fixes #5716 and #5717 right?

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.

3 participants