Skip to content
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

Don't fail teardown if we can't delete the network #34750

Merged
merged 1 commit into from
Oct 13, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion cluster/gce/util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1362,7 +1362,7 @@ function kube-down() {
"${NETWORK}-default-ssh" \
"${NETWORK}-default-internal" # Pre-1.5 clusters
if [[ "${KUBE_DELETE_NETWORK}" == "true" ]]; then
delete-network
delete-network || true # might fail if there are leaked firewall rules
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe something like delete-network || echo "failed to delete network"?

Copy link
Member Author

Choose a reason for hiding this comment

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

delete-network already does that.

Copy link
Contributor

Choose a reason for hiding this comment

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

Please address this in a followup so the tests pass sooner. Then I can merge this and unblock the queue.

Copy link
Member

Choose a reason for hiding this comment

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

hmm - this is super strange. "Delete network" may fail when there are leaked firewall rules? If so, that as soon as we leak firewall rules in all networks, we won't be able to delete any. Or am I missing something?

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 should probably update the comment, since leaked VMs, routes, and other things will also prevent network deletion.

Basically, with the gcloud API it'll only delete the network if there are no resources in it. In the cloud console (web) it'll first delete anything in the network.

Copy link
Member Author

Choose a reason for hiding this comment

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

@krzyzacy is working on a janitor to clean up leaked resources, so I'm not super worried about this.

fi

# If there are no more remaining master replicas, we should update kubeconfig.
Expand Down
1 change: 0 additions & 1 deletion cluster/gke/util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,6 @@ function test-teardown() {
if ! "${GCLOUD}" compute networks delete --project "${PROJECT}" --quiet "${NETWORK}"; then
echo "Failed to delete network '${NETWORK}'. Listing firewall-rules:"
"${GCLOUD}" compute firewall-rules --project "${PROJECT}" list --filter="network=${NETWORK}"
return 1
fi
fi
fi
Expand Down