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

Deletes Bundles after deleting all its BundleDeployments #2591

Merged
merged 1 commit into from
Jul 3, 2024

Conversation

0xavi0
Copy link
Contributor

@0xavi0 0xavi0 commented Jul 3, 2024

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

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]>
@0xavi0 0xavi0 added the kind/bug label Jul 3, 2024
@0xavi0 0xavi0 added this to the v2.9.0 milestone Jul 3, 2024
@0xavi0 0xavi0 self-assigned this Jul 3, 2024
@0xavi0 0xavi0 marked this pull request as ready for review July 3, 2024 16:19
@0xavi0 0xavi0 requested a review from a team as a code owner July 3, 2024 16:19
@0xavi0
Copy link
Contributor Author

0xavi0 commented Jul 3, 2024

Tested with the following GitRepo

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

@0xavi0 0xavi0 merged commit 6d7cb2a into rancher:main Jul 3, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants