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

Enhance docker network ipaddresspool #418

Merged
merged 4 commits into from
Feb 14, 2024

Conversation

eguzki
Copy link
Contributor

@eguzki eguzki commented Feb 9, 2024

What

metallb is configured with the network address, or subnet, of the docker network defined by kind.

docker network inspect kind looks like

[
    {
        "Name": "kind",
        "Id": "c9a255dd3206276365f3f00c6d87d921f9eb43d6e9fa8193180615c4b48a4b9f",
        "Created": "2024-02-08T19:18:10.314623672+01:00",
        "Scope": "local",
        "Driver": "bridge",
        "EnableIPv6": true,
        "IPAM": {
            "Driver": "default",
            "Options": {},
            "Config": [
                {
                    "Subnet": "172.18.0.0/16",
                    "Gateway": "172.18.0.1"
                },
                {
                    "Subnet": "fc00:f853:ccd:e793::/64",
                    "Gateway": "fc00:f853:ccd:e793::1"
                }
            ]
        },
        "Internal": false,
        "Attachable": false,
        "Ingress": false,
        "ConfigFrom": {
            "Network": ""
        },
        "ConfigOnly": false,
        "Containers": {},
        "Options": {
            "com.docker.network.bridge.enable_ip_masquerade": "true",
            "com.docker.network.driver.mtu": "1500"
        },
        "Labels": {}
    }
]

Currently, the script utils/docker-network-ipaddresspool.sh was parsing only the first item of the IPAM.Config list. When IPv6 is also there, the order of the items is not assured. So it can also be

"IPAM": {
            "Driver": "default",
            "Options": {},
            "Config": [
                {
                    "Subnet": "fc00:f853:ccd:e793::/64"
                },
                {
                    "Subnet": "172.18.0.0/16",
                    "Gateway": "172.18.0.1"
                }
            ]
        },

This PR enhances the script to read only IPv4 subnets.

@eguzki eguzki requested a review from a team as a code owner February 9, 2024 10:53
Copy link

codecov bot commented Feb 9, 2024

Codecov Report

Merging #418 (8d973b9) into main (133645e) will decrease coverage by 0.67%.
The diff coverage is n/a.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #418      +/-   ##
==========================================
- Coverage   66.41%   65.75%   -0.67%     
==========================================
  Files          38       38              
  Lines        3901     3901              
==========================================
- Hits         2591     2565      -26     
- Misses       1125     1146      +21     
- Partials      185      190       +5     
Flag Coverage Δ
integration 70.40% <ø> (-1.29%) ⬇️
unit 60.69% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
api/v1beta1 (u) ∅ <ø> (∅)
pkg/common (u) 78.59% <ø> (ø)
pkg/istio (u) 37.11% <ø> (ø)
pkg/log (u) 31.81% <ø> (ø)
pkg/reconcilers (u) 33.44% <ø> (ø)
pkg/rlptools (u) 56.46% <ø> (ø)
controllers (i) 70.40% <ø> (-1.29%) ⬇️

see 5 files with indirect coverage changes

Copy link
Collaborator

@didierofrivia didierofrivia left a comment

Choose a reason for hiding this comment

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

🍪

@eguzki
Copy link
Contributor Author

eguzki commented Feb 13, 2024

@mikenairn ready to review. Can you check it works for you as well? 🙏

Copy link
Member

@mikenairn mikenairn left a comment

Choose a reason for hiding this comment

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

Tried locally, all seems to be working as expected 👍

@eguzki eguzki merged commit a825617 into main Feb 14, 2024
21 checks passed
@eguzki eguzki deleted the enhance-docker-network-ipaddresspool branch February 14, 2024 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants