Skip to content

Commit

Permalink
fix: cluster-registry-sync-manager nil pointer dereference
Browse files Browse the repository at this point in the history
  • Loading branch information
aalexand committed Aug 14, 2024
1 parent 89bb6fd commit 12fc352
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pkg/sync/manager/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,9 +325,12 @@ func (c *SyncController) hasDifferentHash(object runtime.Object) bool {
instance := object.(*registryv1alpha1.ClusterSync)

oldHash := instance.Status.SyncedDataHash
newHash := ptr.To(hash(instance.Status.SyncedData))

return *oldHash != *newHash
if oldHash == nil || instance.Status.SyncedData == nil {
return true
}

return *oldHash != hash(instance.Status.SyncedData)
}

func (c *SyncController) updateStatus(ctx context.Context, instance *registryv1alpha1.ClusterSync) error {
Expand Down

0 comments on commit 12fc352

Please sign in to comment.