Skip to content
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
14 changes: 14 additions & 0 deletions internal/tracker/source/tekton/tekton.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"path"
"path/filepath"
"regexp"
"strconv"
"strings"

"github.com/Masterminds/semver/v3"
Expand All @@ -32,6 +33,9 @@ import (
const (
// Keys used in labels and annotations in the Tekton's manifest file.

// deprecatedTKey defines if the package is deprecated.
deprecatedTKey = "tekton.dev/deprecated"

// displayNameTKey defines the package's display name.
displayNameTKey = "tekton.dev/displayName"

Expand Down Expand Up @@ -595,6 +599,16 @@ func enrichPackageFromAnnotations(p *hub.Package, annotations map[string]string)
}
}

// Deprecated
if v, ok := annotations[deprecatedTKey]; ok {
deprecated, err := strconv.ParseBool(v)
if err != nil {
errs = multierror.Append(errs, fmt.Errorf("%w: invalid deprecated value", errInvalidAnnotation))
} else {
p.Deprecated = deprecated
}
}

// License
p.License = annotations[licenseAnnotation]

Expand Down
3 changes: 2 additions & 1 deletion internal/tracker/source/tekton/tekton_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func TestTrackerSource(t *testing.T) {
Version: "0.1.0",
Provider: "Some organization",
ContentURL: "https://github.com/user/repo/raw/master/path/task1/0.1/task1.yaml",
Digest: "7dfdce0ad1778d5c9b92115e23b92308bad5b27b0c514fa19f7a12f9ea8be4a9",
Digest: "71cb438c009785420747d5409ad016a6792135c6d1555984508ba6da6dec79cf",
Repository: i.Repository,
License: "Apache-2.0",
Links: []*hub.Link{
Expand Down Expand Up @@ -140,6 +140,7 @@ func TestTrackerSource(t *testing.T) {
"sample1.yaml": "sample content\n",
},
},
Deprecated: true,
Signatures: []string{tekton},
Signed: true,
ContainersImages: []*hub.ContainerImage{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ metadata:
artifacthub.io/screenshots: |
- title: Screenshot 1
url: https://artifacthub.io/screenshot1.jpg
tekton.dev/deprecated: "true"
tekton.dev/pipelines.minVersion: "0.12.1"
tekton.dev/platforms: "linux/amd64, linux/arm64"
tekton.dev/tags: tag1, tag2
Expand Down
Loading