gardener / gardener-extension-networking-calico

Gardener extension controller for the Calico CNI network plugin.
https://gardener.cloud
Apache License 2.0
8 stars 47 forks source link

Sanity Check for dual-stack before use IPAM.CIDR #521

Closed mohamed-rafraf closed 3 weeks ago

mohamed-rafraf commented 3 weeks ago

How to categorize this PR?

This PR introduces a boolean check to determine if the cluster is dual-stack. This check prevents misconfiguration when the user specifies an ipam.cidr value. If ipam.cidr is set , it will lead to an erroneous Calico configuration for dual-stack clusters.

Example configuration:

networking:
  ipFamilies:
    - IPv4
    - IPv6
  type: calico
  nodes: 10.250.0.0/16
  providerConfig:
    apiVersion: calico.networking.extensions.gardener.cloud/v1alpha1
    kind: NetworkConfig
    ipam:
      type: host-local
      cidr: usePodCIDR

In this setup, specifying ipam.cidr can result in the Calico configuration containing incorrect ranges and subnet fields (an invalid configuration for dual-stack networks).

/area networking /kind bug

What this PR does / why we need it:

Which issue(s) this PR fixes: Fixes #

Special notes for your reviewer:

Release note:

NONE
gardener-prow[bot] commented 3 weeks ago

Hi @mohamed-rafraf. Thanks for your PR.

I'm waiting for a gardener member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.
gardener-robot commented 3 weeks ago

@mohamed-rafraf Label kind/todo does not exist.

gardener-robot commented 3 weeks ago

@mohamed-rafraf Thank you for your contribution.

gardener-robot-ci-1 commented 3 weeks ago

Thank you @mohamed-rafraf for your contribution. Before I can start building your PR, a member of the organization must set the required label(s) {'reviewed/ok-to-test'}. Once started, you can check the build status in the PR checks section below.

gardener-robot commented 3 weeks ago

@mohamed-rafraf Label kind/todo does not exist.

DockToFuture commented 3 weeks ago

/test

gardener-prow[bot] commented 3 weeks ago

@DockToFuture: The /test command needs one or more targets. The following commands are available to trigger required jobs:

Use /test all to run the following jobs that were automatically triggered:

In response to [this](https://github.com/gardener/gardener-extension-networking-calico/pull/521#issuecomment-2459793743): >/test Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.
DockToFuture commented 3 weeks ago

/test all

axel7born commented 3 weeks ago

/lgtm