Bumping k8s dependencies to 1.13

This commit is contained in:
Cheng Xing
2018-11-16 14:08:25 -08:00
parent 305407125c
commit b4c0b68ec7
8002 changed files with 884099 additions and 276228 deletions

View File

@@ -10,6 +10,8 @@ import (
"path/filepath"
"runtime"
"strings"
"golang.org/x/tools/godoc/env"
)
// Page describes the contents of the top-level godoc webpage.
@@ -21,11 +23,13 @@ type Page struct {
Query string
Body []byte
GoogleCN bool // page is being served from golang.google.cn
TreeView bool // page needs to contain treeview related js and css
// filled in by servePage
SearchBox bool
Playground bool
Version string
// filled in by ServePage
SearchBox bool
Playground bool
Version string
GoogleAnalytics string
}
func (p *Presentation) ServePage(w http.ResponseWriter, page Page) {
@@ -35,6 +39,7 @@ func (p *Presentation) ServePage(w http.ResponseWriter, page Page) {
page.SearchBox = p.Corpus.IndexEnabled
page.Playground = p.ShowPlayground
page.Version = runtime.Version()
page.GoogleAnalytics = p.GoogleAnalytics
applyTemplateToResponseWriter(w, p.GodocHTML, page)
}
@@ -49,20 +54,19 @@ func (p *Presentation) ServeError(w http.ResponseWriter, r *http.Request, relpat
}
}
p.ServePage(w, Page{
Title: "File " + relpath,
Subtitle: relpath,
Body: applyTemplate(p.ErrorHTML, "errorHTML", err),
GoogleCN: googleCN(r),
Title: "File " + relpath,
Subtitle: relpath,
Body: applyTemplate(p.ErrorHTML, "errorHTML", err),
GoogleCN: googleCN(r),
GoogleAnalytics: p.GoogleAnalytics,
})
}
var onAppengine = false // overridden in appengine.go when on app engine
func googleCN(r *http.Request) bool {
if r.FormValue("googlecn") != "" {
return true
}
if !onAppengine {
if !env.IsProd() {
return false
}
if strings.HasSuffix(r.Host, ".cn") {