Skip to content

collector: honor clustering TLS for cluster API clients - #903

Merged
karimra merged 1 commit into
openconfig:mainfrom
dlanov:fix-891-collector-clustering-tls
Aug 7, 2026
Merged

collector: honor clustering TLS for cluster API clients#903
karimra merged 1 commit into
openconfig:mainfrom
dlanov:fix-891-collector-clustering-tls

Conversation

@dlanov

@dlanov dlanov commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Fixes #891.

Summary

Collector-mode cluster dispatch used plain HTTP clients, so leader-to-member API calls ignored clustering.tls. This prevented the clients from trusting private certificate authorities or presenting client certificates for mTLS.

This change:

  • builds the collector cluster API client from clustering.tls after environment expansion
  • shares the configured client between the cluster manager and assigner
  • preserves the existing 10-second timeout
  • preserves the existing default verified transport when clustering.tls is not configured
  • keeps the exported NewAssigner API unchanged

Testing

  • go test ./pkg/collector/managers/cluster/... -count=1
  • go test ./pkg/collector/... -count=1
  • go build ./...
  • go vet ./pkg/collector/...
  • git diff --check

The tests cover:

  • existing behavior without a TLS configuration
  • failure when configured certificate files cannot be loaded
  • successful leader-to-member mTLS using a private CA and client certificate
  • rejection when the server requires a client certificate but the client does not provide one

Collector-mode cluster dispatch used plain HTTP clients, so leader-to-member API calls ignored clustering TLS settings and could not use private CAs or present client certificates.

Build the shared dispatch client from the configured clustering TLS settings after environment expansion. Preserve the existing timeout and default transport behavior when TLS is not configured.

Signed-off-by: Dennis Lanov <dennis.lanov@gmail.com>
@karimra

karimra commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the contribution!

@karimra
karimra merged commit a156752 into openconfig:main Aug 7, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] Collector mode ignores clustering.tls: leader→member API dispatch cannot use TLS client certs (mTLS impossible, private-CA server certs fail)

2 participants