Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 pkg: envtest: komega: fix UpdateStatus & typos in godoc #1862

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions pkg/envtest/komega/default.go
Expand Up @@ -51,7 +51,7 @@ func List(list client.ObjectList, opts ...client.ListOption) func() error {
// gomega.Eventually(k.Update(&deployment, func (o client.Object) {
// deployment.Spec.Replicas = 3
// return &deployment
// })).To(gomega.Scucceed())
// })).To(gomega.Succeed())
// By calling the returned function directly it can also be used as gomega.Expect(k.Update(...)()).To(...)
func Update(obj client.Object, f func(), opts ...client.UpdateOption) func() error {
checkDefaultClient()
Expand All @@ -61,10 +61,10 @@ func Update(obj client.Object, f func(), opts ...client.UpdateOption) func() err
// UpdateStatus returns a function that fetches a resource, applies the provided update function and then updates the resource's status.
// It can be used with gomega.Eventually() like this:
// deployment := appsv1.Deployment{ ... }
// gomega.Eventually(k.Update(&deployment, func (o client.Object) {
// gomega.Eventually(k.UpdateStatus(&deployment, func (o client.Object) {
// deployment.Status.AvailableReplicas = 1
// return &deployment
// })).To(gomega.Scucceed())
// })).To(gomega.Succeed())
// By calling the returned function directly it can also be used as gomega.Expect(k.UpdateStatus(...)()).To(...)
func UpdateStatus(obj client.Object, f func(), opts ...client.UpdateOption) func() error {
checkDefaultClient()
Expand Down
4 changes: 2 additions & 2 deletions pkg/envtest/komega/interfaces.go
Expand Up @@ -45,7 +45,7 @@ type Komega interface {
// gomega.Eventually(k.Update(&deployment, func (o client.Object) {
// deployment.Spec.Replicas = 3
// return &deployment
// })).To(gomega.Scucceed())
// })).To(gomega.Succeed())
// By calling the returned function directly it can also be used as gomega.Expect(k.Update(...)()).To(...)
Update(client.Object, func(), ...client.UpdateOption) func() error

Expand All @@ -55,7 +55,7 @@ type Komega interface {
// gomega.Eventually(k.Update(&deployment, func (o client.Object) {
// deployment.Status.AvailableReplicas = 1
// return &deployment
// })).To(gomega.Scucceed())
// })).To(gomega.Succeed())
// By calling the returned function directly it can also be used as gomega.Expect(k.UpdateStatus(...)()).To(...)
UpdateStatus(client.Object, func(), ...client.UpdateOption) func() error

Expand Down