Skip to content

Commit

Permalink
feat(HMS-2440): private IPv4 address for GCP
Browse files Browse the repository at this point in the history
  • Loading branch information
ezr-ondrej authored and avitova committed Oct 12, 2023
1 parent 2f0e4ca commit 7b4e49d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion api/openapi.gen.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
"instances": [
{
"detail": {
"privateipv4": "",
"privateipv4": "10.198.0.2",
"privateipv6": "",
"publicdns": "",
"publicipv4": "10.0.0.88"
Expand Down
2 changes: 1 addition & 1 deletion api/openapi.gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions cmd/spec/example_reservation.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
}},
},
}
Expand Down
1 change: 1 addition & 0 deletions internal/clients/http/gcp/gcp_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7b4e49d

Please sign in to comment.