-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
ExtraPortMapping Validation #3302
ExtraPortMapping Validation #3302
Conversation
bc44865
to
7620fc4
Compare
pkg/internal/apis/config/validate.go
Outdated
// using default listen address | ||
if portMapping.ListenAddress == "" { | ||
portMapping.ListenAddress = wildcardAddrIPv4.String() | ||
} | ||
|
||
// using default protool | ||
if portMapping.Protocol == "" { | ||
portMapping.Protocol = PortMappingProtocolTCP | ||
} |
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.
we have a default stage in pkg/internal/apis/config/default.go
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.
point is we should default things in defaulting stage, not here in validation
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.
should I remove defaults from pkg/cluster/internal/providers/<provider>/provision.go
then and add it as part of SetDefaultsCluster in default stage .. defaulting with respect to provider ?
kind/pkg/cluster/internal/providers/docker/provision.go
Lines 363 to 377 in 3610f60
// do provider internal defaulting | |
// in a future API revision we will handle this at the API level and remove this | |
if pm.ListenAddress == "" { | |
switch clusterIPFamily { | |
case config.IPv4Family, config.DualStackFamily: | |
pm.ListenAddress = "0.0.0.0" // this is the docker default anyhow | |
case config.IPv6Family: | |
pm.ListenAddress = "::" | |
default: | |
return nil, errors.Errorf("unknown cluster IP family: %v", clusterIPFamily) | |
} | |
} | |
if string(pm.Protocol) == "" { | |
pm.Protocol = config.PortMappingProtocolTCP // TCP is the default | |
} |
kind/pkg/cluster/internal/providers/podman/provision.go
Lines 376 to 390 in 3610f60
// do provider internal defaulting | |
// in a future API revision we will handle this at the API level and remove this | |
if pm.ListenAddress == "" { | |
switch clusterIPFamily { | |
case config.IPv4Family, config.DualStackFamily: | |
pm.ListenAddress = "0.0.0.0" | |
case config.IPv6Family: | |
pm.ListenAddress = "::" | |
default: | |
return nil, errors.Errorf("unknown cluster IP family: %v", clusterIPFamily) | |
} | |
} | |
if string(pm.Protocol) == "" { | |
pm.Protocol = config.PortMappingProtocolTCP // TCP is the default | |
} |
7620fc4
to
62018bd
Compare
/lgtm for final approval |
/lgtm cancel don't we need to modify |
@aojea Is |
62018bd
to
9ba8845
Compare
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: aroradaman The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
fb8fe10
to
c5bc252
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.
I've been out sick and I'm going to need some more time to think about how to better structure this, but I don't think exporting all of these values is the answer.
Thanks for working on this problem!
Just following up to find out what's the current thoughts on this PR, I'm looking for a resolution to #3301. @BenTheElder Is the feedback more around the implementation details of this PR or is the above mentioned issue the desired behaviour of kind moving forward post v0.18.0? |
I was hoping for a response to the existing comments before reviewing further. |
c5bc252
to
c4c87b7
Compare
c4c87b7
to
dbec326
Compare
dbec326
to
dea0eaa
Compare
Signed-off-by: Daman Arora <[email protected]>
Signed-off-by: Daman Arora <[email protected]>
dea0eaa
to
6fa6758
Compare
/retest |
@aroradaman is there anything I can help with here? Or is this a test that could pass with a retest? |
@prahaladramji I don't think retest would help here, and also the error is not related to this PR. @BenTheElder do we still need |
@aroradaman: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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. I understand the commands that are listed here. |
/test pull-kind-e2e-kubernetes-1-29 |
ping @BenTheElder |
The 1 failing check seemes to be related to vagrant as part of the ci step and not related to this change. A general look at that error seems like it could just be flakey vagrant step (potentially a retry may work). But if not, I'm happy to try and help look at fixing that step. |
PR needs rebase. 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. |
/close in favor of #3513 |
Using random host ports for validating extra port mapping defined without host ports (default behaviour for provider docker and podman)
Fixes #3301