Updated Workflow Template Versions to support IsLatest and added API methods to save, save & publish

This commit is contained in:
Andrey Melnikov
2020-01-24 10:35:06 -08:00
parent 11ae2e9abb
commit 11e90e17da
12 changed files with 501 additions and 77 deletions

View File

@@ -495,55 +495,57 @@ func init() {
func init() { proto.RegisterFile("workflow.proto", fileDescriptor_892c7f566756b0be) }
var fileDescriptor_892c7f566756b0be = []byte{
// 768 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x96, 0xcd, 0x4e, 0x1b, 0x49,
0x10, 0xc7, 0xd5, 0x18, 0xb3, 0xb8, 0x90, 0x81, 0x2d, 0x8c, 0xf1, 0x7a, 0x59, 0x2d, 0xdb, 0xcb,
0x4a, 0xb0, 0x20, 0x8f, 0xf1, 0x6e, 0xa2, 0x88, 0x08, 0x25, 0x11, 0x02, 0x72, 0xb0, 0xa2, 0xc8,
0xf9, 0x40, 0xe2, 0x12, 0x1a, 0xbb, 0x71, 0x46, 0x31, 0xd3, 0x93, 0xe9, 0xb6, 0x51, 0x64, 0xf9,
0x92, 0x48, 0x39, 0xe4, 0x9a, 0xdc, 0xf2, 0x22, 0x39, 0x27, 0x8f, 0xc0, 0x2b, 0xe4, 0x01, 0xf2,
0x08, 0xd1, 0xb4, 0xa7, 0x07, 0xcf, 0x78, 0x92, 0xd8, 0xe1, 0x36, 0xdd, 0x55, 0x5d, 0xff, 0x5f,
0x75, 0x55, 0xb5, 0x0d, 0xb3, 0xe7, 0xc2, 0x7b, 0x76, 0xda, 0x12, 0xe7, 0x25, 0xd7, 0x13, 0x4a,
0x60, 0x8a, 0xb9, 0x76, 0x71, 0xb9, 0x29, 0x44, 0xb3, 0xc5, 0x2d, 0xe6, 0xda, 0x16, 0x73, 0x1c,
0xa1, 0x98, 0xb2, 0x85, 0x23, 0xfb, 0x2e, 0xc5, 0x25, 0x73, 0xe4, 0x89, 0xe2, 0x67, 0x6e, 0x8b,
0x29,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x70, 0xfe, 0x62, 0x85, 0x91, 0xb8, 0x36,
0x34, 0xa2, 0x71, 0x17, 0x93, 0xe7, 0xfa, 0x08, 0x9e, 0xc1, 0x6c, 0xef, 0xea, 0xd4, 0x77, 0xf0,
0xe6, 0x15, 0x92, 0xc0, 0x77, 0x24, 0xfa, 0x1b, 0x67, 0xd4, 0x24, 0xfe, 0xf5, 0x4d, 0x92, 0x10,
0x96, 0x7e, 0xcf, 0x25, 0xa0, 0xfc, 0x5f, 0x53, 0x96, 0x70, 0xac, 0xf6, 0x3f, 0x99, 0xd2, 0xff,
0xb4, 0xfe, 0xfb, 0x1a, 0x00, 0x00, 0xff, 0xff, 0x85, 0x5f, 0xab, 0xe2, 0xb7, 0x09, 0x00, 0x00,
// 799 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0x5f, 0x4f, 0x2b, 0x45,
0x14, 0xcf, 0x50, 0x8a, 0xf4, 0x90, 0x02, 0x1e, 0x4a, 0xa9, 0x15, 0x22, 0x8e, 0x98, 0x80, 0x90,
0x6e, 0xa9, 0x7f, 0x62, 0x30, 0x44, 0x0d, 0x01, 0x7c, 0x68, 0x8c, 0xa9, 0x22, 0x09, 0x2f, 0x32,
0xb4, 0x43, 0xdd, 0x58, 0x76, 0xd6, 0x9d, 0x69, 0x89, 0x69, 0xfa, 0xa0, 0x26, 0x3e, 0xf8, 0xaa,
0x6f, 0x7e, 0x11, 0x9f, 0xf5, 0x23, 0xf0, 0xe2, 0x07, 0xf0, 0x7e, 0x8f, 0x9b, 0x9d, 0xdd, 0x59,
0x76, 0xb7, 0x7b, 0xa1, 0xbd, 0xdc, 0xb7, 0xce, 0x9c, 0x33, 0xe7, 0xf7, 0xfb, 0x9d, 0x7f, 0x5b,
0x58, 0xbc, 0x15, 0xde, 0x0f, 0xd7, 0x3d, 0x71, 0x5b, 0x73, 0x3d, 0xa1, 0x04, 0xe6, 0x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x99, 0x65, 0x0f, 0x4d, 0xa3, 0x0c, 0x9d, 0xff, 0x10, 0xd8,
0xc8, 0x4e, 0xb4, 0xd1, 0xf9, 0x84, 0x62, 0x5c, 0x6b, 0x7d, 0x97, 0xb4, 0xf9, 0x2a, 0xf5, 0x65,
0x88, 0xb8, 0x23, 0xb0, 0x12, 0xeb, 0xde, 0xe8, 0xfe, 0xad, 0x74, 0x5f, 0x4f, 0xc8, 0xfb, 0xd7,
0xa0, 0x30, 0x23, 0x6c, 0x4c, 0x47, 0xdc, 0xe7, 0x79, 0x71, 0x8a, 0xc7, 0xd3, 0xbf, 0x8a, 0x55,
0xcf, 0x14, 0x0b, 0xff, 0x26, 0xb0, 0x1e, 0xdf, 0x33, 0xa9, 0xc2, 0x48, 0xdc, 0x1e, 0x5b, 0x45,
0x69, 0x17, 0xa3, 0x73, 0x67, 0x02, 0xcf, 0x70, 0x87, 0x1d, 0x69, 0xe9, 0x87, 0xf8, 0xc9, 0x13,
0x44, 0xe0, 0x9f, 0x24, 0xf9, 0x2d, 0x37, 0x68, 0x12, 0xdf, 0x7e, 0x21, 0x93, 0x88, 0x2c, 0x7d,
0xc8, 0x25, 0x64, 0xf9, 0x81, 0x66, 0x59, 0xc3, 0xa9, 0xc6, 0xfc, 0x6a, 0x4e, 0xff, 0xa3, 0x7c,
0xff, 0x79, 0x00, 0x00, 0x00, 0xff, 0xff, 0x31, 0xf2, 0x48, 0x29, 0x9f, 0x0a, 0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.
@@ -565,6 +567,7 @@ type WorkflowServiceClient interface {
WatchWorkflow(ctx context.Context, in *WatchWorkflowRequest, opts ...grpc.CallOption) (WorkflowService_WatchWorkflowClient, error)
GetWorkflowLogs(ctx context.Context, in *GetWorkflowLogsRequest, opts ...grpc.CallOption) (WorkflowService_GetWorkflowLogsClient, error)
CreateWorkflowTemplate(ctx context.Context, in *CreateWorkflowTemplateRequest, opts ...grpc.CallOption) (*WorkflowTemplate, error)
UpdateWorkflowTemplateVersion(ctx context.Context, in *UpdateWorkflowTemplateVersionRequest, opts ...grpc.CallOption) (*WorkflowTemplate, error)
CreateWorkflowTemplateVersion(ctx context.Context, in *CreateWorkflowTemplateRequest, opts ...grpc.CallOption) (*WorkflowTemplate, error)
GetWorkflowTemplate(ctx context.Context, in *GetWorkflowTemplateRequest, opts ...grpc.CallOption) (*WorkflowTemplate, error)
ListWorkflowTemplateVersions(ctx context.Context, in *ListWorkflowTemplateVersionsRequest, opts ...grpc.CallOption) (*ListWorkflowTemplateVersionsResponse, error)
@@ -679,6 +682,15 @@ func (c *workflowServiceClient) CreateWorkflowTemplate(ctx context.Context, in *
return out, nil
}
func (c *workflowServiceClient) UpdateWorkflowTemplateVersion(ctx context.Context, in *UpdateWorkflowTemplateVersionRequest, opts ...grpc.CallOption) (*WorkflowTemplate, error) {
out := new(WorkflowTemplate)
err := c.cc.Invoke(ctx, "/api.WorkflowService/UpdateWorkflowTemplateVersion", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *workflowServiceClient) CreateWorkflowTemplateVersion(ctx context.Context, in *CreateWorkflowTemplateRequest, opts ...grpc.CallOption) (*WorkflowTemplate, error) {
out := new(WorkflowTemplate)
err := c.cc.Invoke(ctx, "/api.WorkflowService/CreateWorkflowTemplateVersion", in, out, opts...)
@@ -724,6 +736,7 @@ type WorkflowServiceServer interface {
WatchWorkflow(*WatchWorkflowRequest, WorkflowService_WatchWorkflowServer) error
GetWorkflowLogs(*GetWorkflowLogsRequest, WorkflowService_GetWorkflowLogsServer) error
CreateWorkflowTemplate(context.Context, *CreateWorkflowTemplateRequest) (*WorkflowTemplate, error)
UpdateWorkflowTemplateVersion(context.Context, *UpdateWorkflowTemplateVersionRequest) (*WorkflowTemplate, error)
CreateWorkflowTemplateVersion(context.Context, *CreateWorkflowTemplateRequest) (*WorkflowTemplate, error)
GetWorkflowTemplate(context.Context, *GetWorkflowTemplateRequest) (*WorkflowTemplate, error)
ListWorkflowTemplateVersions(context.Context, *ListWorkflowTemplateVersionsRequest) (*ListWorkflowTemplateVersionsResponse, error)
@@ -752,6 +765,9 @@ func (*UnimplementedWorkflowServiceServer) GetWorkflowLogs(req *GetWorkflowLogsR
func (*UnimplementedWorkflowServiceServer) CreateWorkflowTemplate(ctx context.Context, req *CreateWorkflowTemplateRequest) (*WorkflowTemplate, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreateWorkflowTemplate not implemented")
}
func (*UnimplementedWorkflowServiceServer) UpdateWorkflowTemplateVersion(ctx context.Context, req *UpdateWorkflowTemplateVersionRequest) (*WorkflowTemplate, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateWorkflowTemplateVersion not implemented")
}
func (*UnimplementedWorkflowServiceServer) CreateWorkflowTemplateVersion(ctx context.Context, req *CreateWorkflowTemplateRequest) (*WorkflowTemplate, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreateWorkflowTemplateVersion not implemented")
}
@@ -883,6 +899,24 @@ func _WorkflowService_CreateWorkflowTemplate_Handler(srv interface{}, ctx contex
return interceptor(ctx, in, info, handler)
}
func _WorkflowService_UpdateWorkflowTemplateVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UpdateWorkflowTemplateVersionRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(WorkflowServiceServer).UpdateWorkflowTemplateVersion(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/api.WorkflowService/UpdateWorkflowTemplateVersion",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(WorkflowServiceServer).UpdateWorkflowTemplateVersion(ctx, req.(*UpdateWorkflowTemplateVersionRequest))
}
return interceptor(ctx, in, info, handler)
}
func _WorkflowService_CreateWorkflowTemplateVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CreateWorkflowTemplateRequest)
if err := dec(in); err != nil {
@@ -975,6 +1009,10 @@ var _WorkflowService_serviceDesc = grpc.ServiceDesc{
MethodName: "CreateWorkflowTemplate",
Handler: _WorkflowService_CreateWorkflowTemplate_Handler,
},
{
MethodName: "UpdateWorkflowTemplateVersion",
Handler: _WorkflowService_UpdateWorkflowTemplateVersion_Handler,
},
{
MethodName: "CreateWorkflowTemplateVersion",
Handler: _WorkflowService_CreateWorkflowTemplateVersion_Handler,

View File

@@ -430,6 +430,120 @@ func local_request_WorkflowService_CreateWorkflowTemplate_0(ctx context.Context,
}
func request_WorkflowService_UpdateWorkflowTemplateVersion_0(ctx context.Context, marshaler runtime.Marshaler, client WorkflowServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq UpdateWorkflowTemplateVersionRequest
var metadata runtime.ServerMetadata
newReader, berr := utilities.IOReaderFactory(req.Body)
if berr != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
}
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.WorkflowTemplate); err != nil && err != io.EOF {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["namespace"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "namespace")
}
protoReq.Namespace, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err)
}
val, ok = pathParams["workflowTemplate.uid"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "workflowTemplate.uid")
}
err = runtime.PopulateFieldFromPath(&protoReq, "workflowTemplate.uid", val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "workflowTemplate.uid", err)
}
val, ok = pathParams["workflowTemplate.version"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "workflowTemplate.version")
}
err = runtime.PopulateFieldFromPath(&protoReq, "workflowTemplate.version", val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "workflowTemplate.version", err)
}
msg, err := client.UpdateWorkflowTemplateVersion(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_WorkflowService_UpdateWorkflowTemplateVersion_0(ctx context.Context, marshaler runtime.Marshaler, server WorkflowServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq UpdateWorkflowTemplateVersionRequest
var metadata runtime.ServerMetadata
newReader, berr := utilities.IOReaderFactory(req.Body)
if berr != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
}
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.WorkflowTemplate); err != nil && err != io.EOF {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["namespace"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "namespace")
}
protoReq.Namespace, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err)
}
val, ok = pathParams["workflowTemplate.uid"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "workflowTemplate.uid")
}
err = runtime.PopulateFieldFromPath(&protoReq, "workflowTemplate.uid", val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "workflowTemplate.uid", err)
}
val, ok = pathParams["workflowTemplate.version"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "workflowTemplate.version")
}
err = runtime.PopulateFieldFromPath(&protoReq, "workflowTemplate.version", val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "workflowTemplate.version", err)
}
msg, err := server.UpdateWorkflowTemplateVersion(ctx, &protoReq)
return msg, metadata, err
}
func request_WorkflowService_CreateWorkflowTemplateVersion_0(ctx context.Context, marshaler runtime.Marshaler, client WorkflowServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq CreateWorkflowTemplateRequest
var metadata runtime.ServerMetadata
@@ -940,6 +1054,26 @@ func RegisterWorkflowServiceHandlerServer(ctx context.Context, mux *runtime.Serv
})
mux.Handle("PUT", pattern_WorkflowService_UpdateWorkflowTemplateVersion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_WorkflowService_UpdateWorkflowTemplateVersion_0(rctx, inboundMarshaler, server, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_WorkflowService_UpdateWorkflowTemplateVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_WorkflowService_CreateWorkflowTemplateVersion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
@@ -1201,6 +1335,26 @@ func RegisterWorkflowServiceHandlerClient(ctx context.Context, mux *runtime.Serv
})
mux.Handle("PUT", pattern_WorkflowService_UpdateWorkflowTemplateVersion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_WorkflowService_UpdateWorkflowTemplateVersion_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_WorkflowService_UpdateWorkflowTemplateVersion_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_WorkflowService_CreateWorkflowTemplateVersion_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
@@ -1317,6 +1471,8 @@ var (
pattern_WorkflowService_CreateWorkflowTemplate_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3}, []string{"apis", "v1beta1", "namespace", "workflow_templates"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_WorkflowService_UpdateWorkflowTemplateVersion_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6}, []string{"apis", "v1beta1", "namespace", "workflow_templates", "workflowTemplate.uid", "versions", "workflowTemplate.version"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_WorkflowService_CreateWorkflowTemplateVersion_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"apis", "v1beta1", "namespace", "workflow_templates", "workflowTemplate.uid", "versions"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_WorkflowService_GetWorkflowTemplate_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"apis", "v1beta1", "namespace", "workflow_templates", "uid"}, "", runtime.AssumeColonVerbOpt(true)))
@@ -1341,6 +1497,8 @@ var (
forward_WorkflowService_CreateWorkflowTemplate_0 = runtime.ForwardResponseMessage
forward_WorkflowService_UpdateWorkflowTemplateVersion_0 = runtime.ForwardResponseMessage
forward_WorkflowService_CreateWorkflowTemplateVersion_0 = runtime.ForwardResponseMessage
forward_WorkflowService_GetWorkflowTemplate_0 = runtime.ForwardResponseMessage

View File

@@ -45,6 +45,13 @@ service WorkflowService {
};
}
rpc UpdateWorkflowTemplateVersion (UpdateWorkflowTemplateVersionRequest) returns (WorkflowTemplate) {
option (google.api.http) = {
put: "/apis/v1beta1/{namespace}/workflow_templates/{workflowTemplate.uid}/versions/{workflowTemplate.version}"
body: "workflowTemplate"
};
}
rpc CreateWorkflowTemplateVersion (CreateWorkflowTemplateRequest) returns (WorkflowTemplate) {
option (google.api.http) = {
post: "/apis/v1beta1/{namespace}/workflow_templates/{workflowTemplate.uid}/versions"

View File

@@ -207,6 +207,51 @@
]
}
},
"/apis/v1beta1/{namespace}/workflow_templates/{workflowTemplate.uid}/versions/{workflowTemplate.version}": {
"put": {
"operationId": "UpdateWorkflowTemplateVersion",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/apiWorkflowTemplate"
}
}
},
"parameters": [
{
"name": "namespace",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "workflowTemplate.uid",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "workflowTemplate.version",
"in": "path",
"required": true,
"type": "integer",
"format": "int32"
},
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/apiWorkflowTemplate"
}
}
],
"tags": [
"WorkflowService"
]
}
},
"/apis/v1beta1/{namespace}/workflows": {
"get": {
"operationId": "ListWorkflows",
@@ -474,6 +519,10 @@
},
"manifest": {
"type": "string"
},
"isLatest": {
"type": "boolean",
"format": "boolean"
}
}
},

View File

@@ -67,6 +67,53 @@ func (m *CreateWorkflowTemplateRequest) GetWorkflowTemplate() *WorkflowTemplate
return nil
}
type UpdateWorkflowTemplateVersionRequest struct {
Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"`
WorkflowTemplate *WorkflowTemplate `protobuf:"bytes,2,opt,name=workflowTemplate,proto3" json:"workflowTemplate,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *UpdateWorkflowTemplateVersionRequest) Reset() { *m = UpdateWorkflowTemplateVersionRequest{} }
func (m *UpdateWorkflowTemplateVersionRequest) String() string { return proto.CompactTextString(m) }
func (*UpdateWorkflowTemplateVersionRequest) ProtoMessage() {}
func (*UpdateWorkflowTemplateVersionRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_b9a07547748a96e8, []int{1}
}
func (m *UpdateWorkflowTemplateVersionRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_UpdateWorkflowTemplateVersionRequest.Unmarshal(m, b)
}
func (m *UpdateWorkflowTemplateVersionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_UpdateWorkflowTemplateVersionRequest.Marshal(b, m, deterministic)
}
func (m *UpdateWorkflowTemplateVersionRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_UpdateWorkflowTemplateVersionRequest.Merge(m, src)
}
func (m *UpdateWorkflowTemplateVersionRequest) XXX_Size() int {
return xxx_messageInfo_UpdateWorkflowTemplateVersionRequest.Size(m)
}
func (m *UpdateWorkflowTemplateVersionRequest) XXX_DiscardUnknown() {
xxx_messageInfo_UpdateWorkflowTemplateVersionRequest.DiscardUnknown(m)
}
var xxx_messageInfo_UpdateWorkflowTemplateVersionRequest proto.InternalMessageInfo
func (m *UpdateWorkflowTemplateVersionRequest) GetNamespace() string {
if m != nil {
return m.Namespace
}
return ""
}
func (m *UpdateWorkflowTemplateVersionRequest) GetWorkflowTemplate() *WorkflowTemplate {
if m != nil {
return m.WorkflowTemplate
}
return nil
}
type GetWorkflowTemplateRequest struct {
Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"`
Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid,omitempty"`
@@ -80,7 +127,7 @@ func (m *GetWorkflowTemplateRequest) Reset() { *m = GetWorkflowTemplateR
func (m *GetWorkflowTemplateRequest) String() string { return proto.CompactTextString(m) }
func (*GetWorkflowTemplateRequest) ProtoMessage() {}
func (*GetWorkflowTemplateRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_b9a07547748a96e8, []int{1}
return fileDescriptor_b9a07547748a96e8, []int{2}
}
func (m *GetWorkflowTemplateRequest) XXX_Unmarshal(b []byte) error {
@@ -134,7 +181,7 @@ func (m *ListWorkflowTemplateVersionsRequest) Reset() { *m = ListWorkflo
func (m *ListWorkflowTemplateVersionsRequest) String() string { return proto.CompactTextString(m) }
func (*ListWorkflowTemplateVersionsRequest) ProtoMessage() {}
func (*ListWorkflowTemplateVersionsRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_b9a07547748a96e8, []int{2}
return fileDescriptor_b9a07547748a96e8, []int{3}
}
func (m *ListWorkflowTemplateVersionsRequest) XXX_Unmarshal(b []byte) error {
@@ -181,7 +228,7 @@ func (m *ListWorkflowTemplateVersionsResponse) Reset() { *m = ListWorkfl
func (m *ListWorkflowTemplateVersionsResponse) String() string { return proto.CompactTextString(m) }
func (*ListWorkflowTemplateVersionsResponse) ProtoMessage() {}
func (*ListWorkflowTemplateVersionsResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_b9a07547748a96e8, []int{3}
return fileDescriptor_b9a07547748a96e8, []int{4}
}
func (m *ListWorkflowTemplateVersionsResponse) XXX_Unmarshal(b []byte) error {
@@ -227,7 +274,7 @@ func (m *ListWorkflowTemplatesRequest) Reset() { *m = ListWorkflowTempla
func (m *ListWorkflowTemplatesRequest) String() string { return proto.CompactTextString(m) }
func (*ListWorkflowTemplatesRequest) ProtoMessage() {}
func (*ListWorkflowTemplatesRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_b9a07547748a96e8, []int{4}
return fileDescriptor_b9a07547748a96e8, []int{5}
}
func (m *ListWorkflowTemplatesRequest) XXX_Unmarshal(b []byte) error {
@@ -267,7 +314,7 @@ func (m *ListWorkflowTemplatesResponse) Reset() { *m = ListWorkflowTempl
func (m *ListWorkflowTemplatesResponse) String() string { return proto.CompactTextString(m) }
func (*ListWorkflowTemplatesResponse) ProtoMessage() {}
func (*ListWorkflowTemplatesResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_b9a07547748a96e8, []int{5}
return fileDescriptor_b9a07547748a96e8, []int{6}
}
func (m *ListWorkflowTemplatesResponse) XXX_Unmarshal(b []byte) error {
@@ -307,6 +354,7 @@ type WorkflowTemplate struct {
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
Version int32 `protobuf:"varint,3,opt,name=version,proto3" json:"version,omitempty"`
Manifest string `protobuf:"bytes,4,opt,name=manifest,proto3" json:"manifest,omitempty"`
IsLatest bool `protobuf:"varint,5,opt,name=isLatest,proto3" json:"isLatest,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
@@ -316,7 +364,7 @@ func (m *WorkflowTemplate) Reset() { *m = WorkflowTemplate{} }
func (m *WorkflowTemplate) String() string { return proto.CompactTextString(m) }
func (*WorkflowTemplate) ProtoMessage() {}
func (*WorkflowTemplate) Descriptor() ([]byte, []int) {
return fileDescriptor_b9a07547748a96e8, []int{6}
return fileDescriptor_b9a07547748a96e8, []int{7}
}
func (m *WorkflowTemplate) XXX_Unmarshal(b []byte) error {
@@ -365,8 +413,16 @@ func (m *WorkflowTemplate) GetManifest() string {
return ""
}
func (m *WorkflowTemplate) GetIsLatest() bool {
if m != nil {
return m.IsLatest
}
return false
}
func init() {
proto.RegisterType((*CreateWorkflowTemplateRequest)(nil), "api.CreateWorkflowTemplateRequest")
proto.RegisterType((*UpdateWorkflowTemplateVersionRequest)(nil), "api.UpdateWorkflowTemplateVersionRequest")
proto.RegisterType((*GetWorkflowTemplateRequest)(nil), "api.GetWorkflowTemplateRequest")
proto.RegisterType((*ListWorkflowTemplateVersionsRequest)(nil), "api.ListWorkflowTemplateVersionsRequest")
proto.RegisterType((*ListWorkflowTemplateVersionsResponse)(nil), "api.ListWorkflowTemplateVersionsResponse")
@@ -378,23 +434,25 @@ func init() {
func init() { proto.RegisterFile("workflow_template.proto", fileDescriptor_b9a07547748a96e8) }
var fileDescriptor_b9a07547748a96e8 = []byte{
// 286 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x52, 0xbf, 0x4f, 0xf3, 0x30,
0x10, 0x95, 0x9b, 0xe6, 0xfb, 0xc8, 0xb1, 0x04, 0x0b, 0x84, 0x55, 0xb5, 0x52, 0x64, 0x18, 0x32,
0x65, 0x80, 0x95, 0x05, 0x75, 0x60, 0x61, 0x8a, 0xf8, 0x31, 0x22, 0x53, 0x2e, 0x92, 0x45, 0x63,
0x9b, 0xd8, 0x21, 0x12, 0x13, 0xfc, 0xe7, 0xa8, 0x6e, 0x4a, 0xa5, 0x84, 0x20, 0x54, 0x89, 0xed,
0xce, 0x7e, 0xf7, 0xde, 0xf3, 0x3b, 0xc3, 0x71, 0xa3, 0xab, 0xe7, 0x62, 0xa9, 0x9b, 0x07, 0x87,
0xa5, 0x59, 0x0a, 0x87, 0x99, 0xa9, 0xb4, 0xd3, 0x34, 0x10, 0x46, 0xf2, 0x77, 0x02, 0xb3, 0x79,
0x85, 0xc2, 0xe1, 0x7d, 0x0b, 0xbb, 0x69, 0x51, 0x39, 0xbe, 0xd4, 0x68, 0x1d, 0x9d, 0x42, 0xa4,
0x44, 0x89, 0xd6, 0x88, 0x05, 0x32, 0x92, 0x90, 0x34, 0xca, 0xb7, 0x07, 0xf4, 0x12, 0xe2, 0xa6,
0x33, 0xc8, 0x46, 0x09, 0x49, 0xf7, 0xcf, 0x8e, 0x32, 0x61, 0x64, 0xd6, 0x63, 0xed, 0xc1, 0x79,
0x01, 0x93, 0x2b, 0x74, 0xbb, 0xc9, 0xc7, 0x10, 0xd4, 0xf2, 0xc9, 0x2b, 0x46, 0xf9, 0xaa, 0xa4,
0x0c, 0xfe, 0xbf, 0x62, 0x65, 0xa5, 0x56, 0x2c, 0x48, 0x48, 0x1a, 0xe6, 0x9b, 0x96, 0xdf, 0xc2,
0xc9, 0xb5, 0xb4, 0x3d, 0xa1, 0xbb, 0xf5, 0xb5, 0xdd, 0x51, 0x90, 0x7f, 0x10, 0x38, 0xfd, 0x99,
0xd7, 0x1a, 0xad, 0x2c, 0xd2, 0x43, 0x08, 0x17, 0xba, 0x56, 0xce, 0x93, 0x86, 0xf9, 0xba, 0xa1,
0x73, 0x38, 0xe8, 0x26, 0x62, 0xd9, 0x28, 0x09, 0x86, 0x13, 0xec, 0xe3, 0xf9, 0x05, 0x4c, 0xbf,
0xb3, 0xf0, 0xbb, 0x37, 0xf1, 0x37, 0x98, 0x0d, 0x4c, 0xff, 0xbd, 0x73, 0x05, 0x71, 0x17, 0xb6,
0xc9, 0x98, 0x6c, 0x97, 0x4a, 0x61, 0xbc, 0xb2, 0xdb, 0xc6, 0xee, 0xeb, 0xe1, 0x45, 0xd3, 0x09,
0xec, 0x95, 0x42, 0xc9, 0x02, 0xad, 0x63, 0x63, 0x3f, 0xf1, 0xd5, 0x3f, 0xfe, 0xf3, 0x7f, 0xff,
0xfc, 0x33, 0x00, 0x00, 0xff, 0xff, 0xfd, 0x8f, 0xf0, 0x3d, 0x16, 0x03, 0x00, 0x00,
// 316 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x53, 0x41, 0x4b, 0xf3, 0x40,
0x10, 0x65, 0x9b, 0xe6, 0xfb, 0xda, 0xf1, 0x52, 0x17, 0xc5, 0xa5, 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0x45, 0x7a, 0x02, 0xfe, 0x5c, 0xa7, 0xb1, 0x2b, 0x86, 0xfa, 0x62, 0x0d, 0xe8,
0x04, 0x8e, 0xab, 0x89, 0x58, 0xd6, 0x0a, 0xbc, 0xe6, 0x04, 0xeb, 0x7c, 0x7e, 0x05, 0x83, 0x7d,
0x12, 0x7e, 0xe6, 0x89, 0xbf, 0xc2, 0xb0, 0xa1, 0xfb, 0xf7, 0x95, 0x7f, 0x12, 0xe8, 0x55, 0x79,
0x9b, 0x90, 0xc9, 0xee, 0xaa, 0x14, 0xda, 0xb9, 0xde, 0x32, 0xf7, 0xa2, 0x6e, 0xbe, 0x34, 0xed,
0x43, 0x27, 0x92, 0xb1, 0x5a, 0xa2, 0x75, 0xac, 0x5d, 0x74, 0x6c, 0x71, 0xfe, 0x4f, 0xd9, 0x69,
0xbe, 0xdb, 0x31, 0x3f, 0x20, 0x61, 0x47, 0x6c, 0xf1, 0xe3, 0xbf, 0xe2, 0x89, 0x5e, 0x7e, 0x05,
0x00, 0x00, 0xff, 0xff, 0x7d, 0x80, 0xa3, 0x6b, 0xbd, 0x03, 0x00, 0x00,
}

View File

@@ -7,6 +7,11 @@ message CreateWorkflowTemplateRequest {
WorkflowTemplate workflowTemplate = 2;
}
message UpdateWorkflowTemplateVersionRequest {
string namespace = 1;
WorkflowTemplate workflowTemplate = 2;
}
message GetWorkflowTemplateRequest {
string namespace = 1;
string uid = 2;
@@ -37,4 +42,5 @@ message WorkflowTemplate {
string name = 2;
int32 version = 3;
string manifest = 4;
bool isLatest = 5;
}

8
go.mod
View File

@@ -12,6 +12,7 @@ require (
github.com/elazarl/goproxy v0.0.0-20191011121108-aa519ddbe484 // indirect
github.com/evanphx/json-patch v4.5.0+incompatible // indirect
github.com/go-openapi/spec v0.19.4 // indirect
github.com/go-sql-driver/mysql v1.5.0 // indirect
github.com/gogo/protobuf v1.3.1 // indirect
github.com/golang/protobuf v1.3.2
github.com/google/uuid v1.1.1
@@ -23,17 +24,20 @@ require (
github.com/imdario/mergo v0.3.8 // indirect
github.com/jmoiron/sqlx v1.2.0
github.com/json-iterator/go v1.1.8 // indirect
github.com/lib/pq v1.0.0
github.com/lib/pq v1.3.0
github.com/mattn/go-sqlite3 v2.0.2+incompatible // indirect
github.com/modern-go/reflect2 v1.0.1 // indirect
github.com/pkg/errors v0.8.1 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pressly/goose v2.6.0+incompatible
github.com/sirupsen/logrus v1.4.2 // indirect
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5
github.com/valyala/fasttemplate v1.1.0 // indirect
github.com/ziutek/mymysql v1.5.4 // indirect
golang.org/x/crypto v0.0.0-20191128160524-b544559bb6d1 // indirect
golang.org/x/net v0.0.0-20191126235420-ef20fe5d7933 // indirect
golang.org/x/oauth2 v0.0.0-20191122200657-5d9234df094c // indirect
golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect
google.golang.org/appengine v1.6.5 // indirect
google.golang.org/genproto v0.0.0-20191206224255-0243a4be9c8f
google.golang.org/grpc v1.25.1
gopkg.in/inf.v0 v0.9.1 // indirect

13
go.sum
View File

@@ -74,6 +74,8 @@ github.com/go-openapi/swag v0.19.5 h1:lTz6Ys4CmqqCQmZPBlbQENR1/GucA2bzYTE12Pw4tF
github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk=
github.com/go-sql-driver/mysql v1.4.0 h1:7LxgVwFb2hIQtMm87NdgAVfXjnt4OePseqT1tKx+opk=
github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs=
github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls=
github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58=
@@ -81,6 +83,7 @@ github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfU
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/protobuf v0.0.0-20161109072736-4bd1920723d7/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs=
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
@@ -123,12 +126,16 @@ github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 h1:P6pPBnrTSX3DEVR4fDembhR
github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0/go.mod h1:vmVJ0l/dxyfGW6FmdpVm2joNMFikkuWg0EoCKLGUMNw=
github.com/lib/pq v1.0.0 h1:X5PMW56eZitiTeO7tKzZxFCSpbFZJtkMMooicw2us9A=
github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/lib/pq v1.3.0 h1:/qkRGz8zljWiDcFvgpwUpwIAPu3r07TDvs3Rws+o/pU=
github.com/lib/pq v1.3.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e h1:hB2xlXdHp/pmPZq0y3QnmWAArdw9PqbmotexnWx/FU8=
github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mattn/go-sqlite3 v1.9.0 h1:pDRiWfl+++eC2FEFRy6jXmQlvp4Yh3z1MJKg4UeYM/4=
github.com/mattn/go-sqlite3 v1.9.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
github.com/mattn/go-sqlite3 v2.0.2+incompatible h1:qzw9c2GNT8UFrgWNDhCTqRqYUSmu/Dav/9Z58LGpk7U=
github.com/mattn/go-sqlite3 v2.0.2+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
@@ -143,6 +150,8 @@ github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c h1:eSfnfIuwhxZyULg1NNu
github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA=
github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
@@ -170,6 +179,8 @@ github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6Kllzaw
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
github.com/valyala/fasttemplate v1.1.0 h1:RZqt0yGBsps8NGvLSGW804QQqCUYYLsaOjTVHy1Ocw4=
github.com/valyala/fasttemplate v1.1.0/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8=
github.com/ziutek/mymysql v1.5.4 h1:GB0qdRGsTwQSBVYuVShFBKaXSnSnYYC2d9knnE1LHFs=
github.com/ziutek/mymysql v1.5.4/go.mod h1:LMSpPZ6DbqWFxNCHW77HeMg9I646SAhApZ/wKdgO/C0=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191128160524-b544559bb6d1 h1:anGSYQpPhQwXlwsu5wmfq0nWkCNaMEMUwAv13Y92hd8=
@@ -185,6 +196,7 @@ golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73r
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20191002035440-2ec189313ef0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
@@ -221,6 +233,7 @@ golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgw
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508=
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 h1:gSJIx1SDwno+2ElGhA4+qG2zF97qiUzTM+rQ0klBOcE=
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=

View File

@@ -196,10 +196,39 @@ func (r *ResourceManager) CreateWorkflowTemplateVersion(namespace string, workfl
return nil, util.NewUserError(codes.InvalidArgument, err.Error())
}
if err := r.workflowRepository.RemoveIsLatestFromWorkflowTemplateVersions(workflowTemplate); err != nil {
return nil, err
}
workflowTemplate, err := r.workflowRepository.CreateWorkflowTemplateVersion(namespace, workflowTemplate)
if err != nil {
return nil, util.NewUserErrorWrap(err, "Workflow template")
}
if err == nil && workflowTemplate == nil {
return nil, util.NewUserError(codes.NotFound, "Workflow template not found.")
}
return workflowTemplate, nil
}
func (r *ResourceManager) UpdateWorkflowTemplateVersion(namespace string, workflowTemplate *model.WorkflowTemplate) (*model.WorkflowTemplate, error) {
// validate workflow template
if err := r.kubeClient.ValidateWorkflow(workflowTemplate.GetManifestBytes()); err != nil {
return nil, util.NewUserError(codes.InvalidArgument, err.Error())
}
originalWorkflowTemplate, err := r.workflowRepository.GetWorkflowTemplate(namespace, workflowTemplate.UID, workflowTemplate.Version)
if err != nil {
return nil, err
}
workflowTemplate.ID = originalWorkflowTemplate.ID
workflowTemplate, err = r.workflowRepository.UpdateWorkflowTemplateVersion(workflowTemplate)
if err != nil {
return nil, util.NewUserErrorWrap(err, "Workflow template")
}
if err == nil && workflowTemplate == nil {
return nil, util.NewUserError(codes.NotFound, "Workflow template not found.")
}

View File

@@ -10,6 +10,7 @@ type WorkflowTemplate struct {
Name string
Manifest string
Version int32
IsLatest bool `db:"is_latest"`
}
func (wt *WorkflowTemplate) GetManifestBytes() []byte {

View File

@@ -23,6 +23,7 @@ func (r *WorkflowRepository) insertWorkflowTemplateVersion(workflowTemplate *mod
"workflow_template_id": workflowTemplate.ID,
"manifest": workflowTemplate.Manifest,
"version": int32(time.Now().Unix()),
"is_latest": workflowTemplate.IsLatest,
}).
Suffix("RETURNING version").
RunWith(runner).
@@ -67,6 +68,25 @@ func (r *WorkflowRepository) CreateWorkflowTemplate(namespace string, workflowTe
return workflowTemplate, nil
}
func (r *WorkflowRepository) RemoveIsLatestFromWorkflowTemplateVersions(workflowTemplate *model.WorkflowTemplate) error {
query, args, err := r.sb.Update("workflow_template_versions").
Set("is_latest", true).
Where(sq.Eq{
"workflow_template_id": workflowTemplate.ID,
"is_latest": false,
}).
ToSql()
if err != nil {
return err
}
if _, err := r.db.Exec(query, args...); err != nil {
return err
}
return nil
}
func (r *WorkflowRepository) CreateWorkflowTemplateVersion(namespace string, workflowTemplate *model.WorkflowTemplate) (*model.WorkflowTemplate, error) {
query, args, err := r.sb.Select("id, name").
From("workflow_templates").
@@ -90,8 +110,28 @@ func (r *WorkflowRepository) CreateWorkflowTemplateVersion(namespace string, wor
return workflowTemplate, nil
}
func (r *WorkflowRepository) UpdateWorkflowTemplateVersion(workflowTemplate *model.WorkflowTemplate) (*model.WorkflowTemplate, error) {
query, args, err := r.sb.Update("workflow_template_versions").
Set("manifest", workflowTemplate.Manifest).
Where(sq.Eq{
"workflow_template_id": workflowTemplate.ID,
"version": workflowTemplate.Version,
}).
ToSql()
if err != nil {
return nil, err
}
if _, err := r.db.Exec(query, args...); err != nil {
return nil, err
}
return workflowTemplate, nil
}
func (r *WorkflowRepository) workflowTemplatesSelectBuilder(namespace string) sq.SelectBuilder {
sb := r.sb.Select("wt.uid", "wt.name", "wtv.version").
sb := r.sb.Select("wt.id", "wt.uid", "wt.name", "wtv.version", "wtv.is_latest").
From("workflow_template_versions wtv").
Join("workflow_templates wt ON wt.id = wtv.workflow_template_id").
Where(sq.Eq{

View File

@@ -32,6 +32,7 @@ func apiWorkflow(wf *model.Workflow) (workflow *api.Workflow) {
Name: wf.WorkflowTemplate.Name,
Version: wf.WorkflowTemplate.Version,
Manifest: wf.WorkflowTemplate.Manifest,
IsLatest: wf.WorkflowTemplate.IsLatest,
}
}
@@ -44,6 +45,7 @@ func apiWorkflowTemplate(wft *model.WorkflowTemplate) *api.WorkflowTemplate {
Name: wft.Name,
Version: wft.Version,
Manifest: wft.Manifest,
IsLatest: wft.IsLatest,
}
}
@@ -177,6 +179,25 @@ func (s *WorkflowServer) CreateWorkflowTemplateVersion(ctx context.Context, req
return req.WorkflowTemplate, nil
}
func (s *WorkflowServer) UpdateWorkflowTemplateVersion(ctx context.Context, req *api.UpdateWorkflowTemplateVersionRequest) (*api.WorkflowTemplate, error) {
workflowTemplate := &model.WorkflowTemplate{
UID: req.WorkflowTemplate.Uid,
Name: req.WorkflowTemplate.Name,
Manifest: req.WorkflowTemplate.Manifest,
Version: req.WorkflowTemplate.Version,
}
workflowTemplate, err := s.resourceManager.UpdateWorkflowTemplateVersion(req.Namespace, workflowTemplate)
if errors.As(err, &userError) {
return nil, userError.GRPCError()
}
req.WorkflowTemplate.Uid = workflowTemplate.UID
req.WorkflowTemplate.Name = workflowTemplate.Name
req.WorkflowTemplate.Version = workflowTemplate.Version
return req.WorkflowTemplate, nil
}
func (s *WorkflowServer) GetWorkflowTemplate(ctx context.Context, req *api.GetWorkflowTemplateRequest) (*api.WorkflowTemplate, error) {
workflowTemplate, err := s.resourceManager.GetWorkflowTemplate(req.Namespace, req.Uid, req.Version)
if errors.As(err, &userError) {