Skip to content

Extend RegisteredDataStore with upstream storage #1790

@philbrookes

Description

@philbrookes

Objective

Add upstream registration storage to RegisteredDataStore in internal/extension/registry.go to support the RegisterUpstreamMethod feature.

Details

Add a new registeredUpstreams map alongside the existing dataProviders and subscriptions maps. Introduce the following types:

type RegisteredUpstreamKey struct {
    Policy ResourceID
    URL    string
}

type RegisteredUpstreamEntry struct {
    URL         string
    ClusterName string       // generated: ext-{host}-{port}
    TargetRef   TargetRef    // extracted from policy at registration time
    FailureMode string
    Timeout     string
}

type TargetRef struct {
    Group     string
    Kind      string
    Name      string
    Namespace string
}

Extend ClearPolicyData to also clear registered upstreams for the deleted policy.

Checklist

  • Add registeredUpstreams map to RegisteredDataStore
  • Add RegisteredUpstreamKey, RegisteredUpstreamEntry, TargetRef types
  • Extend ClearPolicyData to clear upstreams by policy
  • Unit tests for CRUD operations and cleanup

Notes

The PR description should include instructions for reviewing and manually confirming the solution functions locally.

References

Metadata

Metadata

Assignees

Labels

feat/extensionsLabel created for organizing the work related to extensions. Felt pretty, might delete later.kind/enhancementNew feature or request

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions