Skip to content

Conversation

crew-helper
Copy link
Contributor

This fixes cluster deletion: uses the spec.Name instead of the resource Name.

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

}

_, err = client.Clusters.Delete(context.Background(), project.Status.ID, cluster.Name)
_, err = atlasClient.Clusters.Delete(context.Background(), project.Status.ID, cluster.Spec.Name)
Copy link
Contributor

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)
Copy link
Contributor Author

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

}
// 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())
Copy link
Contributor Author

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

@crew-helper crew-helper merged commit 255cce7 into main Jan 27, 2021
@crew-helper crew-helper deleted the CLOUDP-81188_fix-remove-cluster branch January 27, 2021 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants