feat: enabled running on windows without bash; if no bash, logs a warning that air gap won't work; we might need to do better than this
@@ -41,8 +41,6 @@ import com.synopsys.integration.detectable.detectable.result.ExecutableNotFoundD
import com.synopsys.integration.detectable.detectable.result.InspectorNotFoundDetectableResult;
import com.synopsys.integration.detectable.detectable.result.PassedDetectableResult;
import com.synopsys.integration.detectable.detectable.result.PropertyInsufficientDetectableResult;
-import com.synopsys.integration.detectable.detectable.result.WrongOperatingSystemResult;
-import com.synopsys.integration.util.OperatingSystemType;
@DetectableInfo(language = "N/A", forge = "Derived from the Linux distribution", requirementsMarkdown = "Access to a Docker Engine. See <a href='https://blackducksoftware.github.io/blackduck-docker-inspector/latest/overview/'>Docker Inspector documentation</a> for details.")
public class DockerDetectable extends Detectable {
@@ -58,8 +56,8 @@ public class DockerDetectable extends Detectable {
private File bashExe;
private DockerInspectorInfo dockerInspectorInfo;
- public DockerDetectable(final DetectableEnvironment environment, final DockerInspectorResolver dockerInspectorResolver, final JavaResolver javaResolver, final BashResolver bashResolver, final DockerResolver dockerResolver,
- final DockerExtractor dockerExtractor, final DockerDetectableOptions dockerDetectableOptions) {
+ public DockerDetectable(DetectableEnvironment environment, DockerInspectorResolver dockerInspectorResolver, JavaResolver javaResolver, BashResolver bashResolver, DockerResolver dockerResolver,
+ DockerExtractor dockerExtractor, DockerDetectableOptions dockerDetectableOptions) {
super(environment);
this.javaResolver = javaResolver;
this.bashResolver = bashResolver;
@@ -85,12 +83,12 @@ public class DockerDetectable extends Detectable {
}
bashExe = bashResolver.resolveBash();
if (bashExe == null) {
- return new ExecutableNotFoundDetectableResult("bash");
+ logger.warn("Bash executable not found. Docker Inspector will not work in air gap mode.");
}
File dockerExe;
try {
dockerExe = dockerResolver.resolveDocker();
- } catch (final Exception e) {
+ } catch (Exception e) {
dockerExe = null;
}
if (dockerExe == null) {
@@ -108,10 +106,10 @@ public class DockerDetectable extends Detectable {
}
@Override
- public Extraction extract(final ExtractionEnvironment extractionEnvironment) {
- final String image = dockerDetectableOptions.getSuppliedDockerImage().orElse("");
- final String imageId = dockerDetectableOptions.getSuppliedDockerImageId().orElse("");
- final String tar = dockerDetectableOptions.getSuppliedDockerTar().orElse("");
+ public Extraction extract(ExtractionEnvironment extractionEnvironment) {
+ String image = dockerDetectableOptions.getSuppliedDockerImage().orElse("");
+ String imageId = dockerDetectableOptions.getSuppliedDockerImageId().orElse("");
+ String tar = dockerDetectableOptions.getSuppliedDockerTar().orElse("");
return dockerExtractor.extract(environment.getDirectory(), extractionEnvironment.getOutputDirectory(), bashExe, javaExe, image, imageId, tar, dockerInspectorInfo,
new DockerProperties(dockerDetectableOptions)); //TODO, doesn't feel right to construct properties here. -jp
}
