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

chore(deps): update mergo #580

Merged
merged 1 commit into from
Feb 7, 2022
Merged

chore(deps): update mergo #580

merged 1 commit into from
Feb 7, 2022

Conversation

GGabriele
Copy link
Collaborator

This makes us able to set zero-value fields and not have them overwritten from non-zero value defaults.

Before:

$ cat kong.yaml
upstreams:
- name: upstream1
  algorithm: round-robin
  targets:
  - target: 198.51.100.11:80
    weight: 0  # default being 100

$ deck sync
<--omitted-->

$ http :8001/upstreams/upstream1/targets | jq ".data[0].weight"
100

After:

$ deck sync
<--omitted-->

$ http :8001/upstreams/upstream1/targets | jq ".data[0].weight"
0

@GGabriele GGabriele requested a review from rainest February 3, 2022 19:48
@GGabriele GGabriele requested a review from a team as a code owner February 3, 2022 19:48
@hbagdi
Copy link
Member

hbagdi commented Feb 7, 2022

Umm, based on the PR description, it seems that we won't be able to set target's weight to 0.
Is that intended?

From what I understand, we want to give the user the ability to specify a zero value.

@GGabriele
Copy link
Collaborator Author

Umm, based on the PR description, it seems that we won't be able to set target's weight to 0. Is that intended?

I included this snipped in the After section, which shows how we can now set zero-values:

$ deck sync
<--omitted-->

$ http :8001/upstreams/upstream1/targets | jq ".data[0].weight"
0

Sorry if that wasn't clear

@hbagdi
Copy link
Member

hbagdi commented Feb 7, 2022

Sorry, my bad.
Can we include an end to end test using our shiny new testing framework?

@GGabriele
Copy link
Collaborator Author

Can we include an end to end test using our shiny new testing framework?

Just added this in the other PR about integrations tests.

That one is currently failing, but it will pass once we merge this PR.

@hbagdi hbagdi merged commit 059b032 into main Feb 7, 2022
@hbagdi hbagdi deleted the update_mergo branch February 7, 2022 15:38
AntoineJac pushed a commit that referenced this pull request Jan 23, 2024
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.

2 participants