Skip to content

Commit dde309d

Browse files
tronghnmortenlj
andcommitted
fix: fall back to primary ip if outgoing is not set
Co-authored-by: Morten Lied Johansen <[email protected]>
1 parent 82ec3a1 commit dde309d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

internal/pkg/instance/instance.go

+7-1
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,16 @@ func PrepareSourceInstance(ctx context.Context, source *resolved.Instance, targe
147147
return retry.RetryableError(err)
148148
}
149149

150+
ip := target.OutgoingIp
151+
if ip == "" {
152+
ip = target.PrimaryIp
153+
}
154+
150155
authNetwork := v1beta1.InstanceAuthorizedNetworks{
151156
Name: &target.Name,
152-
Value: fmt.Sprintf("%s/32", target.OutgoingIp),
157+
Value: fmt.Sprintf("%s/32", ip),
153158
}
159+
154160
sourceSqlInstance.Spec.Settings.IpConfiguration.AuthorizedNetworks = appendAuthNetIfNotExists(sourceSqlInstance, authNetwork)
155161

156162
authNetwork, err = createMigratorAuthNetwork()

0 commit comments

Comments
 (0)