-
Notifications
You must be signed in to change notification settings - Fork 7
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
Weaver: add option to automatically unregister old providers #423
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good feature. Just a minor thing to check.
) | ||
working_providers=$(echo "$working_providers_resp" | sed -e 's/.*"providers":\[//' -e 's/\].*//' -e 's/[",]/ /g') | ||
for prov in $(echo "$all_providers_resp" | sed -e 's/.*"providers":\[//' -e 's/\].*//' -e 's/[",]/ /g'); do | ||
if echo "${WEAVER_WPS_PROVIDERS}" | grep -wqv "$prov" && echo "${working_providers}" | grep -wqv "$prov"; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might have an issue with -
that is not considered in the "word" characters.
Example: finch
replaced by some kind of finch-new finch-old
definition. If finch
is disabled, and therefore not in the list of enabled & working providers, echo "finch-1 finch-2" | grep -wv "finch"
(error/if not triggered) believes that finch
is still there and won't remove the provider.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice feature ! I'd say this also cover the case where we "rename" a WPS service. This will remove the old name.
sed -e 's/.*"providers":\[//' -e 's/\].*//' -e 's/[",]/ /g') | ||
for prov in $(echo "$all_providers_resp" | sed -e 's/.*"providers":\[//' -e 's/\].*//' -e 's/[",]/ /g'); do | ||
# Note: both WEAVER_WPS_PROVIDERS and working_providers are whitespace delimited with no newlines | ||
if echo " ${WEAVER_WPS_PROVIDERS} " | grep -qv "[[:space:]]${prov}[[:space:]]" && \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be run each time autodeploy runs, which runs inside its own container. Please test this with autodeploy.
The reason curl
was a docker run
is because there are no curl
in the autodeploy container.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can confirm this check works in the autodeploy container: grep
, sed
, etc. all work in that environment.
Overview
Introduces the
WEAVER_UNREGISTER_DROPPED_PROVIDERS
variable. If set to "True", Weaver providers that are no longer working (not responding when deployed) and are not named inWEAVER_WPS_PROVIDERS
will be unregistered. This is useful when deploying Weaver with fewer providers than a previous deployment.For example, if the stack is deployed with the Weaver, Finch, and Raven components. Then later deployed with just Weaver and Raven, the Finch provider will be unregistered from weaver.
Previously, the Finch provider would have remained as a Weaver provider despite the fact that it has been removed from the stack.
Changes
Non-breaking changes
Breaking changes
None
Related Issue / Discussion
Additional Information
Links to other issues or sources.
birdhouse_daccs_configs_branch: master
birdhouse_skip_ci: false