Skip to content

Commit

Permalink
Bump Kubernetes version to 0.1.14
Browse files Browse the repository at this point in the history
implement and test patch options
implement new metrics provider API
  • Loading branch information
adracus committed Mar 27, 2019
1 parent e4c40bc commit 16c1164
Show file tree
Hide file tree
Showing 338 changed files with 19,164 additions and 8,448 deletions.
100 changes: 47 additions & 53 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,19 @@ required = ["sigs.k8s.io/testing_frameworks/integration",

[[constraint]]
name = "k8s.io/api"
version = "kubernetes-1.13.4"
version = "kubernetes-1.14.0"

[[constraint]]
name = "k8s.io/apiextensions-apiserver"
version = "kubernetes-1.13.4"
version = "kubernetes-1.14.0"

[[constraint]]
name = "k8s.io/apimachinery"
version = "kubernetes-1.13.4"
version = "kubernetes-1.14.0"

[[constraint]]
name = "k8s.io/client-go"
version = "kubernetes-1.13.4"
version = "kubernetes-1.14.0"

[[constraint]]
name = "sigs.k8s.io/testing_frameworks"
Expand Down
28 changes: 26 additions & 2 deletions pkg/client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1074,7 +1074,7 @@ var _ = Describe("Client", func() {
Expect(err).NotTo(HaveOccurred())

By("patching the Deployment with dry-run")
err = cl.Patch(context.TODO(), dep, client.ConstantPatch(types.MergePatchType, mergePatch), client.UpdatePatchWith(client.UpdateDryRunAll()))
err = cl.Patch(context.TODO(), dep, client.ConstantPatch(types.MergePatchType, mergePatch), client.PatchDryRunAll())
Expect(err).NotTo(HaveOccurred())

By("validating patched Deployment doesn't have the new annotation")
Expand Down Expand Up @@ -1183,7 +1183,7 @@ var _ = Describe("Client", func() {
Kind: "Deployment",
Version: "v1",
})
err = cl.Patch(context.TODO(), u, client.ConstantPatch(types.MergePatchType, mergePatch), client.UpdatePatchWith(client.UpdateDryRunAll()))
err = cl.Patch(context.TODO(), u, client.ConstantPatch(types.MergePatchType, mergePatch), client.PatchDryRunAll())
Expect(err).NotTo(HaveOccurred())

By("validating patched Deployment does not have the new annotation")
Expand Down Expand Up @@ -2153,6 +2153,30 @@ var _ = Describe("Client", func() {
Expect(co.AsUpdateOptions()).To(Equal(&metav1.UpdateOptions{}))
})
})

Describe("PatchOptions", func() {
It("should allow setting DryRun to 'all'", func() {
po := &client.PatchOptions{}
client.PatchDryRunAll()(po)
all := []string{metav1.DryRunAll}
Expect(po.AsPatchOptions().DryRun).To(Equal(all))
})

It("should allow setting Force to 'true'", func() {
po := &client.PatchOptions{}
client.PatchWithForce()(po)
mpo := po.AsPatchOptions()
Expect(mpo.Force).NotTo(BeNil())
Expect(*mpo.Force).To(BeTrue())
})

It("should produce empty metav1.PatchOptions if nil", func() {
var po *client.PatchOptions
Expect(po.AsPatchOptions()).To(Equal(&metav1.PatchOptions{}))
po = &client.PatchOptions{}
Expect(po.AsPatchOptions()).To(Equal(&metav1.PatchOptions{}))
})
})
})

var _ = Describe("DelegatingReader", func() {
Expand Down
Loading

0 comments on commit 16c1164

Please sign in to comment.