-
Notifications
You must be signed in to change notification settings - Fork 3.1k
/
null_workflow_archive.go
49 lines (36 loc) · 1.26 KB
/
null_workflow_archive.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package sqldb
import (
"fmt"
"time"
wfv1 "github.com/argoproj/argo-workflows/v3/pkg/apis/workflow/v1alpha1"
sutils "github.com/argoproj/argo-workflows/v3/server/utils"
)
var NullWorkflowArchive WorkflowArchive = &nullWorkflowArchive{}
type nullWorkflowArchive struct{}
func (r *nullWorkflowArchive) IsEnabled() bool {
return false
}
func (r *nullWorkflowArchive) ArchiveWorkflow(*wfv1.Workflow) error {
return nil
}
func (r *nullWorkflowArchive) ListWorkflows(options sutils.ListOptions) (wfv1.Workflows, error) {
return wfv1.Workflows{}, nil
}
func (r *nullWorkflowArchive) CountWorkflows(options sutils.ListOptions) (int64, error) {
return 0, nil
}
func (r *nullWorkflowArchive) GetWorkflow(string, string, string) (*wfv1.Workflow, error) {
return nil, fmt.Errorf("getting archived workflows not supported")
}
func (r *nullWorkflowArchive) DeleteWorkflow(string) error {
return fmt.Errorf("deleting archived workflows not supported")
}
func (r *nullWorkflowArchive) DeleteExpiredWorkflows(time.Duration) error {
return nil
}
func (r *nullWorkflowArchive) ListWorkflowsLabelKeys() (*wfv1.LabelKeys, error) {
return &wfv1.LabelKeys{}, nil
}
func (r *nullWorkflowArchive) ListWorkflowsLabelValues(string) (*wfv1.LabelValues, error) {
return &wfv1.LabelValues{}, nil
}