From 7341b4624d2314690b70b29ab8e54106a520eef4 Mon Sep 17 00:00:00 2001 From: Ralph Bean Date: Mon, 29 Apr 2024 16:24:53 -0400 Subject: [PATCH] fix: log during syft step I found that the syft step may take a non-negligble amount of time in my builds. Currently, it emits nothing to stdout, so it can feel like your build is stuck doing nothing. By printing here, the user will get a clue as to what is happening. Signed-off-by: Ralph Bean --- task/buildah-remote/0.1/buildah-remote.yaml | 2 ++ task/buildah/0.1/buildah.yaml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/task/buildah-remote/0.1/buildah-remote.yaml b/task/buildah-remote/0.1/buildah-remote.yaml index 0899981cf8..c308931d80 100644 --- a/task/buildah-remote/0.1/buildah-remote.yaml +++ b/task/buildah-remote/0.1/buildah-remote.yaml @@ -364,8 +364,10 @@ spec: image: quay.io/redhat-appstudio/syft:v0.105.1@sha256:1910b829997650c696881e5fc2fc654ddf3184c27edb1b2024e9cb2ba51ac431 name: sbom-syft-generate script: | + echo "Running syft on the source directory" syft dir:$(workspaces.source.path)/source --output cyclonedx-json=$(workspaces.source.path)/sbom-source.json find $(cat /workspace/container_path) -xtype l -delete + echo "Running syft on the image filesystem" syft dir:$(cat /workspace/container_path) --output cyclonedx-json=$(workspaces.source.path)/sbom-image.json volumeMounts: - mountPath: /var/lib/containers diff --git a/task/buildah/0.1/buildah.yaml b/task/buildah/0.1/buildah.yaml index 4e0e53b9d5..9cc7b365e2 100644 --- a/task/buildah/0.1/buildah.yaml +++ b/task/buildah/0.1/buildah.yaml @@ -282,8 +282,10 @@ spec: # (need to set the workdir, see https://github.com/anchore/syft/issues/2465) workingDir: $(workspaces.source.path)/source script: | + echo "Running syft on the source directory" syft dir:$(workspaces.source.path)/source --output cyclonedx-json=$(workspaces.source.path)/sbom-source.json find $(cat /workspace/container_path) -xtype l -delete + echo "Running syft on the image filesystem" syft dir:$(cat /workspace/container_path) --output cyclonedx-json=$(workspaces.source.path)/sbom-image.json volumeMounts: - mountPath: /var/lib/containers