Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/3140/better error message on mixin missing #3145

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion pkg/linter/linter.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ func (l *Linter) Lint(ctx context.Context, m *manifest.Manifest) (Results, error
return nil, span.Error(fmt.Errorf("error validating action: %s", action.name))
}
results = append(results, res...)
}
}

deps := make(map[string]interface{}, len(m.Dependencies.Requires))
for _, dep := range m.Dependencies.Requires {
Expand Down Expand Up @@ -247,6 +247,10 @@ func (l *Linter) Lint(ctx context.Context, m *manifest.Manifest) (Results, error
if strings.Contains(response.Error.Error(), "unknown command") {
continue
}
// put a helpful error when the mixin is not installed
if strings.Contains(response.Error.Error(), "not installed") {
return nil, span.Error(fmt.Errorf("mixin %[1]s is not currently installed. To find view more details you can run: porter mixin search %[1]s. To install you can run porter mixin install %[1]s", response.Name))
}
return nil, span.Error(fmt.Errorf("lint command failed for mixin %s: %s", response.Name, response.Stdout))
}

Expand Down
Loading