fix(redirects): forward k8s.io Go package URLs to pkg.go.dev#55640
fix(redirects): forward k8s.io Go package URLs to pkg.go.dev#55640singhvishalkr wants to merge 2 commits intokubernetes:mainfrom
Conversation
kubernetes.io/api, /apimachinery and /client-go currently 404. These paths receive browser traffic via the k8s.io go-import meta vanity URLs (k8s.io/api -> kubernetes.io/api), so they should forward to canonical package documentation rather than dead-end.
✅ Pull request preview available for checkingBuilt without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
/assign @SayakMukhopadhyay |
|
Thanks; I suggest a tweak. Use 307 rather than 301 status for the redirects. I also don't know if we want to make this change. Anyway, it is almost technically correct, and the fixup is easy. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Switched to 307 in fbdc901. Makes sense since pkg.go.dev could change its URL scheme. |
Issue #55628 reports that
https://kubernetes.io/api,/apimachinery, and/client-goall 404. Browsers reach these paths through thek8s.ioGo vanity URLs:k8s.io/apiserves thego-importmeta tag forgo get, but a browser hitting the same URL gets a normal 302 tokubernetes.io/apiand dead-ends there.The reporter suggested forwarding these to
pkg.go.dev/k8s.io/{package}, which is where the canonical Go package documentation lives. This PR does exactly that with three 301 entries instatic/_redirects.base:/api,/apimachinery, and/client-goare not currently published as kubernetes.io content, so there is no conflicting page to override. The 301 status follows the convention used by the existing site-internal entries in the same file; the external-redirect form follows the precedent of/docs/tasks/tools/install-minikube/->https://minikube.sigs.k8s.io/docs/start/.Scope is intentionally narrow: only the three paths called out in the issue. Sub-path splat redirects (e.g.
/api/core/v1/* -> pkg.go.dev/k8s.io/api/core/v1/...) are easy to add later if a maintainer thinks they are worth it, but the issue is specifically about the package landing pages and I did not want to expand surface beyond what was reported.Closes #55628