You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
readmePath := fmt.Sprintf("%s/%s/%s/%s/%s/README.md", s.CatalogClonePath(), strings.ToLower(p.Catalog), strings.ToLower(p.Kind), p.Name, p.Version)
So for example, the resulting path for README is /tmp/catalog/core3/task/hello-world/0.1/README.md
but it should have been /tmp/catalog/core3/corp/tekton/catalog/task/hello-world/0.1/README.md
Expected Behavior
The API server should be able to fetch and return the README/YAML of the resource from the cloned catalog.
Actual Behavior
Fail to read from cloned files because the path is built incorrectly.
Steps to Reproduce the Problem
Additional Info
sample catalog:
- name: core3
org: My Company
type: internal
provider: gitlab
url: https://some.internal.url
sshurl: ssh://[email protected]_server.com/core3.git
contextdir: corp/tekton/catalog
revision: master
The Bug
ContextDir
was not included when building the paths to README/YAML resources.e.g. https://github.com/tektoncd/hub/blob/main/api/v1/service/resource/resource.go#L186 and https://github.com/tektoncd/hub/blob/main/api/v1/service/resource/resource.go#L207
readmePath := fmt.Sprintf("%s/%s/%s/%s/%s/README.md", s.CatalogClonePath(), strings.ToLower(p.Catalog), strings.ToLower(p.Kind), p.Name, p.Version)
So for example, the resulting path for README is
/tmp/catalog/core3/task/hello-world/0.1/README.md
but it should have been
/tmp/catalog/core3/corp/tekton/catalog/task/hello-world/0.1/README.md
This bug is not affecting https://hub.tekton.dev/ because the community Tekton Hub does not need a
ContextDir
as all resources are in the root dir of https://github.com/tektoncd/catalogValidation
I created a sym-link from
/tmp/catalog/core3/task
to/tmp/catalog/core3/corp/tekton/catalog/task
and all resources are loading fine now.The text was updated successfully, but these errors were encountered: