代码拉取完成,页面将自动刷新
package userstored
import (
"strings"
"github.com/rancher/norman/store/proxy"
"github.com/rancher/norman/types"
clusterSchema "github.com/rancher/types/apis/cluster.cattle.io/v3/schema"
"github.com/rancher/types/apis/project.cattle.io/v3/schema"
"github.com/rancher/types/config"
)
type storeWrapperFunc func(types.Store) types.Store
func addProxyStore(schemas *types.Schemas, context *config.ScaledContext, schemaType, apiVersion string, storeWrapper storeWrapperFunc) *types.Schema {
s := schemas.Schema(&schema.Version, schemaType)
if s == nil {
s = schemas.Schema(&clusterSchema.Version, schemaType)
}
if s == nil {
panic("Failed to find schema " + schemaType)
}
prefix := []string{"api"}
group := ""
version := "v1"
kind := s.CodeName
plural := s.PluralName
parts := strings.SplitN(apiVersion, "/", 2)
if len(parts) == 1 {
version = parts[0]
} else {
group = parts[0]
version = parts[1]
prefix = []string{"apis"}
}
s.Store = proxy.NewProxyStore(context.ClientGetter,
config.UserStorageContext,
prefix,
group,
version,
kind,
plural)
if storeWrapper != nil {
s.Store = storeWrapper(s.Store)
}
return s
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。