Add Channels with no subscribers to configmap
If a channel has no subscribers, it should still be in the configmap.
This allows the dispatcher to respond with a 202 to a publish request
(then drop the published event).
@@ -385,17 +385,17 @@ func (r *reconciler) createNewConfigMap(data map[string]string) *corev1.ConfigMa
func multiChannelFanoutConfig(channels []eventingv1alpha1.Channel) *multichannelfanout.Config {
cc := make([]multichannelfanout.ChannelConfig, 0)
for _, c := range channels {
- channelable := c.Spec.Channelable
- if channelable != nil {
- cc = append(cc, multichannelfanout.ChannelConfig{
+ channelConfig := multichannelfanout.ChannelConfig{
Namespace: c.Namespace,
Name: c.Name,
- FanoutConfig: fanout.Config{
+ }
+ if c.Spec.Channelable != nil {
+ channelConfig.FanoutConfig = fanout.Config{
Subscriptions: c.Spec.Channelable.Subscribers,
- },
- })
}
}
+ cc = append(cc, channelConfig)
+ }
return &multichannelfanout.Config{
ChannelConfigs: cc,
}
