Skip to content

Eventing TLS: Add AddressableFromDestination method on the resolver #2714

@pierDipi

Description

@pierDipi

After #2711 is implemented, as the Eventing TLS feature track describes we should add a new method on the resolver as follow:

AddressableFromDestination(ctx Context, dest Destination, parent interface{}) (*Addressable, error)

The implementation should be similar to URIFromDestination

https://github.com/knative/pkg/blob/main/resolver/addressable_resolver.go#L75-L76C10

but with the following additional algorithm/logic:

  • If status.addresses of the resolved destination is set (has at least 1 element)
    • if dest.ref.address is not specified:
      • Select the first (in order) address from all addresses
      • If no address is found use status.address of the resolved destination
    • else
      • Select the first (in order) address from all addresses with name == dest.ref.address
      • If no address is found return an error explaining that the address with name <address_value> cannot be found/resolved
  • else return status.address of the resolved destination

Since the new AddressableFromDestination is a superset of URIFromDestination, the URIFromDestination should make use of the AddressableFromDestination method but return the resolved URI

Additional Info

/good-first-issue
/kind feature
/area API

Metadata

Metadata

Assignees

Labels

area/APIgood first issueDenotes an issue ready for a new contributor, according to the "help wanted" guidelines.help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.kind/feature

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions