Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add unmarshalling to Percentage #924

Closed
wants to merge 1 commit into from
Closed

Add unmarshalling to Percentage #924

wants to merge 1 commit into from

Conversation

kuritka
Copy link
Collaborator

@kuritka kuritka commented Jul 20, 2022

if we do kubectl apply -f ... with GSLB having:

   # valid values in glsb roundrobin
    weight:
      eu: 50%
      us: 50

the JSON masrshaller doesn't know whether values are number (50) or string (50%, "50").
The value is type Percentage string. Unmrashal function makes conversion, so 50, 50%, "50","50%" are valid.

I made several changes:

  • change comment in CRD
  • Unmarshall
  • Fix one of the unit-tests
  • Regenerate Mocks

@kuritka kuritka changed the title Add weight to RoundRobin CR Add weight to RoundRobin GSLB Jul 20, 2022
@kuritka kuritka force-pushed the wrr-crd branch 4 times, most recently from 1862eff to f21d9d5 Compare July 20, 2022 14:02
if we do `kubectl apply -f ...` with GSLB having:
```yaml
   # valid values in glsb roundrobin
    weight:
      eu: 50%
      us: 50
```
the JSON masrshaller doesn't know whether values are number (50) or string (50%, "50").
The value is `type Percentage string`. Unmrashal function makes conversion, so 50, 50%, "50","50%" are valid.

I made several changes:
- change comment in CRD
- Unmarshall
- Fix one of the unit-tests
- Regenerate Mocks

Signed-off-by: kuritka <kuritka@gmail.com>
@kuritka kuritka changed the title Add weight to RoundRobin GSLB Add unmarshalling to Percentage Jul 21, 2022
Copy link
Member

@jkremser jkremser left a comment

Choose a reason for hiding this comment

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

lgtm, but you will have prolly conflict in that crd file, coz of my previous pr, sorry for that. Just remove the change in that file from the PR + rebase and you should be good.

@somaritane somaritane added this to the 1.0 milestone Jul 25, 2022
@kuritka
Copy link
Collaborator Author

kuritka commented Jul 26, 2022

/close #50 discussion

@kuritka kuritka closed this Jul 26, 2022
@kuritka kuritka deleted the wrr-crd branch September 9, 2022 14:02
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants