Merge pull request #67320 from hanxiaoshuai/fix0810

Automatic merge from submit-queue (batch tested with PRs 67294, 67320, 67335, 67334, 67325). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

fix some minor mistakes in e2e

**What this PR does / why we need it**:
fix some minor mistakes in e2e
**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
This commit is contained in:
Kubernetes Submit Queue 2018-08-15 00:07:12 -07:00 committed by GitHub
commit 73c5266530
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -109,7 +109,10 @@ func testCustomMetrics(f *framework.Framework, kubeClient clientset.Interface, c
defer CleanupAdapter(adapterDeployment)
_, err = kubeClient.RbacV1().ClusterRoleBindings().Create(HPAPermissions)
defer kubeClient.RbacV1().ClusterRoleBindings().Delete("custom-metrics-reader", &metav1.DeleteOptions{})
if err != nil {
framework.Failf("Failed to create ClusterRoleBindings: %v", err)
}
defer kubeClient.RbacV1().ClusterRoleBindings().Delete(HPAPermissions.Name, &metav1.DeleteOptions{})
// Run application that exports the metric
_, err = createSDExporterPods(f, kubeClient)
@ -153,7 +156,10 @@ func testExternalMetrics(f *framework.Framework, kubeClient clientset.Interface,
defer CleanupAdapter(AdapterForOldResourceModel)
_, err = kubeClient.RbacV1().ClusterRoleBindings().Create(HPAPermissions)
defer kubeClient.RbacV1().ClusterRoleBindings().Delete("custom-metrics-reader", &metav1.DeleteOptions{})
if err != nil {
framework.Failf("Failed to create ClusterRoleBindings: %v", err)
}
defer kubeClient.RbacV1().ClusterRoleBindings().Delete(HPAPermissions.Name, &metav1.DeleteOptions{})
// Run application that exports the metric
pod, err := createSDExporterPods(f, kubeClient)