Skip to content
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

fix(evpn-bridge): make tracer optional #380

Merged
merged 1 commit into from
May 14, 2024

Conversation

mardim91
Copy link
Contributor

@mardim91 mardim91 commented Apr 29, 2024

Make tracer optional so we can import the netlinkWrapper library from evpn-gw-cni.

More info here: opiproject/opi-gateway-evpn-cni#14 (comment)

@@ -35,6 +36,12 @@ type Netlink interface {
LinkSetDown(context.Context, netlink.Link) error
LinkSetMaster(context.Context, netlink.Link, netlink.Link) error
LinkSetNoMaster(context.Context, netlink.Link) error
LinkSetNsFd(context.Context, netlink.Link, int) error
Copy link
Contributor

@artek-koltun artek-koltun May 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR descriptions says that we are making the tracer optional. However, we are adding new methods. Should it be a part of a separate PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @artek-koltun,

I will prefer to have those changes if it is possible to a single PR as it is easier for me to test the CNI PR against this one. Mainly these changes that are introduced in this PR have as purpose to make the netlink and FRR wrapper libraries to be reused by other components like the EVPN GW CNI

I can update the description of the PR if that is ok but I would prefer to not have multiple PRs as it is difficult to test the CNI against this. Hope that is ok.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if you test locally, then split and provide one PR and then another one?

Copy link
Contributor Author

@mardim91 mardim91 May 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok let me do the changes on this PR and test them. If they are working I will create two individual ones.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @artek-koltun,

I have made the changes with the noop tracer and tested them. They are working. I will create the two individuals PRs tommorow as we have discussed above

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @artek-koltun,

I have splitted the changes in two PRs. The first one is this PR here and the second one is this

Please review when you find some time.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could I ask you to update the storage bridges as well?

func NewNetlinkWrapperWithArgs(enableTracer bool) *NetlinkWrapper {
netlinkWrapper := &NetlinkWrapper{}
if enableTracer {
netlinkWrapper.tracer = otel.Tracer("")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that we need to check a tracer all the time here and there...
Is it possible to use NoopTracerProvider here, so we use that noop object and not checking for nil all the time?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is a very good point. Let me take a look

@mardim91 mardim91 changed the title fix(evpn-bridge): make tracer optional fix(evpn-bridge): make tracer optional and add extra functions to FRR and netlink wrappers May 13, 2024
@mardim91 mardim91 changed the title fix(evpn-bridge): make tracer optional and add extra functions to FRR and netlink wrappers fix(evpn-bridge): make tracer optional and add extra functions to netlink wrapper May 13, 2024
@mardim91 mardim91 force-pushed the make-tracer-optional branch 2 times, most recently from 06a7932 to b60c09b Compare May 14, 2024 08:14
@mardim91 mardim91 changed the title fix(evpn-bridge): make tracer optional and add extra functions to netlink wrapper fix(evpn-bridge): make tracer optional May 14, 2024
Signed-off-by: Dimitrios Markou <dimitrios.markou@ericsson.com>
Copy link
Contributor

@artek-koltun artek-koltun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@artek-koltun artek-koltun merged commit a134153 into opiproject:main May 14, 2024
15 checks passed
@mardim91
Copy link
Contributor Author

Thank you @artek-koltun

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants