diff --git a/.goreleaser.yml b/.goreleaser.yml index c6d8e6e..cb60d28 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -15,6 +15,8 @@ builds: goos: - linux - darwin + ldflags: + - -X github.com/anchore/harbor-scanner-adapter/pkg/adapter.AdapterVersion={{.Version}} checksum: name_template: 'checksums.txt' snapshot: diff --git a/pkg/adapter/adapter.go b/pkg/adapter/adapter.go index 32209ad..2a5f9ed 100644 --- a/pkg/adapter/adapter.go +++ b/pkg/adapter/adapter.go @@ -12,34 +12,36 @@ const ( HarborMetadataVulnDBUpdateKey = "harbor.scanner-adapter/vulnerability-database-updated-at" HarborMetadataScannerTypeKey = "harbor.scanner-adapter/scanner-type" AdapterType = "os-package-vulnerability" // #nosec G101 - AdapterVersion = "1.3.2" AdapterVendor = "Anchore Inc." AdapterName = "Anchore" ) -var AdapterMetadata = harbor.ScannerAdapterMetadata{ - Scanner: harbor.Scanner{ - Name: AdapterName, - Version: AdapterVersion, - Vendor: AdapterVendor, - }, - Capabilities: []harbor.Capability{ - { - ConsumesMIMETypes: []string{ - DockerImageMimeType, - OciImageMimeType, - }, - ProducesMIMETypes: []string{ - HarborVulnReportv1MimeType, - RawVulnReportMimeType, +var ( + AdapterVersion = "dev" + AdapterMetadata = harbor.ScannerAdapterMetadata{ + Scanner: harbor.Scanner{ + Name: AdapterName, + Version: AdapterVersion, + Vendor: AdapterVendor, + }, + Capabilities: []harbor.Capability{ + { + ConsumesMIMETypes: []string{ + DockerImageMimeType, + OciImageMimeType, + }, + ProducesMIMETypes: []string{ + HarborVulnReportv1MimeType, + RawVulnReportMimeType, + }, }, }, - }, - Properties: map[string]string{ - HarborMetadataVulnDBUpdateKey: "", // This gets updated in response to requests from Harbor - HarborMetadataScannerTypeKey: AdapterType, - }, -} + Properties: map[string]string{ + HarborMetadataVulnDBUpdateKey: "", // This gets updated in response to requests from Harbor + HarborMetadataScannerTypeKey: AdapterType, + }, + } +) // ScannerAdapter defines methods for scanning container images. type ScannerAdapter interface {