-
Notifications
You must be signed in to change notification settings - Fork 229
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
Bundle is not removed after removing GitRepo configured with multiple paths #2586
Comments
When testing rancher#2586 the `Bundle` reconciler found that the `Bundle` was gone as was trying to delete the same `BundleDeployments` in parallel. Deleting the `Bundle` after deleting all its `BundleDeployments` seems to help to prevent that race condition between both reconcilers Refers to: rancher#2586 Signed-off-by: Xavi Garcia <[email protected]>
When testing #2586 the `Bundle` reconciler found that the `Bundle` was gone as was trying to delete the same `BundleDeployments` in parallel. Deleting the `Bundle` after deleting all its `BundleDeployments` seems to help to prevent that race condition between both reconcilers Refers to: #2586 Signed-off-by: Xavi Garcia <[email protected]>
I managed to recreate this one, but it was not happening all the time. Adding here my resources just in case they're useful for QA. I tested with the following apiVersion: fleet.cattle.io/v1alpha1
kind: GitRepo
metadata:
name: sample
namespace: fleet-local
spec:
repo: "https://github.com/rancher/fleet-test-data"
branch: master
paths:
- multiple-paths and the following bash script: #!/bin/bash
i=1
while true
do
echo "---------------------------"
kubectl apply -f test-2586.yaml
OUT=""
while [ "$OUT" != "2" ];
do
OUT=`kubectl get gitrepo sample -n fleet-local -o jsonpath='{.status.summary.ready}'`
done
kubectl delete gitrepo sample -n fleet-local
kubectl wait --for=delete gitrepo/sample --timeout=60s -n fleet-local
kubectl get bundles -A
BUNDLES_LEFT=`kubectl get bundles -A | grep sample | wc -l`
if [ "$BUNDLES_LEFT" == " 0" ];
then
echo "ALL GOOD attempt number: ${i}"
echo "---------------------------"
i=$(($i+1))
else
echo "FAILED"
echo "---------------------------"
exit 1
fi
done It fails repeatedly with the version without the fix: ---------------------------
gitrepo.fleet.cattle.io/sample created
gitrepo.fleet.cattle.io "sample" deleted
NAMESPACE NAME BUNDLEDEPLOYMENTS-READY STATUS
fleet-local fleet-agent-local 1/1
ALL GOOD attempt number: 8
---------------------------
---------------------------
gitrepo.fleet.cattle.io/sample created
gitrepo.fleet.cattle.io "sample" deleted
NAMESPACE NAME BUNDLEDEPLOYMENTS-READY STATUS
fleet-local fleet-agent-local 1/1
fleet-local sample-multiple-paths-service 1/1
FAILED
--------------------------- ---------------------------
gitrepo.fleet.cattle.io/sample created
gitrepo.fleet.cattle.io "sample" deleted
NAMESPACE NAME BUNDLEDEPLOYMENTS-READY STATUS
fleet-local fleet-agent-local 1/1
ALL GOOD attempt number: 15
---------------------------
---------------------------
gitrepo.fleet.cattle.io/sample created
gitrepo.fleet.cattle.io "sample" deleted
NAMESPACE NAME BUNDLEDEPLOYMENTS-READY STATUS
fleet-local fleet-agent-local 1/1
fleet-local sample-multiple-paths-service 1/1
FAILED
--------------------------- and I was able to run the test 210 times and it did not fail just with the change in #2591 ---------------------------
gitrepo.fleet.cattle.io/sample created
gitrepo.fleet.cattle.io "sample" deleted
NAMESPACE NAME BUNDLEDEPLOYMENTS-READY STATUS
fleet-local fleet-agent-local 1/1
ALL GOOD attempt number: 210
--------------------------- |
As we are using finalizers for Bundles we can let the Bundle reconciler deal with its BundleDeployments and just delete the Bundle in the gitopts reconciler. That way we avoid having race conditions between both reconcilers trying to delete the same BundleDeployments Related to: rancher#2586 Signed-off-by: Xavi Garcia <[email protected]>
) As we are using finalizers for Bundles we can let the Bundle reconciler deal with its BundleDeployments and just delete the Bundle in the gitopts reconciler. That way we avoid having race conditions between both reconcilers trying to delete the same BundleDeployments Related to: #2586 Signed-off-by: Xavi Garcia <[email protected]>
Thank You @0xavi0 for the script. It helped me to create and delete |
Steps Performed:
|
Is there an existing issue for this?
Current Behavior
After deleting GitRepo pointing to multiple paths(Service and ConfigMap), configmap getting removed but service is not being removed instead it is re-created.
Also, observed that bundle not removed after deleting GitRepo, may causing this issue. Same service app is created under Apps which is being re-created again and again.
Expected Behavior
Once GitRepo removed no leftover should be present.
Steps To Reproduce
Environment
Logs
GitJob Logs
Anything else?
In my GitRepo, ConfigMaps gets removed but Service remains as it is and re-created when try to delete it. Also, there is created for the same Service which cannot be removed.
The text was updated successfully, but these errors were encountered: