Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
4ffaabd6e6 | |||
c647f76894 | |||
c1c5d23f92 | |||
4263647288 |
@@ -84,8 +84,8 @@ func (con *AuthApi) LoggedIn(ctx *gin.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type SignUpRequest struct {
|
type SignUpRequest struct {
|
||||||
Username string
|
Username string `json:"username"`
|
||||||
Password string
|
Password string `json:"password"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (con AuthApi) signUp(ctx *gin.Context) {
|
func (con AuthApi) signUp(ctx *gin.Context) {
|
||||||
@@ -119,8 +119,8 @@ func (con AuthApi) signUp(ctx *gin.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type SignInRequest struct {
|
type SignInRequest struct {
|
||||||
Username string
|
Username string `json:"username"`
|
||||||
Password string
|
Password string `json:"password"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (con AuthApi) signIn(ctx *gin.Context) {
|
func (con AuthApi) signIn(ctx *gin.Context) {
|
||||||
|
@@ -3,6 +3,7 @@ package kubernetes
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"io"
|
"io"
|
||||||
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
@@ -250,22 +251,24 @@ func (i *InstanceManager) InteractiveTerminal(ctx context.Context, serverId stri
|
|||||||
req := i.coreV1Cli.CoreV1().RESTClient().
|
req := i.coreV1Cli.CoreV1().RESTClient().
|
||||||
Post().
|
Post().
|
||||||
Resource("pods").
|
Resource("pods").
|
||||||
Namespace(i.Config.Namespace).
|
|
||||||
Name(serverId).
|
Name(serverId).
|
||||||
|
Namespace(i.Config.Namespace).
|
||||||
SubResource("attach").
|
SubResource("attach").
|
||||||
VersionedParams(&corev1.PodAttachOptions{
|
VersionedParams(&corev1.PodAttachOptions{
|
||||||
Container: "server",
|
Stdin: true,
|
||||||
Stdin: true,
|
Stdout: true,
|
||||||
Stdout: true,
|
Stderr: true,
|
||||||
Stderr: true,
|
TTY: true,
|
||||||
TTY: true,
|
|
||||||
}, clientgoscheme.ParameterCodec)
|
}, clientgoscheme.ParameterCodec)
|
||||||
|
|
||||||
executor, err := remotecommand.NewSPDYExecutor(i.restCfg, "POST", req.URL())
|
executor, err := remotecommand.NewSPDYExecutor(i.restCfg, "POST", req.URL())
|
||||||
go func() {
|
go func() {
|
||||||
defer stdoutWriter.Close()
|
defer stdoutWriter.Close()
|
||||||
defer stdinReader.Close()
|
defer stdinReader.Close()
|
||||||
_ = executor.StreamWithContext(ctx, remotecommand.StreamOptions{Stdin: stdinReader, Stdout: stdoutWriter, Stderr: stdoutWriter, Tty: true, TerminalSizeQueue: queue})
|
err := executor.StreamWithContext(ctx, remotecommand.StreamOptions{Stdin: stdinReader, Stdout: stdoutWriter, Stderr: stdoutWriter, Tty: true, TerminalSizeQueue: queue})
|
||||||
|
if err != nil {
|
||||||
|
log.Printf("Failed to attach %e", err)
|
||||||
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Reference in New Issue
Block a user