-
Notifications
You must be signed in to change notification settings - Fork 8
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
Check the Pod when we delete the volume #87
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #87 +/- ##
===========================================
+ Coverage 69.68% 71.89% +2.21%
===========================================
Files 32 33 +1
Lines 1260 1427 +167
===========================================
+ Hits 878 1026 +148
- Misses 324 333 +9
- Partials 58 68 +10
Continue to review full report at Codecov.
|
src/kubernetes/pods.go
Outdated
@@ -33,3 +33,13 @@ func (kc *KubeCtl) DeletePod(name string) error { | |||
options := metav1.DeleteOptions{} | |||
return kc.Clientset.CoreV1().Pods(kc.Namespace).Delete(name, &options) | |||
} | |||
|
|||
func (kc *KubeCtl) DoesPodCompleted(pod *corev1.Pod) bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about IsPodCompleted
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good
src/volume/volume.go
Outdated
pods := []entity.Pod{} | ||
err := session.FindAll(entity.PodCollectionName, bson.M{"volumes.name": volume.Name}, &pods) | ||
if err != nil { | ||
return fmt.Errorf("Load the database fail:%v", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
vscode都會建議 error message 不要大寫開頭,我們要統一嗎?
https://github.com/golang/go/wiki/CodeReviewComments#error-strings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, 好唷
Check the Pod when we delete the volume Former-commit-id: 8bd9d4fc9803d6d80400a08651f4e3a2d5b5d198 [formerly 6758cf2] Former-commit-id: df99e4fb65b85633f89bc150713c3fc6dd975c11
Check the Pod when we delete the volume
DoesPodCompleted
which return false if the phase of Pod ispending
orrunning
.