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

Fix Transparent Proxy Block in Read #20179

Closed
wants to merge 24 commits into from
Closed

Conversation

absolutelightning
Copy link
Contributor

@absolutelightning absolutelightning commented Jan 12, 2024

Description

When we create a service default using the following data

Kind = "service-defaults"
Name = "sd"
Protocol = "tcp"
Destination {
  Addresses = ["test.com","test.org"]
  Port = 443
}

Currently when we read the config entry back - we get

{
    "Kind": "service-defaults",
    "Name": "sd",
    "Protocol": "tcp",
    "TransparentProxy": {},
    "MeshGateway": {},
    "Expose": {},
    "Destination": {
        "Addresses": [
            "test.com",
            "test.org"
        ],
        "Port": 443
    },
    "CreateIndex": 18,
    "ModifyIndex": 18
}

Notice the transparent proxy block introduced with blank values.

With this change in PR - we get

{
    "Kind": "service-defaults",
    "Name": "sd",
    "Protocol": "tcp",
    "MeshGateway": {},
    "Expose": {},
    "Destination": {
        "Addresses": [
            "test.com",
            "test.org"
        ],
        "Port": 443
    },
    "CreateIndex": 18,
    "ModifyIndex": 18
}

The response is decoded in consul terraform provider and we get default values of int OutboundListenerPort -> 0 and bool DialedDirectly -> false, there. which is causing issue. We are using json decode in consul terraform provider.

Testing & Reproduction steps

CI

PR Checklist

  • updated test coverage
  • external facing docs updated
  • appropriate backport labels added
  • not a security concern

@absolutelightning absolutelightning requested a review from a team as a code owner January 12, 2024 11:17
@absolutelightning absolutelightning added the consul-india PRs/Issues assigned to Consul India team label Jan 12, 2024
@absolutelightning absolutelightning self-assigned this Jan 12, 2024
@absolutelightning absolutelightning added pr/no-changelog PR does not need a corresponding .changelog entry pr/no-backport labels Jan 12, 2024
@absolutelightning absolutelightning marked this pull request as draft January 12, 2024 13:30
@absolutelightning absolutelightning marked this pull request as ready for review January 12, 2024 14:45
@Ganeshrockz
Copy link
Contributor

Ganeshrockz commented Jan 15, 2024

Any specific reason you can't handle this in the provider's logic? I see other fields returning non pointer fields and I guess this was done like to make sure to not perform nil checks in downstream dependencies.

@absolutelightning
Copy link
Contributor Author

The response is decoded in consul terraform provider and we get default values of int OutboundListenerPort -> 0 and bool DialedDirectly -> false, there. which is causing issue. We are using json decode in consul terraform provider.

The response is decoded in consul terraform provider and we get default values of int OutboundListenerPort -> 0 and bool DialedDirectly -> false, there. which is causing issue. We are using json decode in consul terraform provider.

Copy link

This pull request has been automatically flagged for inactivity because it has not been acted upon in the last 60 days. It will be closed if no new activity occurs in the next 30 days. Please feel free to re-open to resurrect the change if you feel this has happened by mistake. Thank you for your contributions.

@github-actions github-actions bot added the meta/stale Automatically flagged for inactivity by stalebot label Mar 16, 2024
Copy link

Closing due to inactivity. If you feel this was a mistake or you wish to re-open at any time in the future, please leave a comment and it will be re-surfaced for the maintainers to review.

@github-actions github-actions bot closed this May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
consul-india PRs/Issues assigned to Consul India team meta/stale Automatically flagged for inactivity by stalebot pr/no-backport pr/no-changelog PR does not need a corresponding .changelog entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants