代码拉取完成,页面将自动刷新
package workload
import (
"github.com/rancher/norman/types"
"github.com/rancher/types/apis/project.cattle.io/v3/schema"
)
func ConfigureStore(schemas *types.Schemas) {
workloadSchema := schemas.Schema(&schema.Version, "workload")
store := NewAggregateStore(
schemas.Schema(&schema.Version, "deployment"),
schemas.Schema(&schema.Version, "replicaSet"),
schemas.Schema(&schema.Version, "replicationController"),
schemas.Schema(&schema.Version, "daemonSet"),
schemas.Schema(&schema.Version, "statefulSet"),
schemas.Schema(&schema.Version, "job"),
schemas.Schema(&schema.Version, "cronJob"))
for _, s := range store.Schemas {
s.Formatter = workloadFormatter
}
workloadSchema.Store = store
}
func workloadFormatter(apiContext *types.APIContext, resource *types.RawResource) {
workloadID := resource.ID
workloadSchema := apiContext.Schemas.Schema(&schema.Version, "workload")
resource.Links["self"] = apiContext.URLBuilder.ResourceLinkByID(workloadSchema, workloadID)
resource.Links["remove"] = apiContext.URLBuilder.ResourceLinkByID(workloadSchema, workloadID)
resource.Links["update"] = apiContext.URLBuilder.ResourceLinkByID(workloadSchema, workloadID)
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。