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

VX-149 VX-150 Add k8s pod, service, pvc: get list create delete function #58

Merged
merged 4 commits into from
Jul 4, 2018

Conversation

chenyunchen
Copy link
Contributor

No description provided.

@chenyunchen chenyunchen changed the title Add k8s pod, service: get list create delete function Add k8s pod, service, pvc: get list create delete function Jul 3, 2018
@chenyunchen chenyunchen force-pushed the alex/addk8sfunction branch from 4dae7da to d6fcabe Compare July 3, 2018 07:35
@chenyunchen chenyunchen changed the title Add k8s pod, service, pvc: get list create delete function VX-149 VX-150 Add k8s pod, service, pvc: get list create delete function Jul 3, 2018
Copy link
Contributor

@hwchiu hwchiu left a comment

Choose a reason for hiding this comment

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

LGTM


//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)
Copy link
Contributor

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.


//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)
Copy link
Contributor

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)


//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)
Copy link
Contributor

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-io
Copy link

codecov-io commented Jul 4, 2018

Codecov Report

Merging #58 into develop will increase coverage by 0.67%.
The diff coverage is 86.66%.

Impacted file tree graph

@@             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
Impacted Files Coverage Δ
src/kubernetes/nodes.go 90% <ø> (ø) ⬆️
src/kubernetes/pods.go 86.66% <86.66%> (ø)
src/kubernetes/pvc.go 86.66% <86.66%> (ø)
src/kubernetes/services.go 86.66% <86.66%> (ø)
src/networkprovider/ovs.go 78.78% <0%> (+2.92%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ee1f82e...04095f7. Read the comment docs.

@chenyunchen chenyunchen force-pushed the alex/addk8sfunction branch from 29c7384 to 04095f7 Compare July 4, 2018 06:13
@John-Lin John-Lin merged commit e206b23 into develop Jul 4, 2018
@John-Lin John-Lin deleted the alex/addk8sfunction branch July 5, 2018 10:39
John-Lin added a commit that referenced this pull request Jul 25, 2018
VX-149 VX-150 Add k8s pod, service, pvc: get list create delete function

Former-commit-id: 2e93f942b209e675723145e557b7ffb0bc8994d4 [formerly e206b23]
Former-commit-id: 77129bca7098229b4145cc2be5b9b3fdddea2d8d
John-Lin added a commit that referenced this pull request Jul 25, 2018
VX-149 VX-150 Add k8s pod, service, pvc: get list create delete function

Former-commit-id: 2e93f942b209e675723145e557b7ffb0bc8994d4 [formerly 2e93f942b209e675723145e557b7ffb0bc8994d4 [formerly e206b23]]
Former-commit-id: 77129bca7098229b4145cc2be5b9b3fdddea2d8d
Former-commit-id: 8c04dae
John-Lin added a commit that referenced this pull request Jul 25, 2018
VX-149 VX-150 Add k8s pod, service, pvc: get list create delete function
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.

4 participants