diff --git a/api/openapi.gen.json b/api/openapi.gen.json index f3777086..26980782 100644 --- a/api/openapi.gen.json +++ b/api/openapi.gen.json @@ -133,7 +133,7 @@ "instances": [ { "detail": { - "privateipv4": "", + "privateipv4": "10.198.0.2", "privateipv6": "", "publicdns": "", "publicipv4": "10.0.0.88" diff --git a/api/openapi.gen.yaml b/api/openapi.gen.yaml index 3729e8f1..d7974bf7 100644 --- a/api/openapi.gen.yaml +++ b/api/openapi.gen.yaml @@ -716,7 +716,7 @@ components: image_id: 08a48fed-de87-40ab-a571-f64e30bd0aa8 instances: - detail: - privateipv4: "" + privateipv4: 10.198.0.2 privateipv6: "" publicdns: "" publicipv4: 10.0.0.88 diff --git a/cmd/spec/example_reservation.go b/cmd/spec/example_reservation.go index 8b0b23a9..bbc8db45 100644 --- a/cmd/spec/example_reservation.go +++ b/cmd/spec/example_reservation.go @@ -203,8 +203,9 @@ var GCPReservationResponsePayloadDoneExample = payloads.GCPReservationResponse{ PowerOff: false, Instances: []payloads.InstanceResponse{ {InstanceID: "3003942005876582747", Detail: models.ReservationInstanceDetail{ - PublicDNS: "", - PublicIPv4: "10.0.0.88", + PublicDNS: "", + PublicIPv4: "10.0.0.88", + PrivateIPv4: "10.198.0.2", }}, }, } diff --git a/internal/clients/http/gcp/gcp_client.go b/internal/clients/http/gcp/gcp_client.go index 9fea6c74..4f51ec1b 100644 --- a/internal/clients/http/gcp/gcp_client.go +++ b/internal/clients/http/gcp/gcp_client.go @@ -316,6 +316,7 @@ func (c *gcpClient) GetInstanceDescriptionByID(ctx context.Context, id, zone str instanceId := strconv.FormatUint(instance.GetId(), 10) instanceDesc := clients.InstanceDescription{ID: instanceId} for _, n := range instance.NetworkInterfaces { + instanceDesc.PrivateIPv4 = ptr.FromOrEmpty(n.NetworkIP) if len(n.AccessConfigs) > 0 && n.AccessConfigs[0] != nil { instanceDesc.IPv4 = *n.AccessConfigs[0].NatIP break