mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-04 04:08:16 +00:00 
			
		
		
		
	aggregator: add availability state transition logging
This commit is contained in:
		@@ -458,6 +458,22 @@ func (c *AvailableConditionController) updateAPIServiceStatus(originalAPIService
 | 
				
			|||||||
		return newAPIService, nil
 | 
							return newAPIService, nil
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						orig := apiregistrationv1apihelper.GetAPIServiceConditionByType(originalAPIService, apiregistrationv1.Available)
 | 
				
			||||||
 | 
						now := apiregistrationv1apihelper.GetAPIServiceConditionByType(newAPIService, apiregistrationv1.Available)
 | 
				
			||||||
 | 
						unknown := apiregistrationv1.APIServiceCondition{
 | 
				
			||||||
 | 
							Type:   apiregistrationv1.Available,
 | 
				
			||||||
 | 
							Status: apiregistrationv1.ConditionUnknown,
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						if orig == nil {
 | 
				
			||||||
 | 
							orig = &unknown
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						if now == nil {
 | 
				
			||||||
 | 
							now = &unknown
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						if *orig != *now {
 | 
				
			||||||
 | 
							klog.V(2).InfoS("changing APIService availability", "name", newAPIService.Name, "oldStatus", orig.Status, "newStatus", now.Status, "message", now.Message, "reason", now.Reason)
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	newAPIService, err := c.apiServiceClient.APIServices().UpdateStatus(context.TODO(), newAPIService, metav1.UpdateOptions{})
 | 
						newAPIService, err := c.apiServiceClient.APIServices().UpdateStatus(context.TODO(), newAPIService, metav1.UpdateOptions{})
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		return nil, err
 | 
							return nil, err
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user