func NeedsUpdate(c *v1alpha1.CockroachCluster, e *rookv1alpha1.Cluster) bool {
	params := c.Spec.CockroachClusterParameters
	if !reflect.DeepEqual(rook.Annotations(params.Annotations), e.Spec.Annotations) {
		return true
	}
	if !reflect.DeepEqual(params.Storage.NodeCount, e.Spec.Storage.NodeCount) {
		return true
	}
	if !reflect.DeepEqual(params.Storage.VolumeClaimTemplates, e.Spec.Storage.VolumeClaimTemplates) {
		return true
	}
	if !reflect.DeepEqual(convertPorts(params.Network.Ports), e.Spec.Network.Ports) {
		return true
	}
	if !reflect.DeepEqual(params.CachePercent, e.Spec.CachePercent) {
		return true
	}
	if !reflect.DeepEqual(params.MaxSQLMemoryPercent, e.Spec.MaxSQLMemoryPercent) {
		return true
	}
	return false
}
NeedsUpdate determines whether the external Rook Cockroach cluster needs to be
updated.
package cockroach
import (
	"reflect"
	rookv1alpha1 "github.com/rook/rook/pkg/apis/cockroachdb.rook.io/v1alpha1"
	rook "github.com/rook/rook/pkg/apis/rook.io/v1alpha2"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"github.com/crossplane/provider-rook/apis/database/v1alpha1"
)
func CrossToRook(c *v1alpha1.CockroachCluster) *rookv1alpha1.Cluster {
	params := c.Spec.CockroachClusterParameters
	return &rookv1alpha1.Cluster{
		ObjectMeta: metav1.ObjectMeta{
			Name:      params.Name,
			Namespace: params.Namespace,
		},
		Spec: rookv1alpha1.ClusterSpec{
			Annotations: rook.Annotations(params.Annotations),
			Storage: rook.StorageScopeSpec{
				NodeCount: params.Storage.NodeCount,
				Selection: rook.Selection{
					VolumeClaimTemplates: params.Storage.VolumeClaimTemplates,
				},
			},
			Network: rookv1alpha1.NetworkSpec{
				Ports: convertPorts(params.Network.Ports),
			},
			Secure:              params.Secure,
			CachePercent:        params.CachePercent,
			MaxSQLMemoryPercent: params.MaxSQLMemoryPercent,
		},
	}
}