mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 20:53:33 +00:00
Merge pull request #101420 from sttts/sttts-aggregator-available-controller-logging-upstream
aggregator: add availability state transition logging
This commit is contained in:
commit
576f0eb0b4
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user