Skip to content
Snippets Groups Projects
Commit 2c292253 authored by Harald Mueller's avatar Harald Mueller
Browse files

use previous ChannelId for l2sm

parent 428fc890
No related branches found
No related tags found
No related merge requests found
Pipeline #52238 failed
...@@ -44,7 +44,7 @@ func ChannelServiceName(channel crd.Channel) string { ...@@ -44,7 +44,7 @@ func ChannelServiceName(channel crd.Channel) string {
// ChannelId returns an id for this channel that combines namespace and name // ChannelId returns an id for this channel that combines namespace and name
// into one string. // into one string.
func ChannelId(channel crd.Channel) string { func ChannelId(channel crd.Channel) string {
return fmt.Sprintf("%s-%s", channel.Namespace, channel.Name) return fmt.Sprintf("%s_%s", channel.Namespace, channel.Name)
} }
// ParseChannelId expects a channel id created by ChannelId() and // ParseChannelId expects a channel id created by ChannelId() and
......
...@@ -412,6 +412,7 @@ func (l *L2SMReconciler) SetupWithManager(mgr ctrl.Manager) error { ...@@ -412,6 +412,7 @@ func (l *L2SMReconciler) SetupWithManager(mgr ctrl.Manager) error {
return ctrl.NewControllerManagedBy(mgr).For(&crd.Channel{}). return ctrl.NewControllerManagedBy(mgr).For(&crd.Channel{}).
Watches(&crd.NetworkLink{}, handler.EnqueueRequestsFromMapFunc(l.setupLinkHandlerMapFunc())). Watches(&crd.NetworkLink{}, handler.EnqueueRequestsFromMapFunc(l.setupLinkHandlerMapFunc())).
Watches(&crd.Ipam{}, handler.EnqueueRequestsFromMapFunc(l.setupIpamHandlerMapFunc())). Watches(&crd.Ipam{}, handler.EnqueueRequestsFromMapFunc(l.setupIpamHandlerMapFunc())).
Watches(&corev1.Pod{}, handler.EnqueueRequestsFromMapFunc(l.setupPodHandlerMapFunc())). // disable Pod watches, probably not used/required currently
// Watches(&corev1.Pod{}, handler.EnqueueRequestsFromMapFunc(l.setupPodHandlerMapFunc())).
Complete(l) Complete(l)
} }
...@@ -58,7 +58,7 @@ func MakeVlink(channel crd.Channel, path *crd.NetworkPath) l2sm.L2Network { ...@@ -58,7 +58,7 @@ func MakeVlink(channel crd.Channel, path *crd.NetworkPath) l2sm.L2Network {
Kind: "L2Network", Kind: "L2Network",
}, },
ObjectMeta: metav1.ObjectMeta{ ObjectMeta: metav1.ObjectMeta{
Name: infrastructure.ChannelId(channel), Name: channel.Name, // using only the channel name is unambiguous, since vlink is currently in the same namespace as the channel
Namespace: channel.Namespace, Namespace: channel.Namespace,
Labels: map[string]string{ Labels: map[string]string{
"channel": infrastructure.ChannelId(channel), "channel": infrastructure.ChannelId(channel),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment