support archiving workflow_templates

This commit is contained in:
rushtehrani
2020-02-04 12:23:52 -08:00
parent 5086508996
commit 04b76e6aa8
11 changed files with 478 additions and 97 deletions

View File

@@ -511,60 +511,62 @@ func init() {
func init() { proto.RegisterFile("workflow.proto", fileDescriptor_892c7f566756b0be) } func init() { proto.RegisterFile("workflow.proto", fileDescriptor_892c7f566756b0be) }
var fileDescriptor_892c7f566756b0be = []byte{ var fileDescriptor_892c7f566756b0be = []byte{
// 835 bytes of a gzipped FileDescriptorProto // 869 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x96, 0xdf, 0x4e, 0x33, 0x45, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x96, 0x4f, 0x6f, 0x1b, 0x45,
0x14, 0xc0, 0x33, 0xf4, 0x2b, 0xd2, 0xf3, 0xa5, 0x1f, 0x78, 0x28, 0xa5, 0x56, 0x88, 0x38, 0x62, 0x14, 0xc0, 0x35, 0x71, 0x1d, 0xe2, 0x57, 0xb9, 0x29, 0xaf, 0x8e, 0x6d, 0x4c, 0x2a, 0xc2, 0x34,
0x02, 0x42, 0xba, 0xa5, 0xfe, 0x09, 0xc1, 0x90, 0x48, 0x08, 0xe0, 0x45, 0x63, 0x4c, 0x15, 0x89, 0x48, 0x49, 0x5b, 0x79, 0x5d, 0x53, 0x50, 0x15, 0x54, 0x89, 0xa8, 0x6a, 0xcb, 0xc1, 0x42, 0xc8,
0x78, 0x21, 0x43, 0x3b, 0xd4, 0x8d, 0x65, 0x67, 0xdd, 0x99, 0x96, 0x98, 0xa6, 0x17, 0xea, 0x9d, 0x50, 0x2a, 0xca, 0x81, 0x4e, 0xec, 0x89, 0xb3, 0xc2, 0xd9, 0x59, 0x76, 0xc6, 0x8e, 0x90, 0xe5,
0xb7, 0x7a, 0xe7, 0x8d, 0xf1, 0x29, 0xbc, 0xf6, 0x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 0x21, 0xe5, 0x3b, 0x9a, 0xb2, 0x86, 0x53, 0x8d, 0xf9, 0xe5, 0x26, 0xf1, 0xdd, 0x33, 0x49, 0x62, 0x58, 0x7a, 0x9e, 0x8a, 0xa1, 0x7c, 0xa8, 0x29, 0x9b, 0xb8,
0xac, 0xfe, 0x8c, 0x7d, 0xfb, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xaa, 0x6f, 0xd7, 0x25, 0x14, 0xd0, 0x98, 0xe3, 0x31, 0x81, 0xda, 0x6e, 0xd0, 0x3b, 0x70, 0xc7, 0xb3, 0x3b, 0xe7, 0x8e, 0xf6,
0x0b, 0x00, 0x00, 0x7a, 0x86, 0xd4, 0xa2, 0x6d, 0x9e, 0xaf, 0x64, 0xe0, 0x76, 0x34, 0xdc, 0xc3, 0xbb, 0x97, 0xe8,
0x9e, 0xbd, 0x65, 0xfd, 0xa5, 0xfd, 0xfe, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x85, 0x98, 0x83,
0x4b, 0xb7, 0x0b, 0x00, 0x00,
} }
// Reference imports to suppress errors if they are not otherwise used. // Reference imports to suppress errors if they are not otherwise used.
@@ -591,6 +593,7 @@ type WorkflowServiceClient interface {
GetWorkflowTemplate(ctx context.Context, in *GetWorkflowTemplateRequest, 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) ListWorkflowTemplateVersions(ctx context.Context, in *ListWorkflowTemplateVersionsRequest, opts ...grpc.CallOption) (*ListWorkflowTemplateVersionsResponse, error)
ListWorkflowTemplates(ctx context.Context, in *ListWorkflowTemplatesRequest, opts ...grpc.CallOption) (*ListWorkflowTemplatesResponse, error) ListWorkflowTemplates(ctx context.Context, in *ListWorkflowTemplatesRequest, opts ...grpc.CallOption) (*ListWorkflowTemplatesResponse, error)
ArchiveWorkflowTemplate(ctx context.Context, in *ArchiveWorkflowTemplateRequest, opts ...grpc.CallOption) (*ArchiveWorkflowTemplateResponse, error)
} }
type workflowServiceClient struct { type workflowServiceClient struct {
@@ -746,6 +749,15 @@ func (c *workflowServiceClient) ListWorkflowTemplates(ctx context.Context, in *L
return out, nil return out, nil
} }
func (c *workflowServiceClient) ArchiveWorkflowTemplate(ctx context.Context, in *ArchiveWorkflowTemplateRequest, opts ...grpc.CallOption) (*ArchiveWorkflowTemplateResponse, error) {
out := new(ArchiveWorkflowTemplateResponse)
err := c.cc.Invoke(ctx, "/api.WorkflowService/ArchiveWorkflowTemplate", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// WorkflowServiceServer is the server API for WorkflowService service. // WorkflowServiceServer is the server API for WorkflowService service.
type WorkflowServiceServer interface { type WorkflowServiceServer interface {
// Creates a Workflow // Creates a Workflow
@@ -760,6 +772,7 @@ type WorkflowServiceServer interface {
GetWorkflowTemplate(context.Context, *GetWorkflowTemplateRequest) (*WorkflowTemplate, error) GetWorkflowTemplate(context.Context, *GetWorkflowTemplateRequest) (*WorkflowTemplate, error)
ListWorkflowTemplateVersions(context.Context, *ListWorkflowTemplateVersionsRequest) (*ListWorkflowTemplateVersionsResponse, error) ListWorkflowTemplateVersions(context.Context, *ListWorkflowTemplateVersionsRequest) (*ListWorkflowTemplateVersionsResponse, error)
ListWorkflowTemplates(context.Context, *ListWorkflowTemplatesRequest) (*ListWorkflowTemplatesResponse, error) ListWorkflowTemplates(context.Context, *ListWorkflowTemplatesRequest) (*ListWorkflowTemplatesResponse, error)
ArchiveWorkflowTemplate(context.Context, *ArchiveWorkflowTemplateRequest) (*ArchiveWorkflowTemplateResponse, error)
} }
// UnimplementedWorkflowServiceServer can be embedded to have forward compatible implementations. // UnimplementedWorkflowServiceServer can be embedded to have forward compatible implementations.
@@ -799,6 +812,9 @@ func (*UnimplementedWorkflowServiceServer) ListWorkflowTemplateVersions(ctx cont
func (*UnimplementedWorkflowServiceServer) ListWorkflowTemplates(ctx context.Context, req *ListWorkflowTemplatesRequest) (*ListWorkflowTemplatesResponse, error) { func (*UnimplementedWorkflowServiceServer) ListWorkflowTemplates(ctx context.Context, req *ListWorkflowTemplatesRequest) (*ListWorkflowTemplatesResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListWorkflowTemplates not implemented") return nil, status.Errorf(codes.Unimplemented, "method ListWorkflowTemplates not implemented")
} }
func (*UnimplementedWorkflowServiceServer) ArchiveWorkflowTemplate(ctx context.Context, req *ArchiveWorkflowTemplateRequest) (*ArchiveWorkflowTemplateResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ArchiveWorkflowTemplate not implemented")
}
func RegisterWorkflowServiceServer(s *grpc.Server, srv WorkflowServiceServer) { func RegisterWorkflowServiceServer(s *grpc.Server, srv WorkflowServiceServer) {
s.RegisterService(&_WorkflowService_serviceDesc, srv) s.RegisterService(&_WorkflowService_serviceDesc, srv)
@@ -1008,6 +1024,24 @@ func _WorkflowService_ListWorkflowTemplates_Handler(srv interface{}, ctx context
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }
func _WorkflowService_ArchiveWorkflowTemplate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ArchiveWorkflowTemplateRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(WorkflowServiceServer).ArchiveWorkflowTemplate(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/api.WorkflowService/ArchiveWorkflowTemplate",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(WorkflowServiceServer).ArchiveWorkflowTemplate(ctx, req.(*ArchiveWorkflowTemplateRequest))
}
return interceptor(ctx, in, info, handler)
}
var _WorkflowService_serviceDesc = grpc.ServiceDesc{ var _WorkflowService_serviceDesc = grpc.ServiceDesc{
ServiceName: "api.WorkflowService", ServiceName: "api.WorkflowService",
HandlerType: (*WorkflowServiceServer)(nil), HandlerType: (*WorkflowServiceServer)(nil),
@@ -1048,6 +1082,10 @@ var _WorkflowService_serviceDesc = grpc.ServiceDesc{
MethodName: "ListWorkflowTemplates", MethodName: "ListWorkflowTemplates",
Handler: _WorkflowService_ListWorkflowTemplates_Handler, Handler: _WorkflowService_ListWorkflowTemplates_Handler,
}, },
{
MethodName: "ArchiveWorkflowTemplate",
Handler: _WorkflowService_ArchiveWorkflowTemplate_Handler,
},
}, },
Streams: []grpc.StreamDesc{ Streams: []grpc.StreamDesc{
{ {

View File

@@ -955,6 +955,82 @@ func local_request_WorkflowService_ListWorkflowTemplates_0(ctx context.Context,
} }
func request_WorkflowService_ArchiveWorkflowTemplate_0(ctx context.Context, marshaler runtime.Marshaler, client WorkflowServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq ArchiveWorkflowTemplateRequest
var metadata runtime.ServerMetadata
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["uid"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "uid")
}
protoReq.Uid, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "uid", err)
}
msg, err := client.ArchiveWorkflowTemplate(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_WorkflowService_ArchiveWorkflowTemplate_0(ctx context.Context, marshaler runtime.Marshaler, server WorkflowServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq ArchiveWorkflowTemplateRequest
var metadata runtime.ServerMetadata
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["uid"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "uid")
}
protoReq.Uid, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "uid", err)
}
msg, err := server.ArchiveWorkflowTemplate(ctx, &protoReq)
return msg, metadata, err
}
// RegisterWorkflowServiceHandlerServer registers the http handlers for service WorkflowService to "mux". // RegisterWorkflowServiceHandlerServer registers the http handlers for service WorkflowService to "mux".
// UnaryRPC :call WorkflowServiceServer directly. // UnaryRPC :call WorkflowServiceServer directly.
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
@@ -1174,6 +1250,26 @@ func RegisterWorkflowServiceHandlerServer(ctx context.Context, mux *runtime.Serv
}) })
mux.Handle("DELETE", pattern_WorkflowService_ArchiveWorkflowTemplate_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_ArchiveWorkflowTemplate_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_ArchiveWorkflowTemplate_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil return nil
} }
@@ -1455,6 +1551,26 @@ func RegisterWorkflowServiceHandlerClient(ctx context.Context, mux *runtime.Serv
}) })
mux.Handle("DELETE", pattern_WorkflowService_ArchiveWorkflowTemplate_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_ArchiveWorkflowTemplate_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_ArchiveWorkflowTemplate_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil return nil
} }
@@ -1482,6 +1598,8 @@ var (
pattern_WorkflowService_ListWorkflowTemplateVersions_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", "uid", "versions"}, "", runtime.AssumeColonVerbOpt(true))) pattern_WorkflowService_ListWorkflowTemplateVersions_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", "uid", "versions"}, "", runtime.AssumeColonVerbOpt(true)))
pattern_WorkflowService_ListWorkflowTemplates_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_ListWorkflowTemplates_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_ArchiveWorkflowTemplate_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)))
) )
var ( var (
@@ -1508,4 +1626,6 @@ var (
forward_WorkflowService_ListWorkflowTemplateVersions_0 = runtime.ForwardResponseMessage forward_WorkflowService_ListWorkflowTemplateVersions_0 = runtime.ForwardResponseMessage
forward_WorkflowService_ListWorkflowTemplates_0 = runtime.ForwardResponseMessage forward_WorkflowService_ListWorkflowTemplates_0 = runtime.ForwardResponseMessage
forward_WorkflowService_ArchiveWorkflowTemplate_0 = runtime.ForwardResponseMessage
) )

View File

@@ -79,6 +79,12 @@ service WorkflowService {
get: "/apis/v1beta1/{namespace}/workflow_templates" get: "/apis/v1beta1/{namespace}/workflow_templates"
}; };
} }
rpc ArchiveWorkflowTemplate (ArchiveWorkflowTemplateRequest) returns (ArchiveWorkflowTemplateResponse) {
option (google.api.http) = {
delete: "/apis/v1beta1/{namespace}/workflow_templates/{uid}"
};
}
} }
message CreateWorkflowRequest { message CreateWorkflowRequest {

View File

@@ -100,6 +100,34 @@
"tags": [ "tags": [
"WorkflowService" "WorkflowService"
] ]
},
"delete": {
"operationId": "ArchiveWorkflowTemplate",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/apiArchiveWorkflowTemplateResponse"
}
}
},
"parameters": [
{
"name": "namespace",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "uid",
"in": "path",
"required": true,
"type": "string"
}
],
"tags": [
"WorkflowService"
]
} }
}, },
"/apis/v1beta1/{namespace}/workflow_templates/{uid}/versions": { "/apis/v1beta1/{namespace}/workflow_templates/{uid}/versions": {
@@ -423,6 +451,14 @@
} }
}, },
"definitions": { "definitions": {
"apiArchiveWorkflowTemplateResponse": {
"type": "object",
"properties": {
"workflowTemplate": {
"$ref": "#/definitions/apiWorkflowTemplate"
}
}
},
"apiListWorkflowTemplateVersionsResponse": { "apiListWorkflowTemplateVersionsResponse": {
"type": "object", "type": "object",
"properties": { "properties": {
@@ -535,6 +571,10 @@
"isLatest": { "isLatest": {
"type": "boolean", "type": "boolean",
"format": "boolean" "format": "boolean"
},
"isArchived": {
"type": "boolean",
"format": "boolean"
} }
} }
}, },

View File

@@ -349,6 +349,92 @@ func (m *ListWorkflowTemplatesResponse) GetWorkflowTemplates() []*WorkflowTempla
return nil return nil
} }
type ArchiveWorkflowTemplateRequest 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"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ArchiveWorkflowTemplateRequest) Reset() { *m = ArchiveWorkflowTemplateRequest{} }
func (m *ArchiveWorkflowTemplateRequest) String() string { return proto.CompactTextString(m) }
func (*ArchiveWorkflowTemplateRequest) ProtoMessage() {}
func (*ArchiveWorkflowTemplateRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_b9a07547748a96e8, []int{7}
}
func (m *ArchiveWorkflowTemplateRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ArchiveWorkflowTemplateRequest.Unmarshal(m, b)
}
func (m *ArchiveWorkflowTemplateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ArchiveWorkflowTemplateRequest.Marshal(b, m, deterministic)
}
func (m *ArchiveWorkflowTemplateRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_ArchiveWorkflowTemplateRequest.Merge(m, src)
}
func (m *ArchiveWorkflowTemplateRequest) XXX_Size() int {
return xxx_messageInfo_ArchiveWorkflowTemplateRequest.Size(m)
}
func (m *ArchiveWorkflowTemplateRequest) XXX_DiscardUnknown() {
xxx_messageInfo_ArchiveWorkflowTemplateRequest.DiscardUnknown(m)
}
var xxx_messageInfo_ArchiveWorkflowTemplateRequest proto.InternalMessageInfo
func (m *ArchiveWorkflowTemplateRequest) GetNamespace() string {
if m != nil {
return m.Namespace
}
return ""
}
func (m *ArchiveWorkflowTemplateRequest) GetUid() string {
if m != nil {
return m.Uid
}
return ""
}
type ArchiveWorkflowTemplateResponse struct {
WorkflowTemplate *WorkflowTemplate `protobuf:"bytes,1,opt,name=workflowTemplate,proto3" json:"workflowTemplate,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ArchiveWorkflowTemplateResponse) Reset() { *m = ArchiveWorkflowTemplateResponse{} }
func (m *ArchiveWorkflowTemplateResponse) String() string { return proto.CompactTextString(m) }
func (*ArchiveWorkflowTemplateResponse) ProtoMessage() {}
func (*ArchiveWorkflowTemplateResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_b9a07547748a96e8, []int{8}
}
func (m *ArchiveWorkflowTemplateResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ArchiveWorkflowTemplateResponse.Unmarshal(m, b)
}
func (m *ArchiveWorkflowTemplateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ArchiveWorkflowTemplateResponse.Marshal(b, m, deterministic)
}
func (m *ArchiveWorkflowTemplateResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_ArchiveWorkflowTemplateResponse.Merge(m, src)
}
func (m *ArchiveWorkflowTemplateResponse) XXX_Size() int {
return xxx_messageInfo_ArchiveWorkflowTemplateResponse.Size(m)
}
func (m *ArchiveWorkflowTemplateResponse) XXX_DiscardUnknown() {
xxx_messageInfo_ArchiveWorkflowTemplateResponse.DiscardUnknown(m)
}
var xxx_messageInfo_ArchiveWorkflowTemplateResponse proto.InternalMessageInfo
func (m *ArchiveWorkflowTemplateResponse) GetWorkflowTemplate() *WorkflowTemplate {
if m != nil {
return m.WorkflowTemplate
}
return nil
}
type WorkflowTemplate struct { type WorkflowTemplate struct {
CreatedAt string `protobuf:"bytes,1,opt,name=createdAt,proto3" json:"createdAt,omitempty"` CreatedAt string `protobuf:"bytes,1,opt,name=createdAt,proto3" json:"createdAt,omitempty"`
Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid,omitempty"` Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid,omitempty"`
@@ -356,6 +442,7 @@ type WorkflowTemplate struct {
Version int32 `protobuf:"varint,4,opt,name=version,proto3" json:"version,omitempty"` Version int32 `protobuf:"varint,4,opt,name=version,proto3" json:"version,omitempty"`
Manifest string `protobuf:"bytes,5,opt,name=manifest,proto3" json:"manifest,omitempty"` Manifest string `protobuf:"bytes,5,opt,name=manifest,proto3" json:"manifest,omitempty"`
IsLatest bool `protobuf:"varint,6,opt,name=isLatest,proto3" json:"isLatest,omitempty"` IsLatest bool `protobuf:"varint,6,opt,name=isLatest,proto3" json:"isLatest,omitempty"`
IsArchived bool `protobuf:"varint,7,opt,name=isArchived,proto3" json:"isArchived,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"` XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"` XXX_sizecache int32 `json:"-"`
@@ -365,7 +452,7 @@ func (m *WorkflowTemplate) Reset() { *m = WorkflowTemplate{} }
func (m *WorkflowTemplate) String() string { return proto.CompactTextString(m) } func (m *WorkflowTemplate) String() string { return proto.CompactTextString(m) }
func (*WorkflowTemplate) ProtoMessage() {} func (*WorkflowTemplate) ProtoMessage() {}
func (*WorkflowTemplate) Descriptor() ([]byte, []int) { func (*WorkflowTemplate) Descriptor() ([]byte, []int) {
return fileDescriptor_b9a07547748a96e8, []int{7} return fileDescriptor_b9a07547748a96e8, []int{9}
} }
func (m *WorkflowTemplate) XXX_Unmarshal(b []byte) error { func (m *WorkflowTemplate) XXX_Unmarshal(b []byte) error {
@@ -428,6 +515,13 @@ func (m *WorkflowTemplate) GetIsLatest() bool {
return false return false
} }
func (m *WorkflowTemplate) GetIsArchived() bool {
if m != nil {
return m.IsArchived
}
return false
}
func init() { func init() {
proto.RegisterType((*CreateWorkflowTemplateRequest)(nil), "api.CreateWorkflowTemplateRequest") proto.RegisterType((*CreateWorkflowTemplateRequest)(nil), "api.CreateWorkflowTemplateRequest")
proto.RegisterType((*UpdateWorkflowTemplateVersionRequest)(nil), "api.UpdateWorkflowTemplateVersionRequest") proto.RegisterType((*UpdateWorkflowTemplateVersionRequest)(nil), "api.UpdateWorkflowTemplateVersionRequest")
@@ -436,32 +530,36 @@ func init() {
proto.RegisterType((*ListWorkflowTemplateVersionsResponse)(nil), "api.ListWorkflowTemplateVersionsResponse") proto.RegisterType((*ListWorkflowTemplateVersionsResponse)(nil), "api.ListWorkflowTemplateVersionsResponse")
proto.RegisterType((*ListWorkflowTemplatesRequest)(nil), "api.ListWorkflowTemplatesRequest") proto.RegisterType((*ListWorkflowTemplatesRequest)(nil), "api.ListWorkflowTemplatesRequest")
proto.RegisterType((*ListWorkflowTemplatesResponse)(nil), "api.ListWorkflowTemplatesResponse") proto.RegisterType((*ListWorkflowTemplatesResponse)(nil), "api.ListWorkflowTemplatesResponse")
proto.RegisterType((*ArchiveWorkflowTemplateRequest)(nil), "api.ArchiveWorkflowTemplateRequest")
proto.RegisterType((*ArchiveWorkflowTemplateResponse)(nil), "api.ArchiveWorkflowTemplateResponse")
proto.RegisterType((*WorkflowTemplate)(nil), "api.WorkflowTemplate") proto.RegisterType((*WorkflowTemplate)(nil), "api.WorkflowTemplate")
} }
func init() { proto.RegisterFile("workflow_template.proto", fileDescriptor_b9a07547748a96e8) } func init() { proto.RegisterFile("workflow_template.proto", fileDescriptor_b9a07547748a96e8) }
var fileDescriptor_b9a07547748a96e8 = []byte{ var fileDescriptor_b9a07547748a96e8 = []byte{
// 330 bytes of a gzipped FileDescriptorProto // 368 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x53, 0xbf, 0x4f, 0x02, 0x31, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x54, 0x41, 0x4f, 0xc2, 0x30,
0x14, 0x4e, 0x39, 0x0e, 0xb9, 0xe7, 0x82, 0x8d, 0xc6, 0x86, 0x40, 0x72, 0xa9, 0x0c, 0x37, 0x31, 0x14, 0x4e, 0x19, 0x03, 0xf6, 0xbc, 0x60, 0xa3, 0xb1, 0x21, 0x80, 0xcb, 0xe4, 0xb0, 0x13, 0x07,
0xe8, 0xea, 0x42, 0x18, 0x5c, 0x98, 0x1a, 0xd1, 0xd1, 0x54, 0x78, 0x24, 0x8d, 0x70, 0xad, 0xd7, 0xbd, 0x7a, 0x21, 0x1c, 0xbc, 0x70, 0x30, 0x8b, 0xe8, 0xd1, 0xd4, 0xad, 0xc4, 0x46, 0x58, 0xeb,
0x22, 0x89, 0x93, 0x4e, 0xfe, 0x2b, 0xfe, 0x99, 0xe6, 0xca, 0x0f, 0x15, 0xee, 0x8c, 0x21, 0xd1, 0x5a, 0x20, 0xf1, 0xa4, 0x27, 0xff, 0x9a, 0x3f, 0xcb, 0xac, 0x0c, 0x44, 0xd8, 0x8c, 0x12, 0xf5,
0xad, 0x5f, 0xfb, 0xbd, 0xd7, 0xef, 0x7b, 0x3f, 0xe0, 0x74, 0xa1, 0xb3, 0x87, 0xc9, 0x54, 0x2f, 0xd6, 0xf7, 0xfa, 0xbd, 0xd7, 0xef, 0xfb, 0xf2, 0x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 0xa2, 0xa0, 0xe7, 0x14, 0xaa, 0xee, 0x25, 0xe1, 0x3d, 0x9f, 0xb1, 0x5f, 0x0a, 0x80, 0x17, 0xc1, 0x71, 0xe1, 0xc6, 0x4c, 0x4f,
0xb9, 0x1b, 0xdf, 0xf0, 0x48, 0xf8, 0xf3, 0xd7, 0x39, 0xa8, 0x7e, 0x9b, 0x03, 0xda, 0x84, 0xfa, 0x5e, 0x68, 0xd1, 0xcf, 0x42, 0xfb, 0x86, 0xa0, 0xbe, 0x09, 0x4b, 0xa9, 0x86, 0xe6, 0xab, 0x8e,
0x4c, 0xa6, 0x6a, 0x82, 0xd6, 0xb1, 0xd0, 0x47, 0x6c, 0x70, 0xfe, 0xa6, 0xec, 0x20, 0x57, 0xe6, 0x7a, 0x7a, 0x49, 0x75, 0xd5, 0xc8, 0xc9, 0x2a, 0x86, 0x72, 0xaa, 0xc4, 0x04, 0xd5, 0x09, 0xcc,
0x58, 0x2d, 0x26, 0x49, 0x5d, 0x6c, 0xf0, 0x7d, 0xcd, 0x2f, 0xf0, 0xc5, 0x47, 0x00, 0x00, 0x00, 0x79, 0x3d, 0xbf, 0xe5, 0x4f, 0xf9, 0xc5, 0x0d, 0xa8, 0x4d, 0x68, 0xcc, 0x47, 0x4c, 0x69, 0x62,
0xff, 0xff, 0xa0, 0x4d, 0xfe, 0x9d, 0xdb, 0x03, 0x00, 0x00, 0x9b, 0x89, 0x55, 0x9d, 0xde, 0x71, 0x35, 0x48, 0x1d, 0xd5, 0xa4, 0xe2, 0x22, 0xbf, 0x16, 0xac,
0x6a, 0xdc, 0x06, 0xe0, 0x2a, 0xb3, 0x24, 0x22, 0x55, 0x73, 0xbb, 0xd6, 0xb9, 0xab, 0x98, 0x1f,
0xd3, 0xd9, 0x7b, 0x00, 0x00, 0x00, 0xff, 0xff, 0x0e, 0xb1, 0x9a, 0x5e, 0xb3, 0x04, 0x00, 0x00,
} }

View File

@@ -37,6 +37,15 @@ message ListWorkflowTemplatesResponse {
repeated WorkflowTemplate workflowTemplates = 2; repeated WorkflowTemplate workflowTemplates = 2;
} }
message ArchiveWorkflowTemplateRequest {
string namespace = 1;
string uid = 2;
}
message ArchiveWorkflowTemplateResponse {
WorkflowTemplate workflowTemplate = 1;
}
message WorkflowTemplate { message WorkflowTemplate {
string createdAt = 1; string createdAt = 1;
string uid = 2; string uid = 2;
@@ -44,4 +53,5 @@ message WorkflowTemplate {
int32 version = 4; int32 version = 4;
string manifest = 5; string manifest = 5;
bool isLatest = 6; bool isLatest = 6;
bool isArchived = 7;
} }

View File

@@ -0,0 +1,5 @@
-- +goose Up
ALTER TABLE workflow_templates ADD COLUMN is_archived boolean DEFAULT false;
-- +goose Down
ALTER TABLE workflow_templates DROP COLUMN is_archived;

View File

@@ -346,3 +346,28 @@ func (r *ResourceManager) ListWorkflowTemplates(namespace string) (workflowTempl
return return
} }
func (r *ResourceManager) ArchiveWorkflowTemplate(namespace, uid string) (archived bool, err error) {
allowed, err := r.kubeClient.IsAuthorized(namespace, "delete", "argoproj.io", "workflow", "")
if err != nil {
return false, util.NewUserError(codes.Unknown, "Unknown error.")
}
if !allowed {
return false, util.NewUserError(codes.PermissionDenied, "Permission denied.")
}
workflowTemplate, err := r.workflowRepository.GetWorkflowTemplate(namespace, uid, 0)
if err != nil {
return false, util.NewUserError(codes.Unknown, "Unknown error.")
}
if err == nil && workflowTemplate == nil {
return false, util.NewUserError(codes.NotFound, "Workflow template not found.")
}
archived, err = r.workflowRepository.ArchiveWorkflowTemplate(namespace, uid)
if !archived || err != nil {
return false, util.NewUserError(codes.Unknown, "Unknown error.")
}
return
}

View File

@@ -6,13 +6,14 @@ import (
) )
type WorkflowTemplate struct { type WorkflowTemplate struct {
ID uint64 ID uint64
CreatedAt time.Time `db:"created_at"` CreatedAt time.Time `db:"created_at"`
UID string UID string
Name string Name string
Manifest string Manifest string
Version int32 Version int32
IsLatest bool `db:"is_latest"` IsLatest bool `db:"is_latest"`
IsArchived bool `db:"is_archived"`
} }
func (wt *WorkflowTemplate) GetManifestBytes() []byte { func (wt *WorkflowTemplate) GetManifestBytes() []byte {

View File

@@ -131,7 +131,7 @@ func (r *WorkflowRepository) UpdateWorkflowTemplateVersion(workflowTemplate *mod
} }
func (r *WorkflowRepository) workflowTemplatesSelectBuilder(namespace string) sq.SelectBuilder { func (r *WorkflowRepository) workflowTemplatesSelectBuilder(namespace string) sq.SelectBuilder {
sb := r.sb.Select("wt.id", "wt.created_at", "wt.uid", "wt.name", "wtv.version", "wtv.is_latest"). sb := r.sb.Select("wt.id", "wt.created_at", "wt.uid", "wt.name", "wt.is_archived", "wtv.version", "wtv.is_latest").
From("workflow_template_versions wtv"). From("workflow_template_versions wtv").
Join("workflow_templates wt ON wt.id = wtv.workflow_template_id"). Join("workflow_templates wt ON wt.id = wtv.workflow_template_id").
Where(sq.Eq{ Where(sq.Eq{
@@ -184,6 +184,9 @@ func (r *WorkflowRepository) ListWorkflowTemplates(namespace string) (workflowTe
query, args, err := r.workflowTemplatesSelectBuilder(namespace). query, args, err := r.workflowTemplatesSelectBuilder(namespace).
Options("DISTINCT ON (wt.id) wt.id,"). Options("DISTINCT ON (wt.id) wt.id,").
Where(sq.Eq{
"wt.is_archived": false,
}).
OrderBy("wt.id desc").ToSql() OrderBy("wt.id desc").ToSql()
if err != nil { if err != nil {
return return
@@ -193,3 +196,23 @@ func (r *WorkflowRepository) ListWorkflowTemplates(namespace string) (workflowTe
return return
} }
func (r *WorkflowRepository) ArchiveWorkflowTemplate(namespace, uid string) (bool, error) {
query, args, err := r.sb.Update("workflow_templates").
Set("is_archived", true).
Where(sq.Eq{
"uid": uid,
"namespace": namespace,
}).
ToSql()
if err != nil {
return false, err
}
if _, err := r.db.Exec(query, args...); err != nil {
return false, err
}
return true, nil
}

View File

@@ -29,12 +29,13 @@ func apiWorkflow(wf *model.Workflow) (workflow *api.Workflow) {
if wf.WorkflowTemplate != nil { if wf.WorkflowTemplate != nil {
workflow.WorkflowTemplate = &api.WorkflowTemplate{ workflow.WorkflowTemplate = &api.WorkflowTemplate{
Uid: wf.WorkflowTemplate.UID, Uid: wf.WorkflowTemplate.UID,
CreatedAt: wf.WorkflowTemplate.CreatedAt.UTC().Format(time.RFC3339), CreatedAt: wf.WorkflowTemplate.CreatedAt.UTC().Format(time.RFC3339),
Name: wf.WorkflowTemplate.Name, Name: wf.WorkflowTemplate.Name,
Version: wf.WorkflowTemplate.Version, Version: wf.WorkflowTemplate.Version,
Manifest: wf.WorkflowTemplate.Manifest, Manifest: wf.WorkflowTemplate.Manifest,
IsLatest: wf.WorkflowTemplate.IsLatest, IsLatest: wf.WorkflowTemplate.IsLatest,
IsArchived: wf.WorkflowTemplate.IsArchived,
} }
} }
@@ -43,12 +44,13 @@ func apiWorkflow(wf *model.Workflow) (workflow *api.Workflow) {
func apiWorkflowTemplate(wft *model.WorkflowTemplate) *api.WorkflowTemplate { func apiWorkflowTemplate(wft *model.WorkflowTemplate) *api.WorkflowTemplate {
return &api.WorkflowTemplate{ return &api.WorkflowTemplate{
Uid: wft.UID, Uid: wft.UID,
CreatedAt: wft.CreatedAt.UTC().Format(time.RFC3339), CreatedAt: wft.CreatedAt.UTC().Format(time.RFC3339),
Name: wft.Name, Name: wft.Name,
Version: wft.Version, Version: wft.Version,
Manifest: wft.Manifest, Manifest: wft.Manifest,
IsLatest: wft.IsLatest, IsLatest: wft.IsLatest,
IsArchived: wft.IsArchived,
} }
} }
@@ -243,3 +245,16 @@ func (s *WorkflowServer) ListWorkflowTemplates(ctx context.Context, req *api.Lis
WorkflowTemplates: apiWorkflowTemplates, WorkflowTemplates: apiWorkflowTemplates,
}, nil }, nil
} }
func (s *WorkflowServer) ArchiveWorkflowTemplate(ctx context.Context, req *api.ArchiveWorkflowTemplateRequest) (*api.ArchiveWorkflowTemplateResponse, error) {
archived, err := s.resourceManager.ArchiveWorkflowTemplate(req.Namespace, req.Uid)
if errors.As(err, &userError) {
return nil, userError.GRPCError()
}
return &api.ArchiveWorkflowTemplateResponse{
WorkflowTemplate: &api.WorkflowTemplate{
IsArchived: archived,
},
}, nil
}