Skip to content
This repository has been archived by the owner on Jul 15, 2024. It is now read-only.

Race condition on cluster creation/deletion causes unexpected behaviour #198

Merged
merged 5 commits into from
Apr 27, 2021

Conversation

jgwest
Copy link
Member

@jgwest jgwest commented Apr 12, 2021

See details on parent issue.

The vast majority of this PR is test changes, the new files in pkg/utils are the only substantial changes to product code.

This PR:

  • Forks a few of the util/db/cluster.go functions from Argo CD, and replaces their use of the race-condition-prone ApplicationLister, with a simple kubeclient query.
  • Forks the test cases that test those functions, as well, to make sure nothing has regressed.
  • As I state in the PR, ideally we would upstream these changes to Argo CD in some form, but in the mean time (and until Argo CD has adopted the fix in all the versions we support), this fixes the issue here.

Fixes #176

@jgwest jgwest marked this pull request as ready for review April 16, 2021 13:22
@OmerKahani
Copy link
Contributor

What would be the steps once ArgoCD adopts the fix? Do we revert this PR?

@jgwest
Copy link
Member Author

jgwest commented Apr 26, 2021

@OmerKahani Good question, what we need from Argo CD is a version of this API (in the Argo CD code) that doesn't use the Secret lister (which can have delayed results that cause the race condition), but instead just query the cluster directly.

Once this is in place in Argo CD, we would pull in that new version of Argo CD as a dependency, and switch to using that API. At that point, we would:

  • Delete pkg/utils/cluster*.go (no longer needed)
  • Replace references to "github.com/argoproj-labs/applicationset/pkg/utils" with the new Argo CD package

@jgwest jgwest merged commit 2f2cebf into argoproj:master Apr 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Race condition on cluster creation/deletion causes unexpected behaviour
2 participants