Skip to content

Eventing TLS: support creating TLS server for InMemoryChannel dispatcher #6874

@pierDipi

Description

@pierDipi

Problem

After #6865 and #6837, we the foundation bits to enabled the imc-dispatcher to create a TLS server when the transport-encryption feature flag is set to Permissive or Strict.

We need to make sure that the dispatcher is creating such TLS server on the fly without restarts by watching the config-features ConfigMap with the below snippet in pkg/reconciler/inmemorychannel/dispatcher/controller.go:

	featureStore := feature.NewStore(logging.FromContext(ctx).Named("feature-config-store"), func(name string, value interface{}) {
		
		impl.GlobalResync(inmemorychannelInformer.Informer())

	})
	featureStore.WatchConfigs(cmw)

and then create the TLS message receiver as part of the NewFanoutMessageHandler

handler := r.multiChannelMessageHandler.GetChannelHandler(config.HostName)
if handler == nil {
// No handler yet, create one.
fanoutHandler, err := fanout.NewFanoutMessageHandler(
logging.FromContext(ctx).Desugar(),
channel.NewMessageDispatcher(logging.FromContext(ctx).Desugar()),
config.FanoutConfig,
r.reporter,
)
if err != nil {
logging.FromContext(ctx).Error("Failed to create a new fanout.MessageHandler", err)
return err
}
r.multiChannelMessageHandler.SetChannelHandler(config.HostName, fanoutHandler)

Even if an handler is present, we need to make sure to have the TLS server is present when transport-encryption feature flag is set to Permissive or Strict

Exit Criteria

imc-dispatcher accepts TLS connections that are handled with path-based routing #6865

Additional context (optional)

/help

Metadata

Metadata

Assignees

Labels

help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.kind/feature-request

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions