Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dependabot fixes #12

Merged
merged 2 commits into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/docker-registry-v2-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
go-version: '1.20'
go-version: '1.21'
check-latest: true
- name: Install Cosign
uses: sigstore/cosign-installer@main
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e-with-binary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
go-version: '1.20'
go-version: '1.21'
check-latest: true
- name: build sigscan and check
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/oras-registry-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
go-version: '1.20'
go-version: '1.21'
check-latest: true
- name: Install Cosign
uses: sigstore/cosign-installer@main
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: '1.20'
go-version: '1.21'
- uses: actions/checkout@v3
- name: Go Build
run: make sigscan && mv ./sigscan ./${{ matrix.SIGSCAN_TARGET }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/zot-registry-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
go-version: '1.20'
go-version: '1.21'
check-latest: true
- name: Install Cosign
uses: sigstore/cosign-installer@main
Expand Down
7 changes: 1 addition & 6 deletions cmd/sigscan/fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ type FSInspectOptions struct {
Dir string
}

func newFSInspect(ctx context.Context) *cobra.Command {
func newFSInspect(_ context.Context) *cobra.Command {

var (
outOpts *options.Output
Expand All @@ -52,7 +52,6 @@ func newFSInspect(ctx context.Context) *cobra.Command {

dirs := cmd.Flags().Args()

var err error
var out output.FSJSONOutput
out.FileSystem = strings.Join(dirs, ",")

Expand Down Expand Up @@ -194,10 +193,6 @@ func newFSInspect(ctx context.Context) *cobra.Command {
fmt.Printf("Found %d signatures out of %d entries\n", sigCount, entryCount)
}

if err != nil {
return fmt.Errorf("sigscan error: %s", err.Error())
}

return nil
},
}
Expand Down
37 changes: 10 additions & 27 deletions cmd/sigscan/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ func parseRepoPath(opts *repositoryOptions, arg string) error {
return nil
}

func newRepoInspect(ctx context.Context) *cobra.Command {
func newRepoInspect(_ context.Context) *cobra.Command {

var (
outOpts *options.Output
Expand Down Expand Up @@ -350,46 +350,29 @@ func newRepoInspect(ctx context.Context) *cobra.Command {
return fmt.Errorf("error reading referrer: %s", err.Error())
}

/* Until OCI 1.1 is released Notaryv2 signatures may be accessible via Image Manifest or Artifact Manifest
/* Notaryv2 signatures may be accessible via Image Manifest
https://github.com/opencontainers/image-spec/blob/main/specs-go/v1/manifest.go
https://github.com/opencontainers/image-spec/blob/main/specs-go/v1/artifact.go
*/

var artifact *ocispec.Artifact = &ocispec.Artifact{}
var manifest *ocispec.Manifest = &ocispec.Manifest{}

err = json.Unmarshal(pulledBlob, artifact)
if err != nil {
return fmt.Errorf(err.Error())
}

err = json.Unmarshal(pulledBlob, manifest)
if err != nil {
return fmt.Errorf(err.Error())
}

if manifest.Config.MediaType == registry.NotaryV2ArtifactType || artifact.ArtifactType == registry.NotaryV2ArtifactType {
if manifest.Config.MediaType == registry.NotaryV2ArtifactType {

// Found NotaryV2 signature
sigCount += 1

if outOpts.Mode == options.OutputModePretty {
if artifact.MediaType == registry.ImageManifestMediaType {
log.WithFields(logrus.Fields{
"repo": repo + ":" + tag,
"referrerMediaType": referrer.MediaType,
"mediaType": manifest.MediaType,
"artifactType": manifest.Config.MediaType,
"notaryV2EnvelopeMediaType": manifest.Layers[0].MediaType,
}).Trace("ImageManifest")
}
if artifact.MediaType == registry.ArtifactManifestMediaType {
log.WithFields(logrus.Fields{
"repo": repo + ":" + tag,
"referrerMediaType": referrer.MediaType,
"notaryV2EnvelopeMediaType": artifact.Blobs[0].MediaType,
}).Trace("ArtifactManifest")
}
log.WithFields(logrus.Fields{
"repo": repo + ":" + tag,
"referrerMediaType": referrer.MediaType,
"mediaType": manifest.MediaType,
"artifactType": manifest.Config.MediaType,
"notaryV2EnvelopeMediaType": manifest.Layers[0].MediaType,
}).Trace("ImageManifest")
}

if outOpts.Mode == options.OutputModeJSON {
Expand Down
Loading
Loading