37 Star 407 Fork 74

GVPrancher/rancher

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
Clone or Download
crd.go 765 Bytes
Copy Edit Raw Blame History
Darren Shepherd authored 2018-04-26 15:02 . Move watch sharing to norman
package managementstored
import (
"context"
"sync"
"github.com/rancher/norman/store/crd"
"github.com/rancher/norman/types"
"github.com/rancher/types/config"
)
func createCrd(ctx context.Context, wg *sync.WaitGroup, factory *crd.Factory, schemas *types.Schemas, version *types.APIVersion, schemaIDs ...string) {
wg.Add(1)
go func() {
defer wg.Done()
var schemasToCreate []*types.Schema
for _, schemaID := range schemaIDs {
s := schemas.Schema(version, schemaID)
if s == nil {
panic("can not find schema " + schemaID)
}
schemasToCreate = append(schemasToCreate, s)
}
err := factory.AssignStores(ctx, config.ManagementStorageContext, schemasToCreate...)
if err != nil {
panic("creating CRD store " + err.Error())
}
}()
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/rancher/rancher.git
git@gitee.com:rancher/rancher.git
rancher
rancher
rancher
v2.1.6-rc4

Search