Skip to content

Commit

Permalink
IPContext merged in begin chain element (#1231)
Browse files Browse the repository at this point in the history
Using the Client chain, the network service client cannot update the
IPContext without the mergeConnectionContext function implemented. A NSC
might want to update it if it needs to add, update or delete routes, src
IP addresses (VIPs...), policies...

Signed-off-by: Lionel Jouin <lionel.jouin@est.tech>
  • Loading branch information
LionelJouin committed Mar 3, 2022
1 parent 9d5c3f7 commit 7a95650
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/networkservice/common/begin/merge.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright (c) 2021 Cisco and/or its affiliates.
// Copyright (c) 2021-2022 Cisco and/or its affiliates.
// Copyright (c) 2022 Nordix Foundation
//
// SPDX-License-Identifier: Apache-2.0
//
Expand Down Expand Up @@ -36,7 +37,8 @@ func mergeConnection(returnedConnection, requestedConnection, connection *networ
func mergeConnectionContext(returnedConnectionContext, requestedConnectionContext, connectioncontext *networkservice.ConnectionContext) *networkservice.ConnectionContext {
rv := proto.Clone(connectioncontext).(*networkservice.ConnectionContext)
if !proto.Equal(returnedConnectionContext, requestedConnectionContext) {
// TODO: IPContext, DNSContext, EthernetContext, do we need to do MTU?
// TODO: DNSContext, EthernetContext, do we need to do MTU?
rv.IpContext = requestedConnectionContext.IpContext
rv.ExtraContext = mergeMapStringString(returnedConnectionContext.GetExtraContext(), requestedConnectionContext.GetExtraContext(), connectioncontext.GetExtraContext())
}
return rv
Expand Down

0 comments on commit 7a95650

Please sign in to comment.