Skip to content

Commit

Permalink
probe command, probe refactoring, urfave update
Browse files Browse the repository at this point in the history
Signed-off-by: Kyle Quest <[email protected]>
  • Loading branch information
kcq committed Feb 8, 2024
1 parent dc27332 commit 965a82e
Show file tree
Hide file tree
Showing 80 changed files with 7,741 additions and 1,523 deletions.
5 changes: 3 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ require (
github.com/slimtoolkit/go-update v0.0.0-20231119011834-99945ebd76f7
github.com/slimtoolkit/uiprogress v0.0.0-20231119012247-4a052fb12f37
github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635
github.com/urfave/cli/v2 v2.3.0
github.com/urfave/cli/v2 v2.27.1
golang.org/x/crypto v0.17.0
golang.org/x/net v0.18.0
golang.org/x/sys v0.15.0
Expand All @@ -45,7 +45,7 @@ require (
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/bradfitz/iter v0.0.0-20191230175014-e8f45d346db8 // indirect
github.com/containerd/stargz-snapshotter/estargz v0.14.3 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.3 // indirect
github.com/distribution/distribution/v3 v3.0.0-20210316161203-a01c71e2477e // indirect
github.com/docker/cli v24.0.0+incompatible // indirect
github.com/docker/distribution v2.8.2+incompatible // indirect
Expand Down Expand Up @@ -99,6 +99,7 @@ require (
github.com/ulyssessouza/godotenv v1.3.1-0.20210806120901-e417b721114e // indirect
github.com/vbatts/tar-split v0.11.3 // indirect
github.com/xlab/treeprint v1.1.0 // indirect
github.com/xrash/smetrics v0.0.0-20231213231151-1d8dd44e695e // indirect
go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5 // indirect
golang.org/x/mod v0.14.0 // indirect
golang.org/x/oauth2 v0.10.0 // indirect
Expand Down
8 changes: 8 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ github.com/containerd/stargz-snapshotter/estargz v0.14.3/go.mod h1:KY//uOCIkSuNA
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w=
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/cpuguy83/go-md2man/v2 v2.0.3 h1:qMCsGGgs+MAzDFyp9LpAe1Lqy/fY/qCovCm0qnXZOBM=
github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY=
github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4=
Expand Down Expand Up @@ -330,6 +332,8 @@ github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
github.com/russross/blackfriday v1.6.0 h1:KqfZb0pUVN2lYqZUYRddxF4OR8ZMURnJIG5Y3VRLtww=
github.com/russross/blackfriday v1.6.0/go.mod h1:ti0ldHuxg49ri4ksnFxlkCfN+hvslNlmVHqNRXXJNAY=
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
Expand Down Expand Up @@ -390,13 +394,17 @@ github.com/ulyssessouza/godotenv v1.3.1-0.20210806120901-e417b721114e/go.mod h1:
github.com/urfave/cli v1.22.12/go.mod h1:sSBEIC79qR6OvcmsD4U3KABeOTxDqQtdDnaFuUN30b8=
github.com/urfave/cli/v2 v2.3.0 h1:qph92Y649prgesehzOrQjdWyxFOp/QVM+6imKHad91M=
github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI=
github.com/urfave/cli/v2 v2.27.1 h1:8xSQ6szndafKVRmfyeUMxkNUJQMjL1F2zmsZ+qHpfho=
github.com/urfave/cli/v2 v2.27.1/go.mod h1:8qnjx1vcq5s2/wpsqoZFndg2CE5tNFyrTvS6SinrnYQ=
github.com/vbatts/tar-split v0.11.3 h1:hLFqsOLQ1SsppQNTMpkpPXClLDfC2A3Zgy9OUU+RVck=
github.com/vbatts/tar-split v0.11.3/go.mod h1:9QlHN18E+fEH7RdG+QAJJcuya3rqT7eXSTY7wGrAokY=
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ=
github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y=
github.com/xlab/treeprint v1.1.0 h1:G/1DjNkPpfZCFt9CSh6b5/nY4VimlbHF3Rh4obvtzDk=
github.com/xlab/treeprint v1.1.0/go.mod h1:gj5Gd3gPdKtR1ikdDK6fnFLdmIS0X30kTTuNd/WEJu0=
github.com/xrash/smetrics v0.0.0-20231213231151-1d8dd44e695e h1:+SOyEddqYF09QP7vr7CgJ1eti3pY9Fn3LHO1M1r/0sI=
github.com/xrash/smetrics v0.0.0-20231213231151-1d8dd44e695e/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
Expand Down
8 changes: 4 additions & 4 deletions pkg/app/master/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"github.com/slimtoolkit/slim/pkg/app/master/command/install"
"github.com/slimtoolkit/slim/pkg/app/master/command/lint"
"github.com/slimtoolkit/slim/pkg/app/master/command/merge"
//"github.com/slimtoolkit/slim/pkg/app/master/command/probe"
"github.com/slimtoolkit/slim/pkg/app/master/command/probe"
"github.com/slimtoolkit/slim/pkg/app/master/command/profile"
"github.com/slimtoolkit/slim/pkg/app/master/command/registry"
"github.com/slimtoolkit/slim/pkg/app/master/command/run"
Expand All @@ -47,9 +47,10 @@ func registerCommands() {
//registering commands explicitly instead of relying on init()
//also get to control the order of the commands in the interactive prompt

debug.RegisterCommand()
build.RegisterCommand()
xray.RegisterCommand()
lint.RegisterCommand()
build.RegisterCommand()
merge.RegisterCommand()
images.RegisterCommand()
registry.RegisterCommand()
Expand All @@ -61,11 +62,10 @@ func registerCommands() {
update.RegisterCommand()
install.RegisterCommand()
//edit.RegisterCommand() - not doing anything yet
//probe.RegisterCommand() - not doing anything yet
probe.RegisterCommand()
//convert.RegisterCommand() - not doing anything yet
run.RegisterCommand()
//server.RegisterCommand() - not doing anything yet
debug.RegisterCommand()
//containerize.RegisterCommand() - not doing anything yet
dockerclipm.RegisterCommand()
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/app/master/command/build/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ var CLI = &cli.Command{

doPublishExposedPorts := ctx.Bool(command.FlagPublishExposedPorts)

httpProbeOpts := command.GetHTTPProbeOptions(xc, ctx)
httpProbeOpts := command.GetHTTPProbeOptions(xc, ctx, false)

continueAfter, err := command.GetContinueAfter(ctx)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/app/master/command/build/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (
"github.com/slimtoolkit/slim/pkg/app/master/config"
"github.com/slimtoolkit/slim/pkg/app/master/inspectors/container"
"github.com/slimtoolkit/slim/pkg/app/master/inspectors/image"
"github.com/slimtoolkit/slim/pkg/app/master/inspectors/probes/http"
"github.com/slimtoolkit/slim/pkg/app/master/kubernetes"
"github.com/slimtoolkit/slim/pkg/app/master/probe/http"
"github.com/slimtoolkit/slim/pkg/app/master/version"
cmd "github.com/slimtoolkit/slim/pkg/command"
"github.com/slimtoolkit/slim/pkg/consts"
Expand Down
2 changes: 1 addition & 1 deletion pkg/app/master/command/build/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import (
"github.com/slimtoolkit/slim/pkg/app/master/config"
"github.com/slimtoolkit/slim/pkg/app/master/inspectors/image"
"github.com/slimtoolkit/slim/pkg/app/master/inspectors/pod"
"github.com/slimtoolkit/slim/pkg/app/master/inspectors/probes/http"
"github.com/slimtoolkit/slim/pkg/app/master/kubernetes"
"github.com/slimtoolkit/slim/pkg/app/master/probe/http"
"github.com/slimtoolkit/slim/pkg/report"
"github.com/slimtoolkit/slim/pkg/util/errutil"
"github.com/slimtoolkit/slim/pkg/util/fsutil"
Expand Down
9 changes: 7 additions & 2 deletions pkg/app/master/command/cliflags.go
Original file line number Diff line number Diff line change
Expand Up @@ -927,17 +927,22 @@ func Cflag(name string) cli.Flag {
}

func HTTPProbeFlags() []cli.Flag {
return []cli.Flag{
return append([]cli.Flag{
Cflag(FlagHTTPProbeOff),
Cflag(FlagHTTPProbe),
Cflag(FlagHTTPProbeExitOnFailure),
}, HTTPProbeFlagsBasic()...)
}

func HTTPProbeFlagsBasic() []cli.Flag {
return []cli.Flag{
Cflag(FlagHTTPProbeCmd),
Cflag(FlagHTTPProbeCmdFile),
Cflag(FlagHTTPProbeStartWait),
Cflag(FlagHTTPProbeRetryCount),
Cflag(FlagHTTPProbeRetryWait),
Cflag(FlagHTTPProbePorts),
Cflag(FlagHTTPProbeFull),
Cflag(FlagHTTPProbeExitOnFailure),
Cflag(FlagHTTPProbeCrawl),
Cflag(FlagHTTPCrawlMaxDepth),
Cflag(FlagHTTPCrawlMaxPageCount),
Expand Down
13 changes: 9 additions & 4 deletions pkg/app/master/command/clifvgetter.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,9 @@ func GetContainerRunOptions(ctx *cli.Context) (*config.ContainerRunOptions, erro
return &cro, nil
}

func GetHTTPProbeOptions(xc *app.ExecutionContext, ctx *cli.Context) config.HTTPProbeOptions {
func GetHTTPProbeOptions(xc *app.ExecutionContext, ctx *cli.Context, doProbe bool) config.HTTPProbeOptions {
opts := config.HTTPProbeOptions{
Do: ctx.Bool(FlagHTTPProbe) && !ctx.Bool(FlagHTTPProbeOff),
Full: ctx.Bool(FlagHTTPProbeFull),
ExitOnFailure: ctx.Bool(FlagHTTPProbeExitOnFailure),
Full: ctx.Bool(FlagHTTPProbeFull),

StartWait: ctx.Int(FlagHTTPProbeStartWait),
RetryCount: ctx.Int(FlagHTTPProbeRetryCount),
Expand All @@ -70,6 +68,13 @@ func GetHTTPProbeOptions(xc *app.ExecutionContext, ctx *cli.Context) config.HTTP
CrawlConcurrencyMax: ctx.Int(FlagHTTPMaxConcurrentCrawlers),
}

if doProbe {
opts.Do = true
} else {
opts.Do = ctx.Bool(FlagHTTPProbe) && !ctx.Bool(FlagHTTPProbeOff)
opts.ExitOnFailure = ctx.Bool(FlagHTTPProbeExitOnFailure)
}

cmds, err := GetHTTPProbes(ctx)
if err != nil {
xc.Out.Error("param.http.probe", err.Error())
Expand Down
28 changes: 20 additions & 8 deletions pkg/app/master/command/probe/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,28 +19,40 @@ var CLI = &cli.Command{
Name: Name,
Aliases: []string{Alias},
Usage: Usage,
Flags: append([]cli.Flag{
cflag(FlagTarget),
cflag(FlagPort),
}, command.HTTPProbeFlagsBasic()...),
Action: func(ctx *cli.Context) error {
gcvalues := command.GlobalFlagValues(ctx)
gparams, ok := command.CLIContextGet(ctx.Context, command.GlobalParams).(*command.GenericParams)
if !ok || gparams == nil {
return command.ErrNoGlobalParams
}

xc := app.NewExecutionContext(
Name,
gcvalues.QuietCLIMode,
gcvalues.OutputFormat)
gparams.QuietCLIMode,
gparams.OutputFormat)

targetRef := ctx.String(command.FlagTarget)
if targetRef == "" {
targetEndpoint := ctx.String(FlagTarget)
if targetEndpoint == "" {
if ctx.Args().Len() < 1 {
xc.Out.Error("param.target", "missing target")
cli.ShowCommandHelp(ctx, Name)
return nil
} else {
targetRef = ctx.Args().First()
targetEndpoint = ctx.Args().First()
}
}

httpProbeOpts := command.GetHTTPProbeOptions(xc, ctx, true)
targetPorts := ctx.UintSlice(FlagPort)
OnCommand(
xc,
gcvalues,
targetRef)
gparams,
targetEndpoint,
targetPorts,
httpProbeOpts)

return nil
},
Expand Down
40 changes: 40 additions & 0 deletions pkg/app/master/command/probe/flags.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package probe

import (
log "github.com/sirupsen/logrus"
"github.com/urfave/cli/v2"
)

// Probe command flag names and usage descriptions
const (
FlagTarget = "target"
FlagTargetUsage = "Target endpoint to probe"

//for now just TCP ports (so no FlagProto for now)
FlagPort = "port"
FlagPortUsage = "Endpoint port to probe"
)

var Flags = map[string]cli.Flag{
FlagTarget: &cli.StringFlag{
Name: FlagTarget,
Value: "",
Usage: FlagTargetUsage,
EnvVars: []string{"DSLIM_PRB_TARGET"},
},
FlagPort: &cli.UintSliceFlag{
Name: FlagPort,
Value: cli.NewUintSlice(),
Usage: FlagPortUsage,
EnvVars: []string{"DSLIM_PRB_PORT"},
},
}

func cflag(name string) cli.Flag {
cf, ok := Flags[name]
if !ok {
log.Fatalf("unknown flag='%s'", name)
}

return cf
}
27 changes: 24 additions & 3 deletions pkg/app/master/command/probe/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import (

"github.com/slimtoolkit/slim/pkg/app"
"github.com/slimtoolkit/slim/pkg/app/master/command"
"github.com/slimtoolkit/slim/pkg/app/master/config"
"github.com/slimtoolkit/slim/pkg/app/master/probe/http"
"github.com/slimtoolkit/slim/pkg/app/master/version"
cmd "github.com/slimtoolkit/slim/pkg/command"
"github.com/slimtoolkit/slim/pkg/docker/dockerclient"
Expand All @@ -24,7 +26,10 @@ type ovars = app.OutVars
func OnCommand(
xc *app.ExecutionContext,
gparams *command.GenericParams,
targetRef string) {
targetEndpoint string,
targetPorts []uint,
httpProbeOpts config.HTTPProbeOptions) {
printState := true
logger := log.WithFields(log.Fields{"app": appName, "cmd": Name})
cmdName := fmt.Sprintf("cmd=%s", Name)

Expand All @@ -36,7 +41,7 @@ func OnCommand(
xc.Out.State(cmd.StateStarted)
xc.Out.Info("params",
ovars{
"target": targetRef,
"target": targetEndpoint,
})

client, err := dockerclient.New(gparams.ClientConfig)
Expand All @@ -51,7 +56,7 @@ func OnCommand(
"message": exitMsg,
})

exitCode := command.ECTCommon | command.ECCNoDockerConnectInfo
exitCode := -222
xc.Out.State("exited",
ovars{
"exit.code": exitCode,
Expand All @@ -66,6 +71,22 @@ func OnCommand(
version.Print(xc, cmdName, logger, client, false, gparams.InContainer, gparams.IsDSImage)
}

probe, err := http.NewEndpointProbe(xc, targetEndpoint, targetPorts, httpProbeOpts, printState)
xc.FailOn(err)

probe.Start()

xc.Out.Prompt("waiting for the HTTP probe to finish")
<-probe.DoneChan()
xc.Out.Info("event",
ovars{
"message": "HTTP probe is done",
})

if probe != nil && probe.CallCount > 0 && probe.OkCount == 0 {
xc.Out.Error("probe.error", "no.successful.calls")
}

xc.Out.State(cmd.StateCompleted)
cmdReport.State = cmd.StateCompleted
xc.Out.State(cmd.StateDone)
Expand Down
30 changes: 30 additions & 0 deletions pkg/app/master/command/probe/prompt.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,39 @@ package probe

import (
"github.com/c-bata/go-prompt"

"github.com/slimtoolkit/slim/pkg/app/master/command"
)

var CommandSuggestion = prompt.Suggest{
Text: Name,
Description: Usage,
}

var CommandFlagSuggestions = &command.FlagSuggestions{
Names: []prompt.Suggest{
{Text: command.FullFlagName(FlagTarget), Description: FlagTargetUsage},
{Text: command.FullFlagName(FlagPort), Description: FlagPortUsage},
{Text: command.FullFlagName(command.FlagHTTPProbeCmd), Description: command.FlagHTTPProbeCmdUsage},
{Text: command.FullFlagName(command.FlagHTTPProbeCmdFile), Description: command.FlagHTTPProbeCmdFileUsage},
{Text: command.FullFlagName(command.FlagHTTPProbeStartWait), Description: command.FlagHTTPProbeStartWaitUsage},
{Text: command.FullFlagName(command.FlagHTTPProbeRetryCount), Description: command.FlagHTTPProbeRetryCountUsage},
{Text: command.FullFlagName(command.FlagHTTPProbeRetryWait), Description: command.FlagHTTPProbeRetryWaitUsage},
{Text: command.FullFlagName(command.FlagHTTPProbePorts), Description: command.FlagHTTPProbePortsUsage},
{Text: command.FullFlagName(command.FlagHTTPProbeFull), Description: command.FlagHTTPProbeFullUsage},
{Text: command.FullFlagName(command.FlagHTTPProbeExitOnFailure), Description: command.FlagHTTPProbeExitOnFailureUsage},
{Text: command.FullFlagName(command.FlagHTTPProbeCrawl), Description: command.FlagHTTPProbeCrawlUsage},
{Text: command.FullFlagName(command.FlagHTTPCrawlMaxDepth), Description: command.FlagHTTPCrawlMaxDepthUsage},
{Text: command.FullFlagName(command.FlagHTTPCrawlMaxPageCount), Description: command.FlagHTTPCrawlMaxPageCountUsage},
{Text: command.FullFlagName(command.FlagHTTPCrawlConcurrency), Description: command.FlagHTTPCrawlConcurrencyUsage},
{Text: command.FullFlagName(command.FlagHTTPMaxConcurrentCrawlers), Description: command.FlagHTTPMaxConcurrentCrawlersUsage},
{Text: command.FullFlagName(command.FlagHTTPProbeAPISpec), Description: command.FlagHTTPProbeAPISpecUsage},
{Text: command.FullFlagName(command.FlagHTTPProbeAPISpecFile), Description: command.FlagHTTPProbeAPISpecFileUsage},
},
Values: map[string]command.CompleteValue{
command.FullFlagName(command.FlagHTTPProbeCmdFile): command.CompleteFile,
command.FullFlagName(command.FlagHTTPProbeFull): command.CompleteBool,
command.FullFlagName(command.FlagHTTPProbeCrawl): command.CompleteTBool,
command.FullFlagName(command.FlagHTTPProbeAPISpecFile): command.CompleteFile,
},
}
2 changes: 1 addition & 1 deletion pkg/app/master/command/probe/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ func RegisterCommand() {
Name,
CLI,
CommandSuggestion,
nil)
CommandFlagSuggestions)
}
2 changes: 1 addition & 1 deletion pkg/app/master/command/profile/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ var CLI = &cli.Command{

doPublishExposedPorts := ctx.Bool(command.FlagPublishExposedPorts)

httpProbeOpts := command.GetHTTPProbeOptions(xc, ctx)
httpProbeOpts := command.GetHTTPProbeOptions(xc, ctx, false)

continueAfter, err := command.GetContinueAfter(ctx)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/app/master/command/profile/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
"github.com/slimtoolkit/slim/pkg/app/master/config"
"github.com/slimtoolkit/slim/pkg/app/master/inspectors/container"
"github.com/slimtoolkit/slim/pkg/app/master/inspectors/image"
"github.com/slimtoolkit/slim/pkg/app/master/inspectors/probes/http"
"github.com/slimtoolkit/slim/pkg/app/master/probe/http"
"github.com/slimtoolkit/slim/pkg/app/master/version"
cmd "github.com/slimtoolkit/slim/pkg/command"
"github.com/slimtoolkit/slim/pkg/docker/dockerclient"
Expand Down
Loading

0 comments on commit 965a82e

Please sign in to comment.