fix some typos

This commit is contained in:
GLYASAI 2020-01-08 18:33:00 +08:00
parent dee14ce89b
commit edad9cec54
7 changed files with 13 additions and 13 deletions

View File

@ -117,7 +117,7 @@ type TaskWorker interface {
var workerCreaterList = make(map[string]func([]byte, *exectorManager) (TaskWorker, error))
//RegisterWorker register worker creater
//RegisterWorker register worker creator
func RegisterWorker(name string, fun func([]byte, *exectorManager) (TaskWorker, error)) {
workerCreaterList[name] = fun
}

View File

@ -171,7 +171,7 @@ func New(client kubernetes.Interface,
// create informers factory, enable and assign required informers
store.sharedInformer = informers.NewFilteredSharedInformerFactory(client, conf.ResyncPeriod, corev1.NamespaceAll,
func(options *metav1.ListOptions) {
// options.LabelSelector = "creater=Rainbond"
options.LabelSelector = "creator=Rainbond"
})
store.informers.Ingress = store.sharedInformer.Extensions().V1beta1().Ingresses().Informer()

View File

@ -88,7 +88,7 @@ func NewKubeClient(cfg *conf.Conf) (KubeClient, error) {
stop := make(chan struct{})
sharedInformers := informers.NewFilteredSharedInformerFactory(cli, cfg.MinResyncPeriod, v1.NamespaceAll,
func(options *metav1.ListOptions) {
//options.LabelSelector = "creater=Rainbond"
//options.LabelSelector = "creator=Rainbond"
})
sharedInformers.Core().V1().Services().Informer()
sharedInformers.Core().V1().Endpoints().Informer()
@ -445,8 +445,8 @@ func (k *kubeClient) UpK8sNode(rainbondNode *client.HostNode) (*v1.Node, error)
},
},
}
//set rainbond creater lable
node.Labels["creater"] = "Rainbond"
//set rainbond creator lable
node.Labels["creator"] = "Rainbond"
savedNode, err := k.kubeclient.CoreV1().Nodes().Create(node)
if err != nil {
return nil, err

View File

@ -99,7 +99,7 @@ func (n *NodeConfig) GetID() string {
//if return true, snapshot need update
func (n *NodeConfig) TryUpdate(obj interface{}) (needUpdate bool) {
if service, ok := obj.(*corev1.Service); ok {
if v, ok := service.Labels["creater"]; !ok || v != "Rainbond" {
if v, ok := service.Labels["creator"]; !ok || v != "Rainbond" {
return false
}
if _, ok := n.dependServices.Load(service.Labels["service_id"]); ok {
@ -107,7 +107,7 @@ func (n *NodeConfig) TryUpdate(obj interface{}) (needUpdate bool) {
}
}
if endpoints, ok := obj.(*corev1.Endpoints); ok {
if v, ok := endpoints.Labels["creater"]; !ok || v != "Rainbond" {
if v, ok := endpoints.Labels["creator"]; !ok || v != "Rainbond" {
return false
}
if _, ok := n.dependServices.Load(endpoints.Labels["service_id"]); ok {
@ -258,7 +258,7 @@ func CreateDiscoverServerManager(client kubecache.KubeClient, conf option.Conf)
queue: NewQueue(1 * time.Second),
}
sharedInformers := informers.NewFilteredSharedInformerFactory(dsm.kubecli, time.Second*10, corev1.NamespaceAll, func(options *meta_v1.ListOptions) {
options.LabelSelector = "creater=Rainbond"
options.LabelSelector = "creator=Rainbond"
})
svcInformer := sharedInformers.Core().V1().Services().Informer()
dsm.services = dsm.createCacheHandler(svcInformer, "Services")

View File

@ -75,7 +75,7 @@ func InClusterConfig() (*rest.Config, error) {
func NewRainbondFilteredSharedInformerFactory(clientset kubernetes.Interface) informers.SharedInformerFactory {
return informers.NewFilteredSharedInformerFactory(
clientset, 30*time.Second, corev1.NamespaceAll, func(options *metav1.ListOptions) {
options.LabelSelector = "creater=Rainbond"
options.LabelSelector = "creator=Rainbond"
},
)
}

View File

@ -617,11 +617,11 @@ func (a *appRuntimeStore) listHPAEvents(hpa *v2beta1.HorizontalPodAutoscaler) er
return nil
}
//getAppService if creater is true, will create new app service where not found in store
func (a *appRuntimeStore) getAppService(serviceID, version, createrID string, creater bool) (*v1.AppService, error) {
//getAppService if creator is true, will create new app service where not found in store
func (a *appRuntimeStore) getAppService(serviceID, version, createrID string, creator bool) (*v1.AppService, error) {
var appservice *v1.AppService
appservice = a.GetAppService(serviceID)
if appservice == nil && creater {
if appservice == nil && creator {
var err error
appservice, err = conversion.InitCacheAppService(a.dbmanager, serviceID, createrID)
if err != nil {

View File

@ -26,7 +26,7 @@ func (a *AppService) GetCommonLabels(labels ...map[string]string) map[string]str
resultLabel[k] = v
}
}
resultLabel["creater"] = "Rainbond"
resultLabel["creator"] = "Rainbond"
resultLabel["creater_id"] = a.CreaterID
resultLabel["service_id"] = a.ServiceID
resultLabel["service_alias"] = a.ServiceAlias