mirror of
https://github.com/kubernetes/kubectl.git
synced 2026-06-09 08:51:18 -04:00
Merge pull request #115953 from pohly/lint-gomega
test: fixing + linting gomega usage Kubernetes-commit: 015e2fa20c2e08d78e5772c2d0eea00500843e4b
This commit is contained in:
commit
c80bfb61bf
5 changed files with 23 additions and 23 deletions
8
go.mod
8
go.mod
|
|
@ -30,10 +30,10 @@ require (
|
|||
github.com/stretchr/testify v1.8.1
|
||||
golang.org/x/sys v0.5.0
|
||||
gopkg.in/yaml.v2 v2.4.0
|
||||
k8s.io/api v0.0.0-20230222010230-f7c08e33a45d
|
||||
k8s.io/api v0.0.0-20230224170233-ec40acc5b8d7
|
||||
k8s.io/apimachinery v0.0.0-20230223090012-28259f54ab7d
|
||||
k8s.io/cli-runtime v0.0.0-20230216212953-f7d17e2e4c3a
|
||||
k8s.io/client-go v0.0.0-20230224050558-ba2fdddad18c
|
||||
k8s.io/client-go v0.0.0-20230225010603-b46677097d03
|
||||
k8s.io/component-base v0.0.0-20230215215219-ae9be4dda9da
|
||||
k8s.io/component-helpers v0.0.0-20230215120307-78f7b9c080f0
|
||||
k8s.io/klog/v2 v2.80.1
|
||||
|
|
@ -91,10 +91,10 @@ require (
|
|||
)
|
||||
|
||||
replace (
|
||||
k8s.io/api => k8s.io/api v0.0.0-20230222010230-f7c08e33a45d
|
||||
k8s.io/api => k8s.io/api v0.0.0-20230224170233-ec40acc5b8d7
|
||||
k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20230223090012-28259f54ab7d
|
||||
k8s.io/cli-runtime => k8s.io/cli-runtime v0.0.0-20230216212953-f7d17e2e4c3a
|
||||
k8s.io/client-go => k8s.io/client-go v0.0.0-20230224050558-ba2fdddad18c
|
||||
k8s.io/client-go => k8s.io/client-go v0.0.0-20230225010603-b46677097d03
|
||||
k8s.io/code-generator => k8s.io/code-generator v0.0.0-20230215100914-00ad370df34c
|
||||
k8s.io/component-base => k8s.io/component-base v0.0.0-20230215215219-ae9be4dda9da
|
||||
k8s.io/component-helpers => k8s.io/component-helpers v0.0.0-20230215120307-78f7b9c080f0
|
||||
|
|
|
|||
8
go.sum
8
go.sum
|
|
@ -531,14 +531,14 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh
|
|||
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
|
||||
honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
|
||||
honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
|
||||
k8s.io/api v0.0.0-20230222010230-f7c08e33a45d h1:+VG9Mm3/5hF68jUHCl6VGvr6EakD/mI/UtYn7YfLS78=
|
||||
k8s.io/api v0.0.0-20230222010230-f7c08e33a45d/go.mod h1:pIoETLNxk7aEZKVxgu2QTu7skpwH4/QaSON6m2ZcWk0=
|
||||
k8s.io/api v0.0.0-20230224170233-ec40acc5b8d7 h1:QRn9B/c3nFBOr/y1ZvkxSj+8csklqfM0eKhJhQ7ujCo=
|
||||
k8s.io/api v0.0.0-20230224170233-ec40acc5b8d7/go.mod h1:ZgBZcyAg9mrSMLoN3CT3jXA80Nglj1iAeLPjz64hQZ8=
|
||||
k8s.io/apimachinery v0.0.0-20230223090012-28259f54ab7d h1:/diE2y6H2T5l0s265p3l0Dfi4S9vAH3mx0azm51dyEM=
|
||||
k8s.io/apimachinery v0.0.0-20230223090012-28259f54ab7d/go.mod h1:8B/+OdWlScxVvirboh1J5IZSHQrCreQ7fi/5UQntvX0=
|
||||
k8s.io/cli-runtime v0.0.0-20230216212953-f7d17e2e4c3a h1:W9z6yaiE06sOwAuMJQse5quQUlP3Jx/3F4cMCA6C2rE=
|
||||
k8s.io/cli-runtime v0.0.0-20230216212953-f7d17e2e4c3a/go.mod h1:vHZb1K0wxLPJhnJVfdZCh8PJomSsJgd4olTvxLqZt+0=
|
||||
k8s.io/client-go v0.0.0-20230224050558-ba2fdddad18c h1:8qW5dB5Fo4TV2nMUNt64v1UfvmTRU4Ur/UJV5qNliGI=
|
||||
k8s.io/client-go v0.0.0-20230224050558-ba2fdddad18c/go.mod h1:gQIfTNHKjwXL4bngPyXFGikm4C6khDHb1n/UUeHFnL8=
|
||||
k8s.io/client-go v0.0.0-20230225010603-b46677097d03 h1:1e2qRaOenUEC2vO9pIlzDizWrrX/da6cmYwzjOlEB2w=
|
||||
k8s.io/client-go v0.0.0-20230225010603-b46677097d03/go.mod h1:HRsm6qmqZE2rC0JWXUXAp5Z4usMnZMEcUdRZAYP5ghQ=
|
||||
k8s.io/component-base v0.0.0-20230215215219-ae9be4dda9da h1:tgXu2y67YqUXP4txgy1vMTvOOqpT/kzIxmrtE0SvR8M=
|
||||
k8s.io/component-base v0.0.0-20230215215219-ae9be4dda9da/go.mod h1:GgrhCRrPLmN9lWoh+m52a6iHKG3zx8KJyclgqPgbFDQ=
|
||||
k8s.io/component-helpers v0.0.0-20230215120307-78f7b9c080f0 h1:2lV0FlxzZ3gJgDcpiJz54cZgDxHjRn8u9xwoSxkYtD4=
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ var _ = Describe("Getting the Resources", func() {
|
|||
instance = openapi.NewOpenAPIParser(openapi.NewOpenAPIGetter(&client))
|
||||
var err error
|
||||
expectedData, err = openapi.NewOpenAPIData(nil)
|
||||
Expect(err).To(BeNil())
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
})
|
||||
|
||||
Context("when the server returns a successful result", func() {
|
||||
|
|
@ -56,12 +56,12 @@ var _ = Describe("Getting the Resources", func() {
|
|||
Expect(client.Calls).To(Equal(0))
|
||||
|
||||
result, err := instance.Parse()
|
||||
Expect(err).To(BeNil())
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
Expect(result).To(Equal(expectedData))
|
||||
Expect(client.Calls).To(Equal(1))
|
||||
|
||||
result, err = instance.Parse()
|
||||
Expect(err).To(BeNil())
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
Expect(result).To(Equal(expectedData))
|
||||
// No additional client calls expected
|
||||
Expect(client.Calls).To(Equal(1))
|
||||
|
|
|
|||
|
|
@ -34,9 +34,9 @@ var _ = Describe("Reading apps/v1/Deployment from openAPIData", func() {
|
|||
var resources openapi.Resources
|
||||
BeforeEach(func() {
|
||||
s, err := fakeSchema.OpenAPISchema()
|
||||
Expect(err).To(BeNil())
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
resources, err = openapi.NewOpenAPIData(s)
|
||||
Expect(err).To(BeNil())
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
})
|
||||
|
||||
gvk := schema.GroupVersionKind{
|
||||
|
|
@ -52,7 +52,7 @@ var _ = Describe("Reading apps/v1/Deployment from openAPIData", func() {
|
|||
Expect(schema.(*proto.Kind)).ToNot(BeNil())
|
||||
consumes := resources.GetConsumes(gvk, "PATCH")
|
||||
Expect(consumes).ToNot(BeNil())
|
||||
Expect(len(consumes)).To(Equal(4))
|
||||
Expect(consumes).To(HaveLen(4))
|
||||
})
|
||||
})
|
||||
|
||||
|
|
@ -60,9 +60,9 @@ var _ = Describe("Reading authorization.k8s.io/v1/SubjectAccessReview from openA
|
|||
var resources openapi.Resources
|
||||
BeforeEach(func() {
|
||||
s, err := fakeSchema.OpenAPISchema()
|
||||
Expect(err).To(BeNil())
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
resources, err = openapi.NewOpenAPIData(s)
|
||||
Expect(err).To(BeNil())
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
})
|
||||
|
||||
gvk := schema.GroupVersionKind{
|
||||
|
|
|
|||
|
|
@ -36,9 +36,9 @@ var _ = Describe("resource validation using OpenAPI Schema", func() {
|
|||
var validator Schema
|
||||
BeforeEach(func() {
|
||||
s, err := fakeSchema.OpenAPISchema()
|
||||
Expect(err).To(BeNil())
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
resources, err := openapi.NewOpenAPIData(s)
|
||||
Expect(err).To(BeNil())
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
validator = NewSchemaValidation(resources)
|
||||
Expect(validator).ToNot(BeNil())
|
||||
})
|
||||
|
|
@ -65,7 +65,7 @@ spec:
|
|||
- image: redis
|
||||
name: redis
|
||||
`))
|
||||
Expect(err).To(BeNil())
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
})
|
||||
|
||||
It("validates a valid pod", func() {
|
||||
|
|
@ -87,7 +87,7 @@ spec:
|
|||
image: gcr.io/fake_project/fake_image:fake_tag
|
||||
name: master
|
||||
`))
|
||||
Expect(err).To(BeNil())
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
})
|
||||
|
||||
It("finds invalid command (string instead of []string) in Json Pod", func() {
|
||||
|
|
@ -317,7 +317,7 @@ spec:
|
|||
command:
|
||||
`))
|
||||
|
||||
Expect(err).To(BeNil())
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
})
|
||||
|
||||
It("can validate lists", func() {
|
||||
|
|
@ -336,7 +336,7 @@ items:
|
|||
- name: name
|
||||
`))
|
||||
|
||||
Expect(err).To(BeNil())
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
})
|
||||
|
||||
It("fails because apiVersion is not provided", func() {
|
||||
|
|
@ -407,6 +407,6 @@ metadata:
|
|||
spec:
|
||||
foo: bar
|
||||
`))
|
||||
Expect(err).To(BeNil())
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
})
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in a new issue