-
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
[Task] container exec #259
Conversation
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
ea93362
to
bf63f88
Compare
src/server/handler_shell.go
Outdated
return | ||
} | ||
|
||
kubeconfigPath := filepath.Join(os.Getenv("HOME"), ".kube", "config") |
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.
這裡可以改從 serviceprovider 拿嗎?
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.
可以, 但是有一點點小麻煩因為現在 serviceprovider沒有存kubeconfigPath 或 下面一行的cfg
src/server/handler_terminal.go
Outdated
) | ||
|
||
if buf, err = session.Recv(); err != nil { | ||
log.Printf("handleTerminalSession: can't Recv: %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.
統一用 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 { |
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.
如果用 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(). |
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.
req := sp.KubeCtl.Clientset.CoreV1().RESTClient().Post().
src/server/route.go
Outdated
|
||
router.PathPrefix("/api/sockjs").Handler(CreateAttachHandler("/api/sockjs")) |
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.
不放在 v1 底下嗎?
8/28之後再來審視這個PR |
bc96dec
to
55af670
Compare
55af670
to
7e74f88
Compare
No description provided.