Skip to content

Commit 93842ef

Browse files
openshift-pipelines-botmbpavan
authored andcommitted
[bot] Update release-v1.20.x from tektoncd/hub to 249e2ab
$ git diff --stat 249e2ab..e22c108 api/pkg/cli/hub/get_resource.go | 59 +- api/pkg/cli/hub/get_resource_test.go | 9 + config/01-db/10-db-migration.yaml | 1 + config/02-api/22-api-deployment.yaml | 1 + config/03-ui/31-ui-deployment.yaml | 11 + .../00-config/01-swagger-deployment.yaml | 1 + go.mod | 1 + go.sum | 2 + images/ui.Dockerfile | 6 +- ui/image/nginx.conf | 7 + ui/image/start.sh | 20 +- ui/package-lock.json | 86 ++- vendor/github.com/Masterminds/semver/v3/.gitignore | 1 + .../github.com/Masterminds/semver/v3/.golangci.yml | 27 + .../github.com/Masterminds/semver/v3/CHANGELOG.md | 268 +++++++ .../github.com/Masterminds/semver/v3/LICENSE.txt | 19 + vendor/github.com/Masterminds/semver/v3/Makefile | 31 + vendor/github.com/Masterminds/semver/v3/README.md | 274 +++++++ .../github.com/Masterminds/semver/v3/SECURITY.md | 19 + .../github.com/Masterminds/semver/v3/collection.go | 24 + .../Masterminds/semver/v3/constraints.go | 601 ++++++++++++++++ vendor/github.com/Masterminds/semver/v3/doc.go | 184 +++++ vendor/github.com/Masterminds/semver/v3/version.go | 788 +++++++++++++++++++++ vendor/modules.txt | 3 + 24 files changed, 2395 insertions(+), 48 deletions(-) https://github.com/tektoncd/hub/compare/249e2ab3ad60600e7db078651c64bec2b85d7b87..e22c108769c3d9b4ed4171e32c8a6ab3bd2e980e
1 parent 4f6a922 commit 93842ef

File tree

25 files changed

+49
-2396
lines changed

25 files changed

+49
-2396
lines changed

head

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
e22c108769c3d9b4ed4171e32c8a6ab3bd2e980e
1+
249e2ab3ad60600e7db078651c64bec2b85d7b87

upstream/api/pkg/cli/hub/get_resource.go

Lines changed: 4 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import (
2121
"sort"
2222
"strings"
2323

24-
"github.com/Masterminds/semver/v3"
2524
rclient "github.com/tektoncd/hub/api/v1/gen/http/resource/client"
2625
)
2726

@@ -232,8 +231,9 @@ func (t *tektonHubClient) GetResourceVersionslist(r ResourceOption) ([]string, e
232231
for i := range opts.hubResVersions.Versions {
233232
ver = append(ver, *opts.hubResVersions.Versions[i].Version)
234233
}
234+
sort.Sort(sort.Reverse(sort.StringSlice(ver)))
235235

236-
return sortVersionsSemanticaly(ver), nil
236+
return ver, nil
237237
}
238238

239239
// Endpoint computes the endpoint url using input provided
@@ -484,58 +484,7 @@ func findArtifactHubResourceVersions(data []byte) ([]string, error) {
484484
for _, r := range resp.AvailableVersions {
485485
versions = append(versions, r.Version)
486486
}
487+
sort.Sort(sort.Reverse(sort.StringSlice(versions)))
487488

488-
return sortVersionsSemanticaly(versions), nil
489-
}
490-
491-
// sortVersionsSemanticaly sorts version strings using semantic versioning rules
492-
// Returns versions in descending order (latest first), preserving original format
493-
func sortVersionsSemanticaly(versions []string) []string {
494-
if len(versions) <= 1 {
495-
return versions
496-
}
497-
498-
// Create a struct to hold both original string and parsed version
499-
type versionPair struct {
500-
original string
501-
semver *semver.Version
502-
}
503-
504-
var validVersions []versionPair
505-
var invalidVersions []string
506-
507-
// Parse versions, keeping original strings and invalid ones separate
508-
for _, v := range versions {
509-
// Try to parse as semantic version
510-
version, err := semver.NewVersion(v)
511-
if err != nil {
512-
// If it's not a valid semver, keep it as string for fallback sorting
513-
invalidVersions = append(invalidVersions, v)
514-
} else {
515-
validVersions = append(validVersions, versionPair{
516-
original: v,
517-
semver: version,
518-
})
519-
}
520-
}
521-
522-
// Sort valid versions by their semver objects in descending order (latest first)
523-
sort.Slice(validVersions, func(i, j int) bool {
524-
return validVersions[i].semver.GreaterThan(validVersions[j].semver)
525-
})
526-
527-
// Sort invalid versions alphabetically in descending order as fallback
528-
sort.Sort(sort.Reverse(sort.StringSlice(invalidVersions)))
529-
530-
// Convert back to original strings and combine results
531-
var result []string
532-
533-
// Add properly sorted semantic versions first (in original format)
534-
for _, vp := range validVersions {
535-
result = append(result, vp.original)
536-
}
537-
538-
result = append(result, invalidVersions...)
539-
540-
return result
489+
return versions, nil
541490
}

upstream/api/pkg/cli/hub/get_resource_test.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,3 @@ func TestGetResourceEndpoint(t *testing.T) {
3939
url = opt.Endpoint()
4040
assert.Equal(t, "/v1/resource/tekton/task/abc/0.1.1", url)
4141
}
42-
43-
func TestSortVersionsSemanticaly(t *testing.T) {
44-
// includes valid semver and some invalid strings (alpha/beta)
45-
in := []string{"0.9.0", "1.0.0", "v0.10.0", "alpha", "2.0.0", "1.2.3", "beta"}
46-
out := sortVersionsSemanticaly(in)
47-
48-
// valid semvers should be in descending order first
49-
assert.Equal(t, []string{"2.0.0", "1.2.3", "1.0.0", "v0.10.0", "0.9.0", "beta", "alpha"}, out)
50-
}

upstream/config/01-db/10-db-migration.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ spec:
3131
image: quay.io/tekton-hub/db-migration
3232
securityContext:
3333
allowPrivilegeEscalation: false
34-
readOnlyRootFilesystem: true
3534
runAsUser: 65532
3635
capabilities:
3736
drop:

upstream/config/02-api/22-api-deployment.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ spec:
9595
timeoutSeconds: 1
9696
securityContext:
9797
allowPrivilegeEscalation: false
98-
readOnlyRootFilesystem: true
9998
runAsUser: 65532
10099
capabilities:
101100
drop:

upstream/config/03-ui/31-ui-deployment.yaml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,10 @@ spec:
3232
memory: 500Mi
3333
securityContext:
3434
allowPrivilegeEscalation: false
35-
readOnlyRootFilesystem: true
3635
runAsUser: 65532
3736
capabilities:
3837
drop:
3938
- ALL
40-
volumeMounts:
41-
- name: config-volume
42-
mountPath: /tmp/config
43-
- name: tmp
44-
mountPath: /tmp
4539
env:
4640
- name: API_URL
4741
valueFrom:
@@ -94,8 +88,3 @@ spec:
9488
periodSeconds: 5
9589
successThreshold: 1
9690
timeoutSeconds: 1
97-
volumes:
98-
- name: config-volume
99-
emptyDir: {}
100-
- name: tmp
101-
emptyDir: {}

upstream/config/06-swagger/00-config/01-swagger-deployment.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ spec:
2525
image: quay.io/tekton-hub/swagger
2626
securityContext:
2727
allowPrivilegeEscalation: false
28-
readOnlyRootFilesystem: true
2928
runAsUser: 65532
3029
capabilities:
3130
drop:

upstream/go.mod

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ toolchain go1.23.8
77
require (
88
github.com/ActiveState/vt10x v1.3.1
99
github.com/AlecAivazis/survey/v2 v2.3.7
10-
github.com/Masterminds/semver/v3 v3.4.0
1110
github.com/Netflix/go-expect v0.0.0-20220104043353-73e0943537d2
1211
github.com/fatih/color v1.18.0
1312
github.com/go-co-op/gocron v1.37.0

upstream/go.sum

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,6 @@ github.com/AzureAD/microsoft-authentication-library-for-go v1.3.1 h1:gUDtaZk8het
111111
github.com/AzureAD/microsoft-authentication-library-for-go v1.3.1/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI=
112112
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
113113
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
114-
github.com/Masterminds/semver/v3 v3.4.0 h1:Zog+i5UMtVoCU8oKka5P7i9q9HgrJeGzI9SA1Xbatp0=
115-
github.com/Masterminds/semver/v3 v3.4.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM=
116114
github.com/Microsoft/go-winio v0.4.11/go.mod h1:VhR8bwka0BXejwEJY73c50VrPtXAaKcyvVC4A4RozmA=
117115
github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA=
118116
github.com/Microsoft/go-winio v0.4.15-0.20190919025122-fc70bd9a86b5/go.mod h1:tTuCMEN+UleMWgg9dVx4Hu52b1bJo+59jBh3ajtinzw=

upstream/images/ui.Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ COPY --from=BUILD /app/build /usr/share/nginx/html
1616
COPY ui/image/start.sh /usr/bin/
1717

1818
USER root
19-
RUN chmod +x /usr/bin/start.sh && \
20-
mkdir -p /tmp/config && \
21-
chown -R nginx:nginx /tmp/config
19+
RUN chmod ugo+rw /usr/share/nginx/html/config.js && \
20+
chown nginx:nginx /usr/share/nginx/html/config.js && \
21+
chmod +x /usr/bin/start.sh
2222
USER nginx
2323

2424
EXPOSE 8080

0 commit comments

Comments
 (0)