21
21
sign_image ,
22
22
verify_signature ,
23
23
)
24
- from scripts .evergreen .release .sbom import generate_sbom , generate_sbom_for_cli
25
24
26
25
from .build_configuration import BuildConfiguration
27
26
from .build_context import BuildScenario
@@ -59,7 +58,6 @@ def pipeline_process_image(
59
58
build_configuration : BuildConfiguration ,
60
59
dockerfile_args : Dict [str , str ] = None ,
61
60
build_path : str = "." ,
62
- with_sbom : bool = True ,
63
61
):
64
62
"""Builds a Docker image with arguments defined in `args`."""
65
63
span = trace .get_current_span ()
@@ -83,46 +81,6 @@ def pipeline_process_image(
83
81
build_path = build_path ,
84
82
)
85
83
86
- if with_sbom :
87
- produce_sbom (dockerfile_args )
88
-
89
-
90
- @TRACER .start_as_current_span ("produce_sbom" )
91
- def produce_sbom (args ):
92
- span = trace .get_current_span ()
93
- if not is_running_in_evg_pipeline ():
94
- logger .info ("Skipping SBOM Generation (enabled only for EVG)" )
95
- return
96
-
97
- try :
98
- image_pull_spec = args ["quay_registry" ] + args .get ("ubi_suffix" , "" )
99
- except KeyError :
100
- logger .error (f"Could not find image pull spec. Args: { args } " )
101
- logger .error (f"Skipping SBOM generation" )
102
- return
103
-
104
- try :
105
- image_tag = args ["release_version" ]
106
- span .set_attribute ("mck.release_version" , image_tag )
107
- except KeyError :
108
- logger .error (f"Could not find image tag. Args: { args } " )
109
- logger .error (f"Skipping SBOM generation" )
110
- return
111
-
112
- image_pull_spec = f"{ image_pull_spec } :{ image_tag } "
113
- print (f"Producing SBOM for image: { image_pull_spec } args: { args } " )
114
-
115
- platform = "linux/amd64"
116
- if "platform" in args :
117
- if args ["platform" ] == "arm64" :
118
- platform = "linux/arm64"
119
- elif args ["platform" ] == "amd64" :
120
- platform = "linux/amd64"
121
- else :
122
- raise ValueError (f"Unrecognized platform in { args } . Cannot proceed with SBOM generation" )
123
-
124
- generate_sbom (image_pull_spec , platform )
125
-
126
84
127
85
def build_tests_image (build_configuration : BuildConfiguration ):
128
86
"""
@@ -338,7 +296,6 @@ def build_image_generic(
338
296
dockerfile_path = dockerfile_path ,
339
297
build_configuration = build_configuration ,
340
298
dockerfile_args = build_args ,
341
- with_sbom = False , # TODO: specify no SBOM, write folllow up tasks and todo
342
299
)
343
300
344
301
if build_configuration .sign :
0 commit comments