From dca8227fc6293c288a352481a950f41170f84ede Mon Sep 17 00:00:00 2001 From: Balazs Nadasdi Date: Fri, 8 Oct 2021 14:46:38 +0200 Subject: [PATCH] feat: Mark VM as deleted Mark the VM in the spec as deleted and let the reconciliation loop handle it. For mocking purpose, I introduced a Clock in ports.Collection. Changed the event to Update event from Delete event. For the reconciliation loop, they are the same. Let me know if we still want to use the Delete event. fixes #74 --- api/services/microvm/v1alpha1/microvms.pb.go | 44 ++-- .../microvm/v1alpha1/microvms.pb.gw.go | 44 +++- api/services/microvm/v1alpha1/microvms.proto | 2 +- .../microvm/v1alpha1/microvms.swagger.json | 5 + .../microvm/v1alpha1/microvms_grpc.pb.go | 9 +- api/types/microvm.pb.go | 212 +++++++++--------- api/types/microvm.proto | 5 +- core/application/app_test.go | 42 +++- core/application/commands.go | 28 ++- core/models/microvm.go | 6 + core/ports/collection.go | 7 +- core/ports/time.go | 7 + go.mod | 5 +- go.sum | 3 - internal/inject/wire.go | 2 + internal/inject/wire_gen.go | 3 +- 16 files changed, 257 insertions(+), 167 deletions(-) create mode 100644 core/ports/time.go diff --git a/api/services/microvm/v1alpha1/microvms.pb.go b/api/services/microvm/v1alpha1/microvms.pb.go index 7122f8d1..0cac5967 100644 --- a/api/services/microvm/v1alpha1/microvms.pb.go +++ b/api/services/microvm/v1alpha1/microvms.pb.go @@ -7,9 +7,6 @@ package v1alpha1 import ( - reflect "reflect" - sync "sync" - _ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options" types "github.com/weaveworks/reignite/api/types" _ "google.golang.org/genproto/googleapis/api/annotations" @@ -18,6 +15,8 @@ import ( anypb "google.golang.org/protobuf/types/known/anypb" emptypb "google.golang.org/protobuf/types/known/emptypb" fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb" + reflect "reflect" + sync "sync" ) const ( @@ -696,27 +695,24 @@ func file_services_microvm_v1alpha1_microvms_proto_rawDescGZIP() []byte { return file_services_microvm_v1alpha1_microvms_proto_rawDescData } -var ( - file_services_microvm_v1alpha1_microvms_proto_msgTypes = make([]protoimpl.MessageInfo, 11) - file_services_microvm_v1alpha1_microvms_proto_goTypes = []interface{}{ - (*CreateMicroVMRequest)(nil), // 0: microvm.services.api.v1alpha1.CreateMicroVMRequest - (*CreateMicroVMResponse)(nil), // 1: microvm.services.api.v1alpha1.CreateMicroVMResponse - (*DeleteMicroVMRequest)(nil), // 2: microvm.services.api.v1alpha1.DeleteMicroVMRequest - (*UpdateMicroVMRequest)(nil), // 3: microvm.services.api.v1alpha1.UpdateMicroVMRequest - (*UpdateMicroVMResponse)(nil), // 4: microvm.services.api.v1alpha1.UpdateMicroVMResponse - (*GetMicroVMRequest)(nil), // 5: microvm.services.api.v1alpha1.GetMicroVMRequest - (*GetMicroVMResponse)(nil), // 6: microvm.services.api.v1alpha1.GetMicroVMResponse - (*ListMicroVMsRequest)(nil), // 7: microvm.services.api.v1alpha1.ListMicroVMsRequest - (*ListMicroVMsResponse)(nil), // 8: microvm.services.api.v1alpha1.ListMicroVMsResponse - (*ListMessage)(nil), // 9: microvm.services.api.v1alpha1.ListMessage - nil, // 10: microvm.services.api.v1alpha1.CreateMicroVMRequest.MetadataEntry - (*types.MicroVMSpec)(nil), // 11: reignite.types.MicroVMSpec - (*fieldmaskpb.FieldMask)(nil), // 12: google.protobuf.FieldMask - (*anypb.Any)(nil), // 13: google.protobuf.Any - (*emptypb.Empty)(nil), // 14: google.protobuf.Empty - } -) - +var file_services_microvm_v1alpha1_microvms_proto_msgTypes = make([]protoimpl.MessageInfo, 11) +var file_services_microvm_v1alpha1_microvms_proto_goTypes = []interface{}{ + (*CreateMicroVMRequest)(nil), // 0: microvm.services.api.v1alpha1.CreateMicroVMRequest + (*CreateMicroVMResponse)(nil), // 1: microvm.services.api.v1alpha1.CreateMicroVMResponse + (*DeleteMicroVMRequest)(nil), // 2: microvm.services.api.v1alpha1.DeleteMicroVMRequest + (*UpdateMicroVMRequest)(nil), // 3: microvm.services.api.v1alpha1.UpdateMicroVMRequest + (*UpdateMicroVMResponse)(nil), // 4: microvm.services.api.v1alpha1.UpdateMicroVMResponse + (*GetMicroVMRequest)(nil), // 5: microvm.services.api.v1alpha1.GetMicroVMRequest + (*GetMicroVMResponse)(nil), // 6: microvm.services.api.v1alpha1.GetMicroVMResponse + (*ListMicroVMsRequest)(nil), // 7: microvm.services.api.v1alpha1.ListMicroVMsRequest + (*ListMicroVMsResponse)(nil), // 8: microvm.services.api.v1alpha1.ListMicroVMsResponse + (*ListMessage)(nil), // 9: microvm.services.api.v1alpha1.ListMessage + nil, // 10: microvm.services.api.v1alpha1.CreateMicroVMRequest.MetadataEntry + (*types.MicroVMSpec)(nil), // 11: reignite.types.MicroVMSpec + (*fieldmaskpb.FieldMask)(nil), // 12: google.protobuf.FieldMask + (*anypb.Any)(nil), // 13: google.protobuf.Any + (*emptypb.Empty)(nil), // 14: google.protobuf.Empty +} var file_services_microvm_v1alpha1_microvms_proto_depIdxs = []int32{ 11, // 0: microvm.services.api.v1alpha1.CreateMicroVMRequest.microvm:type_name -> reignite.types.MicroVMSpec 10, // 1: microvm.services.api.v1alpha1.CreateMicroVMRequest.metadata:type_name -> microvm.services.api.v1alpha1.CreateMicroVMRequest.MetadataEntry diff --git a/api/services/microvm/v1alpha1/microvms.pb.gw.go b/api/services/microvm/v1alpha1/microvms.pb.gw.go index 3ff1b00e..264b3ff9 100644 --- a/api/services/microvm/v1alpha1/microvms.pb.gw.go +++ b/api/services/microvm/v1alpha1/microvms.pb.gw.go @@ -24,17 +24,17 @@ import ( ) // Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = metadata.Join + var ( - _ codes.Code - _ io.Reader - _ status.Status - _ = runtime.String - _ = utilities.NewDoubleArray - _ = metadata.Join + filter_MicroVM_CreateMicroVM_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} ) -var filter_MicroVM_CreateMicroVM_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} - func request_MicroVM_CreateMicroVM_0(ctx context.Context, marshaler runtime.Marshaler, client MicroVMClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq CreateMicroVMRequest var metadata runtime.ServerMetadata @@ -48,6 +48,7 @@ func request_MicroVM_CreateMicroVM_0(ctx context.Context, marshaler runtime.Mars msg, err := client.CreateMicroVM(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err + } func local_request_MicroVM_CreateMicroVM_0(ctx context.Context, marshaler runtime.Marshaler, server MicroVMServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -63,9 +64,12 @@ func local_request_MicroVM_CreateMicroVM_0(ctx context.Context, marshaler runtim msg, err := server.CreateMicroVM(ctx, &protoReq) return msg, metadata, err + } -var filter_MicroVM_UpdateMicroVM_0 = &utilities.DoubleArray{Encoding: map[string]int{"microvm": 0, "namespace": 1, "id": 2}, Base: []int{1, 1, 1, 2, 0, 0}, Check: []int{0, 1, 2, 2, 3, 4}} +var ( + filter_MicroVM_UpdateMicroVM_0 = &utilities.DoubleArray{Encoding: map[string]int{"microvm": 0, "namespace": 1, "id": 2}, Base: []int{1, 1, 1, 2, 0, 0}, Check: []int{0, 1, 2, 2, 3, 4}} +) func request_MicroVM_UpdateMicroVM_0(ctx context.Context, marshaler runtime.Marshaler, client MicroVMClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq UpdateMicroVMRequest @@ -107,6 +111,7 @@ func request_MicroVM_UpdateMicroVM_0(ctx context.Context, marshaler runtime.Mars msg, err := client.UpdateMicroVM(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err + } func local_request_MicroVM_UpdateMicroVM_0(ctx context.Context, marshaler runtime.Marshaler, server MicroVMServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -149,6 +154,7 @@ func local_request_MicroVM_UpdateMicroVM_0(ctx context.Context, marshaler runtim msg, err := server.UpdateMicroVM(ctx, &protoReq) return msg, metadata, err + } func request_MicroVM_DeleteMicroVM_0(ctx context.Context, marshaler runtime.Marshaler, client MicroVMClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -184,6 +190,7 @@ func request_MicroVM_DeleteMicroVM_0(ctx context.Context, marshaler runtime.Mars msg, err := client.DeleteMicroVM(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err + } func local_request_MicroVM_DeleteMicroVM_0(ctx context.Context, marshaler runtime.Marshaler, server MicroVMServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -219,6 +226,7 @@ func local_request_MicroVM_DeleteMicroVM_0(ctx context.Context, marshaler runtim msg, err := server.DeleteMicroVM(ctx, &protoReq) return msg, metadata, err + } func request_MicroVM_GetMicroVM_0(ctx context.Context, marshaler runtime.Marshaler, client MicroVMClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -254,6 +262,7 @@ func request_MicroVM_GetMicroVM_0(ctx context.Context, marshaler runtime.Marshal msg, err := client.GetMicroVM(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err + } func local_request_MicroVM_GetMicroVM_0(ctx context.Context, marshaler runtime.Marshaler, server MicroVMServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -289,6 +298,7 @@ func local_request_MicroVM_GetMicroVM_0(ctx context.Context, marshaler runtime.M msg, err := server.GetMicroVM(ctx, &protoReq) return msg, metadata, err + } func request_MicroVM_ListMicroVMs_0(ctx context.Context, marshaler runtime.Marshaler, client MicroVMClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -314,6 +324,7 @@ func request_MicroVM_ListMicroVMs_0(ctx context.Context, marshaler runtime.Marsh msg, err := client.ListMicroVMs(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err + } func local_request_MicroVM_ListMicroVMs_0(ctx context.Context, marshaler runtime.Marshaler, server MicroVMServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -339,6 +350,7 @@ func local_request_MicroVM_ListMicroVMs_0(ctx context.Context, marshaler runtime msg, err := server.ListMicroVMs(ctx, &protoReq) return msg, metadata, err + } func request_MicroVM_ListMicroVMsStream_0(ctx context.Context, marshaler runtime.Marshaler, client MicroVMClient, req *http.Request, pathParams map[string]string) (MicroVM_ListMicroVMsStreamClient, runtime.ServerMetadata, error) { @@ -363,6 +375,7 @@ func request_MicroVM_ListMicroVMsStream_0(ctx context.Context, marshaler runtime } metadata.HeaderMD = header return stream, metadata, nil + } // RegisterMicroVMHandlerServer registers the http handlers for service MicroVM to "mux". @@ -370,6 +383,7 @@ func request_MicroVM_ListMicroVMsStream_0(ctx context.Context, marshaler runtime // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. // Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterMicroVMHandlerFromEndpoint instead. func RegisterMicroVMHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MicroVMServer) error { + mux.Handle("POST", pattern_MicroVM_CreateMicroVM_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -390,6 +404,7 @@ func RegisterMicroVMHandlerServer(ctx context.Context, mux *runtime.ServeMux, se } forward_MicroVM_CreateMicroVM_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) mux.Handle("PUT", pattern_MicroVM_UpdateMicroVM_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { @@ -412,6 +427,7 @@ func RegisterMicroVMHandlerServer(ctx context.Context, mux *runtime.ServeMux, se } forward_MicroVM_UpdateMicroVM_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) mux.Handle("DELETE", pattern_MicroVM_DeleteMicroVM_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { @@ -434,6 +450,7 @@ func RegisterMicroVMHandlerServer(ctx context.Context, mux *runtime.ServeMux, se } forward_MicroVM_DeleteMicroVM_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) mux.Handle("GET", pattern_MicroVM_GetMicroVM_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { @@ -456,6 +473,7 @@ func RegisterMicroVMHandlerServer(ctx context.Context, mux *runtime.ServeMux, se } forward_MicroVM_GetMicroVM_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) mux.Handle("GET", pattern_MicroVM_ListMicroVMs_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { @@ -478,6 +496,7 @@ func RegisterMicroVMHandlerServer(ctx context.Context, mux *runtime.ServeMux, se } forward_MicroVM_ListMicroVMs_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) mux.Handle("POST", pattern_MicroVM_ListMicroVMsStream_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { @@ -527,6 +546,7 @@ func RegisterMicroVMHandler(ctx context.Context, mux *runtime.ServeMux, conn *gr // doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in // "MicroVMClient" to call the correct interceptors. func RegisterMicroVMHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MicroVMClient) error { + mux.Handle("POST", pattern_MicroVM_CreateMicroVM_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -544,6 +564,7 @@ func RegisterMicroVMHandlerClient(ctx context.Context, mux *runtime.ServeMux, cl } forward_MicroVM_CreateMicroVM_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) mux.Handle("PUT", pattern_MicroVM_UpdateMicroVM_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { @@ -563,6 +584,7 @@ func RegisterMicroVMHandlerClient(ctx context.Context, mux *runtime.ServeMux, cl } forward_MicroVM_UpdateMicroVM_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) mux.Handle("DELETE", pattern_MicroVM_DeleteMicroVM_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { @@ -582,6 +604,7 @@ func RegisterMicroVMHandlerClient(ctx context.Context, mux *runtime.ServeMux, cl } forward_MicroVM_DeleteMicroVM_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) mux.Handle("GET", pattern_MicroVM_GetMicroVM_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { @@ -601,6 +624,7 @@ func RegisterMicroVMHandlerClient(ctx context.Context, mux *runtime.ServeMux, cl } forward_MicroVM_GetMicroVM_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) mux.Handle("GET", pattern_MicroVM_ListMicroVMs_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { @@ -620,6 +644,7 @@ func RegisterMicroVMHandlerClient(ctx context.Context, mux *runtime.ServeMux, cl } forward_MicroVM_ListMicroVMs_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) mux.Handle("POST", pattern_MicroVM_ListMicroVMsStream_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { @@ -639,6 +664,7 @@ func RegisterMicroVMHandlerClient(ctx context.Context, mux *runtime.ServeMux, cl } forward_MicroVM_ListMicroVMsStream_0(ctx, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...) + }) return nil diff --git a/api/services/microvm/v1alpha1/microvms.proto b/api/services/microvm/v1alpha1/microvms.proto index 90b99c3f..de2ce876 100644 --- a/api/services/microvm/v1alpha1/microvms.proto +++ b/api/services/microvm/v1alpha1/microvms.proto @@ -93,4 +93,4 @@ message ListMicroVMsResponse { message ListMessage { reignite.types.MicroVMSpec microvm = 1; -} \ No newline at end of file +} diff --git a/api/services/microvm/v1alpha1/microvms.swagger.json b/api/services/microvm/v1alpha1/microvms.swagger.json index 9c6ce5c9..56873679 100644 --- a/api/services/microvm/v1alpha1/microvms.swagger.json +++ b/api/services/microvm/v1alpha1/microvms.swagger.json @@ -323,6 +323,11 @@ "type": "string", "format": "date-time", "description": "UpdatedAt indicates the time the microvm was last updated." + }, + "deletedAt": { + "type": "string", + "format": "date-time", + "description": "DeletedAt indicates the time the microvm was marked as deleted." } }, "description": "MicroVMSpec represents the specification for a microvm." diff --git a/api/services/microvm/v1alpha1/microvms_grpc.pb.go b/api/services/microvm/v1alpha1/microvms_grpc.pb.go index 421b8aef..0219d718 100644 --- a/api/services/microvm/v1alpha1/microvms_grpc.pb.go +++ b/api/services/microvm/v1alpha1/microvms_grpc.pb.go @@ -4,7 +4,6 @@ package v1alpha1 import ( context "context" - grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -126,28 +125,24 @@ type MicroVMServer interface { } // UnimplementedMicroVMServer should be embedded to have forward compatible implementations. -type UnimplementedMicroVMServer struct{} +type UnimplementedMicroVMServer struct { +} func (UnimplementedMicroVMServer) CreateMicroVM(context.Context, *CreateMicroVMRequest) (*CreateMicroVMResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CreateMicroVM not implemented") } - func (UnimplementedMicroVMServer) UpdateMicroVM(context.Context, *UpdateMicroVMRequest) (*UpdateMicroVMResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateMicroVM not implemented") } - func (UnimplementedMicroVMServer) DeleteMicroVM(context.Context, *DeleteMicroVMRequest) (*emptypb.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method DeleteMicroVM not implemented") } - func (UnimplementedMicroVMServer) GetMicroVM(context.Context, *GetMicroVMRequest) (*GetMicroVMResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetMicroVM not implemented") } - func (UnimplementedMicroVMServer) ListMicroVMs(context.Context, *ListMicroVMsRequest) (*ListMicroVMsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ListMicroVMs not implemented") } - func (UnimplementedMicroVMServer) ListMicroVMsStream(*ListMicroVMsRequest, MicroVM_ListMicroVMsStreamServer) error { return status.Errorf(codes.Unimplemented, "method ListMicroVMsStream not implemented") } diff --git a/api/types/microvm.pb.go b/api/types/microvm.pb.go index 853c86c3..c418b2de 100644 --- a/api/types/microvm.pb.go +++ b/api/types/microvm.pb.go @@ -7,12 +7,11 @@ package types import ( - reflect "reflect" - sync "sync" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" ) const ( @@ -103,6 +102,8 @@ type MicroVMSpec struct { CreatedAt *timestamppb.Timestamp `protobuf:"bytes,11,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` // UpdatedAt indicates the time the microvm was last updated. UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,12,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` + // DeletedAt indicates the time the microvm was marked as deleted. + DeletedAt *timestamppb.Timestamp `protobuf:"bytes,13,opt,name=deleted_at,json=deletedAt,proto3" json:"deleted_at,omitempty"` } func (x *MicroVMSpec) Reset() { @@ -221,6 +222,13 @@ func (x *MicroVMSpec) GetUpdatedAt() *timestamppb.Timestamp { return nil } +func (x *MicroVMSpec) GetDeletedAt() *timestamppb.Timestamp { + if x != nil { + return x.DeletedAt + } + return nil +} + // Kernel represents the configuration for a kernel. type Kernel struct { state protoimpl.MessageState @@ -553,7 +561,7 @@ type VolumeSource struct { unknownFields protoimpl.UnknownFields // Container is used to specify a source of a volume as a OCI container. - ContainerSource *string `protobuf:"bytes,1,opt,name=container_source,json=containerSource,proto3,oneof" json:"container_source,omitempty"` // TODO: add CSI + ContainerSource *string `protobuf:"bytes,1,opt,name=container_source,json=containerSource,proto3,oneof" json:"container_source,omitempty"` //TODO: add CSI } func (x *VolumeSource) Reset() { @@ -651,7 +659,7 @@ var file_types_microvm_proto_rawDesc = []byte{ 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x72, 0x65, 0x69, 0x67, 0x6e, 0x69, 0x74, 0x65, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xcb, 0x05, 0x0a, 0x0b, 0x4d, 0x69, 0x63, 0x72, 0x6f, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x86, 0x06, 0x0a, 0x0b, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x56, 0x4d, 0x53, 0x70, 0x65, 0x63, 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, @@ -688,77 +696,81 @@ var file_types_microvm_proto_rawDesc = []byte{ 0x64, 0x5f, 0x61, 0x74, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, - 0x74, 0x1a, 0x39, 0x0a, 0x0b, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, - 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, - 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x3b, 0x0a, 0x0d, - 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, - 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, - 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x69, 0x6e, - 0x69, 0x74, 0x72, 0x64, 0x22, 0x94, 0x01, 0x0a, 0x06, 0x4b, 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x12, - 0x14, 0x0a, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x69, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6d, 0x64, 0x6c, 0x69, 0x6e, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6d, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x12, - 0x1f, 0x0a, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x48, 0x00, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x88, 0x01, 0x01, - 0x12, 0x2c, 0x0a, 0x12, 0x61, 0x64, 0x64, 0x5f, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x5f, - 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x61, 0x64, - 0x64, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, 0x0b, - 0x0a, 0x09, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x4c, 0x0a, 0x06, 0x49, - 0x6e, 0x69, 0x74, 0x72, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x1f, 0x0a, 0x08, 0x66, - 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, - 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x42, 0x0b, 0x0a, 0x09, - 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0xaa, 0x02, 0x0a, 0x10, 0x4e, 0x65, - 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x12, 0x2a, - 0x0a, 0x11, 0x67, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x67, 0x75, 0x65, 0x73, 0x74, - 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x3e, 0x0a, 0x04, 0x74, 0x79, - 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2a, 0x2e, 0x72, 0x65, 0x69, 0x67, 0x6e, - 0x69, 0x74, 0x65, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, - 0x6b, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x2e, 0x49, 0x66, 0x61, 0x63, 0x65, - 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x2c, 0x0a, 0x12, 0x61, 0x6c, - 0x6c, 0x6f, 0x77, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x72, 0x65, 0x71, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x4d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x12, 0x20, 0x0a, 0x09, 0x67, 0x75, 0x65, 0x73, - 0x74, 0x5f, 0x6d, 0x61, 0x63, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x08, 0x67, - 0x75, 0x65, 0x73, 0x74, 0x4d, 0x61, 0x63, 0x88, 0x01, 0x01, 0x12, 0x1d, 0x0a, 0x07, 0x61, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x07, 0x61, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x88, 0x01, 0x01, 0x22, 0x21, 0x0a, 0x09, 0x49, 0x66, 0x61, - 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x4d, 0x41, 0x43, 0x56, 0x54, 0x41, - 0x50, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x54, 0x41, 0x50, 0x10, 0x01, 0x42, 0x0c, 0x0a, 0x0a, - 0x5f, 0x67, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x6d, 0x61, 0x63, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x61, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x95, 0x02, 0x0a, 0x06, 0x56, 0x6f, 0x6c, 0x75, 0x6d, - 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, - 0x64, 0x12, 0x17, 0x0a, 0x07, 0x69, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x06, 0x69, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x20, 0x0a, 0x0c, 0x69, 0x73, - 0x5f, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x6f, 0x6e, 0x6c, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x0a, 0x69, 0x73, 0x52, 0x65, 0x61, 0x64, 0x4f, 0x6e, 0x6c, 0x79, 0x12, 0x1f, 0x0a, 0x0b, - 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0a, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x34, 0x0a, - 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, - 0x72, 0x65, 0x69, 0x67, 0x6e, 0x69, 0x74, 0x65, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x56, - 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x06, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x12, 0x26, 0x0a, 0x0c, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0b, 0x70, 0x61, 0x72, - 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x88, 0x01, 0x01, 0x12, 0x21, 0x0a, 0x0a, 0x73, - 0x69, 0x7a, 0x65, 0x5f, 0x69, 0x6e, 0x5f, 0x6d, 0x62, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x48, - 0x01, 0x52, 0x08, 0x73, 0x69, 0x7a, 0x65, 0x49, 0x6e, 0x4d, 0x62, 0x88, 0x01, 0x01, 0x42, 0x0f, - 0x0a, 0x0d, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x42, - 0x0d, 0x0a, 0x0b, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x5f, 0x69, 0x6e, 0x5f, 0x6d, 0x62, 0x22, 0x53, - 0x0a, 0x0c, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x2e, - 0x0a, 0x10, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x74, - 0x61, 0x69, 0x6e, 0x65, 0x72, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x88, 0x01, 0x01, 0x42, 0x13, - 0x0a, 0x11, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x22, 0x2d, 0x0a, 0x15, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, - 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x14, 0x0a, 0x05, - 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x69, 0x6d, 0x61, - 0x67, 0x65, 0x42, 0x30, 0x5a, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x77, 0x65, 0x61, 0x76, 0x65, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x2f, 0x72, 0x65, 0x69, 0x67, - 0x6e, 0x69, 0x74, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x3b, 0x74, - 0x79, 0x70, 0x65, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, + 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x52, 0x09, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x41, 0x74, 0x1a, 0x39, 0x0a, 0x0b, + 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, + 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x3b, 0x0a, 0x0d, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x3a, 0x02, 0x38, 0x01, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x69, 0x6e, 0x69, 0x74, 0x72, 0x64, 0x22, + 0x94, 0x01, 0x0a, 0x06, 0x4b, 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6d, + 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, + 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6d, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x63, 0x6d, 0x64, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x1f, 0x0a, 0x08, 0x66, 0x69, + 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x08, + 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x2c, 0x0a, 0x12, 0x61, + 0x64, 0x64, 0x5f, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, + 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x61, 0x64, 0x64, 0x4e, 0x65, 0x74, 0x77, + 0x6f, 0x72, 0x6b, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x66, 0x69, + 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x4c, 0x0a, 0x06, 0x49, 0x6e, 0x69, 0x74, 0x72, 0x64, + 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x1f, 0x0a, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, + 0x6e, 0x61, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x66, 0x69, 0x6c, 0x65, + 0x6e, 0x61, 0x6d, 0x65, 0x22, 0xaa, 0x02, 0x0a, 0x10, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, + 0x49, 0x6e, 0x74, 0x65, 0x72, 0x66, 0x61, 0x63, 0x65, 0x12, 0x2a, 0x0a, 0x11, 0x67, 0x75, 0x65, + 0x73, 0x74, 0x5f, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x67, 0x75, 0x65, 0x73, 0x74, 0x44, 0x65, 0x76, 0x69, 0x63, + 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x3e, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x2a, 0x2e, 0x72, 0x65, 0x69, 0x67, 0x6e, 0x69, 0x74, 0x65, 0x2e, 0x74, + 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x6e, 0x74, 0x65, + 0x72, 0x66, 0x61, 0x63, 0x65, 0x2e, 0x49, 0x66, 0x61, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, + 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x2c, 0x0a, 0x12, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x6d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x72, 0x65, 0x71, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x10, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0x52, 0x65, 0x71, 0x12, 0x20, 0x0a, 0x09, 0x67, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x6d, 0x61, 0x63, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x08, 0x67, 0x75, 0x65, 0x73, 0x74, 0x4d, + 0x61, 0x63, 0x88, 0x01, 0x01, 0x12, 0x1d, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x88, 0x01, 0x01, 0x22, 0x21, 0x0a, 0x09, 0x49, 0x66, 0x61, 0x63, 0x65, 0x54, 0x79, 0x70, + 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x4d, 0x41, 0x43, 0x56, 0x54, 0x41, 0x50, 0x10, 0x00, 0x12, 0x07, + 0x0a, 0x03, 0x54, 0x41, 0x50, 0x10, 0x01, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x67, 0x75, 0x65, 0x73, + 0x74, 0x5f, 0x6d, 0x61, 0x63, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x22, 0x95, 0x02, 0x0a, 0x06, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, + 0x69, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x69, + 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x20, 0x0a, 0x0c, 0x69, 0x73, 0x5f, 0x72, 0x65, 0x61, 0x64, + 0x5f, 0x6f, 0x6e, 0x6c, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x69, 0x73, 0x52, + 0x65, 0x61, 0x64, 0x4f, 0x6e, 0x6c, 0x79, 0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x6f, 0x75, 0x6e, 0x74, + 0x5f, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6d, 0x6f, + 0x75, 0x6e, 0x74, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x34, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x72, 0x65, 0x69, 0x67, 0x6e, + 0x69, 0x74, 0x65, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x56, 0x6f, 0x6c, 0x75, 0x6d, 0x65, + 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x26, + 0x0a, 0x0c, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0b, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, + 0x6e, 0x49, 0x64, 0x88, 0x01, 0x01, 0x12, 0x21, 0x0a, 0x0a, 0x73, 0x69, 0x7a, 0x65, 0x5f, 0x69, + 0x6e, 0x5f, 0x6d, 0x62, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x48, 0x01, 0x52, 0x08, 0x73, 0x69, + 0x7a, 0x65, 0x49, 0x6e, 0x4d, 0x62, 0x88, 0x01, 0x01, 0x42, 0x0f, 0x0a, 0x0d, 0x5f, 0x70, 0x61, + 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x73, + 0x69, 0x7a, 0x65, 0x5f, 0x69, 0x6e, 0x5f, 0x6d, 0x62, 0x22, 0x53, 0x0a, 0x0c, 0x56, 0x6f, 0x6c, + 0x75, 0x6d, 0x65, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x2e, 0x0a, 0x10, 0x63, 0x6f, 0x6e, + 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, + 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x88, 0x01, 0x01, 0x42, 0x13, 0x0a, 0x11, 0x5f, 0x63, 0x6f, + 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x22, 0x2d, + 0x0a, 0x15, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x56, 0x6f, 0x6c, 0x75, 0x6d, + 0x65, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x42, 0x30, 0x5a, + 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x77, 0x65, 0x61, 0x76, + 0x65, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x2f, 0x72, 0x65, 0x69, 0x67, 0x6e, 0x69, 0x74, 0x65, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x3b, 0x74, 0x79, 0x70, 0x65, 0x73, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -773,24 +785,21 @@ func file_types_microvm_proto_rawDescGZIP() []byte { return file_types_microvm_proto_rawDescData } -var ( - file_types_microvm_proto_enumTypes = make([]protoimpl.EnumInfo, 1) - file_types_microvm_proto_msgTypes = make([]protoimpl.MessageInfo, 9) - file_types_microvm_proto_goTypes = []interface{}{ - (NetworkInterface_IfaceType)(0), // 0: reignite.types.NetworkInterface.IfaceType - (*MicroVMSpec)(nil), // 1: reignite.types.MicroVMSpec - (*Kernel)(nil), // 2: reignite.types.Kernel - (*Initrd)(nil), // 3: reignite.types.Initrd - (*NetworkInterface)(nil), // 4: reignite.types.NetworkInterface - (*Volume)(nil), // 5: reignite.types.Volume - (*VolumeSource)(nil), // 6: reignite.types.VolumeSource - (*ContainerVolumeSource)(nil), // 7: reignite.types.ContainerVolumeSource - nil, // 8: reignite.types.MicroVMSpec.LabelsEntry - nil, // 9: reignite.types.MicroVMSpec.MetadataEntry - (*timestamppb.Timestamp)(nil), // 10: google.protobuf.Timestamp - } -) - +var file_types_microvm_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_types_microvm_proto_msgTypes = make([]protoimpl.MessageInfo, 9) +var file_types_microvm_proto_goTypes = []interface{}{ + (NetworkInterface_IfaceType)(0), // 0: reignite.types.NetworkInterface.IfaceType + (*MicroVMSpec)(nil), // 1: reignite.types.MicroVMSpec + (*Kernel)(nil), // 2: reignite.types.Kernel + (*Initrd)(nil), // 3: reignite.types.Initrd + (*NetworkInterface)(nil), // 4: reignite.types.NetworkInterface + (*Volume)(nil), // 5: reignite.types.Volume + (*VolumeSource)(nil), // 6: reignite.types.VolumeSource + (*ContainerVolumeSource)(nil), // 7: reignite.types.ContainerVolumeSource + nil, // 8: reignite.types.MicroVMSpec.LabelsEntry + nil, // 9: reignite.types.MicroVMSpec.MetadataEntry + (*timestamppb.Timestamp)(nil), // 10: google.protobuf.Timestamp +} var file_types_microvm_proto_depIdxs = []int32{ 8, // 0: reignite.types.MicroVMSpec.labels:type_name -> reignite.types.MicroVMSpec.LabelsEntry 2, // 1: reignite.types.MicroVMSpec.kernel:type_name -> reignite.types.Kernel @@ -800,13 +809,14 @@ var file_types_microvm_proto_depIdxs = []int32{ 9, // 5: reignite.types.MicroVMSpec.metadata:type_name -> reignite.types.MicroVMSpec.MetadataEntry 10, // 6: reignite.types.MicroVMSpec.created_at:type_name -> google.protobuf.Timestamp 10, // 7: reignite.types.MicroVMSpec.updated_at:type_name -> google.protobuf.Timestamp - 0, // 8: reignite.types.NetworkInterface.type:type_name -> reignite.types.NetworkInterface.IfaceType - 6, // 9: reignite.types.Volume.source:type_name -> reignite.types.VolumeSource - 10, // [10:10] is the sub-list for method output_type - 10, // [10:10] is the sub-list for method input_type - 10, // [10:10] is the sub-list for extension type_name - 10, // [10:10] is the sub-list for extension extendee - 0, // [0:10] is the sub-list for field type_name + 10, // 8: reignite.types.MicroVMSpec.deleted_at:type_name -> google.protobuf.Timestamp + 0, // 9: reignite.types.NetworkInterface.type:type_name -> reignite.types.NetworkInterface.IfaceType + 6, // 10: reignite.types.Volume.source:type_name -> reignite.types.VolumeSource + 11, // [11:11] is the sub-list for method output_type + 11, // [11:11] is the sub-list for method input_type + 11, // [11:11] is the sub-list for extension type_name + 11, // [11:11] is the sub-list for extension extendee + 0, // [0:11] is the sub-list for field type_name } func init() { file_types_microvm_proto_init() } diff --git a/api/types/microvm.proto b/api/types/microvm.proto index 28beda48..94d218da 100644 --- a/api/types/microvm.proto +++ b/api/types/microvm.proto @@ -46,6 +46,9 @@ message MicroVMSpec { // UpdatedAt indicates the time the microvm was last updated. google.protobuf.Timestamp updated_at = 12; + + // DeletedAt indicates the time the microvm was marked as deleted. + google.protobuf.Timestamp deleted_at = 13; } // Kernel represents the configuration for a kernel. @@ -121,4 +124,4 @@ message VolumeSource { message ContainerVolumeSource { // Image specifies teh conatiner image to use for the volume. string image = 1; -} \ No newline at end of file +} diff --git a/core/application/app_test.go b/core/application/app_test.go index bdc782ca..a4ac7fdb 100644 --- a/core/application/app_test.go +++ b/core/application/app_test.go @@ -3,6 +3,7 @@ package application_test import ( "context" "testing" + "time" "github.com/golang/mock/gomock" . "github.com/onsi/gomega" @@ -17,6 +18,8 @@ import ( ) func TestApp_CreateMicroVM(t *testing.T) { + frozenTime := time.Now + testCases := []struct { name string specToCreate *models.MicroVM @@ -45,9 +48,12 @@ func TestApp_CreateMicroVM(t *testing.T) { nil, ) + expectedCreatedSpec := createTestSpec("id1234", defaults.MicroVMNamespace) + expectedCreatedSpec.Spec.CreatedAt = frozenTime().Unix() + rm.Save( gomock.AssignableToTypeOf(context.Background()), - gomock.Eq(createTestSpec("id1234", defaults.MicroVMNamespace)), + gomock.Eq(expectedCreatedSpec), ).Return( createTestSpec("id1234", defaults.MicroVMNamespace), nil, @@ -77,9 +83,12 @@ func TestApp_CreateMicroVM(t *testing.T) { nil, ) + expectedCreatedSpec := createTestSpec("id1234", "default") + expectedCreatedSpec.Spec.CreatedAt = frozenTime().Unix() + rm.Save( gomock.AssignableToTypeOf(context.Background()), - gomock.Eq(createTestSpec("id1234", "default")), + gomock.Eq(expectedCreatedSpec), ).Return( createTestSpec("id1234", "default"), nil, @@ -134,6 +143,7 @@ func TestApp_CreateMicroVM(t *testing.T) { NetworkService: ns, ImageService: is, FileSystem: fs, + Clock: frozenTime, } tc.expect(rm.EXPECT(), em.EXPECT(), im.EXPECT(), pm.EXPECT()) @@ -152,6 +162,8 @@ func TestApp_CreateMicroVM(t *testing.T) { } func TestApp_UpdateMicroVM(t *testing.T) { + frozenTime := time.Now + testCases := []struct { name string specToUpdate *models.MicroVM @@ -185,9 +197,12 @@ func TestApp_UpdateMicroVM(t *testing.T) { nil, ) + expectedUpdatedSpec := createTestSpec("id1234", "default") + expectedUpdatedSpec.Spec.UpdatedAt = frozenTime().Unix() + rm.Save( gomock.AssignableToTypeOf(context.Background()), - gomock.Eq(createTestSpec("id1234", "default")), + gomock.Eq(expectedUpdatedSpec), ).Return( createTestSpec("id1234", "default"), nil, @@ -227,6 +242,7 @@ func TestApp_UpdateMicroVM(t *testing.T) { NetworkService: ns, ImageService: is, FileSystem: fs, + Clock: frozenTime, } tc.expect(rm.EXPECT(), em.EXPECT(), im.EXPECT(), pm.EXPECT()) @@ -245,6 +261,8 @@ func TestApp_UpdateMicroVM(t *testing.T) { } func TestApp_DeleteMicroVM(t *testing.T) { + frozenTime := time.Now + testCases := []struct { name string toDeleteID string @@ -275,15 +293,21 @@ func TestApp_DeleteMicroVM(t *testing.T) { nil, ) - rm.Delete( + expectedUpdatedSpec := createTestSpec("id1234", "default") + expectedUpdatedSpec.Spec.DeletedAt = frozenTime().Unix() + + rm.Save( gomock.AssignableToTypeOf(context.Background()), + gomock.Eq(expectedUpdatedSpec), + ).Return( createTestSpec("id1234", "default"), - ).Return(nil) + nil, + ) em.Publish( gomock.AssignableToTypeOf(context.Background()), gomock.Eq(defaults.TopicMicroVMEvents), - gomock.Eq(&events.MicroVMSpecDeleted{ + gomock.Eq(&events.MicroVMSpecUpdated{ ID: "id1234", Namespace: "default", }), @@ -292,7 +316,7 @@ func TestApp_DeleteMicroVM(t *testing.T) { }, { name: "spec doesn't exist, should not delete", - expectError: false, + expectError: true, toDeleteID: "id1234", toDeleteNS: "default", expect: func(rm *mock.MockMicroVMRepositoryMockRecorder, em *mock.MockEventServiceMockRecorder, im *mock.MockIDServiceMockRecorder, pm *mock.MockMicroVMServiceMockRecorder) { @@ -330,6 +354,7 @@ func TestApp_DeleteMicroVM(t *testing.T) { NetworkService: ns, ImageService: is, FileSystem: fs, + Clock: frozenTime, } tc.expect(rm.EXPECT(), em.EXPECT(), im.EXPECT(), pm.EXPECT()) @@ -391,6 +416,9 @@ func createTestSpec(name, ns string) *models.MicroVM { Size: 20000, }, }, + CreatedAt: 0, + UpdatedAt: 0, + DeletedAt: 0, }, } } diff --git a/core/application/commands.go b/core/application/commands.go index ece5fb81..3b201222 100644 --- a/core/application/commands.go +++ b/core/application/commands.go @@ -46,6 +46,9 @@ func (a *app) CreateMicroVM(ctx context.Context, mvm *models.MicroVM) (*models.M // TODO: validate the spec + // Set the timestamp when the VMspec was created. + mvm.Spec.CreatedAt = a.ports.Clock().Unix() + createdMVM, err := a.ports.Repo.Save(ctx, mvm) if err != nil { return nil, fmt.Errorf("saving microvm spec: %w", err) @@ -86,6 +89,9 @@ func (a *app) UpdateMicroVM(ctx context.Context, mvm *models.MicroVM) (*models.M // TODO: validate incoming spec // TODO: check if update is valid (i.e. compare existing to requested update) + // Set the timestamp when the VMspec was updated. + mvm.Spec.UpdatedAt = a.ports.Clock().Unix() + updatedMVM, err := a.ports.Repo.Save(ctx, mvm) if err != nil { return nil, fmt.Errorf("updating microvm spec: %w", err) @@ -114,21 +120,25 @@ func (a *app) DeleteMicroVM(ctx context.Context, id, namespace string) error { return fmt.Errorf("checking to see if spec exists: %w", err) } if foundMvm == nil { - logger.Infof("microvm %s/%s doesn't exist, skipping delete", id, namespace) - - return nil + return errSpecNotFound{ + name: id, + namespace: namespace, + } } - err = a.ports.Repo.Delete(ctx, foundMvm) + // Set the timestamp when the VMspec was deleted. + foundMvm.Spec.DeletedAt = a.ports.Clock().Unix() + + _, err = a.ports.Repo.Save(ctx, foundMvm) if err != nil { - return fmt.Errorf("deleting microvm from repository: %w", err) + return fmt.Errorf("marking microvm spec for deletion: %w", err) } - if err := a.ports.EventService.Publish(ctx, defaults.TopicMicroVMEvents, &events.MicroVMSpecDeleted{ - ID: id, - Namespace: namespace, + if err := a.ports.EventService.Publish(ctx, defaults.TopicMicroVMEvents, &events.MicroVMSpecUpdated{ + ID: foundMvm.ID.Name(), + Namespace: foundMvm.ID.Namespace(), }); err != nil { - return fmt.Errorf("publishing microvm deleted event: %w", err) + return fmt.Errorf("publishing microvm updated event: %w", err) } return nil diff --git a/core/models/microvm.go b/core/models/microvm.go index e28edc9c..89d7340e 100644 --- a/core/models/microvm.go +++ b/core/models/microvm.go @@ -29,6 +29,12 @@ type MicroVMSpec struct { // Metadata allows you to specify data to be added to the metadata service. The key is the name // of the metadata item and the value is the base64 encoded contents of the metadata. Metadata map[string]string `json:"metadata"` + // CreatedAt indicates the time the microvm was created at. + CreatedAt int64 `json:"created_at"` + // UpdatedAt indicates the time the microvm was last updated. + UpdatedAt int64 `json:"updated_at"` + // DeletedAt indicates the time the microvm was marked as deleted. + DeletedAt int64 `json:"deleted_at"` } // MicroVMStatus contains the runtime status of the microvm. diff --git a/core/ports/collection.go b/core/ports/collection.go index 6d7e4b65..28e5f1e6 100644 --- a/core/ports/collection.go +++ b/core/ports/collection.go @@ -1,6 +1,10 @@ package ports -import "github.com/spf13/afero" +import ( + "time" + + "github.com/spf13/afero" +) type Collection struct { Repo MicroVMRepository @@ -10,4 +14,5 @@ type Collection struct { NetworkService NetworkService ImageService ImageService FileSystem afero.Fs + Clock func() time.Time } diff --git a/core/ports/time.go b/core/ports/time.go new file mode 100644 index 00000000..38059389 --- /dev/null +++ b/core/ports/time.go @@ -0,0 +1,7 @@ +package ports + +import "time" + +type HasTime interface { + SetClock(func() time.Time) +} diff --git a/go.mod b/go.mod index 974adc75..5cd31ccd 100644 --- a/go.mod +++ b/go.mod @@ -23,10 +23,9 @@ require ( github.com/spf13/cobra v1.2.1 github.com/spf13/pflag v1.0.5 github.com/spf13/viper v1.9.0 + github.com/vishvananda/netlink v1.1.1-0.20201029203352-d40f9887b852 google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83 google.golang.org/grpc v1.41.0 google.golang.org/protobuf v1.27.1 - github.com/vishvananda/netlink v1.1.1-0.20201029203352-d40f9887b852 - gopkg.in/yaml.v2 v2.4.0 // indirect - gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b ) diff --git a/go.sum b/go.sum index 8c7ffa97..2e217839 100644 --- a/go.sum +++ b/go.sum @@ -595,7 +595,6 @@ github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/subcommands v1.0.1 h1:/eqq+otEXm5vhfBrbREPCSVQbvofip6kIz+mX5TUH7k= github.com/google/subcommands v1.0.1/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -1155,7 +1154,6 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.2 h1:Gz96sIWK3OalVv/I/qNygP42zyoKp3xptRVCWRFEBvo= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1440,7 +1438,6 @@ golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.3 h1:L69ShwSZEyCsLKoAxDKeMvLDZkumEe8gXUZAjab0tX8= golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= diff --git a/internal/inject/wire.go b/internal/inject/wire.go index 6275733d..00a06475 100644 --- a/internal/inject/wire.go +++ b/internal/inject/wire.go @@ -5,6 +5,7 @@ package inject import ( "fmt" + "time" "github.com/google/wire" "github.com/spf13/afero" @@ -93,6 +94,7 @@ func appPorts(repo ports.MicroVMRepository, prov ports.MicroVMService, es ports. NetworkService: ns, ImageService: ims, FileSystem: fs, + Clock: time.Now, } } diff --git a/internal/inject/wire_gen.go b/internal/inject/wire_gen.go index bfbbb324..8c143a5d 100644 --- a/internal/inject/wire_gen.go +++ b/internal/inject/wire_gen.go @@ -8,7 +8,6 @@ package inject import ( "fmt" - "github.com/spf13/afero" "github.com/weaveworks/reignite/core/application" "github.com/weaveworks/reignite/core/ports" @@ -19,6 +18,7 @@ import ( "github.com/weaveworks/reignite/infrastructure/network" "github.com/weaveworks/reignite/infrastructure/ulid" "github.com/weaveworks/reignite/internal/config" + "time" ) // Injectors from wire.go: @@ -108,6 +108,7 @@ func appPorts(repo ports.MicroVMRepository, prov ports.MicroVMService, es ports. NetworkService: ns, ImageService: ims, FileSystem: fs, + Clock: time.Now, } }