-
Notifications
You must be signed in to change notification settings - Fork 0
VM Connect Changes #309
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
base: master
Are you sure you want to change the base?
VM Connect Changes #309
Changes from all commits
57da52e
57e9c0a
6d9ca6b
6455869
04e4fbc
a195dd7
679b5e4
d4de6fd
fa51cfb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -94,7 +94,7 @@ func GetServerAddress(cc *grpc.ClientConn) string { | |
| defer mux.Unlock() | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. probably can just remove this file to keep the commit history simple
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed in new pr. |
||
|
|
||
| for key, value := range connectionCache { | ||
| if value == cc { | ||
| if value == cc { | ||
| return key | ||
| } | ||
| } | ||
|
|
@@ -109,7 +109,7 @@ func AddNodeNameToErrorMessageInterceptor() grpc.UnaryClientInterceptor { | |
| serverAddressPort := GetServerAddress(cc) | ||
| if len(serverAddressPort) != 0 { | ||
| serverAddress := (strings.Split(serverAddressPort, ":"))[0] | ||
| err = errors.Wrapf(err, "nodename = %s", serverAddress) | ||
| err = errors.Wrapf(err, "nodename = %s", serverAddress) | ||
| } | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -114,6 +114,23 @@ func (c *client) Hydrate(ctx context.Context, group, name string, sg *compute.Vi | |
| return &(*vms)[0], nil | ||
| } | ||
|
|
||
| func (c *client) GetHyperVVmId(ctx context.Context, group, name string) (*compute.VirtualMachineHyperVVmId, error) { | ||
| vm, err := c.get(ctx, group, name) | ||
| if err != nil { | ||
| return nil, err | ||
| } | ||
|
|
||
| mocResponse, err := c.VirtualMachineAgentClient.GetHyperVVmId(ctx, vm[0]) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just to be safe, can we make sure the vm list is non-empty before accessing it?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done in new pr. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there a specific reason we aren’t using the INVOKE function for the calls to cloudAgent? It already has RBAC, redaction, and common logging built in. Would it make sense to embed these new function calls within INVOKE to take advantage of those built-in features?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These functions are not running operations on the VM, they are simply getting and passing up information from set fields. |
||
| if err != nil { | ||
| return nil, err | ||
| } | ||
| response := &compute.VirtualMachineHyperVVmId{ | ||
| HyperVVmId: &mocResponse.HyperVVmId, | ||
| } | ||
|
|
||
| return response, nil | ||
| } | ||
|
|
||
| func (c *client) Start(ctx context.Context, group, name string) (err error) { | ||
| request, err := c.getVirtualMachineOperationRequest(ctx, wssdcommonproto.VirtualMachineOperation_START, name) | ||
| if err != nil { | ||
|
|
||
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.
same as other prs, make sure to remove all changes from these files before merge