[JUJU-3442] Wait for apps before integrate #189
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
In certain situations the
integrate
resource can be requested before the applications are available in the Juju side. This app includes an active wait that waits until the two apps are available. For the sake of configurability, thejuju_integration
resource has been updated with atimeout
field indicating the number of seconds to wait before requesting two applications to be integrated. If the applications are not available before the timeout, the integration will not be done.Fix #188
Type of change
Please mark if proceeds.
Environment
QA steps
Reproduce the deployment of a subordinate indicated in #188 This deployment may not fail in every use case. To emulate the benefit of using the timeout, we will force a situation were the timeout is reached, check that the integration is not done, and finally create the integration.
Now
terraform apply
should not finished, because 1 second is not probably enough for the integration to be requested. This can be checked withjuju status -m relation-test --relations
.Model Controller Cloud/Region Version SLA Timestamp relation-test test2942 localhost/localhost 2.9.42 unsupported 14:40:17+02:00 App Version Status Scale Charm Channel Rev Exposed Message telegraf unknown 0 telegraf latest/stable 66 no ubuntu 20.04 active 1 ubuntu latest/stable 21 no Unit Workload Agent Machine Public address Ports Message ubuntu/0* active idle 0 10.220.18.115 Machine State Address Inst id Series AZ Message 0 started 10.220.18.115 juju-a623bf-0 focal Running
Next, increase the timeout, apply again, and check that the relation is there