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

[Task] container exec #259

Merged
merged 3 commits into from
Sep 18, 2018
Merged

[Task] container exec #259

merged 3 commits into from
Sep 18, 2018

Conversation

John-Lin
Copy link
Contributor

No description provided.

@codecov-io
Copy link

codecov-io commented Aug 20, 2018

Codecov Report

Merging #259 into develop will decrease coverage by 2.76%.
The diff coverage is 0%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #259      +/-   ##
===========================================
- Coverage       74%   71.23%   -2.77%     
===========================================
  Files           64       66       +2     
  Lines         3781     3928     +147     
===========================================
  Hits          2798     2798              
- Misses         778      925     +147     
  Partials       205      205
Impacted Files Coverage Δ
src/server/handler_shell.go 0% <0%> (ø)
src/server/handler_terminal.go 0% <0%> (ø)
src/serviceprovider/serviceprovider.go 0% <0%> (ø) ⬆️
src/server/route.go 80.98% <0%> (-4.2%) ⬇️

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 8d2f93c...c1d8a3b. Read the comment docs.

@John-Lin John-Lin force-pushed the johnlin/container-exec branch from ea93362 to bf63f88 Compare August 22, 2018 15:26
@John-Lin John-Lin changed the title [WIP] container exec [Task] container exec Aug 22, 2018
return
}

kubeconfigPath := filepath.Join(os.Getenv("HOME"), ".kube", "config")
Copy link
Contributor

Choose a reason for hiding this comment

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

這裡可以改從 serviceprovider 拿嗎?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

可以, 但是有一點點小麻煩因為現在 serviceprovider沒有存kubeconfigPath 或 下面一行的cfg

)

if buf, err = session.Recv(); err != nil {
log.Printf("handleTerminalSession: can't Recv: %v", err)
Copy link
Contributor

@WakeupTsai WakeupTsai Aug 23, 2018

Choose a reason for hiding this comment

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

統一用 logger.Infof?


// startProcess is called by handleAttach
// Executed cmd in the container specified in request and connects it up with the ptyHandler (a session)
func startProcess(k8sClient kubernetes.Interface, cfg *rest.Config, request *restful.Request, cmd []string, ptyHandler PtyHandler) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

如果用 serviceprovider 的話,這邊可以改成
func startProcess(sp *serviceprovider.Container, cfg *rest.Config, request *restful.Request, cmd []string, ptyHandler PtyHandler) error {

podName := request.PathParameter("pod")
containerName := request.PathParameter("container")

req := k8sClient.CoreV1().RESTClient().Post().
Copy link
Contributor

Choose a reason for hiding this comment

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

req := sp.KubeCtl.Clientset.CoreV1().RESTClient().Post().


router.PathPrefix("/api/sockjs").Handler(CreateAttachHandler("/api/sockjs"))
Copy link
Contributor

Choose a reason for hiding this comment

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

不放在 v1 底下嗎?

@hwchiu
Copy link
Contributor

hwchiu commented Aug 24, 2018

8/28之後再來審視這個PR

@John-Lin John-Lin force-pushed the johnlin/container-exec branch 3 times, most recently from bc96dec to 55af670 Compare September 7, 2018 08:01
@WakeupTsai WakeupTsai force-pushed the johnlin/container-exec branch from 55af670 to 7e74f88 Compare September 10, 2018 08:40
@John-Lin John-Lin merged commit 537f01e into develop Sep 18, 2018
@John-Lin John-Lin deleted the johnlin/container-exec branch September 18, 2018 06:49
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.

5 participants