-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
🐛 ipam: fix gateway being required for IPAddress #8506
🐛 ipam: fix gateway being required for IPAddress #8506
Conversation
f5e6246
to
e498306
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
I don't have any expertise in the IPAM provider, but this change seems to make sense.
LGTM label has been added. Git tree hash: b1c1c5010355868c45260ded50512732577c365f
|
e498306
to
450658e
Compare
there is an alternative implementation here, that makes gateway required for ipv4, and allows it to be optional with ipv6: #8525 /hold |
@schrej can you maybe open an issue for discussion? Then we can close/open PRs according to consensus |
/unhold |
450658e
to
d9a6aa7
Compare
/lgtm Maybe you want to do a quick manual test somewhere to see if it works as expected (as we don't have e2e test coverage with IPAM) |
LGTM label has been added. Git tree hash: 4118c42282f5fa0f41d6c98d36851a0e5a1d7f55
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe you want to do a quick manual test somewhere to see if it works as expected (as we don't have e2e test coverage with IPAM)
Maybe a stupid question - really don't know much about the IPAM implementations - how difficult would it be to set up an e2e test for this API? Could we create a simplified provider or use an existing one?
Depends on what's considered end-to-end for this API at this level. Imo we need to ensure that the two IPAM resources work as expected/defined, so IPAM and infra providers can rely on it. If we want to include the apiserver in the scope, we could use envtest - but I don't know if and how webhooks can be tested with that. For now we have unit tests for what those webhooks do. The ipam providers should of course have e2e tests with these resources (we currently do not, since envtest doesn't run webhooks). Same goes for infra providers that want to support the contract. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/approve
Based on the discussion in the related issue
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: vincepri The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
I'd be interested in this being backported to release 1.4 if we could. |
/cherry-pick release-1.4 |
@vincepri: cannot checkout In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@vincepri: new pull request created: #8574 In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/area ipam |
What this PR does / why we need it:
The validating webhook for IPAddress ensures that
.spec.gateway
is a valid IP address. This check fails if the field is empty, making it a required field. Since it is defined asomitempty
it should be optional.This PR wraps it with an is-empty check to allow the field to be empty.
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):related to kubernetes-sigs/cluster-api-ipam-provider-in-cluster#70
Fixes #8536