CNTRLPLANE-3342: Extract support/netutil package from support/util - #8360
Conversation
|
Pipeline controller notification For optional jobs, comment This repository is configured in: LGTM mode |
|
Skipping CI for Draft Pull Request. |
|
@bryan-cox: This pull request references CNTRLPLANE-3342 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set. DetailsIn 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 openshift-eng/jira-lifecycle-plugin repository. |
📝 WalkthroughWalkthroughThis pull request refactors network-related utility functions by establishing a new 🚥 Pre-merge checks | ✅ 11 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (11 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bryan-cox The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
56b45c8 to
0ab199f
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
support/pki/kas.go (1)
14-19:⚠️ Potential issue | 🟡 MinorUse
serviceCIDRin the error message.
serviceIPis still empty whenFirstUsableIPreturns an error, so the diagnostic loses the CIDR that actually failed.Suggested fix
- return nil, nil, fmt.Errorf("cannot get the first usable IP from CIDR %s: %w", serviceIP, err) + return nil, nil, fmt.Errorf("cannot get the first usable IP from CIDR %s: %w", serviceCIDR, err)🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@support/pki/kas.go` around lines 14 - 19, The error message inside the loop that calls netutil.FirstUsableIP currently prints serviceIP (which will be empty on error) instead of the failing CIDR; update the fmt.Errorf call in the loop that iterates serviceCIDRs (where serviceIP, err := netutil.FirstUsableIP(serviceCIDR) is used) to include serviceCIDR in the formatted message so the diagnostic reports the actual CIDR that caused the error.control-plane-operator/controllers/hostedcontrolplane/kas/service.go (1)
256-260:⚠️ Potential issue | 🔴 CriticalPass the HCP name to
netutil.ReconcileInternalRouteinstead of an empty string.The call at line 260 currently passes
""for the HCP name parameter, but the function signature expectshcName string. The wrapper function receivesowner *metav1.OwnerReferenceand already usesowner.Nameat line 258, so it should be passed here as well. Other similar functions throughout the codebase (oauth/route.go, ignitionserver/route.go, metrics_proxy/route.go) correctly pass the HCP name.🛠️ Suggested fix
func ReconcileInternalRoute(route *routev1.Route, owner *metav1.OwnerReference) error { util.EnsureOwnerRef(route, owner) route.Spec.Host = fmt.Sprintf("api.%s.hypershift.local", owner.Name) // Assumes owner is the HCP - return netutil.ReconcileInternalRoute(route, "", manifests.KubeAPIServerService("").Name) + return netutil.ReconcileInternalRoute(route, owner.Name, manifests.KubeAPIServerService("").Name) }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@control-plane-operator/controllers/hostedcontrolplane/kas/service.go` around lines 256 - 260, The wrapper ReconcileInternalRoute sets route.Spec.Host using owner.Name but calls netutil.ReconcileInternalRoute with an empty HCP name; change the call to pass owner.Name instead of "" so the hcName parameter receives the hosted control plane name. Locate the call to netutil.ReconcileInternalRoute in ReconcileInternalRoute and replace the empty string argument with owner.Name (keeping manifests.KubeAPIServerService("").Name unchanged).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@support/netutil/iputil.go`:
- Around line 65-85: HostFromURL currently returns bracketed IPv6 hosts like
"[::1]" when no port is present; update HostFromURL to strip surrounding
brackets for bare IPv6 addresses before returning. Specifically, after obtaining
hostPort from parsedURL.Host and after the hasPortRegex check that determines
there is no port, detect if hostPort starts with "[" and ends with "]" and if so
remove the leading "[" and trailing "]" (return the unbracketed value); keep
existing error handling for parsing and SplitHostPort, and continue to validate
hostName where SplitHostPort is used. Ensure this fix is applied in the
HostFromURL function (and consider hasPortRegex logic) so callers receive
unbracketed IPv6 addresses for DNS/dial usage.
---
Outside diff comments:
In `@control-plane-operator/controllers/hostedcontrolplane/kas/service.go`:
- Around line 256-260: The wrapper ReconcileInternalRoute sets route.Spec.Host
using owner.Name but calls netutil.ReconcileInternalRoute with an empty HCP
name; change the call to pass owner.Name instead of "" so the hcName parameter
receives the hosted control plane name. Locate the call to
netutil.ReconcileInternalRoute in ReconcileInternalRoute and replace the empty
string argument with owner.Name (keeping manifests.KubeAPIServerService("").Name
unchanged).
In `@support/pki/kas.go`:
- Around line 14-19: The error message inside the loop that calls
netutil.FirstUsableIP currently prints serviceIP (which will be empty on error)
instead of the failing CIDR; update the fmt.Errorf call in the loop that
iterates serviceCIDRs (where serviceIP, err :=
netutil.FirstUsableIP(serviceCIDR) is used) to include serviceCIDR in the
formatted message so the diagnostic reports the actual CIDR that caused the
error.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Central YAML (inherited)
Review profile: CHILL
Plan: Enterprise
Run ID: dcf16027-3f6f-4ca8-87fa-7a01368ca400
📒 Files selected for processing (79)
cmd/cluster/core/dump.gocmd/kubeconfig/create.gocmd/oadp/common.gocmd/oadp/restore.gocontrol-plane-operator/controllers/awsprivatelink/awsprivatelink_controller.gocontrol-plane-operator/controllers/gcpprivateserviceconnect/psc_endpoint_controller.gocontrol-plane-operator/controllers/hostedcontrolplane/cloud/openstack/providerconfig.gocontrol-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.gocontrol-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller_test.gocontrol-plane-operator/controllers/hostedcontrolplane/infra/infra.gocontrol-plane-operator/controllers/hostedcontrolplane/infra/infra_test.gocontrol-plane-operator/controllers/hostedcontrolplane/ingress/router.gocontrol-plane-operator/controllers/hostedcontrolplane/ingress/router_test.gocontrol-plane-operator/controllers/hostedcontrolplane/kas/params.gocontrol-plane-operator/controllers/hostedcontrolplane/kas/service.gocontrol-plane-operator/controllers/hostedcontrolplane/multus_disable_test.gocontrol-plane-operator/controllers/hostedcontrolplane/oauth/route.gocontrol-plane-operator/controllers/hostedcontrolplane/pki/params.gocontrol-plane-operator/controllers/hostedcontrolplane/v2/cloud_controller_manager/openstack/config.gocontrol-plane-operator/controllers/hostedcontrolplane/v2/cno/component.gocontrol-plane-operator/controllers/hostedcontrolplane/v2/cno/deployment.gocontrol-plane-operator/controllers/hostedcontrolplane/v2/etcd/statefulset.gocontrol-plane-operator/controllers/hostedcontrolplane/v2/ignitionserver/pki.gocontrol-plane-operator/controllers/hostedcontrolplane/v2/ignitionserver/route.gocontrol-plane-operator/controllers/hostedcontrolplane/v2/ignitionserver/route_test.gocontrol-plane-operator/controllers/hostedcontrolplane/v2/ignitionserver/service.gocontrol-plane-operator/controllers/hostedcontrolplane/v2/ignitionserver_proxy/service.gocontrol-plane-operator/controllers/hostedcontrolplane/v2/kas/deployment.gocontrol-plane-operator/controllers/hostedcontrolplane/v2/kas/kubeconfig.gocontrol-plane-operator/controllers/hostedcontrolplane/v2/kas/params.gocontrol-plane-operator/controllers/hostedcontrolplane/v2/kcm/deployment.gocontrol-plane-operator/controllers/hostedcontrolplane/v2/metrics_proxy/route.gocontrol-plane-operator/controllers/hostedcontrolplane/v2/oapi/deployment.gocontrol-plane-operator/controllers/hostedcontrolplane/v2/oauth_apiserver/deployment.gocontrol-plane-operator/controllers/hostedcontrolplane/v2/router/config.gocontrol-plane-operator/controllers/hostedcontrolplane/v2/router/config_test.gocontrol-plane-operator/controllers/hostedcontrolplane/v2/router/util/util.gocontrol-plane-operator/hostedclusterconfigoperator/controllers/resources/kas/reconcile.gocontrol-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.gocontrol-plane-operator/hostedclusterconfigoperator/controllers/resources/resources_test.gocontrol-plane-operator/main.gohypershift-operator/controllers/hostedcluster/hostedcluster_controller.gohypershift-operator/controllers/hostedcluster/network_policies.gohypershift-operator/controllers/nodepool/apiserver-haproxy/haproxy.gohypershift-operator/controllers/nodepool/manifests.gohypershift-operator/controllers/nodepool/nto.gohypershift-operator/controllers/nodepool/nto_test.gohypershift-operator/controllers/sharedingress/sharedingress_controller.gohypershift-operator/main.gokonnectivity-https-proxy/cmd.gosharedingress-config-generator/config.gosharedingress-config-generator/config_test.gosharedingress-config-generator/controller.gosupport/conditions/conditions.gosupport/globalconfig/infrastructure.gosupport/globalconfig/installconfig.gosupport/globalconfig/network.gosupport/netutil/expose.gosupport/netutil/expose_test.gosupport/netutil/iputil.gosupport/netutil/iputil_test.gosupport/netutil/networking.gosupport/netutil/networking_test.gosupport/netutil/public.gosupport/netutil/public_test.gosupport/netutil/route.gosupport/netutil/route_test.gosupport/netutil/visibility.gosupport/netutil/visibility_test.gosupport/pki/kas.gosupport/upsert/apply.gosupport/upsert/apply_test.gosupport/util/util.gosupport/util/util_test.gotest/e2e/nodepool_mirrorconfigs_test.gotest/e2e/nodepool_nto_performanceprofile_test.gotest/e2e/util/hypershift_framework.gotest/e2e/util/oauth.gotest/e2e/util/util.go
💤 Files with no reviewable changes (2)
- support/util/util_test.go
- support/util/util.go
|
/verified by UT and e2e |
|
@bryan-cox: This PR has been marked as verified by DetailsIn 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 openshift-eng/jira-lifecycle-plugin repository. |
There was a problem hiding this comment.
♻️ Duplicate comments (1)
support/netutil/iputil.go (1)
74-76:⚠️ Potential issue | 🟡 MinorReturn unbracketed host for bare IPv6 URLs.
At Line 74, the no-port path returns
hostPortverbatim, sohttps://[::1]yields[::1]instead of::1. This is the same unresolved edge case previously raised and can break hostname/IP consumers.Proposed fix
if !hasPortRegex.MatchString(hostPort) { + if len(hostPort) >= 2 && hostPort[0] == '[' && hostPort[len(hostPort)-1] == ']' { + return hostPort[1 : len(hostPort)-1], nil + } return hostPort, nil }In Go's net/url package, what do URL.Host and URL.Hostname() return for: 1) https://[::1] 2) https://[::1]:8443🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@support/netutil/iputil.go` around lines 74 - 76, The no-port branch currently returns hostPort verbatim (when hasPortRegex fails), which leaves bracketed IPv6 hosts like "[::1]" unchanged; update that branch so when hostPort starts with '[' and ends with ']' you strip the surrounding brackets and return the inner address (e.g., "::1") instead. Locate the code using hasPortRegex and hostPort in iputil.go and add a simple check using strings.HasPrefix(hostPort, "[") && strings.HasSuffix(hostPort, "]") to return hostPort[1:len(hostPort)-1], otherwise return hostPort as before.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In `@support/netutil/iputil.go`:
- Around line 74-76: The no-port branch currently returns hostPort verbatim
(when hasPortRegex fails), which leaves bracketed IPv6 hosts like "[::1]"
unchanged; update that branch so when hostPort starts with '[' and ends with ']'
you strip the surrounding brackets and return the inner address (e.g., "::1")
instead. Locate the code using hasPortRegex and hostPort in iputil.go and add a
simple check using strings.HasPrefix(hostPort, "[") &&
strings.HasSuffix(hostPort, "]") to return hostPort[1:len(hostPort)-1],
otherwise return hostPort as before.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Central YAML (inherited)
Review profile: CHILL
Plan: Enterprise
Run ID: 4d2b4263-fdc8-45e0-9a2a-615b828ea4fa
📒 Files selected for processing (79)
cmd/cluster/core/dump.gocmd/kubeconfig/create.gocmd/oadp/common.gocmd/oadp/restore.gocontrol-plane-operator/controllers/awsprivatelink/awsprivatelink_controller.gocontrol-plane-operator/controllers/gcpprivateserviceconnect/psc_endpoint_controller.gocontrol-plane-operator/controllers/hostedcontrolplane/cloud/openstack/providerconfig.gocontrol-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.gocontrol-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller_test.gocontrol-plane-operator/controllers/hostedcontrolplane/infra/infra.gocontrol-plane-operator/controllers/hostedcontrolplane/infra/infra_test.gocontrol-plane-operator/controllers/hostedcontrolplane/ingress/router.gocontrol-plane-operator/controllers/hostedcontrolplane/ingress/router_test.gocontrol-plane-operator/controllers/hostedcontrolplane/kas/params.gocontrol-plane-operator/controllers/hostedcontrolplane/kas/service.gocontrol-plane-operator/controllers/hostedcontrolplane/multus_disable_test.gocontrol-plane-operator/controllers/hostedcontrolplane/oauth/route.gocontrol-plane-operator/controllers/hostedcontrolplane/pki/params.gocontrol-plane-operator/controllers/hostedcontrolplane/v2/cloud_controller_manager/openstack/config.gocontrol-plane-operator/controllers/hostedcontrolplane/v2/cno/component.gocontrol-plane-operator/controllers/hostedcontrolplane/v2/cno/deployment.gocontrol-plane-operator/controllers/hostedcontrolplane/v2/etcd/statefulset.gocontrol-plane-operator/controllers/hostedcontrolplane/v2/ignitionserver/pki.gocontrol-plane-operator/controllers/hostedcontrolplane/v2/ignitionserver/route.gocontrol-plane-operator/controllers/hostedcontrolplane/v2/ignitionserver/route_test.gocontrol-plane-operator/controllers/hostedcontrolplane/v2/ignitionserver/service.gocontrol-plane-operator/controllers/hostedcontrolplane/v2/ignitionserver_proxy/service.gocontrol-plane-operator/controllers/hostedcontrolplane/v2/kas/deployment.gocontrol-plane-operator/controllers/hostedcontrolplane/v2/kas/kubeconfig.gocontrol-plane-operator/controllers/hostedcontrolplane/v2/kas/params.gocontrol-plane-operator/controllers/hostedcontrolplane/v2/kcm/deployment.gocontrol-plane-operator/controllers/hostedcontrolplane/v2/metrics_proxy/route.gocontrol-plane-operator/controllers/hostedcontrolplane/v2/oapi/deployment.gocontrol-plane-operator/controllers/hostedcontrolplane/v2/oauth_apiserver/deployment.gocontrol-plane-operator/controllers/hostedcontrolplane/v2/router/config.gocontrol-plane-operator/controllers/hostedcontrolplane/v2/router/config_test.gocontrol-plane-operator/controllers/hostedcontrolplane/v2/router/util/util.gocontrol-plane-operator/hostedclusterconfigoperator/controllers/resources/kas/reconcile.gocontrol-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.gocontrol-plane-operator/hostedclusterconfigoperator/controllers/resources/resources_test.gocontrol-plane-operator/main.gohypershift-operator/controllers/hostedcluster/hostedcluster_controller.gohypershift-operator/controllers/hostedcluster/network_policies.gohypershift-operator/controllers/nodepool/apiserver-haproxy/haproxy.gohypershift-operator/controllers/nodepool/manifests.gohypershift-operator/controllers/nodepool/nto.gohypershift-operator/controllers/nodepool/nto_test.gohypershift-operator/controllers/sharedingress/sharedingress_controller.gohypershift-operator/main.gokonnectivity-https-proxy/cmd.gosharedingress-config-generator/config.gosharedingress-config-generator/config_test.gosharedingress-config-generator/controller.gosupport/conditions/conditions.gosupport/globalconfig/infrastructure.gosupport/globalconfig/installconfig.gosupport/globalconfig/network.gosupport/netutil/expose.gosupport/netutil/expose_test.gosupport/netutil/iputil.gosupport/netutil/iputil_test.gosupport/netutil/networking.gosupport/netutil/networking_test.gosupport/netutil/public.gosupport/netutil/public_test.gosupport/netutil/route.gosupport/netutil/route_test.gosupport/netutil/visibility.gosupport/netutil/visibility_test.gosupport/pki/kas.gosupport/upsert/apply.gosupport/upsert/apply_test.gosupport/util/util.gosupport/util/util_test.gotest/e2e/nodepool_mirrorconfigs_test.gotest/e2e/nodepool_nto_performanceprofile_test.gotest/e2e/util/hypershift_framework.gotest/e2e/util/oauth.gotest/e2e/util/util.go
💤 Files with no reviewable changes (2)
- support/util/util_test.go
- support/util/util.go
✅ Files skipped from review due to trivial changes (43)
- support/netutil/public.go
- support/netutil/networking.go
- support/netutil/visibility.go
- support/netutil/visibility_test.go
- support/netutil/networking_test.go
- support/netutil/route.go
- support/globalconfig/installconfig.go
- support/netutil/expose_test.go
- support/netutil/public_test.go
- control-plane-operator/controllers/hostedcontrolplane/v2/router/config.go
- support/netutil/route_test.go
- test/e2e/nodepool_mirrorconfigs_test.go
- control-plane-operator/controllers/hostedcontrolplane/cloud/openstack/providerconfig.go
- support/netutil/expose.go
- control-plane-operator/controllers/hostedcontrolplane/v2/cloud_controller_manager/openstack/config.go
- konnectivity-https-proxy/cmd.go
- hypershift-operator/controllers/nodepool/manifests.go
- control-plane-operator/controllers/hostedcontrolplane/kas/params.go
- cmd/oadp/restore.go
- control-plane-operator/hostedclusterconfigoperator/controllers/resources/kas/reconcile.go
- control-plane-operator/controllers/hostedcontrolplane/v2/ignitionserver/service.go
- support/conditions/conditions.go
- support/pki/kas.go
- control-plane-operator/controllers/hostedcontrolplane/ingress/router_test.go
- control-plane-operator/controllers/hostedcontrolplane/v2/kcm/deployment.go
- support/globalconfig/infrastructure.go
- control-plane-operator/controllers/hostedcontrolplane/multus_disable_test.go
- control-plane-operator/controllers/hostedcontrolplane/v2/ignitionserver_proxy/service.go
- control-plane-operator/controllers/hostedcontrolplane/v2/etcd/statefulset.go
- control-plane-operator/controllers/hostedcontrolplane/v2/router/config_test.go
- control-plane-operator/controllers/hostedcontrolplane/v2/ignitionserver/pki.go
- sharedingress-config-generator/config.go
- control-plane-operator/controllers/hostedcontrolplane/v2/ignitionserver/route_test.go
- control-plane-operator/controllers/hostedcontrolplane/v2/metrics_proxy/route.go
- control-plane-operator/controllers/hostedcontrolplane/v2/router/util/util.go
- control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go
- control-plane-operator/controllers/hostedcontrolplane/infra/infra_test.go
- test/e2e/util/hypershift_framework.go
- control-plane-operator/controllers/hostedcontrolplane/oauth/route.go
- control-plane-operator/controllers/hostedcontrolplane/pki/params.go
- hypershift-operator/controllers/nodepool/nto_test.go
- control-plane-operator/controllers/hostedcontrolplane/v2/kas/kubeconfig.go
- support/upsert/apply_test.go
🚧 Files skipped from review as they are similar to previous changes (20)
- control-plane-operator/controllers/hostedcontrolplane/v2/oapi/deployment.go
- sharedingress-config-generator/config_test.go
- control-plane-operator/controllers/hostedcontrolplane/v2/cno/component.go
- test/e2e/util/oauth.go
- control-plane-operator/controllers/hostedcontrolplane/v2/kas/params.go
- support/upsert/apply.go
- test/e2e/nodepool_nto_performanceprofile_test.go
- sharedingress-config-generator/controller.go
- hypershift-operator/controllers/nodepool/nto.go
- cmd/cluster/core/dump.go
- control-plane-operator/controllers/hostedcontrolplane/v2/ignitionserver/route.go
- support/globalconfig/network.go
- cmd/kubeconfig/create.go
- control-plane-operator/controllers/gcpprivateserviceconnect/psc_endpoint_controller.go
- control-plane-operator/main.go
- control-plane-operator/controllers/hostedcontrolplane/kas/service.go
- control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller_test.go
- control-plane-operator/controllers/hostedcontrolplane/v2/kas/deployment.go
- test/e2e/util/util.go
- control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources_test.go
Move network visibility, route management, service publishing, networking, and IP utility functions into a new cohesive support/netutil package. Files moved via git mv: visibility.go, route.go, expose.go, networking.go, public.go and their corresponding test files. Functions extracted from util.go into new iputil.go: IsIPv4CIDR, IsIPv4Address, FirstUsableIP, ResolveDNSHostname, HostFromURL. Tests extracted from util_test.go into new iputil_test.go. Signed-off-by: Bryan Cox <brcox@redhat.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Update all callers across the codebase to import and reference symbols from the new support/netutil package instead of support/util. Files that only used extracted symbols have their support/util import removed entirely. Files using both extracted and remaining symbols retain both imports. Signed-off-by: Bryan Cox <brcox@redhat.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
0ab199f to
c55ad86
Compare
|
/lgtm |
|
Scheduling tests matching the |
|
/verified by UT & e2e |
|
@bryan-cox: This PR has been marked as verified by DetailsIn 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 openshift-eng/jira-lifecycle-plugin repository. |
Test Resultse2e-aks
e2e-aws
|
AI Test Failure AnalysisJob: Generated by hypershift-analyze-e2e-failure post-step using Claude claude-opus-4-6 |
|
/test e2e-aws |
AI Test Failure AnalysisJob: Generated by hypershift-analyze-e2e-failure post-step using Claude claude-opus-4-6 |
|
/test e2e-aws |
|
/override "ci/prow/verify-workflows" |
|
@bryan-cox: Overrode contexts on behalf of bryan-cox: ci/prow/verify-workflows DetailsIn 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-sigs/prow repository. |
|
@bryan-cox: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions 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-sigs/prow repository. I understand the commands that are listed here. |
Test Failure Analysis CompleteJob Information
Test Failure AnalysisErrorSummaryThe Root CauseThe root cause is a stale PR branch — a race condition between two PRs from the same author (bryan-cox):
The Recommendations
Evidence
|
What this PR does / why we need it:
Extracts network visibility, route management, service publishing, networking, and IP utility functions from the monolithic
support/util/package (632 importers) into a new focusedsupport/netutil/package (~60 callers).This improves discoverability by name and bounds the blast radius of network-related changes. The extracted functions form a cohesive cluster covering:
IsPrivateHCP,IsPublicHCP,IsPrivateHC,IsPublicHC,LabelHCPRoutesReconcileExternalRoute,ReconcileInternalRoute,HCPRouteLabel,ShortenName, etc.ServicePublishingStrategyByTypeForHCP,IsLBKAS,IsRouteKAS,UseDedicatedDNS, etc.MachineCIDRs,ServiceCIDRs,KASPodPort,AdvertiseAddress, etc.ConnectsThroughInternetToControlplaneIsIPv4CIDR,IsIPv4Address,FirstUsableIP,ResolveDNSHostname,HostFromURLClean break — no forwarding functions left in
support/util/.Which issue(s) this PR fixes:
Fixes https://issues.redhat.com/browse/CNTRLPLANE-3342
Special notes for your reviewer:
git mvto preserve historygo build ./...,go test ./support/netutil/...,make lint, andmake run-gitlintall passChecklist:
Summary by CodeRabbit
Refactor
New Features
Tests