Skip to content

[FEA]: Honor proxyUrl from the cluster Secret when writing CCLClusterConfig #166

Done

Description

@anandj91

Is this a new feature, an improvement, or a change to existing functionality?

Improvement

Please provide a clear description of problem this feature solves

The cp operator connects to an infra-plane cluster with the same credentials Secret Argo CD uses, rebuilt into a rest.Config by remote.RESTConfig (internal/remote/remote.go). It ignores Argo CD's documented config.proxyUrl. For a cluster reachable only through that proxy, Argo CD deploys fine, but the operator connects directly, and the CCLInfraPlane stays ClusterConfigApplied=False/ClusterUnreachable and never gets its CCLClusterConfig.

Raised by Codex on #160: #160 (comment)

Describe your ideal solution

Read proxyUrl and set rest.Config.Proxy:

type clusterConfig struct {
	// ...
	ProxyURL string `json:"proxyUrl,omitempty"`
}

// in RESTConfig, for a remote cluster:
if cfg.ProxyURL != "" {
	proxyURL, err := url.Parse(cfg.ProxyURL)
	if err != nil {
		// Not wrapped: the URL can carry proxy credentials.
		return nil, fmt.Errorf("%w: proxyUrl of Secret %s/%s is not a valid URL",
			ErrInvalidCredentials, secret.Namespace, secret.Name)
	}
	restConfig.Proxy = http.ProxyURL(proxyURL)
}
  • Unit tests in internal/remote/remote_test.go: Proxy(req) returns the configured URL; a proxyUrl with a control character (\u007f, so the JSON still parses and url.Parse is what fails) returns ErrInvalidCredentials, and the error names proxyUrl without quoting it.
  • DESIGN.md: list proxyUrl among the keys internal/remote reads, and add it to what InvalidCredentials covers.

Activity

  1. linear commented on Oct 25, 2026

    @linear
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions