-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use metadata map for storing vfconfig #307
use metadata map for storing vfconfig #307
Conversation
// LoadOrStore returns the existing VFConfig stored in per Connection.Id metadata if present. | ||
// Otherwise, it stores and returns the given nterface_types.InterfaceIndex. | ||
// The loaded result is true if the value was loaded, false if stored. | ||
func LoadOrStore(ctx context.Context, isClient bool, config VFConfig) (value VFConfig, ok bool) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please return *VFConfig
instead of VFConfig
, I suppose that the most common usage for altering the data would be:
vfConfig, _ := vfconfig.LoadOrStore(ctx, ...)
...
vfConfig.xxx = yyy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So actually I have meant replacing all VFConfig
with *VFConfig
, both for input and for output values :)
It should be really confusing if Load
and LoadOrStore
return different types or if input and output parameters for LoadOrStore
have different types.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, changed it now.
3fa866a
to
2ce3b47
Compare
Signed-off-by: Periyasamy Palanisamy <periyasamy.palanisamy@est.tech>
Signed-off-by: Periyasamy Palanisamy <periyasamy.palanisamy@est.tech>
2ce3b47
to
fc9c8b6
Compare
…k-kernel@main PR link: networkservicemesh/sdk-kernel#307 Commit: eba0791 Author: Denis Tingaikin Date: 2021-08-29 23:55:39 +0300 Message: - Merge pull request #307 from Nordix/metadata-vfconfig Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k-kernel@main PR link: networkservicemesh/sdk-kernel#307 Commit: eba0791 Author: Denis Tingaikin Date: 2021-08-29 23:55:39 +0300 Message: - Merge pull request #307 from Nordix/metadata-vfconfig Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
stores vfconfig into metadata map service to accommodate vfconfig for both client and endpoint connections.
an alternate and proper fix as per feedback in the PR
Signed-off-by: Periyasamy Palanisamy periyasamy.palanisamy@est.tech