From 95e868767cdf05b6971af3d406e2b2b23a60c8d3 Mon Sep 17 00:00:00 2001 From: Claudia Date: Tue, 25 Jan 2022 09:23:07 +0000 Subject: [PATCH] feat: Make create return full Microvm object (#361) Previously this was just the spec, but it is useful to have more so that we can get things like the provider ID. --- api/services/microvm/v1alpha1/microvms.pb.go | 178 +++++++++--------- api/services/microvm/v1alpha1/microvms.proto | 2 +- .../microvm/v1alpha1/microvms.swagger.json | 2 +- buf.lock | 6 +- infrastructure/grpc/convert.go | 2 +- infrastructure/grpc/server.go | 12 +- infrastructure/grpc/server_test.go | 4 +- test/e2e/e2e_test.go | 4 +- .../grpc/services/microvm/v1alpha1/proto.md | 2 +- 9 files changed, 108 insertions(+), 104 deletions(-) diff --git a/api/services/microvm/v1alpha1/microvms.pb.go b/api/services/microvm/v1alpha1/microvms.pb.go index 11906fc6..18e4e6cc 100644 --- a/api/services/microvm/v1alpha1/microvms.pb.go +++ b/api/services/microvm/v1alpha1/microvms.pb.go @@ -86,7 +86,7 @@ type CreateMicroVMResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Microvm *types.MicroVMSpec `protobuf:"bytes,1,opt,name=microvm,proto3" json:"microvm,omitempty"` + Microvm *types.MicroVM `protobuf:"bytes,1,opt,name=microvm,proto3" json:"microvm,omitempty"` } func (x *CreateMicroVMResponse) Reset() { @@ -121,7 +121,7 @@ func (*CreateMicroVMResponse) Descriptor() ([]byte, []int) { return file_services_microvm_v1alpha1_microvms_proto_rawDescGZIP(), []int{1} } -func (x *CreateMicroVMResponse) GetMicrovm() *types.MicroVMSpec { +func (x *CreateMicroVMResponse) GetMicrovm() *types.MicroVM { if x != nil { return x.Microvm } @@ -461,98 +461,98 @@ var file_services_microvm_v1alpha1_microvms_proto_rawDesc = []byte{ 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2a, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x4f, 0x0a, 0x15, 0x43, 0x72, 0x65, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x4b, 0x0a, 0x15, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x56, 0x4d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x36, 0x0a, 0x07, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x76, 0x6d, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x66, 0x6c, 0x69, 0x6e, 0x74, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, - 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x56, 0x4d, 0x53, 0x70, 0x65, - 0x63, 0x52, 0x07, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x76, 0x6d, 0x22, 0x44, 0x0a, 0x14, 0x44, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x56, 0x4d, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, - 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, - 0x22, 0x41, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x56, 0x4d, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, - 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, - 0x61, 0x63, 0x65, 0x22, 0x48, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x56, - 0x4d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x07, 0x6d, 0x69, 0x63, + 0x73, 0x65, 0x12, 0x32, 0x0a, 0x07, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x76, 0x6d, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x66, 0x6c, 0x69, 0x6e, 0x74, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, + 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x56, 0x4d, 0x52, 0x07, 0x6d, + 0x69, 0x63, 0x72, 0x6f, 0x76, 0x6d, 0x22, 0x44, 0x0a, 0x14, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x56, 0x4d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, + 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1c, + 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x22, 0x41, 0x0a, 0x11, + 0x47, 0x65, 0x74, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x56, 0x4d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, + 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x22, + 0x48, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x56, 0x4d, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x07, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x76, 0x6d, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x66, 0x6c, 0x69, 0x6e, 0x74, 0x6c, 0x6f, + 0x63, 0x6b, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x56, 0x4d, + 0x52, 0x07, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x76, 0x6d, 0x22, 0x33, 0x0a, 0x13, 0x4c, 0x69, 0x73, + 0x74, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x56, 0x4d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x22, 0x4a, + 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x56, 0x4d, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x07, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x76, + 0x6d, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x66, 0x6c, 0x69, 0x6e, 0x74, 0x6c, + 0x6f, 0x63, 0x6b, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x56, + 0x4d, 0x52, 0x07, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x76, 0x6d, 0x22, 0x41, 0x0a, 0x0b, 0x4c, 0x69, + 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x32, 0x0a, 0x07, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x76, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x66, 0x6c, 0x69, 0x6e, 0x74, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4d, 0x69, 0x63, - 0x72, 0x6f, 0x56, 0x4d, 0x52, 0x07, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x76, 0x6d, 0x22, 0x33, 0x0a, - 0x13, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x56, 0x4d, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, - 0x63, 0x65, 0x22, 0x4a, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x56, - 0x4d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x07, 0x6d, 0x69, - 0x63, 0x72, 0x6f, 0x76, 0x6d, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x66, 0x6c, - 0x69, 0x6e, 0x74, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4d, 0x69, - 0x63, 0x72, 0x6f, 0x56, 0x4d, 0x52, 0x07, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x76, 0x6d, 0x22, 0x41, - 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x32, 0x0a, - 0x07, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x76, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, - 0x2e, 0x66, 0x6c, 0x69, 0x6e, 0x74, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, - 0x2e, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x56, 0x4d, 0x52, 0x07, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x76, - 0x6d, 0x32, 0xe5, 0x05, 0x0a, 0x07, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x56, 0x4d, 0x12, 0x95, 0x01, - 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x56, 0x4d, 0x12, - 0x33, 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x76, 0x6d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x56, 0x4d, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x34, 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x76, 0x6d, 0x2e, 0x73, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x69, 0x63, 0x72, 0x6f, - 0x56, 0x4d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x19, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x13, 0x22, 0x11, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x6d, 0x69, - 0x63, 0x72, 0x6f, 0x76, 0x6d, 0x12, 0x88, 0x01, 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, - 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x56, 0x4d, 0x12, 0x33, 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x76, - 0x6d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x69, - 0x63, 0x72, 0x6f, 0x56, 0x4d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, - 0x6d, 0x70, 0x74, 0x79, 0x22, 0x2a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x24, 0x2a, 0x22, 0x2f, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x76, 0x6d, 0x2f, - 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x7d, 0x2f, 0x7b, 0x69, 0x64, 0x7d, - 0x12, 0x9d, 0x01, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x56, 0x4d, 0x12, - 0x30, 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x76, 0x6d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, - 0x47, 0x65, 0x74, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x56, 0x4d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x31, 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x76, 0x6d, 0x2e, 0x73, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x56, 0x4d, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x24, 0x12, 0x22, 0x2f, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x76, 0x6d, 0x2f, - 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x7d, 0x2f, 0x7b, 0x69, 0x64, 0x7d, - 0x12, 0x9e, 0x01, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x56, 0x4d, - 0x73, 0x12, 0x32, 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x76, 0x6d, 0x2e, 0x73, 0x65, 0x72, 0x76, + 0x72, 0x6f, 0x56, 0x4d, 0x52, 0x07, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x76, 0x6d, 0x32, 0xe5, 0x05, + 0x0a, 0x07, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x56, 0x4d, 0x12, 0x95, 0x01, 0x0a, 0x0d, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x56, 0x4d, 0x12, 0x33, 0x2e, 0x6d, 0x69, + 0x63, 0x72, 0x6f, 0x76, 0x6d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x56, 0x4d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x34, 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x76, 0x6d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x56, 0x4d, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x19, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x13, 0x22, 0x11, + 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x76, + 0x6d, 0x12, 0x88, 0x01, 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x69, 0x63, 0x72, + 0x6f, 0x56, 0x4d, 0x12, 0x33, 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x76, 0x6d, 0x2e, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x56, + 0x4d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, + 0x22, 0x2a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x24, 0x2a, 0x22, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2f, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x76, 0x6d, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, + 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x7d, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x9d, 0x01, 0x0a, + 0x0a, 0x47, 0x65, 0x74, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x56, 0x4d, 0x12, 0x30, 0x2e, 0x6d, 0x69, + 0x63, 0x72, 0x6f, 0x76, 0x6d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4d, + 0x69, 0x63, 0x72, 0x6f, 0x56, 0x4d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, + 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x76, 0x6d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x47, 0x65, + 0x74, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x56, 0x4d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x2a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x24, 0x12, 0x22, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2f, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x76, 0x6d, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, + 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x7d, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x9e, 0x01, 0x0a, + 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x56, 0x4d, 0x73, 0x12, 0x32, 0x2e, + 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x76, 0x6d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x56, 0x4d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x33, 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x76, 0x6d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x56, 0x4d, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x76, 0x6d, 0x2e, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x56, - 0x4d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x25, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x1f, 0x12, 0x1d, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x6d, 0x69, - 0x63, 0x72, 0x6f, 0x76, 0x6d, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, - 0x7d, 0x12, 0x76, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x56, 0x4d, - 0x73, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x32, 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x76, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x25, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x12, 0x1d, + 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x76, + 0x6d, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x7d, 0x12, 0x76, 0x0a, + 0x12, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x56, 0x4d, 0x73, 0x53, 0x74, 0x72, + 0x65, 0x61, 0x6d, 0x12, 0x32, 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x76, 0x6d, 0x2e, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x56, 0x4d, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x76, 0x6d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x69, 0x63, 0x72, - 0x6f, 0x56, 0x4d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x6d, 0x69, - 0x63, 0x72, 0x6f, 0x76, 0x6d, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, - 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x30, 0x01, 0x42, 0xda, 0x01, 0x5a, 0x3d, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x77, 0x65, 0x61, 0x76, 0x65, 0x77, 0x6f, - 0x72, 0x6b, 0x73, 0x2f, 0x66, 0x6c, 0x69, 0x6e, 0x74, 0x6c, 0x6f, 0x63, 0x6b, 0x2f, 0x61, 0x70, - 0x69, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x6d, 0x69, 0x63, 0x72, 0x6f, - 0x76, 0x6d, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x92, 0x41, 0x97, 0x01, 0x12, - 0x71, 0x0a, 0x15, 0x46, 0x6c, 0x69, 0x6e, 0x74, 0x6c, 0x6f, 0x63, 0x6b, 0x20, 0x4d, 0x69, 0x63, - 0x72, 0x6f, 0x56, 0x4d, 0x20, 0x41, 0x50, 0x49, 0x12, 0x53, 0x54, 0x68, 0x65, 0x20, 0x46, 0x6c, - 0x69, 0x6e, 0x74, 0x6c, 0x6f, 0x63, 0x6b, 0x20, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x56, 0x4d, 0x20, - 0x41, 0x50, 0x49, 0x20, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x73, 0x20, 0x6f, 0x70, 0x65, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, - 0x73, 0x69, 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x6d, 0x61, 0x6e, 0x61, - 0x67, 0x69, 0x6e, 0x67, 0x20, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x76, 0x6d, 0x73, 0x32, 0x03, 0x30, - 0x2e, 0x31, 0x32, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, - 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x30, 0x01, 0x42, 0xda, 0x01, 0x5a, 0x3d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x77, 0x65, 0x61, 0x76, 0x65, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x2f, + 0x66, 0x6c, 0x69, 0x6e, 0x74, 0x6c, 0x6f, 0x63, 0x6b, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x76, 0x6d, 0x2f, 0x76, + 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x92, 0x41, 0x97, 0x01, 0x12, 0x71, 0x0a, 0x15, 0x46, + 0x6c, 0x69, 0x6e, 0x74, 0x6c, 0x6f, 0x63, 0x6b, 0x20, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x56, 0x4d, + 0x20, 0x41, 0x50, 0x49, 0x12, 0x53, 0x54, 0x68, 0x65, 0x20, 0x46, 0x6c, 0x69, 0x6e, 0x74, 0x6c, + 0x6f, 0x63, 0x6b, 0x20, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x56, 0x4d, 0x20, 0x41, 0x50, 0x49, 0x20, + 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x73, 0x20, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, + 0x69, 0x6e, 0x67, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x69, 0x6e, 0x67, + 0x20, 0x6d, 0x69, 0x63, 0x72, 0x6f, 0x76, 0x6d, 0x73, 0x32, 0x03, 0x30, 0x2e, 0x31, 0x32, 0x10, + 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, 0x73, 0x6f, 0x6e, + 0x3a, 0x10, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, 0x73, + 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -586,7 +586,7 @@ var file_services_microvm_v1alpha1_microvms_proto_goTypes = []interface{}{ var file_services_microvm_v1alpha1_microvms_proto_depIdxs = []int32{ 9, // 0: microvm.services.api.v1alpha1.CreateMicroVMRequest.microvm:type_name -> flintlock.types.MicroVMSpec 8, // 1: microvm.services.api.v1alpha1.CreateMicroVMRequest.metadata:type_name -> microvm.services.api.v1alpha1.CreateMicroVMRequest.MetadataEntry - 9, // 2: microvm.services.api.v1alpha1.CreateMicroVMResponse.microvm:type_name -> flintlock.types.MicroVMSpec + 10, // 2: microvm.services.api.v1alpha1.CreateMicroVMResponse.microvm:type_name -> flintlock.types.MicroVM 10, // 3: microvm.services.api.v1alpha1.GetMicroVMResponse.microvm:type_name -> flintlock.types.MicroVM 10, // 4: microvm.services.api.v1alpha1.ListMicroVMsResponse.microvm:type_name -> flintlock.types.MicroVM 10, // 5: microvm.services.api.v1alpha1.ListMessage.microvm:type_name -> flintlock.types.MicroVM diff --git a/api/services/microvm/v1alpha1/microvms.proto b/api/services/microvm/v1alpha1/microvms.proto index d6ce9e78..ce1c9540 100644 --- a/api/services/microvm/v1alpha1/microvms.proto +++ b/api/services/microvm/v1alpha1/microvms.proto @@ -52,7 +52,7 @@ message CreateMicroVMRequest { } message CreateMicroVMResponse { - flintlock.types.MicroVMSpec microvm = 1; + flintlock.types.MicroVM microvm = 1; } message DeleteMicroVMRequest { diff --git a/api/services/microvm/v1alpha1/microvms.swagger.json b/api/services/microvm/v1alpha1/microvms.swagger.json index 9978195e..dfa942ea 100644 --- a/api/services/microvm/v1alpha1/microvms.swagger.json +++ b/api/services/microvm/v1alpha1/microvms.swagger.json @@ -502,7 +502,7 @@ "type": "object", "properties": { "microvm": { - "$ref": "#/definitions/typesMicroVMSpec" + "$ref": "#/definitions/typesMicroVM" } } }, diff --git a/buf.lock b/buf.lock index fc5facc9..cd83e750 100644 --- a/buf.lock +++ b/buf.lock @@ -5,9 +5,9 @@ deps: owner: googleapis repository: googleapis branch: main - commit: 0039142542b74d11b0ae5a1e9fd4d523 - digest: b1-AzPoqjtlLpx5dVojvgRauI1re5i4LPsghzU0KO-16o4= - create_time: 2022-01-05T15:03:17.46488Z + commit: 6f119269f95240afb69b052c93992f46 + digest: b1-FqoWvdt8ivSWpqSHtadcv6cG7ZzejzQHuj7G5CAUg80= + create_time: 2022-01-22T15:05:34.236772Z - remote: buf.build owner: grpc-ecosystem repository: grpc-gateway diff --git a/infrastructure/grpc/convert.go b/infrastructure/grpc/convert.go index ca4cf272..98774183 100644 --- a/infrastructure/grpc/convert.go +++ b/infrastructure/grpc/convert.go @@ -136,7 +136,7 @@ func convertVolumeToModel(volume *types.Volume) *models.Volume { return convertedVol } -func convertModelToMicroVM(mvm *models.MicroVM) *types.MicroVMSpec { +func convertModelToMicroVMSpec(mvm *models.MicroVM) *types.MicroVMSpec { converted := &types.MicroVMSpec{ Id: mvm.ID.Name(), Namespace: mvm.ID.Namespace(), diff --git a/infrastructure/grpc/server.go b/infrastructure/grpc/server.go index 97e06a7d..43785b65 100644 --- a/infrastructure/grpc/server.go +++ b/infrastructure/grpc/server.go @@ -79,7 +79,11 @@ func (s *server) CreateMicroVM( logger.Trace("converting model to response") resp := &mvmv1.CreateMicroVMResponse{ - Microvm: convertModelToMicroVM(createdModel), + Microvm: &types.MicroVM{ + Version: int32(createdModel.Version), + Spec: convertModelToMicroVMSpec(createdModel), + Status: convertModelToMicroVMStatus(createdModel), + }, } return resp, nil @@ -130,7 +134,7 @@ func (s *server) GetMicroVM(ctx context.Context, req *mvmv1.GetMicroVMRequest) ( resp := &mvmv1.GetMicroVMResponse{ Microvm: &types.MicroVM{ Version: int32(foundMicrovm.Version), - Spec: convertModelToMicroVM(foundMicrovm), + Spec: convertModelToMicroVMSpec(foundMicrovm), Status: convertModelToMicroVMStatus(foundMicrovm), }, } @@ -168,7 +172,7 @@ func (s *server) ListMicroVMs(ctx context.Context, for _, mvm := range foundMicrovms { converted := &types.MicroVM{ Version: int32(mvm.Version), - Spec: convertModelToMicroVM(mvm), + Spec: convertModelToMicroVMSpec(mvm), Status: convertModelToMicroVMStatus(mvm), } resp.Microvm = append(resp.Microvm, converted) @@ -206,7 +210,7 @@ func (s *server) ListMicroVMsStream( resp := &mvmv1.ListMessage{ Microvm: &types.MicroVM{ Version: int32(mvm.Version), - Spec: convertModelToMicroVM(mvm), + Spec: convertModelToMicroVMSpec(mvm), Status: convertModelToMicroVMStatus(mvm), }, } diff --git a/infrastructure/grpc/server_test.go b/infrastructure/grpc/server_test.go index 29f2051f..51562ac8 100644 --- a/infrastructure/grpc/server_test.go +++ b/infrastructure/grpc/server_test.go @@ -91,8 +91,8 @@ func TestServer_CreateMicroVM(t *testing.T) { Expect(err).To(HaveOccurred()) } else { Expect(err).NotTo(HaveOccurred()) - Expect(resp.Microvm.Id).To(Equal("mvm1")) - Expect(resp.Microvm.Namespace).To(Equal("default")) + Expect(resp.Microvm.Spec.Id).To(Equal("mvm1")) + Expect(resp.Microvm.Spec.Namespace).To(Equal("default")) } }) } diff --git a/test/e2e/e2e_test.go b/test/e2e/e2e_test.go index b5bbda4b..0d6255b9 100644 --- a/test/e2e/e2e_test.go +++ b/test/e2e/e2e_test.go @@ -45,7 +45,7 @@ func TestE2E(t *testing.T) { log.Println("TEST STEP: creating MicroVM") created := u.CreateMVM(flintlockClient, mvmID, mvmNS) - Expect(created.Microvm.Id).To(Equal(mvmID)) + Expect(created.Microvm.Spec.Id).To(Equal(mvmID)) log.Println("TEST STEP: getting (and verifying) existing MicroVM") Eventually(func(g Gomega) error { @@ -65,7 +65,7 @@ func TestE2E(t *testing.T) { log.Println("TEST STEP: creating a second MicroVM") created = u.CreateMVM(flintlockClient, secondMvmID, mvmNS) - Expect(created.Microvm.Id).To(Equal(secondMvmID)) + Expect(created.Microvm.Spec.Id).To(Equal(secondMvmID)) log.Println("TEST STEP: listing all MicroVMs") Eventually(func(g Gomega) error { diff --git a/userdocs/docs/grpc/services/microvm/v1alpha1/proto.md b/userdocs/docs/grpc/services/microvm/v1alpha1/proto.md index cb30316d..1283e9d9 100644 --- a/userdocs/docs/grpc/services/microvm/v1alpha1/proto.md +++ b/userdocs/docs/grpc/services/microvm/v1alpha1/proto.md @@ -67,7 +67,7 @@ | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| microvm | [flintlock.types.MicroVMSpec](#flintlock.types.MicroVMSpec) | | | +| microvm | [flintlock.types.MicroVM](#flintlock.types.MicroVM) | | |