fix incorrect logic
Kubernetes-commit: d4b41afe59736e63c0f5388256324c2583d7a659
This commit is contained in:
		
							parent
							
								
									e6d18566b8
								
							
						
					
					
						commit
						768926168b
					
				| 
						 | 
				
			
			@ -67,13 +67,15 @@ func (ps *Plugins) Registered() []string {
 | 
			
		|||
func (ps *Plugins) Register(name string, plugin Factory) {
 | 
			
		||||
	ps.lock.Lock()
 | 
			
		||||
	defer ps.lock.Unlock()
 | 
			
		||||
	_, found := ps.registry[name]
 | 
			
		||||
	if found {
 | 
			
		||||
		glog.Fatalf("Admission plugin %q was registered twice", name)
 | 
			
		||||
	}
 | 
			
		||||
	if ps.registry == nil {
 | 
			
		||||
	if ps.registry != nil {
 | 
			
		||||
		_, found := ps.registry[name]
 | 
			
		||||
		if found {
 | 
			
		||||
			glog.Fatalf("Admission plugin %q was registered twice", name)
 | 
			
		||||
		}
 | 
			
		||||
	} else {
 | 
			
		||||
		ps.registry = map[string]Factory{}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	glog.V(1).Infof("Registered admission plugin %q", name)
 | 
			
		||||
	ps.registry[name] = plugin
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue