Skip to content

Commit 0b3f507

Browse files
Merge pull request #1044 from wking/publish-cluster-operator-start-time
OTA-1160: pkg/cvo/reconciliation_issues: Publish ClusterOperator transitionStart
2 parents 53a8fbf + a804d97 commit 0b3f507

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

pkg/cvo/reconciliation_issues.go

+12
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"encoding/json"
55
"fmt"
66
"sort"
7+
"time"
78

89
configv1 "github.com/openshift/api/config/v1"
910
"github.com/openshift/cluster-version-operator/pkg/payload"
@@ -65,6 +66,11 @@ type reconciliationIssue struct {
6566

6667
Effect string `json:"effect,omitempty"`
6768
Manifest *reconciledManifest `json:"manifest,omitempty"`
69+
70+
// TransitionStart records when this resource was most
71+
// recently requested to update. Optional; only tracked for some
72+
// manifest types.
73+
TransitionStart *time.Time `json:"transitionStart,omitempty"`
6874
}
6975

7076
type reconciledManifest struct {
@@ -103,6 +109,12 @@ func reconciliationIssueFromError(err error) (string, error) {
103109
if updateErr.Task.Manifest.Obj != nil {
104110
entry.Manifest.Namespace = updateErr.Task.Manifest.Obj.GetNamespace()
105111
entry.Manifest.Name = updateErr.Task.Manifest.Obj.GetName()
112+
if updateErr.Task.Manifest.GVK == configv1.GroupVersion.WithKind("ClusterOperator") {
113+
start := payload.COUpdateStartTimesGet(entry.Manifest.Name)
114+
if !start.IsZero() {
115+
entry.TransitionStart = &start
116+
}
117+
}
106118
}
107119
}
108120
}

0 commit comments

Comments
 (0)