Skip to content

Conversation

@Clee2691
Copy link
Contributor

@Clee2691 Clee2691 commented Nov 3, 2025

Description

This PR fixes an issue where Vector collectors cannot access log stores outside the cluster when both restrictive network policies are enabled and the cluster has a cluster-wide proxy configured.

CLO will attempt to parse the port from the proxy URLS based on the proxy variables:

  • HTTP_PROXY
  • HTTPS_PROXY

If the port is not specified for the proxy URL, it will add the default ports for the specific schema

  • HTTP: 80
  • HTTPS: 443

/cc @cahartma @vparfonov
/assign @jcantrill

Links

…trict network policy is enabled and the cluster has cluster-wide proxy.
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Nov 3, 2025
@openshift-ci-robot
Copy link

openshift-ci-robot commented Nov 3, 2025

@Clee2691: This pull request references LOG-8068 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 bug to target the "4.8.0" version, but no target version was set.

In response to this:

Description

This PR fixes an issue where Vector collectors cannot access log stores outside the cluster when both restrictive network policies are enabled and the cluster has a cluster-wide proxy configured.

CLO will attempt to parse the port from the proxy URLS based on the proxy variables:

  • HTTP_PROXY
  • HTTPS_PROXY

If the port is not specified for the proxy URL, it will add the default ports for the specific schema

  • HTTP: 80
  • HTTPS: 443

/cc @cahartma @vparfonov
/assign @jcantrill

Links

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.

@openshift-ci openshift-ci bot requested review from cahartma and vparfonov November 3, 2025 17:32
@Clee2691
Copy link
Contributor Author

Clee2691 commented Nov 3, 2025

/retest

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 3, 2025

@Clee2691: all tests passed!

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

for _, envVar := range proxyEnvVars {
// Process proxy environment variables
if proxyEnvNames.Has(envVar.Name) {
if port := parsePortProtocolFromURL(envVar.Value); port != nil {
Copy link
Contributor

@cahartma cahartma Nov 3, 2025

Choose a reason for hiding this comment

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

corrected:
In the case where the parseUrl fails, it will end up running url.Parse() twice .
maybe the line above could be changed to something like:
if (envVar.Name == "http_proxy" || envVar.Name == "https_proxy") && envVar.Value != "" {
in that case you wouldn't need to create the set and the extra nested if. lmk if you want to chat.

} else if envVar.Value != "" {
// If no explicit port, add default port based on scheme
if parsedURL, err := url.Parse(envVar.Value); err == nil {
var defaultPort int32
Copy link
Contributor

Choose a reason for hiding this comment

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

I would have thought you can use getDefaultPort() here?

Copy link
Contributor

@cahartma cahartma Nov 3, 2025

Choose a reason for hiding this comment

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

otherwise, I would create a quick helper below this: getProxyDefaultPort(scheme) to help clean up the many nested possibilities.
you could return a boolean so you don't have to run the final if > 0. To use the helper, my suggestion would be to simplify the final check:
defaultPort, ok := getProxyDefaultPort(parsedURL.Scheme); ok { portProtocolMap[....] = true }

BeforeEach(func() {
// Save original environment variables
originalEnvVars = make(map[string]string)
for _, envVar := range []string{"HTTP_PROXY", "HTTPS_PROXY", "http_proxy", "https_proxy", "NO_PROXY", "no_proxy"} {
Copy link
Contributor

Choose a reason for hiding this comment

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

I would use util.GetProxyEnvVars() here.

@jcantrill
Copy link
Contributor

/hold

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 4, 2025
Copy link
Contributor

@jcantrill jcantrill left a comment

Choose a reason for hiding this comment

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

/approve

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 4, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Clee2691, jcantrill

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. release/6.4

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants