@@ -87,7 +87,7 @@ func NewClusterOperatorStatusController(
8787func (c StatusSyncer ) sync () error {
8888 detailedSpec , currentDetailedStatus , _ , err := c .operatorClient .GetOperatorState ()
8989 if apierrors .IsNotFound (err ) {
90- c .eventRecorder .Warningf ("StatusNotFound" , "Unable to determine current operator status for %s" , c .clusterOperatorName )
90+ c .eventRecorder .Warningf ("StatusNotFound" , "Unable to determine current operator status for clusteroperator/ %s" , c .clusterOperatorName )
9191 if err := c .clusterOperatorClient .ClusterOperators ().Delete (c .clusterOperatorName , nil ); err != nil && ! apierrors .IsNotFound (err ) {
9292 return err
9393 }
@@ -99,7 +99,7 @@ func (c StatusSyncer) sync() error {
9999
100100 originalClusterOperatorObj , err := c .clusterOperatorLister .Get (c .clusterOperatorName )
101101 if err != nil && ! apierrors .IsNotFound (err ) {
102- c .eventRecorder .Warningf ("StatusFailed" , "Unable to get current operator status for %s: %v" , c .clusterOperatorName , err )
102+ c .eventRecorder .Warningf ("StatusFailed" , "Unable to get current operator status for clusteroperator/ %s: %v" , c .clusterOperatorName , err )
103103 return err
104104 }
105105
@@ -150,7 +150,11 @@ func (c StatusSyncer) sync() error {
150150 // TODO work out removal. We don't always know the existing value, so removing early seems like a bad idea. Perhaps a remove flag.
151151 versions := c .versionGetter .GetVersions ()
152152 for operand , version := range versions {
153- operatorv1helpers .SetOperandVersion (& clusterOperatorObj .Status .Versions , configv1.OperandVersion {Name : operand , Version : version })
153+ previousVersion := operatorv1helpers .SetOperandVersion (& clusterOperatorObj .Status .Versions , configv1.OperandVersion {Name : operand , Version : version })
154+ if previousVersion != version {
155+ // having this message will give us a marker in events when the operator updated compared to when the operand is updated
156+ c .eventRecorder .Eventf ("OperatorVersionChanged" , "clusteroperator/%s version %q changed from %q to %q" , c .clusterOperatorName , operand , previousVersion , version )
157+ }
154158 }
155159
156160 // if we have no diff, just return
@@ -162,7 +166,7 @@ func (c StatusSyncer) sync() error {
162166 if _ , updateErr := c .clusterOperatorClient .ClusterOperators ().UpdateStatus (clusterOperatorObj ); err != nil {
163167 return updateErr
164168 }
165- c .eventRecorder .Eventf ("OperatorStatusChanged" , "Status for operator %s changed: %s" , c .clusterOperatorName , configv1helpers .GetStatusDiff (originalClusterOperatorObj .Status , clusterOperatorObj .Status ))
169+ c .eventRecorder .Eventf ("OperatorStatusChanged" , "Status for clusteroperator/ %s changed: %s" , c .clusterOperatorName , configv1helpers .GetStatusDiff (originalClusterOperatorObj .Status , clusterOperatorObj .Status ))
166170 return nil
167171}
168172
0 commit comments