func (b *StatefulSet) calculateSeedList(replicas int32) {
	cassandraSeedsList := []string{}
	for i := int32(0); i < replicas; i++ {
		seed := fmt.Sprintf("%s-cassandra-%d.%s.%s.svc.cluster.local",
			b.cluster.GetName(),
			int(i),
			b.options.ServiceName,
			b.cluster.GetNamespace())
		cassandraSeedsList = append(cassandraSeedsList, seed)
	}
	if b.cluster.Spec.ExternalSeeds != nil || len(b.cluster.Spec.ExternalSeeds) > 0 {
		cassandraSeedsList = append(cassandraSeedsList, b.cluster.Spec.ExternalSeeds...)
	}
	b.seedList = cassandraSeedsList
}
Calculates seed list for cluster. If ExternalSeeds is set in the resource
We append the external seeds to the primary cluster seed list.
TODO: Do not make all local cluster nodes seeds
package resource
import (
	"errors"
	"fmt"
	"github.com/operator-framework/operator-sdk/pkg/sdk"
	"github.com/pantheon-systems/cassandra-operator/pkg/apis/database/v1alpha1"
	opsdk "github.com/pantheon-systems/cassandra-operator/pkg/backend/k8s"
	appsv1 "k8s.io/api/apps/v1"
	corev1 "k8s.io/api/core/v1"
	"k8s.io/apimachinery/pkg/api/resource"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
var (
	readinessProbeInitialDelaySeconds = int32(15)
	readinessProbeTimeoutSeconds      = int32(5)
	defaultStorageCapacity            = resource.MustParse("1000Gi")
	readinessProbeScriptName          = "/ready-probe.sh"
	defaultStorageClassName           = ssdStorageClassName
)
type StatefulSet struct {
	desired *appsv1.StatefulSet
	cluster *v1alpha1.CassandraCluster
	seedList            []string
	desiredReplicas     int32
	enableAutoBootstrap bool
	options *builderOp
}
func NewStatefulSet(cc *v1alpha1.CassandraCluster, opts ...BuilderOption) *StatefulSet {
	op := newBuilderOp()
	op.applyOpts(opts)
	return &StatefulSet{
		cluster:             cc,
		options:             op,
		enableAutoBootstrap: true,
		seedList:            []string{},
	}
}
func (b *StatefulSet) Reconcile(driver opsdk.Client) (sdk.Object, error) {
	var err error
	if b.options.ServiceAccountName == "" || b.options.ServiceName == "" {
		return nil, fmt.Errorf("both ServiceAccountName and ServiceAccount are required: %s, %s", b.options.ServiceAccountName, b.options.ServiceName)
	}
	existing := &appsv1.StatefulSet{
		TypeMeta:   GetStatefulSetTypeMeta(),
		ObjectMeta: b.buildObjectMeta(),
	}
	err = driver.Get(existing)
	if err != nil {
		return nil, errors.New("could not get existing")
	}
	if existing.ResourceVersion == "" {
		b.desiredReplicas = int32(1)
		b.calculateSeedList(b.desiredReplicas)
		b.calculateAutoBootstrap(0, 0)
		b.configureDesired()
		err = driver.Create(b.desired)
		return b.desired, err
	}
	existingReplicas := *existing.Spec.Replicas
	existingReadyReplicas := existing.Status.ReadyReplicas
	b.desiredReplicas, _ = b.calculateReplicas(existingReplicas, existingReadyReplicas)
	b.calculateAutoBootstrap(existingReplicas, existingReadyReplicas)
	b.calculateSeedList(b.desiredReplicas)
	b.configureDesired()
	b.desired.ResourceVersion = existing.ResourceVersion
	err = driver.Update(b.desired)
	if err != nil {
		return nil, err
	}
	return b.desired, nil
}