Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ipam): show private ips on resources #2759

Draft
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

yfodil
Copy link
Contributor

@yfodil yfodil commented Oct 2, 2024

No description provided.

@yfodil yfodil added the vpc Virtual Private Cloud (VPC) issues, bugs and feature requests label Oct 2, 2024
@yfodil yfodil self-assigned this Oct 2, 2024
@github-actions github-actions bot added rdb Managed MySQL and PostgreSQL issues, bugs and feature requests load-balancer Load-balancer issues, bugs and feature requests k8s Kubernetes Kapsule issues, bugs and feature requests instance Instance issues, bugs and feature requests redis Managed Redis issues, bugs and feature requests baremetal vpcgw labels Oct 2, 2024
@github-actions github-actions bot added the iot IoT issues, bugs and feature requests label Oct 3, 2024
@codecov-commenter
Copy link

codecov-commenter commented Oct 3, 2024

Codecov Report

Attention: Patch coverage is 84.48276% with 36 lines in your changes missing coverage. Please review.

Project coverage is 71.40%. Comparing base (fe86049) to head (9619f51).
Report is 199 commits behind head on master.

Files with missing lines Patch % Lines
internal/services/ipam/helpers.go 71.42% 4 Missing and 4 partials ⚠️
internal/services/k8s/pool.go 85.00% 3 Missing and 3 partials ⚠️
internal/services/instance/private_nic.go 87.09% 2 Missing and 2 partials ⚠️
internal/services/instance/server.go 77.77% 2 Missing and 2 partials ⚠️
internal/services/redis/cluster.go 80.00% 2 Missing and 2 partials ⚠️
internal/services/vpcgw/network.go 88.23% 2 Missing and 2 partials ⚠️
internal/services/baremetal/server.go 86.66% 1 Missing and 1 partial ⚠️
internal/services/lb/lb.go 86.66% 1 Missing and 1 partial ⚠️
internal/services/rdb/instance.go 93.33% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2759      +/-   ##
==========================================
- Coverage   71.43%   71.40%   -0.04%     
==========================================
  Files         277      328      +51     
  Lines       35875    33151    -2724     
==========================================
- Hits        25628    23672    -1956     
+ Misses       8028     7215     -813     
- Partials     2219     2264      +45     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@yfodil yfodil marked this pull request as ready for review October 4, 2024 07:53
privateNetworkIDs = append(privateNetworkIDs, pn.PrivateNetworkID)
}

var allPrivateIPs []map[string]interface{}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Considering server will have at least 1 IP per connected private network. This should be allocated for the minimum size.

if pnI, pnExist := flattenPrivateNetwork(res.Endpoints); pnExist {
_ = d.Set("private_network", pnI)

if res.Endpoints[0].PrivateNetwork.ProvisioningMode == rdb.EndpointPrivateNetworkDetailsProvisioningModeIpam {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can the first endpoint be something else than a private network ? res.Endpoints[0].PrivateNetwork may be nil

"address": {
Type: schema.TypeString,
Computed: true,
Description: "The private IP address",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would precise that it is an IPv4

"id": {
Type: schema.TypeString,
Computed: true,
Description: "The ID of the IP address resource",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would precise it is an IPv4

"address": {
Type: schema.TypeString,
Computed: true,
Description: "The private IP address",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would precise it is an IPv4

"id": {
Type: schema.TypeString,
Computed: true,
Description: "The ID of the IP address resource",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would precise it is an IPv4

"address": {
Type: schema.TypeString,
Computed: true,
Description: "The private IP address",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would precise it is an IPv4

"id": {
Type: schema.TypeString,
Computed: true,
Description: "The ID of the IP address resource",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would precise it is an IPv4

"address": {
Type: schema.TypeString,
Computed: true,
Description: "The private IP address",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would precise it is an IPv4

@@ -252,6 +252,10 @@ attached to the server. Updates to this field will trigger a stop/start of the s
- `private_network` - (Optional) The private network associated with the server.
Use the `pn_id` key to attach a [private_network](https://www.scaleway.com/en/developers/api/instance/#path-private-nics-list-all-private-nics) on your instance.

- `private_ip` - The list of private IP addresses associated with the resource.
- `id` - The ID of the IP address resource.
- `address` - The private IP address.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would precise it is an IPv4

@@ -244,6 +246,25 @@ If this behaviour is wanted, please set 'reinstall_on_ssh_key_changes' argument
},
},
},
"private_ip": {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would plural make sense here if it is a list?

@remyleone remyleone marked this pull request as draft October 28, 2024 14:55
@remyleone remyleone added the priority:high New features label Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
baremetal instance Instance issues, bugs and feature requests iot IoT issues, bugs and feature requests k8s Kubernetes Kapsule issues, bugs and feature requests load-balancer Load-balancer issues, bugs and feature requests priority:high New features rdb Managed MySQL and PostgreSQL issues, bugs and feature requests redis Managed Redis issues, bugs and feature requests vpc Virtual Private Cloud (VPC) issues, bugs and feature requests vpcgw
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants