Skip to content
This repository has been archived by the owner on Aug 25, 2021. It is now read-only.

make sync-catalog work with clients disabled #570

Merged
merged 2 commits into from Aug 13, 2020

Conversation

fbegyn
Copy link
Contributor

@fbegyn fbegyn commented Aug 12, 2020

Currently sync-catalog won't work when clients are disabled (see #211 ). I'm opening this PR because we have a use case (running multiple consuls) where we disable clients and prefer working with the kubernetes service instead.

The sync-catalog won't work with the clients disabled due to the use of the HOST_IP variable. Since the option is given to disable the clients, I think the logic would go that if the clients are disabled, the sync-catalog talks to the kubernetes service for the consul server instead of interacting through the clients.

It has some duplicate code and I'm not sure if this is the best way, but it has been confirmed to work when deploying our application set.

Feel free to make any suggestions, I mainly want to see #211 resolved.

Currently the sync-catalog won't work when the clients are disable
because of the use of `HOST_IP` to connect to the service. I propose
that when clients are disable, the synccatalog falls back to the consul
server service.
@hashicorp-cla
Copy link

hashicorp-cla commented Aug 12, 2020

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@lkysow lkysow left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! Can you also write tests please? See https://github.com/hashicorp/consul-helm/blob/master/CONTRIBUTING.md#writing-unit-tests.

@lkysow lkysow added area/chart-only Related to changes that simply require yaml chart changes, e.g. exposing a new field area/sync Related to catalog sync enhancement New feature or request labels Aug 12, 2020
When `client.enabled=true` the syncCatalog should make use of the
HOST_IP to connect with consul. When `client.enabled=false`
the syncCatalog should fall back to the consul server service.
Copy link
Member

@lkysow lkysow left a comment

Choose a reason for hiding this comment

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

This is great, thanks so much!

@lkysow lkysow merged commit 0b382a2 into hashicorp:master Aug 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/chart-only Related to changes that simply require yaml chart changes, e.g. exposing a new field area/sync Related to catalog sync enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants