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

Removing integration having offer as endpoint results in removal of integrations of all consumers of the offer. #308

Closed
hemanthnakkina opened this issue Sep 12, 2023 · 3 comments · Fixed by #309
Labels
hint/main going on main branch kind/bug indicates a bug in the project
Milestone

Comments

@hemanthnakkina
Copy link
Contributor

hemanthnakkina commented Sep 12, 2023

Description

I have 2 models. One model provides an offer and more than one application from second model consumes the same offer.

If one of the application in second model removes the integration with the offer, the integration is removed from all the applications consumed by the offer.

Urgency

Blocker for our release

Terraform Juju Provider version

0.8.0

Terraform version

v1.5.7

Terraform Configuration(s)

Plans: https://pastebin.ubuntu.com/p/bqHp7z38vh/

Reproduce / Test

Environment: Juju 3.1/stable + microk8s 1.26-strict/stable

1. On plan1,
terraform init && terraform apply -auto-approve

Look for juju status -m ingress and wait for traefik application is in active state.

2. On plan2,
terraform init && terraform apply -auto-approve

Look for juju status -m sunbeam and wait for all applications are in active state.

3. Remove integration on one of application
# Disable integration with traefik offer on keystone1
echo '{"enable-multiple-traefik-consumers": false}' >> plan2/terraform.tfvars.json
terraform apply -auto-approve.

Look for juju status -m sunbeam. Both keystone, keystone1 applications are in blocked or error state.

Results after running above steps: https://pastebin.ubuntu.com/p/Q3PFmY59nV/

Expected only keystone1 application to be in blocked state and should not trigger anything on keystone application.

Debug/Panic Output

No response

Notes & References

No response

@hemanthnakkina hemanthnakkina added the kind/bug indicates a bug in the project label Sep 12, 2023
hemanthnakkina added a commit to hemanthnakkina/terraform-provider-juju that referenced this issue Sep 12, 2023
For an offer with multiple consumers, if the integration
for one consumer is removed, the offer is removed on
consumer/remote side. This leads to removal of integrations
for rest of the consumers.
Use DestroyIntegration even for relations with offers as
endpoint instead of deletion of remoteoffer.

Fixes: juju#308
@hmlanigan
Copy link
Member

@hemanthnakkina please retry with 0.9.0

@hemanthnakkina
Copy link
Contributor Author

@hmlanigan I have tested this with the juju-terraform-provider built from main as well and saw the issue. I am positive the issue exists with v0.9.0 as the source code is same around this functionality.

@hmlanigan hmlanigan added the hint/main going on main branch label Sep 14, 2023
@hmlanigan hmlanigan added this to the 0.9.1 milestone Sep 14, 2023
hemanthnakkina added a commit to hemanthnakkina/terraform-provider-juju that referenced this issue Sep 18, 2023
Currently removing an integration with an offer removes
the remote offer. This does not take into consideration
of any other consumers integrated with the offer.
This leads to other consumers getting relation-broken
which is not expected.

Check for number of consumers during delete integration
for an offer. Remove RemoteOffer only when the current
integration is the only consumer to the offer. Otherwise
use DestroyIntegration that removes only the integration
between the calling comsumer and the offer without affecting
the relation between other consumers and offer.

Fixes: juju#308
hemanthnakkina added a commit to hemanthnakkina/terraform-provider-juju that referenced this issue Sep 18, 2023
Currently removing an integration with an offer removes
the remote offer. This does not take into consideration
of any other consumers integrated with the offer.
This leads to other consumers getting relation-broken
which is not expected.

Check for number of consumers during delete integration
for an offer. Remove RemoteOffer only when the current
integration is the only consumer to the offer. Otherwise
use DestroyIntegration that removes only the integration
between the calling comsumer and the offer without affecting
the relation between other consumers and offer.

Fixes: juju#308
hemanthnakkina added a commit to hemanthnakkina/terraform-provider-juju that referenced this issue Sep 18, 2023
Currently removing an integration with an offer removes
the remote offer. This does not take into consideration
of any other consumers integrated with the offer.
This leads to other consumers getting relation-broken
which is not expected.

Check for number of consumers during delete integration
for an offer. Remove RemoteOffer only when the current
integration is the only consumer to the offer. Otherwise
use DestroyIntegration that removes only the integration
between the calling comsumer and the offer without affecting
the relation between other consumers and offer.

Fixes: juju#308
hemanthnakkina added a commit to hemanthnakkina/terraform-provider-juju that referenced this issue Sep 20, 2023
Currently removing an integration with an offer removes
the remote offer. This does not take into consideration
of any other consumers integrated with the offer.
This leads to other consumers getting relation-broken
which is not expected.

Remove the integration using DestroyIntegration irrespective
of whether the endpoint is an offer or not.

Fixes: juju#308
hemanthnakkina added a commit to hemanthnakkina/terraform-provider-juju that referenced this issue Sep 20, 2023
Currently removing an integration with an offer removes
the remote offer. This does not take into consideration
of any other consumers integrated with the offer.
This leads to other consumers getting relation-broken
which is not expected.

Remove the integration using DestroyIntegration irrespective
of whether the endpoint is an offer or not.

Fixes: juju#308
hemanthnakkina added a commit to hemanthnakkina/terraform-provider-juju that referenced this issue Sep 20, 2023
Currently removing an integration with an offer removes
the remote offer. This does not take into consideration
of any other consumers integrated with the offer.
This leads to other consumers getting relation-broken
which is not expected.

Remove the integration using DestroyIntegration irrespective
of whether the endpoint is an offer or not.

Fixes: juju#308
hemanthnakkina added a commit to hemanthnakkina/terraform-provider-juju that referenced this issue Sep 21, 2023
Currently removing an integration with an offer removes
the remote offer. This does not take into consideration
of any other consumers integrated with the offer.
This leads to other consumers getting relation-broken
which is not expected.

Remove the integration using DestroyIntegration irrespective
of whether the endpoint is an offer or not.

Fixes: juju#308
hemanthnakkina added a commit to hemanthnakkina/terraform-provider-juju that referenced this issue Sep 21, 2023
Currently removing an integration with an offer removes
the remote offer. This does not take into consideration
of any other consumers integrated with the offer.
This leads to other consumers getting relation-broken
which is not expected.

Remove the integration using DestroyIntegration irrespective
of whether the endpoint is an offer or not.

The acceptance tests that involves postgres deployment takes
around 5 minutes and the new test added also requires
deploying postgres which increases the total time required
for integration tests to run. So increase integration tests
timeout to 40m from 30m.

Fixes: juju#308
@hmlanigan hmlanigan modified the milestones: 0.9.1, 0.10.0 Sep 22, 2023
@hmlanigan
Copy link
Member

This bug is not a regression in 0.9.0, will be fixed in 0.10.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hint/main going on main branch kind/bug indicates a bug in the project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants