-
Notifications
You must be signed in to change notification settings - Fork 102
CLOUDP-81188: fix deletion of Atlas Cluster #65
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
Conversation
} | ||
|
||
_, err = client.Clusters.Delete(context.Background(), project.Status.ID, cluster.Name) | ||
_, err = atlasClient.Clusters.Delete(context.Background(), project.Status.ID, cluster.Spec.Name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤦♂️
Co-authored-by: Pavel Vasilev <explosere@gmail.com>
ctx := customresource.MarkReconciliationStarted(r.Client, cluster, log) | ||
|
||
log.Infow("-> Starting AtlasCluster reconciliation", "spec", cluster.Spec) | ||
log.Infow("-> Starting AtlasCluster reconciliation", "spec", cluster.Spec, "generation", cluster.Generation, "status", cluster.Status) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vasilevp this one was added for debugging issue - I expect there are sometimes caching problems and that's why our tests are flaky
pkg/util/testutil/customresources.go
Outdated
} | ||
// Atlas Operator hasn't started working yet | ||
if createdResource.GetGeneration() != createdResource.GetStatus().GetObservedGeneration() { | ||
fmt.Printf("Generation: %+v, observed Generation: %+v\n", createdResource.GetGeneration(), createdResource.GetStatus().GetObservedGeneration()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is also for debugging of flaky tests
This fixes cluster deletion: uses the
spec.Name
instead of the resourceName
.Also moves the testing logic for cluster deletion to
afterRun
to avoid double calls to cluster removal. Then waits until the cluster is removed and removes the project