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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core: add context parameter to k8sutil node #9163

Merged
merged 1 commit into from Nov 15, 2021

Conversation

y1r
Copy link
Contributor

@y1r y1r commented Nov 13, 2021

Description of your changes:

This commit adds context parameter to k8sutil node functions. By this,
we can handle cancellation during API call of node resource.

Signed-off-by: Yuichiro Ueno y1r.ueno@gmail.com

Which issue is resolved by this Pull Request:
Part of #8700

Checklist:

  • Commit Message Formatting: Commit titles and messages follow guidelines in the developer guide.
  • Skip Tests for Docs: Add the flag for skipping the build if this is only a documentation change. See here for the flag.
  • Skip Unrelated Tests: Add a flag to run tests for a specific storage provider. See test options.
  • Reviewed the developer guide on Submitting a Pull Request
  • Documentation has been updated, if necessary.
  • Unit tests have been added, if necessary.
  • Integration tests have been added, if necessary.
  • Pending release notes updated with breaking and/or notable changes, if necessary.
  • Upgrade from previous release is tested and upgrade user guide is updated, if necessary.
  • Code generation (make codegen) has been run to update object specifications, if necessary.

pkg/operator/ceph/cluster/osd/osd.go Show resolved Hide resolved
pkg/operator/discover/discover.go Show resolved Hide resolved
@mergify
Copy link

mergify bot commented Nov 15, 2021

This pull request has merge conflicts that must be resolved before it can be merged. @y1r please rebase it. https://rook.io/docs/rook/latest/development-flow.html#updating-your-fork

@y1r
Copy link
Contributor Author

y1r commented Nov 15, 2021

@leseb I've updated the PR, so could you review this again?

  • checked pkg/operator/discover/discover.go and removed all context.TODO
  • checked pkg/operator/ceph/cluster/osd/osd.go and removed all context.TODO

Copy link
Member

@leseb leseb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small question

cmd/rook/ceph/osd.go Outdated Show resolved Hide resolved
This commit adds context parameter to k8sutil node functions. By this,
we can handle cancellation during API call of node resource.

Signed-off-by: Yuichiro Ueno <y1r.ueno@gmail.com>
@leseb
Copy link
Member

leseb commented Nov 15, 2021

@y1r this is the last PR in the series to complete #8700 right? So I edited the description of the PR and swapped part of with closes. Thanks

@y1r
Copy link
Contributor Author

y1r commented Nov 15, 2021

this is the last PR in the series to complete #8700 right?

Not yet. I executed grep on the top of rebased this PR:

$ grep -R 'context.TODO()' . | grep -v test.go | grep -v tests | grep context.TODO | sort
./configmap.go: ctx := context.TODO()
./endpoint.go:  ctx := context.TODO()
./kvstore.go:   ctx := context.TODO()
./kvstore.go:   ctx := context.TODO()
./kvstore.go:   ctx := context.TODO()
./kvstore.go:   ctx := context.TODO()
./prometheus.go:        ctx := context.TODO()
./prometheus.go:        ctx := context.TODO()
./pvc.go:               err := client.Get(context.TODO(), types.NamespacedName{Name: *(currentPVC.Spec.StorageClassName)}, storageClass)
./pvc.go:               if err = client.Update(context.TODO(), currentPVC); err != nil {
./replicaset.go:        ctx := context.TODO()
./secret.go:    ctx := context.TODO()
./service.go:   ctx := context.TODO()
./service.go:   ctx := context.TODO()
./service.go:   ctx := context.TODO()

I'll do them later.

@leseb
Copy link
Member

leseb commented Nov 15, 2021

this is the last PR in the series to complete #8700 right?

Not yet. I executed grep on the top of rebased this PR:

$ grep -R 'context.TODO()' . | grep -v test.go | grep -v tests | grep context.TODO | sort
./configmap.go: ctx := context.TODO()
./endpoint.go:  ctx := context.TODO()
./kvstore.go:   ctx := context.TODO()
./kvstore.go:   ctx := context.TODO()
./kvstore.go:   ctx := context.TODO()
./kvstore.go:   ctx := context.TODO()
./prometheus.go:        ctx := context.TODO()
./prometheus.go:        ctx := context.TODO()
./pvc.go:               err := client.Get(context.TODO(), types.NamespacedName{Name: *(currentPVC.Spec.StorageClassName)}, storageClass)
./pvc.go:               if err = client.Update(context.TODO(), currentPVC); err != nil {
./replicaset.go:        ctx := context.TODO()
./secret.go:    ctx := context.TODO()
./service.go:   ctx := context.TODO()
./service.go:   ctx := context.TODO()
./service.go:   ctx := context.TODO()

I'll do them later.

Ok I reverted my edit, thanks!

@leseb leseb merged commit c5783a7 into rook:master Nov 15, 2021
@y1r y1r deleted the add-context-k8sutil-node branch May 11, 2022 04:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants