mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-06 18:54:06 +00:00
Correct the label selector used in TestSampleAPIServer
TestSampleAPIServer tried to validate APIService deletion, but it used an unmatched selector to delete and list APIServices, which essentially validated nothing. Signed-off-by: Quan Tian <qtian@vmware.com>
This commit is contained in:
parent
86676bce04
commit
b500c3d693
@ -560,7 +560,6 @@ func TestSampleAPIServer(ctx context.Context, f *framework.Framework, aggrclient
|
|||||||
ginkgo.By("Adding a label to the APIService")
|
ginkgo.By("Adding a label to the APIService")
|
||||||
apiServiceClient := aggrclient.ApiregistrationV1().APIServices()
|
apiServiceClient := aggrclient.ApiregistrationV1().APIServices()
|
||||||
apiServiceLabel := map[string]string{"e2e-apiservice": "patched"}
|
apiServiceLabel := map[string]string{"e2e-apiservice": "patched"}
|
||||||
apiServiceLabelSelector := labels.SelectorFromSet(apiServiceLabel).String()
|
|
||||||
apiServicePatch, err := json.Marshal(map[string]interface{}{
|
apiServicePatch, err := json.Marshal(map[string]interface{}{
|
||||||
"metadata": map[string]interface{}{
|
"metadata": map[string]interface{}{
|
||||||
"labels": apiServiceLabel,
|
"labels": apiServiceLabel,
|
||||||
@ -641,7 +640,7 @@ func TestSampleAPIServer(ctx context.Context, f *framework.Framework, aggrclient
|
|||||||
framework.Logf("Found updated apiService label for %q", apiServiceName)
|
framework.Logf("Found updated apiService label for %q", apiServiceName)
|
||||||
|
|
||||||
// kubectl delete flunder test-flunder
|
// kubectl delete flunder test-flunder
|
||||||
ginkgo.By(fmt.Sprintf("Delete APIService %q", flunderName))
|
ginkgo.By(fmt.Sprintf("Delete flunders resource %q", flunderName))
|
||||||
err = dynamicClient.Delete(ctx, flunderName, metav1.DeleteOptions{})
|
err = dynamicClient.Delete(ctx, flunderName, metav1.DeleteOptions{})
|
||||||
validateErrorWithDebugInfo(ctx, f, err, pods, "deleting flunders(%v) using dynamic client", unstructuredList.Items)
|
validateErrorWithDebugInfo(ctx, f, err, pods, "deleting flunders(%v) using dynamic client", unstructuredList.Items)
|
||||||
|
|
||||||
@ -724,6 +723,7 @@ func TestSampleAPIServer(ctx context.Context, f *framework.Framework, aggrclient
|
|||||||
}
|
}
|
||||||
framework.Logf("Found patched status condition for %s", wardle.ObjectMeta.Name)
|
framework.Logf("Found patched status condition for %s", wardle.ObjectMeta.Name)
|
||||||
|
|
||||||
|
apiServiceLabelSelector := labels.SelectorFromSet(updatedApiService.Labels).String()
|
||||||
ginkgo.By(fmt.Sprintf("APIService deleteCollection with labelSelector: %q", apiServiceLabelSelector))
|
ginkgo.By(fmt.Sprintf("APIService deleteCollection with labelSelector: %q", apiServiceLabelSelector))
|
||||||
|
|
||||||
err = aggrclient.ApiregistrationV1().APIServices().DeleteCollection(ctx,
|
err = aggrclient.ApiregistrationV1().APIServices().DeleteCollection(ctx,
|
||||||
|
Loading…
Reference in New Issue
Block a user