/area test-and-release
/kind dev
I would like to be able to use go get code.elafros.dev/elafros, then see $GOPATH/src/code.elafros.dev/elafros on my local FS.
Currently we use go get github.com/elafros/elafros.
elafros-incubator, elafros, elafros-attic) with minimal disruption.See as a work example code.cloudfoundry.org.
The Cloud Foundry go-fetcher code is here.
In order to do this, we'd need something to actually be hosted at code.knative.dev, with a meta tag to redirect go get to the relevant GitHub URL.
From go help importpath:
If the import path is not a known code hosting site and also lacks a
version control qualifier, the go tool attempts to fetch the import
over https/http and looks for a <meta> tag in the document's HTML
<head>.
The meta tag has the form:
<meta name="go-import" content="import-prefix vcs repo-root">
The import-prefix is the import path corresponding to the repository
root. It must be a prefix or an exact match of the package being
fetched with "go get". If it's not an exact match, another http
request is made at the prefix to verify the <meta> tags match.
The meta tag should appear as early in the file as possible.
In particular, it should appear before any raw JavaScript or CSS,
to avoid confusing the go command's restricted parser.
The vcs is one of "git", "hg", "svn", etc,
The repo-root is the root of the version control system
containing a scheme and not containing a .vcs qualifier.
For example,
import "example.org/pkg/foo"
will result in the following requests:
https://example.org/pkg/foo?go-get=1 (preferred)
http://example.org/pkg/foo?go-get=1 (fallback, only with -insecure)
If that page contains the meta tag
<meta name="go-import" content="example.org git https://code.org/r/p/exproj">
the go tool will verify that https://example.org/?go-get=1 contains the
same meta tag and then git clone https://code.org/r/p/exproj into
GOPATH/src/example.org.
So I'm not sure this is feasible until https://code.knative.dev actually hosts content.
We should do this by v1 or not do it.
It's a small thing that saves so much hassle later on.
I'm reaching out to the docs team, but I think my preference would be knative.dev/serving over code.knative.dev/serving... 馃し鈥嶁檪
I think knative.dev/serving would collide with anything else we wanted to put at that URL in future. code.knative.dev/serving less so.
I think this is what "dibs" is for :)
I see it's the quick and the 500 around here.
Go import path redirection works by looking for a <meta> tag on the page when there's a special query parameter present. So knative.dev/serving could still serve other content to regular browser users without any problem.
See also: http://cloud.google.com/go which is also a valid Go import path: https://godoc.org/cloud.google.com/go
edit: Apparently I already posted the chapter-and-verse from Go docs, _ten months ago to the day_ 馃槺
Thinking about this some more, this is probably going to require coordination with the Productivity WG and we'll probably spend a few weeks tracking down assorted glitches. I don't want to risk the release by attempting this in the final weeks.
/cc @adrcunha
This is where K8s serves this text: https://github.com/kubernetes/k8s.io/blob/master/k8s.io/configmap-nginx.yaml#L36-L49
For Prow @fejta pointed me at https://github.com/kubernetes/test-infra/blob/b3a9e5ba03ff1d38d3dc3a0fae2880874de1db83/config/jobs/kubernetes/sig-gcp/sig-gcp-windows.yaml#L67-L72 for customizing how we import things.
FYI, we own kn.dev, just waiting for certs to roll out.
I found where Istio did this via their netlify setup and it seems reasonable straightforward: https://github.com/istio/istio.io/pull/1491/files
I'll send @RichieEscarez a PR to test the waters.
Most helpful comment
Go import path redirection works by looking for a
<meta>tag on the page when there's a special query parameter present. Soknative.dev/servingcould still serve other content to regular browser users without any problem.See also: http://cloud.google.com/go which is also a valid Go import path: https://godoc.org/cloud.google.com/go
edit: Apparently I already posted the chapter-and-verse from Go docs, _ten months ago to the day_ 馃槺