Skip to content

Allow configuring the service registry in opencloud.yaml - #3875

Open
aduffeck wants to merge 4 commits into
opencloud-eu:mainfrom
aduffeck:registry-yaml-config
Open

aduffeck wants to merge 4 commits into
opencloud-eu:mainfrom
aduffeck:registry-yaml-config

Conversation

@aduffeck

@aduffeck aduffeck commented Nov 2, 2026

Copy link
Copy Markdown
Member

The service registry can only be configured through the MICRO_REGISTRY* env vars, and OC_EVENTS_ENDPOINT doesn't affect it. When services run on a different host than NATS without MICRO_REGISTRY_ADDRESS, they fall back to 127.0.0.1:9233 and exit with nats: no servers available for connection, without saying which address they tried (#3623).

Changes

  • New service_registry section in opencloud.yaml. The MICRO_REGISTRY* env vars still work and override it.
    service_registry:
      addresses:
        - nats.example.svc:9233
      auth_username: ...
      auth_password: ...
  • activitylog, auth-guest, invitations and webfinger now get the same registry addresses and credentials when MICRO_REGISTRY is set. go-micro swaps out the registry in their service.Init(), so they used to read only env.
  • The fatal registration error now logs the registry addresses, with passwords redacted.
  • opencloud version reads the config before listing services.
  • The unused registry field is gone, so an old registry: key in opencloud.yaml is still ignored.

I tested with NATS, storage-users and webfinger in separate containers, with and without NATS auth.

/cc @micbar

Fixes #3623

The registry address and credentials could only be set via the
MICRO_REGISTRY* env vars. Also log the registry address when the
registration fails.
go-micro replaces the registry in service.Init() when MICRO_REGISTRY is
set, so activitylog, auth-guest, invitations and webfinger ignored the
registry settings from opencloud.yaml.
@codacy-production

codacy-production Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 26 complexity

Metric Results
Complexity 26

View in Codacy

🟢 Coverage 74.68% diff coverage · +0.12% coverage variation

Metric Results
Coverage variation ✅ +0.12% coverage variation (-1.00%)
Diff coverage ✅ 74.68% diff coverage

View coverage diff in Codacy

Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (12d8edb) 93317 26496 28.39%
Head commit (687f663) 93386 (+69) 26625 (+129) 28.51% (+0.12%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#3875) 79 59 74.68%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

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.

Unable to connect to external nats (gateway/storage-users)

1 participant