-
Notifications
You must be signed in to change notification settings - Fork 27
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
🐛 Handle missing containerless-deps #349
Conversation
Missing container-kantra-deps setup caused kantra analyze-bin command segfault. Adding check and error message to fail nicely. Related to: konveyor#338 Signed-off-by: Marek Aufart <[email protected]>
cmd/analyze-bin.go
Outdated
path := filepath.Join(b.homeKantraDir, RulesetsLocation) | ||
path := filepath.Join(b.homeKantraDir, "rulesets") | ||
if _, err := os.Stat(path); os.IsNotExist(err) { | ||
b.log.Error(err, "cannot find ruleset, ensure containerless-kantra-deps are in place") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets change this to specifically mention that we can't find the rulesets directory. Then add validation for the other deps
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, will make this logic more specific and move most of it to the command validation function.
Signed-off-by: Marek Aufart <[email protected]>
requiredDirs := []string{b.homeKantraDir, filepath.Join(b.homeKantraDir, "rulesets"), filepath.Join(b.homeKantraDir, JavaBundlesLocation), filepath.Join(b.homeKantraDir, JDTLSBinLocation)} | ||
for _, path := range requiredDirs { | ||
if _, err := os.Stat(path); os.IsNotExist(err) { | ||
b.log.Error(err, "cannot open required path, ensure that container-less dependencies are installed") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Example error messages for missing rulesets:
ERRO[0000] cannot open required path, ensure that container-less dependencies are installed error="stat /home/.../.kantra/rulesets: no such file or directory"
Signed-off-by: Marek Aufart <[email protected]>
Thank you! |
Missing container-kantra-deps setup caused kantra analyze-bin command failure (details below). Appears when someone skips README step cloning and moving https://github.com/eemcmullan/containerless-kantra-deps.git to
~/.kantra
Adding check and error message to fail nicely.
Related to: #338