@@ -53,16 +53,14 @@ func (rabib *RemoteAgentBuildInfoBuilder) Build(module string) (*buildinfo.Build
5353// Search for image manifest and layers in Artifactory.
5454func (rabib * RemoteAgentBuildInfoBuilder ) handleManifest (resultMap map [string ]* utils.ResultItem ) (map [string ]* utils.ResultItem , * manifest , error ) {
5555 if manifest , ok := resultMap ["manifest.json" ]; ok {
56- err := rabib .isVerifiedManifest (manifest )
57- if err != nil {
58- return nil , nil , err
59-
56+ if ! rabib .isVerifiedManifest (manifest ) {
57+ log .Debug ("Manifest verification failed, continuing with SHA-based validation..." )
6058 }
6159 manifest , err := getManifest (resultMap , rabib .buildInfoBuilder .serviceManager , rabib .buildInfoBuilder .repositoryDetails .key )
6260 if err != nil {
6361 return nil , nil , err
6462 }
65- // // Manifest may hold 'empty layers'. As a result, promotion will fail to promote the same layer more than once.
63+ // Manifest may hold 'empty layers'. As a result, promotion will fail to promote the same layer more than once.
6664 rabib .buildInfoBuilder .imageSha2 = manifest .Config .Digest
6765 log .Debug ("Found manifest.json. Proceeding to create build-info." )
6866 return resultMap , manifest , nil
@@ -134,16 +132,15 @@ func (rabib *RemoteAgentBuildInfoBuilder) searchImage() (resultMap map[string]*u
134132 return nil , errorutils .CheckErrorf (imageNotFoundErrorMessage , rabib .buildInfoBuilder .image .name )
135133}
136134
137- // Verify manifest's sha256. If there is no match, return nil .
138- func (rabib * RemoteAgentBuildInfoBuilder ) isVerifiedManifest (imageManifest * utils.ResultItem ) error {
135+ // Verify manifest's sha256. Returns true if manifest is verified, false otherwise .
136+ func (rabib * RemoteAgentBuildInfoBuilder ) isVerifiedManifest (imageManifest * utils.ResultItem ) bool {
139137 if imageManifest .GetProperty ("docker.manifest.digest" ) != rabib .manifestSha2 {
140138 manifestDigest := imageManifest .GetProperty ("docker.manifest.digest" )
141139 log .Warn ("Manifest digest mismatch detected. Local image digest: " + rabib .manifestSha2 + ", Repository digest: " + manifestDigest )
142140 log .Info ("Proceeding with SHA-based validation to ensure correct image identification..." )
143- // Return nil instead of error to allow the operation to continue
144- return nil
141+ return false
145142 }
146- return nil
143+ return true
147144}
148145
149146func getFatManifestRoot (fatManifestPath string ) string {
0 commit comments