代码拉取完成,页面将自动刷新
package clusterregistrationtokens
import (
"net/http"
"github.com/gorilla/mux"
"github.com/rancher/norman/types"
"github.com/rancher/norman/urlbuilder"
"github.com/rancher/rancher/pkg/image"
"github.com/rancher/rancher/pkg/settings"
"github.com/rancher/rancher/pkg/systemtemplate"
"github.com/rancher/types/apis/management.cattle.io/v3/schema"
)
func ClusterImportHandler(resp http.ResponseWriter, req *http.Request) {
resp.Header().Set("Content-Type", "text/plain")
token := mux.Vars(req)["token"]
urlBuilder, err := urlbuilder.New(req, schema.Version, types.NewSchemas())
if err != nil {
resp.WriteHeader(500)
resp.Write([]byte(err.Error()))
return
}
url := urlBuilder.RelativeToRoot("")
authImage := ""
authImages := req.URL.Query()["authImage"]
if len(authImages) > 0 {
authImage = authImages[0]
}
if err := systemtemplate.SystemTemplate(resp, image.Resolve(settings.AgentImage.Get()), authImage, token, url); err != nil {
resp.WriteHeader(500)
resp.Write([]byte(err.Error()))
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。