Skip to content
Open
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/
package org.jboss.sbomer.service.nextgen.core.dto.api;

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.ObjectNode;

/**
* Generator configuration.
Expand All @@ -27,5 +27,5 @@
* @param format Requested manifest format
* @param options Custom options for generator
*/
public record GeneratorConfig(Resources resources, String format, JsonNode options) {
public record GeneratorConfig(Resources resources, String format, ObjectNode options) {
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import org.jboss.sbomer.core.errors.ApplicationException;
import org.jboss.sbomer.core.features.sbom.utils.FileUtils;
import org.jboss.sbomer.core.features.sbom.utils.MDCUtils;
import org.jboss.sbomer.core.features.sbom.utils.ObjectMapperProvider;
import org.jboss.sbomer.service.feature.sbom.config.GenerationRequestControllerConfig;
import org.jboss.sbomer.service.feature.sbom.k8s.model.SbomGenerationPhase;
import org.jboss.sbomer.service.feature.sbom.k8s.resources.Labels;
Expand All @@ -49,7 +48,6 @@
import org.jboss.sbomer.service.nextgen.core.utils.JacksonUtils;
import org.jboss.sbomer.service.nextgen.service.EntityMapper;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonNode;

import io.fabric8.kubernetes.api.model.Duration;
Expand Down Expand Up @@ -324,19 +322,8 @@ public TaskRun desired(GenerationRecord generation) {

GenerationRequest request = JacksonUtils.parse(GenerationRequest.class, generation.request());

SyftContainerImageOptions options = null;

try {
options = ObjectMapperProvider.json()
.treeToValue(request.generator().config().options(), SyftContainerImageOptions.class);
} catch (JsonProcessingException e) {
throw new ApplicationException(
"Unexpected options provided, expected Syft generator options, but got: {}",
request.generator().config().options(),
e);
}

// SyftOptions options = (SyftOptions) request.generator().config().options();
SyftContainerImageOptions options = JacksonUtils
.parse(SyftContainerImageOptions.class, request.generator().config().options());

Duration timeout;

Expand Down
Loading