Skip to content

Commit

Permalink
Merge pull request kubernetes-sigs#1862 from damdo/pkg-envtest-komega…
Browse files Browse the repository at this point in the history
…-fix-updatestatus-godoc

🐛 pkg: envtest: komega: fix UpdateStatus & typos in godoc
  • Loading branch information
k8s-ci-robot authored and alvaroaleman committed Apr 14, 2022
2 parents 188b486 + bc7cc68 commit bfe5fe5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/golangci-lint.yml
Expand Up @@ -19,5 +19,5 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
version: v1.40.1
version: v1.45.2
working-directory: ${{matrix.working-directory}}
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

0 comments on commit bfe5fe5

Please sign in to comment.