add supplemental container support

This commit is contained in:
Zoe
2025-04-10 16:18:42 +00:00
parent 2bd953dcb6
commit d501775ae6
21 changed files with 460 additions and 215 deletions

View File

@@ -1,4 +1,4 @@
package handlers
package commands
import (
"fmt"

View File

@@ -1,4 +1,5 @@
package handlers
package commands
import (
"archive/tar"

View File

@@ -1,4 +1,4 @@
package handlers
package commands
import (
"encoding/json"

View File

@@ -1,4 +1,4 @@
package handlers
package commands
import (
"encoding/json"

View File

@@ -1,4 +1,4 @@
package handlers
package commands
import (
"encoding/json"

View File

@@ -1,4 +1,4 @@
package handlers
package commands
import (
"fmt"

View File

@@ -1,4 +1,4 @@
package handlers
package commands
import (
"fmt"

View File

@@ -13,7 +13,7 @@ import (
"github.com/agnivade/levenshtein"
"github.com/briandowns/spinner"
"github.com/juls0730/flux/cmd/flux/handlers"
"github.com/juls0730/flux/cmd/flux/commands"
"github.com/juls0730/flux/cmd/flux/models"
"github.com/juls0730/flux/pkg"
)
@@ -23,6 +23,8 @@ var config []byte
var configPath = filepath.Join(os.Getenv("HOME"), "/.config/flux")
var version = pkg.Version
var helpStr = `Usage:
flux <command>
@@ -179,15 +181,20 @@ func main() {
os.Exit(1)
}
if info.Version != version {
fmt.Printf("Version mismatch, daemon is running version %s, but you are running version %s\n", info.Version, version)
os.Exit(1)
}
cmdHandler := CommandHandler{
commands: make(map[string]func(bool, models.Config, pkg.Info, *spinner.Spinner, *models.CustomSpinnerWriter, []string) error),
}
cmdHandler.RegisterCmd("deploy", handlers.DeployCommand)
cmdHandler.RegisterCmd("stop", handlers.StopCommand)
cmdHandler.RegisterCmd("start", handlers.StartCommand)
cmdHandler.RegisterCmd("delete", handlers.DeleteCommand)
cmdHandler.RegisterCmd("init", handlers.InitCommand)
cmdHandler.RegisterCmd("deploy", commands.DeployCommand)
cmdHandler.RegisterCmd("stop", commands.StopCommand)
cmdHandler.RegisterCmd("start", commands.StartCommand)
cmdHandler.RegisterCmd("delete", commands.DeleteCommand)
cmdHandler.RegisterCmd("init", commands.InitCommand)
err = runCommand(command, args, config, info, cmdHandler, 0)
if err != nil {

View File

@@ -4,7 +4,7 @@ import (
"net/http"
_ "net/http/pprof"
"github.com/juls0730/flux/server"
"github.com/juls0730/flux/internal/server"
"go.uber.org/zap"
)