Skip to content

Commit

Permalink
feat: updating reachable to check permission
Browse files Browse the repository at this point in the history
  • Loading branch information
ssmirr committed Feb 2, 2020
1 parent 90ba5ae commit dc1cee0
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 23 deletions.
13 changes: 8 additions & 5 deletions lib/inspect/checks/reachable.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,25 @@ class reachableCheck extends Check {
let results = [];

for (let i = 0; i < args.length; i++) {
if ((await this.connector.pathExists(args[i], context)) || (await this.connector.isReachable(args[i], context))) {
if(!(await this.connector.pathExists(args[i], context)) && (await this.connector.isReachable(args[i], context)) == "Docker"){
let permission = args[i].permission || '';
let path = args[i].path || args[i];

if ((await this.connector.pathExists(path, permission, context)) || (await this.connector.isReachable(path, context))) {
if(!(await this.connector.pathExists(path, permission, context)) && (await this.connector.isReachable(path, context)) == "Docker"){
results.push({
resource: args[i],
resource: path,
status: "Docker Connector does not support reachable checks for the argument provided",
});
}
else{
results.push({
resource: args[i],
resource: path,
status: true,
});
}
} else {
results.push({
resource: args[i],
resource: path,
status: false,
});
}
Expand Down
36 changes: 18 additions & 18 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit dc1cee0

Please sign in to comment.