mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-01 07:47:56 +00:00
Merge pull request #121145 from Rei1010/apiClean
e2e_api: stop using deprecated framework.ExpectNotEqual
This commit is contained in:
commit
9c1c603fbe
@ -191,7 +191,7 @@ var _ = SIGDescribe("Servers with support for API chunking", func() {
|
||||
opts.Continue = inconsistentToken
|
||||
list, err = client.List(ctx, opts)
|
||||
framework.ExpectNoError(err, "failed to list pod templates in namespace: %s, given inconsistent continue token %s and limit: %d", ns, opts.Continue, opts.Limit)
|
||||
framework.ExpectNotEqual(list.ResourceVersion, firstRV)
|
||||
gomega.Expect(list.ResourceVersion).ToNot(gomega.Equal(firstRV))
|
||||
gomega.Expect(len(list.Items)).To(gomega.BeNumerically("==", opts.Limit))
|
||||
found := int(oneTenth)
|
||||
|
||||
|
@ -123,7 +123,7 @@ var _ = SIGDescribe("CustomResourceDefinition resources [Privileged:ClusterAdmin
|
||||
expected = e
|
||||
}
|
||||
}
|
||||
framework.ExpectNotEqual(expected, nil)
|
||||
gomega.Expect(expected).ToNot(gomega.BeNil())
|
||||
if !equality.Semantic.DeepEqual(actual.Spec, expected.Spec) {
|
||||
framework.Failf("Expected CustomResourceDefinition in list with name %s to match crd created with same name, but got different specs:\n%s",
|
||||
actual.Name, cmp.Diff(expected.Spec, actual.Spec))
|
||||
@ -211,7 +211,7 @@ var _ = SIGDescribe("CustomResourceDefinition resources [Privileged:ClusterAdmin
|
||||
break
|
||||
}
|
||||
}
|
||||
framework.ExpectNotEqual(group, nil, "apiextensions.k8s.io API group not found in /apis discovery document")
|
||||
gomega.Expect(group).ToNot(gomega.BeNil(), "apiextensions.k8s.io API group not found in /apis discovery document")
|
||||
|
||||
ginkgo.By("finding the apiextensions.k8s.io/v1 API group/version in the /apis discovery document")
|
||||
var version *metav1.GroupVersionForDiscovery
|
||||
@ -221,7 +221,7 @@ var _ = SIGDescribe("CustomResourceDefinition resources [Privileged:ClusterAdmin
|
||||
break
|
||||
}
|
||||
}
|
||||
framework.ExpectNotEqual(version, nil, "apiextensions.k8s.io/v1 API group version not found in /apis discovery document")
|
||||
gomega.Expect(version).ToNot(gomega.BeNil(), "apiextensions.k8s.io/v1 API group version not found in /apis discovery document")
|
||||
}
|
||||
|
||||
{
|
||||
@ -239,7 +239,7 @@ var _ = SIGDescribe("CustomResourceDefinition resources [Privileged:ClusterAdmin
|
||||
break
|
||||
}
|
||||
}
|
||||
framework.ExpectNotEqual(version, nil, "apiextensions.k8s.io/v1 API group version not found in /apis/apiextensions.k8s.io discovery document")
|
||||
gomega.Expect(version).ToNot(gomega.BeNil(), "apiextensions.k8s.io/v1 API group version not found in /apis/apiextensions.k8s.io discovery document")
|
||||
}
|
||||
|
||||
{
|
||||
@ -256,7 +256,7 @@ var _ = SIGDescribe("CustomResourceDefinition resources [Privileged:ClusterAdmin
|
||||
crdResource = &apiResourceList.APIResources[i]
|
||||
}
|
||||
}
|
||||
framework.ExpectNotEqual(crdResource, nil, "customresourcedefinitions resource not found in /apis/apiextensions.k8s.io/v1 discovery document")
|
||||
gomega.Expect(crdResource).ToNot(gomega.BeNil(), "customresourcedefinitions resource not found in /apis/apiextensions.k8s.io/v1 discovery document")
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -129,7 +129,7 @@ var _ = SIGDescribe("Discovery", func() {
|
||||
list := &metav1.APIGroupList{}
|
||||
err := f.ClientSet.Discovery().RESTClient().Get().AbsPath("/apis/").Do(ctx).Into(list)
|
||||
framework.ExpectNoError(err, "Failed to find /apis/")
|
||||
framework.ExpectNotEqual(len(list.Groups), 0, "Missing APIGroups")
|
||||
gomega.Expect(list.Groups).ToNot(gomega.BeEmpty(), "Missing APIGroups")
|
||||
|
||||
for _, group := range list.Groups {
|
||||
if strings.HasSuffix(group.Name, ".example.com") {
|
||||
@ -143,7 +143,7 @@ var _ = SIGDescribe("Discovery", func() {
|
||||
apiPath := "/apis/" + group.Name + "/"
|
||||
err = f.ClientSet.Discovery().RESTClient().Get().AbsPath(apiPath).Do(ctx).Into(checkGroup)
|
||||
framework.ExpectNoError(err, "Fail to access: %s", apiPath)
|
||||
framework.ExpectNotEqual(len(checkGroup.Versions), 0, "No version found for %v", group.Name)
|
||||
gomega.Expect(checkGroup.Versions).ToNot(gomega.BeEmpty(), "No version found for %v", group.Name)
|
||||
framework.Logf("PreferredVersion.GroupVersion: %s", checkGroup.PreferredVersion.GroupVersion)
|
||||
framework.Logf("Versions found %v", checkGroup.Versions)
|
||||
|
||||
|
@ -112,8 +112,8 @@ var _ = SIGDescribe("Servers with support for Table transformation", func() {
|
||||
Do(ctx).Into(pagedTable)
|
||||
framework.ExpectNoError(err, "failed to get pod templates in Table form in namespace: %s", ns)
|
||||
gomega.Expect(pagedTable.Rows).To(gomega.HaveLen(2))
|
||||
framework.ExpectNotEqual(pagedTable.ResourceVersion, "")
|
||||
framework.ExpectNotEqual(pagedTable.Continue, "")
|
||||
gomega.Expect(pagedTable.ResourceVersion).ToNot(gomega.BeEmpty())
|
||||
gomega.Expect(pagedTable.Continue).ToNot(gomega.BeEmpty())
|
||||
gomega.Expect(pagedTable.Rows[0].Cells[0]).To(gomega.Equal("template-0000"))
|
||||
gomega.Expect(pagedTable.Rows[1].Cells[0]).To(gomega.Equal("template-0001"))
|
||||
|
||||
@ -138,7 +138,7 @@ var _ = SIGDescribe("Servers with support for Table transformation", func() {
|
||||
gomega.Expect(table.Rows).ToNot(gomega.BeEmpty())
|
||||
gomega.Expect(table.Rows[0].Cells).To(gomega.HaveLen(len(table.ColumnDefinitions)))
|
||||
gomega.Expect(table.ColumnDefinitions[0].Name).To(gomega.Equal("Name"))
|
||||
framework.ExpectNotEqual(table.ResourceVersion, "")
|
||||
gomega.Expect(table.ResourceVersion).ToNot(gomega.BeEmpty())
|
||||
|
||||
out := printTable(table)
|
||||
gomega.Expect(out).To(gomega.MatchRegexp("^NAME\\s"))
|
||||
|
@ -131,7 +131,7 @@ var _ = SIGDescribe("AdmissionWebhook [Privileged:ClusterAdmin]", func() {
|
||||
break
|
||||
}
|
||||
}
|
||||
framework.ExpectNotEqual(group, nil, "admissionregistration.k8s.io API group not found in /apis discovery document")
|
||||
gomega.Expect(group).ToNot(gomega.BeNil(), "admissionregistration.k8s.io API group not found in /apis discovery document")
|
||||
|
||||
ginkgo.By("finding the admissionregistration.k8s.io/v1 API group/version in the /apis discovery document")
|
||||
var version *metav1.GroupVersionForDiscovery
|
||||
@ -141,7 +141,7 @@ var _ = SIGDescribe("AdmissionWebhook [Privileged:ClusterAdmin]", func() {
|
||||
break
|
||||
}
|
||||
}
|
||||
framework.ExpectNotEqual(version, nil, "admissionregistration.k8s.io/v1 API group version not found in /apis discovery document")
|
||||
gomega.Expect(version).ToNot(gomega.BeNil(), "admissionregistration.k8s.io/v1 API group version not found in /apis discovery document")
|
||||
}
|
||||
|
||||
{
|
||||
@ -159,7 +159,7 @@ var _ = SIGDescribe("AdmissionWebhook [Privileged:ClusterAdmin]", func() {
|
||||
break
|
||||
}
|
||||
}
|
||||
framework.ExpectNotEqual(version, nil, "admissionregistration.k8s.io/v1 API group version not found in /apis/admissionregistration.k8s.io discovery document")
|
||||
gomega.Expect(version).ToNot(gomega.BeNil(), "admissionregistration.k8s.io/v1 API group version not found in /apis/admissionregistration.k8s.io discovery document")
|
||||
}
|
||||
|
||||
{
|
||||
@ -182,8 +182,8 @@ var _ = SIGDescribe("AdmissionWebhook [Privileged:ClusterAdmin]", func() {
|
||||
validatingWebhookResource = &apiResourceList.APIResources[i]
|
||||
}
|
||||
}
|
||||
framework.ExpectNotEqual(mutatingWebhookResource, nil, "mutatingwebhookconfigurations resource not found in /apis/admissionregistration.k8s.io/v1 discovery document")
|
||||
framework.ExpectNotEqual(validatingWebhookResource, nil, "validatingwebhookconfigurations resource not found in /apis/admissionregistration.k8s.io/v1 discovery document")
|
||||
gomega.Expect(mutatingWebhookResource).ToNot(gomega.BeNil(), "mutatingwebhookconfigurations resource not found in /apis/admissionregistration.k8s.io/v1 discovery document")
|
||||
gomega.Expect(validatingWebhookResource).ToNot(gomega.BeNil(), "validatingwebhookconfigurations resource not found in /apis/admissionregistration.k8s.io/v1 discovery document")
|
||||
}
|
||||
})
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user