Skip to content

Commit

Permalink
Make interactive app work on Docker-less hosts too
Browse files Browse the repository at this point in the history
The removed client initialization seemed redundant anyway because the
dockerutil calls can work with nil clients, too.

Signed-off-by: Ivan Velichko <iximiuz@gmail.com>
  • Loading branch information
iximiuz committed Mar 17, 2024
1 parent fed44fd commit bac50e0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 19 deletions.
18 changes: 0 additions & 18 deletions pkg/app/master/command/cliprompt.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@ import (

"github.com/mintoolkit/mint/pkg/app"
"github.com/mintoolkit/mint/pkg/app/master/config"
"github.com/mintoolkit/mint/pkg/docker/dockerclient"
"github.com/mintoolkit/mint/pkg/docker/dockerutil"
"github.com/mintoolkit/mint/pkg/util/errutil"
"github.com/mintoolkit/mint/pkg/util/fsutil"
"github.com/mintoolkit/mint/pkg/version"
)

type InteractiveApp struct {
Expand All @@ -41,20 +37,6 @@ func NewInteractiveApp(app *cli.App, gparams *GenericParams) *InteractiveApp {
},
}

client, err := dockerclient.New(gparams.ClientConfig)
if err == dockerclient.ErrNoDockerInfo {
exitMsg := "missing Docker connection info"
if gparams.InContainer && gparams.IsDSImage {
exitMsg = "make sure to pass the Docker connect parameters to the mint app container"
}
fmt.Printf("mint: info=docker.connect.error message='%s'\n", exitMsg)
fmt.Printf("mint: state=exited version=%s location='%s'\n", version.Current(), fsutil.ExeDir())
os.Exit(-777)
}
errutil.FailOn(err)

ia.dclient = client

ia.appPrompt = prompt.New(
ia.execute,
ia.complete,
Expand Down
2 changes: 1 addition & 1 deletion scripts/src.build.quick.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ BUILD_TIME="$(date -u '+%Y-%m-%d_%I:%M:%S%p')"
TAG="current"
REVISION="current"
if hash git 2>/dev/null && [ -e $BDIR/.git ]; then
TAG="$(git describe --tags)"
TAG="$(git describe --tags --always)"
REVISION="$(git rev-parse HEAD)"
fi

Expand Down

0 comments on commit bac50e0

Please sign in to comment.