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

Fix leaking ingress resources in federated ingress e2e test. #34652

Merged
merged 1 commit into from Oct 13, 2016
Merged

Fix leaking ingress resources in federated ingress e2e test. #34652

merged 1 commit into from Oct 13, 2016

Conversation

ghost
Copy link

@ghost ghost commented Oct 12, 2016

Originally the federated ingresses were being deleted, but due to the lack of cascading deletion, the cluster ingresses were never being deleted, leading to leaked GCE loadbalancer resources. This fixes that.

Fix leaking ingress resources in federated ingress e2e test.

This change is Reviewable

@ghost ghost added priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note Denotes a PR that will be considered when it comes time to generate release notes. cherrypick-candidate labels Oct 12, 2016
@ghost ghost added this to the v1.4 milestone Oct 12, 2016
@k8s-github-robot k8s-github-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Oct 12, 2016
@@ -268,6 +276,15 @@ func deleteIngressOrFail(clientset *fedclientset.Clientset, namespace string, in
framework.ExpectNoError(err, "Error deleting ingress %q from namespace %q", ingressName, namespace)
}

// TODO: quinton: This is largely a cut 'n paste of the above. Yuck! Refactor as soon as we have a common interface implmented by both fedclientset.Clientset and kubeclientset.Clientset
func deleteClusterIngressOrFail(clusterName string, clientset *kubeclientset.Clientset, namespace string, ingressName string) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of passing the clientset, you can pass IngressesGetter or IngressInterface or just a func(namespace, ingressName) that deletes the ingress. You wont need to duplicate the func then.

Copy link
Author

Choose a reason for hiding this comment

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

Agreed, will do in followup PR.

@nikhiljindal
Copy link
Contributor

lgtm with one suggestion

@@ -64,7 +64,7 @@ var _ = framework.KubeDescribe("Federated ingresses [Feature:Federation]", func(

It("should be created and deleted successfully", func() {
framework.SkipUnlessFederated(f.Client)

framework.SkipUnlessProviderIs("gce", "gke") // TODO: Federated ingress is not yet supported on non-GCP platforms.
Copy link
Contributor

Choose a reason for hiding this comment

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

👍 Thanks!

framework.ExpectNoError(err, "Error deleting ingress %q in namespace %q", ingress.Name, ns)
framework.ExpectNoError(err, "Error deleting ingress %q/%q in federation", ns, ingress.Name)
for clusterName, cluster := range clusters {
err := cluster.Ingresses(ns).Delete(ingress.Name, &v1.DeleteOptions{})
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a reason you cannot use deleteClusterIngressOrFail() here?

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, I think you need to do something akin to cleanupServiceShardsAndProviderResources() (https://github.com/kubernetes/kubernetes/blob/master/test/e2e/federated-ingress.go#L139) to ensure the underlying cloud resources are cleaned up.

For an Ingress specific example, see the Ingress e2e test - https://github.com/kubernetes/kubernetes/blob/master/test/e2e/ingress_utils.go#L311

But let's get this PR in first.

Copy link
Author

@ghost ghost Oct 12, 2016

Choose a reason for hiding this comment

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

Regarding your first comment, I followed the existing style used for the deletion of the federated ingresses.

Agreed about the GCE resources. I'll add that in a separate PR.

@madhusudancs madhusudancs added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 12, 2016
@ghost
Copy link
Author

ghost commented Oct 13, 2016

@k8s-bot test this issue #IGNORE

@k8s-github-robot
Copy link

@k8s-bot test this [submit-queue is verifying that this PR is safe to merge]

@k8s-github-robot
Copy link

Automatic merge from submit-queue

@k8s-github-robot k8s-github-robot merged commit 726c2e7 into kubernetes:master Oct 13, 2016
@jessfraz jessfraz added the cherry-pick-approved Indicates a cherry-pick PR into a release branch has been approved by the release branch manager. label Oct 13, 2016
k8s-github-robot pushed a commit that referenced this pull request Oct 18, 2016
…52-origin-release-1.4

Automatic merge from submit-queue

Automated cherry pick of #34652

Cherry pick of #34652 on release-1.4.

#34652: Fix leaking ingress resources in federated ingress e2e test.
@k8s-cherrypick-bot
Copy link

Commit found in the "release-1.4" branch appears to be this PR. Removing the "cherrypick-candidate" label. If this is an error find help to get your PR picked.

shyamjvs pushed a commit to shyamjvs/kubernetes that referenced this pull request Dec 1, 2016
…ck-of-#34652-origin-release-1.4

Automatic merge from submit-queue

Automated cherry pick of kubernetes#34652

Cherry pick of kubernetes#34652 on release-1.4.

kubernetes#34652: Fix leaking ingress resources in federated ingress e2e test.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-pick-approved Indicates a cherry-pick PR into a release branch has been approved by the release branch manager. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants