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

Add unit tests for computeagent #1182

Merged

Conversation

katiewasnothere
Copy link
Contributor

This PR adds unit tests for the compute agent portion of the ncproxy flow.

Signed-off-by: Kathryn Baldauf kabaldau@microsoft.com

@katiewasnothere katiewasnothere requested a review from a team as a code owner September 29, 2021 22:00
internal/uvm/computeagent_test.go Show resolved Hide resolved
internal/uvm/computeagent_test.go Show resolved Hide resolved
internal/uvm/computeagent_test.go Show resolved Hide resolved
@@ -84,7 +84,6 @@ func (s *grpcService) AddNIC(ctx context.Context, req *ncproxygrpc.AddNICRequest
}
if agent, ok := s.containerIDToComputeAgent.get(req.ContainerID); ok {
caReq := &computeagent.AddNICInternalRequest{
ContainerID: req.ContainerID,
Copy link
Contributor

Choose a reason for hiding this comment

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

My ncproxy cache is getting purged, we don't need to pass this along anymore (if we even needed to at all)? I don't believe it was needed but we don't log it just for tracing purposes or anything in the shim?

Copy link
Contributor Author

@katiewasnothere katiewasnothere Sep 30, 2021

Choose a reason for hiding this comment

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

I don't know of a specific reason to. If it was for logging, we can just log the compute agent's utility VM ID in compute agent.

Copy link
Contributor

Choose a reason for hiding this comment

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

We added an annotation so they could specify a custom "container id" to use to pass during requests https://github.com/microsoft/hcsshim/blob/master/cmd/containerd-shim-runhcs-v1/pod.go#L178-L181, so the UVM ID might not be the same

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, good point. I can add it back just for future tracing needs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added back

Copy link
Contributor

Choose a reason for hiding this comment

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

I still see them getting deleted here, although I see that you added back where they get logged (but they'll just be empty strings as they're not getting passed here)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Whoops, added back.

Copy link
Contributor

@anmaxvl anmaxvl left a comment

Choose a reason for hiding this comment

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

test dir needs revendor, other than that LGTM

Signed-off-by: Kathryn Baldauf <kabaldau@microsoft.com>
@dcantah
Copy link
Contributor

dcantah commented Oct 1, 2021

Besides the ContainerID removal this LGTM, I'll relook on the next push

@dcantah
Copy link
Contributor

dcantah commented Oct 1, 2021

Should push new commits for these btw so it's easier to see what changed, we can always just squash on check-in

Signed-off-by: Kathryn Baldauf <kabaldau@microsoft.com>
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.

3 participants