feat: implement run and run:detached
This utilizes a Kubernetes Job to start a pod in order to take advantage of completed Job cleanup in Kubernetes. It also properly handles interactivity by ensuring the container has a TTY. Note that there is currently no provision for parsing docker arguments and translating them into their Kubernetes equivalents.
This commit is contained in:
1 parent
6b85374857
commit
8b8444fb1f
10 files changed
+833
-115
No files matched your search
@@ -53,7 +53,10 @@ func main() {
|
||||
appName := flag.Arg(1)
|
||||
containerType := flag.Arg(2)
|
||||
args := flag.Args()
|
||||
if len(args) > 3 {
|
||||
if len(args) == 2 {
|
||||
_, args = common.ShiftString(args)
|
||||
_, args = common.ShiftString(args)
|
||||
} else if len(args) >= 3 {
|
||||
_, args = common.ShiftString(args)
|
||||
_, args = common.ShiftString(args)
|
||||
_, args = common.ShiftString(args)
|
||||
@@ -86,6 +89,22 @@ func main() {
|
||||
scheduler := flag.Arg(0)
|
||||
appName := flag.Arg(1)
|
||||
err = scheduler_k3s.TriggerSchedulerStop(scheduler, appName)
|
||||
case "scheduler-run":
|
||||
var envCount int
|
||||
scheduler := flag.Arg(0)
|
||||
appName := flag.Arg(1)
|
||||
envCount, err = strconv.Atoi(flag.Arg(2))
|
||||
if err != nil {
|
||||
envCount = 0
|
||||
}
|
||||
args := flag.Args()
|
||||
if len(args) >= 3 {
|
||||
_, args = common.ShiftString(args)
|
||||
_, args = common.ShiftString(args)
|
||||
_, args = common.ShiftString(args)
|
||||
}
|
||||
|
||||
err = scheduler_k3s.TriggerSchedulerRun(scheduler, appName, envCount, args)
|
||||
default:
|
||||
err = fmt.Errorf("Invalid plugin trigger call: %s", trigger)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user