diff --git a/images/kubectl-build-deploy-dind/build-deploy-docker-compose.sh b/images/kubectl-build-deploy-dind/build-deploy-docker-compose.sh index d5b30618d5..4b8fab5ea6 100755 --- a/images/kubectl-build-deploy-dind/build-deploy-docker-compose.sh +++ b/images/kubectl-build-deploy-dind/build-deploy-docker-compose.sh @@ -1696,20 +1696,22 @@ patchBuildStep "${buildStartTime}" "${previousStepEnd}" "${currentStepEnd}" "${N previousStepEnd=${currentStepEnd} set -x -############################################## -### RUN sbom generation and store in configmap -############################################## +if [ "$(featureFlag INSIGHTS)" = enabled ]; then + ############################################## + ### RUN sbom generation and store in configmap + ############################################## -for IMAGE_NAME in "${!IMAGES_BUILD[@]}" -do + for IMAGE_NAME in "${!IMAGES_BUILD[@]}" + do - IMAGE_TAG="${IMAGE_TAG:-latest}" - IMAGE_FULL="${REGISTRY}/${PROJECT}/${ENVIRONMENT}/${IMAGE_NAME}:${IMAGE_TAG}" - . /kubectl-build-deploy/scripts/exec-generate-sbom-configmap.sh -done + IMAGE_TAG="${IMAGE_TAG:-latest}" + IMAGE_FULL="${REGISTRY}/${PROJECT}/${ENVIRONMENT}/${IMAGE_NAME}:${IMAGE_TAG}" + . /kubectl-build-deploy/scripts/exec-generate-sbom-configmap.sh + done -set +x -currentStepEnd="$(date +"%Y-%m-%d %H:%M:%S")" -patchBuildStep "${buildStartTime}" "${previousStepEnd}" "${currentStepEnd}" "${NAMESPACE}" "sbomCompleted" "SBOM Gathering" -previousStepEnd=${currentStepEnd} -set -x + set +x + currentStepEnd="$(date +"%Y-%m-%d %H:%M:%S")" + patchBuildStep "${buildStartTime}" "${previousStepEnd}" "${currentStepEnd}" "${NAMESPACE}" "sbomCompleted" "SBOM Gathering" + previousStepEnd=${currentStepEnd} + set -x +fi