Fix regression that prevented default organizational runner group from being scale target
Fixes #1131
This commit is contained in:
		
							parent
							
								
									eb0a4a9603
								
							
						
					
					
						commit
						fcf4778bac
					
				|  | @ -614,11 +614,7 @@ func (autoscaler *HorizontalRunnerAutoscalerGitHubWebhook) getManagedRunnerGroup | ||||||
| 			return nil, fmt.Errorf("unsupported scale target kind: %v", kind) | 			return nil, fmt.Errorf("unsupported scale target kind: %v", kind) | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		if g == "" { | 		if g != "" && e == "" && o == "" { | ||||||
| 			continue |  | ||||||
| 		} |  | ||||||
| 
 |  | ||||||
| 		if e == "" && o == "" { |  | ||||||
| 			autoscaler.Log.V(1).Info( | 			autoscaler.Log.V(1).Info( | ||||||
| 				"invalid runner group config in scale target: spec.group must be set along with either spec.enterprise or spec.organization", | 				"invalid runner group config in scale target: spec.group must be set along with either spec.enterprise or spec.organization", | ||||||
| 				"scaleTargetKind", kind, | 				"scaleTargetKind", kind, | ||||||
|  | @ -631,6 +627,16 @@ func (autoscaler *HorizontalRunnerAutoscalerGitHubWebhook) getManagedRunnerGroup | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		if e != enterprise && o != org { | 		if e != enterprise && o != org { | ||||||
|  | 			autoscaler.Log.V(1).Info( | ||||||
|  | 				"Skipped scale target irrelevant to event", | ||||||
|  | 				"eventOrganization", org, | ||||||
|  | 				"eventEnterprise", enterprise, | ||||||
|  | 				"scaleTargetKind", kind, | ||||||
|  | 				"scaleTargetGroup", g, | ||||||
|  | 				"scaleTargetEnterprise", e, | ||||||
|  | 				"scaleTargetOrganization", o, | ||||||
|  | 			) | ||||||
|  | 
 | ||||||
| 			continue | 			continue | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue