Skip to content

Commit 1657cf6

Browse files
authored
Merge pull request #2602 from erikgb/fix-komega-godoc-examples
📖 Fix komega godoc examples
2 parents a50d5d7 + ddba256 commit 1657cf6

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

pkg/envtest/komega/default.go

+2-4
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,8 @@ func List(list client.ObjectList, opts ...client.ListOption) func() error {
5353
// It can be used with gomega.Eventually() like this:
5454
//
5555
// deployment := appsv1.Deployment{ ... }
56-
// gomega.Eventually(k.Update(&deployment, func (o client.Object) {
56+
// gomega.Eventually(k.Update(&deployment, func() {
5757
// deployment.Spec.Replicas = 3
58-
// return &deployment
5958
// })).To(gomega.Succeed())
6059
//
6160
// By calling the returned function directly it can also be used as gomega.Expect(k.Update(...)()).To(...)
@@ -68,9 +67,8 @@ func Update(obj client.Object, f func(), opts ...client.UpdateOption) func() err
6867
// It can be used with gomega.Eventually() like this:
6968
//
7069
// deployment := appsv1.Deployment{ ... }
71-
// gomega.Eventually(k.UpdateStatus(&deployment, func (o client.Object) {
70+
// gomega.Eventually(k.UpdateStatus(&deployment, func() {
7271
// deployment.Status.AvailableReplicas = 1
73-
// return &deployment
7472
// })).To(gomega.Succeed())
7573
//
7674
// By calling the returned function directly it can also be used as gomega.Expect(k.UpdateStatus(...)()).To(...)

pkg/envtest/komega/interfaces.go

+2-4
Original file line numberDiff line numberDiff line change
@@ -42,19 +42,17 @@ type Komega interface {
4242
// Update returns a function that fetches a resource, applies the provided update function and then updates the resource.
4343
// It can be used with gomega.Eventually() like this:
4444
// deployment := appsv1.Deployment{ ... }
45-
// gomega.Eventually(k.Update(&deployment, func (o client.Object) {
45+
// gomega.Eventually(k.Update(&deployment, func() {
4646
// deployment.Spec.Replicas = 3
47-
// return &deployment
4847
// })).To(gomega.Succeed())
4948
// By calling the returned function directly it can also be used as gomega.Expect(k.Update(...)()).To(...)
5049
Update(client.Object, func(), ...client.UpdateOption) func() error
5150

5251
// UpdateStatus returns a function that fetches a resource, applies the provided update function and then updates the resource's status.
5352
// It can be used with gomega.Eventually() like this:
5453
// deployment := appsv1.Deployment{ ... }
55-
// gomega.Eventually(k.Update(&deployment, func (o client.Object) {
54+
// gomega.Eventually(k.Update(&deployment, func() {
5655
// deployment.Status.AvailableReplicas = 1
57-
// return &deployment
5856
// })).To(gomega.Succeed())
5957
// By calling the returned function directly it can also be used as gomega.Expect(k.UpdateStatus(...)()).To(...)
6058
UpdateStatus(client.Object, func(), ...client.SubResourceUpdateOption) func() error

0 commit comments

Comments
 (0)