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

Pod controller change stop signature #2056

Merged
merged 3 commits into from
May 11, 2023

Conversation

e-sumin
Copy link
Contributor

@e-sumin e-sumin commented May 10, 2023

Change Overview

Since PodController is a general purpose interface, it makes no sense to pass timeout to StartPod method and keep it internally. It's much better to pass it to StopPod.
For the same reason it makes no sense to StopPod when WaitForPodReady failed. Interface user might want to do something before stopping pod.

Pull request type

Please check the type of change your PR introduces:

  • 🚧 Work in Progress
  • 🌈 Refactoring (no functional changes, no api changes)
  • 🐹 Trivial/Minor
  • 🐛 Bugfix
  • 🌻 Feature
  • 🗺️ Documentation
  • 🤖 Test

Test Plan

  • 💪 Manual
  • ⚡ Unit test
  • 💚 E2E

@github-actions
Copy link
Contributor

Thanks for submitting this pull request 🎉. The team will review it soon and get back to you.

If you haven't already, please take a moment to review our project contributing guideline and Code of Conduct document.

@infraq infraq added this to In Progress in Kanister May 10, 2023
@e-sumin e-sumin force-pushed the pod_controller_change_stop_signature branch from 2a444c2 to 4b89667 Compare May 11, 2023 07:17
Copy link
Contributor

@viveksinghggits viveksinghggits left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -40,9 +40,9 @@ var (
type PodController interface {
PodName() string
Pod() *corev1.Pod
StartPod(ctx context.Context, stopTimeout time.Duration) error
StartPod(ctx context.Context) error
Copy link
Contributor

Choose a reason for hiding this comment

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

Removing stopTimeout is good idea. I was thinking would it be a good idea if StartPod accepts another parameter that decides if StartPod wold also wait for the pod to be Running.
But I see we have another method that does that.
I am not sure if removing WaitForPodReady method and having that handled in StartPod would be better idea but it's worth thinking about.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Originally it was written in a way you are describing, but I think that generic interface should provide granular methods, and consumers are able to combine them as they would like. Also that makes tests easier.

Copy link
Contributor

@pavannd1 pavannd1 May 11, 2023

Choose a reason for hiding this comment

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

Agree with @e-sumin 👍🏼

@e-sumin e-sumin added the kueue label May 11, 2023
Kanister automation moved this from In Progress to Reviewer approved May 11, 2023
@mergify mergify bot merged commit 8a60b23 into master May 11, 2023
Kanister automation moved this from Reviewer approved to Done May 11, 2023
@mergify mergify bot deleted the pod_controller_change_stop_signature branch May 11, 2023 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants