loop over communication sis now outside loop over namespaces.
This commit is contained in:
		
							parent
							
								
									ea6eb4e9ae
								
							
						
					
					
						commit
						a640b726bf
					
				| @ -76,30 +76,27 @@ func validate(files []string, options *Options) error { | |||||||
| 				} | 				} | ||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
| 
 | 	} | ||||||
| 		for _, communication := range config.Communications { | 	for _, communication := range config.Communications { | ||||||
| 			if len(communication.Ports) == 0 { | 		if len(communication.Ports) == 0 { | ||||||
|  | 			continue | ||||||
|  | 		} | ||||||
|  | 		for _, applicationName := range communication.To { | ||||||
|  | 			application, _, _ := config.GetApplication(applicationName) | ||||||
|  | 			if application == nil { | ||||||
| 				continue | 				continue | ||||||
| 			} | 			} | ||||||
| 			for _, applicationName := range communication.To { | 			for _, port := range communication.Ports { | ||||||
| 				application, _, _ := config.GetApplication(applicationName) | 				pods := FindPods(application, clientset) | ||||||
| 				if application == nil { | 				for _, pod := range pods { | ||||||
| 					continue | 					if !HasPort(pod, port) { | ||||||
| 				} | 						LogValidationMsg(Error, "communication %v -> %v: port %v is not configured in pod %s/%s", | ||||||
| 				for _, port := range communication.Ports { | 							communication.From, communication.To, port, pod.Namespace, pod.Name) | ||||||
| 					pods := FindPods(application, clientset) |  | ||||||
| 					for _, pod := range pods { |  | ||||||
| 						if !HasPort(pod, port) { |  | ||||||
| 							LogValidationMsg(Error, "communication %v -> %v: port %v is not configured in pod %s/%s", |  | ||||||
| 								communication.From, communication.To, port, pod.Namespace, pod.Name) |  | ||||||
| 						} |  | ||||||
| 					} | 					} | ||||||
| 
 |  | ||||||
| 				} | 				} | ||||||
|  | 
 | ||||||
| 			} | 			} | ||||||
| 
 |  | ||||||
| 		} | 		} | ||||||
| 
 |  | ||||||
| 	} | 	} | ||||||
| 	return nil | 	return nil | ||||||
| } | } | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user