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

tests/framework: wait for deletion and dump namespace #4471

Merged
merged 2 commits into from
Jan 24, 2022

Conversation

shashankram
Copy link
Member

Description:
Waits for resources created by Helm to delete prior
to performing deletion of the entire namespace.
Without this, some dangling resources can be left
behind in the cluster such and the namespace could
be stuck in the terminating state.
Also dumps the namespaces that fail to terminate. This
is necessary to root cause namespace deletion issues.

Testing done:
Used this change to root cause a bug in uninstall that left
namespaces in a dangling state.

Affected area:

Functional Area
Tests [X]

Please answer the following questions with yes/no.

  1. Does this change contain code from or inspired by another project? no

    • Did you notify the maintainers and provide attribution?
  2. Is this a breaking change? no

Waits for resources created by Helm to delete prior
to performing deletion of the entire namespace.
Without this, some dangling resources can be left
behind in the cluster such and the namespace could
be stuck in the terminating state.
Also dumps the namespaces that fail to terminate. This
is necessary to root cause namespace deletion issues.

Signed-off-by: Shashank Ram <[email protected]>
tests/framework/common.go Outdated Show resolved Hide resolved
Comment on lines +1245 to +1249
// Dump the namespaces that failed to terminate
stdout, stderr, _ := td.RunLocal("kubectl", "get", "namespace", "-l", osmTest, "-o", "yaml")
td.T.Logf("Namespace info:")
td.T.Logf("stdout:\n%s", stdout)
td.T.Logf("stderr:\n%s", stderr)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For something this simple, could you use the k8s Go client instead to do this? There are only a couple places we invoke kubectl directly and I'd rather not add more if we can help it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather not, in the interest of simplifying how the object is dumped nicely by kubectl.

Signed-off-by: Shashank Ram <[email protected]>
@shashankram shashankram merged commit a0c9a86 into openservicemesh:main Jan 24, 2022
@shashankram shashankram deleted the e2e-nsinfo branch January 24, 2022 22:04
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.

4 participants