Skip to content

Commit

Permalink
recover nil GRPCConnectionState by update failure
Browse files Browse the repository at this point in the history
Signed-off-by: akihikokuroda <akihikokuroda2020@gmail.com>
  • Loading branch information
akihikokuroda committed Jan 13, 2022
1 parent c914d09 commit 2520907
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/controller/operators/catalog/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -793,8 +793,13 @@ func (o *Operator) syncConnection(logger *logrus.Entry, in *v1alpha1.CatalogSour
updateConnectionStateFunc(out, source)
}

// GRPCConnectionState update must fail before
if out.Status.GRPCConnectionState == nil {
updateConnectionStateFunc(out, source)
}

// connection is already good, but we need to update the sync time
if out.Status.GRPCConnectionState != nil && o.sourcesLastUpdate.After(out.Status.GRPCConnectionState.LastConnectTime.Time) {
if o.sourcesLastUpdate.After(out.Status.GRPCConnectionState.LastConnectTime.Time) {
// Set connection status and return.
out.Status.GRPCConnectionState.LastConnectTime = now
out.Status.GRPCConnectionState.LastObservedState = source.ConnectionState.String()
Expand Down

0 comments on commit 2520907

Please sign in to comment.