@Test public void should_use_classpath_locator_by_default() { final LocationResolverChain locationResolverChain = new LocationResolverChain(); final LocationResolver locationResolver = locationResolverChain.getLocationResolver(new BuildahConfiguration()); assertThat(locationResolver) .isInstanceOf(ClasspathLocationResolver.class); }
public LocationResolver getLocationResolver(BuildahConfiguration buildahConfiguration) { final String buildahBinary = this.operatingSystemConfig.resolveBinary(BUILDAH_BINARY_FORMAT); final String runcBinary = this.operatingSystemConfig.resolveBinary(RUNC_BINARY_FORMAT); if (System.getProperty(BUILDAH_VERSION) != null && System.getProperty(RUNC_VERSION) != null) { return getUrlLocationResolver(buildahBinary, System.getProperty(BUILDAH_VERSION), runcBinary, System.getProperty(RUNC_VERSION)); } if (buildahConfiguration.isBuildahVersionSet() && buildahConfiguration.isRuncVersionSet()) { return getUrlLocationResolver(buildahBinary, buildahConfiguration.getBuildahVersion(), runcBinary, buildahConfiguration.getRuncVersion()); } return getClasspathLocationResolver(buildahBinary, runcBinary); }
LocationResolverChain { public LocationResolver getLocationResolver(BuildahConfiguration buildahConfiguration) { final String buildahBinary = this.operatingSystemConfig.resolveBinary(BUILDAH_BINARY_FORMAT); final String runcBinary = this.operatingSystemConfig.resolveBinary(RUNC_BINARY_FORMAT); if (System.getProperty(BUILDAH_VERSION) != null && System.getProperty(RUNC_VERSION) != null) { return getUrlLocationResolver(buildahBinary, System.getProperty(BUILDAH_VERSION), runcBinary, System.getProperty(RUNC_VERSION)); } if (buildahConfiguration.isBuildahVersionSet() && buildahConfiguration.isRuncVersionSet()) { return getUrlLocationResolver(buildahBinary, buildahConfiguration.getBuildahVersion(), runcBinary, buildahConfiguration.getRuncVersion()); } return getClasspathLocationResolver(buildahBinary, runcBinary); } }
LocationResolverChain { public LocationResolver getLocationResolver(BuildahConfiguration buildahConfiguration) { final String buildahBinary = this.operatingSystemConfig.resolveBinary(BUILDAH_BINARY_FORMAT); final String runcBinary = this.operatingSystemConfig.resolveBinary(RUNC_BINARY_FORMAT); if (System.getProperty(BUILDAH_VERSION) != null && System.getProperty(RUNC_VERSION) != null) { return getUrlLocationResolver(buildahBinary, System.getProperty(BUILDAH_VERSION), runcBinary, System.getProperty(RUNC_VERSION)); } if (buildahConfiguration.isBuildahVersionSet() && buildahConfiguration.isRuncVersionSet()) { return getUrlLocationResolver(buildahBinary, buildahConfiguration.getBuildahVersion(), runcBinary, buildahConfiguration.getRuncVersion()); } return getClasspathLocationResolver(buildahBinary, runcBinary); } LocationResolverChain(); }
LocationResolverChain { public LocationResolver getLocationResolver(BuildahConfiguration buildahConfiguration) { final String buildahBinary = this.operatingSystemConfig.resolveBinary(BUILDAH_BINARY_FORMAT); final String runcBinary = this.operatingSystemConfig.resolveBinary(RUNC_BINARY_FORMAT); if (System.getProperty(BUILDAH_VERSION) != null && System.getProperty(RUNC_VERSION) != null) { return getUrlLocationResolver(buildahBinary, System.getProperty(BUILDAH_VERSION), runcBinary, System.getProperty(RUNC_VERSION)); } if (buildahConfiguration.isBuildahVersionSet() && buildahConfiguration.isRuncVersionSet()) { return getUrlLocationResolver(buildahBinary, buildahConfiguration.getBuildahVersion(), runcBinary, buildahConfiguration.getRuncVersion()); } return getClasspathLocationResolver(buildahBinary, runcBinary); } LocationResolverChain(); LocationResolver getLocationResolver(BuildahConfiguration buildahConfiguration); }
LocationResolverChain { public LocationResolver getLocationResolver(BuildahConfiguration buildahConfiguration) { final String buildahBinary = this.operatingSystemConfig.resolveBinary(BUILDAH_BINARY_FORMAT); final String runcBinary = this.operatingSystemConfig.resolveBinary(RUNC_BINARY_FORMAT); if (System.getProperty(BUILDAH_VERSION) != null && System.getProperty(RUNC_VERSION) != null) { return getUrlLocationResolver(buildahBinary, System.getProperty(BUILDAH_VERSION), runcBinary, System.getProperty(RUNC_VERSION)); } if (buildahConfiguration.isBuildahVersionSet() && buildahConfiguration.isRuncVersionSet()) { return getUrlLocationResolver(buildahBinary, buildahConfiguration.getBuildahVersion(), runcBinary, buildahConfiguration.getRuncVersion()); } return getClasspathLocationResolver(buildahBinary, runcBinary); } LocationResolverChain(); LocationResolver getLocationResolver(BuildahConfiguration buildahConfiguration);  }