3 Commits
main ... v0.0.9

Author SHA1 Message Date
4ffaabd6e6 added log on failure to attach
Some checks failed
Build and Push Docker Image / Build image (push) Has been cancelled
2025-04-09 16:45:18 +03:00
c647f76894 removed container attach thingy 2025-04-09 16:20:34 +03:00
c1c5d23f92 plz
Some checks failed
Build and Push Docker Image / Build image (push) Has been cancelled
2025-04-09 04:14:08 +03:00
2 changed files with 12 additions and 9 deletions

View File

@@ -119,8 +119,8 @@ func (con AuthApi) signUp(ctx *gin.Context) {
}
type SignInRequest struct {
Username string
Password string
Username string `json:"username"`
Password string `json:"password"`
}
func (con AuthApi) signIn(ctx *gin.Context) {

View File

@@ -3,6 +3,7 @@ package kubernetes
import (
"context"
"io"
"log"
"os"
"path/filepath"
"strings"
@@ -250,22 +251,24 @@ func (i *InstanceManager) InteractiveTerminal(ctx context.Context, serverId stri
req := i.coreV1Cli.CoreV1().RESTClient().
Post().
Resource("pods").
Namespace(i.Config.Namespace).
Name(serverId).
Namespace(i.Config.Namespace).
SubResource("attach").
VersionedParams(&corev1.PodAttachOptions{
Container: "server",
Stdin: true,
Stdout: true,
Stderr: true,
TTY: true,
Stdin: true,
Stdout: true,
Stderr: true,
TTY: true,
}, clientgoscheme.ParameterCodec)
executor, err := remotecommand.NewSPDYExecutor(i.restCfg, "POST", req.URL())
go func() {
defer stdoutWriter.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 {