@@ -32,7 +32,6 @@ import (
32
32
"strings"
33
33
"text/template"
34
34
35
- "github.com/containerd/stargz-snapshotter/estargz"
36
35
"github.com/google/go-containerregistry/pkg/name"
37
36
v1 "github.com/google/go-containerregistry/pkg/v1"
38
37
"github.com/google/go-containerregistry/pkg/v1/empty"
@@ -394,7 +393,7 @@ func writeSBOM(sbom []byte, appFileName, dir, ext string) error {
394
393
}
395
394
sbomPath := filepath .Join (sbomDir , appFileName + "." + ext )
396
395
log .Printf ("Writing SBOM to %s" , sbomPath )
397
- return os .WriteFile (sbomPath , sbom , 0644 )
396
+ return os .WriteFile (sbomPath , sbom , 0644 ) //nolint:gosec
398
397
}
399
398
return nil
400
399
}
@@ -956,10 +955,7 @@ func buildLayer(appPath, file string, platform *v1.Platform, layerMediaType type
956
955
binaryLayerBytes := binaryLayerBuf .Bytes ()
957
956
return tarball .LayerFromOpener (func () (io.ReadCloser , error ) {
958
957
return io .NopCloser (bytes .NewBuffer (binaryLayerBytes )), nil
959
- }, tarball .WithCompressedCaching , tarball .WithEstargzOptions (estargz .WithPrioritizedFiles ([]string {
960
- // When using estargz, prioritize downloading the binary entrypoint.
961
- appPath ,
962
- })), tarball .WithMediaType (layerMediaType ))
958
+ }, tarball .WithCompressedCaching , tarball .WithMediaType (layerMediaType ))
963
959
}
964
960
965
961
// Append appPath to the PATH environment variable, if it exists. Otherwise,
@@ -1226,18 +1222,15 @@ func (pm *platformMatcher) matches(base *v1.Platform) bool {
1226
1222
if p .OS != "windows" {
1227
1223
// osversion mismatch is only possibly allowed when os == windows.
1228
1224
continue
1229
- } else {
1230
- if pcount , bcount := strings .Count (p .OSVersion , "." ), strings .Count (base .OSVersion , "." ); pcount == 2 && bcount == 3 {
1231
- if p .OSVersion != base .OSVersion [:strings .LastIndex (base .OSVersion , "." )] {
1232
- // If requested osversion is X.Y.Z and potential match is X.Y.Z.A, all of X.Y.Z must match.
1233
- // Any other form of these osversions are not a match.
1234
- continue
1235
- }
1236
- } else {
1237
- // Partial osversion matching only allows X.Y.Z to match X.Y.Z.A.
1225
+ }
1226
+ if pcount , bcount := strings .Count (p .OSVersion , "." ), strings .Count (base .OSVersion , "." ); pcount == 2 && bcount == 3 {
1227
+ if p .OSVersion != base .OSVersion [:strings .LastIndex (base .OSVersion , "." )] {
1228
+ // If requested osversion is X.Y.Z and potential match is X.Y.Z.A, all of X.Y.Z must match.
1229
+ // Any other form of these osversions are not a match.
1238
1230
continue
1239
1231
}
1240
1232
}
1233
+ // Otherwise, partial osversion matching only allows X.Y.Z to match X.Y.Z.A.
1241
1234
}
1242
1235
return true
1243
1236
}
0 commit comments