-
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
VX-149 VX-150 Add k8s pod, service, pvc: get list create delete function #58
Conversation
4dae7da
to
d6fcabe
Compare
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.
LGTM
src/kubernetes/pvc.go
Outdated
|
||
//Create the PVC by the PVC object | ||
func (kc *KubeCtl) CreatePVC(pvc *corev1.PersistentVolumeClaim, namespace string) (*corev1.PersistentVolumeClaim, error) { | ||
pvc, err := kc.Clientset.CoreV1().PersistentVolumeClaims(namespace).Create(pvc) |
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.
we can just use return kc.Clientset.CoreV1().PersistentVolumeClaims(namespace).Create(pvc)
.
The caller should check the error object.
src/kubernetes/pods.go
Outdated
|
||
//Create the pod by the pod object | ||
func (kc *KubeCtl) CreatePod(pod *corev1.Pod, namespace string) (*corev1.Pod, error) { | ||
pod, err := kc.Clientset.CoreV1().Pods(namespace).Create(pod) |
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.
return kc.Clientset.CoreV1().Pods(namespace).Create(pod)
src/kubernetes/services.go
Outdated
|
||
//Create the service by the service object | ||
func (kc *KubeCtl) CreateService(service *corev1.Service, namespace string) (*corev1.Service, error) { | ||
service, err := kc.Clientset.CoreV1().Services(namespace).Create(service) |
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.
return kc.Clientset.CoreV1().Services(namespace).Create(service)
Codecov Report
@@ Coverage Diff @@
## develop #58 +/- ##
===========================================
+ Coverage 80.4% 81.08% +0.67%
===========================================
Files 20 23 +3
Lines 592 645 +53
===========================================
+ Hits 476 523 +47
- Misses 85 89 +4
- Partials 31 33 +2
Continue to review full report at Codecov.
|
29c7384
to
04095f7
Compare
VX-149 VX-150 Add k8s pod, service, pvc: get list create delete function Former-commit-id: 2e93f942b209e675723145e557b7ffb0bc8994d4 [formerly e206b23] Former-commit-id: 77129bca7098229b4145cc2be5b9b3fdddea2d8d
VX-149 VX-150 Add k8s pod, service, pvc: get list create delete function
No description provided.