Skip to content

Commit 9aec529

Browse files
ruinan-liuPradeep Kumar Gayam
andauthored
[moc] Add AvailabilitySet Operation for Add/Remove VM (#376)
* Make avset update operation idempotent * Pull from master * Updating to use platformVM and nodeagnetVM Name * Removing platform vm Name dependency * Remove comments * fix * Updating go.mod to remove moc-pkg --------- Co-authored-by: Pradeep Kumar Gayam <[email protected]>
1 parent 03d4cc8 commit 9aec529

File tree

8 files changed

+357
-163
lines changed

8 files changed

+357
-163
lines changed

.pipelines/build.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ jobs:
7979
steps:
8080
- task: GoTool@0
8181
inputs:
82-
version: '1.22.5'
82+
version: '1.24.3'
8383

8484
- task: InstallSSHKey@0
8585
inputs:

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,4 @@ mocks:
5555

5656
golangci-lint:
5757
$(GOCMD) install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
58-
$(GOPATH_BIN)/golangci-lint run --config .golangci.yml
58+
$(GOPATH_BIN)/golangci-lint run --config .golangci.yml

go.sum

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,4 +92,4 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8
9292
gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10=
9393
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
9494
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
95-
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
95+
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

rpc/cloudagent/compute/availabilityset/moc_cloudagent_availabilityset.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ message AvailabilitySetResponse {
2222
message VirtualMachineReference {
2323
string groupName = 1;
2424
string name = 2;
25-
string realizedName = 3;
25+
string realizedName = 3; // This is nodeagnet vm name
2626
}
2727

2828
message AvailabilitySetPrecheckRequest {

rpc/common/moc_common_computecommon.pb.go

Lines changed: 156 additions & 128 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rpc/common/moc_common_computecommon.proto

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,3 +258,8 @@ message ProxyConfiguration {
258258
repeated string noProxy = 3;
259259
string trustedCa = 4 [(sensitivecompute) = true];
260260
}
261+
262+
enum AvailabilitySetOperation {
263+
ADD_VM = 0;
264+
REMOVE_VM = 1;
265+
}

rpc/nodeagent/compute/availabilityset/moc_nodeagent_availabilityset.proto

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ package moc.nodeagent.compute;
77

88
import "google/protobuf/wrappers.proto";
99
import "moc_common_common.proto";
10+
import "moc_common_computecommon.proto";
11+
1012

1113
message AvailabilitySetRequest {
1214
repeated AvailabilitySet AvailabilitySets = 1;
@@ -35,6 +37,19 @@ message AvailabilitySet {
3537
repeated VirtualMachineReference virtualMachines = 7;
3638
}
3739

40+
message AvailabilitySetOperationRequest {
41+
string AvailabilitySet = 1;
42+
string NodeagentVMName = 2;
43+
AvailabilitySetOperation OperationType = 3;
44+
}
45+
46+
message AvailabilitySetOperationResponse {
47+
google.protobuf.BoolValue Result = 2;
48+
string Error = 3;
49+
}
50+
51+
3852
service AvailabilitySetAgent {
3953
rpc Invoke(AvailabilitySetRequest) returns (AvailabilitySetResponse) {}
54+
rpc Operate(AvailabilitySetOperationRequest) returns (AvailabilitySetOperationResponse) {}
4055
}

rpc/nodeagent/compute/moc_nodeagent_availabilityset.pb.go

Lines changed: 177 additions & 31 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)