Make canonical field default to False

Signed-off-by: Seth Foster <fosterbseth@gmail.com>
This commit is contained in:
Seth Foster
2024-01-16 13:10:55 -05:00
committed by Seth Foster
parent 60108ebd10
commit a188798543
2 changed files with 2 additions and 1 deletions

View File

@@ -5612,6 +5612,7 @@ class InstanceSerializer(BaseSerializer):
# delete the receptor address if the port is None
instance.receptor_addresses.filter(address=instance.hostname).delete()
elif kwargs:
kwargs['canonical'] = True
instance.receptor_addresses.update_or_create(address=instance.hostname, defaults=kwargs)
return instance

View File

@@ -28,7 +28,7 @@ class ReceptorAddress(models.Model):
help_text=_("Protocol to use for the Receptor listener, 'tcp', 'wss', or 'ws'."), max_length=10, default=Protocols.TCP, choices=Protocols.choices
)
is_internal = models.BooleanField(help_text=_("If True, only routable within the Kubernetes cluster."), default=False)
canonical = models.BooleanField(help_text=_("If True, this address is the canonical address for the instance."), default=True)
canonical = models.BooleanField(help_text=_("If True, this address is the canonical address for the instance."), default=False)
peers_from_control_nodes = models.BooleanField(help_text=_("If True, control plane cluster nodes should automatically peer to it."), default=False)
instance = models.ForeignKey(
'Instance',