Issue # 223 - Remove app finalizers during e2e fixture teardown#225
Merged
alexmt merged 1 commit intoargoproj:masterfrom May 22, 2018
Merged
Issue # 223 - Remove app finalizers during e2e fixture teardown#225alexmt merged 1 commit intoargoproj:masterfrom
alexmt merged 1 commit intoargoproj:masterfrom
Conversation
merenbach
approved these changes
May 22, 2018
Contributor
merenbach
left a comment
There was a problem hiding this comment.
Looks good to me. One tiny comment.
| } | ||
| } | ||
| if err == nil { | ||
| err = f.KubeClient.CoreV1().Namespaces().Delete(f.Namespace, &metav1.DeleteOptions{}) |
Contributor
There was a problem hiding this comment.
Wondering if this could be moved right after line 206, thus obviating the need for sequential inverse conditionals.
Collaborator
Author
There was a problem hiding this comment.
Logic would change if I move it.
TearDown method is checking if the previous operation successful and trying to delete namespace. Delete operation error is stored same err variable. Finally method checking if err is not nil which means something went wrong and report that teardown had issues. I hope I'm not missing something obvious.
Contributor
|
Ah, yes, my mistake! Good work!
…On Tue, May 22, 2018 at 9:16 AM, Alexander Matyushentsev < ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In test/e2e/fixture.go
<#225 (comment)>:
> + patch, err = json.Marshal(map[string]interface{}{
+ "metadata": map[string]interface{}{
+ "finalizers": make([]string, 0),
+ },
+ })
+ if err == nil {
+ _, err = f.AppClient.ArgoprojV1alpha1().Applications(app.Namespace).Patch(app.Name, types.MergePatchType, patch)
+ }
+ }
+ if err != nil {
+ break
+ }
+ }
+ }
+ if err == nil {
+ err = f.KubeClient.CoreV1().Namespaces().Delete(f.Namespace, &metav1.DeleteOptions{})
Logic would change if I move it.
TearDown method is checking if the previous operation successful and
trying to delete namespace. Delete operation error is stored same err
variable. Finally method checking if err is not nil which means something
went wrong and report that teardown had issues. I hope I'm not missing
something obvious.
—
You are receiving this because your review was requested.
Reply to this email directly, view it on GitHub
<#225 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABFZ1GGFxgO99EqjDQAHolVA-e4HFIO9ks5t1DnRgaJpZM4UI7lg>
.
|
leoluz
pushed a commit
to leoluz/argo-cd
that referenced
this pull request
Sep 29, 2023
…nd on them (argoproj#225) * fix: sync should apply Namespaces and CRDs before resources that depend on them Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #223