Skip to content

Commit

Permalink
Bump v0.75.1
Browse files Browse the repository at this point in the history
  • Loading branch information
erebe committed Dec 19, 2023
1 parent 7abf328 commit 01d9e9f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 16 deletions.
19 changes: 5 additions & 14 deletions cmd/shell.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,9 @@ var shellCmd = &cobra.Command{
},
}
var (
command []string
podName *string
podContainerName *string
podNameFlag string
containerNameFlag string
command []string
podName string
podContainerName string
)

func shellRequestWithoutArg() (*pkg.ShellRequest, error) {
Expand Down Expand Up @@ -252,15 +250,8 @@ func shellRequestWithApplicationUrl(args []string) (*pkg.ShellRequest, error) {
func init() {
var shellCmd = shellCmd
shellCmd.Flags().StringSliceVarP(&command, "command", "c", []string{"sh"}, "command to launch inside the pod")
shellCmd.Flags().StringVarP(&podNameFlag, "pod", "p", "", "pod name where to exec into")
shellCmd.Flags().StringVar(&containerNameFlag, "container", "", "container name inside the pod")

if podNameFlag != "" {
podName = &podNameFlag
}
if containerNameFlag != "" {
podContainerName = &containerNameFlag
}
shellCmd.Flags().StringVarP(&podName, "pod", "p", "", "pod name where to exec into")
shellCmd.Flags().StringVar(&podContainerName, "container", "", "container name inside the pod")

rootCmd.AddCommand(shellCmd)
}
5 changes: 3 additions & 2 deletions pkg/shell.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ type ShellRequest struct {
ProjectID utils.Id `url:"project"`
OrganizationID utils.Id `url:"organization"`
ClusterID utils.Id `url:"cluster"`
PodName *string `url:"pod_name,omitempty"`
ContainerName *string `url:"container_name,omitempty"`
PodName string `url:"pod_name,omitempty"`
ContainerName string `url:"container_name,omitempty"`
Command []string `url:"command"`
}

Expand Down Expand Up @@ -62,6 +62,7 @@ func ExecShell(req *ShellRequest) {

func createWebsocketConn(req *ShellRequest) (*websocket.Conn, error) {
command, err := query.Values(req)
println("", command.Encode(), req.PodName)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 01d9e9f

Please sign in to comment.