Skip to content

Commit

Permalink
feat: Display links to installation instructions for missing dependen…
Browse files Browse the repository at this point in the history
…cies, resolves #128 (#129)
  • Loading branch information
alexlokshin-czi authored Mar 1, 2022
1 parent 2784bc9 commit 172d22d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pkg/backend/aws/COVERAGE
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.8
7.7
2 changes: 1 addition & 1 deletion pkg/backend/aws/testbackend/COVERAGE
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.4
0.5
10 changes: 5 additions & 5 deletions pkg/util/preconditions.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func ValidateEnvironment(ctx context.Context) error {
if !valid {
errs = multierror.Append(
errs,
errors.Errorf("docker compose >= V2 required but %s was detected", version),
errors.Errorf("docker compose >= V2 required but %s was detected, please follow https://docs.docker.com/compose/cli-command/", version),
)
for _, reason := range reasons {
errs = multierror.Append(errs, reason)
Expand All @@ -44,22 +44,22 @@ func ValidateEnvironment(ctx context.Context) error {

_, err = exec.LookPath("aws")
if err != nil {
errs = multierror.Append(errs, errors.Wrap(err, "could not find aws cli in path"))
errs = multierror.Append(errs, errors.Wrap(err, "could not find aws cli in path, run 'brew install awscli' or follow https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html"))
}

_, err = exec.LookPath("terraform")
if err != nil {
errs = multierror.Append(errs, errors.Wrap(err, "could not find terraform in path"))
errs = multierror.Append(errs, errors.Wrap(err, "could not find terraform cli in path, run 'brew install terraform', or follow https://learn.hashicorp.com/tutorials/terraform/install-cli"))
}

_, err = exec.LookPath("session-manager-plugin")
if err != nil {
errs = multierror.Append(errs, errors.Wrap(err, "could not find session-manager-plugin in path"))
errs = multierror.Append(errs, errors.Wrap(err, "could not find session-manager-plugin in path, run 'brew install --cask session-manager-plugin', or follow https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-install-plugin.html"))
}

client, err := client.NewClientWithOpts(client.FromEnv, client.WithAPIVersionNegotiation())
if err != nil {
errs = multierror.Append(errs, errors.Wrap(err, "docker engine is not running"))
errs = multierror.Append(errs, errors.Wrap(err, "docker engine is not running, follow https://docs.docker.com/get-docker/"))
}

_, err = client.ContainerList(ctx, types.ContainerListOptions{})
Expand Down

0 comments on commit 172d22d

Please sign in to comment.