From 75a090759dcf53d1812073de7caec7c1e347eab3 Mon Sep 17 00:00:00 2001 From: Alex Collins Date: Wed, 22 Apr 2020 09:49:01 -0700 Subject: [PATCH 01/15] fix: Implement missing instanceID code. Fixes #2780 --- api/openapi-spec/swagger.json | 5 +- cmd/argo/commands/client/conn.go | 16 +- cmd/argo/commands/cron/create.go | 22 +- cmd/argo/commands/root.go | 2 +- cmd/argo/commands/submit.go | 2 - pkg/apiclient/apiclient.go | 26 +- pkg/apiclient/argo-kube-client.go | 14 +- pkg/apiclient/workflow/workflow.pb.go | 180 ++-- pkg/apiclient/workflow/workflow.proto | 3 +- pkg/apiclient/workflow/workflow.swagger.json | 7 +- pkg/apis/workflow/v1alpha1/common.go | 2 - pkg/apis/workflow/v1alpha1/generated.pb.go | 825 +++++++++--------- pkg/apis/workflow/v1alpha1/generated.proto | 3 - server/apiserver/argoserver.go | 4 +- .../cluster_workflow_template_server.go | 8 +- .../cluster_workflow_template_server_test.go | 2 +- server/cronworkflow/cron_workflow_server.go | 10 +- server/workflow/workflow_server.go | 18 +- .../workflow_template_server.go | 7 +- .../workflow_template_server_test.go | 2 +- util/labels/labeler.go | 27 + util/labels/labeler_test.go | 29 + workflow/util/util.go | 3 - 23 files changed, 609 insertions(+), 608 deletions(-) create mode 100644 util/labels/labeler.go create mode 100644 util/labels/labeler_test.go diff --git a/api/openapi-spec/swagger.json b/api/openapi-spec/swagger.json index d986afbe88a1..19bbfca33c06 100644 --- a/api/openapi-spec/swagger.json +++ b/api/openapi-spec/swagger.json @@ -2875,10 +2875,6 @@ "type": "string", "title": "GenerateName overrides metadata.generateName" }, - "instanceID": { - "type": "string", - "title": "InstanceID binds the Resource to the specified instance ID" - }, "labels": { "type": "string", "title": "Labels adds to metadata.labels" @@ -6180,6 +6176,7 @@ "$ref": "#/definitions/io.k8s.api.core.v1.CreateOptions" }, "instanceID": { + "description": "This field is no longer used.", "type": "string" }, "namespace": { diff --git a/cmd/argo/commands/client/conn.go b/cmd/argo/commands/client/conn.go index e72163967918..530293697da0 100644 --- a/cmd/argo/commands/client/conn.go +++ b/cmd/argo/commands/client/conn.go @@ -13,6 +13,7 @@ import ( ) var argoServer string +var instanceId string var overrides = clientcmd.ConfigOverrides{} @@ -31,14 +32,21 @@ func GetConfig() clientcmd.ClientConfig { return clientcmd.NewInteractiveDeferredLoadingClientConfig(loadingRules, &overrides, os.Stdin) } -func AddArgoServerFlagsToCmd(cmd *cobra.Command) { +func AddAPIClientFlagsToCmd(cmd *cobra.Command) { + cmd.PersistentFlags().StringVar(&instanceId, "instanceid", "", "submit with a specific controller's instance id label") cmd.PersistentFlags().StringVar(&argoServer, "argo-server", os.Getenv("ARGO_SERVER"), "API server `host:port`. e.g. localhost:2746. Defaults to the ARGO_SERVER environment variable.") } func NewAPIClient() (context.Context, apiclient.Client) { - ctx, client, err := apiclient.NewClient(argoServer, func() string { - return GetAuthString() - }, GetConfig()) + ctx, client, err := apiclient.NewClientFromOpts( + apiclient.Opts{ + ArgoServer: argoServer, + InstanceID: instanceId, + AuthSupplier: func() string { + return GetAuthString() + }, + ClientConfig: GetConfig(), + }) if err != nil { log.Fatal(err) } diff --git a/cmd/argo/commands/cron/create.go b/cmd/argo/commands/cron/create.go index 68e654d81fa8..3afc554bc720 100644 --- a/cmd/argo/commands/cron/create.go +++ b/cmd/argo/commands/cron/create.go @@ -20,14 +20,9 @@ type cliCreateOpts struct { strict bool // --strict } -type cronWorkflowSubmitOpts struct { - instanceId string -} - func NewCreateCommand() *cobra.Command { var ( cliCreateOpts cliCreateOpts - submitOpts cronWorkflowSubmitOpts ) var command = &cobra.Command{ Use: "create FILE1 FILE2...", @@ -38,16 +33,15 @@ func NewCreateCommand() *cobra.Command { os.Exit(1) } - CreateCronWorkflows(args, &cliCreateOpts, &submitOpts) + CreateCronWorkflows(args, &cliCreateOpts) }, } command.Flags().StringVarP(&cliCreateOpts.output, "output", "o", "", "Output format. One of: name|json|yaml|wide") - command.Flags().StringVar(&submitOpts.instanceId, "instanceid", "", "submit with a specific controller's instance id label") command.Flags().BoolVar(&cliCreateOpts.strict, "strict", true, "perform strict workflow validation") return command } -func CreateCronWorkflows(filePaths []string, cliOpts *cliCreateOpts, submitOpts *cronWorkflowSubmitOpts) { +func CreateCronWorkflows(filePaths []string, cliOpts *cliCreateOpts) { ctx, apiClient := client.NewAPIClient() serviceClient := apiClient.NewCronWorkflowServiceClient() @@ -70,7 +64,6 @@ func CreateCronWorkflows(filePaths []string, cliOpts *cliCreateOpts, submitOpts } for _, cronWf := range cronWorkflows { - applySubmitOpts(&cronWf, submitOpts) created, err := serviceClient.CreateCronWorkflow(ctx, &cronworkflowpkg.CreateCronWorkflowRequest{ Namespace: namespace, CronWorkflow: &cronWf, @@ -100,14 +93,3 @@ func unmarshalCronWorkflows(wfBytes []byte, strict bool) []wfv1.CronWorkflow { log.Fatalf("Failed to parse workflow template: %v", err) return nil } - -func applySubmitOpts(cwf *wfv1.CronWorkflow, submitOpts *cronWorkflowSubmitOpts) { - labels := cwf.GetLabels() - if labels == nil { - labels = make(map[string]string) - } - if submitOpts.instanceId != "" { - labels[common.LabelKeyControllerInstanceID] = submitOpts.instanceId - } - cwf.SetLabels(labels) -} diff --git a/cmd/argo/commands/root.go b/cmd/argo/commands/root.go index 9a4ea879fd9c..9cc3cd9414a8 100644 --- a/cmd/argo/commands/root.go +++ b/cmd/argo/commands/root.go @@ -59,7 +59,7 @@ If you're using the Argo Server (e.g. because you need large workflow support or command.AddCommand(clustertemplate.NewClusterTemplateCommand()) client.AddKubectlFlagsToCmd(command) - client.AddArgoServerFlagsToCmd(command) + client.AddAPIClientFlagsToCmd(command) // global log level var logLevel string diff --git a/cmd/argo/commands/submit.go b/cmd/argo/commands/submit.go index 883ec672f2bc..e9997e770000 100644 --- a/cmd/argo/commands/submit.go +++ b/cmd/argo/commands/submit.go @@ -66,7 +66,6 @@ func NewSubmitCommand() *cobra.Command { command.Flags().StringVar(&submitOpts.Entrypoint, "entrypoint", "", "override entrypoint") command.Flags().StringArrayVarP(&submitOpts.Parameters, "parameter", "p", []string{}, "pass an input parameter") command.Flags().StringVar(&submitOpts.ServiceAccount, "serviceaccount", "", "run all pods in the workflow using specified serviceaccount") - command.Flags().StringVar(&submitOpts.InstanceID, "instanceid", "", "submit with a specific controller's instance id label") command.Flags().BoolVar(&submitOpts.DryRun, "dry-run", false, "modify the workflow on the client-side without creating it") command.Flags().BoolVar(&submitOpts.ServerDryRun, "server-dry-run", false, "send request to server with dry-run flag which will modify the workflow without creating it") command.Flags().StringVarP(&cliSubmitOpts.output, "output", "o", "", "Output format. One of: name|json|yaml|wide") @@ -198,7 +197,6 @@ func submitWorkflows(workflows []wfv1.Workflow, submitOpts *wfv1.SubmitOpts, cli created, err := serviceClient.CreateWorkflow(ctx, &workflowpkg.WorkflowCreateRequest{ Namespace: wf.Namespace, Workflow: &wf, - InstanceID: submitOpts.InstanceID, ServerDryRun: submitOpts.ServerDryRun, CreateOptions: options, }) diff --git a/pkg/apiclient/apiclient.go b/pkg/apiclient/apiclient.go index 36e4cbb266eb..84eeb13b8beb 100644 --- a/pkg/apiclient/apiclient.go +++ b/pkg/apiclient/apiclient.go @@ -2,6 +2,7 @@ package apiclient import ( "context" + "fmt" "k8s.io/client-go/tools/clientcmd" @@ -20,10 +21,29 @@ type Client interface { NewClusterWorkflowTemplateServiceClient() clusterworkflowtmplpkg.ClusterWorkflowTemplateServiceClient } +type Opts struct { + ArgoServer string + InstanceID string + AuthSupplier func() string + ClientConfig clientcmd.ClientConfig +} + +// DEPRECATED: use NewClientFromOpts func NewClient(argoServer string, authSupplier func() string, clientConfig clientcmd.ClientConfig) (context.Context, Client, error) { - if argoServer != "" { - return newArgoServerClient(argoServer, authSupplier()) + return NewClientFromOpts(Opts{ + ArgoServer: argoServer, + AuthSupplier: authSupplier, + ClientConfig: clientConfig, + }) +} + +func NewClientFromOpts(opts Opts) (context.Context, Client, error) { + if opts.ArgoServer != "" && opts.InstanceID != "" { + return nil, nil, fmt.Errorf("cannot use instance ID with Argo Server") + } + if opts.ArgoServer != "" { + return newArgoServerClient(opts.ArgoServer, opts.AuthSupplier()) } else { - return newArgoKubeClient(clientConfig) + return newArgoKubeClient(opts.ClientConfig, opts.InstanceID) } } diff --git a/pkg/apiclient/argo-kube-client.go b/pkg/apiclient/argo-kube-client.go index cb864236f81e..9a78dc69be23 100644 --- a/pkg/apiclient/argo-kube-client.go +++ b/pkg/apiclient/argo-kube-client.go @@ -25,9 +25,10 @@ import ( var argoKubeOffloadNodeStatusRepo = sqldb.ExplosiveOffloadNodeStatusRepo type argoKubeClient struct { + instanceID string } -func newArgoKubeClient(clientConfig clientcmd.ClientConfig) (context.Context, Client, error) { +func newArgoKubeClient(clientConfig clientcmd.ClientConfig, instanceID string) (context.Context, Client, error) { restConfig, err := clientConfig.ClientConfig() if err != nil { return nil, nil, err @@ -45,18 +46,19 @@ func newArgoKubeClient(clientConfig clientcmd.ClientConfig) (context.Context, Cl if err != nil { return nil, nil, err } - return ctx, &argoKubeClient{}, nil + return ctx, &argoKubeClient{instanceID}, nil } func (a *argoKubeClient) NewWorkflowServiceClient() workflowpkg.WorkflowServiceClient { - return &argoKubeWorkflowServiceClient{workflowserver.NewWorkflowServer("", argoKubeOffloadNodeStatusRepo)} + return &argoKubeWorkflowServiceClient{workflowserver.NewWorkflowServer(a.instanceID, argoKubeOffloadNodeStatusRepo)} } func (a *argoKubeClient) NewCronWorkflowServiceClient() cronworkflow.CronWorkflowServiceClient { - return &argoKubeCronWorkflowServiceClient{cronworkflowserver.NewCronWorkflowServer("")} + return &argoKubeCronWorkflowServiceClient{cronworkflowserver.NewCronWorkflowServer(a.instanceID)} } + func (a *argoKubeClient) NewWorkflowTemplateServiceClient() workflowtemplate.WorkflowTemplateServiceClient { - return &argoKubeWorkflowTemplateServiceClient{workflowtemplateserver.NewWorkflowTemplateServer()} + return &argoKubeWorkflowTemplateServiceClient{workflowtemplateserver.NewWorkflowTemplateServer(a.instanceID)} } func (a *argoKubeClient) NewArchivedWorkflowServiceClient() (workflowarchivepkg.ArchivedWorkflowServiceClient, error) { @@ -64,5 +66,5 @@ func (a *argoKubeClient) NewArchivedWorkflowServiceClient() (workflowarchivepkg. } func (a *argoKubeClient) NewClusterWorkflowTemplateServiceClient() clusterworkflowtemplate.ClusterWorkflowTemplateServiceClient { - return &argoKubeWorkflowClusterTemplateServiceClient{clusterworkflowtmplserver.NewClusterWorkflowTemplateServer()} + return &argoKubeWorkflowClusterTemplateServiceClient{clusterworkflowtmplserver.NewClusterWorkflowTemplateServer(a.instanceID)} } diff --git a/pkg/apiclient/workflow/workflow.pb.go b/pkg/apiclient/workflow/workflow.pb.go index a0e30b8d9428..d75a43217fad 100644 --- a/pkg/apiclient/workflow/workflow.pb.go +++ b/pkg/apiclient/workflow/workflow.pb.go @@ -36,14 +36,15 @@ var _ = math.Inf const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type WorkflowCreateRequest struct { - Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` - Workflow *v1alpha1.Workflow `protobuf:"bytes,2,opt,name=workflow,proto3" json:"workflow,omitempty"` - InstanceID string `protobuf:"bytes,3,opt,name=instanceID,proto3" json:"instanceID,omitempty"` - ServerDryRun bool `protobuf:"varint,4,opt,name=serverDryRun,proto3" json:"serverDryRun,omitempty"` - CreateOptions *v1.CreateOptions `protobuf:"bytes,5,opt,name=createOptions,proto3" json:"createOptions,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` + Workflow *v1alpha1.Workflow `protobuf:"bytes,2,opt,name=workflow,proto3" json:"workflow,omitempty"` + // This field is no longer used. + InstanceID string `protobuf:"bytes,3,opt,name=instanceID,proto3" json:"instanceID,omitempty"` // Deprecated: Do not use. + ServerDryRun bool `protobuf:"varint,4,opt,name=serverDryRun,proto3" json:"serverDryRun,omitempty"` + CreateOptions *v1.CreateOptions `protobuf:"bytes,5,opt,name=createOptions,proto3" json:"createOptions,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *WorkflowCreateRequest) Reset() { *m = WorkflowCreateRequest{} } @@ -93,6 +94,7 @@ func (m *WorkflowCreateRequest) GetWorkflow() *v1alpha1.Workflow { return nil } +// Deprecated: Do not use. func (m *WorkflowCreateRequest) GetInstanceID() string { if m != nil { return m.InstanceID @@ -1127,87 +1129,87 @@ func init() { } var fileDescriptor_1f6bb75f9e833cb6 = []byte{ - // 1267 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x98, 0x41, 0x6f, 0xdc, 0x44, - 0x1b, 0xc7, 0x35, 0x49, 0xdf, 0x36, 0x9d, 0x26, 0x69, 0x3b, 0x2f, 0x94, 0x95, 0xd5, 0xa6, 0xe9, - 0x40, 0x21, 0x4d, 0x1b, 0x3b, 0x9b, 0x16, 0x28, 0x95, 0x0a, 0x2a, 0x4d, 0x89, 0x80, 0x15, 0x54, - 0x5e, 0x10, 0x2a, 0x37, 0xc7, 0xfb, 0xc4, 0x71, 0xe3, 0xf5, 0x18, 0xcf, 0xec, 0x46, 0x4b, 0x15, - 0x10, 0x1c, 0x39, 0xc0, 0x81, 0x0b, 0x82, 0x0b, 0x14, 0x90, 0x90, 0x90, 0xa0, 0x7c, 0x02, 0xae, - 0x1c, 0x91, 0xf8, 0x02, 0x28, 0xe2, 0x83, 0xa0, 0x19, 0xdb, 0x63, 0x3b, 0xbb, 0xdd, 0x9a, 0xb8, - 0xd0, 0xdb, 0x8c, 0xc7, 0x33, 0xff, 0xdf, 0x3c, 0xcf, 0xcc, 0xe3, 0xff, 0x2e, 0x3e, 0x1b, 0x6d, - 0x79, 0x96, 0x13, 0xf9, 0x6e, 0xe0, 0x43, 0x28, 0xac, 0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 0x56, 0xb4, 0x2b, 0xc6, 0x52, 0x45, 0xda, 0x44, 0x5c, 0x02, 0xff, 0x80, 0xf0, - 0x6c, 0xe2, 0x34, 0xc7, 0x25, 0xb7, 0xe4, 0x45, 0xeb, 0xc2, 0x3e, 0xa7, 0x60, 0x97, 0x8d, 0xf3, - 0x95, 0x61, 0xbb, 0x20, 0x51, 0x7f, 0x44, 0xf8, 0x68, 0xea, 0xdd, 0x34, 0xeb, 0x88, 0x73, 0x56, - 0xb6, 0x77, 0x75, 0x61, 0x9f, 0x57, 0xb0, 0x4d, 0xe3, 0x42, 0x25, 0x58, 0x9e, 0x68, 0x4b, 0xda, - 0x5f, 0x10, 0x3e, 0xae, 0x9d, 0xb4, 0xe6, 0xa5, 0xc3, 0xbc, 0x7b, 0xed, 0x76, 0x5d, 0xe2, 0x17, - 0x14, 0xf1, 0x45, 0xc3, 0xac, 0x44, 0x2c, 0x32, 0x75, 0xc9, 0x7c, 0x17, 0xe1, 0x69, 0x69, 0xd7, - 0x35, 0xee, 0x88, 0x1a, 0x58, 0xb0, 0xf3, 0x75, 0x49, 0x2f, 0x29, 0x52, 0xd3, 0x38, 0x57, 0x2d, - 0xb6, 0x82, 0x45, 0x12, 0xf2, 0x2b, 0x84, 0xa7, 0xa5, 0x81, 0x19, 0x07, 0x59, 0x30, 0x38, 0x75, - 0x21, 0x97, 0x14, 0xe4, 0x33, 0x94, 0x8e, 0x87, 0x0c, 0xfc, 0x50, 0xdd, 0xa7, 0x01, 0x3e, 0x94, - 0x58, 0x72, 0x3e, 0xea, 0xeb, 0x96, 0xff, 0x5a, 0x30, 0x48, 0x3e, 0x9a, 0xf9, 0x3a, 0x7a, 0x45, - 0x69, 0x5d, 0x22, 0x2b, 0x95, 0x02, 0x72, 0x27, 0xb5, 0x76, 0x3b, 0x56, 0xc0, 0xbc, 0x65, 0x44, - 0xbe, 0x41, 0x78, 0xb6, 0x5d, 0xae, 0x3c, 0xa7, 0x47, 0x5d, 0x8f, 0x87, 0x58, 0x77, 0x2c, 0x05, - 0x7c, 0x8e, 0x3e, 0xa0, 0x88, 0xeb, 0x72, 0xf3, 0xf2, 0xd5, 0xdf, 0x76, 0xe7, 0xd0, 0xef, 0xbb, - 0x73, 0xe8, 0xcf, 0xdd, 0x39, 0xf4, 0xae, 0xf5, 0xa0, 0x3f, 0xbb, 0xf6, 0xfc, 0x73, 0xb7, 0x7e, - 0x50, 0xfd, 0x77, 0x75, 0xf1, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0x2f, 0x3f, 0x7b, 0xe3, 0xda, - 0x13, 0x00, 0x00, + // 1270 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x98, 0x4d, 0x6f, 0xdc, 0x44, + 0x18, 0xc7, 0x35, 0x9b, 0x90, 0x97, 0xc9, 0x4b, 0x9b, 0x01, 0xca, 0xca, 0x4a, 0x93, 0x74, 0x20, + 0x90, 0xa6, 0x89, 0x9d, 0x4d, 0x02, 0x94, 0x4a, 0x05, 0xb5, 0x49, 0x89, 0x80, 0x15, 0x54, 0x5e, + 0x10, 0x2a, 0x37, 0xc7, 0x3b, 0x71, 0xdc, 0x78, 0x3d, 0xc6, 0x33, 0xbb, 0xd1, 0x52, 0x05, 0x04, + 0x47, 0x0e, 0x70, 0xe0, 0x82, 0xe0, 0x02, 0x05, 0x24, 0x24, 0x24, 0x54, 0xc4, 0x07, 0xe0, 0xca, + 0x11, 0x89, 0x2f, 0x80, 0x22, 0x3e, 0x08, 0x9a, 0xb1, 0x3d, 0xb6, 0xb3, 0xdb, 0xad, 0x89, 0x0b, + 0xbd, 0xcd, 0x78, 0x3c, 0xf3, 0xff, 0xcd, 0xf3, 0xcc, 0x3c, 0xfe, 0xef, 0xc2, 0xc5, 0xe0, 0xc0, + 0x31, 0xac, 0xc0, 0xb5, 0x3d, 0x97, 0xf8, 0xdc, 0x38, 0xa4, 0xe1, 0xc1, 0x9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x68, 0x9b, 0x6a, 0x39, 0x84, 0x21, 0x74, 0x7d, 0xc6, 0x2d, 0xdf, 0x26, 0xaf, 0x6d, 0x57, + 0x87, 0x84, 0xf2, 0xf5, 0x4a, 0x15, 0x98, 0x99, 0xa7, 0x08, 0xc3, 0x49, 0x46, 0xc2, 0x0e, 0x09, + 0xb7, 0xc3, 0xae, 0xd9, 0xf6, 0xab, 0xc3, 0x0b, 0x60, 0x69, 0xcc, 0xcc, 0x3d, 0x43, 0xb7, 0xe0, + 0x94, 0x2d, 0x77, 0xf4, 0x56, 0x20, 0x13, 0x52, 0x7d, 0x4c, 0x72, 0x6e, 0xe8, 0x51, 0x58, 0xf4, + 0x6c, 0x46, 0x52, 0x44, 0x91, 0x11, 0xbd, 0x53, 0xd3, 0xb7, 0xb2, 0x53, 0xcd, 0xfc, 0x4a, 0xf8, + 0x1e, 0x80, 0x28, 0x21, 0xdf, 0x21, 0x3c, 0x09, 0x19, 0x82, 0xc3, 0x22, 0x42, 0x71, 0xb4, 0x64, + 0x3b, 0x1f, 0xc6, 0xca, 0xc9, 0x30, 0xde, 0x84, 0xd0, 0x21, 0x3c, 0x01, 0x1c, 0x92, 0x80, 0x6b, + 0xc5, 0x00, 0x77, 0xd4, 0x3c, 0x33, 0xb3, 0x06, 0x3a, 0x07, 0x47, 0xf6, 0x5c, 0xe2, 0x35, 0x99, + 0x8c, 0xc9, 0xb8, 0x19, 0xf7, 0xf0, 0x37, 0x00, 0x3e, 0x9e, 0x20, 0xd7, 0x5d, 0xc6, 0x8b, 0xa5, + 0xb9, 0x01, 0x27, 0x3c, 0x97, 0x29, 0xc0, 0x28, 0xd3, 0xb5, 0x62, 0x80, 0xf5, 0x74, 0xa2, 0x99, + 0x5d, 0x25, 0x83, 0x38, 0x94, 0x43, 0x74, 0xe0, 0x53, 0xea, 0x38, 0x10, 0xd6, 0xde, 0x6d, 0xb9, + 0x25, 0x22, 0xab, 0xc1, 0xb1, 0x16, 0x69, 0x51, 0xf7, 0x03,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0x02, 0x5f, 0xc4, 0x0f, 0x28, 0xe2, 0xaa, 0xdc, 0x5c, 0xbf, 0xfa, 0xfb, 0xf1, + 0x1c, 0xf8, 0xe3, 0x78, 0x0e, 0xfc, 0x75, 0x3c, 0x07, 0xde, 0x33, 0x1e, 0xf4, 0x87, 0xd7, 0x89, + 0x7f, 0xef, 0x76, 0x47, 0xe4, 0xff, 0x57, 0x1b, 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0x66, 0xee, + 0x6c, 0x55, 0xde, 0x13, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/pkg/apiclient/workflow/workflow.proto b/pkg/apiclient/workflow/workflow.proto index 8d28582dd332..d830355b71c5 100644 --- a/pkg/apiclient/workflow/workflow.proto +++ b/pkg/apiclient/workflow/workflow.proto @@ -15,7 +15,8 @@ package workflow; message WorkflowCreateRequest { string namespace = 1; github.com.argoproj.argo.pkg.apis.workflow.v1alpha1.Workflow workflow = 2; - string instanceID = 3; + // This field is no longer used. + string instanceID = 3 [deprecated=true]; bool serverDryRun = 4; k8s.io.apimachinery.pkg.apis.meta.v1.CreateOptions createOptions = 5; } diff --git a/pkg/apiclient/workflow/workflow.swagger.json b/pkg/apiclient/workflow/workflow.swagger.json index 1fe00c67ab31..6e026d74e072 100644 --- a/pkg/apiclient/workflow/workflow.swagger.json +++ b/pkg/apiclient/workflow/workflow.swagger.json @@ -1752,10 +1752,6 @@ "type": "string", "title": "GenerateName overrides metadata.generateName" }, - "instanceID": { - "type": "string", - "title": "InstanceID binds the Resource to the specified instance ID" - }, "entrypoint": { "type": "string", "title": "Entrypoint overrides spec.entrypoint" @@ -4979,7 +4975,8 @@ "$ref": "#/definitions/github.com.argoproj.argo.pkg.apis.workflow.v1alpha1.Workflow" }, "instanceID": { - "type": "string" + "type": "string", + "description": "This field is no longer used." }, "serverDryRun": { "type": "boolean", diff --git a/pkg/apis/workflow/v1alpha1/common.go b/pkg/apis/workflow/v1alpha1/common.go index e0188b5a4525..c36254c6c39a 100644 --- a/pkg/apis/workflow/v1alpha1/common.go +++ b/pkg/apis/workflow/v1alpha1/common.go @@ -34,8 +34,6 @@ type SubmitOpts struct { Name string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"` // GenerateName overrides metadata.generateName GenerateName string `json:"generateName,omitempty" protobuf:"bytes,2,opt,name=generateName"` - // InstanceID binds the Resource to the specified instance ID - InstanceID string `json:"instanceID,omitempty" protobuf:"bytes,3,opt,name=instanceID"` // Entrypoint overrides spec.entrypoint Entrypoint string `json:"entryPoint,omitempty" protobuf:"bytes,4,opt,name=entrypoint"` // Parameters passes input parameters to workflow diff --git a/pkg/apis/workflow/v1alpha1/generated.pb.go b/pkg/apis/workflow/v1alpha1/generated.pb.go index 9ed5fcbf993f..51b2330d993f 100644 --- a/pkg/apis/workflow/v1alpha1/generated.pb.go +++ b/pkg/apis/workflow/v1alpha1/generated.pb.go @@ -2025,399 +2025,398 @@ func init() { } var fileDescriptor_c23edafa7e7ea072 = []byte{ - // 6264 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x3c, 0x4b, 0x6c, 0x1c, 0xc9, - 0x75, 0x3b, 0x24, 0x67, 0x38, 0xf3, 0x86, 0xa4, 0xa8, 0x12, 0x25, 0xcd, 0x72, 0xb5, 0x1c, 0xb9, - 0x37, 0xbb, 0xd1, 0x26, 0x6b, 0xd2, 0xab, 0xf5, 0x26, 0xeb, 0xcf, 0x7e, 0x38, 0xa4, 0x48, 0x51, - 0x1f, 0x92, 0x7e, 0x43, 0x49, 0xb1, 0x77, 0x61, 0xa7, 0x39, 0x5d, 0x33, 0xd3, 0xe2, 0x4c, 0x77, - 0x6f, 0x57, 0x8f, 0xb8, 0xf4, 0x26, 0xc8, 0xc6, 0x48, 0xe0, 0x7c, 0x60, 0x20, 0x41, 0x00, 0xc3, - 0x80, 0x11, 0x20, 0xf0, 0x25, 0x97, 0xe4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, 0x7d, - 0x28, 0x91, 0xcb, 0x8a, 0x4b, 0xed, 0xb4, 0x92, 0x58, 0x0a, 0x21, 0x0c, 0x23, 0x11, 0xc6, 0x8f, - 0xc6, 0xa1, 0x18, 0x22, 0xc8, 0x45, 0x98, 0x70, 0xcc, 0x2e, 0x15, 0xa3, 0x57, 0xaa, 0x4d, 0xa9, - 0x82, 0x13, 0x9b, 0x66, 0x97, 0x77, 0x90, 0xd9, 0xa5, 0x9c, 0xc2, 0x33, 0x83, 0xb6, 0x18, 0x81, - 0x18, 0xc5, 0xb6, 0x19, 0xb4, 0x51, 0x60, 0xc8, 0x05, 0x98, 0xe8, 0xba, 0x16, 0xad, 0x8c, 0x5f, - 0xcc, 0x5d, 0xca, 0xcb, 0x0e, 0xbe, 0xe9, 0x5a, 0x14, 0x05, 0x94, 0x97, 0x6f, 0xfa, 0x6e, 0xb7, - 0x32, 0x91, 0x2c, 0xbf, 0xe6, 0xbb, 0x5d, 0x14, 0x18, 0xf2, 0xfb, 0x39, 0x98, 0x0d, 0xab, 0x77, - 0xc3, 0x6d, 0x98, 0x81, 0xed, 0x3a, 0x95, 0xbc, 0x18, 0xf0, 0x2b, 0x23, 0x75, 0x44, 0xc8, 0xac, - 0x56, 0x51, 0x52, 0x67, 0xd3, 0x18, 0xec, 0x13, 0x4c, 0x2e, 0x03, 0xb4, 0x3a, 0xee, 0xae, 0xd9, - 0xe1, 0x7d, 0x50, 0x29, 0x88, 0x5a, 0xeb, 0x21, 0x5c, 0xd7, 0x18, 0x8c, 0x51, 0x91, 0x3d, 0x98, - 0x34, 0xe5, 0xac, 0xa8, 0x4c, 0x8a, 0x7a, 0xaf, 0x0e, 0x59, 0xef, 0xc4, 0xcc, 0xaa, 0x95, 0x8f, - 0x0e, 0xab, 0x93, 0x0a, 0x88, 0xa1, 0x04, 0xf2, 0x12, 0x14, 0x5d, 0x8f, 0x57, 0xd5, 0xec, 0x54, - 0x8a, 0x17, 0x73, 0x97, 0x8a, 0xb5, 0x59, 0x55, 0xbd, 0xe2, 0x96, 0x82, 0xa3, 0xa6, 0x30, 0xfe, - 0xb6, 0x00, 0x7d, 0xad, 0x26, 0x2f, 0x43, 0x59, 0x71, 0xbb, 0xe1, 0xb6, 0x98, 0x18, 0xfc, 0x62, - 0xed, 0xd4, 0xd1, 0x61, 0xb5, 0xbc, 0x1c, 0x81, 0x31, 0x4e, 0x43, 0xee, 0xc0, 0x18, 0x7b, 0x45, - 0x4d, 0xc3, 0x37, 0x87, 0x6a, 0x5d, 0xfd, 0x15, 0xad, 0xa0, 0x85, 0xa3, 0xc3, 0xea, 0x58, 0xfd, - 0x15, 0x1c, 0x63, 0xaf, 0xf0, 0xe5, 0xa3, 0x65, 0x07, 0x42, 0x79, 0x86, 0x5d, 0x3e, 0xd6, 0xed, - 0x40, 0xb3, 0x16, 0xcb, 0xc7, 0xba, 0x1d, 0x20, 0xe7, 0xca, 0x97, 0x8f, 0x76, 0x10, 0x78, 0x42, - 0xf9, 0x86, 0x5d, 0x3e, 0xae, 0xee, 0xec, 0x6c, 0x6b, 0xf6, 0x42, 0xbb, 0x39, 0x04, 0x05, 0x63, - 0xf2, 0x3e, 0xef, 0x49, 0x89, 0x73, 0xfd, 0x03, 0xa5, 0xb5, 0x57, 0x47, 0xd2, 0x5a, 0xd7, 0x3f, - 0xd0, 0xe2, 0xd4, 0x98, 0x68, 0x04, 0xc6, 0xa5, 0x89, 0xd6, 0x59, 0x4d, 0x26, 0x94, 0x74, 0xe8, - 0xd6, 0xad, 0xae, 0xd5, 0x53, 0xad, 0x5b, 0x5d, 0xab, 0xa3, 0x60, 0xcc, 0xc7, 0xc6, 0x37, 0xf7, - 0x95, 0x4e, 0x0f, 0x37, 0x36, 0x68, 0xee, 0x27, 0xc7, 0x06, 0xcd, 0x7d, 0xe4, 0x5c, 0x39, 0x73, - 0x97, 0x31, 0xa1, 0xc2, 0xc3, 0x32, 0xdf, 0xaa, 0xd7, 0x93, 0xcc, 0xb7, 0xea, 0x75, 0xe4,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 0x23, 0xe5, 0xe3, 0x93, 0x42, 0x19, 0x89, 0x8f, 0xbe, 0x5a, - 0xcd, 0x71, 0x8f, 0xf2, 0x4e, 0x8c, 0x13, 0x9f, 0x58, 0x98, 0xe0, 0x6d, 0xfc, 0x5d, 0x0e, 0x48, - 0xff, 0x42, 0x40, 0xae, 0x43, 0xc1, 0x6c, 0x04, 0xdc, 0x5f, 0x94, 0x31, 0x86, 0xe7, 0xb2, 0x0c, - 0x13, 0x29, 0x0a, 0x69, 0x93, 0x72, 0x0d, 0xa1, 0xd1, 0xea, 0xb1, 0x2c, 0x8a, 0xa2, 0x62, 0x41, - 0x5c, 0x38, 0xdd, 0x31, 0x59, 0x10, 0xea, 0xaa, 0xc5, 0x9b, 0xac, 0x16, 0xc9, 0x5f, 0x38, 0x5e, - 0xa3, 0x78, 0x89, 0xda, 0x59, 0xae, 0xb9, 0x37, 0xd2, 0x8c, 0xb0, 0x9f, 0xb7, 0xf1, 0xad, 0x02, - 0x4c, 0xae, 0x2e, 0xaf, 0xef, 0x98, 0x6c, 0xef, 0x18, 0x01, 0x04, 0x3e, 0x38, 0x6a, 0x5b, 0x4b, - 0x4f, 0xaf, 0x70, 0xbb, 0x43, 0x4d, 0x41, 0x5c, 0x28, 0x99, 0x61, 0x38, 0x46, 0x2d, 0xbf, 0x6f, - 0x0c, 0x69, 0xb4, 0x2a, 0x2e, 0xf1, 0x70, 0x88, 0x02, 0x61, 0x24, 0x83, 0x30, 0x28, 0x87, 0xc2, - 0x91, 0x36, 0x95, 0xa7, 0x38, 0x64, 0x18, 0x2b, 0xe2, 0x23, 0x3d, 0xb7, 0x18, 0x00, 0xe3, 0x52, - 0xc8, 0xc7, 0x61, 0xca, 0xa2, 0x7c, 0x16, 0x53, 0xa7, 0x61, 0x53, 0x3e, 0x61, 0xc7, 0x79, 0xbf, - 0xf0, 0x85, 0x6b, 0x35, 0x06, 0xc7, 0x04, 0x15, 0xb9, 0x0b, 0xa5, 0x7d, 0x3b, 0x68, 0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 0x00, 0x94, 0x70, 0x4e, 0xd0, - 0xa4, 0x41, 0xa3, 0x5d, 0x99, 0x10, 0x0b, 0xaa, 0x20, 0x58, 0xe3, 0x00, 0x94, 0xf0, 0x8c, 0xe0, - 0x43, 0xfe, 0xf1, 0x07, 0x1f, 0x0a, 0x27, 0x1c, 0x7c, 0x20, 0x1e, 0x9c, 0x61, 0xac, 0xbd, 0xed, - 0xdb, 0xf7, 0xcc, 0x80, 0x46, 0xda, 0x33, 0xf9, 0x28, 0x72, 0xce, 0x1f, 0x1d, 0x56, 0xcf, 0xd4, - 0xeb, 0x57, 0xd3, 0x5c, 0x30, 0x8b, 0x35, 0xa9, 0xc3, 0x59, 0xdb, 0x61, 0xb4, 0xd1, 0xf3, 0xe9, - 0x46, 0xcb, 0x71, 0x7d, 0x7a, 0xd5, 0x65, 0x9c, 0x9d, 0x8a, 0x40, 0x3f, 0xab, 0x06, 0xed, 0xec, - 0x46, 0x16, 0x11, 0x66, 0x97, 0x35, 0xbe, 0x93, 0x83, 0xa9, 0x78, 0xfc, 0x91, 0x30, 0x80, 0xf6, - 0xea, 0x5a, 0x5d, 0x2e, 0x25, 0x6a, 0x86, 0xbf, 0x39, 0x74, 0x58, 0x53, 0xb2, 0x89, 0x9c, 0xca, - 0x08, 0x86, 0x31, 0x31, 0xc7, 0x38, 0xe0, 0x78, 0x0e, 0xf2, 0x4d, 0xd7, 0x6f, 0x50, 0xb5, 0x18, - 0xea, 0x59, 0xb2, 0xc6, 0x81, 0x28, 0x71, 0xc6, 0x0f, 0x73, 0x10, 0x93, 0x40, 0x7e, 0x03, 0xa6, - 0xb9, 0x8c, 0xeb, 0xfe, 0x6e, 0xa2, 0x35, 0xb5, 0xa1, 0x5b, 0xa3, 0x39, 0xd5, 0xce, 0x2a, 0xf9, - 0xd3, 0x09, 0x30, 0x26, 0xe5, 0x91, 0x5f, 0x84, 0x92, 0x69, 0x59, 0x3e, 0x65, 0x8c, 0xca, 0xbd, - 0xa2, 0x54, 0x9b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 0xfb, 0x13, 0x6a, 0x35, 0x73, 0xae, 0x51, 0xbf, 0xf7, 0xfd, 0xea, 0x6c, 0xf8, 0xad, - 0x33, 0x20, 0xfa, 0xdb, 0xc5, 0x97, 0x44, 0xcf, 0xb5, 0x36, 0xb6, 0x2b, 0x53, 0xc9, 0x25, 0x71, - 0x9b, 0x03, 0x51, 0xe2, 0xc8, 0x25, 0x28, 0x5a, 0x26, 0xed, 0xba, 0x0e, 0xb5, 0x2a, 0xd3, 0x51, - 0x68, 0x6b, 0x55, 0xc1, 0x50, 0x63, 0xc9, 0x17, 0xa0, 0x60, 0x0b, 0xd7, 0xa2, 0x32, 0x23, 0x06, - 0xe6, 0x53, 0xc3, 0x19, 0x1f, 0x82, 0x45, 0x0d, 0xf8, 0x5e, 0x23, 0xff, 0xa3, 0x62, 0x4b, 0x1a, - 0x30, 0xe9, 0xf6, 0x02, 0x21, 0xe1, 0x94, 0x90, 0x30, 0x5c, 0x64, 0x77, 0x4b, 0xf2, 0x90, 0x1e, - 0x92, 0xfa, 0xc0, 0x90, 0x33, 0x6f, 0x6f, 0xa3, 0x6d, 0x77, 0x2c, 0x9f, 0x3a, 0x95, 0x59, 0x11, - 0x13, 0x10, 0xed, 0x5d, 0x51, 0x30, 0xd4, 0x58, 0xf2, 0xcb, 0x30, 0xed, 0xf6, 0x02, 0x31, 0x4b, - 0xf8, 0x28, 0xb3, 0xca, 0x69, 0x41, 0x7e, 0x9a, 0xcf, 0xd9, 0xad, 0x38, 0x02, 0x93, 0x74, 0xf3, - 0xab, 0x70, 0x2e, 0x5b, 0x17, 0x1e, 0xb6, 0xfd, 0x8d, 0xc7, 0xb7, 0xbf, 0x19, 0x98, 0x8a, 0xa7, - 0xed, 0x8a, 0x50, 0x70, 0x2c, 0xdb, 0x8b, 0xb8, 0x50, 0x72, 0xeb, 0x27, 0x11, 0x0a, 0xde, 0xaa, - 0xf7, 0x85, 0x82, 0x35, 0x08, 0x23, 0x19, 0x0f, 0x0b, 0x05, 0x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62, 0x55, 0x8c, 0xba, 0xbd, 0x1e, 0xc3, 0x61, 0x82, 0x92, - 0x4b, 0x50, 0x16, 0x22, 0x24, 0x35, 0x21, 0x65, 0xe3, 0x79, 0x30, 0xe3, 0x26, 0x37, 0x65, 0x19, - 0x8a, 0xfa, 0xf8, 0x31, 0x13, 0x64, 0x13, 0x65, 0x65, 0x3a, 0x4b, 0x6a, 0x0f, 0x4f, 0xf1, 0x37, - 0xde, 0x84, 0x53, 0x2a, 0xbb, 0x59, 0x4f, 0xd2, 0x47, 0xba, 0x52, 0x63, 0xfc, 0x67, 0x0e, 0xca, - 0x3b, 0x3b, 0x37, 0xf4, 0x96, 0x8a, 0x70, 0x8e, 0xc9, 0x74, 0xe6, 0xe5, 0x66, 0x40, 0xfd, 0x15, - 0xb7, 0xeb, 0x75, 0xa8, 0xe6, 0xa5, 0x72, 0x8c, 0xeb, 0x99, 0x14, 0x38, 0xa0, 0x24, 0xd9, 0x80, - 0x33, 0x71, 0x8c, 0xb2, 0x28, 0xd4, 0x1d, 0x1e, 0x99, 0x4c, 0xd3, 0x8f, 0xc6, 0xac, 0x32, 0x69, - 0x56, 0xca, 0xac, 0x50, 0xf7, 0x67, 0xfb, 0x58, 0x29, 0x34, 0x66, 0x95, 0x31, 0xb6, 0xa0, 0x1c, - 0xbb, 0x3c, 0x4d, 0xde, 0x82, 0xd9, 0x86, 0xdb, 0xf5, 0x7c, 0xca, 0x98, 0xed, 0x3a, 0x37, 0xe8, - 0x3d, 0xda, 0x51, 0x4d, 0x16, 0xc9, 0xca, 0x2b, 0x29, 0x1c, 0xf6, 0x51, 0x1b, 0xdf, 0x78, 0x1a, - 0x74, 0x5a, 0xee, 0xcf, 0x92, 0x7b, 0x87, 0x0a, 0xc5, 0x37, 0x74, 0xa8, 0x30, 0x3f, 0x7a, 0xa8, - 0x50, 0xcf, 0xd2, 0x54, 0xb8, 0xb0, 0x15, 0x85, 0x0b, 0x0b, 0x27, 0x10, 0x2e, 0xd4, 0x1b, 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0x18, 0xe3, 0x34, 0xe4, 0x16, - 0x94, 0x03, 0xb7, 0x43, 0x7d, 0x95, 0x81, 0x52, 0x11, 0x83, 0xbf, 0x90, 0xa5, 0xc9, 0x3b, 0x9a, - 0x2c, 0x72, 0x0e, 0x23, 0x18, 0xc3, 0x38, 0x1f, 0x6e, 0xf0, 0x87, 0xd7, 0xfa, 0x7c, 0xe1, 0xc3, - 0x3c, 0x9d, 0x34, 0xf8, 0xeb, 0x71, 0x24, 0x26, 0x69, 0xc9, 0x3a, 0x9c, 0xf6, 0x7c, 0xdb, 0xf5, - 0xed, 0xe0, 0x60, 0xa5, 0x63, 0x32, 0x26, 0x18, 0xcc, 0x0b, 0x06, 0x3a, 0x7c, 0xb5, 0x9d, 0x26, - 0xc0, 0xfe, 0x32, 0xe4, 0x12, 0x14, 0x43, 0x60, 0xe5, 0x19, 0x61, 0xab, 0x89, 0x65, 0x29, 0x2c, - 0x8b, 0x1a, 0x3b, 0xe0, 0x6e, 0xc5, 0x85, 0x61, 0xee, 0x56, 0x10, 0x0b, 0x2e, 0x98, 0xbd, 0xc0, - 0xed, 0x72, 0x40, 0xb2, 0xc8, 0x8e, 0xbb, 0x47, 0x9d, 0xca, 0x45, 0xb1, 0x57, 0x5d, 0x3c, 0x3a, - 0xac, 0x5e, 0x58, 0x7e, 0x00, 0x1d, 0x3e, 0x90, 0x0b, 0xe9, 0x42, 0x91, 0xaa, 0xfb, 0x21, 0x95, - 0x8f, 0x8c, 0xb0, 0x49, 0x24, 0x2f, 0x99, 0x84, 0xe7, 0x21, 0x12, 0x86, 0x5a, 0x04, 0xd9, 0x81, - 0x72, 0xdb, 0x65, 0xc1, 0x72, 0xc7, 0x36, 0x19, 0x65, 0x95, 0x67, 0x85, 0x9e, 0x64, 0xee, 0x6f, - 0x57, 0x43, 0xb2, 0x48, 0x4d, 0xae, 0x46, 0x25, 0x31, 0xce, 0x86, 0x50, 0x11, 0x0f, 0xe9, 0x89, - 0x51, 0x73, 0x9d, 0x80,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, 0x9e, 0xac, 0xc5, 0x68, 0xe1, 0x91, 0x78, - 0x1d, 0x4e, 0xe6, 0x56, 0xd5, 0x1f, 0x16, 0x62, 0x21, 0x9d, 0x80, 0x7a, 0x3f, 0x4b, 0xf0, 0x19, - 0x2a, 0xc1, 0x27, 0xf1, 0x0e, 0x5f, 0xfe, 0x09, 0xbe, 0xc3, 0x57, 0x18, 0xe2, 0x1d, 0xbe, 0xc9, - 0x27, 0xf9, 0x0e, 0x5f, 0xf1, 0x98, 0xef, 0xf0, 0x95, 0x7e, 0x72, 0xde, 0xe1, 0xfb, 0x30, 0x07, - 0xb3, 0xff, 0xdf, 0x1f, 0xca, 0xfe, 0x41, 0x0e, 0xe6, 0xfe, 0x17, 0x5e, 0xc8, 0xbe, 0x9b, 0x8c, - 0x52, 0x5f, 0x39, 0x91, 0x46, 0x0e, 0x88, 0x56, 0xff, 0x51, 0x46, 0x13, 0x45, 0xd4, 0xfa, 0xfd, - 0xc7, 0xf5, 0xd4, 0xf0, 0x5c, 0xd6, 0x53, 0xc3, 0xc9, 0xa7, 0x85, 0x6b, 0x8b, 0xdf, 0xfe, 0x70, - 0xe1, 0xa9, 0xef, 0x7e, 0xb8, 0xf0, 0xd4, 0xf7, 0x3e, 0x5c, 0x78, 0xea, 0x83, 0xa3, 0x85, 0xdc, - 0xb7, 0x8f, 0x16, 0x72, 0xdf, 0x3d, 0x5a, 0xc8, 0x7d, 0xef, 0x68, 0x21, 0xf7, 0x83, 0xa3, 0x85, - 0xdc, 0x1f, 0xfc, 0xf3, 0xc2, 0x53, 0x9f, 0x2b, 0x86, 0x02, 0xfe, 0x27, 0x00, 0x00, 0xff, 0xff, - 0x1c, 0x74, 0x4a, 0x0f, 0xf7, 0x68, 0x00, 0x00, + // 6245 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x3c, 0x5b, 0x6c, 0x23, 0xc9, + 0x71, 0x47, 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x16, 0xda, 0x6a, 0x84, 0xc2, 0x38, 0x1d, 0x79, 0x49, 0x2d, 0x7e, 0x72, 0x95, + 0xa9, 0xa4, 0x16, 0xbf, 0x22, 0xaf, 0x5e, 0x6c, 0x01, 0x7c, 0x0d, 0xa6, 0xc2, 0x88, 0x9d, 0x90, + 0x92, 0x17, 0xa5, 0xc2, 0x25, 0x73, 0x6a, 0x3b, 0x86, 0xc3, 0x04, 0x65, 0x3a, 0xa2, 0x58, 0x78, + 0x22, 0x11, 0xc5, 0x55, 0x98, 0x65, 0x81, 0xeb, 0x53, 0x2b, 0xa4, 0xb8, 0xb6, 0x5a, 0x21, 0x89, + 0x86, 0xce, 0xd6, 0x53, 0x78, 0xec, 0x2b, 0x41, 0xb6, 0x60, 0x6e, 0x2f, 0x75, 0x14, 0x29, 0x1a, + 0x7f, 0x46, 0x70, 0xba, 0xa0, 0x38, 0xcd, 0xdd, 0xcd, 0xa0, 0xc1, 0xcc, 0x92, 0xe4, 0x53, 0x30, + 0x1d, 0x56, 0x53, 0xac, 0x40, 0x95, 0x39, 0xc1, 0x4a, 0xfb, 0x30, 0xdb, 0x71, 0x24, 0x26, 0x69, + 0xc9, 0xc7, 0x20, 0xef, 0xb5, 0x4d, 0x46, 0x55, 0x00, 0x32, 0x8c, 0x1f, 0xe5, 0xb7, 0x38, 0xf0, + 0xe8, 0xa0, 0x5a, 0xe2, 0x63, 0x26, 0x3e, 0x50, 0x12, 0x92, 0xcb, 0x00, 0x3b, 0x6e, 0xcf, 0xb1, + 0x4c, 0x7f, 0xff, 0xda, 0xaa, 0x3a, 0x0b, 0xd0, 0x76, 0x5b, 0x4d, 0x63, 0x30, 0x46, 0xc5, 0xb7, + 0xaa, 0xae, 0x5c, 0xb4, 0x55, 0x1c, 0x51, 0x6f, 0x55, 0x7a, 0x2d, 0x57, 0x78, 0xf2, 0x36, 0x94, + 0xc4, 0xb9, 0x09, 0xb5, 0x96, 0x03, 0x15, 0x4c, 0x7c, 0x94, 0x10, 0x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e9, 0x76, 0x9f, 0xd7, 0xb5, 0x97, 0x7a, 0xb4, 0x96, 0x14, + 0x7c, 0x74, 0x50, 0x3d, 0xd6, 0xd3, 0x78, 0x8b, 0x9a, 0x77, 0xb2, 0xc2, 0xf1, 0x24, 0xaf, 0xf1, + 0x07, 0x27, 0x79, 0x19, 0xdf, 0xcd, 0xc1, 0xd4, 0x13, 0x7c, 0x89, 0x61, 0x27, 0xf9, 0x12, 0xc3, + 0xeb, 0x23, 0x0d, 0xdb, 0x80, 0x57, 0x18, 0xfe, 0xe9, 0x1c, 0x24, 0x5e, 0x40, 0x20, 0x0e, 0x94, + 0xc2, 0x15, 0x32, 0x4c, 0x16, 0x78, 0x7d, 0xa4, 0x28, 0x40, 0x34, 0x37, 0x43, 0x08, 0xc3, 0x48, + 0x44, 0x2a, 0xe6, 0x3b, 0x76, 0xac, 0x98, 0xef, 0x13, 0x8f, 0x30, 0x65, 0xdb, 0x64, 0x13, 0x8f, + 0xc5, 0x26, 0xbb, 0x70, 0xe2, 0x36, 0xd9, 0xb3, 0x8f, 0xdf, 0x26, 0x8b, 0x79, 0xa0, 0xf9, 0x11, + 0x3c, 0xd0, 0xf7, 0x61, 0x4e, 0xfe, 0x5d, 0xe9, 0x98, 0x76, 0x57, 0xeb, 0x8b, 0xba, 0x90, 0xf1, + 0x62, 0xa6, 0x25, 0x46, 0x7d, 0x66, 0xb3, 0x80, 0x3a, 0xc1, 0x9d, 0xa8, 0x64, 0x94, 0x90, 0x7a, + 0x27, 0x83, 0x1d, 0x66, 0x0a, 0x49, 0xbb, 0x2c, 0x93, 0xc7, 0x70, 0x59, 0xbe, 0x9e, 0x83, 0xb3, + 0x66, 0xd6, 0x83, 0x5f, 0x2a, 0x70, 0x75, 0x7d, 0x24, 0x07, 0x32, 0xc1, 0x51, 0x39, 0x80, 0x59, + 0x28, 0xcc, 0xae, 0x03, 0x79, 0x3e, 0x8a, 0x41, 0xc8, 0x03, 0x84, 0xec, 0xe8, 0xc1, 0x57, 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xde, 0xe1, 0x42, 0xee, 0x07, 0x87, 0x0b, 0xb9, 0x3f, 0xf8, 0x97, + 0x85, 0xa7, 0x3e, 0x57, 0x0c, 0x05, 0xfc, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xbb, 0xbd, 0x5a, + 0xf3, 0xc3, 0x68, 0x00, 0x00, } func (m *ArchiveStrategy) Marshal() (dAtA []byte, err error) { @@ -5303,11 +5302,6 @@ func (m *SubmitOpts) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintGenerated(dAtA, i, uint64(len(m.Entrypoint))) i-- dAtA[i] = 0x22 - i -= len(m.InstanceID) - copy(dAtA[i:], m.InstanceID) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.InstanceID))) - i-- - dAtA[i] = 0x1a i -= len(m.GenerateName) copy(dAtA[i:], m.GenerateName) i = encodeVarintGenerated(dAtA, i, uint64(len(m.GenerateName))) @@ -7971,8 +7965,6 @@ func (m *SubmitOpts) Size() (n int) { n += 1 + l + sovGenerated(uint64(l)) l = len(m.GenerateName) n += 1 + l + sovGenerated(uint64(l)) - l = len(m.InstanceID) - n += 1 + l + sovGenerated(uint64(l)) l = len(m.Entrypoint) n += 1 + l + sovGenerated(uint64(l)) if len(m.Parameters) > 0 { @@ -9280,7 +9272,6 @@ func (this *SubmitOpts) String() string { s := strings.Join([]string{`&SubmitOpts{`, `Name:` + fmt.Sprintf("%v", this.Name) + `,`, `GenerateName:` + fmt.Sprintf("%v", this.GenerateName) + `,`, - `InstanceID:` + fmt.Sprintf("%v", this.InstanceID) + `,`, `Entrypoint:` + fmt.Sprintf("%v", this.Entrypoint) + `,`, `Parameters:` + fmt.Sprintf("%v", this.Parameters) + `,`, `ParameterFile:` + fmt.Sprintf("%v", this.ParameterFile) + `,`, @@ -18992,38 +18983,6 @@ func (m *SubmitOpts) Unmarshal(dAtA []byte) error { } m.GenerateName = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InstanceID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.InstanceID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Entrypoint", wireType) diff --git a/pkg/apis/workflow/v1alpha1/generated.proto b/pkg/apis/workflow/v1alpha1/generated.proto index 3222192ad0d6..c83b2711d514 100644 --- a/pkg/apis/workflow/v1alpha1/generated.proto +++ b/pkg/apis/workflow/v1alpha1/generated.proto @@ -796,9 +796,6 @@ message SubmitOpts { // GenerateName overrides metadata.generateName optional string generateName = 2; - // InstanceID binds the Resource to the specified instance ID - optional string instanceID = 3; - // Entrypoint overrides spec.entrypoint optional string entrypoint = 4; diff --git a/server/apiserver/argoserver.go b/server/apiserver/argoserver.go index 3a76c112dd66..cc9b3d8e7e1c 100644 --- a/server/apiserver/argoserver.go +++ b/server/apiserver/argoserver.go @@ -196,10 +196,10 @@ func (as *argoServer) newGRPCServer(instanceID string, offloadNodeStatusRepo sql infopkg.RegisterInfoServiceServer(grpcServer, info.NewInfoServer(as.managedNamespace, links)) workflowpkg.RegisterWorkflowServiceServer(grpcServer, workflow.NewWorkflowServer(instanceID, offloadNodeStatusRepo)) - workflowtemplatepkg.RegisterWorkflowTemplateServiceServer(grpcServer, workflowtemplate.NewWorkflowTemplateServer()) + workflowtemplatepkg.RegisterWorkflowTemplateServiceServer(grpcServer, workflowtemplate.NewWorkflowTemplateServer(instanceID)) cronworkflowpkg.RegisterCronWorkflowServiceServer(grpcServer, cronworkflow.NewCronWorkflowServer(instanceID)) workflowarchivepkg.RegisterArchivedWorkflowServiceServer(grpcServer, workflowarchive.NewWorkflowArchiveServer(wfArchive)) - clusterwftemplatepkg.RegisterClusterWorkflowTemplateServiceServer(grpcServer, clusterworkflowtemplate.NewClusterWorkflowTemplateServer()) + clusterwftemplatepkg.RegisterClusterWorkflowTemplateServiceServer(grpcServer, clusterworkflowtemplate.NewClusterWorkflowTemplateServer(instanceID)) return grpcServer } diff --git a/server/clusterworkflowtemplate/cluster_workflow_template_server.go b/server/clusterworkflowtemplate/cluster_workflow_template_server.go index c724ea056ae1..54e06ceeef15 100644 --- a/server/clusterworkflowtemplate/cluster_workflow_template_server.go +++ b/server/clusterworkflowtemplate/cluster_workflow_template_server.go @@ -10,15 +10,17 @@ import ( clusterwftmplpkg "github.com/argoproj/argo/pkg/apiclient/clusterworkflowtemplate" "github.com/argoproj/argo/pkg/apis/workflow/v1alpha1" "github.com/argoproj/argo/server/auth" + "github.com/argoproj/argo/util/labels" "github.com/argoproj/argo/workflow/templateresolution" "github.com/argoproj/argo/workflow/validate" ) type ClusterWorkflowTemplateServer struct { + instanceID string } -func NewClusterWorkflowTemplateServer() clusterwftmplpkg.ClusterWorkflowTemplateServiceServer { - return &ClusterWorkflowTemplateServer{} +func NewClusterWorkflowTemplateServer(instanceID string) clusterwftmplpkg.ClusterWorkflowTemplateServiceServer { + return &ClusterWorkflowTemplateServer{instanceID} } func (cwts *ClusterWorkflowTemplateServer) CreateClusterWorkflowTemplate(ctx context.Context, req *clusterwftmplpkg.ClusterWorkflowTemplateCreateRequest) (*v1alpha1.ClusterWorkflowTemplate, error) { @@ -27,6 +29,8 @@ func (cwts *ClusterWorkflowTemplateServer) CreateClusterWorkflowTemplate(ctx con return nil, fmt.Errorf("cluster workflow template was not found in the request body") } + labels.SetInstanceID(req.Template, cwts.instanceID) + cwftmplGetter := templateresolution.WrapClusterWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().ClusterWorkflowTemplates()) _, err := validate.ValidateClusterWorkflowTemplate(nil, cwftmplGetter, req.Template) diff --git a/server/clusterworkflowtemplate/cluster_workflow_template_server_test.go b/server/clusterworkflowtemplate/cluster_workflow_template_server_test.go index 750a21c399d1..a2aa8db65b25 100644 --- a/server/clusterworkflowtemplate/cluster_workflow_template_server_test.go +++ b/server/clusterworkflowtemplate/cluster_workflow_template_server_test.go @@ -148,7 +148,7 @@ func getClusterWorkflowTemplateServer() (clusterwftmplpkg.ClusterWorkflowTemplat kubeClientSet := fake.NewSimpleClientset() wfClientset := wftFake.NewSimpleClientset(&cwftObj1, &cwftObj2) ctx := context.WithValue(context.WithValue(context.TODO(), auth.WfKey, wfClientset), auth.KubeKey, kubeClientSet) - return NewClusterWorkflowTemplateServer(), ctx + return NewClusterWorkflowTemplateServer(""), ctx } func TestWorkflowTemplateServer_CreateClusterWorkflowTemplate(t *testing.T) { diff --git a/server/cronworkflow/cron_workflow_server.go b/server/cronworkflow/cron_workflow_server.go index aa4d52941c12..03f37e55bd5f 100644 --- a/server/cronworkflow/cron_workflow_server.go +++ b/server/cronworkflow/cron_workflow_server.go @@ -9,6 +9,7 @@ import ( cronworkflowpkg "github.com/argoproj/argo/pkg/apiclient/cronworkflow" "github.com/argoproj/argo/pkg/apis/workflow/v1alpha1" "github.com/argoproj/argo/server/auth" + "github.com/argoproj/argo/util/labels" "github.com/argoproj/argo/workflow/common" "github.com/argoproj/argo/workflow/templateresolution" "github.com/argoproj/argo/workflow/validate" @@ -57,14 +58,7 @@ func (c *cronWorkflowServiceServer) CreateCronWorkflow(ctx context.Context, req return nil, err } - if len(c.instanceID) > 0 { - labels := req.CronWorkflow.GetLabels() - if labels == nil { - labels = make(map[string]string) - } - labels[common.LabelKeyControllerInstanceID] = c.instanceID - req.CronWorkflow.SetLabels(labels) - } + labels.SetInstanceID(req.CronWorkflow, c.instanceID) return wfClient.ArgoprojV1alpha1().CronWorkflows(req.Namespace).Create(req.CronWorkflow) } diff --git a/server/workflow/workflow_server.go b/server/workflow/workflow_server.go index e641030941eb..8f8b3c6ea770 100644 --- a/server/workflow/workflow_server.go +++ b/server/workflow/workflow_server.go @@ -14,6 +14,7 @@ import ( "github.com/argoproj/argo/pkg/apis/workflow" "github.com/argoproj/argo/pkg/apis/workflow/v1alpha1" "github.com/argoproj/argo/server/auth" + "github.com/argoproj/argo/util/labels" "github.com/argoproj/argo/util/logs" "github.com/argoproj/argo/workflow/common" "github.com/argoproj/argo/workflow/packer" @@ -35,21 +36,6 @@ func NewWorkflowServer(instanceID string, offloadNodeStatusRepo sqldb.OffloadNod } } -func (s *workflowServer) setInstanceID(instanceID string, wf *v1alpha1.Workflow) { - if instanceID != "" || s.instanceID != "" { - labels := wf.GetLabels() - if labels == nil { - labels = make(map[string]string) - } - if instanceID != "" { - labels[common.LabelKeyControllerInstanceID] = instanceID - } else { - labels[common.LabelKeyControllerInstanceID] = s.instanceID - } - wf.SetLabels(labels) - } -} - func (s *workflowServer) CreateWorkflow(ctx context.Context, req *workflowpkg.WorkflowCreateRequest) (*v1alpha1.Workflow, error) { wfClient := auth.GetWfClient(ctx) @@ -61,7 +47,7 @@ func (s *workflowServer) CreateWorkflow(ctx context.Context, req *workflowpkg.Wo req.Workflow.Namespace = req.Namespace } - s.setInstanceID(req.InstanceID, req.Workflow) + labels.SetInstanceID(req.Workflow, s.instanceID) wftmplGetter := templateresolution.WrapWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().WorkflowTemplates(req.Namespace)) cwftmplGetter := templateresolution.WrapClusterWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().ClusterWorkflowTemplates()) diff --git a/server/workflowtemplate/workflow_template_server.go b/server/workflowtemplate/workflow_template_server.go index 6fc2b8ab952a..d1259f4dc5b6 100644 --- a/server/workflowtemplate/workflow_template_server.go +++ b/server/workflowtemplate/workflow_template_server.go @@ -10,15 +10,17 @@ import ( workflowtemplatepkg "github.com/argoproj/argo/pkg/apiclient/workflowtemplate" "github.com/argoproj/argo/pkg/apis/workflow/v1alpha1" "github.com/argoproj/argo/server/auth" + "github.com/argoproj/argo/util/labels" "github.com/argoproj/argo/workflow/templateresolution" "github.com/argoproj/argo/workflow/validate" ) type WorkflowTemplateServer struct { + instanceID string } -func NewWorkflowTemplateServer() workflowtemplatepkg.WorkflowTemplateServiceServer { - return &WorkflowTemplateServer{} +func NewWorkflowTemplateServer(instanceID string) workflowtemplatepkg.WorkflowTemplateServiceServer { + return &WorkflowTemplateServer{instanceID} } func (wts *WorkflowTemplateServer) CreateWorkflowTemplate(ctx context.Context, req *workflowtemplatepkg.WorkflowTemplateCreateRequest) (*v1alpha1.WorkflowTemplate, error) { @@ -26,6 +28,7 @@ func (wts *WorkflowTemplateServer) CreateWorkflowTemplate(ctx context.Context, r if req.Template == nil { return nil, fmt.Errorf("workflow template was not found in the request body") } + labels.SetInstanceID(req.Template, wts.instanceID) wftmplGetter := templateresolution.WrapWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().WorkflowTemplates(req.Namespace)) cwftmplGetter := templateresolution.WrapClusterWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().ClusterWorkflowTemplates()) diff --git a/server/workflowtemplate/workflow_template_server_test.go b/server/workflowtemplate/workflow_template_server_test.go index ba2e2089138c..3fff85ca36f8 100644 --- a/server/workflowtemplate/workflow_template_server_test.go +++ b/server/workflowtemplate/workflow_template_server_test.go @@ -151,7 +151,7 @@ func getWorkflowTemplateServer() (workflowtemplatepkg.WorkflowTemplateServiceSer kubeClientSet := fake.NewSimpleClientset() wfClientset := wftFake.NewSimpleClientset(&wftObj1, &wftObj2) ctx := context.WithValue(context.WithValue(context.TODO(), auth.WfKey, wfClientset), auth.KubeKey, kubeClientSet) - return NewWorkflowTemplateServer(), ctx + return NewWorkflowTemplateServer(""), ctx } func TestWorkflowTemplateServer_CreateWorkflowTemplate(t *testing.T) { diff --git a/util/labels/labeler.go b/util/labels/labeler.go new file mode 100644 index 000000000000..d61d4f5ae67d --- /dev/null +++ b/util/labels/labeler.go @@ -0,0 +1,27 @@ +package labels + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/argoproj/argo/workflow/common" +) + +func SetInstanceID(obj metav1.Object, instanceID string) { + Label(obj, common.LabelKeyControllerInstanceID, instanceID) +} + +// label the object with the first non-empty value, if all value are empty, it is not set at all +func Label(obj metav1.Object, name string, values ...string) { + for _, value := range values { + if value == "" { + continue + } + labels := obj.GetLabels() + if labels == nil { + labels = map[string]string{} + } + labels[name] = value + obj.SetLabels(labels) + return + } +} diff --git a/util/labels/labeler_test.go b/util/labels/labeler_test.go new file mode 100644 index 000000000000..5b60dcd92e60 --- /dev/null +++ b/util/labels/labeler_test.go @@ -0,0 +1,29 @@ +package labels + +import ( + "testing" + + "github.com/stretchr/testify/assert" + + wfv1 "github.com/argoproj/argo/pkg/apis/workflow/v1alpha1" +) + +func TestLabel(t *testing.T) { + t.Run("Empty", func(t *testing.T) { + obj := &wfv1.Workflow{} + Label(obj, "foo") + assert.Empty(t, obj.Labels) + }) + t.Run("One", func(t *testing.T) { + obj := &wfv1.Workflow{} + Label(obj, "foo", "bar") + assert.Len(t, obj.Labels, 1) + assert.Equal(t, "bar", obj.Labels["foo"]) + }) + t.Run("Two", func(t *testing.T) { + obj := &wfv1.Workflow{} + Label(obj, "foo", "bar", "baz") + assert.Len(t, obj.Labels, 1) + assert.Equal(t, "bar", obj.Labels["foo"]) + }) +} diff --git a/workflow/util/util.go b/workflow/util/util.go index f1e41b0973e0..546f49a1ac5a 100644 --- a/workflow/util/util.go +++ b/workflow/util/util.go @@ -217,9 +217,6 @@ func ApplySubmitOpts(wf *wfv1.Workflow, opts *wfv1.SubmitOpts) error { labels[k] = v } } - if opts.InstanceID != "" { - labels[common.LabelKeyControllerInstanceID] = opts.InstanceID - } wf.SetLabels(labels) if len(opts.Parameters) > 0 || opts.ParameterFile != "" { newParams := make([]wfv1.Parameter, 0) From c6aa68cb32e46bf93e27fef9d59d808a17e9e2ec Mon Sep 17 00:00:00 2001 From: Alex Collins Date: Wed, 22 Apr 2020 12:26:29 -0700 Subject: [PATCH 02/15] changes --- server/apiserver/argoserver.go | 2 +- server/artifacts/artifact_server.go | 14 +++- .../cluster_workflow_template_server.go | 40 +++++++--- server/cronworkflow/cron_workflow_server.go | 54 +++---------- server/workflow/workflow_server.go | 75 +++++++------------ .../workflow_template_server.go | 4 +- util/instanceid/instanceid.go | 39 ++++++++++ util/instanceid/instanceid_test.go | 48 ++++++++++++ util/labels/labeler.go | 6 -- 9 files changed, 165 insertions(+), 117 deletions(-) create mode 100644 util/instanceid/instanceid.go create mode 100644 util/instanceid/instanceid_test.go diff --git a/server/apiserver/argoserver.go b/server/apiserver/argoserver.go index cc9b3d8e7e1c..33930e665955 100644 --- a/server/apiserver/argoserver.go +++ b/server/apiserver/argoserver.go @@ -131,7 +131,7 @@ func (as *argoServer) Run(ctx context.Context, port int, browserOpenFunc func(st // disable the archiving - and still read old records wfArchive = sqldb.NewWorkflowArchive(session, persistence.GetClusterName(), configMap.InstanceID) } - artifactServer := artifacts.NewArtifactServer(as.authenticator, offloadRepo, wfArchive) + artifactServer := artifacts.NewArtifactServer(as.authenticator, offloadRepo, wfArchive, configMap.InstanceID) grpcServer := as.newGRPCServer(configMap.InstanceID, offloadRepo, wfArchive, configMap.Links) httpServer := as.newHTTPServer(ctx, port, artifactServer) diff --git a/server/artifacts/artifact_server.go b/server/artifacts/artifact_server.go index af787fcf712d..c1fe2cf0ab2e 100644 --- a/server/artifacts/artifact_server.go +++ b/server/artifacts/artifact_server.go @@ -17,6 +17,7 @@ import ( "github.com/argoproj/argo/persist/sqldb" wfv1 "github.com/argoproj/argo/pkg/apis/workflow/v1alpha1" "github.com/argoproj/argo/server/auth" + "github.com/argoproj/argo/util/instanceid" artifact "github.com/argoproj/argo/workflow/artifacts" "github.com/argoproj/argo/workflow/packer" ) @@ -25,10 +26,11 @@ type ArtifactServer struct { authN auth.Gatekeeper offloadNodeStatusRepo sqldb.OffloadNodeStatusRepo wfArchive sqldb.WorkflowArchive + instanceID string } -func NewArtifactServer(authN auth.Gatekeeper, offloadNodeStatusRepo sqldb.OffloadNodeStatusRepo, wfArchive sqldb.WorkflowArchive) *ArtifactServer { - return &ArtifactServer{authN, offloadNodeStatusRepo, wfArchive} +func NewArtifactServer(authN auth.Gatekeeper, offloadNodeStatusRepo sqldb.OffloadNodeStatusRepo, wfArchive sqldb.WorkflowArchive, instanceID string) *ArtifactServer { + return &ArtifactServer{authN, offloadNodeStatusRepo, wfArchive, instanceID} } func (a *ArtifactServer) GetArtifact(w http.ResponseWriter, r *http.Request) { @@ -48,7 +50,7 @@ func (a *ArtifactServer) GetArtifact(w http.ResponseWriter, r *http.Request) { log.WithFields(log.Fields{"namespace": namespace, "workflowName": workflowName, "nodeId": nodeId, "artifactName": artifactName}).Info("Download artifact") - wf, err := a.getWorkflow(ctx, namespace, workflowName) + wf, err := a.getWorkflowAndValidate(ctx, namespace, workflowName) if err != nil { a.serverInternalError(err, w) return @@ -158,12 +160,16 @@ func (a *ArtifactServer) getArtifact(ctx context.Context, wf *wfv1.Workflow, nod return file, nil } -func (a *ArtifactServer) getWorkflow(ctx context.Context, namespace string, workflowName string) (*wfv1.Workflow, error) { +func (a *ArtifactServer) getWorkflowAndValidate(ctx context.Context, namespace string, workflowName string) (*wfv1.Workflow, error) { wfClient := auth.GetWfClient(ctx) wf, err := wfClient.ArgoprojV1alpha1().Workflows(namespace).Get(workflowName, metav1.GetOptions{}) if err != nil { return nil, err } + err = instanceid.Validate(wf, a.instanceID) + if err != nil { + return nil, err + } err = packer.DecompressWorkflow(wf) if err != nil { return nil, err diff --git a/server/clusterworkflowtemplate/cluster_workflow_template_server.go b/server/clusterworkflowtemplate/cluster_workflow_template_server.go index 54e06ceeef15..e9a245b2567d 100644 --- a/server/clusterworkflowtemplate/cluster_workflow_template_server.go +++ b/server/clusterworkflowtemplate/cluster_workflow_template_server.go @@ -10,7 +10,7 @@ import ( clusterwftmplpkg "github.com/argoproj/argo/pkg/apiclient/clusterworkflowtemplate" "github.com/argoproj/argo/pkg/apis/workflow/v1alpha1" "github.com/argoproj/argo/server/auth" - "github.com/argoproj/argo/util/labels" + "github.com/argoproj/argo/util/instanceid" "github.com/argoproj/argo/workflow/templateresolution" "github.com/argoproj/argo/workflow/validate" ) @@ -29,7 +29,7 @@ func (cwts *ClusterWorkflowTemplateServer) CreateClusterWorkflowTemplate(ctx con return nil, fmt.Errorf("cluster workflow template was not found in the request body") } - labels.SetInstanceID(req.Template, cwts.instanceID) + instanceid.Label(req.Template, cwts.instanceID) cwftmplGetter := templateresolution.WrapClusterWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().ClusterWorkflowTemplates()) @@ -43,15 +43,24 @@ func (cwts *ClusterWorkflowTemplateServer) CreateClusterWorkflowTemplate(ctx con } func (cwts *ClusterWorkflowTemplateServer) GetClusterWorkflowTemplate(ctx context.Context, req *clusterwftmplpkg.ClusterWorkflowTemplateGetRequest) (*v1alpha1.ClusterWorkflowTemplate, error) { - wfClient := auth.GetWfClient(ctx) - - wfTmpl, err := wfClient.ArgoprojV1alpha1().ClusterWorkflowTemplates().Get(req.Name, v1.GetOptions{}) - + wfTmpl, err := cwts.getTemplateAndValidate(ctx, req.Name) if err != nil { return nil, err } + return wfTmpl, nil +} - return wfTmpl, err +func (cwts *ClusterWorkflowTemplateServer) getTemplateAndValidate(ctx context.Context, name string) (*v1alpha1.ClusterWorkflowTemplate, error) { + wfClient := auth.GetWfClient(ctx) + wfTmpl, err := wfClient.ArgoprojV1alpha1().ClusterWorkflowTemplates().Get(name, v1.GetOptions{}) + if err != nil { + return nil, err + } + err = instanceid.Validate(wfTmpl, cwts.instanceID) + if err != nil { + return nil, err + } + return wfTmpl, nil } func (cwts *ClusterWorkflowTemplateServer) ListClusterWorkflowTemplates(ctx context.Context, req *clusterwftmplpkg.ClusterWorkflowTemplateListRequest) (*v1alpha1.ClusterWorkflowTemplateList, error) { @@ -60,7 +69,7 @@ func (cwts *ClusterWorkflowTemplateServer) ListClusterWorkflowTemplates(ctx cont if req.ListOptions != nil { options = *req.ListOptions } - cwfList, err := wfClient.ArgoprojV1alpha1().ClusterWorkflowTemplates().List(options) + cwfList, err := wfClient.ArgoprojV1alpha1().ClusterWorkflowTemplates().List(instanceid.With(options, cwts.instanceID)) if err != nil { return nil, err } @@ -72,8 +81,11 @@ func (cwts *ClusterWorkflowTemplateServer) ListClusterWorkflowTemplates(ctx cont func (cwts *ClusterWorkflowTemplateServer) DeleteClusterWorkflowTemplate(ctx context.Context, req *clusterwftmplpkg.ClusterWorkflowTemplateDeleteRequest) (*clusterwftmplpkg.ClusterWorkflowTemplateDeleteResponse, error) { wfClient := auth.GetWfClient(ctx) - - err := wfClient.ArgoprojV1alpha1().ClusterWorkflowTemplates().Delete(req.Name, &v1.DeleteOptions{}) + _, err := cwts.getTemplateAndValidate(ctx, req.Name) + if err != nil { + return nil, err + } + err = wfClient.ArgoprojV1alpha1().ClusterWorkflowTemplates().Delete(req.Name, &v1.DeleteOptions{}) if err != nil { return nil, err } @@ -82,8 +94,8 @@ func (cwts *ClusterWorkflowTemplateServer) DeleteClusterWorkflowTemplate(ctx con } func (cwts *ClusterWorkflowTemplateServer) LintClusterWorkflowTemplate(ctx context.Context, req *clusterwftmplpkg.ClusterWorkflowTemplateLintRequest) (*v1alpha1.ClusterWorkflowTemplate, error) { + instanceid.Label(req.Template, cwts.instanceID) wfClient := auth.GetWfClient(ctx) - cwftmplGetter := templateresolution.WrapClusterWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().ClusterWorkflowTemplates()) _, err := validate.ValidateClusterWorkflowTemplate(nil, cwftmplGetter, req.Template) @@ -98,10 +110,14 @@ func (cwts *ClusterWorkflowTemplateServer) UpdateClusterWorkflowTemplate(ctx con if req.Template == nil { return nil, fmt.Errorf("ClusterWorkflowTemplate is not found in Request body") } + err := instanceid.Validate(req.Template, cwts.instanceID) + if err != nil { + return nil, err + } wfClient := auth.GetWfClient(ctx) cwftmplGetter := templateresolution.WrapClusterWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().ClusterWorkflowTemplates()) - _, err := validate.ValidateClusterWorkflowTemplate(nil, cwftmplGetter, req.Template) + _, err = validate.ValidateClusterWorkflowTemplate(nil, cwftmplGetter, req.Template) if err != nil { return nil, err } diff --git a/server/cronworkflow/cron_workflow_server.go b/server/cronworkflow/cron_workflow_server.go index 03f37e55bd5f..6c0deb6aef74 100644 --- a/server/cronworkflow/cron_workflow_server.go +++ b/server/cronworkflow/cron_workflow_server.go @@ -9,8 +9,7 @@ import ( cronworkflowpkg "github.com/argoproj/argo/pkg/apiclient/cronworkflow" "github.com/argoproj/argo/pkg/apis/workflow/v1alpha1" "github.com/argoproj/argo/server/auth" - "github.com/argoproj/argo/util/labels" - "github.com/argoproj/argo/workflow/common" + "github.com/argoproj/argo/util/instanceid" "github.com/argoproj/argo/workflow/templateresolution" "github.com/argoproj/argo/workflow/validate" ) @@ -28,6 +27,7 @@ func (c *cronWorkflowServiceServer) LintCronWorkflow(ctx context.Context, req *c wfClient := auth.GetWfClient(ctx) wftmplGetter := templateresolution.WrapWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().WorkflowTemplates(req.Namespace)) cwftmplGetter := templateresolution.WrapClusterWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().ClusterWorkflowTemplates()) + instanceid.Label(req.CronWorkflow, c.instanceID) err := validate.ValidateCronWorkflow(wftmplGetter, cwftmplGetter, req.CronWorkflow) if err != nil { return nil, err @@ -40,8 +40,7 @@ func (c *cronWorkflowServiceServer) ListCronWorkflows(ctx context.Context, req * if req.ListOptions != nil { options = *req.ListOptions } - optsWithInstanceId := c.withInstanceID(options) - return auth.GetWfClient(ctx).ArgoprojV1alpha1().CronWorkflows(req.Namespace).List(optsWithInstanceId) + return auth.GetWfClient(ctx).ArgoprojV1alpha1().CronWorkflows(req.Namespace).List(instanceid.With(options, c.instanceID)) } func (c *cronWorkflowServiceServer) CreateCronWorkflow(ctx context.Context, req *cronworkflowpkg.CreateCronWorkflowRequest) (*v1alpha1.CronWorkflow, error) { @@ -49,6 +48,7 @@ func (c *cronWorkflowServiceServer) CreateCronWorkflow(ctx context.Context, req if req.CronWorkflow == nil { return nil, fmt.Errorf("cron workflow was not found in the request body") } + instanceid.Label(req.CronWorkflow, c.instanceID) wftmplGetter := templateresolution.WrapWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().WorkflowTemplates(req.Namespace)) cwftmplGetter := templateresolution.WrapClusterWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().ClusterWorkflowTemplates()) @@ -58,8 +58,6 @@ func (c *cronWorkflowServiceServer) CreateCronWorkflow(ctx context.Context, req return nil, err } - labels.SetInstanceID(req.CronWorkflow, c.instanceID) - return wfClient.ArgoprojV1alpha1().CronWorkflows(req.Namespace).Create(req.CronWorkflow) } @@ -68,11 +66,11 @@ func (c *cronWorkflowServiceServer) GetCronWorkflow(ctx context.Context, req *cr if req.GetOptions != nil { options = *req.GetOptions } - return c.getCronWorkflow(ctx, req.Namespace, req.Name, options) + return c.getCronWorkflowAndValidate(ctx, req.Namespace, req.Name, options) } func (c *cronWorkflowServiceServer) UpdateCronWorkflow(ctx context.Context, req *cronworkflowpkg.UpdateCronWorkflowRequest) (*v1alpha1.CronWorkflow, error) { - _, err := c.getCronWorkflow(ctx, req.Namespace, req.Name, metav1.GetOptions{}) + _, err := c.getCronWorkflowAndValidate(ctx, req.Namespace, req.Name, metav1.GetOptions{}) if err != nil { return nil, err } @@ -80,7 +78,7 @@ func (c *cronWorkflowServiceServer) UpdateCronWorkflow(ctx context.Context, req } func (c *cronWorkflowServiceServer) DeleteCronWorkflow(ctx context.Context, req *cronworkflowpkg.DeleteCronWorkflowRequest) (*cronworkflowpkg.CronWorkflowDeletedResponse, error) { - _, err := c.getCronWorkflow(ctx, req.Namespace, req.Name, metav1.GetOptions{}) + _, err := c.getCronWorkflowAndValidate(ctx, req.Namespace, req.Name, metav1.GetOptions{}) if err != nil { return nil, err } @@ -91,45 +89,15 @@ func (c *cronWorkflowServiceServer) DeleteCronWorkflow(ctx context.Context, req return &cronworkflowpkg.CronWorkflowDeletedResponse{}, nil } -func (c *cronWorkflowServiceServer) withInstanceID(opt metav1.ListOptions) metav1.ListOptions { - if len(opt.LabelSelector) > 0 { - opt.LabelSelector += "," - } - if len(c.instanceID) == 0 { - opt.LabelSelector += fmt.Sprintf("!%s", common.LabelKeyControllerInstanceID) - return opt - } - opt.LabelSelector += fmt.Sprintf("%s=%s", common.LabelKeyControllerInstanceID, c.instanceID) - return opt -} - -func (c *cronWorkflowServiceServer) getCronWorkflow(ctx context.Context, namespace string, name string, options metav1.GetOptions) (*v1alpha1.CronWorkflow, error) { +func (c *cronWorkflowServiceServer) getCronWorkflowAndValidate(ctx context.Context, namespace string, name string, options metav1.GetOptions) (*v1alpha1.CronWorkflow, error) { wfClient := auth.GetWfClient(ctx) cronWf, err := wfClient.ArgoprojV1alpha1().CronWorkflows(namespace).Get(name, options) if err != nil { return nil, err } - ok := c.validateInstanceID(cronWf) - if !ok { - return nil, fmt.Errorf("CronWorkflow '%s' is not managed by the current Argo server", cronWf.Name) + err = instanceid.Validate(cronWf, c.instanceID) + if err != nil { + return nil, err } return cronWf, nil } - -func (c *cronWorkflowServiceServer) validateInstanceID(cronWf *v1alpha1.CronWorkflow) bool { - if len(c.instanceID) == 0 { - if len(cronWf.Labels) == 0 { - return true - } - if _, ok := cronWf.Labels[common.LabelKeyControllerInstanceID]; !ok { - return true - } - } else if len(cronWf.Labels) > 0 { - if val, ok := cronWf.Labels[common.LabelKeyControllerInstanceID]; ok { - if val == c.instanceID { - return true - } - } - } - return false -} diff --git a/server/workflow/workflow_server.go b/server/workflow/workflow_server.go index 8f8b3c6ea770..2894a5d18087 100644 --- a/server/workflow/workflow_server.go +++ b/server/workflow/workflow_server.go @@ -14,7 +14,7 @@ import ( "github.com/argoproj/argo/pkg/apis/workflow" "github.com/argoproj/argo/pkg/apis/workflow/v1alpha1" "github.com/argoproj/argo/server/auth" - "github.com/argoproj/argo/util/labels" + "github.com/argoproj/argo/util/instanceid" "github.com/argoproj/argo/util/logs" "github.com/argoproj/argo/workflow/common" "github.com/argoproj/argo/workflow/packer" @@ -47,7 +47,7 @@ func (s *workflowServer) CreateWorkflow(ctx context.Context, req *workflowpkg.Wo req.Workflow.Namespace = req.Namespace } - labels.SetInstanceID(req.Workflow, s.instanceID) + instanceid.Label(req.Workflow, s.instanceID) wftmplGetter := templateresolution.WrapWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().WorkflowTemplates(req.Namespace)) cwftmplGetter := templateresolution.WrapClusterWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().ClusterWorkflowTemplates()) @@ -81,7 +81,7 @@ func (s *workflowServer) GetWorkflow(ctx context.Context, req *workflowpkg.Workf if req.GetOptions != nil { wfGetOption = *req.GetOptions } - wf, err := s.getWorkflow(ctx, req.Namespace, req.Name, wfGetOption) + wf, err := s.getWorkflowAndValidate(ctx, req.Namespace, req.Name, wfGetOption) if err != nil { return nil, err } @@ -112,7 +112,7 @@ func (s *workflowServer) ListWorkflows(ctx context.Context, req *workflowpkg.Wor listOption = *req.ListOptions } - wfList, err := wfClient.ArgoprojV1alpha1().Workflows(req.Namespace).List(s.withInstanceID(listOption)) + wfList, err := wfClient.ArgoprojV1alpha1().Workflows(req.Namespace).List(instanceid.With(listOption, s.instanceID)) if err != nil { return nil, err } @@ -141,7 +141,7 @@ func (s *workflowServer) WatchWorkflows(req *workflowpkg.WatchWorkflowsRequest, if req.ListOptions != nil { opts = *req.ListOptions } - watch, err := wfClient.ArgoprojV1alpha1().Workflows(req.Namespace).Watch(s.withInstanceID(opts)) + watch, err := wfClient.ArgoprojV1alpha1().Workflows(req.Namespace).Watch(instanceid.With(opts, s.instanceID)) if err != nil { return err } @@ -191,11 +191,10 @@ func (s *workflowServer) WatchWorkflows(req *workflowpkg.WatchWorkflowsRequest, } func (s *workflowServer) DeleteWorkflow(ctx context.Context, req *workflowpkg.WorkflowDeleteRequest) (*workflowpkg.WorkflowDeleteResponse, error) { - _, err := s.getWorkflow(ctx, req.Namespace, req.Name, metav1.GetOptions{}) + _, err := s.getWorkflowAndValidate(ctx, req.Namespace, req.Name, metav1.GetOptions{}) if err != nil { return nil, err } - err = auth.GetWfClient(ctx).ArgoprojV1alpha1().Workflows(req.Namespace).Delete(req.Name, &metav1.DeleteOptions{}) if err != nil { return nil, err @@ -207,7 +206,7 @@ func (s *workflowServer) RetryWorkflow(ctx context.Context, req *workflowpkg.Wor wfClient := auth.GetWfClient(ctx) kubeClient := auth.GetKubeClient(ctx) - wf, err := s.getWorkflow(ctx, req.Namespace, req.Name, metav1.GetOptions{}) + wf, err := s.getWorkflowAndValidate(ctx, req.Namespace, req.Name, metav1.GetOptions{}) if err != nil { return nil, err } @@ -221,7 +220,7 @@ func (s *workflowServer) RetryWorkflow(ctx context.Context, req *workflowpkg.Wor func (s *workflowServer) ResubmitWorkflow(ctx context.Context, req *workflowpkg.WorkflowResubmitRequest) (*v1alpha1.Workflow, error) { wfClient := auth.GetWfClient(ctx) - wf, err := s.getWorkflow(ctx, req.Namespace, req.Name, metav1.GetOptions{}) + wf, err := s.getWorkflowAndValidate(ctx, req.Namespace, req.Name, metav1.GetOptions{}) if err != nil { return nil, err } @@ -240,8 +239,7 @@ func (s *workflowServer) ResubmitWorkflow(ctx context.Context, req *workflowpkg. func (s *workflowServer) ResumeWorkflow(ctx context.Context, req *workflowpkg.WorkflowResumeRequest) (*v1alpha1.Workflow, error) { wfClient := auth.GetWfClient(ctx) - - _, err := s.getWorkflow(ctx, req.Namespace, req.Name, metav1.GetOptions{}) + _, err := s.getWorkflowAndValidate(ctx, req.Namespace, req.Name, metav1.GetOptions{}) if err != nil { return nil, err } @@ -263,7 +261,7 @@ func (s *workflowServer) ResumeWorkflow(ctx context.Context, req *workflowpkg.Wo func (s *workflowServer) SuspendWorkflow(ctx context.Context, req *workflowpkg.WorkflowSuspendRequest) (*v1alpha1.Workflow, error) { wfClient := auth.GetWfClient(ctx) - _, err := s.getWorkflow(ctx, req.Namespace, req.Name, metav1.GetOptions{}) + _, err := s.getWorkflowAndValidate(ctx, req.Namespace, req.Name, metav1.GetOptions{}) if err != nil { return nil, err } @@ -284,7 +282,7 @@ func (s *workflowServer) SuspendWorkflow(ctx context.Context, req *workflowpkg.W func (s *workflowServer) TerminateWorkflow(ctx context.Context, req *workflowpkg.WorkflowTerminateRequest) (*v1alpha1.Workflow, error) { wfClient := auth.GetWfClient(ctx) - _, err := s.getWorkflow(ctx, req.Namespace, req.Name, metav1.GetOptions{}) + _, err := s.getWorkflowAndValidate(ctx, req.Namespace, req.Name, metav1.GetOptions{}) if err != nil { return nil, err } @@ -303,7 +301,11 @@ func (s *workflowServer) TerminateWorkflow(ctx context.Context, req *workflowpkg func (s *workflowServer) StopWorkflow(ctx context.Context, req *workflowpkg.WorkflowStopRequest) (*v1alpha1.Workflow, error) { wfClient := auth.GetWfClient(ctx) - err := util.StopWorkflow(wfClient.ArgoprojV1alpha1().Workflows(req.Namespace), req.Name, req.NodeFieldSelector, req.Message) + _, err := s.getWorkflowAndValidate(ctx, req.Namespace, req.Name, metav1.GetOptions{}) + if err != nil { + return nil, err + } + err = util.StopWorkflow(wfClient.ArgoprojV1alpha1().Workflows(req.Namespace), req.Name, req.NodeFieldSelector, req.Message) if err != nil { return nil, err } @@ -317,9 +319,9 @@ func (s *workflowServer) StopWorkflow(ctx context.Context, req *workflowpkg.Work func (s *workflowServer) LintWorkflow(ctx context.Context, req *workflowpkg.WorkflowLintRequest) (*v1alpha1.Workflow, error) { wfClient := auth.GetWfClient(ctx) - wftmplGetter := templateresolution.WrapWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().WorkflowTemplates(req.Namespace)) cwftmplGetter := templateresolution.WrapClusterWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().ClusterWorkflowTemplates()) + instanceid.Label(req.Workflow, s.instanceID) _, err := validate.ValidateWorkflow(wftmplGetter, cwftmplGetter, req.Workflow, validate.ValidateOpts{Lint: true}) @@ -334,52 +336,26 @@ func (s *workflowServer) PodLogs(req *workflowpkg.WorkflowLogRequest, ws workflo ctx := ws.Context() wfClient := auth.GetWfClient(ctx) kubeClient := auth.GetKubeClient(ctx) - return logs.WorkflowLogs(ctx, wfClient, kubeClient, req, ws) -} - -func (s *workflowServer) withInstanceID(opt metav1.ListOptions) metav1.ListOptions { - if len(opt.LabelSelector) > 0 { - opt.LabelSelector += "," - } - if len(s.instanceID) == 0 { - opt.LabelSelector += fmt.Sprintf("!%s", common.LabelKeyControllerInstanceID) - return opt + _, err := s.getWorkflowAndValidate(ctx, req.Namespace, req.Name, metav1.GetOptions{}) + if err != nil { + return err } - opt.LabelSelector += fmt.Sprintf("%s=%s", common.LabelKeyControllerInstanceID, s.instanceID) - return opt + return logs.WorkflowLogs(ctx, wfClient, kubeClient, req, ws) } -func (s *workflowServer) getWorkflow(ctx context.Context, namespace string, name string, options metav1.GetOptions) (*v1alpha1.Workflow, error) { +func (s *workflowServer) getWorkflowAndValidate(ctx context.Context, namespace string, name string, options metav1.GetOptions) (*v1alpha1.Workflow, error) { wfClient := auth.GetWfClient(ctx) wf, err := wfClient.ArgoprojV1alpha1().Workflows(namespace).Get(name, options) if err != nil { return nil, err } - ok := s.validateInstanceID(wf) - if !ok { - return nil, fmt.Errorf("Workflow '%s' is not managed by the current Argo server", wf.Name) + err = instanceid.Validate(wf, s.instanceID) + if err != nil { + return nil, err } return wf, nil } -func (s *workflowServer) validateInstanceID(wf *v1alpha1.Workflow) bool { - if len(s.instanceID) == 0 { - if len(wf.Labels) == 0 { - return true - } - if _, ok := wf.Labels[common.LabelKeyControllerInstanceID]; !ok { - return true - } - } else if len(wf.Labels) > 0 { - if val, ok := wf.Labels[common.LabelKeyControllerInstanceID]; ok { - if val == s.instanceID { - return true - } - } - } - return false -} - func (s *workflowServer) SubmitWorkflow(ctx context.Context, req *workflowpkg.WorkflowSubmitRequest) (*v1alpha1.Workflow, error) { wfClient := auth.GetWfClient(ctx) var wf *v1alpha1.Workflow @@ -408,6 +384,7 @@ func (s *workflowServer) SubmitWorkflow(ctx context.Context, req *workflowpkg.Wo } + instanceid.Label(wf, s.instanceID) err := util.ApplySubmitOpts(wf, req.SubmitOptions) if err != nil { return nil, err diff --git a/server/workflowtemplate/workflow_template_server.go b/server/workflowtemplate/workflow_template_server.go index d1259f4dc5b6..412f0e68dade 100644 --- a/server/workflowtemplate/workflow_template_server.go +++ b/server/workflowtemplate/workflow_template_server.go @@ -10,7 +10,7 @@ import ( workflowtemplatepkg "github.com/argoproj/argo/pkg/apiclient/workflowtemplate" "github.com/argoproj/argo/pkg/apis/workflow/v1alpha1" "github.com/argoproj/argo/server/auth" - "github.com/argoproj/argo/util/labels" + "github.com/argoproj/argo/util/instanceid" "github.com/argoproj/argo/workflow/templateresolution" "github.com/argoproj/argo/workflow/validate" ) @@ -28,7 +28,7 @@ func (wts *WorkflowTemplateServer) CreateWorkflowTemplate(ctx context.Context, r if req.Template == nil { return nil, fmt.Errorf("workflow template was not found in the request body") } - labels.SetInstanceID(req.Template, wts.instanceID) + instanceid.Label(req.Template, wts.instanceID) wftmplGetter := templateresolution.WrapWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().WorkflowTemplates(req.Namespace)) cwftmplGetter := templateresolution.WrapClusterWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().ClusterWorkflowTemplates()) diff --git a/util/instanceid/instanceid.go b/util/instanceid/instanceid.go new file mode 100644 index 000000000000..c56b57305196 --- /dev/null +++ b/util/instanceid/instanceid.go @@ -0,0 +1,39 @@ +package instanceid + +import ( + "fmt" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/argoproj/argo/util/labels" + "github.com/argoproj/argo/workflow/common" +) + +func Label(obj metav1.Object, instanceID string) { + labels.Label(obj, common.LabelKeyControllerInstanceID, instanceID) +} + +func With(opts metav1.ListOptions, instanceID string) metav1.ListOptions { + if len(opts.LabelSelector) > 0 { + opts.LabelSelector += "," + } + if instanceID == "" { + opts.LabelSelector += fmt.Sprintf("!%s", common.LabelKeyControllerInstanceID) + } else { + opts.LabelSelector += fmt.Sprintf("%s=%s", common.LabelKeyControllerInstanceID, instanceID) + } + return opts +} + +func Validate(obj metav1.Object, instanceID string) error { + l := obj.GetLabels() + if instanceID == "" { + if _, ok := l[common.LabelKeyControllerInstanceID]; !ok { + return nil + } + } else if val, ok := l[common.LabelKeyControllerInstanceID]; ok && val == instanceID { + return nil + + } + return fmt.Errorf("'%s' is not managed by the current Argo Server", obj.GetName()) +} diff --git a/util/instanceid/instanceid_test.go b/util/instanceid/instanceid_test.go new file mode 100644 index 000000000000..afa9206ffe0b --- /dev/null +++ b/util/instanceid/instanceid_test.go @@ -0,0 +1,48 @@ +package instanceid + +import ( + "testing" + + "github.com/stretchr/testify/assert" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + wfv1 "github.com/argoproj/argo/pkg/apis/workflow/v1alpha1" + "github.com/argoproj/argo/workflow/common" +) + +func TestLabel(t *testing.T) { + t.Run("Empty", func(t *testing.T) { + obj := &wfv1.Workflow{} + Label(obj, "") + assert.Empty(t, obj.GetLabels()) + }) + t.Run("One", func(t *testing.T) { + obj := &wfv1.Workflow{} + Label(obj, "foo") + assert.Len(t, obj.GetLabels(), 1) + assert.Equal(t, "foo", obj.GetLabels()[common.LabelKeyControllerInstanceID]) + }) +} + +func TestWith(t *testing.T) { + t.Run("Empty", func(t *testing.T) { + with := With(metav1.ListOptions{}, "") + assert.Equal(t, "!workflows.argoproj.io/controller-instanceid", with.LabelSelector) + }) + t.Run("ExistingSelector", func(t *testing.T) { + with := With(metav1.ListOptions{LabelSelector: "foo"}, "") + assert.Equal(t, "foo,!workflows.argoproj.io/controller-instanceid", with.LabelSelector) + }) +} + +func TestValidate(t *testing.T) { + t.Run("NoInstanceID", func(t *testing.T) { + assert.NoError(t, Validate(&wfv1.Workflow{}, "")) + assert.Error(t, Validate(&wfv1.Workflow{ObjectMeta: metav1.ObjectMeta{Labels: map[string]string{common.LabelKeyControllerInstanceID: "bar"}}}, "")) + }) + t.Run("InstanceID", func(t *testing.T) { + assert.Error(t, Validate(&wfv1.Workflow{}, "foo")) + assert.Error(t, Validate(&wfv1.Workflow{ObjectMeta: metav1.ObjectMeta{Labels: map[string]string{common.LabelKeyControllerInstanceID: "bar"}}}, "foo")) + assert.NoError(t, Validate(&wfv1.Workflow{ObjectMeta: metav1.ObjectMeta{Labels: map[string]string{common.LabelKeyControllerInstanceID: "foo"}}}, "foo")) + }) +} diff --git a/util/labels/labeler.go b/util/labels/labeler.go index d61d4f5ae67d..17652b967961 100644 --- a/util/labels/labeler.go +++ b/util/labels/labeler.go @@ -2,14 +2,8 @@ package labels import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - "github.com/argoproj/argo/workflow/common" ) -func SetInstanceID(obj metav1.Object, instanceID string) { - Label(obj, common.LabelKeyControllerInstanceID, instanceID) -} - // label the object with the first non-empty value, if all value are empty, it is not set at all func Label(obj metav1.Object, name string, values ...string) { for _, value := range values { From 7729d785e5638ef6ad90ba82526d6393c40c27fe Mon Sep 17 00:00:00 2001 From: Alex Collins Date: Wed, 22 Apr 2020 19:58:48 -0700 Subject: [PATCH 03/15] sonar-project.properties --- sonar-project.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sonar-project.properties b/sonar-project.properties index 91323c73fd9d..b346db54437f 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -3,6 +3,6 @@ sonar.organization=argoproj sonar.projectName=Argo Workflows sonar.projectVersion=2.x sonar.host.url=https://sonarcloud.io -sonar.exclusions=**/*.pb*.go,**/*generated*.go,,**/*_test.go,**/mocks/*,,**/vendor/**,**/ui/** +sonar.exclusions=**/*.pb*.go,**/*generated*.go,,**/*_test.go,**/mocks/*,**/vendor/**,**/ui/** sonar.go.tests.reportPath=test-results/test-report.json sonar.go.coverage.reportPaths=coverage.out From 1b64c2461a26d444fc98b44b255e48c0c7d58510 Mon Sep 17 00:00:00 2001 From: Alex Collins Date: Thu, 23 Apr 2020 08:45:14 -0700 Subject: [PATCH 04/15] remove label --- util/instanceid/instanceid.go | 6 +++++- util/instanceid/instanceid_test.go | 7 ++++++- util/labels/labeler.go | 8 ++++++++ util/labels/labeler_test.go | 25 +++++++++++++++++++++++++ 4 files changed, 44 insertions(+), 2 deletions(-) diff --git a/util/instanceid/instanceid.go b/util/instanceid/instanceid.go index c56b57305196..dcb5cc16221d 100644 --- a/util/instanceid/instanceid.go +++ b/util/instanceid/instanceid.go @@ -10,7 +10,11 @@ import ( ) func Label(obj metav1.Object, instanceID string) { - labels.Label(obj, common.LabelKeyControllerInstanceID, instanceID) + if instanceID != "" { + labels.Label(obj, common.LabelKeyControllerInstanceID, instanceID) + } else { + labels.UnLabel(obj, common.LabelKeyControllerInstanceID) + } } func With(opts metav1.ListOptions, instanceID string) metav1.ListOptions { diff --git a/util/instanceid/instanceid_test.go b/util/instanceid/instanceid_test.go index afa9206ffe0b..c45fa5ec8201 100644 --- a/util/instanceid/instanceid_test.go +++ b/util/instanceid/instanceid_test.go @@ -16,12 +16,17 @@ func TestLabel(t *testing.T) { Label(obj, "") assert.Empty(t, obj.GetLabels()) }) - t.Run("One", func(t *testing.T) { + t.Run("Add", func(t *testing.T) { obj := &wfv1.Workflow{} Label(obj, "foo") assert.Len(t, obj.GetLabels(), 1) assert.Equal(t, "foo", obj.GetLabels()[common.LabelKeyControllerInstanceID]) }) + t.Run("Remove", func(t *testing.T) { + obj := &wfv1.Workflow{ObjectMeta: metav1.ObjectMeta{Labels: map[string]string{common.LabelKeyControllerInstanceID: "bar"}}} + Label(obj, "") + assert.Empty(t, obj.GetLabels()) + }) } func TestWith(t *testing.T) { diff --git a/util/labels/labeler.go b/util/labels/labeler.go index 17652b967961..99f80b01836d 100644 --- a/util/labels/labeler.go +++ b/util/labels/labeler.go @@ -19,3 +19,11 @@ func Label(obj metav1.Object, name string, values ...string) { return } } + +func UnLabel(obj metav1.Object, name string) { + labels := obj.GetLabels() + if labels == nil { + return + } + delete(labels, name) +} diff --git a/util/labels/labeler_test.go b/util/labels/labeler_test.go index 5b60dcd92e60..3735ffe6b20b 100644 --- a/util/labels/labeler_test.go +++ b/util/labels/labeler_test.go @@ -4,6 +4,7 @@ import ( "testing" "github.com/stretchr/testify/assert" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" wfv1 "github.com/argoproj/argo/pkg/apis/workflow/v1alpha1" ) @@ -27,3 +28,27 @@ func TestLabel(t *testing.T) { assert.Equal(t, "bar", obj.Labels["foo"]) }) } + +func TestUnLabel(t *testing.T) { + t.Run("nil", func(t *testing.T) { + obj := &wfv1.Workflow{} + UnLabel(obj, "foo") + assert.Empty(t, obj.Labels) + }) + t.Run("Empty", func(t *testing.T) { + obj := &wfv1.Workflow{ObjectMeta: metav1.ObjectMeta{Labels: map[string]string{}}} + UnLabel(obj, "foo") + assert.Empty(t, obj.Labels) + }) + t.Run("One", func(t *testing.T) { + obj := &wfv1.Workflow{ObjectMeta: metav1.ObjectMeta{Labels: map[string]string{"foo": ""}}} + UnLabel(obj, "foo") + assert.Empty(t, obj.Labels) + }) + t.Run("Two", func(t *testing.T) { + obj := &wfv1.Workflow{ObjectMeta: metav1.ObjectMeta{Labels: map[string]string{"bar": ""}}} + UnLabel(obj, "foo") + assert.Len(t, obj.Labels, 1) + assert.Contains(t, obj.Labels, "bar") + }) +} From f1efaa18da5a7829fa9c0da0b0806a3ddee873b6 Mon Sep 17 00:00:00 2001 From: Alex Collins Date: Fri, 24 Apr 2020 13:47:13 -0700 Subject: [PATCH 05/15] changes --- cmd/argo/commands/client/conn.go | 2 +- pkg/apiclient/apiclient.go | 8 ++--- .../workflow_template_server.go | 31 +++++++++++++------ 3 files changed, 27 insertions(+), 14 deletions(-) diff --git a/cmd/argo/commands/client/conn.go b/cmd/argo/commands/client/conn.go index aa72e3d06eff..027139a0e13d 100644 --- a/cmd/argo/commands/client/conn.go +++ b/cmd/argo/commands/client/conn.go @@ -46,7 +46,7 @@ func NewAPIClient() (context.Context, apiclient.Client) { ctx, client, err := apiclient.NewClientFromOpts( apiclient.Opts{ ArgoServerOpts: argoServerOpts, - InstanceID: instanceId, + InstanceID: instanceId, AuthSupplier: func() string { return GetAuthString() }, diff --git a/pkg/apiclient/apiclient.go b/pkg/apiclient/apiclient.go index 557c1f72e9b2..1774787001a9 100644 --- a/pkg/apiclient/apiclient.go +++ b/pkg/apiclient/apiclient.go @@ -25,9 +25,9 @@ type Client interface { type Opts struct { ArgoServerOpts ArgoServerOpts - InstanceID string - AuthSupplier func() string - ClientConfig clientcmd.ClientConfig + InstanceID string + AuthSupplier func() string + ClientConfig clientcmd.ClientConfig } // DEPRECATED: use NewClientFromOpts @@ -40,7 +40,7 @@ func NewClient(argoServer string, authSupplier func() string, clientConfig clien } func NewClientFromOpts(opts Opts) (context.Context, Client, error) { - if opts.ArgoServer != "" && opts.InstanceID != "" { + if opts.ArgoServerOpts.URL != "" && opts.InstanceID != "" { return nil, nil, fmt.Errorf("cannot use instance ID with Argo Server") } if opts.ArgoServerOpts.URL != "" { diff --git a/server/workflowtemplate/workflow_template_server.go b/server/workflowtemplate/workflow_template_server.go index 412f0e68dade..9f6243765aff 100644 --- a/server/workflowtemplate/workflow_template_server.go +++ b/server/workflowtemplate/workflow_template_server.go @@ -43,15 +43,20 @@ func (wts *WorkflowTemplateServer) CreateWorkflowTemplate(ctx context.Context, r } func (wts *WorkflowTemplateServer) GetWorkflowTemplate(ctx context.Context, req *workflowtemplatepkg.WorkflowTemplateGetRequest) (*v1alpha1.WorkflowTemplate, error) { - wfClient := auth.GetWfClient(ctx) - - wfTmpl, err := wfClient.ArgoprojV1alpha1().WorkflowTemplates(req.Namespace).Get(req.Name, v1.GetOptions{}) + return wts.getTemplateAndValidate(ctx, req.Namespace, req.Name) +} +func (wts *WorkflowTemplateServer) getTemplateAndValidate(ctx context.Context, namespace string, name string) (*v1alpha1.WorkflowTemplate, error) { + wfClient := auth.GetWfClient(ctx) + wfTmpl, err := wfClient.ArgoprojV1alpha1().WorkflowTemplates(namespace).Get(name, v1.GetOptions{}) if err != nil { return nil, err } - - return wfTmpl, err + err = instanceid.Validate(wfTmpl, wts.instanceID) + if err != nil { + return nil, err + } + return wfTmpl, nil } func (wts *WorkflowTemplateServer) ListWorkflowTemplates(ctx context.Context, req *workflowtemplatepkg.WorkflowTemplateListRequest) (*v1alpha1.WorkflowTemplateList, error) { @@ -60,6 +65,7 @@ func (wts *WorkflowTemplateServer) ListWorkflowTemplates(ctx context.Context, re if req.ListOptions != nil { options = *req.ListOptions } + instanceid.With(options, wts.instanceID) wfList, err := wfClient.ArgoprojV1alpha1().WorkflowTemplates(req.Namespace).List(options) if err != nil { return nil, err @@ -72,8 +78,11 @@ func (wts *WorkflowTemplateServer) ListWorkflowTemplates(ctx context.Context, re func (wts *WorkflowTemplateServer) DeleteWorkflowTemplate(ctx context.Context, req *workflowtemplatepkg.WorkflowTemplateDeleteRequest) (*workflowtemplatepkg.WorkflowTemplateDeleteResponse, error) { wfClient := auth.GetWfClient(ctx) - - err := wfClient.ArgoprojV1alpha1().WorkflowTemplates(req.Namespace).Delete(req.Name, &v1.DeleteOptions{}) + _, err := wts.getTemplateAndValidate(ctx, req.Namespace, req.Name) + if err != nil { + return nil, err + } + err = wfClient.ArgoprojV1alpha1().WorkflowTemplates(req.Namespace).Delete(req.Name, &v1.DeleteOptions{}) if err != nil { return nil, err } @@ -83,7 +92,7 @@ func (wts *WorkflowTemplateServer) DeleteWorkflowTemplate(ctx context.Context, r func (wts *WorkflowTemplateServer) LintWorkflowTemplate(ctx context.Context, req *workflowtemplatepkg.WorkflowTemplateLintRequest) (*v1alpha1.WorkflowTemplate, error) { wfClient := auth.GetWfClient(ctx) - + instanceid.Label(req.Template, wts.instanceID) wftmplGetter := templateresolution.WrapWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().WorkflowTemplates(req.Namespace)) cwftmplGetter := templateresolution.WrapClusterWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().ClusterWorkflowTemplates()) @@ -100,12 +109,16 @@ func (wts *WorkflowTemplateServer) UpdateWorkflowTemplate(ctx context.Context, r if req.Template == nil { return nil, fmt.Errorf("WorkflowTemplate is not found in Request body") } + err := instanceid.Validate(req.Template, wts.instanceID) + if err != nil { + return nil, err + } wfClient := auth.GetWfClient(ctx) wftmplGetter := templateresolution.WrapWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().WorkflowTemplates(req.Namespace)) cwftmplGetter := templateresolution.WrapClusterWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().ClusterWorkflowTemplates()) - _, err := validate.ValidateWorkflowTemplate(wftmplGetter, cwftmplGetter, req.Template) + _, err = validate.ValidateWorkflowTemplate(wftmplGetter, cwftmplGetter, req.Template) if err != nil { return nil, err } From d2cec0c525135e5aeb6ab293b8fa0999be2aa90c Mon Sep 17 00:00:00 2001 From: Alex Collins Date: Fri, 24 Apr 2020 14:27:16 -0700 Subject: [PATCH 06/15] ok --- cmd/argo/commands/client/conn.go | 6 ++-- pkg/apiclient/apiclient.go | 3 +- pkg/apiclient/argo-kube-client.go | 15 +++++---- server/apiserver/argoserver.go | 17 ++++++---- server/artifacts/artifact_server.go | 8 ++--- .../cluster_workflow_template_server.go | 19 ++++++----- .../cluster_workflow_template_server_test.go | 13 ++++++-- server/cronworkflow/cron_workflow_server.go | 19 ++++++----- .../cronworkflow/cron_workflow_server_test.go | 3 +- server/workflow/workflow_server.go | 32 +++++++++--------- server/workflow/workflow_server_test.go | 17 +++++----- .../workflow_template_server.go | 22 ++++++------- .../workflow_template_server_test.go | 18 +++++++--- util/instanceid/{instanceid.go => service.go} | 33 +++++++++++++------ .../{instanceid_test.go => service_test.go} | 28 +++++++++------- 15 files changed, 146 insertions(+), 107 deletions(-) rename util/instanceid/{instanceid.go => service.go} (55%) rename util/instanceid/{instanceid_test.go => service_test.go} (59%) diff --git a/cmd/argo/commands/client/conn.go b/cmd/argo/commands/client/conn.go index 027139a0e13d..4719c8eae030 100644 --- a/cmd/argo/commands/client/conn.go +++ b/cmd/argo/commands/client/conn.go @@ -13,7 +13,7 @@ import ( ) var argoServerOpts = apiclient.ArgoServerOpts{} -var instanceId string +var instanceID string var overrides = clientcmd.ConfigOverrides{} @@ -33,7 +33,7 @@ func GetConfig() clientcmd.ClientConfig { } func AddAPIClientFlagsToCmd(cmd *cobra.Command) { - cmd.PersistentFlags().StringVar(&instanceId, "instanceid", os.Getenv("ARGO_INSTANCEID"), "submit with a specific controller's instance id label. Default to the ARGO_INSTANCEID environment variable.") + cmd.PersistentFlags().StringVar(&instanceID, "instanceid", os.Getenv("ARGO_INSTANCEID"), "submit with a specific controller's instance id label. Default to the ARGO_INSTANCEID environment variable.") // "-s" like kubectl cmd.PersistentFlags().StringVarP(&argoServerOpts.URL, "argo-server", "s", os.Getenv("ARGO_SERVER"), "API server `host:port`. e.g. localhost:2746. Defaults to the ARGO_SERVER environment variable.") // "-e" for encrypted - like zip @@ -46,7 +46,7 @@ func NewAPIClient() (context.Context, apiclient.Client) { ctx, client, err := apiclient.NewClientFromOpts( apiclient.Opts{ ArgoServerOpts: argoServerOpts, - InstanceID: instanceId, + InstanceID: instanceID, AuthSupplier: func() string { return GetAuthString() }, diff --git a/pkg/apiclient/apiclient.go b/pkg/apiclient/apiclient.go index 1774787001a9..466ea9140c01 100644 --- a/pkg/apiclient/apiclient.go +++ b/pkg/apiclient/apiclient.go @@ -12,6 +12,7 @@ import ( workflowpkg "github.com/argoproj/argo/pkg/apiclient/workflow" workflowarchivepkg "github.com/argoproj/argo/pkg/apiclient/workflowarchive" workflowtemplatepkg "github.com/argoproj/argo/pkg/apiclient/workflowtemplate" + "github.com/argoproj/argo/util/instanceid" ) type Client interface { @@ -46,6 +47,6 @@ func NewClientFromOpts(opts Opts) (context.Context, Client, error) { if opts.ArgoServerOpts.URL != "" { return newArgoServerClient(opts.ArgoServerOpts, opts.AuthSupplier()) } else { - return newArgoKubeClient(opts.ClientConfig, opts.InstanceID) + return newArgoKubeClient(opts.ClientConfig, instanceid.NewService(opts.InstanceID)) } } diff --git a/pkg/apiclient/argo-kube-client.go b/pkg/apiclient/argo-kube-client.go index 08e21375ed4c..407572a8b391 100644 --- a/pkg/apiclient/argo-kube-client.go +++ b/pkg/apiclient/argo-kube-client.go @@ -21,16 +21,17 @@ import ( workflowserver "github.com/argoproj/argo/server/workflow" workflowtemplateserver "github.com/argoproj/argo/server/workflowtemplate" "github.com/argoproj/argo/util/help" + "github.com/argoproj/argo/util/instanceid" ) var argoKubeOffloadNodeStatusRepo = sqldb.ExplosiveOffloadNodeStatusRepo var NoArgoServerErr = fmt.Errorf("this is impossible if you are not using the Argo Server, see " + help.CLI) type argoKubeClient struct { - instanceID string + instanceIDService instanceid.Service } -func newArgoKubeClient(clientConfig clientcmd.ClientConfig, instanceID string) (context.Context, Client, error) { +func newArgoKubeClient(clientConfig clientcmd.ClientConfig, instanceIDService instanceid.Service) (context.Context, Client, error) { restConfig, err := clientConfig.ClientConfig() if err != nil { return nil, nil, err @@ -48,19 +49,19 @@ func newArgoKubeClient(clientConfig clientcmd.ClientConfig, instanceID string) ( if err != nil { return nil, nil, err } - return ctx, &argoKubeClient{instanceID}, nil + return ctx, &argoKubeClient{instanceIDService}, nil } func (a *argoKubeClient) NewWorkflowServiceClient() workflowpkg.WorkflowServiceClient { - return &argoKubeWorkflowServiceClient{workflowserver.NewWorkflowServer(a.instanceID, argoKubeOffloadNodeStatusRepo)} + return &argoKubeWorkflowServiceClient{workflowserver.NewWorkflowServer(a.instanceIDService, argoKubeOffloadNodeStatusRepo)} } func (a *argoKubeClient) NewCronWorkflowServiceClient() cronworkflow.CronWorkflowServiceClient { - return &argoKubeCronWorkflowServiceClient{cronworkflowserver.NewCronWorkflowServer(a.instanceID)} + return &argoKubeCronWorkflowServiceClient{cronworkflowserver.NewCronWorkflowServer(a.instanceIDService)} } func (a *argoKubeClient) NewWorkflowTemplateServiceClient() workflowtemplate.WorkflowTemplateServiceClient { - return &argoKubeWorkflowTemplateServiceClient{workflowtemplateserver.NewWorkflowTemplateServer(a.instanceID)} + return &argoKubeWorkflowTemplateServiceClient{workflowtemplateserver.NewWorkflowTemplateServer(a.instanceIDService)} } func (a *argoKubeClient) NewArchivedWorkflowServiceClient() (workflowarchivepkg.ArchivedWorkflowServiceClient, error) { @@ -72,5 +73,5 @@ func (a *argoKubeClient) NewInfoServiceClient() (infopkg.InfoServiceClient, erro } func (a *argoKubeClient) NewClusterWorkflowTemplateServiceClient() clusterworkflowtemplate.ClusterWorkflowTemplateServiceClient { - return &argoKubeWorkflowClusterTemplateServiceClient{clusterworkflowtmplserver.NewClusterWorkflowTemplateServer(a.instanceID)} + return &argoKubeWorkflowClusterTemplateServiceClient{clusterworkflowtmplserver.NewClusterWorkflowTemplateServer(a.instanceIDService)} } diff --git a/server/apiserver/argoserver.go b/server/apiserver/argoserver.go index 60f572590ac6..5e1e68a70d16 100644 --- a/server/apiserver/argoserver.go +++ b/server/apiserver/argoserver.go @@ -41,6 +41,7 @@ import ( "github.com/argoproj/argo/server/workflowarchive" "github.com/argoproj/argo/server/workflowtemplate" grpcutil "github.com/argoproj/argo/util/grpc" + "github.com/argoproj/argo/util/instanceid" "github.com/argoproj/argo/util/json" ) @@ -137,8 +138,10 @@ func (as *argoServer) Run(ctx context.Context, port int, browserOpenFunc func(st // disable the archiving - and still read old records wfArchive = sqldb.NewWorkflowArchive(session, persistence.GetClusterName(), as.managedNamespace, configMap.InstanceID) } - artifactServer := artifacts.NewArtifactServer(as.authenticator, offloadRepo, wfArchive, configMap.InstanceID) - grpcServer := as.newGRPCServer(configMap.InstanceID, offloadRepo, wfArchive, configMap.Links) + + instanceIDService := instanceid.NewService(configMap.InstanceID) + artifactServer := artifacts.NewArtifactServer(as.authenticator, offloadRepo, wfArchive, instanceIDService) + grpcServer := as.newGRPCServer(instanceIDService, offloadRepo, wfArchive, configMap.Links) httpServer := as.newHTTPServer(ctx, port, artifactServer) // Start listener @@ -178,7 +181,7 @@ func (as *argoServer) Run(ctx context.Context, port int, browserOpenFunc func(st <-as.stopCh } -func (as *argoServer) newGRPCServer(instanceID string, offloadNodeStatusRepo sqldb.OffloadNodeStatusRepo, wfArchive sqldb.WorkflowArchive, links []*v1alpha1.Link) *grpc.Server { +func (as *argoServer) newGRPCServer(instanceIDService instanceid.Service, offloadNodeStatusRepo sqldb.OffloadNodeStatusRepo, wfArchive sqldb.WorkflowArchive, links []*v1alpha1.Link) *grpc.Server { serverLog := log.NewEntry(log.StandardLogger()) sOpts := []grpc.ServerOption{ @@ -205,11 +208,11 @@ func (as *argoServer) newGRPCServer(instanceID string, offloadNodeStatusRepo sql grpcServer := grpc.NewServer(sOpts...) infopkg.RegisterInfoServiceServer(grpcServer, info.NewInfoServer(as.managedNamespace, links)) - workflowpkg.RegisterWorkflowServiceServer(grpcServer, workflow.NewWorkflowServer(instanceID, offloadNodeStatusRepo)) - workflowtemplatepkg.RegisterWorkflowTemplateServiceServer(grpcServer, workflowtemplate.NewWorkflowTemplateServer(instanceID)) - cronworkflowpkg.RegisterCronWorkflowServiceServer(grpcServer, cronworkflow.NewCronWorkflowServer(instanceID)) + workflowpkg.RegisterWorkflowServiceServer(grpcServer, workflow.NewWorkflowServer(instanceIDService, offloadNodeStatusRepo)) + workflowtemplatepkg.RegisterWorkflowTemplateServiceServer(grpcServer, workflowtemplate.NewWorkflowTemplateServer(instanceIDService)) + cronworkflowpkg.RegisterCronWorkflowServiceServer(grpcServer, cronworkflow.NewCronWorkflowServer(instanceIDService)) workflowarchivepkg.RegisterArchivedWorkflowServiceServer(grpcServer, workflowarchive.NewWorkflowArchiveServer(wfArchive)) - clusterwftemplatepkg.RegisterClusterWorkflowTemplateServiceServer(grpcServer, clusterworkflowtemplate.NewClusterWorkflowTemplateServer(instanceID)) + clusterwftemplatepkg.RegisterClusterWorkflowTemplateServiceServer(grpcServer, clusterworkflowtemplate.NewClusterWorkflowTemplateServer(instanceIDService)) return grpcServer } diff --git a/server/artifacts/artifact_server.go b/server/artifacts/artifact_server.go index c1fe2cf0ab2e..b0fd063a8d37 100644 --- a/server/artifacts/artifact_server.go +++ b/server/artifacts/artifact_server.go @@ -26,11 +26,11 @@ type ArtifactServer struct { authN auth.Gatekeeper offloadNodeStatusRepo sqldb.OffloadNodeStatusRepo wfArchive sqldb.WorkflowArchive - instanceID string + instanceIDService instanceid.Service } -func NewArtifactServer(authN auth.Gatekeeper, offloadNodeStatusRepo sqldb.OffloadNodeStatusRepo, wfArchive sqldb.WorkflowArchive, instanceID string) *ArtifactServer { - return &ArtifactServer{authN, offloadNodeStatusRepo, wfArchive, instanceID} +func NewArtifactServer(authN auth.Gatekeeper, offloadNodeStatusRepo sqldb.OffloadNodeStatusRepo, wfArchive sqldb.WorkflowArchive, instanceIDService instanceid.Service) *ArtifactServer { + return &ArtifactServer{authN, offloadNodeStatusRepo, wfArchive, instanceIDService} } func (a *ArtifactServer) GetArtifact(w http.ResponseWriter, r *http.Request) { @@ -166,7 +166,7 @@ func (a *ArtifactServer) getWorkflowAndValidate(ctx context.Context, namespace s if err != nil { return nil, err } - err = instanceid.Validate(wf, a.instanceID) + err = a.instanceIDService.Validate(wf) if err != nil { return nil, err } diff --git a/server/clusterworkflowtemplate/cluster_workflow_template_server.go b/server/clusterworkflowtemplate/cluster_workflow_template_server.go index e9a245b2567d..0af013ccdd2f 100644 --- a/server/clusterworkflowtemplate/cluster_workflow_template_server.go +++ b/server/clusterworkflowtemplate/cluster_workflow_template_server.go @@ -16,10 +16,10 @@ import ( ) type ClusterWorkflowTemplateServer struct { - instanceID string + instanceIDService instanceid.Service } -func NewClusterWorkflowTemplateServer(instanceID string) clusterwftmplpkg.ClusterWorkflowTemplateServiceServer { +func NewClusterWorkflowTemplateServer(instanceID instanceid.Service) clusterwftmplpkg.ClusterWorkflowTemplateServiceServer { return &ClusterWorkflowTemplateServer{instanceID} } @@ -29,7 +29,7 @@ func (cwts *ClusterWorkflowTemplateServer) CreateClusterWorkflowTemplate(ctx con return nil, fmt.Errorf("cluster workflow template was not found in the request body") } - instanceid.Label(req.Template, cwts.instanceID) + cwts.instanceIDService.Label(req.Template) cwftmplGetter := templateresolution.WrapClusterWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().ClusterWorkflowTemplates()) @@ -56,7 +56,7 @@ func (cwts *ClusterWorkflowTemplateServer) getTemplateAndValidate(ctx context.Co if err != nil { return nil, err } - err = instanceid.Validate(wfTmpl, cwts.instanceID) + err = cwts.instanceIDService.Validate(wfTmpl) if err != nil { return nil, err } @@ -65,11 +65,12 @@ func (cwts *ClusterWorkflowTemplateServer) getTemplateAndValidate(ctx context.Co func (cwts *ClusterWorkflowTemplateServer) ListClusterWorkflowTemplates(ctx context.Context, req *clusterwftmplpkg.ClusterWorkflowTemplateListRequest) (*v1alpha1.ClusterWorkflowTemplateList, error) { wfClient := auth.GetWfClient(ctx) - options := v1.ListOptions{} + options := &v1.ListOptions{} if req.ListOptions != nil { - options = *req.ListOptions + options = req.ListOptions } - cwfList, err := wfClient.ArgoprojV1alpha1().ClusterWorkflowTemplates().List(instanceid.With(options, cwts.instanceID)) + cwts.instanceIDService.With(options) + cwfList, err := wfClient.ArgoprojV1alpha1().ClusterWorkflowTemplates().List(*options) if err != nil { return nil, err } @@ -94,7 +95,7 @@ func (cwts *ClusterWorkflowTemplateServer) DeleteClusterWorkflowTemplate(ctx con } func (cwts *ClusterWorkflowTemplateServer) LintClusterWorkflowTemplate(ctx context.Context, req *clusterwftmplpkg.ClusterWorkflowTemplateLintRequest) (*v1alpha1.ClusterWorkflowTemplate, error) { - instanceid.Label(req.Template, cwts.instanceID) + cwts.instanceIDService.Label(req.Template) wfClient := auth.GetWfClient(ctx) cwftmplGetter := templateresolution.WrapClusterWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().ClusterWorkflowTemplates()) @@ -110,7 +111,7 @@ func (cwts *ClusterWorkflowTemplateServer) UpdateClusterWorkflowTemplate(ctx con if req.Template == nil { return nil, fmt.Errorf("ClusterWorkflowTemplate is not found in Request body") } - err := instanceid.Validate(req.Template, cwts.instanceID) + err := cwts.instanceIDService.Validate(req.Template) if err != nil { return nil, err } diff --git a/server/clusterworkflowtemplate/cluster_workflow_template_server_test.go b/server/clusterworkflowtemplate/cluster_workflow_template_server_test.go index a2aa8db65b25..0d050461e3c6 100644 --- a/server/clusterworkflowtemplate/cluster_workflow_template_server_test.go +++ b/server/clusterworkflowtemplate/cluster_workflow_template_server_test.go @@ -7,6 +7,7 @@ import ( clusterwftmplpkg "github.com/argoproj/argo/pkg/apiclient/clusterworkflowtemplate" "github.com/argoproj/argo/server/auth" + "github.com/argoproj/argo/util/instanceid" "github.com/stretchr/testify/assert" "k8s.io/client-go/kubernetes/fake" @@ -60,7 +61,10 @@ const cwftStr2 = `{ "apiVersion": "argoproj.io/v1alpha1", "kind": "ClusterWorkflowTemplate", "metadata": { - "name": "cluster-workflow-template-whalesay-template2" + "name": "cluster-workflow-template-whalesay-template2", + "labels": { + "workflows.argoproj.io/controller-instanceid": "my-instanceid" + } }, "spec": { "arguments": { @@ -100,7 +104,10 @@ const cwftStr3 = `{ "apiVersion": "argoproj.io/v1alpha1", "kind": "ClusterWorkflowTemplate", "metadata": { - "name": "cluster-workflow-template-whalesay-template3" + "name": "cluster-workflow-template-whalesay-template3", + "labels": { + "workflows.argoproj.io/controller-instanceid": "my-instanceid" + } }, "spec": { "arguments": { @@ -148,7 +155,7 @@ func getClusterWorkflowTemplateServer() (clusterwftmplpkg.ClusterWorkflowTemplat kubeClientSet := fake.NewSimpleClientset() wfClientset := wftFake.NewSimpleClientset(&cwftObj1, &cwftObj2) ctx := context.WithValue(context.WithValue(context.TODO(), auth.WfKey, wfClientset), auth.KubeKey, kubeClientSet) - return NewClusterWorkflowTemplateServer(""), ctx + return NewClusterWorkflowTemplateServer(instanceid.NewService("my-instanceid")), ctx } func TestWorkflowTemplateServer_CreateClusterWorkflowTemplate(t *testing.T) { diff --git a/server/cronworkflow/cron_workflow_server.go b/server/cronworkflow/cron_workflow_server.go index 6c0deb6aef74..fa8bbb86f3c5 100644 --- a/server/cronworkflow/cron_workflow_server.go +++ b/server/cronworkflow/cron_workflow_server.go @@ -15,19 +15,19 @@ import ( ) type cronWorkflowServiceServer struct { - instanceID string + instanceIDService instanceid.Service } // NewCronWorkflowServer returns a new cronWorkflowServiceServer -func NewCronWorkflowServer(instanceID string) cronworkflowpkg.CronWorkflowServiceServer { - return &cronWorkflowServiceServer{instanceID: instanceID} +func NewCronWorkflowServer(instanceIDService instanceid.Service) cronworkflowpkg.CronWorkflowServiceServer { + return &cronWorkflowServiceServer{instanceIDService} } func (c *cronWorkflowServiceServer) LintCronWorkflow(ctx context.Context, req *cronworkflowpkg.LintCronWorkflowRequest) (*v1alpha1.CronWorkflow, error) { wfClient := auth.GetWfClient(ctx) wftmplGetter := templateresolution.WrapWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().WorkflowTemplates(req.Namespace)) cwftmplGetter := templateresolution.WrapClusterWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().ClusterWorkflowTemplates()) - instanceid.Label(req.CronWorkflow, c.instanceID) + c.instanceIDService.Label(req.CronWorkflow) err := validate.ValidateCronWorkflow(wftmplGetter, cwftmplGetter, req.CronWorkflow) if err != nil { return nil, err @@ -36,11 +36,12 @@ func (c *cronWorkflowServiceServer) LintCronWorkflow(ctx context.Context, req *c } func (c *cronWorkflowServiceServer) ListCronWorkflows(ctx context.Context, req *cronworkflowpkg.ListCronWorkflowsRequest) (*v1alpha1.CronWorkflowList, error) { - options := metav1.ListOptions{} + options := &metav1.ListOptions{} if req.ListOptions != nil { - options = *req.ListOptions + options = req.ListOptions } - return auth.GetWfClient(ctx).ArgoprojV1alpha1().CronWorkflows(req.Namespace).List(instanceid.With(options, c.instanceID)) + c.instanceIDService.With(options) + return auth.GetWfClient(ctx).ArgoprojV1alpha1().CronWorkflows(req.Namespace).List(*options) } func (c *cronWorkflowServiceServer) CreateCronWorkflow(ctx context.Context, req *cronworkflowpkg.CreateCronWorkflowRequest) (*v1alpha1.CronWorkflow, error) { @@ -48,7 +49,7 @@ func (c *cronWorkflowServiceServer) CreateCronWorkflow(ctx context.Context, req if req.CronWorkflow == nil { return nil, fmt.Errorf("cron workflow was not found in the request body") } - instanceid.Label(req.CronWorkflow, c.instanceID) + c.instanceIDService.Label(req.CronWorkflow) wftmplGetter := templateresolution.WrapWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().WorkflowTemplates(req.Namespace)) cwftmplGetter := templateresolution.WrapClusterWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().ClusterWorkflowTemplates()) @@ -95,7 +96,7 @@ func (c *cronWorkflowServiceServer) getCronWorkflowAndValidate(ctx context.Conte if err != nil { return nil, err } - err = instanceid.Validate(cronWf, c.instanceID) + err = c.instanceIDService.Validate(cronWf) if err != nil { return nil, err } diff --git a/server/cronworkflow/cron_workflow_server_test.go b/server/cronworkflow/cron_workflow_server_test.go index 3fbf4cd3a0af..332c0b868631 100644 --- a/server/cronworkflow/cron_workflow_server_test.go +++ b/server/cronworkflow/cron_workflow_server_test.go @@ -11,6 +11,7 @@ import ( wfv1 "github.com/argoproj/argo/pkg/apis/workflow/v1alpha1" wftFake "github.com/argoproj/argo/pkg/client/clientset/versioned/fake" "github.com/argoproj/argo/server/auth" + "github.com/argoproj/argo/util/instanceid" ) func Test_cronWorkflowServiceServer(t *testing.T) { @@ -43,7 +44,7 @@ spec: panic(err) } wfClientset := wftFake.NewSimpleClientset() - server := NewCronWorkflowServer("testinstanceid001") + server := NewCronWorkflowServer(instanceid.NewService("my-instanceid")) ctx := context.WithValue(context.TODO(), auth.WfKey, wfClientset) t.Run("CreateCronWorkflow", func(t *testing.T) { diff --git a/server/workflow/workflow_server.go b/server/workflow/workflow_server.go index 2894a5d18087..ee2b22646ce9 100644 --- a/server/workflow/workflow_server.go +++ b/server/workflow/workflow_server.go @@ -24,16 +24,13 @@ import ( ) type workflowServer struct { - instanceID string + instanceIDService instanceid.Service offloadNodeStatusRepo sqldb.OffloadNodeStatusRepo } // NewWorkflowServer returns a new workflowServer -func NewWorkflowServer(instanceID string, offloadNodeStatusRepo sqldb.OffloadNodeStatusRepo) workflowpkg.WorkflowServiceServer { - return &workflowServer{ - instanceID: instanceID, - offloadNodeStatusRepo: offloadNodeStatusRepo, - } +func NewWorkflowServer(instanceIDService instanceid.Service, offloadNodeStatusRepo sqldb.OffloadNodeStatusRepo) workflowpkg.WorkflowServiceServer { + return &workflowServer{instanceIDService, offloadNodeStatusRepo} } func (s *workflowServer) CreateWorkflow(ctx context.Context, req *workflowpkg.WorkflowCreateRequest) (*v1alpha1.Workflow, error) { @@ -47,7 +44,7 @@ func (s *workflowServer) CreateWorkflow(ctx context.Context, req *workflowpkg.Wo req.Workflow.Namespace = req.Namespace } - instanceid.Label(req.Workflow, s.instanceID) + s.instanceIDService.Label(req.Workflow) wftmplGetter := templateresolution.WrapWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().WorkflowTemplates(req.Namespace)) cwftmplGetter := templateresolution.WrapClusterWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().ClusterWorkflowTemplates()) @@ -107,12 +104,12 @@ func (s *workflowServer) GetWorkflow(ctx context.Context, req *workflowpkg.Workf func (s *workflowServer) ListWorkflows(ctx context.Context, req *workflowpkg.WorkflowListRequest) (*v1alpha1.WorkflowList, error) { wfClient := auth.GetWfClient(ctx) - var listOption = metav1.ListOptions{} + var listOption = &metav1.ListOptions{} if req.ListOptions != nil { - listOption = *req.ListOptions + listOption = req.ListOptions } - - wfList, err := wfClient.ArgoprojV1alpha1().Workflows(req.Namespace).List(instanceid.With(listOption, s.instanceID)) + s.instanceIDService.With(listOption) + wfList, err := wfClient.ArgoprojV1alpha1().Workflows(req.Namespace).List(*listOption) if err != nil { return nil, err } @@ -137,11 +134,12 @@ func (s *workflowServer) ListWorkflows(ctx context.Context, req *workflowpkg.Wor func (s *workflowServer) WatchWorkflows(req *workflowpkg.WatchWorkflowsRequest, ws workflowpkg.WorkflowService_WatchWorkflowsServer) error { wfClient := auth.GetWfClient(ws.Context()) - opts := metav1.ListOptions{} + opts := &metav1.ListOptions{} if req.ListOptions != nil { - opts = *req.ListOptions + opts = req.ListOptions } - watch, err := wfClient.ArgoprojV1alpha1().Workflows(req.Namespace).Watch(instanceid.With(opts, s.instanceID)) + s.instanceIDService.With(opts) + watch, err := wfClient.ArgoprojV1alpha1().Workflows(req.Namespace).Watch(*opts) if err != nil { return err } @@ -321,7 +319,7 @@ func (s *workflowServer) LintWorkflow(ctx context.Context, req *workflowpkg.Work wfClient := auth.GetWfClient(ctx) wftmplGetter := templateresolution.WrapWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().WorkflowTemplates(req.Namespace)) cwftmplGetter := templateresolution.WrapClusterWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().ClusterWorkflowTemplates()) - instanceid.Label(req.Workflow, s.instanceID) + s.instanceIDService.Label(req.Workflow) _, err := validate.ValidateWorkflow(wftmplGetter, cwftmplGetter, req.Workflow, validate.ValidateOpts{Lint: true}) @@ -349,7 +347,7 @@ func (s *workflowServer) getWorkflowAndValidate(ctx context.Context, namespace s if err != nil { return nil, err } - err = instanceid.Validate(wf, s.instanceID) + err = s.instanceIDService.Validate(wf) if err != nil { return nil, err } @@ -384,7 +382,7 @@ func (s *workflowServer) SubmitWorkflow(ctx context.Context, req *workflowpkg.Wo } - instanceid.Label(wf, s.instanceID) + s.instanceIDService.Label(wf) err := util.ApplySubmitOpts(wf, req.SubmitOptions) if err != nil { return nil, err diff --git a/server/workflow/workflow_server_test.go b/server/workflow/workflow_server_test.go index c592ec65eb2f..fe41417a6cb3 100644 --- a/server/workflow/workflow_server_test.go +++ b/server/workflow/workflow_server_test.go @@ -19,6 +19,7 @@ import ( "github.com/argoproj/argo/pkg/apis/workflow/v1alpha1" v1alpha "github.com/argoproj/argo/pkg/client/clientset/versioned/fake" "github.com/argoproj/argo/server/auth" + "github.com/argoproj/argo/util/instanceid" ) const wf1 = ` @@ -30,7 +31,7 @@ const wf1 = ` "generateName": "hello-world-", "generation": 5, "labels": { - "workflows.argoproj.io/controller-instanceid": "testinstanceid001", + "workflows.argoproj.io/controller-instanceid": "my-instanceid", "workflows.argoproj.io/completed": "true", "workflows.argoproj.io/phase": "Succeeded" }, @@ -92,7 +93,7 @@ const wf2 = ` "generateName": "hello-world-", "generation": 5, "labels": { - "workflows.argoproj.io/controller-instanceid": "testinstanceid001", + "workflows.argoproj.io/controller-instanceid": "my-instanceid", "workflows.argoproj.io/completed": "true", "workflows.argoproj.io/phase": "Succeeded" }, @@ -154,7 +155,7 @@ const wf3 = ` "generateName": "hello-world-", "generation": 5, "labels": { - "workflows.argoproj.io/controller-instanceid": "testinstanceid001", + "workflows.argoproj.io/controller-instanceid": "my-instanceid", "workflows.argoproj.io/completed": "true", "workflows.argoproj.io/phase": "Succeeded" }, @@ -216,7 +217,7 @@ const wf4 = ` "generateName": "hello-world-", "generation": 5, "labels": { - "workflows.argoproj.io/controller-instanceid": "testinstanceid001", + "workflows.argoproj.io/controller-instanceid": "my-instanceid", "workflows.argoproj.io/completed": "true", "workflows.argoproj.io/phase": "Succeeded" }, @@ -278,7 +279,7 @@ const wf5 = ` "generateName": "hello-world-", "generation": 5, "labels": { - "workflows.argoproj.io/controller-instanceid": "testinstanceid001", + "workflows.argoproj.io/controller-instanceid": "my-instanceid", "workflows.argoproj.io/completed": "false", "workflows.argoproj.io/phase": "Running" }, @@ -340,7 +341,7 @@ const workflow1 = ` "metadata": { "generateName": "hello-world-", "labels": { - "workflows.argoproj.io/controller-instanceid": "testinstanceid001" + "workflows.argoproj.io/controller-instanceid": "my-instanceid" } }, "spec": { @@ -485,8 +486,6 @@ const clusterworkflowtmpl = ` } ` -const testInstanceID = "testinstanceid001" - func getWorkflowServer() (workflowpkg.WorkflowServiceServer, context.Context) { var wfObj1, wfObj2, wfObj3, wfObj4, wfObj5 v1alpha1.Workflow @@ -506,7 +505,7 @@ func getWorkflowServer() (workflowpkg.WorkflowServiceServer, context.Context) { offloadNodeStatusRepo := &mocks.OffloadNodeStatusRepo{} offloadNodeStatusRepo.On("IsEnabled", mock.Anything).Return(true) offloadNodeStatusRepo.On("List", mock.Anything).Return(map[sqldb.UUIDVersion]v1alpha1.Nodes{}, nil) - server := NewWorkflowServer(testInstanceID, offloadNodeStatusRepo) + server := NewWorkflowServer(instanceid.NewService("my-instanceid"), offloadNodeStatusRepo) kubeClientSet := fake.NewSimpleClientset() wfClientset := v1alpha.NewSimpleClientset(&wfObj1, &wfObj2, &wfObj3, &wfObj4, &wfObj5, &wftmpl, &cronwfObj, &cwfTmpl) wfClientset.PrependReactor("create", "workflows", generateNameReactor) diff --git a/server/workflowtemplate/workflow_template_server.go b/server/workflowtemplate/workflow_template_server.go index 9f6243765aff..0f1ab880be1e 100644 --- a/server/workflowtemplate/workflow_template_server.go +++ b/server/workflowtemplate/workflow_template_server.go @@ -16,11 +16,11 @@ import ( ) type WorkflowTemplateServer struct { - instanceID string + instanceIDService instanceid.Service } -func NewWorkflowTemplateServer(instanceID string) workflowtemplatepkg.WorkflowTemplateServiceServer { - return &WorkflowTemplateServer{instanceID} +func NewWorkflowTemplateServer(instanceIDService instanceid.Service) workflowtemplatepkg.WorkflowTemplateServiceServer { + return &WorkflowTemplateServer{instanceIDService} } func (wts *WorkflowTemplateServer) CreateWorkflowTemplate(ctx context.Context, req *workflowtemplatepkg.WorkflowTemplateCreateRequest) (*v1alpha1.WorkflowTemplate, error) { @@ -28,7 +28,7 @@ func (wts *WorkflowTemplateServer) CreateWorkflowTemplate(ctx context.Context, r if req.Template == nil { return nil, fmt.Errorf("workflow template was not found in the request body") } - instanceid.Label(req.Template, wts.instanceID) + wts.instanceIDService.Label(req.Template) wftmplGetter := templateresolution.WrapWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().WorkflowTemplates(req.Namespace)) cwftmplGetter := templateresolution.WrapClusterWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().ClusterWorkflowTemplates()) @@ -52,7 +52,7 @@ func (wts *WorkflowTemplateServer) getTemplateAndValidate(ctx context.Context, n if err != nil { return nil, err } - err = instanceid.Validate(wfTmpl, wts.instanceID) + err = wts.instanceIDService.Validate(wfTmpl) if err != nil { return nil, err } @@ -61,12 +61,12 @@ func (wts *WorkflowTemplateServer) getTemplateAndValidate(ctx context.Context, n func (wts *WorkflowTemplateServer) ListWorkflowTemplates(ctx context.Context, req *workflowtemplatepkg.WorkflowTemplateListRequest) (*v1alpha1.WorkflowTemplateList, error) { wfClient := auth.GetWfClient(ctx) - options := v1.ListOptions{} + options := &v1.ListOptions{} if req.ListOptions != nil { - options = *req.ListOptions + options = req.ListOptions } - instanceid.With(options, wts.instanceID) - wfList, err := wfClient.ArgoprojV1alpha1().WorkflowTemplates(req.Namespace).List(options) + wts.instanceIDService.With(options) + wfList, err := wfClient.ArgoprojV1alpha1().WorkflowTemplates(req.Namespace).List(*options) if err != nil { return nil, err } @@ -92,7 +92,7 @@ func (wts *WorkflowTemplateServer) DeleteWorkflowTemplate(ctx context.Context, r func (wts *WorkflowTemplateServer) LintWorkflowTemplate(ctx context.Context, req *workflowtemplatepkg.WorkflowTemplateLintRequest) (*v1alpha1.WorkflowTemplate, error) { wfClient := auth.GetWfClient(ctx) - instanceid.Label(req.Template, wts.instanceID) + wts.instanceIDService.Label(req.Template) wftmplGetter := templateresolution.WrapWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().WorkflowTemplates(req.Namespace)) cwftmplGetter := templateresolution.WrapClusterWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().ClusterWorkflowTemplates()) @@ -109,7 +109,7 @@ func (wts *WorkflowTemplateServer) UpdateWorkflowTemplate(ctx context.Context, r if req.Template == nil { return nil, fmt.Errorf("WorkflowTemplate is not found in Request body") } - err := instanceid.Validate(req.Template, wts.instanceID) + err := wts.instanceIDService.Validate(req.Template) if err != nil { return nil, err } diff --git a/server/workflowtemplate/workflow_template_server_test.go b/server/workflowtemplate/workflow_template_server_test.go index 3fff85ca36f8..e14db35d295c 100644 --- a/server/workflowtemplate/workflow_template_server_test.go +++ b/server/workflowtemplate/workflow_template_server_test.go @@ -7,6 +7,7 @@ import ( workflowtemplatepkg "github.com/argoproj/argo/pkg/apiclient/workflowtemplate" "github.com/argoproj/argo/server/auth" + "github.com/argoproj/argo/util/instanceid" "github.com/stretchr/testify/assert" "k8s.io/client-go/kubernetes/fake" @@ -21,7 +22,10 @@ const wftStr1 = `{ "apiVersion": "argoproj.io/v1alpha1", "kind": "WorkflowTemplate", "metadata": { - "name": "workflow-template-whalesay-template" + "name": "workflow-template-whalesay-template", + "labels": { + "workflows.argoproj.io/controller-instanceid": "my-instanceid" + } }, "spec": { "arguments": { @@ -62,7 +66,10 @@ const wftStr2 = `{ "kind": "WorkflowTemplate", "metadata": { "name": "workflow-template-whalesay-template2", - "namespace": "default" + "namespace": "default", + "labels": { + "workflows.argoproj.io/controller-instanceid": "my-instanceid" + } }, "spec": { "arguments": { @@ -103,7 +110,10 @@ const wftStr3 = `{ "kind": "WorkflowTemplate", "metadata": { "name": "workflow-template-whalesay-template3", - "namespace": "default" + "namespace": "default", + "labels": { + "workflows.argoproj.io/controller-instanceid": "my-instanceid" + } }, "spec": { "arguments": { @@ -151,7 +161,7 @@ func getWorkflowTemplateServer() (workflowtemplatepkg.WorkflowTemplateServiceSer kubeClientSet := fake.NewSimpleClientset() wfClientset := wftFake.NewSimpleClientset(&wftObj1, &wftObj2) ctx := context.WithValue(context.WithValue(context.TODO(), auth.WfKey, wfClientset), auth.KubeKey, kubeClientSet) - return NewWorkflowTemplateServer(""), ctx + return NewWorkflowTemplateServer(instanceid.NewService("my-instanceid")), ctx } func TestWorkflowTemplateServer_CreateWorkflowTemplate(t *testing.T) { diff --git a/util/instanceid/instanceid.go b/util/instanceid/service.go similarity index 55% rename from util/instanceid/instanceid.go rename to util/instanceid/service.go index dcb5cc16221d..47be185c9496 100644 --- a/util/instanceid/instanceid.go +++ b/util/instanceid/service.go @@ -9,33 +9,46 @@ import ( "github.com/argoproj/argo/workflow/common" ) -func Label(obj metav1.Object, instanceID string) { - if instanceID != "" { - labels.Label(obj, common.LabelKeyControllerInstanceID, instanceID) +type Service interface { + Label(obj metav1.Object) + With(options *metav1.ListOptions) + Validate(w metav1.Object) error +} + +type service struct { + instanceID string +} + +func NewService(instanceId string) Service { + return &service{instanceId} +} + +func (s *service) Label(obj metav1.Object) { + if s.instanceID != "" { + labels.Label(obj, common.LabelKeyControllerInstanceID, s.instanceID) } else { labels.UnLabel(obj, common.LabelKeyControllerInstanceID) } } -func With(opts metav1.ListOptions, instanceID string) metav1.ListOptions { +func (s *service) With(opts *metav1.ListOptions) { if len(opts.LabelSelector) > 0 { opts.LabelSelector += "," } - if instanceID == "" { + if s.instanceID == "" { opts.LabelSelector += fmt.Sprintf("!%s", common.LabelKeyControllerInstanceID) } else { - opts.LabelSelector += fmt.Sprintf("%s=%s", common.LabelKeyControllerInstanceID, instanceID) + opts.LabelSelector += fmt.Sprintf("%s=%s", common.LabelKeyControllerInstanceID, s.instanceID) } - return opts } -func Validate(obj metav1.Object, instanceID string) error { +func (s *service) Validate(obj metav1.Object) error { l := obj.GetLabels() - if instanceID == "" { + if s.instanceID == "" { if _, ok := l[common.LabelKeyControllerInstanceID]; !ok { return nil } - } else if val, ok := l[common.LabelKeyControllerInstanceID]; ok && val == instanceID { + } else if val, ok := l[common.LabelKeyControllerInstanceID]; ok && val == s.instanceID { return nil } diff --git a/util/instanceid/instanceid_test.go b/util/instanceid/service_test.go similarity index 59% rename from util/instanceid/instanceid_test.go rename to util/instanceid/service_test.go index c45fa5ec8201..bfc7451bd830 100644 --- a/util/instanceid/instanceid_test.go +++ b/util/instanceid/service_test.go @@ -13,41 +13,45 @@ import ( func TestLabel(t *testing.T) { t.Run("Empty", func(t *testing.T) { obj := &wfv1.Workflow{} - Label(obj, "") + NewService("").Label(obj) assert.Empty(t, obj.GetLabels()) }) t.Run("Add", func(t *testing.T) { obj := &wfv1.Workflow{} - Label(obj, "foo") + NewService("foo").Label(obj) assert.Len(t, obj.GetLabels(), 1) assert.Equal(t, "foo", obj.GetLabels()[common.LabelKeyControllerInstanceID]) }) t.Run("Remove", func(t *testing.T) { obj := &wfv1.Workflow{ObjectMeta: metav1.ObjectMeta{Labels: map[string]string{common.LabelKeyControllerInstanceID: "bar"}}} - Label(obj, "") + NewService("").Label(obj) assert.Empty(t, obj.GetLabels()) }) } func TestWith(t *testing.T) { t.Run("Empty", func(t *testing.T) { - with := With(metav1.ListOptions{}, "") - assert.Equal(t, "!workflows.argoproj.io/controller-instanceid", with.LabelSelector) + opts := &metav1.ListOptions{} + NewService("").With(opts) + assert.Equal(t, "!workflows.argoproj.io/controller-instanceid", opts.LabelSelector) }) t.Run("ExistingSelector", func(t *testing.T) { - with := With(metav1.ListOptions{LabelSelector: "foo"}, "") - assert.Equal(t, "foo,!workflows.argoproj.io/controller-instanceid", with.LabelSelector) + opts := &metav1.ListOptions{LabelSelector: "foo"} + NewService("").With(opts) + assert.Equal(t, "foo,!workflows.argoproj.io/controller-instanceid", opts.LabelSelector) }) } func TestValidate(t *testing.T) { t.Run("NoInstanceID", func(t *testing.T) { - assert.NoError(t, Validate(&wfv1.Workflow{}, "")) - assert.Error(t, Validate(&wfv1.Workflow{ObjectMeta: metav1.ObjectMeta{Labels: map[string]string{common.LabelKeyControllerInstanceID: "bar"}}}, "")) + s := NewService("") + assert.NoError(t, s.Validate(&wfv1.Workflow{})) + assert.Error(t, s.Validate(&wfv1.Workflow{ObjectMeta: metav1.ObjectMeta{Labels: map[string]string{common.LabelKeyControllerInstanceID: "bar"}}})) }) t.Run("InstanceID", func(t *testing.T) { - assert.Error(t, Validate(&wfv1.Workflow{}, "foo")) - assert.Error(t, Validate(&wfv1.Workflow{ObjectMeta: metav1.ObjectMeta{Labels: map[string]string{common.LabelKeyControllerInstanceID: "bar"}}}, "foo")) - assert.NoError(t, Validate(&wfv1.Workflow{ObjectMeta: metav1.ObjectMeta{Labels: map[string]string{common.LabelKeyControllerInstanceID: "foo"}}}, "foo")) + s := NewService("foo") + assert.Error(t, s.Validate(&wfv1.Workflow{})) + assert.Error(t, s.Validate(&wfv1.Workflow{ObjectMeta: metav1.ObjectMeta{Labels: map[string]string{common.LabelKeyControllerInstanceID: "bar"}}})) + assert.NoError(t, s.Validate(&wfv1.Workflow{ObjectMeta: metav1.ObjectMeta{Labels: map[string]string{common.LabelKeyControllerInstanceID: "foo"}}})) }) } From e136708337225d7f0e4da2524ae7a3370c2d66ec Mon Sep 17 00:00:00 2001 From: Alex Collins Date: Fri, 24 Apr 2020 15:49:24 -0700 Subject: [PATCH 07/15] changes --- persist/sqldb/mocks/WorkflowArchive.go | 60 +++++++------- persist/sqldb/null_workflow_archive.go | 11 +-- persist/sqldb/workflow_archive.go | 53 +++++++------ server/apiserver/argoserver.go | 7 +- server/artifacts/artifact_server.go | 4 +- .../cluster_workflow_template_server.go | 10 +-- .../cluster_workflow_template_server_test.go | 7 +- server/cronworkflow/cron_workflow_server.go | 8 +- server/workflow/workflow_server.go | 16 ++-- .../archived_workflow_server.go | 6 +- .../archived_workflow_server_test.go | 13 +-- .../workflow_template_server.go | 10 +-- .../workflow_template_server_test.go | 7 +- test/e2e/fixtures/e2e_suite.go | 5 +- test/e2e/fixtures/persistence.go | 4 +- util/instanceid/service.go | 32 ++++++-- util/instanceid/service_test.go | 21 ++--- util/marker/service.go | 79 +++++++++++++++++++ util/marker/service_test.go | 37 +++++++++ util/marker/test_server_stream_test.go | 37 +++++++++ workflow/controller/config.go | 4 +- workflow/controller/controller.go | 2 +- workflow/controller/operator.go | 3 +- 23 files changed, 308 insertions(+), 128 deletions(-) create mode 100644 util/marker/service.go create mode 100644 util/marker/service_test.go create mode 100644 util/marker/test_server_stream_test.go diff --git a/persist/sqldb/mocks/WorkflowArchive.go b/persist/sqldb/mocks/WorkflowArchive.go index 79b73cc54c63..f234f378d156 100644 --- a/persist/sqldb/mocks/WorkflowArchive.go +++ b/persist/sqldb/mocks/WorkflowArchive.go @@ -3,6 +3,8 @@ package mocks import ( + context "context" + mock "github.com/stretchr/testify/mock" labels "k8s.io/apimachinery/pkg/labels" @@ -16,13 +18,13 @@ type WorkflowArchive struct { mock.Mock } -// ArchiveWorkflow provides a mock function with given fields: wf -func (_m *WorkflowArchive) ArchiveWorkflow(wf *v1alpha1.Workflow) error { - ret := _m.Called(wf) +// ArchiveWorkflow provides a mock function with given fields: ctx, wf +func (_m *WorkflowArchive) ArchiveWorkflow(ctx context.Context, wf *v1alpha1.Workflow) error { + ret := _m.Called(ctx, wf) var r0 error - if rf, ok := ret.Get(0).(func(*v1alpha1.Workflow) error); ok { - r0 = rf(wf) + if rf, ok := ret.Get(0).(func(context.Context, *v1alpha1.Workflow) error); ok { + r0 = rf(ctx, wf) } else { r0 = ret.Error(0) } @@ -30,13 +32,13 @@ func (_m *WorkflowArchive) ArchiveWorkflow(wf *v1alpha1.Workflow) error { return r0 } -// DeleteWorkflow provides a mock function with given fields: uid -func (_m *WorkflowArchive) DeleteWorkflow(uid string) error { - ret := _m.Called(uid) +// DeleteWorkflow provides a mock function with given fields: ctx, uid +func (_m *WorkflowArchive) DeleteWorkflow(ctx context.Context, uid string) error { + ret := _m.Called(ctx, uid) var r0 error - if rf, ok := ret.Get(0).(func(string) error); ok { - r0 = rf(uid) + if rf, ok := ret.Get(0).(func(context.Context, string) error); ok { + r0 = rf(ctx, uid) } else { r0 = ret.Error(0) } @@ -44,13 +46,13 @@ func (_m *WorkflowArchive) DeleteWorkflow(uid string) error { return r0 } -// DeleteWorkflows provides a mock function with given fields: ttl -func (_m *WorkflowArchive) DeleteWorkflows(ttl time.Duration) error { - ret := _m.Called(ttl) +// DeleteWorkflows provides a mock function with given fields: ctx, ttl +func (_m *WorkflowArchive) DeleteWorkflows(ctx context.Context, ttl time.Duration) error { + ret := _m.Called(ctx, ttl) var r0 error - if rf, ok := ret.Get(0).(func(time.Duration) error); ok { - r0 = rf(ttl) + if rf, ok := ret.Get(0).(func(context.Context, time.Duration) error); ok { + r0 = rf(ctx, ttl) } else { r0 = ret.Error(0) } @@ -58,13 +60,13 @@ func (_m *WorkflowArchive) DeleteWorkflows(ttl time.Duration) error { return r0 } -// GetWorkflow provides a mock function with given fields: uid -func (_m *WorkflowArchive) GetWorkflow(uid string) (*v1alpha1.Workflow, error) { - ret := _m.Called(uid) +// GetWorkflow provides a mock function with given fields: ctx, uid +func (_m *WorkflowArchive) GetWorkflow(ctx context.Context, uid string) (*v1alpha1.Workflow, error) { + ret := _m.Called(ctx, uid) var r0 *v1alpha1.Workflow - if rf, ok := ret.Get(0).(func(string) *v1alpha1.Workflow); ok { - r0 = rf(uid) + if rf, ok := ret.Get(0).(func(context.Context, string) *v1alpha1.Workflow); ok { + r0 = rf(ctx, uid) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*v1alpha1.Workflow) @@ -72,8 +74,8 @@ func (_m *WorkflowArchive) GetWorkflow(uid string) (*v1alpha1.Workflow, error) { } var r1 error - if rf, ok := ret.Get(1).(func(string) error); ok { - r1 = rf(uid) + if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = rf(ctx, uid) } else { r1 = ret.Error(1) } @@ -81,13 +83,13 @@ func (_m *WorkflowArchive) GetWorkflow(uid string) (*v1alpha1.Workflow, error) { return r0, r1 } -// ListWorkflows provides a mock function with given fields: namespace, minStartAt, maxStartAt, labelRequirements, limit, offset -func (_m *WorkflowArchive) ListWorkflows(namespace string, minStartAt time.Time, maxStartAt time.Time, labelRequirements labels.Requirements, limit int, offset int) (v1alpha1.Workflows, error) { - ret := _m.Called(namespace, minStartAt, maxStartAt, labelRequirements, limit, offset) +// ListWorkflows provides a mock function with given fields: ctx, namespace, minStartAt, maxStartAt, labelRequirements, limit, offset +func (_m *WorkflowArchive) ListWorkflows(ctx context.Context, namespace string, minStartAt time.Time, maxStartAt time.Time, labelRequirements labels.Requirements, limit int, offset int) (v1alpha1.Workflows, error) { + ret := _m.Called(ctx, namespace, minStartAt, maxStartAt, labelRequirements, limit, offset) var r0 v1alpha1.Workflows - if rf, ok := ret.Get(0).(func(string, time.Time, time.Time, labels.Requirements, int, int) v1alpha1.Workflows); ok { - r0 = rf(namespace, minStartAt, maxStartAt, labelRequirements, limit, offset) + if rf, ok := ret.Get(0).(func(context.Context, string, time.Time, time.Time, labels.Requirements, int, int) v1alpha1.Workflows); ok { + r0 = rf(ctx, namespace, minStartAt, maxStartAt, labelRequirements, limit, offset) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(v1alpha1.Workflows) @@ -95,8 +97,8 @@ func (_m *WorkflowArchive) ListWorkflows(namespace string, minStartAt time.Time, } var r1 error - if rf, ok := ret.Get(1).(func(string, time.Time, time.Time, labels.Requirements, int, int) error); ok { - r1 = rf(namespace, minStartAt, maxStartAt, labelRequirements, limit, offset) + if rf, ok := ret.Get(1).(func(context.Context, string, time.Time, time.Time, labels.Requirements, int, int) error); ok { + r1 = rf(ctx, namespace, minStartAt, maxStartAt, labelRequirements, limit, offset) } else { r1 = ret.Error(1) } diff --git a/persist/sqldb/null_workflow_archive.go b/persist/sqldb/null_workflow_archive.go index ae252bdb9b98..c5b1a17159ea 100644 --- a/persist/sqldb/null_workflow_archive.go +++ b/persist/sqldb/null_workflow_archive.go @@ -1,6 +1,7 @@ package sqldb import ( + "context" "fmt" "time" @@ -14,22 +15,22 @@ var NullWorkflowArchive WorkflowArchive = &nullWorkflowArchive{} type nullWorkflowArchive struct { } -func (r *nullWorkflowArchive) ArchiveWorkflow(*wfv1.Workflow) error { +func (r *nullWorkflowArchive) ArchiveWorkflow(context.Context, *wfv1.Workflow) error { return nil } -func (r *nullWorkflowArchive) ListWorkflows(string, time.Time, time.Time, labels.Requirements, int, int) (wfv1.Workflows, error) { +func (r *nullWorkflowArchive) ListWorkflows(context.Context, string, time.Time, time.Time, labels.Requirements, int, int) (wfv1.Workflows, error) { return wfv1.Workflows{}, nil } -func (r *nullWorkflowArchive) GetWorkflow(string) (*wfv1.Workflow, error) { +func (r *nullWorkflowArchive) GetWorkflow(context.Context, string) (*wfv1.Workflow, error) { return nil, fmt.Errorf("getting archived workflows not supported") } -func (r *nullWorkflowArchive) DeleteWorkflow(string) error { +func (r *nullWorkflowArchive) DeleteWorkflow(context.Context, string) error { return fmt.Errorf("deleting archived workflows not supported") } -func (r *nullWorkflowArchive) DeleteWorkflows(time.Duration) error { +func (r *nullWorkflowArchive) DeleteWorkflows(context.Context, time.Duration) error { return nil } diff --git a/persist/sqldb/workflow_archive.go b/persist/sqldb/workflow_archive.go index 132ed38699b5..7a35d063a416 100644 --- a/persist/sqldb/workflow_archive.go +++ b/persist/sqldb/workflow_archive.go @@ -14,6 +14,7 @@ import ( "upper.io/db.v3/lib/sqlbuilder" wfv1 "github.com/argoproj/argo/pkg/apis/workflow/v1alpha1" + "github.com/argoproj/argo/util/instanceid" ) const archiveTableName = "argo_archived_workflows" @@ -44,27 +45,27 @@ type archivedWorkflowLabelRecord struct { } type WorkflowArchive interface { - ArchiveWorkflow(wf *wfv1.Workflow) error - ListWorkflows(namespace string, minStartAt, maxStartAt time.Time, labelRequirements labels.Requirements, limit, offset int) (wfv1.Workflows, error) - GetWorkflow(uid string) (*wfv1.Workflow, error) - DeleteWorkflow(uid string) error - DeleteWorkflows(ttl time.Duration) error + ArchiveWorkflow(ctx context.Context, wf *wfv1.Workflow) error + ListWorkflows(ctx context.Context, namespace string, minStartAt, maxStartAt time.Time, labelRequirements labels.Requirements, limit, offset int) (wfv1.Workflows, error) + GetWorkflow(ctx context.Context, uid string) (*wfv1.Workflow, error) + DeleteWorkflow(ctx context.Context, uid string) error + DeleteWorkflows(ctx context.Context, ttl time.Duration) error } type workflowArchive struct { - session sqlbuilder.Database - clusterName string - managedNamespace string - instanceID string - dbType dbType + session sqlbuilder.Database + clusterName string + managedNamespace string + instanceIDService instanceid.Service + dbType dbType } // NewWorkflowArchive returns a new workflowArchive -func NewWorkflowArchive(session sqlbuilder.Database, clusterName, managedNamespace, instanceID string) WorkflowArchive { - return &workflowArchive{session: session, clusterName: clusterName, managedNamespace: managedNamespace, instanceID: instanceID, dbType: dbTypeFor(session)} +func NewWorkflowArchive(session sqlbuilder.Database, clusterName, managedNamespace string, instanceIDService instanceid.Service) WorkflowArchive { + return &workflowArchive{session: session, clusterName: clusterName, managedNamespace: managedNamespace, instanceIDService: instanceIDService, dbType: dbTypeFor(session)} } -func (r *workflowArchive) ArchiveWorkflow(wf *wfv1.Workflow) error { +func (r *workflowArchive) ArchiveWorkflow(ctx context.Context, wf *wfv1.Workflow) error { logCtx := log.WithFields(log.Fields{"uid": wf.UID, "labels": wf.GetLabels()}) logCtx.Debug("Archiving workflow") workflow, err := json.Marshal(wf) @@ -74,7 +75,7 @@ func (r *workflowArchive) ArchiveWorkflow(wf *wfv1.Workflow) error { return r.session.Tx(context.Background(), func(sess sqlbuilder.Tx) error { _, err := sess. DeleteFrom(archiveTableName). - Where(r.clusterManagedNamespaceAndInstanceID()). + Where(r.clusterManagedNamespaceAndInstanceID(ctx)). And(db.Cond{"uid": wf.UID}). Exec() if err != nil { @@ -84,7 +85,7 @@ func (r *workflowArchive) ArchiveWorkflow(wf *wfv1.Workflow) error { Insert(&archivedWorkflowRecord{ archivedWorkflowMetadata: archivedWorkflowMetadata{ ClusterName: r.clusterName, - InstanceID: r.instanceID, + InstanceID: r.instanceIDService.InstanceID(ctx), UID: string(wf.UID), Name: wf.Name, Namespace: wf.Namespace, @@ -115,7 +116,7 @@ func (r *workflowArchive) ArchiveWorkflow(wf *wfv1.Workflow) error { }) } -func (r *workflowArchive) ListWorkflows(namespace string, minStartedAt, maxStartedAt time.Time, labelRequirements labels.Requirements, limit int, offset int) (wfv1.Workflows, error) { +func (r *workflowArchive) ListWorkflows(ctx context.Context,namespace string, minStartedAt, maxStartedAt time.Time, labelRequirements labels.Requirements, limit int, offset int) (wfv1.Workflows, error) { var archivedWfs []archivedWorkflowMetadata clause, err := labelsClause(r.dbType, labelRequirements) if err != nil { @@ -124,7 +125,7 @@ func (r *workflowArchive) ListWorkflows(namespace string, minStartedAt, maxStart err = r.session. Select("name", "namespace", "uid", "phase", "startedat", "finishedat"). From(archiveTableName). - Where(r.clusterManagedNamespaceAndInstanceID()). + Where(r.clusterManagedNamespaceAndInstanceID(ctx)). And(namespaceEqual(namespace)). And(startedAtClause(minStartedAt, maxStartedAt)). And(clause). @@ -154,11 +155,11 @@ func (r *workflowArchive) ListWorkflows(namespace string, minStartedAt, maxStart return wfs, nil } -func (r *workflowArchive) clusterManagedNamespaceAndInstanceID() db.Compound { +func (r *workflowArchive) clusterManagedNamespaceAndInstanceID(ctx context.Context) db.Compound { return db.And( db.Cond{"clustername": r.clusterName}, namespaceEqual(r.managedNamespace), - db.Cond{"instanceid": r.instanceID}, + db.Cond{"instanceid": r.instanceIDService.InstanceID(ctx)}, ) } @@ -181,12 +182,12 @@ func namespaceEqual(namespace string) db.Cond { } } -func (r *workflowArchive) GetWorkflow(uid string) (*wfv1.Workflow, error) { +func (r *workflowArchive) GetWorkflow(ctx context.Context, uid string) (*wfv1.Workflow, error) { archivedWf := &archivedWorkflowRecord{} err := r.session. Select("workflow"). From(archiveTableName). - Where(r.clusterManagedNamespaceAndInstanceID()). + Where(r.clusterManagedNamespaceAndInstanceID(ctx)). And(db.Cond{"uid": uid}). One(archivedWf) if err != nil { @@ -203,10 +204,10 @@ func (r *workflowArchive) GetWorkflow(uid string) (*wfv1.Workflow, error) { return wf, nil } -func (r *workflowArchive) DeleteWorkflow(uid string) error { +func (r *workflowArchive) DeleteWorkflow(ctx context.Context, uid string) error { rs, err := r.session. DeleteFrom(archiveTableName). - Where(r.clusterManagedNamespaceAndInstanceID()). + Where(r.clusterManagedNamespaceAndInstanceID(ctx)). And(db.Cond{"uid": uid}). Exec() if err != nil { @@ -220,10 +221,10 @@ func (r *workflowArchive) DeleteWorkflow(uid string) error { return nil } -func (r *workflowArchive) DeleteWorkflows(ttl time.Duration) error { +func (r *workflowArchive) DeleteWorkflows(ctx context.Context, ttl time.Duration) error { rs, err := r.session. DeleteFrom(archiveTableName). - Where(r.clusterManagedNamespaceAndInstanceID()). + Where(r.clusterManagedNamespaceAndInstanceID(ctx)). And(fmt.Sprintf("finishedat < current_timestamp - interval '%d' second", int(ttl.Seconds()))). Exec() if err != nil { @@ -235,4 +236,4 @@ func (r *workflowArchive) DeleteWorkflows(ttl time.Duration) error { } log.WithFields(log.Fields{"rowsAffected": rowsAffected}).Info("Deleted archived workflows") return nil -} \ No newline at end of file +} diff --git a/server/apiserver/argoserver.go b/server/apiserver/argoserver.go index 5e1e68a70d16..02c538d0f807 100644 --- a/server/apiserver/argoserver.go +++ b/server/apiserver/argoserver.go @@ -120,6 +120,7 @@ func (as *argoServer) Run(ctx context.Context, port int, browserOpenFunc func(st if err != nil { log.Fatal(err) } + instanceIDService := instanceid.NewService(configMap.InstanceID) var offloadRepo = sqldb.ExplosiveOffloadNodeStatusRepo var wfArchive = sqldb.NullWorkflowArchive persistence := configMap.Persistence @@ -136,10 +137,8 @@ func (as *argoServer) Run(ctx context.Context, port int, browserOpenFunc func(st } // we always enable the archive for the Argo Server, as the Argo Server does not write records, so you can // disable the archiving - and still read old records - wfArchive = sqldb.NewWorkflowArchive(session, persistence.GetClusterName(), as.managedNamespace, configMap.InstanceID) + wfArchive = sqldb.NewWorkflowArchive(session, persistence.GetClusterName(), as.managedNamespace, instanceIDService) } - - instanceIDService := instanceid.NewService(configMap.InstanceID) artifactServer := artifacts.NewArtifactServer(as.authenticator, offloadRepo, wfArchive, instanceIDService) grpcServer := as.newGRPCServer(instanceIDService, offloadRepo, wfArchive, configMap.Links) httpServer := as.newHTTPServer(ctx, port, artifactServer) @@ -196,12 +195,14 @@ func (as *argoServer) newGRPCServer(instanceIDService instanceid.Service, offloa grpcutil.PanicLoggerUnaryServerInterceptor(serverLog), grpcutil.ErrorTranslationUnaryServerInterceptor, as.authenticator.UnaryServerInterceptor(), + instanceIDService.UnaryServerInterceptor(), )), grpc.StreamInterceptor(grpc_middleware.ChainStreamServer( grpc_logrus.StreamServerInterceptor(serverLog), grpcutil.PanicLoggerStreamServerInterceptor(serverLog), grpcutil.ErrorTranslationStreamServerInterceptor, as.authenticator.StreamServerInterceptor(), + instanceIDService.StreamServerInterceptor(), )), } diff --git a/server/artifacts/artifact_server.go b/server/artifacts/artifact_server.go index b0fd063a8d37..233d0702e284 100644 --- a/server/artifacts/artifact_server.go +++ b/server/artifacts/artifact_server.go @@ -166,7 +166,7 @@ func (a *ArtifactServer) getWorkflowAndValidate(ctx context.Context, namespace s if err != nil { return nil, err } - err = a.instanceIDService.Validate(wf) + err = a.instanceIDService.Validate(ctx, wf) if err != nil { return nil, err } @@ -189,7 +189,7 @@ func (a *ArtifactServer) getWorkflowAndValidate(ctx context.Context, namespace s } func (a *ArtifactServer) getWorkflowByUID(ctx context.Context, uid string) (*wfv1.Workflow, error) { - wf, err := a.wfArchive.GetWorkflow(uid) + wf, err := a.wfArchive.GetWorkflow(ctx, uid) if err != nil { return nil, err } diff --git a/server/clusterworkflowtemplate/cluster_workflow_template_server.go b/server/clusterworkflowtemplate/cluster_workflow_template_server.go index 0af013ccdd2f..8bb98e9c24dd 100644 --- a/server/clusterworkflowtemplate/cluster_workflow_template_server.go +++ b/server/clusterworkflowtemplate/cluster_workflow_template_server.go @@ -29,7 +29,7 @@ func (cwts *ClusterWorkflowTemplateServer) CreateClusterWorkflowTemplate(ctx con return nil, fmt.Errorf("cluster workflow template was not found in the request body") } - cwts.instanceIDService.Label(req.Template) + cwts.instanceIDService.Label(ctx, req.Template) cwftmplGetter := templateresolution.WrapClusterWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().ClusterWorkflowTemplates()) @@ -56,7 +56,7 @@ func (cwts *ClusterWorkflowTemplateServer) getTemplateAndValidate(ctx context.Co if err != nil { return nil, err } - err = cwts.instanceIDService.Validate(wfTmpl) + err = cwts.instanceIDService.Validate(ctx, wfTmpl) if err != nil { return nil, err } @@ -69,7 +69,7 @@ func (cwts *ClusterWorkflowTemplateServer) ListClusterWorkflowTemplates(ctx cont if req.ListOptions != nil { options = req.ListOptions } - cwts.instanceIDService.With(options) + cwts.instanceIDService.With(ctx, options) cwfList, err := wfClient.ArgoprojV1alpha1().ClusterWorkflowTemplates().List(*options) if err != nil { return nil, err @@ -95,7 +95,7 @@ func (cwts *ClusterWorkflowTemplateServer) DeleteClusterWorkflowTemplate(ctx con } func (cwts *ClusterWorkflowTemplateServer) LintClusterWorkflowTemplate(ctx context.Context, req *clusterwftmplpkg.ClusterWorkflowTemplateLintRequest) (*v1alpha1.ClusterWorkflowTemplate, error) { - cwts.instanceIDService.Label(req.Template) + cwts.instanceIDService.Label(ctx, req.Template) wfClient := auth.GetWfClient(ctx) cwftmplGetter := templateresolution.WrapClusterWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().ClusterWorkflowTemplates()) @@ -111,7 +111,7 @@ func (cwts *ClusterWorkflowTemplateServer) UpdateClusterWorkflowTemplate(ctx con if req.Template == nil { return nil, fmt.Errorf("ClusterWorkflowTemplate is not found in Request body") } - err := cwts.instanceIDService.Validate(req.Template) + err := cwts.instanceIDService.Validate(ctx, req.Template) if err != nil { return nil, err } diff --git a/server/clusterworkflowtemplate/cluster_workflow_template_server_test.go b/server/clusterworkflowtemplate/cluster_workflow_template_server_test.go index 0d050461e3c6..669b52f6b64c 100644 --- a/server/clusterworkflowtemplate/cluster_workflow_template_server_test.go +++ b/server/clusterworkflowtemplate/cluster_workflow_template_server_test.go @@ -5,15 +5,14 @@ import ( "encoding/json" "testing" - clusterwftmplpkg "github.com/argoproj/argo/pkg/apiclient/clusterworkflowtemplate" - "github.com/argoproj/argo/server/auth" - "github.com/argoproj/argo/util/instanceid" - "github.com/stretchr/testify/assert" "k8s.io/client-go/kubernetes/fake" + clusterwftmplpkg "github.com/argoproj/argo/pkg/apiclient/clusterworkflowtemplate" "github.com/argoproj/argo/pkg/apis/workflow/v1alpha1" wftFake "github.com/argoproj/argo/pkg/client/clientset/versioned/fake" + "github.com/argoproj/argo/server/auth" + "github.com/argoproj/argo/util/instanceid" ) const cwftStr1 = `{ diff --git a/server/cronworkflow/cron_workflow_server.go b/server/cronworkflow/cron_workflow_server.go index fa8bbb86f3c5..cccdae13ab7f 100644 --- a/server/cronworkflow/cron_workflow_server.go +++ b/server/cronworkflow/cron_workflow_server.go @@ -27,7 +27,7 @@ func (c *cronWorkflowServiceServer) LintCronWorkflow(ctx context.Context, req *c wfClient := auth.GetWfClient(ctx) wftmplGetter := templateresolution.WrapWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().WorkflowTemplates(req.Namespace)) cwftmplGetter := templateresolution.WrapClusterWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().ClusterWorkflowTemplates()) - c.instanceIDService.Label(req.CronWorkflow) + c.instanceIDService.Label(ctx, req.CronWorkflow) err := validate.ValidateCronWorkflow(wftmplGetter, cwftmplGetter, req.CronWorkflow) if err != nil { return nil, err @@ -40,7 +40,7 @@ func (c *cronWorkflowServiceServer) ListCronWorkflows(ctx context.Context, req * if req.ListOptions != nil { options = req.ListOptions } - c.instanceIDService.With(options) + c.instanceIDService.With(ctx, options) return auth.GetWfClient(ctx).ArgoprojV1alpha1().CronWorkflows(req.Namespace).List(*options) } @@ -49,7 +49,7 @@ func (c *cronWorkflowServiceServer) CreateCronWorkflow(ctx context.Context, req if req.CronWorkflow == nil { return nil, fmt.Errorf("cron workflow was not found in the request body") } - c.instanceIDService.Label(req.CronWorkflow) + c.instanceIDService.Label(ctx, req.CronWorkflow) wftmplGetter := templateresolution.WrapWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().WorkflowTemplates(req.Namespace)) cwftmplGetter := templateresolution.WrapClusterWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().ClusterWorkflowTemplates()) @@ -96,7 +96,7 @@ func (c *cronWorkflowServiceServer) getCronWorkflowAndValidate(ctx context.Conte if err != nil { return nil, err } - err = c.instanceIDService.Validate(cronWf) + err = c.instanceIDService.Validate(ctx, cronWf) if err != nil { return nil, err } diff --git a/server/workflow/workflow_server.go b/server/workflow/workflow_server.go index ee2b22646ce9..9edcf069d15a 100644 --- a/server/workflow/workflow_server.go +++ b/server/workflow/workflow_server.go @@ -44,7 +44,7 @@ func (s *workflowServer) CreateWorkflow(ctx context.Context, req *workflowpkg.Wo req.Workflow.Namespace = req.Namespace } - s.instanceIDService.Label(req.Workflow) + s.instanceIDService.Label(ctx, req.Workflow) wftmplGetter := templateresolution.WrapWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().WorkflowTemplates(req.Namespace)) cwftmplGetter := templateresolution.WrapClusterWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().ClusterWorkflowTemplates()) @@ -108,7 +108,7 @@ func (s *workflowServer) ListWorkflows(ctx context.Context, req *workflowpkg.Wor if req.ListOptions != nil { listOption = req.ListOptions } - s.instanceIDService.With(listOption) + s.instanceIDService.With(ctx, listOption) wfList, err := wfClient.ArgoprojV1alpha1().Workflows(req.Namespace).List(*listOption) if err != nil { return nil, err @@ -133,18 +133,18 @@ func (s *workflowServer) ListWorkflows(ctx context.Context, req *workflowpkg.Wor } func (s *workflowServer) WatchWorkflows(req *workflowpkg.WatchWorkflowsRequest, ws workflowpkg.WorkflowService_WatchWorkflowsServer) error { - wfClient := auth.GetWfClient(ws.Context()) + ctx := ws.Context() + wfClient := auth.GetWfClient(ctx) opts := &metav1.ListOptions{} if req.ListOptions != nil { opts = req.ListOptions } - s.instanceIDService.With(opts) + s.instanceIDService.With(ctx, opts) watch, err := wfClient.ArgoprojV1alpha1().Workflows(req.Namespace).Watch(*opts) if err != nil { return err } defer watch.Stop() - ctx := ws.Context() log.Debug("Piping events to channel") @@ -319,7 +319,7 @@ func (s *workflowServer) LintWorkflow(ctx context.Context, req *workflowpkg.Work wfClient := auth.GetWfClient(ctx) wftmplGetter := templateresolution.WrapWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().WorkflowTemplates(req.Namespace)) cwftmplGetter := templateresolution.WrapClusterWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().ClusterWorkflowTemplates()) - s.instanceIDService.Label(req.Workflow) + s.instanceIDService.Label(ctx, req.Workflow) _, err := validate.ValidateWorkflow(wftmplGetter, cwftmplGetter, req.Workflow, validate.ValidateOpts{Lint: true}) @@ -347,7 +347,7 @@ func (s *workflowServer) getWorkflowAndValidate(ctx context.Context, namespace s if err != nil { return nil, err } - err = s.instanceIDService.Validate(wf) + err = s.instanceIDService.Validate(ctx, wf) if err != nil { return nil, err } @@ -382,7 +382,7 @@ func (s *workflowServer) SubmitWorkflow(ctx context.Context, req *workflowpkg.Wo } - s.instanceIDService.Label(wf) + s.instanceIDService.Label(ctx, wf) err := util.ApplySubmitOpts(wf, req.SubmitOptions) if err != nil { return nil, err diff --git a/server/workflowarchive/archived_workflow_server.go b/server/workflowarchive/archived_workflow_server.go index ea513ac49230..20d1fc90faf4 100644 --- a/server/workflowarchive/archived_workflow_server.go +++ b/server/workflowarchive/archived_workflow_server.go @@ -88,7 +88,7 @@ func (w *archivedWorkflowServer) ListArchivedWorkflows(ctx context.Context, req hasMore := true // keep trying until we have enough for len(items) < limit { - moreItems, err := w.wfArchive.ListWorkflows(namespace, minStartedAt, maxStartedAt, requirements, limit+1, offset) + moreItems, err := w.wfArchive.ListWorkflows(ctx, namespace, minStartedAt, maxStartedAt, requirements, limit+1, offset) if err != nil { return nil, err } @@ -113,7 +113,7 @@ func (w *archivedWorkflowServer) ListArchivedWorkflows(ctx context.Context, req } func (w *archivedWorkflowServer) GetArchivedWorkflow(ctx context.Context, req *workflowarchivepkg.GetArchivedWorkflowRequest) (*wfv1.Workflow, error) { - wf, err := w.wfArchive.GetWorkflow(req.Uid) + wf, err := w.wfArchive.GetWorkflow(ctx, req.Uid) if err != nil { return nil, err } @@ -142,7 +142,7 @@ func (w *archivedWorkflowServer) DeleteArchivedWorkflow(ctx context.Context, req if !allowed { return nil, status.Error(codes.PermissionDenied, "permission denied") } - err = w.wfArchive.DeleteWorkflow(req.Uid) + err = w.wfArchive.DeleteWorkflow(ctx, req.Uid) if err != nil { return nil, err } diff --git a/server/workflowarchive/archived_workflow_server_test.go b/server/workflowarchive/archived_workflow_server_test.go index dbdd2257807e..5e0d267cf730 100644 --- a/server/workflowarchive/archived_workflow_server_test.go +++ b/server/workflowarchive/archived_workflow_server_test.go @@ -6,6 +6,7 @@ import ( "time" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" authorizationv1 "k8s.io/api/authorization/v1" @@ -46,13 +47,13 @@ func Test_archivedWorkflowServer(t *testing.T) { }, nil }) // two pages of results for limit 1 - repo.On("ListWorkflows", "", time.Time{}, time.Time{}, labels.Requirements(nil), 2, 0).Return(wfv1.Workflows{{}, {}}, nil) - repo.On("ListWorkflows", "", time.Time{}, time.Time{}, labels.Requirements(nil), 2, 1).Return(wfv1.Workflows{{}}, nil) + repo.On("ListWorkflows", mock.Anything, "", time.Time{}, time.Time{}, labels.Requirements(nil), 2, 0).Return(wfv1.Workflows{{}, {}}, nil) + repo.On("ListWorkflows", mock.Anything, "", time.Time{}, time.Time{}, labels.Requirements(nil), 2, 1).Return(wfv1.Workflows{{}}, nil) minStartAt, _ := time.Parse(time.RFC3339, "2020-01-01T00:00:00Z") maxStartAt, _ := time.Parse(time.RFC3339, "2020-01-02T00:00:00Z") - repo.On("ListWorkflows", "", minStartAt, maxStartAt, labels.Requirements(nil), 2, 0).Return(wfv1.Workflows{{}}, nil) - repo.On("GetWorkflow", "").Return(nil, nil) - repo.On("GetWorkflow", "my-uid").Return(&wfv1.Workflow{ + repo.On("ListWorkflows", mock.Anything, "", minStartAt, maxStartAt, labels.Requirements(nil), 2, 0).Return(wfv1.Workflows{{}}, nil) + repo.On("GetWorkflow", mock.Anything, "").Return(nil, nil) + repo.On("GetWorkflow", mock.Anything, "my-uid").Return(&wfv1.Workflow{ ObjectMeta: metav1.ObjectMeta{Name: "my-name"}, Spec: wfv1.WorkflowSpec{ Entrypoint: "my-entrypoint", @@ -66,7 +67,7 @@ func Test_archivedWorkflowServer(t *testing.T) { ObjectMeta: metav1.ObjectMeta{Name: "my-name-resubmitted"}, }, nil }) - repo.On("DeleteWorkflow", "my-uid").Return(nil) + repo.On("DeleteWorkflow", mock.Anything, "my-uid").Return(nil) ctx := context.WithValue(context.WithValue(context.TODO(), auth.WfKey, wfClient), auth.KubeKey, kubeClient) t.Run("ListArchivedWorkflows", func(t *testing.T) { diff --git a/server/workflowtemplate/workflow_template_server.go b/server/workflowtemplate/workflow_template_server.go index 0f1ab880be1e..a2ce2adba318 100644 --- a/server/workflowtemplate/workflow_template_server.go +++ b/server/workflowtemplate/workflow_template_server.go @@ -28,7 +28,7 @@ func (wts *WorkflowTemplateServer) CreateWorkflowTemplate(ctx context.Context, r if req.Template == nil { return nil, fmt.Errorf("workflow template was not found in the request body") } - wts.instanceIDService.Label(req.Template) + wts.instanceIDService.Label(ctx, req.Template) wftmplGetter := templateresolution.WrapWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().WorkflowTemplates(req.Namespace)) cwftmplGetter := templateresolution.WrapClusterWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().ClusterWorkflowTemplates()) @@ -52,7 +52,7 @@ func (wts *WorkflowTemplateServer) getTemplateAndValidate(ctx context.Context, n if err != nil { return nil, err } - err = wts.instanceIDService.Validate(wfTmpl) + err = wts.instanceIDService.Validate(ctx, wfTmpl) if err != nil { return nil, err } @@ -65,7 +65,7 @@ func (wts *WorkflowTemplateServer) ListWorkflowTemplates(ctx context.Context, re if req.ListOptions != nil { options = req.ListOptions } - wts.instanceIDService.With(options) + wts.instanceIDService.With(ctx, options) wfList, err := wfClient.ArgoprojV1alpha1().WorkflowTemplates(req.Namespace).List(*options) if err != nil { return nil, err @@ -92,7 +92,7 @@ func (wts *WorkflowTemplateServer) DeleteWorkflowTemplate(ctx context.Context, r func (wts *WorkflowTemplateServer) LintWorkflowTemplate(ctx context.Context, req *workflowtemplatepkg.WorkflowTemplateLintRequest) (*v1alpha1.WorkflowTemplate, error) { wfClient := auth.GetWfClient(ctx) - wts.instanceIDService.Label(req.Template) + wts.instanceIDService.Label(ctx, req.Template) wftmplGetter := templateresolution.WrapWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().WorkflowTemplates(req.Namespace)) cwftmplGetter := templateresolution.WrapClusterWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().ClusterWorkflowTemplates()) @@ -109,7 +109,7 @@ func (wts *WorkflowTemplateServer) UpdateWorkflowTemplate(ctx context.Context, r if req.Template == nil { return nil, fmt.Errorf("WorkflowTemplate is not found in Request body") } - err := wts.instanceIDService.Validate(req.Template) + err := wts.instanceIDService.Validate(ctx, req.Template) if err != nil { return nil, err } diff --git a/server/workflowtemplate/workflow_template_server_test.go b/server/workflowtemplate/workflow_template_server_test.go index e14db35d295c..6cb7724c58e8 100644 --- a/server/workflowtemplate/workflow_template_server_test.go +++ b/server/workflowtemplate/workflow_template_server_test.go @@ -5,15 +5,14 @@ import ( "encoding/json" "testing" - workflowtemplatepkg "github.com/argoproj/argo/pkg/apiclient/workflowtemplate" - "github.com/argoproj/argo/server/auth" - "github.com/argoproj/argo/util/instanceid" - "github.com/stretchr/testify/assert" "k8s.io/client-go/kubernetes/fake" + workflowtemplatepkg "github.com/argoproj/argo/pkg/apiclient/workflowtemplate" "github.com/argoproj/argo/pkg/apis/workflow/v1alpha1" wftFake "github.com/argoproj/argo/pkg/client/clientset/versioned/fake" + "github.com/argoproj/argo/server/auth" + "github.com/argoproj/argo/util/instanceid" ) const wftStr1 = `{ diff --git a/test/e2e/fixtures/e2e_suite.go b/test/e2e/fixtures/e2e_suite.go index 2e456e0b27ff..498af12d0757 100644 --- a/test/e2e/fixtures/e2e_suite.go +++ b/test/e2e/fixtures/e2e_suite.go @@ -2,6 +2,7 @@ package fixtures import ( "bufio" + "context" "encoding/base64" "os" "strings" @@ -191,10 +192,10 @@ func (s *E2ESuite) DeleteResources(label string) { archive := s.Persistence.workflowArchive parse, err := labels.ParseToRequirements(Label) s.CheckError(err) - workflows, err := archive.ListWorkflows(Namespace, time.Time{}, time.Time{}, parse, 0, 0) + workflows, err := archive.ListWorkflows(context.Background(), Namespace, time.Time{}, time.Time{}, parse, 0, 0) s.CheckError(err) for _, workflow := range workflows { - err := archive.DeleteWorkflow(string(workflow.UID)) + err := archive.DeleteWorkflow(context.Background(), string(workflow.UID)) s.CheckError(err) } } diff --git a/test/e2e/fixtures/persistence.go b/test/e2e/fixtures/persistence.go index 07e7cb101b98..aa81a5d700a5 100644 --- a/test/e2e/fixtures/persistence.go +++ b/test/e2e/fixtures/persistence.go @@ -6,6 +6,7 @@ import ( "github.com/argoproj/argo/config" "github.com/argoproj/argo/persist/sqldb" + "github.com/argoproj/argo/util/instanceid" ) type Persistence struct { @@ -36,7 +37,8 @@ func newPersistence(kubeClient kubernetes.Interface) *Persistence { if err != nil { panic(err) } - workflowArchive := sqldb.NewWorkflowArchive(session, persistence.GetClusterName(), Namespace, wcConfig.InstanceID) + instanceIDService := instanceid.NewService(wcConfig.InstanceID) + workflowArchive := sqldb.NewWorkflowArchive(session, persistence.GetClusterName(), Namespace, instanceIDService) return &Persistence{session, offloadNodeStatusRepo, workflowArchive} } else { return &Persistence{offloadNodeStatusRepo: sqldb.ExplosiveOffloadNodeStatusRepo, workflowArchive: sqldb.NullWorkflowArchive} diff --git a/util/instanceid/service.go b/util/instanceid/service.go index 47be185c9496..8eb0d93b768b 100644 --- a/util/instanceid/service.go +++ b/util/instanceid/service.go @@ -1,29 +1,43 @@ package instanceid import ( + "context" "fmt" + "strings" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/argoproj/argo/util/labels" + "github.com/argoproj/argo/util/marker" "github.com/argoproj/argo/workflow/common" ) type Service interface { - Label(obj metav1.Object) - With(options *metav1.ListOptions) - Validate(w metav1.Object) error + marker.Service + Label(ctx context.Context, obj metav1.Object) + With(ctx context.Context, options *metav1.ListOptions) + Validate(ctx context.Context, obj metav1.Object) error + InstanceID(ctx context.Context) string +} + +func NewService(instanceId string) Service { + return &service{marker.NewService(func(fullMethod string) bool { + return strings.HasPrefix(fullMethod, "/info.InfoService/") + }), instanceId} } type service struct { + marker.Service instanceID string } -func NewService(instanceId string) Service { - return &service{instanceId} +func (s *service) InstanceID(ctx context.Context) string { + s.Mark(ctx) + return s.instanceID } -func (s *service) Label(obj metav1.Object) { +func (s *service) Label(ctx context.Context, obj metav1.Object) { + s.Mark(ctx) if s.instanceID != "" { labels.Label(obj, common.LabelKeyControllerInstanceID, s.instanceID) } else { @@ -31,7 +45,8 @@ func (s *service) Label(obj metav1.Object) { } } -func (s *service) With(opts *metav1.ListOptions) { +func (s *service) With(ctx context.Context, opts *metav1.ListOptions) { + s.Mark(ctx) if len(opts.LabelSelector) > 0 { opts.LabelSelector += "," } @@ -42,7 +57,8 @@ func (s *service) With(opts *metav1.ListOptions) { } } -func (s *service) Validate(obj metav1.Object) error { +func (s *service) Validate(ctx context.Context, obj metav1.Object) error { + s.Mark(ctx) l := obj.GetLabels() if s.instanceID == "" { if _, ok := l[common.LabelKeyControllerInstanceID]; !ok { diff --git a/util/instanceid/service_test.go b/util/instanceid/service_test.go index bfc7451bd830..7bf0d5c5cf70 100644 --- a/util/instanceid/service_test.go +++ b/util/instanceid/service_test.go @@ -1,6 +1,7 @@ package instanceid import ( + "context" "testing" "github.com/stretchr/testify/assert" @@ -13,18 +14,18 @@ import ( func TestLabel(t *testing.T) { t.Run("Empty", func(t *testing.T) { obj := &wfv1.Workflow{} - NewService("").Label(obj) + NewService("").Label(context.Background(), obj) assert.Empty(t, obj.GetLabels()) }) t.Run("Add", func(t *testing.T) { obj := &wfv1.Workflow{} - NewService("foo").Label(obj) + NewService("foo").Label(context.Background(), obj) assert.Len(t, obj.GetLabels(), 1) assert.Equal(t, "foo", obj.GetLabels()[common.LabelKeyControllerInstanceID]) }) t.Run("Remove", func(t *testing.T) { obj := &wfv1.Workflow{ObjectMeta: metav1.ObjectMeta{Labels: map[string]string{common.LabelKeyControllerInstanceID: "bar"}}} - NewService("").Label(obj) + NewService("").Label(context.Background(), obj) assert.Empty(t, obj.GetLabels()) }) } @@ -32,12 +33,12 @@ func TestLabel(t *testing.T) { func TestWith(t *testing.T) { t.Run("Empty", func(t *testing.T) { opts := &metav1.ListOptions{} - NewService("").With(opts) + NewService("").With(context.Background(), opts) assert.Equal(t, "!workflows.argoproj.io/controller-instanceid", opts.LabelSelector) }) t.Run("ExistingSelector", func(t *testing.T) { opts := &metav1.ListOptions{LabelSelector: "foo"} - NewService("").With(opts) + NewService("").With(context.Background(), opts) assert.Equal(t, "foo,!workflows.argoproj.io/controller-instanceid", opts.LabelSelector) }) } @@ -45,13 +46,13 @@ func TestWith(t *testing.T) { func TestValidate(t *testing.T) { t.Run("NoInstanceID", func(t *testing.T) { s := NewService("") - assert.NoError(t, s.Validate(&wfv1.Workflow{})) - assert.Error(t, s.Validate(&wfv1.Workflow{ObjectMeta: metav1.ObjectMeta{Labels: map[string]string{common.LabelKeyControllerInstanceID: "bar"}}})) + assert.NoError(t, s.Validate(context.Background(), &wfv1.Workflow{})) + assert.Error(t, s.Validate(context.Background(), &wfv1.Workflow{ObjectMeta: metav1.ObjectMeta{Labels: map[string]string{common.LabelKeyControllerInstanceID: "bar"}}})) }) t.Run("InstanceID", func(t *testing.T) { s := NewService("foo") - assert.Error(t, s.Validate(&wfv1.Workflow{})) - assert.Error(t, s.Validate(&wfv1.Workflow{ObjectMeta: metav1.ObjectMeta{Labels: map[string]string{common.LabelKeyControllerInstanceID: "bar"}}})) - assert.NoError(t, s.Validate(&wfv1.Workflow{ObjectMeta: metav1.ObjectMeta{Labels: map[string]string{common.LabelKeyControllerInstanceID: "foo"}}})) + assert.Error(t, s.Validate(context.Background(), &wfv1.Workflow{})) + assert.Error(t, s.Validate(context.Background(), &wfv1.Workflow{ObjectMeta: metav1.ObjectMeta{Labels: map[string]string{common.LabelKeyControllerInstanceID: "bar"}}})) + assert.NoError(t, s.Validate(context.Background(), &wfv1.Workflow{ObjectMeta: metav1.ObjectMeta{Labels: map[string]string{common.LabelKeyControllerInstanceID: "foo"}}})) }) } diff --git a/util/marker/service.go b/util/marker/service.go new file mode 100644 index 000000000000..72d61393fddf --- /dev/null +++ b/util/marker/service.go @@ -0,0 +1,79 @@ +package marker + +import ( + "context" + "math/rand" + + grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware" + log "github.com/sirupsen/logrus" + "google.golang.org/grpc" +) + +/* + A marker service is an abstract service. + + At the start of the request, we create a random marker and put it into the context. + + Any sub-types should invoke the `Mark` method to indicate the expected this happened. + + At the end of the request, we check the marker and panic if it was not ticked off. +*/ +type Service interface { + Mark(ctx context.Context) + UnaryServerInterceptor() grpc.UnaryServerInterceptor + StreamServerInterceptor() grpc.StreamServerInterceptor +} + +func NewService(ignore func(fullMethod string) bool) Service { + return &service{struct{}{}, make(map[int]bool), ignore} +} + +type service struct { + markerKey struct{} + markers map[int]bool + ignore func(fullMethod string) bool +} + +func (s *service) context(ctx context.Context) (func(), context.Context, int) { + marker := rand.Int() + return func() { delete(s.markers, marker) }, context.WithValue(ctx, s.markerKey, marker), marker +} + +func (s *service) Mark(ctx context.Context) { + marker, ok := ctx.Value(s.markerKey).(int) + if ok { + s.markers[marker] = true + } +} + +func (s *service) check(fullMethod string, marker int) { + if s.ignore(fullMethod) { + return + } + _, ok := s.markers[marker] + logCtx := log.WithField("fullMethod", fullMethod) + if !ok { + logCtx.Fatal("marker not found - this should never happen") + } +} + +func (s *service) StreamServerInterceptor() grpc.StreamServerInterceptor { + return func(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error { + closer, ctx, marker := s.context(ss.Context()) + defer closer() + wrapped := grpc_middleware.WrapServerStream(ss) + wrapped.WrappedContext = ctx + err := handler(srv, wrapped) + s.check(info.FullMethod, marker) + return err + } +} +func (s *service) UnaryServerInterceptor() grpc.UnaryServerInterceptor { + return func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error) { + closer, ctx, marker := s.context(ctx) + defer closer() + i, err := handler(ctx, req) + s.check(info.FullMethod, marker) + return i, err + } +} diff --git a/util/marker/service_test.go b/util/marker/service_test.go new file mode 100644 index 000000000000..89c9c6af4b23 --- /dev/null +++ b/util/marker/service_test.go @@ -0,0 +1,37 @@ +package marker + +import ( + "context" + "testing" + + "github.com/stretchr/testify/assert" + "google.golang.org/grpc" +) + +func TestNewService(t *testing.T) { + s := NewService(func(fullMethod string) bool { + return fullMethod == "ignore" + }) + t.Run("Unary", func(t *testing.T) { + resp, err := s.UnaryServerInterceptor()(context.Background(), nil, &grpc.UnaryServerInfo{}, func(ctx context.Context, req interface{}) (interface{}, error) { + s.Mark(ctx) + return "my-resp", nil + }) + if assert.NoError(t, err) { + assert.Equal(t, "my-resp", resp) + } + }) + t.Run("Ignore", func(t *testing.T) { + _, err := s.UnaryServerInterceptor()(context.Background(), nil, &grpc.UnaryServerInfo{FullMethod: "ignore"}, func(ctx context.Context, req interface{}) (interface{}, error) { + return nil, nil + }) + assert.NoError(t, err) + }) + t.Run("Stream", func(t *testing.T) { + err := s.StreamServerInterceptor()("", &testServerStream{}, &grpc.StreamServerInfo{}, func(srv interface{}, ss grpc.ServerStream) error { + s.Mark(ss.Context()) + return nil + }) + assert.NoError(t, err) + }) +} diff --git a/util/marker/test_server_stream_test.go b/util/marker/test_server_stream_test.go new file mode 100644 index 000000000000..2b677f6eaec2 --- /dev/null +++ b/util/marker/test_server_stream_test.go @@ -0,0 +1,37 @@ +package marker + +import ( + "context" + + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" +) + +type testServerStream struct { +} + +var _ grpc.ServerStream = &testServerStream{} + +func (t testServerStream) SetHeader(md metadata.MD) error { + panic("implement me") +} + +func (t testServerStream) SendHeader(md metadata.MD) error { + panic("implement me") +} + +func (t testServerStream) SetTrailer(md metadata.MD) { + panic("implement me") +} + +func (t testServerStream) Context() context.Context { + return context.Background() +} + +func (t testServerStream) SendMsg(m interface{}) error { + panic("implement me") +} + +func (t testServerStream) RecvMsg(m interface{}) error { + panic("implement me") +} diff --git a/workflow/controller/config.go b/workflow/controller/config.go index 6886aea81415..1f58b72aedff 100644 --- a/workflow/controller/config.go +++ b/workflow/controller/config.go @@ -12,6 +12,7 @@ import ( "github.com/argoproj/argo/config" "github.com/argoproj/argo/errors" "github.com/argoproj/argo/persist/sqldb" + "github.com/argoproj/argo/util/instanceid" ) func (wfc *WorkflowController) updateConfig(config config.Config) error { @@ -57,7 +58,8 @@ func (wfc *WorkflowController) updateConfig(config config.Config) error { log.Info("Node status offloading is disabled") } if persistence.Archive { - wfc.wfArchive = sqldb.NewWorkflowArchive(session, persistence.GetClusterName(), wfc.managedNamespace, wfc.Config.InstanceID) + instanceIDService := instanceid.NewService(wfc.Config.InstanceID) + wfc.wfArchive = sqldb.NewWorkflowArchive(session, persistence.GetClusterName(), wfc.managedNamespace, instanceIDService) log.Info("Workflow archiving is enabled") } else { log.Info("Workflow archiving is disabled") diff --git a/workflow/controller/controller.go b/workflow/controller/controller.go index 1e0056772283..1007e74585f4 100644 --- a/workflow/controller/controller.go +++ b/workflow/controller/controller.go @@ -382,7 +382,7 @@ func (wfc *WorkflowController) archivedWorkflowGarbageCollector(stopCh <-chan st return case <-ticker.C: log.Info("Performing archived workflow GC") - err := wfc.wfArchive.DeleteWorkflows(time.Duration(ttl)) + err := wfc.wfArchive.DeleteWorkflows(context.Background(), time.Duration(ttl)) if err != nil { log.WithField("err", err).Error("Failed to delete archived workflows") } diff --git a/workflow/controller/operator.go b/workflow/controller/operator.go index e24334f16a8d..a05838ded346 100644 --- a/workflow/controller/operator.go +++ b/workflow/controller/operator.go @@ -1,6 +1,7 @@ package controller import ( + "context" "encoding/json" "fmt" "math" @@ -1587,7 +1588,7 @@ func (woc *wfOperationCtx) markWorkflowPhase(phase wfv1.NodePhase, markCompleted woc.updated = true woc.wf.Status.Message = err.Error() } - err = woc.controller.wfArchive.ArchiveWorkflow(woc.wf) + err = woc.controller.wfArchive.ArchiveWorkflow(context.Background(), woc.wf) if err != nil { woc.log.WithField("err", err).Error("Failed to archive workflow") } From 4bc5e6a365284c1609234b3073525b0a82ea1b64 Mon Sep 17 00:00:00 2001 From: Alex Collins Date: Fri, 24 Apr 2020 16:03:06 -0700 Subject: [PATCH 08/15] changes --- persist/sqldb/workflow_archive.go | 2 +- server/artifacts/artifact_server.go | 6 ++++ .../cronworkflow/cron_workflow_server_test.go | 9 ++++++ test/e2e/ui/ui-long-workflow.yaml | 11 ------- util/instanceid/service.go | 4 +++ util/instanceid/service_test.go | 11 ++++++- util/marker/service.go | 29 +++++++++---------- util/marker/test_server_stream_test.go | 1 + 8 files changed, 45 insertions(+), 28 deletions(-) delete mode 100644 test/e2e/ui/ui-long-workflow.yaml diff --git a/persist/sqldb/workflow_archive.go b/persist/sqldb/workflow_archive.go index 7a35d063a416..ba687de7f3d1 100644 --- a/persist/sqldb/workflow_archive.go +++ b/persist/sqldb/workflow_archive.go @@ -116,7 +116,7 @@ func (r *workflowArchive) ArchiveWorkflow(ctx context.Context, wf *wfv1.Workflow }) } -func (r *workflowArchive) ListWorkflows(ctx context.Context,namespace string, minStartedAt, maxStartedAt time.Time, labelRequirements labels.Requirements, limit int, offset int) (wfv1.Workflows, error) { +func (r *workflowArchive) ListWorkflows(ctx context.Context, namespace string, minStartedAt, maxStartedAt time.Time, labelRequirements labels.Requirements, limit int, offset int) (wfv1.Workflows, error) { var archivedWfs []archivedWorkflowMetadata clause, err := labelsClause(r.dbType, labelRequirements) if err != nil { diff --git a/server/artifacts/artifact_server.go b/server/artifacts/artifact_server.go index 233d0702e284..88ee41f86cb9 100644 --- a/server/artifacts/artifact_server.go +++ b/server/artifacts/artifact_server.go @@ -41,6 +41,9 @@ func (a *ArtifactServer) GetArtifact(w http.ResponseWriter, r *http.Request) { _, _ = w.Write([]byte(err.Error())) return } + _, ctx, marker := a.instanceIDService.ContextWithMarker(ctx) + defer a.instanceIDService.Check("", marker) + path := strings.SplitN(r.URL.Path, "/", 6) namespace := path[2] @@ -72,6 +75,9 @@ func (a *ArtifactServer) GetArtifactByUID(w http.ResponseWriter, r *http.Request _, _ = w.Write([]byte(err.Error())) return } + _, ctx, marker := a.instanceIDService.ContextWithMarker(ctx) + defer a.instanceIDService.Check("", marker) + path := strings.SplitN(r.URL.Path, "/", 6) uid := path[2] diff --git a/server/cronworkflow/cron_workflow_server_test.go b/server/cronworkflow/cron_workflow_server_test.go index 332c0b868631..e33ab7598896 100644 --- a/server/cronworkflow/cron_workflow_server_test.go +++ b/server/cronworkflow/cron_workflow_server_test.go @@ -56,6 +56,15 @@ spec: assert.NotNil(t, created) } }) + t.Run("LintWorkflow", func(t *testing.T) { + wf, err := server.LintCronWorkflow(ctx, &cronworkflowpkg.LintCronWorkflowRequest{ + Namespace: "my-ns", + CronWorkflow: &cronWf, + }) + if assert.NoError(t, err) { + assert.NotNil(t, wf) + } + }) t.Run("ListCronWorkflows", func(t *testing.T) { cronWfs, err := server.ListCronWorkflows(ctx, &cronworkflowpkg.ListCronWorkflowsRequest{Namespace: "my-ns"}) if assert.NoError(t, err) { diff --git a/test/e2e/ui/ui-long-workflow.yaml b/test/e2e/ui/ui-long-workflow.yaml deleted file mode 100644 index d96cb8feb198..000000000000 --- a/test/e2e/ui/ui-long-workflow.yaml +++ /dev/null @@ -1,11 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Workflow -metadata: - name: long-workflow -spec: - entrypoint: plan - templates: - - name: plan - container: - image: docker/whalesay:latest - command: [sh, -c, sleep 90] \ No newline at end of file diff --git a/util/instanceid/service.go b/util/instanceid/service.go index 8eb0d93b768b..4eb03280c636 100644 --- a/util/instanceid/service.go +++ b/util/instanceid/service.go @@ -12,6 +12,10 @@ import ( "github.com/argoproj/argo/workflow/common" ) +/* +It might seem that a whole service for instance ID is overkill, but by extending `marker.Service` we +can check at runtime that we actually used instance ID during a request. +*/ type Service interface { marker.Service Label(ctx context.Context, obj metav1.Object) diff --git a/util/instanceid/service_test.go b/util/instanceid/service_test.go index 7bf0d5c5cf70..09ad397d5e2b 100644 --- a/util/instanceid/service_test.go +++ b/util/instanceid/service_test.go @@ -36,11 +36,16 @@ func TestWith(t *testing.T) { NewService("").With(context.Background(), opts) assert.Equal(t, "!workflows.argoproj.io/controller-instanceid", opts.LabelSelector) }) - t.Run("ExistingSelector", func(t *testing.T) { + t.Run("EmptyExistingSelector", func(t *testing.T) { opts := &metav1.ListOptions{LabelSelector: "foo"} NewService("").With(context.Background(), opts) assert.Equal(t, "foo,!workflows.argoproj.io/controller-instanceid", opts.LabelSelector) }) + t.Run("ExistingSelector", func(t *testing.T) { + opts := &metav1.ListOptions{LabelSelector: "foo"} + NewService("foo").With(context.Background(), opts) + assert.Equal(t, "foo,workflows.argoproj.io/controller-instanceid=foo", opts.LabelSelector) + }) } func TestValidate(t *testing.T) { @@ -56,3 +61,7 @@ func TestValidate(t *testing.T) { assert.NoError(t, s.Validate(context.Background(), &wfv1.Workflow{ObjectMeta: metav1.ObjectMeta{Labels: map[string]string{common.LabelKeyControllerInstanceID: "foo"}}})) }) } + +func Test_service_InstanceID(t *testing.T) { + assert.Equal(t, "foo", NewService("foo").InstanceID(context.Background())) +} \ No newline at end of file diff --git a/util/marker/service.go b/util/marker/service.go index 72d61393fddf..01b358932bf8 100644 --- a/util/marker/service.go +++ b/util/marker/service.go @@ -12,14 +12,14 @@ import ( /* A marker service is an abstract service. - At the start of the request, we create a random marker and put it into the context. - - Any sub-types should invoke the `Mark` method to indicate the expected this happened. - - At the end of the request, we check the marker and panic if it was not ticked off. + 1. At the start of the request, `ContextWithMarker` creates a random marker and puts it into the context. + 2. Any sub-types then invokes `Mark` to indicate the expected this happened. + 3. At the end of the request `Check` checks the marker and panics if it was not marked. */ type Service interface { + ContextWithMarker(ctx context.Context) (func(), context.Context, int) Mark(ctx context.Context) + Check(fullMethod string, marker int) UnaryServerInterceptor() grpc.UnaryServerInterceptor StreamServerInterceptor() grpc.StreamServerInterceptor } @@ -31,10 +31,10 @@ func NewService(ignore func(fullMethod string) bool) Service { type service struct { markerKey struct{} markers map[int]bool - ignore func(fullMethod string) bool + ignore func(operation string) bool } -func (s *service) context(ctx context.Context) (func(), context.Context, int) { +func (s *service) ContextWithMarker(ctx context.Context) (func(), context.Context, int) { marker := rand.Int() return func() { delete(s.markers, marker) }, context.WithValue(ctx, s.markerKey, marker), marker } @@ -46,34 +46,33 @@ func (s *service) Mark(ctx context.Context) { } } -func (s *service) check(fullMethod string, marker int) { - if s.ignore(fullMethod) { +func (s *service) Check(operation string, marker int) { + if s.ignore(operation) { return } _, ok := s.markers[marker] - logCtx := log.WithField("fullMethod", fullMethod) if !ok { - logCtx.Fatal("marker not found - this should never happen") + log.WithField("operation", operation).Fatal("marker not found - this should never happen") } } func (s *service) StreamServerInterceptor() grpc.StreamServerInterceptor { return func(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error { - closer, ctx, marker := s.context(ss.Context()) + closer, ctx, marker := s.ContextWithMarker(ss.Context()) defer closer() wrapped := grpc_middleware.WrapServerStream(ss) wrapped.WrappedContext = ctx err := handler(srv, wrapped) - s.check(info.FullMethod, marker) + s.Check(info.FullMethod, marker) return err } } func (s *service) UnaryServerInterceptor() grpc.UnaryServerInterceptor { return func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error) { - closer, ctx, marker := s.context(ctx) + closer, ctx, marker := s.ContextWithMarker(ctx) defer closer() i, err := handler(ctx, req) - s.check(info.FullMethod, marker) + s.Check(info.FullMethod, marker) return i, err } } diff --git a/util/marker/test_server_stream_test.go b/util/marker/test_server_stream_test.go index 2b677f6eaec2..cca097a1ca4e 100644 --- a/util/marker/test_server_stream_test.go +++ b/util/marker/test_server_stream_test.go @@ -10,6 +10,7 @@ import ( type testServerStream struct { } +// the only purpose of this line is to make sure testServerStream implements ServerStream var _ grpc.ServerStream = &testServerStream{} func (t testServerStream) SetHeader(md metadata.MD) error { From bc51e1425060d267aee8682a98158397ae2bdd7e Mon Sep 17 00:00:00 2001 From: Alex Collins Date: Fri, 24 Apr 2020 16:37:25 -0700 Subject: [PATCH 09/15] changes --- server/workflow/test_server_stream_test.go | 38 ++++++ server/workflow/workflow_server_test.go | 133 +++++++++++++++++---- 2 files changed, 150 insertions(+), 21 deletions(-) create mode 100644 server/workflow/test_server_stream_test.go diff --git a/server/workflow/test_server_stream_test.go b/server/workflow/test_server_stream_test.go new file mode 100644 index 000000000000..6f7211d351f5 --- /dev/null +++ b/server/workflow/test_server_stream_test.go @@ -0,0 +1,38 @@ +package workflow + +import ( + "context" + + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" +) + +type testServerStream struct { + ctx context.Context +} + +var _ grpc.ServerStream = &testServerStream{} + +func (t testServerStream) SetHeader(md metadata.MD) error { + panic("implement me") +} + +func (t testServerStream) SendHeader(md metadata.MD) error { + panic("implement me") +} + +func (t testServerStream) SetTrailer(md metadata.MD) { + panic("implement me") +} + +func (t testServerStream) Context() context.Context { + return t.ctx +} + +func (t testServerStream) SendMsg(interface{}) error { + panic("implement me") +} + +func (t testServerStream) RecvMsg(interface{}) error { + panic("implement me") +} diff --git a/server/workflow/workflow_server_test.go b/server/workflow/workflow_server_test.go index fe41417a6cb3..ff6dbe062c47 100644 --- a/server/workflow/workflow_server_test.go +++ b/server/workflow/workflow_server_test.go @@ -6,8 +6,10 @@ import ( "fmt" "testing" + "github.com/argoproj/pkg/errors" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" + corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/util/rand" "k8s.io/client-go/kubernetes/fake" @@ -332,6 +334,34 @@ const wf5 = ` } } ` + +const failedWf = ` +{ + "apiVersion": "argoproj.io/v1alpha1", + "kind": "Workflow", + "metadata": { + "name": "failed", + "namespace": "workflows", + "labels": { + "workflows.argoproj.io/controller-instanceid": "my-instanceid" + } + }, + "spec": { + "entrypoint": "whalesay", + "templates": [ + { + "container": { + "image": "docker/whalesay:latest" + }, + "name": "whalesay" + } + ] + }, + "status": { + "phase": "Failed" + } +} +` const workflow1 = ` { "namespace": "default", @@ -488,26 +518,27 @@ const clusterworkflowtmpl = ` func getWorkflowServer() (workflowpkg.WorkflowServiceServer, context.Context) { - var wfObj1, wfObj2, wfObj3, wfObj4, wfObj5 v1alpha1.Workflow + var wfObj1, wfObj2, wfObj3, wfObj4, wfObj5, failedWfObj v1alpha1.Workflow var wftmpl v1alpha1.WorkflowTemplate var cwfTmpl v1alpha1.ClusterWorkflowTemplate var cronwfObj v1alpha1.CronWorkflow - _ = json.Unmarshal([]byte(wf1), &wfObj1) - _ = json.Unmarshal([]byte(wf2), &wfObj2) - _ = json.Unmarshal([]byte(wf3), &wfObj3) - _ = json.Unmarshal([]byte(wf4), &wfObj4) - _ = json.Unmarshal([]byte(wf5), &wfObj5) - _ = json.Unmarshal([]byte(workflowtmpl), &wftmpl) - _ = json.Unmarshal([]byte(cronwf), &cronwfObj) - _ = json.Unmarshal([]byte(clusterworkflowtmpl), &cwfTmpl) + errors.CheckError(json.Unmarshal([]byte(wf1), &wfObj1)) + errors.CheckError(json.Unmarshal([]byte(wf2), &wfObj2)) + errors.CheckError(json.Unmarshal([]byte(wf3), &wfObj3)) + errors.CheckError(json.Unmarshal([]byte(wf4), &wfObj4)) + errors.CheckError(json.Unmarshal([]byte(wf5), &wfObj5)) + errors.CheckError(json.Unmarshal([]byte(failedWf), &failedWfObj)) + errors.CheckError(json.Unmarshal([]byte(workflowtmpl), &wftmpl)) + errors.CheckError(json.Unmarshal([]byte(cronwf), &cronwfObj)) + errors.CheckError(json.Unmarshal([]byte(clusterworkflowtmpl), &cwfTmpl)) offloadNodeStatusRepo := &mocks.OffloadNodeStatusRepo{} offloadNodeStatusRepo.On("IsEnabled", mock.Anything).Return(true) offloadNodeStatusRepo.On("List", mock.Anything).Return(map[sqldb.UUIDVersion]v1alpha1.Nodes{}, nil) server := NewWorkflowServer(instanceid.NewService("my-instanceid"), offloadNodeStatusRepo) kubeClientSet := fake.NewSimpleClientset() - wfClientset := v1alpha.NewSimpleClientset(&wfObj1, &wfObj2, &wfObj3, &wfObj4, &wfObj5, &wftmpl, &cronwfObj, &cwfTmpl) + wfClientset := v1alpha.NewSimpleClientset(&wfObj1, &wfObj2, &wfObj3, &wfObj4, &wfObj5, &failedWfObj, &wftmpl, &cronwfObj, &cwfTmpl) wfClientset.PrependReactor("create", "workflows", generateNameReactor) ctx := context.WithValue(context.WithValue(context.TODO(), auth.WfKey, wfClientset), auth.KubeKey, kubeClientSet) return server, ctx @@ -551,17 +582,24 @@ func TestCreateWorkflow(t *testing.T) { } -func TestGetWorkflowWithFound(t *testing.T) { - - server, ctx := getWorkflowServer() +type testWatchWorkflowServer struct { + testServerStream +} - wf, err := getWorkflow(ctx, server, "workflows", "hello-world-b6h5m") - assert.NotNil(t, wf) - assert.Nil(t, err) +func (t testWatchWorkflowServer) Send(*workflowpkg.WorkflowWatchEvent) error { + panic("implement me") +} - wf, err = getWorkflow(ctx, server, "test", "hello-world-b6h5m-test") - assert.NotNil(t, wf) - assert.Nil(t, err) +func TestWatchWorkflows(t *testing.T) { + server, ctx := getWorkflowServer() + wf := &v1alpha1.Workflow{} + assert.NoError(t, json.Unmarshal([]byte(wf1), &wf)) + ctx, cancel := context.WithCancel(ctx) + go func() { + err := server.WatchWorkflows(&workflowpkg.WatchWorkflowsRequest{}, &testWatchWorkflowServer{testServerStream{ctx}}) + assert.NoError(t, err) + }() + cancel() } func TestGetWorkflowWithNotFound(t *testing.T) { @@ -580,7 +618,7 @@ func TestListWorkflow(t *testing.T) { wfl, err := getWorkflowList(ctx, server, "workflows") assert.NotNil(t, wfl) - assert.Equal(t, 3, len(wfl.Items)) + assert.Equal(t, 4, len(wfl.Items)) assert.Nil(t, err) wfl, err = getWorkflowList(ctx, server, "test") @@ -607,7 +645,16 @@ func TestDeleteWorkflow(t *testing.T) { wfl, err := getWorkflowList(ctx, server, "workflows") if assert.NoError(t, err) { - assert.Len(t, wfl.Items, 2) + assert.Len(t, wfl.Items, 3) + } +} + +func TestRetryWorkflow(t *testing.T) { + server, ctx := getWorkflowServer() + req := workflowpkg.WorkflowRetryRequest{Name: "failed", Namespace: "workflows"} + retried, err := server.RetryWorkflow(ctx, &req) + if assert.NoError(t, err) { + assert.NotNil(t, retried) } } @@ -677,6 +724,18 @@ func TestTerminateWorkflow(t *testing.T) { assert.NotNil(t, err) } +func TestStopWorkflow(t *testing.T) { + server, ctx := getWorkflowServer() + wf, err := getWorkflow(ctx, server, "workflows", "hello-world-9tql2-run") + assert.NoError(t, err) + rsmWfReq := workflowpkg.WorkflowStopRequest{Name: wf.Name, Namespace: wf.Namespace} + wf, err = server.StopWorkflow(ctx, &rsmWfReq) + if assert.NoError(t, err) { + assert.NotNil(t, wf) + assert.Equal(t, v1alpha1.NodeRunning, wf.Status.Phase) + } +} + func TestResubmitWorkflow(t *testing.T) { server, ctx := getWorkflowServer() @@ -691,6 +750,38 @@ func TestResubmitWorkflow(t *testing.T) { } } +func TestLintWorkflow(t *testing.T) { + server, ctx := getWorkflowServer() + wf := &v1alpha1.Workflow{} + assert.NoError(t, json.Unmarshal([]byte(wf1), &wf)) + linted, err := server.LintWorkflow(ctx, &workflowpkg.WorkflowLintRequest{Workflow: wf}) + if assert.NoError(t, err) { + assert.NotNil(t, linted) + } +} + +type testPodLogsServer struct { + testServerStream +} + +func (t testPodLogsServer) Send(entry *workflowpkg.LogEntry) error { + panic("implement me") +} + +func TestPodLogs(t *testing.T) { + server, ctx := getWorkflowServer() + ctx, cancel := context.WithCancel(ctx) + go func() { + err := server.PodLogs(&workflowpkg.WorkflowLogRequest{ + Name: "hello-world-9tql2", + Namespace: "workflows", + LogOptions: &corev1.PodLogOptions{}, + }, &testPodLogsServer{testServerStream{ctx}}) + assert.NoError(t, err) + }() + cancel() +} + func TestSubmitWorkflowFromResource(t *testing.T) { server, ctx := getWorkflowServer() From 0bc421caff793002c809f8800f0d847b6e074065 Mon Sep 17 00:00:00 2001 From: Alex Collins Date: Fri, 24 Apr 2020 16:49:34 -0700 Subject: [PATCH 10/15] nil --- server/workflow/workflow_server_test.go | 4 +- test/e2e/argo_server_test.go | 58 ++++++++++++++----------- 2 files changed, 34 insertions(+), 28 deletions(-) diff --git a/server/workflow/workflow_server_test.go b/server/workflow/workflow_server_test.go index ff6dbe062c47..673df8c5ff9d 100644 --- a/server/workflow/workflow_server_test.go +++ b/server/workflow/workflow_server_test.go @@ -773,8 +773,8 @@ func TestPodLogs(t *testing.T) { ctx, cancel := context.WithCancel(ctx) go func() { err := server.PodLogs(&workflowpkg.WorkflowLogRequest{ - Name: "hello-world-9tql2", - Namespace: "workflows", + Name: "hello-world-9tql2", + Namespace: "workflows", LogOptions: &corev1.PodLogOptions{}, }, &testPodLogsServer{testServerStream{ctx}}) assert.NoError(t, err) diff --git a/test/e2e/argo_server_test.go b/test/e2e/argo_server_test.go index 6e28bdf8c0c8..77fdbfe02bba 100644 --- a/test/e2e/argo_server_test.go +++ b/test/e2e/argo_server_test.go @@ -781,36 +781,37 @@ func (s *ArgoServerSuite) TestWorkflowServiceStream() { // use the watch to make sure that the workflow has succeeded s.Run("Watch", func() { + t := s.T() req, err := http.NewRequest("GET", baseUrl+"/api/v1/workflow-events/argo?listOptions.fieldSelector=metadata.name=basic", nil) - assert.NoError(s.T(), err) + assert.NoError(t, err) req.Header.Set("Accept", "text/event-stream") req.Header.Set("Authorization", "Bearer "+s.bearerToken) req.Close = true resp, err := httpClient.Do(req) - assert.NoError(s.T(), err) - assert.NotNil(s.T(), resp) defer func() { - if resp != nil { + if resp != nil && resp.Body != nil { _ = resp.Body.Close() } }() - if assert.Equal(s.T(), 200, resp.StatusCode) { - assert.Equal(s.T(), resp.Header.Get("Content-Type"), "text/event-stream") - scanner := bufio.NewScanner(resp.Body) - for scanner.Scan() { - line := scanner.Text() - log.WithField("line", line).Debug() - // make sure we have this enabled - if line == "" { - continue - } - if strings.Contains(line, `status:`) { - assert.Contains(s.T(), line, `"offloadNodeStatus":true`) - // so that we get this - assert.Contains(s.T(), line, `"nodes":`) - } - if strings.Contains(line, "Succeeded") { - break + if assert.NoError(t, err) && assert.NotNil(t, resp) { + if assert.Equal(t, 200, resp.StatusCode) { + assert.Equal(t, resp.Header.Get("Content-Type"), "text/event-stream") + scanner := bufio.NewScanner(resp.Body) + for scanner.Scan() { + line := scanner.Text() + log.WithField("line", line).Debug() + // make sure we have this enabled + if line == "" { + continue + } + if strings.Contains(line, `status:`) { + assert.Contains(t, line, `"offloadNodeStatus":true`) + // so that we get this + assert.Contains(t, line, `"nodes":`) + } + if strings.Contains(line, "Succeeded") { + break + } } } } @@ -818,16 +819,21 @@ func (s *ArgoServerSuite) TestWorkflowServiceStream() { // then, lets check the logs s.Run("PodLogs", func() { + t := s.T() req, err := http.NewRequest("GET", baseUrl+"/api/v1/workflows/argo/basic/basic/log?logOptions.container=main&logOptions.tailLines=3", nil) - assert.NoError(s.T(), err) + assert.NoError(t, err) req.Header.Set("Accept", "text/event-stream") req.Header.Set("Authorization", "Bearer "+s.bearerToken) req.Close = true resp, err := httpClient.Do(req) - if assert.NoError(s.T(), err) { - defer func() { _ = resp.Body.Close() }() - if assert.Equal(s.T(), 200, resp.StatusCode) { - assert.Equal(s.T(), resp.Header.Get("Content-Type"), "text/event-stream") + defer func() { + if resp != nil && resp.Body != nil { + _ = resp.Body.Close() + } + }() + if assert.NoError(t, err) && assert.NotNil(t, resp) { + if assert.Equal(t, 200, resp.StatusCode) { + assert.Equal(t, resp.Header.Get("Content-Type"), "text/event-stream") s := bufio.NewScanner(resp.Body) for s.Scan() { line := s.Text() From ed2fbe3a9e8e42fc450d223bf46a3d5a2c438fb4 Mon Sep 17 00:00:00 2001 From: Alex Collins Date: Mon, 27 Apr 2020 11:17:34 -0700 Subject: [PATCH 11/15] lint --- persist/sqldb/mocks/WorkflowArchive.go | 60 +++++++------- persist/sqldb/null_workflow_archive.go | 11 ++- persist/sqldb/workflow_archive.go | 36 ++++----- server/apiserver/argoserver.go | 2 - server/artifacts/artifact_server.go | 9 +-- .../cluster_workflow_template_server.go | 10 +-- server/cronworkflow/cron_workflow_server.go | 8 +- server/workflow/workflow_server.go | 14 ++-- server/workflow/workflow_server_test.go | 6 +- .../archived_workflow_server.go | 6 +- .../archived_workflow_server_test.go | 13 ++-- .../workflow_template_server.go | 10 +-- test/e2e/fixtures/e2e_suite.go | 5 +- util/instanceid/service.go | 35 +++------ util/instanceid/service_test.go | 25 +++--- util/marker/service.go | 78 ------------------- util/marker/service_test.go | 37 --------- util/marker/test_server_stream_test.go | 38 --------- workflow/controller/controller.go | 2 +- workflow/controller/operator.go | 3 +- 20 files changed, 114 insertions(+), 294 deletions(-) delete mode 100644 util/marker/service.go delete mode 100644 util/marker/service_test.go delete mode 100644 util/marker/test_server_stream_test.go diff --git a/persist/sqldb/mocks/WorkflowArchive.go b/persist/sqldb/mocks/WorkflowArchive.go index f234f378d156..79b73cc54c63 100644 --- a/persist/sqldb/mocks/WorkflowArchive.go +++ b/persist/sqldb/mocks/WorkflowArchive.go @@ -3,8 +3,6 @@ package mocks import ( - context "context" - mock "github.com/stretchr/testify/mock" labels "k8s.io/apimachinery/pkg/labels" @@ -18,13 +16,13 @@ type WorkflowArchive struct { mock.Mock } -// ArchiveWorkflow provides a mock function with given fields: ctx, wf -func (_m *WorkflowArchive) ArchiveWorkflow(ctx context.Context, wf *v1alpha1.Workflow) error { - ret := _m.Called(ctx, wf) +// ArchiveWorkflow provides a mock function with given fields: wf +func (_m *WorkflowArchive) ArchiveWorkflow(wf *v1alpha1.Workflow) error { + ret := _m.Called(wf) var r0 error - if rf, ok := ret.Get(0).(func(context.Context, *v1alpha1.Workflow) error); ok { - r0 = rf(ctx, wf) + if rf, ok := ret.Get(0).(func(*v1alpha1.Workflow) error); ok { + r0 = rf(wf) } else { r0 = ret.Error(0) } @@ -32,13 +30,13 @@ func (_m *WorkflowArchive) ArchiveWorkflow(ctx context.Context, wf *v1alpha1.Wor return r0 } -// DeleteWorkflow provides a mock function with given fields: ctx, uid -func (_m *WorkflowArchive) DeleteWorkflow(ctx context.Context, uid string) error { - ret := _m.Called(ctx, uid) +// DeleteWorkflow provides a mock function with given fields: uid +func (_m *WorkflowArchive) DeleteWorkflow(uid string) error { + ret := _m.Called(uid) var r0 error - if rf, ok := ret.Get(0).(func(context.Context, string) error); ok { - r0 = rf(ctx, uid) + if rf, ok := ret.Get(0).(func(string) error); ok { + r0 = rf(uid) } else { r0 = ret.Error(0) } @@ -46,13 +44,13 @@ func (_m *WorkflowArchive) DeleteWorkflow(ctx context.Context, uid string) error return r0 } -// DeleteWorkflows provides a mock function with given fields: ctx, ttl -func (_m *WorkflowArchive) DeleteWorkflows(ctx context.Context, ttl time.Duration) error { - ret := _m.Called(ctx, ttl) +// DeleteWorkflows provides a mock function with given fields: ttl +func (_m *WorkflowArchive) DeleteWorkflows(ttl time.Duration) error { + ret := _m.Called(ttl) var r0 error - if rf, ok := ret.Get(0).(func(context.Context, time.Duration) error); ok { - r0 = rf(ctx, ttl) + if rf, ok := ret.Get(0).(func(time.Duration) error); ok { + r0 = rf(ttl) } else { r0 = ret.Error(0) } @@ -60,13 +58,13 @@ func (_m *WorkflowArchive) DeleteWorkflows(ctx context.Context, ttl time.Duratio return r0 } -// GetWorkflow provides a mock function with given fields: ctx, uid -func (_m *WorkflowArchive) GetWorkflow(ctx context.Context, uid string) (*v1alpha1.Workflow, error) { - ret := _m.Called(ctx, uid) +// GetWorkflow provides a mock function with given fields: uid +func (_m *WorkflowArchive) GetWorkflow(uid string) (*v1alpha1.Workflow, error) { + ret := _m.Called(uid) var r0 *v1alpha1.Workflow - if rf, ok := ret.Get(0).(func(context.Context, string) *v1alpha1.Workflow); ok { - r0 = rf(ctx, uid) + if rf, ok := ret.Get(0).(func(string) *v1alpha1.Workflow); ok { + r0 = rf(uid) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*v1alpha1.Workflow) @@ -74,8 +72,8 @@ func (_m *WorkflowArchive) GetWorkflow(ctx context.Context, uid string) (*v1alph } var r1 error - if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { - r1 = rf(ctx, uid) + if rf, ok := ret.Get(1).(func(string) error); ok { + r1 = rf(uid) } else { r1 = ret.Error(1) } @@ -83,13 +81,13 @@ func (_m *WorkflowArchive) GetWorkflow(ctx context.Context, uid string) (*v1alph return r0, r1 } -// ListWorkflows provides a mock function with given fields: ctx, namespace, minStartAt, maxStartAt, labelRequirements, limit, offset -func (_m *WorkflowArchive) ListWorkflows(ctx context.Context, namespace string, minStartAt time.Time, maxStartAt time.Time, labelRequirements labels.Requirements, limit int, offset int) (v1alpha1.Workflows, error) { - ret := _m.Called(ctx, namespace, minStartAt, maxStartAt, labelRequirements, limit, offset) +// ListWorkflows provides a mock function with given fields: namespace, minStartAt, maxStartAt, labelRequirements, limit, offset +func (_m *WorkflowArchive) ListWorkflows(namespace string, minStartAt time.Time, maxStartAt time.Time, labelRequirements labels.Requirements, limit int, offset int) (v1alpha1.Workflows, error) { + ret := _m.Called(namespace, minStartAt, maxStartAt, labelRequirements, limit, offset) var r0 v1alpha1.Workflows - if rf, ok := ret.Get(0).(func(context.Context, string, time.Time, time.Time, labels.Requirements, int, int) v1alpha1.Workflows); ok { - r0 = rf(ctx, namespace, minStartAt, maxStartAt, labelRequirements, limit, offset) + if rf, ok := ret.Get(0).(func(string, time.Time, time.Time, labels.Requirements, int, int) v1alpha1.Workflows); ok { + r0 = rf(namespace, minStartAt, maxStartAt, labelRequirements, limit, offset) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(v1alpha1.Workflows) @@ -97,8 +95,8 @@ func (_m *WorkflowArchive) ListWorkflows(ctx context.Context, namespace string, } var r1 error - if rf, ok := ret.Get(1).(func(context.Context, string, time.Time, time.Time, labels.Requirements, int, int) error); ok { - r1 = rf(ctx, namespace, minStartAt, maxStartAt, labelRequirements, limit, offset) + if rf, ok := ret.Get(1).(func(string, time.Time, time.Time, labels.Requirements, int, int) error); ok { + r1 = rf(namespace, minStartAt, maxStartAt, labelRequirements, limit, offset) } else { r1 = ret.Error(1) } diff --git a/persist/sqldb/null_workflow_archive.go b/persist/sqldb/null_workflow_archive.go index c5b1a17159ea..ae252bdb9b98 100644 --- a/persist/sqldb/null_workflow_archive.go +++ b/persist/sqldb/null_workflow_archive.go @@ -1,7 +1,6 @@ package sqldb import ( - "context" "fmt" "time" @@ -15,22 +14,22 @@ var NullWorkflowArchive WorkflowArchive = &nullWorkflowArchive{} type nullWorkflowArchive struct { } -func (r *nullWorkflowArchive) ArchiveWorkflow(context.Context, *wfv1.Workflow) error { +func (r *nullWorkflowArchive) ArchiveWorkflow(*wfv1.Workflow) error { return nil } -func (r *nullWorkflowArchive) ListWorkflows(context.Context, string, time.Time, time.Time, labels.Requirements, int, int) (wfv1.Workflows, error) { +func (r *nullWorkflowArchive) ListWorkflows(string, time.Time, time.Time, labels.Requirements, int, int) (wfv1.Workflows, error) { return wfv1.Workflows{}, nil } -func (r *nullWorkflowArchive) GetWorkflow(context.Context, string) (*wfv1.Workflow, error) { +func (r *nullWorkflowArchive) GetWorkflow(string) (*wfv1.Workflow, error) { return nil, fmt.Errorf("getting archived workflows not supported") } -func (r *nullWorkflowArchive) DeleteWorkflow(context.Context, string) error { +func (r *nullWorkflowArchive) DeleteWorkflow(string) error { return fmt.Errorf("deleting archived workflows not supported") } -func (r *nullWorkflowArchive) DeleteWorkflows(context.Context, time.Duration) error { +func (r *nullWorkflowArchive) DeleteWorkflows(time.Duration) error { return nil } diff --git a/persist/sqldb/workflow_archive.go b/persist/sqldb/workflow_archive.go index ba687de7f3d1..76fdbf6f8099 100644 --- a/persist/sqldb/workflow_archive.go +++ b/persist/sqldb/workflow_archive.go @@ -45,11 +45,11 @@ type archivedWorkflowLabelRecord struct { } type WorkflowArchive interface { - ArchiveWorkflow(ctx context.Context, wf *wfv1.Workflow) error - ListWorkflows(ctx context.Context, namespace string, minStartAt, maxStartAt time.Time, labelRequirements labels.Requirements, limit, offset int) (wfv1.Workflows, error) - GetWorkflow(ctx context.Context, uid string) (*wfv1.Workflow, error) - DeleteWorkflow(ctx context.Context, uid string) error - DeleteWorkflows(ctx context.Context, ttl time.Duration) error + ArchiveWorkflow(wf *wfv1.Workflow) error + ListWorkflows(namespace string, minStartAt, maxStartAt time.Time, labelRequirements labels.Requirements, limit, offset int) (wfv1.Workflows, error) + GetWorkflow(uid string) (*wfv1.Workflow, error) + DeleteWorkflow(uid string) error + DeleteWorkflows(ttl time.Duration) error } type workflowArchive struct { @@ -65,7 +65,7 @@ func NewWorkflowArchive(session sqlbuilder.Database, clusterName, managedNamespa return &workflowArchive{session: session, clusterName: clusterName, managedNamespace: managedNamespace, instanceIDService: instanceIDService, dbType: dbTypeFor(session)} } -func (r *workflowArchive) ArchiveWorkflow(ctx context.Context, wf *wfv1.Workflow) error { +func (r *workflowArchive) ArchiveWorkflow(wf *wfv1.Workflow) error { logCtx := log.WithFields(log.Fields{"uid": wf.UID, "labels": wf.GetLabels()}) logCtx.Debug("Archiving workflow") workflow, err := json.Marshal(wf) @@ -75,7 +75,7 @@ func (r *workflowArchive) ArchiveWorkflow(ctx context.Context, wf *wfv1.Workflow return r.session.Tx(context.Background(), func(sess sqlbuilder.Tx) error { _, err := sess. DeleteFrom(archiveTableName). - Where(r.clusterManagedNamespaceAndInstanceID(ctx)). + Where(r.clusterManagedNamespaceAndInstanceID()). And(db.Cond{"uid": wf.UID}). Exec() if err != nil { @@ -85,7 +85,7 @@ func (r *workflowArchive) ArchiveWorkflow(ctx context.Context, wf *wfv1.Workflow Insert(&archivedWorkflowRecord{ archivedWorkflowMetadata: archivedWorkflowMetadata{ ClusterName: r.clusterName, - InstanceID: r.instanceIDService.InstanceID(ctx), + InstanceID: r.instanceIDService.InstanceID(), UID: string(wf.UID), Name: wf.Name, Namespace: wf.Namespace, @@ -116,7 +116,7 @@ func (r *workflowArchive) ArchiveWorkflow(ctx context.Context, wf *wfv1.Workflow }) } -func (r *workflowArchive) ListWorkflows(ctx context.Context, namespace string, minStartedAt, maxStartedAt time.Time, labelRequirements labels.Requirements, limit int, offset int) (wfv1.Workflows, error) { +func (r *workflowArchive) ListWorkflows(namespace string, minStartedAt, maxStartedAt time.Time, labelRequirements labels.Requirements, limit int, offset int) (wfv1.Workflows, error) { var archivedWfs []archivedWorkflowMetadata clause, err := labelsClause(r.dbType, labelRequirements) if err != nil { @@ -125,7 +125,7 @@ func (r *workflowArchive) ListWorkflows(ctx context.Context, namespace string, m err = r.session. Select("name", "namespace", "uid", "phase", "startedat", "finishedat"). From(archiveTableName). - Where(r.clusterManagedNamespaceAndInstanceID(ctx)). + Where(r.clusterManagedNamespaceAndInstanceID()). And(namespaceEqual(namespace)). And(startedAtClause(minStartedAt, maxStartedAt)). And(clause). @@ -155,11 +155,11 @@ func (r *workflowArchive) ListWorkflows(ctx context.Context, namespace string, m return wfs, nil } -func (r *workflowArchive) clusterManagedNamespaceAndInstanceID(ctx context.Context) db.Compound { +func (r *workflowArchive) clusterManagedNamespaceAndInstanceID() db.Compound { return db.And( db.Cond{"clustername": r.clusterName}, namespaceEqual(r.managedNamespace), - db.Cond{"instanceid": r.instanceIDService.InstanceID(ctx)}, + db.Cond{"instanceid": r.instanceIDService.InstanceID()}, ) } @@ -182,12 +182,12 @@ func namespaceEqual(namespace string) db.Cond { } } -func (r *workflowArchive) GetWorkflow(ctx context.Context, uid string) (*wfv1.Workflow, error) { +func (r *workflowArchive) GetWorkflow(uid string) (*wfv1.Workflow, error) { archivedWf := &archivedWorkflowRecord{} err := r.session. Select("workflow"). From(archiveTableName). - Where(r.clusterManagedNamespaceAndInstanceID(ctx)). + Where(r.clusterManagedNamespaceAndInstanceID()). And(db.Cond{"uid": uid}). One(archivedWf) if err != nil { @@ -204,10 +204,10 @@ func (r *workflowArchive) GetWorkflow(ctx context.Context, uid string) (*wfv1.Wo return wf, nil } -func (r *workflowArchive) DeleteWorkflow(ctx context.Context, uid string) error { +func (r *workflowArchive) DeleteWorkflow(uid string) error { rs, err := r.session. DeleteFrom(archiveTableName). - Where(r.clusterManagedNamespaceAndInstanceID(ctx)). + Where(r.clusterManagedNamespaceAndInstanceID()). And(db.Cond{"uid": uid}). Exec() if err != nil { @@ -221,10 +221,10 @@ func (r *workflowArchive) DeleteWorkflow(ctx context.Context, uid string) error return nil } -func (r *workflowArchive) DeleteWorkflows(ctx context.Context, ttl time.Duration) error { +func (r *workflowArchive) DeleteWorkflows(ttl time.Duration) error { rs, err := r.session. DeleteFrom(archiveTableName). - Where(r.clusterManagedNamespaceAndInstanceID(ctx)). + Where(r.clusterManagedNamespaceAndInstanceID()). And(fmt.Sprintf("finishedat < current_timestamp - interval '%d' second", int(ttl.Seconds()))). Exec() if err != nil { diff --git a/server/apiserver/argoserver.go b/server/apiserver/argoserver.go index ddd46a622106..22740ddd4100 100644 --- a/server/apiserver/argoserver.go +++ b/server/apiserver/argoserver.go @@ -198,14 +198,12 @@ func (as *argoServer) newGRPCServer(instanceIDService instanceid.Service, offloa grpcutil.PanicLoggerUnaryServerInterceptor(serverLog), grpcutil.ErrorTranslationUnaryServerInterceptor, as.authenticator.UnaryServerInterceptor(), - instanceIDService.UnaryServerInterceptor(), )), grpc.StreamInterceptor(grpc_middleware.ChainStreamServer( grpc_logrus.StreamServerInterceptor(serverLog), grpcutil.PanicLoggerStreamServerInterceptor(serverLog), grpcutil.ErrorTranslationStreamServerInterceptor, as.authenticator.StreamServerInterceptor(), - instanceIDService.StreamServerInterceptor(), )), } diff --git a/server/artifacts/artifact_server.go b/server/artifacts/artifact_server.go index 88ee41f86cb9..bb6b14332fc0 100644 --- a/server/artifacts/artifact_server.go +++ b/server/artifacts/artifact_server.go @@ -41,9 +41,6 @@ func (a *ArtifactServer) GetArtifact(w http.ResponseWriter, r *http.Request) { _, _ = w.Write([]byte(err.Error())) return } - _, ctx, marker := a.instanceIDService.ContextWithMarker(ctx) - defer a.instanceIDService.Check("", marker) - path := strings.SplitN(r.URL.Path, "/", 6) namespace := path[2] @@ -75,8 +72,6 @@ func (a *ArtifactServer) GetArtifactByUID(w http.ResponseWriter, r *http.Request _, _ = w.Write([]byte(err.Error())) return } - _, ctx, marker := a.instanceIDService.ContextWithMarker(ctx) - defer a.instanceIDService.Check("", marker) path := strings.SplitN(r.URL.Path, "/", 6) @@ -172,7 +167,7 @@ func (a *ArtifactServer) getWorkflowAndValidate(ctx context.Context, namespace s if err != nil { return nil, err } - err = a.instanceIDService.Validate(ctx, wf) + err = a.instanceIDService.Validate(wf) if err != nil { return nil, err } @@ -195,7 +190,7 @@ func (a *ArtifactServer) getWorkflowAndValidate(ctx context.Context, namespace s } func (a *ArtifactServer) getWorkflowByUID(ctx context.Context, uid string) (*wfv1.Workflow, error) { - wf, err := a.wfArchive.GetWorkflow(ctx, uid) + wf, err := a.wfArchive.GetWorkflow(uid) if err != nil { return nil, err } diff --git a/server/clusterworkflowtemplate/cluster_workflow_template_server.go b/server/clusterworkflowtemplate/cluster_workflow_template_server.go index 8bb98e9c24dd..0af013ccdd2f 100644 --- a/server/clusterworkflowtemplate/cluster_workflow_template_server.go +++ b/server/clusterworkflowtemplate/cluster_workflow_template_server.go @@ -29,7 +29,7 @@ func (cwts *ClusterWorkflowTemplateServer) CreateClusterWorkflowTemplate(ctx con return nil, fmt.Errorf("cluster workflow template was not found in the request body") } - cwts.instanceIDService.Label(ctx, req.Template) + cwts.instanceIDService.Label(req.Template) cwftmplGetter := templateresolution.WrapClusterWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().ClusterWorkflowTemplates()) @@ -56,7 +56,7 @@ func (cwts *ClusterWorkflowTemplateServer) getTemplateAndValidate(ctx context.Co if err != nil { return nil, err } - err = cwts.instanceIDService.Validate(ctx, wfTmpl) + err = cwts.instanceIDService.Validate(wfTmpl) if err != nil { return nil, err } @@ -69,7 +69,7 @@ func (cwts *ClusterWorkflowTemplateServer) ListClusterWorkflowTemplates(ctx cont if req.ListOptions != nil { options = req.ListOptions } - cwts.instanceIDService.With(ctx, options) + cwts.instanceIDService.With(options) cwfList, err := wfClient.ArgoprojV1alpha1().ClusterWorkflowTemplates().List(*options) if err != nil { return nil, err @@ -95,7 +95,7 @@ func (cwts *ClusterWorkflowTemplateServer) DeleteClusterWorkflowTemplate(ctx con } func (cwts *ClusterWorkflowTemplateServer) LintClusterWorkflowTemplate(ctx context.Context, req *clusterwftmplpkg.ClusterWorkflowTemplateLintRequest) (*v1alpha1.ClusterWorkflowTemplate, error) { - cwts.instanceIDService.Label(ctx, req.Template) + cwts.instanceIDService.Label(req.Template) wfClient := auth.GetWfClient(ctx) cwftmplGetter := templateresolution.WrapClusterWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().ClusterWorkflowTemplates()) @@ -111,7 +111,7 @@ func (cwts *ClusterWorkflowTemplateServer) UpdateClusterWorkflowTemplate(ctx con if req.Template == nil { return nil, fmt.Errorf("ClusterWorkflowTemplate is not found in Request body") } - err := cwts.instanceIDService.Validate(ctx, req.Template) + err := cwts.instanceIDService.Validate(req.Template) if err != nil { return nil, err } diff --git a/server/cronworkflow/cron_workflow_server.go b/server/cronworkflow/cron_workflow_server.go index cccdae13ab7f..fa8bbb86f3c5 100644 --- a/server/cronworkflow/cron_workflow_server.go +++ b/server/cronworkflow/cron_workflow_server.go @@ -27,7 +27,7 @@ func (c *cronWorkflowServiceServer) LintCronWorkflow(ctx context.Context, req *c wfClient := auth.GetWfClient(ctx) wftmplGetter := templateresolution.WrapWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().WorkflowTemplates(req.Namespace)) cwftmplGetter := templateresolution.WrapClusterWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().ClusterWorkflowTemplates()) - c.instanceIDService.Label(ctx, req.CronWorkflow) + c.instanceIDService.Label(req.CronWorkflow) err := validate.ValidateCronWorkflow(wftmplGetter, cwftmplGetter, req.CronWorkflow) if err != nil { return nil, err @@ -40,7 +40,7 @@ func (c *cronWorkflowServiceServer) ListCronWorkflows(ctx context.Context, req * if req.ListOptions != nil { options = req.ListOptions } - c.instanceIDService.With(ctx, options) + c.instanceIDService.With(options) return auth.GetWfClient(ctx).ArgoprojV1alpha1().CronWorkflows(req.Namespace).List(*options) } @@ -49,7 +49,7 @@ func (c *cronWorkflowServiceServer) CreateCronWorkflow(ctx context.Context, req if req.CronWorkflow == nil { return nil, fmt.Errorf("cron workflow was not found in the request body") } - c.instanceIDService.Label(ctx, req.CronWorkflow) + c.instanceIDService.Label(req.CronWorkflow) wftmplGetter := templateresolution.WrapWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().WorkflowTemplates(req.Namespace)) cwftmplGetter := templateresolution.WrapClusterWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().ClusterWorkflowTemplates()) @@ -96,7 +96,7 @@ func (c *cronWorkflowServiceServer) getCronWorkflowAndValidate(ctx context.Conte if err != nil { return nil, err } - err = c.instanceIDService.Validate(ctx, cronWf) + err = c.instanceIDService.Validate(cronWf) if err != nil { return nil, err } diff --git a/server/workflow/workflow_server.go b/server/workflow/workflow_server.go index 5865dcf46444..de782ff40755 100644 --- a/server/workflow/workflow_server.go +++ b/server/workflow/workflow_server.go @@ -44,7 +44,7 @@ func (s *workflowServer) CreateWorkflow(ctx context.Context, req *workflowpkg.Wo req.Workflow.Namespace = req.Namespace } - s.instanceIDService.Label(ctx, req.Workflow) + s.instanceIDService.Label(req.Workflow) wftmplGetter := templateresolution.WrapWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().WorkflowTemplates(req.Namespace)) cwftmplGetter := templateresolution.WrapClusterWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().ClusterWorkflowTemplates()) @@ -108,7 +108,7 @@ func (s *workflowServer) ListWorkflows(ctx context.Context, req *workflowpkg.Wor if req.ListOptions != nil { listOption = req.ListOptions } - s.instanceIDService.With(ctx, listOption) + s.instanceIDService.With(listOption) wfList, err := wfClient.ArgoprojV1alpha1().Workflows(req.Namespace).List(*listOption) if err != nil { return nil, err @@ -139,7 +139,7 @@ func (s *workflowServer) WatchWorkflows(req *workflowpkg.WatchWorkflowsRequest, if req.ListOptions != nil { opts = req.ListOptions } - s.instanceIDService.With(ctx, opts) + s.instanceIDService.With(opts) wfIf := wfClient.ArgoprojV1alpha1().Workflows(req.Namespace) watch, err := wfIf.Watch(*opts) if err != nil { @@ -157,7 +157,7 @@ func (s *workflowServer) WatchWorkflows(req *workflowpkg.WatchWorkflowsRequest, case event, open := <-watch.ResultChan(): if !open { log.Info("Re-establishing workflow watch") - watch, err = wfIf.Watch(opts) + watch, err = wfIf.Watch(*opts) if err != nil { return err } @@ -324,7 +324,7 @@ func (s *workflowServer) LintWorkflow(ctx context.Context, req *workflowpkg.Work wfClient := auth.GetWfClient(ctx) wftmplGetter := templateresolution.WrapWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().WorkflowTemplates(req.Namespace)) cwftmplGetter := templateresolution.WrapClusterWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().ClusterWorkflowTemplates()) - s.instanceIDService.Label(ctx, req.Workflow) + s.instanceIDService.Label(req.Workflow) _, err := validate.ValidateWorkflow(wftmplGetter, cwftmplGetter, req.Workflow, validate.ValidateOpts{Lint: true}) @@ -352,7 +352,7 @@ func (s *workflowServer) getWorkflowAndValidate(ctx context.Context, namespace s if err != nil { return nil, err } - err = s.instanceIDService.Validate(ctx, wf) + err = s.instanceIDService.Validate(wf) if err != nil { return nil, err } @@ -387,7 +387,7 @@ func (s *workflowServer) SubmitWorkflow(ctx context.Context, req *workflowpkg.Wo } - s.instanceIDService.Label(ctx, wf) + s.instanceIDService.Label(wf) err := util.ApplySubmitOpts(wf, req.SubmitOptions) if err != nil { return nil, err diff --git a/server/workflow/workflow_server_test.go b/server/workflow/workflow_server_test.go index 673df8c5ff9d..0318d5f2b5f5 100644 --- a/server/workflow/workflow_server_test.go +++ b/server/workflow/workflow_server_test.go @@ -592,12 +592,14 @@ func (t testWatchWorkflowServer) Send(*workflowpkg.WorkflowWatchEvent) error { func TestWatchWorkflows(t *testing.T) { server, ctx := getWorkflowServer() - wf := &v1alpha1.Workflow{} + wf := &v1alpha1.Workflow{ + Status: v1alpha1.WorkflowStatus{Phase: v1alpha1.NodeSucceeded}, + } assert.NoError(t, json.Unmarshal([]byte(wf1), &wf)) ctx, cancel := context.WithCancel(ctx) go func() { err := server.WatchWorkflows(&workflowpkg.WatchWorkflowsRequest{}, &testWatchWorkflowServer{testServerStream{ctx}}) - assert.NoError(t, err) + assert.EqualError(t, err, "context canceled") }() cancel() } diff --git a/server/workflowarchive/archived_workflow_server.go b/server/workflowarchive/archived_workflow_server.go index 20d1fc90faf4..ea513ac49230 100644 --- a/server/workflowarchive/archived_workflow_server.go +++ b/server/workflowarchive/archived_workflow_server.go @@ -88,7 +88,7 @@ func (w *archivedWorkflowServer) ListArchivedWorkflows(ctx context.Context, req hasMore := true // keep trying until we have enough for len(items) < limit { - moreItems, err := w.wfArchive.ListWorkflows(ctx, namespace, minStartedAt, maxStartedAt, requirements, limit+1, offset) + moreItems, err := w.wfArchive.ListWorkflows(namespace, minStartedAt, maxStartedAt, requirements, limit+1, offset) if err != nil { return nil, err } @@ -113,7 +113,7 @@ func (w *archivedWorkflowServer) ListArchivedWorkflows(ctx context.Context, req } func (w *archivedWorkflowServer) GetArchivedWorkflow(ctx context.Context, req *workflowarchivepkg.GetArchivedWorkflowRequest) (*wfv1.Workflow, error) { - wf, err := w.wfArchive.GetWorkflow(ctx, req.Uid) + wf, err := w.wfArchive.GetWorkflow(req.Uid) if err != nil { return nil, err } @@ -142,7 +142,7 @@ func (w *archivedWorkflowServer) DeleteArchivedWorkflow(ctx context.Context, req if !allowed { return nil, status.Error(codes.PermissionDenied, "permission denied") } - err = w.wfArchive.DeleteWorkflow(ctx, req.Uid) + err = w.wfArchive.DeleteWorkflow(req.Uid) if err != nil { return nil, err } diff --git a/server/workflowarchive/archived_workflow_server_test.go b/server/workflowarchive/archived_workflow_server_test.go index 5e0d267cf730..dbdd2257807e 100644 --- a/server/workflowarchive/archived_workflow_server_test.go +++ b/server/workflowarchive/archived_workflow_server_test.go @@ -6,7 +6,6 @@ import ( "time" "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" authorizationv1 "k8s.io/api/authorization/v1" @@ -47,13 +46,13 @@ func Test_archivedWorkflowServer(t *testing.T) { }, nil }) // two pages of results for limit 1 - repo.On("ListWorkflows", mock.Anything, "", time.Time{}, time.Time{}, labels.Requirements(nil), 2, 0).Return(wfv1.Workflows{{}, {}}, nil) - repo.On("ListWorkflows", mock.Anything, "", time.Time{}, time.Time{}, labels.Requirements(nil), 2, 1).Return(wfv1.Workflows{{}}, nil) + repo.On("ListWorkflows", "", time.Time{}, time.Time{}, labels.Requirements(nil), 2, 0).Return(wfv1.Workflows{{}, {}}, nil) + repo.On("ListWorkflows", "", time.Time{}, time.Time{}, labels.Requirements(nil), 2, 1).Return(wfv1.Workflows{{}}, nil) minStartAt, _ := time.Parse(time.RFC3339, "2020-01-01T00:00:00Z") maxStartAt, _ := time.Parse(time.RFC3339, "2020-01-02T00:00:00Z") - repo.On("ListWorkflows", mock.Anything, "", minStartAt, maxStartAt, labels.Requirements(nil), 2, 0).Return(wfv1.Workflows{{}}, nil) - repo.On("GetWorkflow", mock.Anything, "").Return(nil, nil) - repo.On("GetWorkflow", mock.Anything, "my-uid").Return(&wfv1.Workflow{ + repo.On("ListWorkflows", "", minStartAt, maxStartAt, labels.Requirements(nil), 2, 0).Return(wfv1.Workflows{{}}, nil) + repo.On("GetWorkflow", "").Return(nil, nil) + repo.On("GetWorkflow", "my-uid").Return(&wfv1.Workflow{ ObjectMeta: metav1.ObjectMeta{Name: "my-name"}, Spec: wfv1.WorkflowSpec{ Entrypoint: "my-entrypoint", @@ -67,7 +66,7 @@ func Test_archivedWorkflowServer(t *testing.T) { ObjectMeta: metav1.ObjectMeta{Name: "my-name-resubmitted"}, }, nil }) - repo.On("DeleteWorkflow", mock.Anything, "my-uid").Return(nil) + repo.On("DeleteWorkflow", "my-uid").Return(nil) ctx := context.WithValue(context.WithValue(context.TODO(), auth.WfKey, wfClient), auth.KubeKey, kubeClient) t.Run("ListArchivedWorkflows", func(t *testing.T) { diff --git a/server/workflowtemplate/workflow_template_server.go b/server/workflowtemplate/workflow_template_server.go index a2ce2adba318..0f1ab880be1e 100644 --- a/server/workflowtemplate/workflow_template_server.go +++ b/server/workflowtemplate/workflow_template_server.go @@ -28,7 +28,7 @@ func (wts *WorkflowTemplateServer) CreateWorkflowTemplate(ctx context.Context, r if req.Template == nil { return nil, fmt.Errorf("workflow template was not found in the request body") } - wts.instanceIDService.Label(ctx, req.Template) + wts.instanceIDService.Label(req.Template) wftmplGetter := templateresolution.WrapWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().WorkflowTemplates(req.Namespace)) cwftmplGetter := templateresolution.WrapClusterWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().ClusterWorkflowTemplates()) @@ -52,7 +52,7 @@ func (wts *WorkflowTemplateServer) getTemplateAndValidate(ctx context.Context, n if err != nil { return nil, err } - err = wts.instanceIDService.Validate(ctx, wfTmpl) + err = wts.instanceIDService.Validate(wfTmpl) if err != nil { return nil, err } @@ -65,7 +65,7 @@ func (wts *WorkflowTemplateServer) ListWorkflowTemplates(ctx context.Context, re if req.ListOptions != nil { options = req.ListOptions } - wts.instanceIDService.With(ctx, options) + wts.instanceIDService.With(options) wfList, err := wfClient.ArgoprojV1alpha1().WorkflowTemplates(req.Namespace).List(*options) if err != nil { return nil, err @@ -92,7 +92,7 @@ func (wts *WorkflowTemplateServer) DeleteWorkflowTemplate(ctx context.Context, r func (wts *WorkflowTemplateServer) LintWorkflowTemplate(ctx context.Context, req *workflowtemplatepkg.WorkflowTemplateLintRequest) (*v1alpha1.WorkflowTemplate, error) { wfClient := auth.GetWfClient(ctx) - wts.instanceIDService.Label(ctx, req.Template) + wts.instanceIDService.Label(req.Template) wftmplGetter := templateresolution.WrapWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().WorkflowTemplates(req.Namespace)) cwftmplGetter := templateresolution.WrapClusterWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().ClusterWorkflowTemplates()) @@ -109,7 +109,7 @@ func (wts *WorkflowTemplateServer) UpdateWorkflowTemplate(ctx context.Context, r if req.Template == nil { return nil, fmt.Errorf("WorkflowTemplate is not found in Request body") } - err := wts.instanceIDService.Validate(ctx, req.Template) + err := wts.instanceIDService.Validate(req.Template) if err != nil { return nil, err } diff --git a/test/e2e/fixtures/e2e_suite.go b/test/e2e/fixtures/e2e_suite.go index 498af12d0757..2e456e0b27ff 100644 --- a/test/e2e/fixtures/e2e_suite.go +++ b/test/e2e/fixtures/e2e_suite.go @@ -2,7 +2,6 @@ package fixtures import ( "bufio" - "context" "encoding/base64" "os" "strings" @@ -192,10 +191,10 @@ func (s *E2ESuite) DeleteResources(label string) { archive := s.Persistence.workflowArchive parse, err := labels.ParseToRequirements(Label) s.CheckError(err) - workflows, err := archive.ListWorkflows(context.Background(), Namespace, time.Time{}, time.Time{}, parse, 0, 0) + workflows, err := archive.ListWorkflows(Namespace, time.Time{}, time.Time{}, parse, 0, 0) s.CheckError(err) for _, workflow := range workflows { - err := archive.DeleteWorkflow(context.Background(), string(workflow.UID)) + err := archive.DeleteWorkflow(string(workflow.UID)) s.CheckError(err) } } diff --git a/util/instanceid/service.go b/util/instanceid/service.go index 4eb03280c636..6a1c894fbe0b 100644 --- a/util/instanceid/service.go +++ b/util/instanceid/service.go @@ -1,47 +1,34 @@ package instanceid import ( - "context" "fmt" - "strings" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/argoproj/argo/util/labels" - "github.com/argoproj/argo/util/marker" "github.com/argoproj/argo/workflow/common" ) -/* -It might seem that a whole service for instance ID is overkill, but by extending `marker.Service` we -can check at runtime that we actually used instance ID during a request. -*/ type Service interface { - marker.Service - Label(ctx context.Context, obj metav1.Object) - With(ctx context.Context, options *metav1.ListOptions) - Validate(ctx context.Context, obj metav1.Object) error - InstanceID(ctx context.Context) string + Label(obj metav1.Object) + With(options *metav1.ListOptions) + Validate(obj metav1.Object) error + InstanceID() string } -func NewService(instanceId string) Service { - return &service{marker.NewService(func(fullMethod string) bool { - return strings.HasPrefix(fullMethod, "/info.InfoService/") - }), instanceId} +func NewService(instanceID string) Service { + return &service{instanceID} } type service struct { - marker.Service instanceID string } -func (s *service) InstanceID(ctx context.Context) string { - s.Mark(ctx) +func (s *service) InstanceID() string { return s.instanceID } -func (s *service) Label(ctx context.Context, obj metav1.Object) { - s.Mark(ctx) +func (s *service) Label(obj metav1.Object) { if s.instanceID != "" { labels.Label(obj, common.LabelKeyControllerInstanceID, s.instanceID) } else { @@ -49,8 +36,7 @@ func (s *service) Label(ctx context.Context, obj metav1.Object) { } } -func (s *service) With(ctx context.Context, opts *metav1.ListOptions) { - s.Mark(ctx) +func (s *service) With(opts *metav1.ListOptions) { if len(opts.LabelSelector) > 0 { opts.LabelSelector += "," } @@ -61,8 +47,7 @@ func (s *service) With(ctx context.Context, opts *metav1.ListOptions) { } } -func (s *service) Validate(ctx context.Context, obj metav1.Object) error { - s.Mark(ctx) +func (s *service) Validate(obj metav1.Object) error { l := obj.GetLabels() if s.instanceID == "" { if _, ok := l[common.LabelKeyControllerInstanceID]; !ok { diff --git a/util/instanceid/service_test.go b/util/instanceid/service_test.go index 09ad397d5e2b..a787a6add623 100644 --- a/util/instanceid/service_test.go +++ b/util/instanceid/service_test.go @@ -1,7 +1,6 @@ package instanceid import ( - "context" "testing" "github.com/stretchr/testify/assert" @@ -14,18 +13,18 @@ import ( func TestLabel(t *testing.T) { t.Run("Empty", func(t *testing.T) { obj := &wfv1.Workflow{} - NewService("").Label(context.Background(), obj) + NewService("").Label(obj) assert.Empty(t, obj.GetLabels()) }) t.Run("Add", func(t *testing.T) { obj := &wfv1.Workflow{} - NewService("foo").Label(context.Background(), obj) + NewService("foo").Label(obj) assert.Len(t, obj.GetLabels(), 1) assert.Equal(t, "foo", obj.GetLabels()[common.LabelKeyControllerInstanceID]) }) t.Run("Remove", func(t *testing.T) { obj := &wfv1.Workflow{ObjectMeta: metav1.ObjectMeta{Labels: map[string]string{common.LabelKeyControllerInstanceID: "bar"}}} - NewService("").Label(context.Background(), obj) + NewService("").Label(obj) assert.Empty(t, obj.GetLabels()) }) } @@ -33,17 +32,17 @@ func TestLabel(t *testing.T) { func TestWith(t *testing.T) { t.Run("Empty", func(t *testing.T) { opts := &metav1.ListOptions{} - NewService("").With(context.Background(), opts) + NewService("").With(opts) assert.Equal(t, "!workflows.argoproj.io/controller-instanceid", opts.LabelSelector) }) t.Run("EmptyExistingSelector", func(t *testing.T) { opts := &metav1.ListOptions{LabelSelector: "foo"} - NewService("").With(context.Background(), opts) + NewService("").With(opts) assert.Equal(t, "foo,!workflows.argoproj.io/controller-instanceid", opts.LabelSelector) }) t.Run("ExistingSelector", func(t *testing.T) { opts := &metav1.ListOptions{LabelSelector: "foo"} - NewService("foo").With(context.Background(), opts) + NewService("foo").With(opts) assert.Equal(t, "foo,workflows.argoproj.io/controller-instanceid=foo", opts.LabelSelector) }) } @@ -51,17 +50,17 @@ func TestWith(t *testing.T) { func TestValidate(t *testing.T) { t.Run("NoInstanceID", func(t *testing.T) { s := NewService("") - assert.NoError(t, s.Validate(context.Background(), &wfv1.Workflow{})) - assert.Error(t, s.Validate(context.Background(), &wfv1.Workflow{ObjectMeta: metav1.ObjectMeta{Labels: map[string]string{common.LabelKeyControllerInstanceID: "bar"}}})) + assert.NoError(t, s.Validate(&wfv1.Workflow{})) + assert.Error(t, s.Validate(&wfv1.Workflow{ObjectMeta: metav1.ObjectMeta{Labels: map[string]string{common.LabelKeyControllerInstanceID: "bar"}}})) }) t.Run("InstanceID", func(t *testing.T) { s := NewService("foo") - assert.Error(t, s.Validate(context.Background(), &wfv1.Workflow{})) - assert.Error(t, s.Validate(context.Background(), &wfv1.Workflow{ObjectMeta: metav1.ObjectMeta{Labels: map[string]string{common.LabelKeyControllerInstanceID: "bar"}}})) - assert.NoError(t, s.Validate(context.Background(), &wfv1.Workflow{ObjectMeta: metav1.ObjectMeta{Labels: map[string]string{common.LabelKeyControllerInstanceID: "foo"}}})) + assert.Error(t, s.Validate(&wfv1.Workflow{})) + assert.Error(t, s.Validate(&wfv1.Workflow{ObjectMeta: metav1.ObjectMeta{Labels: map[string]string{common.LabelKeyControllerInstanceID: "bar"}}})) + assert.NoError(t, s.Validate(&wfv1.Workflow{ObjectMeta: metav1.ObjectMeta{Labels: map[string]string{common.LabelKeyControllerInstanceID: "foo"}}})) }) } func Test_service_InstanceID(t *testing.T) { - assert.Equal(t, "foo", NewService("foo").InstanceID(context.Background())) + assert.Equal(t, "foo", NewService("foo").InstanceID()) } \ No newline at end of file diff --git a/util/marker/service.go b/util/marker/service.go deleted file mode 100644 index 01b358932bf8..000000000000 --- a/util/marker/service.go +++ /dev/null @@ -1,78 +0,0 @@ -package marker - -import ( - "context" - "math/rand" - - grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware" - log "github.com/sirupsen/logrus" - "google.golang.org/grpc" -) - -/* - A marker service is an abstract service. - - 1. At the start of the request, `ContextWithMarker` creates a random marker and puts it into the context. - 2. Any sub-types then invokes `Mark` to indicate the expected this happened. - 3. At the end of the request `Check` checks the marker and panics if it was not marked. -*/ -type Service interface { - ContextWithMarker(ctx context.Context) (func(), context.Context, int) - Mark(ctx context.Context) - Check(fullMethod string, marker int) - UnaryServerInterceptor() grpc.UnaryServerInterceptor - StreamServerInterceptor() grpc.StreamServerInterceptor -} - -func NewService(ignore func(fullMethod string) bool) Service { - return &service{struct{}{}, make(map[int]bool), ignore} -} - -type service struct { - markerKey struct{} - markers map[int]bool - ignore func(operation string) bool -} - -func (s *service) ContextWithMarker(ctx context.Context) (func(), context.Context, int) { - marker := rand.Int() - return func() { delete(s.markers, marker) }, context.WithValue(ctx, s.markerKey, marker), marker -} - -func (s *service) Mark(ctx context.Context) { - marker, ok := ctx.Value(s.markerKey).(int) - if ok { - s.markers[marker] = true - } -} - -func (s *service) Check(operation string, marker int) { - if s.ignore(operation) { - return - } - _, ok := s.markers[marker] - if !ok { - log.WithField("operation", operation).Fatal("marker not found - this should never happen") - } -} - -func (s *service) StreamServerInterceptor() grpc.StreamServerInterceptor { - return func(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error { - closer, ctx, marker := s.ContextWithMarker(ss.Context()) - defer closer() - wrapped := grpc_middleware.WrapServerStream(ss) - wrapped.WrappedContext = ctx - err := handler(srv, wrapped) - s.Check(info.FullMethod, marker) - return err - } -} -func (s *service) UnaryServerInterceptor() grpc.UnaryServerInterceptor { - return func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error) { - closer, ctx, marker := s.ContextWithMarker(ctx) - defer closer() - i, err := handler(ctx, req) - s.Check(info.FullMethod, marker) - return i, err - } -} diff --git a/util/marker/service_test.go b/util/marker/service_test.go deleted file mode 100644 index 89c9c6af4b23..000000000000 --- a/util/marker/service_test.go +++ /dev/null @@ -1,37 +0,0 @@ -package marker - -import ( - "context" - "testing" - - "github.com/stretchr/testify/assert" - "google.golang.org/grpc" -) - -func TestNewService(t *testing.T) { - s := NewService(func(fullMethod string) bool { - return fullMethod == "ignore" - }) - t.Run("Unary", func(t *testing.T) { - resp, err := s.UnaryServerInterceptor()(context.Background(), nil, &grpc.UnaryServerInfo{}, func(ctx context.Context, req interface{}) (interface{}, error) { - s.Mark(ctx) - return "my-resp", nil - }) - if assert.NoError(t, err) { - assert.Equal(t, "my-resp", resp) - } - }) - t.Run("Ignore", func(t *testing.T) { - _, err := s.UnaryServerInterceptor()(context.Background(), nil, &grpc.UnaryServerInfo{FullMethod: "ignore"}, func(ctx context.Context, req interface{}) (interface{}, error) { - return nil, nil - }) - assert.NoError(t, err) - }) - t.Run("Stream", func(t *testing.T) { - err := s.StreamServerInterceptor()("", &testServerStream{}, &grpc.StreamServerInfo{}, func(srv interface{}, ss grpc.ServerStream) error { - s.Mark(ss.Context()) - return nil - }) - assert.NoError(t, err) - }) -} diff --git a/util/marker/test_server_stream_test.go b/util/marker/test_server_stream_test.go deleted file mode 100644 index cca097a1ca4e..000000000000 --- a/util/marker/test_server_stream_test.go +++ /dev/null @@ -1,38 +0,0 @@ -package marker - -import ( - "context" - - "google.golang.org/grpc" - "google.golang.org/grpc/metadata" -) - -type testServerStream struct { -} - -// the only purpose of this line is to make sure testServerStream implements ServerStream -var _ grpc.ServerStream = &testServerStream{} - -func (t testServerStream) SetHeader(md metadata.MD) error { - panic("implement me") -} - -func (t testServerStream) SendHeader(md metadata.MD) error { - panic("implement me") -} - -func (t testServerStream) SetTrailer(md metadata.MD) { - panic("implement me") -} - -func (t testServerStream) Context() context.Context { - return context.Background() -} - -func (t testServerStream) SendMsg(m interface{}) error { - panic("implement me") -} - -func (t testServerStream) RecvMsg(m interface{}) error { - panic("implement me") -} diff --git a/workflow/controller/controller.go b/workflow/controller/controller.go index 1007e74585f4..1e0056772283 100644 --- a/workflow/controller/controller.go +++ b/workflow/controller/controller.go @@ -382,7 +382,7 @@ func (wfc *WorkflowController) archivedWorkflowGarbageCollector(stopCh <-chan st return case <-ticker.C: log.Info("Performing archived workflow GC") - err := wfc.wfArchive.DeleteWorkflows(context.Background(), time.Duration(ttl)) + err := wfc.wfArchive.DeleteWorkflows(time.Duration(ttl)) if err != nil { log.WithField("err", err).Error("Failed to delete archived workflows") } diff --git a/workflow/controller/operator.go b/workflow/controller/operator.go index f6a0234e43ce..f756bf770cec 100644 --- a/workflow/controller/operator.go +++ b/workflow/controller/operator.go @@ -1,7 +1,6 @@ package controller import ( - "context" "encoding/json" "fmt" "math" @@ -1589,7 +1588,7 @@ func (woc *wfOperationCtx) markWorkflowPhase(phase wfv1.NodePhase, markCompleted woc.updated = true woc.wf.Status.Message = err.Error() } - err = woc.controller.wfArchive.ArchiveWorkflow(context.Background(), woc.wf) + err = woc.controller.wfArchive.ArchiveWorkflow(woc.wf) if err != nil { woc.log.WithField("err", err).Error("Failed to archive workflow") } From cb13c2614064bfb60ebadf862ab0fc5b10ef3067 Mon Sep 17 00:00:00 2001 From: Alex Collins Date: Tue, 28 Apr 2020 11:14:41 -0700 Subject: [PATCH 12/15] tests --- .../cluster_workflow_template_server.go | 5 - .../cluster_workflow_template_server_test.go | 131 +++++++++++------- test/util/json.go | 10 ++ 3 files changed, 90 insertions(+), 56 deletions(-) create mode 100644 test/util/json.go diff --git a/server/clusterworkflowtemplate/cluster_workflow_template_server.go b/server/clusterworkflowtemplate/cluster_workflow_template_server.go index 0af013ccdd2f..75abdc0369b8 100644 --- a/server/clusterworkflowtemplate/cluster_workflow_template_server.go +++ b/server/clusterworkflowtemplate/cluster_workflow_template_server.go @@ -28,18 +28,13 @@ func (cwts *ClusterWorkflowTemplateServer) CreateClusterWorkflowTemplate(ctx con if req.Template == nil { return nil, fmt.Errorf("cluster workflow template was not found in the request body") } - cwts.instanceIDService.Label(req.Template) - cwftmplGetter := templateresolution.WrapClusterWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().ClusterWorkflowTemplates()) - _, err := validate.ValidateClusterWorkflowTemplate(nil, cwftmplGetter, req.Template) if err != nil { return nil, err } - return wfClient.ArgoprojV1alpha1().ClusterWorkflowTemplates().Create(req.Template) - } func (cwts *ClusterWorkflowTemplateServer) GetClusterWorkflowTemplate(ctx context.Context, req *clusterwftmplpkg.ClusterWorkflowTemplateGetRequest) (*v1alpha1.ClusterWorkflowTemplate, error) { diff --git a/server/clusterworkflowtemplate/cluster_workflow_template_server_test.go b/server/clusterworkflowtemplate/cluster_workflow_template_server_test.go index 669b52f6b64c..c744d9da95cf 100644 --- a/server/clusterworkflowtemplate/cluster_workflow_template_server_test.go +++ b/server/clusterworkflowtemplate/cluster_workflow_template_server_test.go @@ -2,7 +2,6 @@ package clusterworkflowtemplate import ( "context" - "encoding/json" "testing" "github.com/stretchr/testify/assert" @@ -12,11 +11,15 @@ import ( "github.com/argoproj/argo/pkg/apis/workflow/v1alpha1" wftFake "github.com/argoproj/argo/pkg/client/clientset/versioned/fake" "github.com/argoproj/argo/server/auth" + testutil "github.com/argoproj/argo/test/util" "github.com/argoproj/argo/util/instanceid" + "github.com/argoproj/argo/workflow/common" ) -const cwftStr1 = `{ - "template": { +var unlabelled, cwftObj2, cwftObj3 v1alpha1.ClusterWorkflowTemplate + +func init() { + testutil.MustUnmarshallJSON(`{ "apiVersion": "argoproj.io/v1alpha1", "kind": "ClusterWorkflowTemplate", "metadata": { @@ -53,10 +56,9 @@ const cwftStr1 = `{ } ] } - } -}` +}`, &unlabelled) -const cwftStr2 = `{ + testutil.MustUnmarshallJSON(`{ "apiVersion": "argoproj.io/v1alpha1", "kind": "ClusterWorkflowTemplate", "metadata": { @@ -97,9 +99,9 @@ const cwftStr2 = `{ } ] } -}` +}`, &cwftObj2) -const cwftStr3 = `{ + testutil.MustUnmarshallJSON(`{ "apiVersion": "argoproj.io/v1alpha1", "kind": "ClusterWorkflowTemplate", "metadata": { @@ -139,47 +141,49 @@ const cwftStr3 = `{ } ] } -}` +}`, &cwftObj3) +} func getClusterWorkflowTemplateServer() (clusterwftmplpkg.ClusterWorkflowTemplateServiceServer, context.Context) { - var cwftObj1, cwftObj2 v1alpha1.ClusterWorkflowTemplate - err := json.Unmarshal([]byte(cwftStr2), &cwftObj1) - if err != nil { - panic(err) - } - err = json.Unmarshal([]byte(cwftStr3), &cwftObj2) - if err != nil { - panic(err) - } kubeClientSet := fake.NewSimpleClientset() - wfClientset := wftFake.NewSimpleClientset(&cwftObj1, &cwftObj2) + wfClientset := wftFake.NewSimpleClientset(&unlabelled, &cwftObj2, &cwftObj3) ctx := context.WithValue(context.WithValue(context.TODO(), auth.WfKey, wfClientset), auth.KubeKey, kubeClientSet) return NewClusterWorkflowTemplateServer(instanceid.NewService("my-instanceid")), ctx } func TestWorkflowTemplateServer_CreateClusterWorkflowTemplate(t *testing.T) { server, ctx := getClusterWorkflowTemplateServer() - var cwftReq clusterwftmplpkg.ClusterWorkflowTemplateCreateRequest - err := json.Unmarshal([]byte(cwftStr1), &cwftReq) - if err != nil { - panic(err) + cwftReq := clusterwftmplpkg.ClusterWorkflowTemplateCreateRequest{ + Template: unlabelled.DeepCopy(), } + cwftReq.Template.Name = "foo" + assert.NotContains(t, cwftReq.Template.Labels, common.LabelKeyControllerInstanceID) cwftRsp, err := server.CreateClusterWorkflowTemplate(ctx, &cwftReq) if assert.NoError(t, err) { assert.NotNil(t, cwftRsp) + // ensure the label is added + assert.Contains(t, cwftRsp.Labels, common.LabelKeyControllerInstanceID) } } func TestWorkflowTemplateServer_GetClusterWorkflowTemplate(t *testing.T) { server, ctx := getClusterWorkflowTemplateServer() - cwftReq := clusterwftmplpkg.ClusterWorkflowTemplateGetRequest{ - Name: "cluster-workflow-template-whalesay-template2", - } - cwftRsp, err := server.GetClusterWorkflowTemplate(ctx, &cwftReq) - if assert.NoError(t, err) { - assert.NotNil(t, cwftRsp) - assert.Equal(t, "cluster-workflow-template-whalesay-template2", cwftRsp.Name) - } + t.Run("Labelled", func(t *testing.T) { + cwftRsp, err := server.GetClusterWorkflowTemplate(ctx, &clusterwftmplpkg.ClusterWorkflowTemplateGetRequest{ + Name: "cluster-workflow-template-whalesay-template2", + }) + if assert.NoError(t, err) { + assert.NotNil(t, cwftRsp) + assert.Equal(t, "cluster-workflow-template-whalesay-template2", cwftRsp.Name) + assert.Contains(t, cwftRsp.Labels, common.LabelKeyControllerInstanceID) + } + }) + t.Run("Unlabelled", func(t *testing.T) { + _, err := server.GetClusterWorkflowTemplate(ctx, &clusterwftmplpkg.ClusterWorkflowTemplateGetRequest{ + Name: "cluster-workflow-template-whalesay-template", + }) + assert.Error(t, err) + }) } func TestWorkflowTemplateServer_ListClusterWorkflowTemplates(t *testing.T) { @@ -188,34 +192,59 @@ func TestWorkflowTemplateServer_ListClusterWorkflowTemplates(t *testing.T) { cwftRsp, err := server.ListClusterWorkflowTemplates(ctx, &cwftReq) if assert.NoError(t, err) { assert.Len(t, cwftRsp.Items, 2) + for _, item := range cwftRsp.Items { + assert.Contains(t, item.Labels, common.LabelKeyControllerInstanceID) + } } } func TestWorkflowTemplateServer_DeleteClusterWorkflowTemplate(t *testing.T) { server, ctx := getClusterWorkflowTemplateServer() - cwftReq := clusterwftmplpkg.ClusterWorkflowTemplateDeleteRequest{ - Name: "cluster-workflow-template-whalesay-template2", - } - _, err := server.DeleteClusterWorkflowTemplate(ctx, &cwftReq) - assert.NoError(t, err) + t.Run("Labelled", func(t *testing.T) { + _, err := server.DeleteClusterWorkflowTemplate(ctx, &clusterwftmplpkg.ClusterWorkflowTemplateDeleteRequest{ + Name: "cluster-workflow-template-whalesay-template2", + }) + assert.NoError(t, err) + }) + t.Run("Unlabelled", func(t *testing.T) { + _, err := server.DeleteClusterWorkflowTemplate(ctx, &clusterwftmplpkg.ClusterWorkflowTemplateDeleteRequest{ + Name: "cluster-workflow-template-whalesay-template", + }) + assert.Error(t, err) + }) +} +func TestWorkflowTemplateServer_LintClusterWorkflowTemplate(t *testing.T) { + server, ctx := getClusterWorkflowTemplateServer() + t.Run("Labelled", func(t *testing.T) { + var cwftObj1 v1alpha1.ClusterWorkflowTemplate + resp, err := server.LintClusterWorkflowTemplate(ctx, &clusterwftmplpkg.ClusterWorkflowTemplateLintRequest{ + Template: &cwftObj1, + }) + if assert.NoError(t, err) { + assert.Contains(t, resp.Labels, common.LabelKeyControllerInstanceID) + } + }) } func TestWorkflowTemplateServer_UpdateClusterWorkflowTemplate(t *testing.T) { server, ctx := getClusterWorkflowTemplateServer() - var cwftObj1 v1alpha1.ClusterWorkflowTemplate - err := json.Unmarshal([]byte(cwftStr2), &cwftObj1) - if err != nil { - panic(err) - } - cwftObj1.Spec.Templates[0].Container.Image = "alpine:latest" - cwftReq := clusterwftmplpkg.ClusterWorkflowTemplateUpdateRequest{ - Name: "cluster-workflow-template-whalesay-template2", - Template: &cwftObj1, - } - cwftRsp, err := server.UpdateClusterWorkflowTemplate(ctx, &cwftReq) - - if assert.NoError(t, err) { - assert.Equal(t, "alpine:latest", cwftRsp.Spec.Templates[0].Container.Image) - } + t.Run("Labelled", func(t *testing.T) { + req := &clusterwftmplpkg.ClusterWorkflowTemplateUpdateRequest{ + Name: "cluster-workflow-template-whalesay-template2", + Template: cwftObj2.DeepCopy(), + } + req.Template.Spec.Templates[0].Container.Image = "alpine:latest" + cwftRsp, err := server.UpdateClusterWorkflowTemplate(ctx, req) + if assert.NoError(t, err) { + assert.Equal(t, "alpine:latest", cwftRsp.Spec.Templates[0].Container.Image) + } + }) + t.Run("Unlabelled", func(t *testing.T) { + _, err := server.UpdateClusterWorkflowTemplate(ctx, &clusterwftmplpkg.ClusterWorkflowTemplateUpdateRequest{ + Name: "cluster-workflow-template-whalesay-template", + Template: &unlabelled, + }) + assert.Error(t, err) + }) } diff --git a/test/util/json.go b/test/util/json.go new file mode 100644 index 000000000000..86857fd60518 --- /dev/null +++ b/test/util/json.go @@ -0,0 +1,10 @@ +package util + +import "encoding/json" + +func MustUnmarshallJSON(text string, v interface{}) { + err := json.Unmarshal([]byte(text), v) + if err != nil { + panic(err) + } +} From c06d7c3e4983ab89358a18a9bb62caa0dde3f835 Mon Sep 17 00:00:00 2001 From: Alex Collins Date: Tue, 28 Apr 2020 11:29:12 -0700 Subject: [PATCH 13/15] Add tests for cron --- server/cronworkflow/cron_workflow_server.go | 3 - .../cronworkflow/cron_workflow_server_test.go | 64 +++++++++++++------ test/util/yaml.go | 10 +++ util/tmp.go | 5 -- util/tmp_test.go | 11 ---- 5 files changed, 55 insertions(+), 38 deletions(-) create mode 100644 test/util/yaml.go delete mode 100644 util/tmp.go delete mode 100644 util/tmp_test.go diff --git a/server/cronworkflow/cron_workflow_server.go b/server/cronworkflow/cron_workflow_server.go index fa8bbb86f3c5..099510f9b7d1 100644 --- a/server/cronworkflow/cron_workflow_server.go +++ b/server/cronworkflow/cron_workflow_server.go @@ -50,15 +50,12 @@ func (c *cronWorkflowServiceServer) CreateCronWorkflow(ctx context.Context, req return nil, fmt.Errorf("cron workflow was not found in the request body") } c.instanceIDService.Label(req.CronWorkflow) - wftmplGetter := templateresolution.WrapWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().WorkflowTemplates(req.Namespace)) cwftmplGetter := templateresolution.WrapClusterWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().ClusterWorkflowTemplates()) - err := validate.ValidateCronWorkflow(wftmplGetter, cwftmplGetter, req.CronWorkflow) if err != nil { return nil, err } - return wfClient.ArgoprojV1alpha1().CronWorkflows(req.Namespace).Create(req.CronWorkflow) } diff --git a/server/cronworkflow/cron_workflow_server_test.go b/server/cronworkflow/cron_workflow_server_test.go index e33ab7598896..c5707fac44ca 100644 --- a/server/cronworkflow/cron_workflow_server_test.go +++ b/server/cronworkflow/cron_workflow_server_test.go @@ -4,22 +4,26 @@ import ( "context" "testing" - "github.com/ghodss/yaml" "github.com/stretchr/testify/assert" cronworkflowpkg "github.com/argoproj/argo/pkg/apiclient/cronworkflow" wfv1 "github.com/argoproj/argo/pkg/apis/workflow/v1alpha1" wftFake "github.com/argoproj/argo/pkg/client/clientset/versioned/fake" "github.com/argoproj/argo/server/auth" + testutil "github.com/argoproj/argo/test/util" "github.com/argoproj/argo/util/instanceid" + "github.com/argoproj/argo/workflow/common" ) func Test_cronWorkflowServiceServer(t *testing.T) { - cronWfRaw := `apiVersion: argoproj.io/v1alpha1 + var unlabelled, cronWf wfv1.CronWorkflow + testutil.MustUnmarshallYAML(`apiVersion: argoproj.io/v1alpha1 kind: CronWorkflow metadata: name: my-name namespace: my-ns + labels: + workflows.argoproj.io/controller-instanceid: my-instanceid spec: schedule: "* * * * *" concurrencyPolicy: "Allow" @@ -36,14 +40,16 @@ spec: image: python:alpine3.6 imagePullPolicy: IfNotPresent command: ["sh", -c] - args: ["echo hello"]` + args: ["echo hello"]`, &cronWf) - var cronWf wfv1.CronWorkflow - err := yaml.Unmarshal([]byte(cronWfRaw), &cronWf) - if err != nil { - panic(err) - } - wfClientset := wftFake.NewSimpleClientset() + testutil.MustUnmarshallYAML(`apiVersion: argoproj.io/v1alpha1 +kind: CronWorkflow +metadata: + name: unlabelled + namespace: my-ns +`, &unlabelled) + + wfClientset := wftFake.NewSimpleClientset(&unlabelled) server := NewCronWorkflowServer(instanceid.NewService("my-instanceid")) ctx := context.WithValue(context.TODO(), auth.WfKey, wfClientset) @@ -54,6 +60,7 @@ spec: }) if assert.NoError(t, err) { assert.NotNil(t, created) + assert.Contains(t, created.Labels, common.LabelKeyControllerInstanceID) } }) t.Run("LintWorkflow", func(t *testing.T) { @@ -63,6 +70,7 @@ spec: }) if assert.NoError(t, err) { assert.NotNil(t, wf) + assert.Contains(t, wf.Labels, common.LabelKeyControllerInstanceID) } }) t.Run("ListCronWorkflows", func(t *testing.T) { @@ -72,19 +80,37 @@ spec: } }) t.Run("GetCronWorkflow", func(t *testing.T) { - cronWf, err := server.GetCronWorkflow(ctx, &cronworkflowpkg.GetCronWorkflowRequest{Namespace: "my-ns", Name: "my-name"}) - if assert.NoError(t, err) { - assert.NotNil(t, cronWf) - } + t.Run("Labelled", func(t *testing.T) { + cronWf, err := server.GetCronWorkflow(ctx, &cronworkflowpkg.GetCronWorkflowRequest{Namespace: "my-ns", Name: "my-name"}) + if assert.NoError(t, err) { + assert.NotNil(t, cronWf) + } + }) + t.Run("Unlabelled", func(t *testing.T) { + _, err := server.GetCronWorkflow(ctx, &cronworkflowpkg.GetCronWorkflowRequest{Namespace: "my-ns", Name: "unlabelled"}) + assert.Error(t, err) + }) }) t.Run("UpdateCronWorkflow", func(t *testing.T) { - cronWf, err := server.UpdateCronWorkflow(ctx, &cronworkflowpkg.UpdateCronWorkflowRequest{Namespace: "my-ns", Name: "my-name", CronWorkflow: &cronWf}) - if assert.NoError(t, err) { - assert.NotNil(t, cronWf) - } + t.Run("Labelled", func(t *testing.T) { + cronWf, err := server.UpdateCronWorkflow(ctx, &cronworkflowpkg.UpdateCronWorkflowRequest{Namespace: "my-ns", Name: "my-name", CronWorkflow: &cronWf}) + if assert.NoError(t, err) { + assert.NotNil(t, cronWf) + } + }) + t.Run("Unlabelled", func(t *testing.T) { + _, err := server.UpdateCronWorkflow(ctx, &cronworkflowpkg.UpdateCronWorkflowRequest{Namespace: "my-ns", Name: "unlabelled", CronWorkflow: &cronWf}) + assert.Error(t, err) + }) }) t.Run("DeleteCronWorkflow", func(t *testing.T) { - _, err := server.DeleteCronWorkflow(ctx, &cronworkflowpkg.DeleteCronWorkflowRequest{Name: "my-name", Namespace: "my-ns"}) - assert.NoError(t, err) + t.Run("Labelled", func(t *testing.T) { + _, err := server.DeleteCronWorkflow(ctx, &cronworkflowpkg.DeleteCronWorkflowRequest{Name: "my-name", Namespace: "my-ns"}) + assert.NoError(t, err) + }) + t.Run("Unlabelled", func(t *testing.T) { + _, err := server.DeleteCronWorkflow(ctx, &cronworkflowpkg.DeleteCronWorkflowRequest{Name: "unlabelled", Namespace: "my-ns"}) + assert.Error(t, err) + }) }) } diff --git a/test/util/yaml.go b/test/util/yaml.go new file mode 100644 index 000000000000..ec44000b3e50 --- /dev/null +++ b/test/util/yaml.go @@ -0,0 +1,10 @@ +package util + +import "sigs.k8s.io/yaml" + +func MustUnmarshallYAML(text string, v interface{}) { + err := yaml.Unmarshal([]byte(text), v) + if err != nil { + panic(err) + } +} diff --git a/util/tmp.go b/util/tmp.go deleted file mode 100644 index b4e558369c13..000000000000 --- a/util/tmp.go +++ /dev/null @@ -1,5 +0,0 @@ -package util - -func foo() string { - return "bar" -} diff --git a/util/tmp_test.go b/util/tmp_test.go deleted file mode 100644 index 0e4faa34a02d..000000000000 --- a/util/tmp_test.go +++ /dev/null @@ -1,11 +0,0 @@ -package util - -import ( - "testing" - - "github.com/stretchr/testify/assert" -) - -func Test_foo(t *testing.T) { - assert.Equal(t, "bar", foo()) -} From ebd8cedff74427cb65db831279e376178bb36f37 Mon Sep 17 00:00:00 2001 From: Alex Collins Date: Tue, 28 Apr 2020 11:53:35 -0700 Subject: [PATCH 14/15] Add workflow tests --- server/workflow/workflow_server_test.go | 212 +++++++++++++----------- 1 file changed, 112 insertions(+), 100 deletions(-) diff --git a/server/workflow/workflow_server_test.go b/server/workflow/workflow_server_test.go index 0318d5f2b5f5..b78fafcc6091 100644 --- a/server/workflow/workflow_server_test.go +++ b/server/workflow/workflow_server_test.go @@ -6,7 +6,6 @@ import ( "fmt" "testing" - "github.com/argoproj/pkg/errors" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" corev1 "k8s.io/api/core/v1" @@ -21,9 +20,38 @@ import ( "github.com/argoproj/argo/pkg/apis/workflow/v1alpha1" v1alpha "github.com/argoproj/argo/pkg/client/clientset/versioned/fake" "github.com/argoproj/argo/server/auth" + testutil "github.com/argoproj/argo/test/util" "github.com/argoproj/argo/util/instanceid" + "github.com/argoproj/argo/workflow/common" ) +const unlabelled = `{ + "apiVersion": "argoproj.io/v1alpha1", + "kind": "Workflow", + "metadata": { + "namespace": "workflows", + "name": "unlabelled", + "labels": { + "workflows.argoproj.io/phase": "Failed" + } + }, + "spec": { + "entrypoint": "whalesay", + "templates": [ + { + "container": { + "image": "docker/whalesay:latest" + }, + "name": "whalesay" + } + ] + }, + "status": { + "phase": "Failed" + } +} +` + const wf1 = ` { "apiVersion": "argoproj.io/v1alpha1", @@ -369,10 +397,7 @@ const workflow1 = ` "apiVersion": "argoproj.io/v1alpha1", "kind": "Workflow", "metadata": { - "generateName": "hello-world-", - "labels": { - "workflows.argoproj.io/controller-instanceid": "my-instanceid" - } + "generateName": "hello-world-" }, "spec": { "entrypoint": "whalesay", @@ -394,7 +419,6 @@ const workflow1 = ` } } ` - const workflowtmpl = ` { "apiVersion": "argoproj.io/v1alpha1", @@ -518,27 +542,29 @@ const clusterworkflowtmpl = ` func getWorkflowServer() (workflowpkg.WorkflowServiceServer, context.Context) { - var wfObj1, wfObj2, wfObj3, wfObj4, wfObj5, failedWfObj v1alpha1.Workflow + var unlabelledObj, wfObj1, wfObj2, wfObj3, wfObj4, wfObj5, failedWfObj v1alpha1.Workflow var wftmpl v1alpha1.WorkflowTemplate var cwfTmpl v1alpha1.ClusterWorkflowTemplate var cronwfObj v1alpha1.CronWorkflow - errors.CheckError(json.Unmarshal([]byte(wf1), &wfObj1)) - errors.CheckError(json.Unmarshal([]byte(wf2), &wfObj2)) - errors.CheckError(json.Unmarshal([]byte(wf3), &wfObj3)) - errors.CheckError(json.Unmarshal([]byte(wf4), &wfObj4)) - errors.CheckError(json.Unmarshal([]byte(wf5), &wfObj5)) - errors.CheckError(json.Unmarshal([]byte(failedWf), &failedWfObj)) - errors.CheckError(json.Unmarshal([]byte(workflowtmpl), &wftmpl)) - errors.CheckError(json.Unmarshal([]byte(cronwf), &cronwfObj)) - errors.CheckError(json.Unmarshal([]byte(clusterworkflowtmpl), &cwfTmpl)) + testutil.MustUnmarshallJSON(unlabelled, &unlabelledObj) + testutil.MustUnmarshallJSON(wf1, &wfObj1) + testutil.MustUnmarshallJSON(wf1, &wfObj1) + testutil.MustUnmarshallJSON(wf2, &wfObj2) + testutil.MustUnmarshallJSON(wf3, &wfObj3) + testutil.MustUnmarshallJSON(wf4, &wfObj4) + testutil.MustUnmarshallJSON(wf5, &wfObj5) + testutil.MustUnmarshallJSON(failedWf, &failedWfObj) + testutil.MustUnmarshallJSON(workflowtmpl, &wftmpl) + testutil.MustUnmarshallJSON(cronwf, &cronwfObj) + testutil.MustUnmarshallJSON(clusterworkflowtmpl, &cwfTmpl) offloadNodeStatusRepo := &mocks.OffloadNodeStatusRepo{} offloadNodeStatusRepo.On("IsEnabled", mock.Anything).Return(true) offloadNodeStatusRepo.On("List", mock.Anything).Return(map[sqldb.UUIDVersion]v1alpha1.Nodes{}, nil) server := NewWorkflowServer(instanceid.NewService("my-instanceid"), offloadNodeStatusRepo) kubeClientSet := fake.NewSimpleClientset() - wfClientset := v1alpha.NewSimpleClientset(&wfObj1, &wfObj2, &wfObj3, &wfObj4, &wfObj5, &failedWfObj, &wftmpl, &cronwfObj, &cwfTmpl) + wfClientset := v1alpha.NewSimpleClientset(&unlabelledObj, &wfObj1, &wfObj2, &wfObj3, &wfObj4, &wfObj5, &failedWfObj, &wftmpl, &cronwfObj, &cwfTmpl) wfClientset.PrependReactor("create", "workflows", generateNameReactor) ctx := context.WithValue(context.WithValue(context.TODO(), auth.WfKey, wfClientset), auth.KubeKey, kubeClientSet) return server, ctx @@ -555,31 +581,25 @@ func generateNameReactor(action ktesting.Action) (handled bool, ret runtime.Obje } func getWorkflow(ctx context.Context, server workflowpkg.WorkflowServiceServer, namespace string, wfName string) (*v1alpha1.Workflow, error) { - - req := workflowpkg.WorkflowGetRequest{ + return server.GetWorkflow(ctx, &workflowpkg.WorkflowGetRequest{ Name: wfName, Namespace: namespace, - } - - return server.GetWorkflow(ctx, &req) + }) } func getWorkflowList(ctx context.Context, server workflowpkg.WorkflowServiceServer, namespace string) (*v1alpha1.WorkflowList, error) { return server.ListWorkflows(ctx, &workflowpkg.WorkflowListRequest{Namespace: namespace}) - } func TestCreateWorkflow(t *testing.T) { - server, ctx := getWorkflowServer() var req workflowpkg.WorkflowCreateRequest - _ = json.Unmarshal([]byte(workflow1), &req) - + testutil.MustUnmarshallJSON(workflow1, &req) wf, err := server.CreateWorkflow(ctx, &req) - - assert.NotNil(t, wf) - assert.Nil(t, err) - + if assert.NoError(t, err) { + assert.NotNil(t, wf) + assert.Contains(t, wf.Labels, common.LabelKeyControllerInstanceID) + } } type testWatchWorkflowServer struct { @@ -605,83 +625,73 @@ func TestWatchWorkflows(t *testing.T) { } func TestGetWorkflowWithNotFound(t *testing.T) { - server, ctx := getWorkflowServer() - - wf, err := getWorkflow(ctx, server, "test", "NotFound") - assert.Nil(t, wf) - assert.NotNil(t, err) - + t.Run("Labelled", func(t *testing.T) { + wf, err := getWorkflow(ctx, server, "test", "NotFound") + if assert.Error(t, err) { + assert.Nil(t, wf) + } + }) + t.Run("Unlabelled", func(t *testing.T) { + _, err := getWorkflow(ctx, server, "test", "unlabelled") + assert.Error(t, err) + }) } func TestListWorkflow(t *testing.T) { - server, ctx := getWorkflowServer() - wfl, err := getWorkflowList(ctx, server, "workflows") - assert.NotNil(t, wfl) - assert.Equal(t, 4, len(wfl.Items)) - assert.Nil(t, err) - + if assert.NoError(t, err) { + assert.NotNil(t, wfl) + assert.Equal(t, 4, len(wfl.Items)) + } wfl, err = getWorkflowList(ctx, server, "test") - assert.NotNil(t, wfl) - assert.Equal(t, 2, len(wfl.Items)) - assert.Nil(t, err) + if assert.NoError(t, err) { + assert.NotNil(t, wfl) + assert.Equal(t, 2, len(wfl.Items)) + } } func TestDeleteWorkflow(t *testing.T) { - server, ctx := getWorkflowServer() - - wf, err := getWorkflow(ctx, server, "workflows", "hello-world-b6h5m") - assert.Nil(t, err) - delReq := workflowpkg.WorkflowDeleteRequest{ - Name: wf.Name, - Namespace: wf.Namespace, - } - - delRsp, err := server.DeleteWorkflow(ctx, &delReq) - - assert.NoError(t, err) - assert.NotNil(t, delRsp) - - wfl, err := getWorkflowList(ctx, server, "workflows") - if assert.NoError(t, err) { - assert.Len(t, wfl.Items, 3) - } + t.Run("Labelled", func(t *testing.T) { + delRsp, err := server.DeleteWorkflow(ctx, &workflowpkg.WorkflowDeleteRequest{Name: "hello-world-b6h5m", Namespace: "workflows"}) + if assert.NoError(t, err) { + assert.NotNil(t, delRsp) + } + }) + t.Run("Unlabelled", func(t *testing.T) { + _, err := server.DeleteWorkflow(ctx, &workflowpkg.WorkflowDeleteRequest{Name: "unlabelled", Namespace: "workflows"}) + assert.Error(t, err) + }) } func TestRetryWorkflow(t *testing.T) { server, ctx := getWorkflowServer() - req := workflowpkg.WorkflowRetryRequest{Name: "failed", Namespace: "workflows"} - retried, err := server.RetryWorkflow(ctx, &req) - if assert.NoError(t, err) { - assert.NotNil(t, retried) - } + t.Run("Labelled", func(t *testing.T) { + retried, err := server.RetryWorkflow(ctx, &workflowpkg.WorkflowRetryRequest{Name: "failed", Namespace: "workflows"}) + if assert.NoError(t, err) { + assert.NotNil(t, retried) + } + }) + t.Run("Unlabelled", func(t *testing.T) { + _, err := server.RetryWorkflow(ctx, &workflowpkg.WorkflowRetryRequest{Name: "unlabelled", Namespace: "workflows"}) + assert.Error(t, err) + }) } func TestSuspendResumeWorkflow(t *testing.T) { server, ctx := getWorkflowServer() - - wf, err := getWorkflow(ctx, server, "workflows", "hello-world-9tql2-run") - assert.Nil(t, err) - susWfReq := workflowpkg.WorkflowSuspendRequest{ - Name: wf.Name, - Namespace: wf.Namespace, - } - wf, err = server.SuspendWorkflow(ctx, &susWfReq) - assert.NotNil(t, wf) - assert.Equal(t, true, *wf.Spec.Suspend) - assert.Nil(t, err) - rsmWfReq := workflowpkg.WorkflowResumeRequest{ - Name: wf.Name, - Namespace: wf.Namespace, + wf, err := server.SuspendWorkflow(ctx, &workflowpkg.WorkflowSuspendRequest{Name: "hello-world-9tql2-run", Namespace: "workflows"}) + if assert.NoError(t, err) { + assert.NotNil(t, wf) + assert.Equal(t, true, *wf.Spec.Suspend) + wf, err = server.ResumeWorkflow(ctx, &workflowpkg.WorkflowResumeRequest{Name: wf.Name, Namespace: wf.Namespace}) + if assert.NoError(t, err) { + assert.NotNil(t, wf) + assert.Nil(t, wf.Spec.Suspend) + } } - wf, err = server.ResumeWorkflow(ctx, &rsmWfReq) - - assert.NotNil(t, wf) - assert.Nil(t, wf.Spec.Suspend) - assert.Nil(t, err) } func TestSuspendResumeWorkflowWithNotFound(t *testing.T) { @@ -739,26 +749,27 @@ func TestStopWorkflow(t *testing.T) { } func TestResubmitWorkflow(t *testing.T) { - server, ctx := getWorkflowServer() - wf, err := getWorkflow(ctx, server, "workflows", "hello-world-9tql2") - assert.Nil(t, err) - wf, err = server.ResubmitWorkflow(ctx, &workflowpkg.WorkflowResubmitRequest{ - Name: wf.Name, - Namespace: wf.Namespace, + t.Run("Labelled", func(t *testing.T) { + wf, err := server.ResubmitWorkflow(ctx, &workflowpkg.WorkflowResubmitRequest{Name: "hello-world-9tql2", Namespace: "workflows"}) + if assert.NoError(t, err) { + assert.NotNil(t, wf) + } + }) + t.Run("Unlabelled", func(t *testing.T) { + _, err := server.ResubmitWorkflow(ctx, &workflowpkg.WorkflowResubmitRequest{Name: "unlabelled", Namespace: "workflows"}) + assert.Error(t, err) }) - if assert.NoError(t, err) { - assert.NotNil(t, wf) - } } func TestLintWorkflow(t *testing.T) { server, ctx := getWorkflowServer() wf := &v1alpha1.Workflow{} - assert.NoError(t, json.Unmarshal([]byte(wf1), &wf)) + testutil.MustUnmarshallJSON(unlabelled, &wf) linted, err := server.LintWorkflow(ctx, &workflowpkg.WorkflowLintRequest{Workflow: wf}) if assert.NoError(t, err) { assert.NotNil(t, linted) + assert.Contains(t, linted.Labels, common.LabelKeyControllerInstanceID) } } @@ -766,7 +777,7 @@ type testPodLogsServer struct { testServerStream } -func (t testPodLogsServer) Send(entry *workflowpkg.LogEntry) error { +func (t testPodLogsServer) Send(*workflowpkg.LogEntry) error { panic("implement me") } @@ -785,7 +796,6 @@ func TestPodLogs(t *testing.T) { } func TestSubmitWorkflowFromResource(t *testing.T) { - server, ctx := getWorkflowServer() t.Run("SubmitFromWorkflowTemplate", func(t *testing.T) { wf, err := server.SubmitWorkflow(ctx, &workflowpkg.WorkflowSubmitRequest{ @@ -795,6 +805,7 @@ func TestSubmitWorkflowFromResource(t *testing.T) { }) if assert.NoError(t, err) { assert.NotNil(t, wf) + assert.Contains(t, wf.Labels, common.LabelKeyControllerInstanceID) } }) t.Run("SubmitFromCronWorkflow", func(t *testing.T) { @@ -805,6 +816,7 @@ func TestSubmitWorkflowFromResource(t *testing.T) { }) if assert.NoError(t, err) { assert.NotNil(t, wf) + assert.Contains(t, wf.Labels, common.LabelKeyControllerInstanceID) } }) t.Run("SubmitFromClusterWorkflowTemplate", func(t *testing.T) { @@ -815,7 +827,7 @@ func TestSubmitWorkflowFromResource(t *testing.T) { }) if assert.NoError(t, err) { assert.NotNil(t, wf) + assert.Contains(t, wf.Labels, common.LabelKeyControllerInstanceID) } }) - } From 7dca1513bb12d1af39522ebe32c2ecb46c83ec4e Mon Sep 17 00:00:00 2001 From: Alex Collins Date: Tue, 28 Apr 2020 12:20:28 -0700 Subject: [PATCH 15/15] Deprecated unused field --- api/openapi-spec/swagger.json | 6 + .../cluster-workflow-template.pb.go | 89 +++++------ .../cluster-workflow-template.proto | 3 +- .../cluster-workflow-template.swagger.json | 4 +- .../cronworkflow/cron-workflow.pb.go | 93 +++++------ .../cronworkflow/cron-workflow.proto | 3 +- .../cronworkflow/cron-workflow.swagger.json | 4 +- .../workflowtemplate/workflow-template.pb.go | 92 +++++------ .../workflowtemplate/workflow-template.proto | 3 +- .../workflow-template.swagger.json | 4 +- .../cluster_workflow_template_server_test.go | 2 - server/cronworkflow/cron_workflow_server.go | 2 +- .../cronworkflow/cron_workflow_server_test.go | 4 +- .../workflow_template_server.go | 11 -- .../workflow_template_server_test.go | 146 +++++++++++------- 15 files changed, 251 insertions(+), 215 deletions(-) diff --git a/api/openapi-spec/swagger.json b/api/openapi-spec/swagger.json index e81f561d2b39..71b0feffa4e3 100644 --- a/api/openapi-spec/swagger.json +++ b/api/openapi-spec/swagger.json @@ -289,6 +289,7 @@ "parameters": [ { "type": "string", + "description": "DEPRECATED: This field is ignored.", "name": "name", "in": "path", "required": true @@ -563,6 +564,7 @@ }, { "type": "string", + "description": "DEPRECATED: This field is ignored.", "name": "name", "in": "path", "required": true @@ -951,6 +953,7 @@ }, { "type": "string", + "description": "DEPRECATED: This field is ignored.", "name": "name", "in": "path", "required": true @@ -1689,6 +1692,7 @@ "type": "object", "properties": { "name": { + "description": "DEPRECATED: This field is ignored.", "type": "string" }, "template": { @@ -1731,6 +1735,7 @@ "$ref": "#/definitions/io.argoproj.workflow.v1alpha1.CronWorkflow" }, "name": { + "description": "DEPRECATED: This field is ignored.", "type": "string" }, "namespace": { @@ -6411,6 +6416,7 @@ "type": "object", "properties": { "name": { + "description": "DEPRECATED: This field is ignored.", "type": "string" }, "namespace": { diff --git a/pkg/apiclient/clusterworkflowtemplate/cluster-workflow-template.pb.go b/pkg/apiclient/clusterworkflowtemplate/cluster-workflow-template.pb.go index 758616c13735..ad168e52ea82 100644 --- a/pkg/apiclient/clusterworkflowtemplate/cluster-workflow-template.pb.go +++ b/pkg/apiclient/clusterworkflowtemplate/cluster-workflow-template.pb.go @@ -192,7 +192,8 @@ func (m *ClusterWorkflowTemplateListRequest) GetListOptions() *v1.ListOptions { } type ClusterWorkflowTemplateUpdateRequest struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // DEPRECATED: This field is ignored. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Deprecated: Do not use. Template *v1alpha1.ClusterWorkflowTemplate `protobuf:"bytes,2,opt,name=template,proto3" json:"template,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` @@ -232,6 +233,7 @@ func (m *ClusterWorkflowTemplateUpdateRequest) XXX_DiscardUnknown() { var xxx_messageInfo_ClusterWorkflowTemplateUpdateRequest proto.InternalMessageInfo +// Deprecated: Do not use. func (m *ClusterWorkflowTemplateUpdateRequest) GetName() string { if m != nil { return m.Name @@ -410,49 +412,50 @@ func init() { } var fileDescriptor_688d96b5f613e598 = []byte{ - // 666 bytes of a gzipped FileDescriptorProto + // 675 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x56, 0xc1, 0x6f, 0xd3, 0x3e, - 0x14, 0x96, 0xab, 0x9f, 0x7e, 0x02, 0x4f, 0xbb, 0xf8, 0xc2, 0x14, 0xd6, 0x0a, 0xac, 0xa1, 0x42, - 0xa1, 0x0e, 0xe9, 0x76, 0x40, 0x45, 0xec, 0x40, 0x87, 0x7a, 0xa9, 0xc4, 0x94, 0x81, 0xd0, 0xb8, - 0xb9, 0xa9, 0x97, 0x86, 0xa6, 0x71, 0x48, 0xdc, 0x4e, 0x13, 0xe2, 0xc2, 0x8d, 0x33, 0xe2, 0x3f, - 0xe0, 0x8f, 0xe1, 0x84, 0x40, 0x9c, 0x10, 0x1c, 0x50, 0xc5, 0x05, 0xf1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x62, 0xa1, 0x40, 0x7d, 0x78, 0x21, 0x15, 0xbf, 0x05, 0xae, 0x80, 0xeb, 0x1b, 0x8d, 0x0e, 0x99, - 0x11, 0x20, 0x29, 0x01, 0xb9, 0x20, 0xfe, 0xc0, 0x26, 0x11, 0x01, 0x92, 0x12, 0x20, 0x29, 0x01, - 0xa2, 0x48, 0x66, 0x4e, 0xd1, 0xd1, 0x31, 0xdc, 0xb4, 0x64, 0xea, 0x87, 0xbe, 0x2c, 0xd2, 0x56, - 0x49, 0xa6, 0xdb, 0x25, 0x71, 0x95, 0x48, 0xb6, 0x4a, 0xb3, 0x4c, 0x51, 0x95, 0xc8, 0xd8, 0x20, - 0xad, 0x6c, 0xa8, 0x39, 0x8f, 0x84, 0x5f, 0x03, 0x78, 0x55, 0x41, 0xa0, 0xcd, 0x44, 0x2a, 0x15, - 0xc1, 0xff, 0x3c, 0x3a, 0x8c, 0x65, 0x5e, 0x34, 0xe5, 0x1a, 0x1d, 0x42, 0x68, 0x33, 0x31, 0xcf, - 0xe8, 0x76, 0x3e, 0x46, 0xed, 0x69, 0x9c, 0x99, 0xc1, 0xc0, 0x67, 0x10, 0x2b, 0xa8, 0x74, 0x9c, - 0x70, 0xca, 0xe5, 0x08, 0x6e, 0xb8, 0x4e, 0x38, 0x4d, 0x1c, 0x57, 0xde, 0xc8, 0x97, 0xb8, 0x33, - 0x0b, 0x34, 0xb3, 0x28, 0xf8, 0x9d, 0xba, 0xe9, 0x8f, 0xfd, 0x5e, 0xa6, 0xe9, 0x7f, 0xab, 0x44, - 0x76, 0x10, 0x4a, 0xe7, 0x39, 0x08, 0xf8, 0xad, 0x9a, 0xe6, 0x01, 0x73, 0xd9, 0x62, 0x9a, 0xc7, - 0x70, 0xb3, 0x27, 0x0f, 0xad, 0x35, 0x45, 0x07, 0xd9, 0x50, 0x73, 0x1e, 0x09, 0x57, 0xe1, 0xb5, - 0x25, 0xb4, 0x42, 0x9f, 0x7b, 0x21, 0xc3, 0x3f, 0xc1,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, 0x64, 0x5d, 0x86, 0xd4, 0x75, 0x0b, 0xdd, 0x9c, + 0xaf, 0x4b, 0x7f, 0x11, 0xdd, 0xa5, 0x97, 0x91, 0xb6, 0xf5, 0xc8, 0x51, 0x14, 0x90, 0x21, 0xba, + 0xb7, 0xa8, 0xba, 0x9c, 0xcf, 0x69, 0x07, 0x65, 0xca, 0x8b, 0x80, 0x71, 0x4d, 0x4a, 0xdc, 0x44, + 0x05, 0x5a, 0x87, 0x26, 0x00, 0x6e, 0xc4, 0xce, 0x57, 0xda, 0x54, 0xce, 0x18, 0x69, 0xc9, 0xdd, + 0xdb, 0x91, 0xd2, 0x88, 0x56, 0xbc, 0x7b, 0xd1, 0x70, 0x7e, 0x02, 0x70, 0x23, 0x36, 0xa7, 0xd2, + 0x44, 0xce, 0x58, 0xb0, 0xb6, 0xbb, 0x6c, 0x78, 0x62, 0x95, 0xc9, 0x50, 0xd6, 0x16, 0x18, 0xca, + 0x6f, 0x00, 0x5e, 0x89, 0x6c, 0x54, 0xa5, 0x68, 0x89, 0x99, 0xf4, 0xce, 0xe9, 0xca, 0x35, 0xa4, + 0xba, 0xdb, 0x78, 0xab, 0x80, 0x3a, 0xd7, 0xf1, 0x44, 0x13, 0xd4, 0xf6, 0x3a, 0xef, 0x27, 0x55, + 0xf0, 0x71, 0x52, 0x05, 0xdf, 0x27, 0x55, 0xf0, 0x74, 0x77, 0xde, 0x83, 0xef, 0xec, 0xc7, 0x6e, + 0xf7, 0x7f, 0xf9, 0xe4, 0xdb, 0xfe, 0x1d, 0x00, 0x00, 0xff, 0xff, 0x9c, 0xf2, 0x18, 0xa3, 0x1c, + 0x0b, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/pkg/apiclient/clusterworkflowtemplate/cluster-workflow-template.proto b/pkg/apiclient/clusterworkflowtemplate/cluster-workflow-template.proto index f690fe7e01db..e9e6c00763ff 100644 --- a/pkg/apiclient/clusterworkflowtemplate/cluster-workflow-template.proto +++ b/pkg/apiclient/clusterworkflowtemplate/cluster-workflow-template.proto @@ -27,7 +27,8 @@ message ClusterWorkflowTemplateListRequest { } message ClusterWorkflowTemplateUpdateRequest { - string name = 1; + // DEPRECATED: This field is ignored. + string name = 1 [deprecated=true]; github.com.argoproj.argo.pkg.apis.workflow.v1alpha1.ClusterWorkflowTemplate template = 2; } diff --git a/pkg/apiclient/clusterworkflowtemplate/cluster-workflow-template.swagger.json b/pkg/apiclient/clusterworkflowtemplate/cluster-workflow-template.swagger.json index 1b605d726211..93fd926e06f8 100644 --- a/pkg/apiclient/clusterworkflowtemplate/cluster-workflow-template.swagger.json +++ b/pkg/apiclient/clusterworkflowtemplate/cluster-workflow-template.swagger.json @@ -253,6 +253,7 @@ "parameters": [ { "name": "name", + "description": "DEPRECATED: This field is ignored.", "in": "path", "required": true, "type": "string" @@ -302,7 +303,8 @@ "type": "object", "properties": { "name": { - "type": "string" + "type": "string", + "description": "DEPRECATED: This field is ignored." }, "template": { "$ref": "#/definitions/github.com.argoproj.argo.pkg.apis.workflow.v1alpha1.ClusterWorkflowTemplate" diff --git a/pkg/apiclient/cronworkflow/cron-workflow.pb.go b/pkg/apiclient/cronworkflow/cron-workflow.pb.go index bd7fe3326b01..9f1ad394e09f 100644 --- a/pkg/apiclient/cronworkflow/cron-workflow.pb.go +++ b/pkg/apiclient/cronworkflow/cron-workflow.pb.go @@ -268,7 +268,8 @@ func (m *GetCronWorkflowRequest) GetGetOptions() *v1.GetOptions { } type UpdateCronWorkflowRequest struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // DEPRECATED: This field is ignored. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Deprecated: Do not use. Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"` CronWorkflow *v1alpha1.CronWorkflow `protobuf:"bytes,3,opt,name=cronWorkflow,proto3" json:"cronWorkflow,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` @@ -309,6 +310,7 @@ func (m *UpdateCronWorkflowRequest) XXX_DiscardUnknown() { var xxx_messageInfo_UpdateCronWorkflowRequest proto.InternalMessageInfo +// Deprecated: Do not use. func (m *UpdateCronWorkflowRequest) GetName() string { if m != nil { return m.Name @@ -447,50 +449,51 @@ func init() { } var fileDescriptor_257f310938c448f8 = []byte{ - // 683 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x96, 0x4f, 0x6b, 0x13, 0x4f, - 0x18, 0xc7, 0x99, 0xf6, 0xc7, 0x0f, 0x3b, 0xb5, 0xa8, 0x23, 0x68, 0xba, 0xd6, 0x52, 0x86, 0x6a, - 0xff, 0x68, 0x67, 0x4c, 0xd3, 0x83, 0x78, 0xab, 0xa9, 0xf4, 0x12, 0x50, 0xb6, 0x88, 0xd4, 0xdb, - 0x64, 0x33, 0xdd, 0xac, 0xd9, 0xcc, 0xac, 0xbb, 0x93, 0x14, 0x91, 0x5e, 0xbc, 0x7b, 0xf2, 0xa8, - 0x78, 0xf6, 0xe2, 0x1f, 0x44, 0x7c, 0x0d, 0x1e, 0x05, 0xdf, 0x80, 0x04, 0xdf, 0x85, 0x17, 0xd9, - 0x49, 0x36, 0xfb, 0x27, 0x59, 0xba, 0xda, 0x08, 0xde, 0x66, 0xb2, 0xf3, 0x7c, 0x9f, 0xcf, 0x3c, - 0xcf, 0xc3, 0x37, 0x03, 0x89, 0xd7, 0xb2, 0x29, 0xf3, 0x1c, 0xcb, 0x75, 0xb8, 0x50, 0xd4, 0xf2, - 0xa5, 0x38, 0x94, 0x7e, 0xeb, 0xc0, 0x95, 0x87, 0x7a, 0xb3, 0x11, 0xed, 0x88, 0xe7, 0x4b, 0x25, - 0xd1, 0xe9, 0xe4, 0x09, 0x63, 0xc3, 0x76, 0x54, 0xb3, 0x53, 0x27, 0x96, 0x6c, 0x53, 0x5b, 0xda, - 0x92, 0xea, 0x43, 0xf5, 0xce, 0x81, 0xde, 0xe9, 0x8d, 0x5e, 0xf5, 0x83, 0x8d, 0x05, 0x5b, 0x4a, - 0xdb, 0xe5, 0x61, 0x3e, 0xca, 0x84, 0x90, 0x8a, 0x29, 0x47, 0x8a, 0x60, 0xf0, 0x75, 0xab, 0x75, - 0x33, 0x20, 0x8e, 0x0c, 0xbf, 0xb6, 0x99, 0xd5, 0x74, 0x04, 0xf7, 0x9f, 0xd0, 0x01, 0x5e, 0x40, - 0xdb, 0x5c, 0x31, 0xda, 0x2d, 0x53, 0x9b, 0x0b, 0xee, 0x33, 0xc5, 0x1b, 0x83, 0xa8, 0x6a, 0x02, - 0x81, 0xf9, 0x3a, 0xe9, 0x23, 0xbd, 0x88, 0x43, 0x87, 0x17, 0xea, 0x96, 0x99, 0xeb, 0x35, 0xd9, - 0xa8, 0x08, 0x8e, 0x53, 0x53, 0x4b, 0xfa, 0x7c, 0x4c, 0x22, 0xfc, 0x1a, 0xc0, 0x8b, 0x35, 0x47, - 0xa8, 0xaa, 0x2f, 0xc5, 0x83, 0x81, 0xa2, 0xc9, 0x1f, 0x77, 0x78, 0xa0, 0xd0, 0x02, 0x9c, 0x11, - 0xac, 0xcd, 0x03, 0x8f, 0x59, 0xbc, 0x04, 0x96, 0xc0, 0xea, 0x8c, 0x19, 0xff, 0x80, 0x38, 0xd4, - 0x55, 0x8b, 0x82, 0x4a, 0x53, 0x4b, 0x60, 0x75, 0x76, 0x73, 0x9b, 0xc4, 0xe4, 0x24, 0x22, 0xd7, - 0x8b, 0xb0, 0x27, 0x24, 0x24, 0x27, 0xc3, 0xe2, 0x47, 0xe4, 0x24, 0x95, 0x3d, 0x25, 0x8b, 0x7f, - 0x02, 0x38, 0x5f, 0xf5, 0x39, 0x53, 0xfc, 0x5f, 0x45, 0x44, 0xfb, 0x70, 0xce, 0xd2, 0x84, 0x77, - 0x3d, 0xdd, 0xf9, 0xd2, 0xb4, 0xce, 0x53, 0x21, 0xfd, 0xfa, 0x93, 0x64, 0xeb,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, 0xd6, 0xee, 0x88, 0xba, 0x8e, 0x50, 0xb7, 0xc0, 0x3a, 0x7a, 0x0f, 0x20, 0x1a, - 0x35, 0x1e, 0xb4, 0x92, 0x86, 0xce, 0xb5, 0xa6, 0x49, 0x60, 0x6f, 0x68, 0xec, 0x15, 0x8c, 0x8f, - 0xc7, 0x0e, 0x89, 0xdf, 0x01, 0x78, 0x6e, 0xc4, 0x2c, 0xd0, 0xd5, 0x6c, 0x95, 0xc7, 0xbb, 0x89, - 0x71, 0xe7, 0xc4, 0xbc, 0xa1, 0x34, 0x5e, 0xd7, 0xcc, 0xcb, 0xa8, 0x00, 0x33, 0x7a, 0x0b, 0xe0, - 0x99, 0x8c, 0x9b, 0xa0, 0xe5, 0x34, 0xee, 0x78, 0xb3, 0x99, 0x44, 0x71, 0xcb, 0x1a, 0xf4, 0x1a, - 0x5a, 0x2b, 0x30, 0x13, 0x7a, 0x7d, 0x84, 0x3e, 0x03, 0x88, 0x46, 0xed, 0x25, 0x3b, 0x12, 0xb9, - 0x06, 0x34, 0x09, 0xea, 0x2d, 0x4d, 0x4d, 0x8c, 0xe2, 0xd4, 0xe1, 0x64, 0xbc, 0x04, 0x10, 0x8d, - 0x1a, 0x4c, 0x16, 0x3c, 0xd7, 0x82, 0x8c, 0xb5, 0xec, 0xd0, 0xe7, 0x3a, 0x40, 0x54, 0xd6, 0xf5, - 0xe2, 0x80, 0xb7, 0xb7, 0xbf, 0xf4, 0x16, 0xc1, 0xd7, 0xde, 0x22, 0xf8, 0xde, 0x5b, 0x04, 0x0f, - 0x2b, 0xc7, 0x3d, 0x7d, 0xc6, 0x3c, 0xea, 0xea, 0xff, 0xeb, 0xd7, 0x4c, 0xe5, 0x57, 0x00, 0x00, - 0x00, 0xff, 0xff, 0x4d, 0x5f, 0x24, 0x0b, 0xf9, 0x09, 0x00, 0x00, + // 692 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff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x2f, + 0x0c, 0x19, 0x06, 0xba, 0x96, 0x55, 0x39, 0xdf, 0x51, 0x8c, 0x3b, 0xa7, 0xe6, 0x0d, 0x53, 0xe3, + 0x65, 0xcd, 0x3c, 0x8f, 0x4a, 0x30, 0xa3, 0xb7, 0x00, 0x9e, 0xcb, 0x38, 0x0a, 0x9a, 0x4f, 0xe3, + 0xe6, 0x1b, 0xce, 0x28, 0xc4, 0xad, 0x69, 0xd0, 0xeb, 0x68, 0xa9, 0xc4, 0x4c, 0xe8, 0xf5, 0x31, + 0xfa, 0x04, 0x20, 0x1a, 0xb6, 0x98, 0xec, 0x48, 0x14, 0x9a, 0xd0, 0x28, 0xa8, 0xd7, 0x35, 0x35, + 0x31, 0xca, 0x53, 0x87, 0x93, 0xf1, 0x12, 0x40, 0x34, 0x6c, 0x30, 0x59, 0xf0, 0x42, 0x0b, 0x32, + 0x96, 0xb2, 0x43, 0x5f, 0xe8, 0x00, 0x91, 0xac, 0xcb, 0xe5, 0x01, 0x37, 0x37, 0xbe, 0x74, 0x67, + 0xc1, 0xd7, 0xee, 0x2c, 0xf8, 0xde, 0x9d, 0x05, 0x0f, 0xd7, 0x4e, 0x7a, 0xfe, 0xe4, 0x3c, 0xec, + 0x0e, 0xfe, 0xd7, 0x2f, 0x9a, 0xb5, 0x5f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xbe, 0x20, 0x02, 0xb7, + 0xfd, 0x09, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/pkg/apiclient/cronworkflow/cron-workflow.proto b/pkg/apiclient/cronworkflow/cron-workflow.proto index fdec7f4d66bc..5f86f50742da 100644 --- a/pkg/apiclient/cronworkflow/cron-workflow.proto +++ b/pkg/apiclient/cronworkflow/cron-workflow.proto @@ -28,7 +28,8 @@ message GetCronWorkflowRequest { k8s.io.apimachinery.pkg.apis.meta.v1.GetOptions getOptions = 3; } message UpdateCronWorkflowRequest { - string name = 1; + // DEPRECATED: This field is ignored. + string name = 1 [deprecated=true]; string namespace = 2; github.com.argoproj.argo.pkg.apis.workflow.v1alpha1.CronWorkflow cronWorkflow = 3; } diff --git a/pkg/apiclient/cronworkflow/cron-workflow.swagger.json b/pkg/apiclient/cronworkflow/cron-workflow.swagger.json index 2c4cb5e786e4..cf9114157116 100644 --- a/pkg/apiclient/cronworkflow/cron-workflow.swagger.json +++ b/pkg/apiclient/cronworkflow/cron-workflow.swagger.json @@ -288,6 +288,7 @@ }, { "name": "name", + "description": "DEPRECATED: This field is ignored.", "in": "path", "required": true, "type": "string" @@ -340,7 +341,8 @@ "type": "object", "properties": { "name": { - "type": "string" + "type": "string", + "description": "DEPRECATED: This field is ignored." }, "namespace": { "type": "string" diff --git a/pkg/apiclient/workflowtemplate/workflow-template.pb.go b/pkg/apiclient/workflowtemplate/workflow-template.pb.go index a2a60babfc7b..d800c75fcbed 100644 --- a/pkg/apiclient/workflowtemplate/workflow-template.pb.go +++ b/pkg/apiclient/workflowtemplate/workflow-template.pb.go @@ -216,7 +216,8 @@ func (m *WorkflowTemplateListRequest) GetListOptions() *v1.ListOptions { } type WorkflowTemplateUpdateRequest struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // DEPRECATED: This field is ignored. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Deprecated: Do not use. Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"` Template *v1alpha1.WorkflowTemplate `protobuf:"bytes,3,opt,name=template,proto3" json:"template,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` @@ -257,6 +258,7 @@ func (m *WorkflowTemplateUpdateRequest) XXX_DiscardUnknown() { var xxx_messageInfo_WorkflowTemplateUpdateRequest proto.InternalMessageInfo +// Deprecated: Do not use. func (m *WorkflowTemplateUpdateRequest) GetName() string { if m != nil { return m.Name @@ -458,51 +460,51 @@ func init() { } var fileDescriptor_215375a0ab97a62a = []byte{ - // 689 bytes of a gzipped FileDescriptorProto + // 698 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x96, 0xcf, 0x6e, 0xd3, 0x4e, - 0x10, 0xc7, 0xb5, 0xed, 0x4f, 0x3f, 0xd1, 0xad, 0x2a, 0xa1, 0x05, 0x4a, 0x65, 0x4a, 0x54, 0xf9, - 0x80, 0xaa, 0x96, 0xec, 0xc6, 0x29, 0x94, 0xaa, 0x47, 0xd2, 0x2a, 0x42, 0xaa, 0x04, 0x72, 0x41, - 0xa8, 0xdc, 0x36, 0xce, 0xd6, 0x31, 0x71, 0xbc, 0xc6, 0xde, 0xa4, 0x42, 0xa8, 0x17, 0x9e, 0x00, - 0x89, 0x17, 0xe0, 0x01, 0x38, 0x20, 0xc4, 0x0b, 0x20, 0x38, 0x20, 0x4e, 0x48, 0xbc, 0x00, 0x8a, - 0x78, 0x09, 0xc4, 0x05, 0x79, 0x6d, 0xc7, 0x7f, 0x92, 0x12, 0x27, 0x84, 0x13, 0xb7, 0xf5, 0x7a, - 0x67, 0xe6, 0xf3, 0x9d, 0x19, 0x8f, 0x17, 0x6e, 0xbb, 0x6d, 0x93, 0x50, 0xd7, 0x32, 0x6c, 0x8b, - 0x39, 0x82, 0x9c, 0x70, 0xaf, 0x7d, 0x6c, 0xf3, 0x13, 0xc1, 0x3a, 0xae, 0x4d, 0x05, 0x1b, 0x6c, - 0x94, 0xe3, 0x1d, 0xec, 0x7a, 0x5c, 0x70, 0x74, 0x3e, 0x7f, 0x52, 0x29, 0x9b, 0x96, 0x68, 0x75, - 0x1b, 0xd8, 0xe0, 0x1d, 0x62, 0x72, 0x93, 0x13, 0x79, 0xb0, 0xd1, 0x3d, 0x96, 0x4f, 0xf2, 0x41, - 0xae, 0x42, 0x07, 0xca, 0xaa, 0xc9, 0xb9, 0x69, 0xb3, 0x20, 0x36, 0xa1, 0x8e, 0xc3, 0x05, 0x15, - 0x16, 0x77, 0xfc, 0xe8, 0xed, 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x6c, 0x28, 0x93, 0x55, 0x23, 0x68, 0xaa, 0x77, + 0x00, 0x96, 0xc3, 0x29, 0x32, 0x8d, 0x98, 0xcc, 0xb4, 0x54, 0xd6, 0x8b, 0x1b, 0x44, 0x03, 0x2b, + 0xea, 0xa2, 0xd5, 0x09, 0xbb, 0xe8, 0x13, 0x80, 0x97, 0x83, 0xb9, 0x36, 0x84, 0x5c, 0xa8, 0x89, + 0x9c, 0x59, 0x7f, 0x0b, 0x5b, 0x52, 0xc5, 0xba, 0xba, 0x56, 0x50, 0x85, 0x6d, 0x39, 0x62, 0x07, + 0xac, 0xee, 0x1e, 0x7c, 0xee, 0x57, 0xc1, 0xd7, 0x7e, 0x15, 0x7c, 0xef, 0x57, 0xc1, 0xe3, 0x3b, + 0xe3, 0x6e, 0x70, 0xe7, 0xdc, 0x53, 0x1b, 0xff, 0xcb, 0xcb, 0xdb, 0xe6, 0xef, 0x00, 0x00, 0x00, + 0xff, 0xff, 0xa4, 0x4a, 0xb9, 0xa1, 0xd0, 0x0a, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/pkg/apiclient/workflowtemplate/workflow-template.proto b/pkg/apiclient/workflowtemplate/workflow-template.proto index 8bb1e0d778d0..ef964c733a8c 100644 --- a/pkg/apiclient/workflowtemplate/workflow-template.proto +++ b/pkg/apiclient/workflowtemplate/workflow-template.proto @@ -30,7 +30,8 @@ message WorkflowTemplateListRequest { } message WorkflowTemplateUpdateRequest { - string name = 1; + // DEPRECATED: This field is ignored. + string name = 1 [deprecated=true]; string namespace = 2; github.com.argoproj.argo.pkg.apis.workflow.v1alpha1.WorkflowTemplate template = 3; } diff --git a/pkg/apiclient/workflowtemplate/workflow-template.swagger.json b/pkg/apiclient/workflowtemplate/workflow-template.swagger.json index 436638dcc6dc..59103320378b 100644 --- a/pkg/apiclient/workflowtemplate/workflow-template.swagger.json +++ b/pkg/apiclient/workflowtemplate/workflow-template.swagger.json @@ -289,6 +289,7 @@ }, { "name": "name", + "description": "DEPRECATED: This field is ignored.", "in": "path", "required": true, "type": "string" @@ -4246,7 +4247,8 @@ "type": "object", "properties": { "name": { - "type": "string" + "type": "string", + "description": "DEPRECATED: This field is ignored." }, "namespace": { "type": "string" diff --git a/server/clusterworkflowtemplate/cluster_workflow_template_server_test.go b/server/clusterworkflowtemplate/cluster_workflow_template_server_test.go index c744d9da95cf..f11cb92834d5 100644 --- a/server/clusterworkflowtemplate/cluster_workflow_template_server_test.go +++ b/server/clusterworkflowtemplate/cluster_workflow_template_server_test.go @@ -231,7 +231,6 @@ func TestWorkflowTemplateServer_UpdateClusterWorkflowTemplate(t *testing.T) { server, ctx := getClusterWorkflowTemplateServer() t.Run("Labelled", func(t *testing.T) { req := &clusterwftmplpkg.ClusterWorkflowTemplateUpdateRequest{ - Name: "cluster-workflow-template-whalesay-template2", Template: cwftObj2.DeepCopy(), } req.Template.Spec.Templates[0].Container.Image = "alpine:latest" @@ -242,7 +241,6 @@ func TestWorkflowTemplateServer_UpdateClusterWorkflowTemplate(t *testing.T) { }) t.Run("Unlabelled", func(t *testing.T) { _, err := server.UpdateClusterWorkflowTemplate(ctx, &clusterwftmplpkg.ClusterWorkflowTemplateUpdateRequest{ - Name: "cluster-workflow-template-whalesay-template", Template: &unlabelled, }) assert.Error(t, err) diff --git a/server/cronworkflow/cron_workflow_server.go b/server/cronworkflow/cron_workflow_server.go index 099510f9b7d1..74c27695de32 100644 --- a/server/cronworkflow/cron_workflow_server.go +++ b/server/cronworkflow/cron_workflow_server.go @@ -68,7 +68,7 @@ func (c *cronWorkflowServiceServer) GetCronWorkflow(ctx context.Context, req *cr } func (c *cronWorkflowServiceServer) UpdateCronWorkflow(ctx context.Context, req *cronworkflowpkg.UpdateCronWorkflowRequest) (*v1alpha1.CronWorkflow, error) { - _, err := c.getCronWorkflowAndValidate(ctx, req.Namespace, req.Name, metav1.GetOptions{}) + _, err := c.getCronWorkflowAndValidate(ctx, req.Namespace, req.CronWorkflow.Name, metav1.GetOptions{}) if err != nil { return nil, err } diff --git a/server/cronworkflow/cron_workflow_server_test.go b/server/cronworkflow/cron_workflow_server_test.go index c5707fac44ca..e6280973d069 100644 --- a/server/cronworkflow/cron_workflow_server_test.go +++ b/server/cronworkflow/cron_workflow_server_test.go @@ -93,13 +93,13 @@ metadata: }) t.Run("UpdateCronWorkflow", func(t *testing.T) { t.Run("Labelled", func(t *testing.T) { - cronWf, err := server.UpdateCronWorkflow(ctx, &cronworkflowpkg.UpdateCronWorkflowRequest{Namespace: "my-ns", Name: "my-name", CronWorkflow: &cronWf}) + cronWf, err := server.UpdateCronWorkflow(ctx, &cronworkflowpkg.UpdateCronWorkflowRequest{Namespace: "my-ns", CronWorkflow: &cronWf}) if assert.NoError(t, err) { assert.NotNil(t, cronWf) } }) t.Run("Unlabelled", func(t *testing.T) { - _, err := server.UpdateCronWorkflow(ctx, &cronworkflowpkg.UpdateCronWorkflowRequest{Namespace: "my-ns", Name: "unlabelled", CronWorkflow: &cronWf}) + _, err := server.UpdateCronWorkflow(ctx, &cronworkflowpkg.UpdateCronWorkflowRequest{Namespace: "my-ns", CronWorkflow: &unlabelled}) assert.Error(t, err) }) }) diff --git a/server/workflowtemplate/workflow_template_server.go b/server/workflowtemplate/workflow_template_server.go index 0f1ab880be1e..7e4b8fbee843 100644 --- a/server/workflowtemplate/workflow_template_server.go +++ b/server/workflowtemplate/workflow_template_server.go @@ -30,16 +30,12 @@ func (wts *WorkflowTemplateServer) CreateWorkflowTemplate(ctx context.Context, r } wts.instanceIDService.Label(req.Template) wftmplGetter := templateresolution.WrapWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().WorkflowTemplates(req.Namespace)) - cwftmplGetter := templateresolution.WrapClusterWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().ClusterWorkflowTemplates()) - _, err := validate.ValidateWorkflowTemplate(wftmplGetter, cwftmplGetter, req.Template) if err != nil { return nil, err } - return wfClient.ArgoprojV1alpha1().WorkflowTemplates(req.Namespace).Create(req.Template) - } func (wts *WorkflowTemplateServer) GetWorkflowTemplate(ctx context.Context, req *workflowtemplatepkg.WorkflowTemplateGetRequest) (*v1alpha1.WorkflowTemplate, error) { @@ -86,7 +82,6 @@ func (wts *WorkflowTemplateServer) DeleteWorkflowTemplate(ctx context.Context, r if err != nil { return nil, err } - return &workflowtemplatepkg.WorkflowTemplateDeleteResponse{}, nil } @@ -94,14 +89,11 @@ func (wts *WorkflowTemplateServer) LintWorkflowTemplate(ctx context.Context, req wfClient := auth.GetWfClient(ctx) wts.instanceIDService.Label(req.Template) wftmplGetter := templateresolution.WrapWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().WorkflowTemplates(req.Namespace)) - cwftmplGetter := templateresolution.WrapClusterWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().ClusterWorkflowTemplates()) - _, err := validate.ValidateWorkflowTemplate(wftmplGetter, cwftmplGetter, req.Template) if err != nil { return nil, err } - return req.Template, nil } @@ -115,14 +107,11 @@ func (wts *WorkflowTemplateServer) UpdateWorkflowTemplate(ctx context.Context, r } wfClient := auth.GetWfClient(ctx) wftmplGetter := templateresolution.WrapWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().WorkflowTemplates(req.Namespace)) - cwftmplGetter := templateresolution.WrapClusterWorkflowTemplateInterface(wfClient.ArgoprojV1alpha1().ClusterWorkflowTemplates()) - _, err = validate.ValidateWorkflowTemplate(wftmplGetter, cwftmplGetter, req.Template) if err != nil { return nil, err } - res, err := wfClient.ArgoprojV1alpha1().WorkflowTemplates(req.Namespace).Update(req.Template) return res, err } diff --git a/server/workflowtemplate/workflow_template_server_test.go b/server/workflowtemplate/workflow_template_server_test.go index 6cb7724c58e8..539d5624d4dc 100644 --- a/server/workflowtemplate/workflow_template_server_test.go +++ b/server/workflowtemplate/workflow_template_server_test.go @@ -2,19 +2,30 @@ package workflowtemplate import ( "context" - "encoding/json" "testing" "github.com/stretchr/testify/assert" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes/fake" workflowtemplatepkg "github.com/argoproj/argo/pkg/apiclient/workflowtemplate" "github.com/argoproj/argo/pkg/apis/workflow/v1alpha1" wftFake "github.com/argoproj/argo/pkg/client/clientset/versioned/fake" "github.com/argoproj/argo/server/auth" + testutil "github.com/argoproj/argo/test/util" "github.com/argoproj/argo/util/instanceid" + "github.com/argoproj/argo/workflow/common" ) +const unlabelled = `{ + "apiVersion": "argoproj.io/v1alpha1", + "kind": "WorkflowTemplate", + "metadata": { + "name": "unlabelled", + "namespace": "default" + } +}` + const wftStr1 = `{ "namespace": "default", "template": { @@ -148,61 +159,61 @@ const wftStr3 = `{ }` func getWorkflowTemplateServer() (workflowtemplatepkg.WorkflowTemplateServiceServer, context.Context) { - var wftObj1, wftObj2 v1alpha1.WorkflowTemplate - err := json.Unmarshal([]byte(wftStr2), &wftObj1) - if err != nil { - panic(err) - } - err = json.Unmarshal([]byte(wftStr3), &wftObj2) - if err != nil { - panic(err) - } + var unlabelledObj, wftObj1, wftObj2 v1alpha1.WorkflowTemplate + testutil.MustUnmarshallJSON(unlabelled, &unlabelledObj) + testutil.MustUnmarshallJSON(wftStr2, &wftObj1) + testutil.MustUnmarshallJSON(wftStr3, &wftObj2) kubeClientSet := fake.NewSimpleClientset() - wfClientset := wftFake.NewSimpleClientset(&wftObj1, &wftObj2) + wfClientset := wftFake.NewSimpleClientset(&unlabelledObj, &wftObj1, &wftObj2) ctx := context.WithValue(context.WithValue(context.TODO(), auth.WfKey, wfClientset), auth.KubeKey, kubeClientSet) return NewWorkflowTemplateServer(instanceid.NewService("my-instanceid")), ctx } func TestWorkflowTemplateServer_CreateWorkflowTemplate(t *testing.T) { server, ctx := getWorkflowTemplateServer() - var wftReq workflowtemplatepkg.WorkflowTemplateCreateRequest - err := json.Unmarshal([]byte(wftStr1), &wftReq) - if err != nil { - panic(err) - } - wftRsp, err := server.CreateWorkflowTemplate(ctx, &wftReq) - if assert.NoError(t, err) { - assert.NotNil(t, wftRsp) - } + t.Run("Labelled", func(t *testing.T) { + var wftReq workflowtemplatepkg.WorkflowTemplateCreateRequest + testutil.MustUnmarshallJSON(wftStr1, &wftReq) + wftRsp, err := server.CreateWorkflowTemplate(ctx, &wftReq) + if assert.NoError(t, err) { + assert.NotNil(t, wftRsp) + } + }) + t.Run("Unlabelled", func(t *testing.T) { + var wftReq workflowtemplatepkg.WorkflowTemplateCreateRequest + testutil.MustUnmarshallJSON(unlabelled, &wftReq.Template) + wftReq.Namespace = "default" + wftReq.Template.Name = "foo" + wftRsp, err := server.CreateWorkflowTemplate(ctx, &wftReq) + if assert.NoError(t, err) { + assert.NotNil(t, wftRsp) + assert.Contains(t, wftRsp.Labels, common.LabelKeyControllerInstanceID) + } + }) } func TestWorkflowTemplateServer_GetWorkflowTemplate(t *testing.T) { server, ctx := getWorkflowTemplateServer() - wftReq := workflowtemplatepkg.WorkflowTemplateGetRequest{ - Name: "workflow-template-whalesay-template2", - Namespace: "default", - } - wftRsp, err := server.GetWorkflowTemplate(ctx, &wftReq) - if assert.NoError(t, err) { - assert.NotNil(t, wftRsp) - assert.Equal(t, "workflow-template-whalesay-template2", wftRsp.Name) - } + t.Run("Labelled", func(t *testing.T) { + wftRsp, err := server.GetWorkflowTemplate(ctx, &workflowtemplatepkg.WorkflowTemplateGetRequest{Name: "workflow-template-whalesay-template2", Namespace: "default"}) + if assert.NoError(t, err) { + assert.NotNil(t, wftRsp) + assert.Equal(t, "workflow-template-whalesay-template2", wftRsp.Name) + } + }) + t.Run("Unlabelled", func(t *testing.T) { + _, err := server.GetWorkflowTemplate(ctx, &workflowtemplatepkg.WorkflowTemplateGetRequest{Name: "unlabelled", Namespace: "default"}) + assert.Error(t, err) + }) } func TestWorkflowTemplateServer_ListWorkflowTemplates(t *testing.T) { server, ctx := getWorkflowTemplateServer() - wftReq := workflowtemplatepkg.WorkflowTemplateListRequest{ - Namespace: "default", - } - wftRsp, err := server.ListWorkflowTemplates(ctx, &wftReq) + wftRsp, err := server.ListWorkflowTemplates(ctx, &workflowtemplatepkg.WorkflowTemplateListRequest{Namespace: "default"}) if assert.NoError(t, err) { assert.Len(t, wftRsp.Items, 2) } - - wftReq = workflowtemplatepkg.WorkflowTemplateListRequest{ - Namespace: "test", - } - wftRsp, err = server.ListWorkflowTemplates(ctx, &wftReq) + wftRsp, err = server.ListWorkflowTemplates(ctx, &workflowtemplatepkg.WorkflowTemplateListRequest{Namespace: "test"}) if assert.NoError(t, err) { assert.Empty(t, wftRsp.Items) } @@ -210,31 +221,46 @@ func TestWorkflowTemplateServer_ListWorkflowTemplates(t *testing.T) { func TestWorkflowTemplateServer_DeleteWorkflowTemplate(t *testing.T) { server, ctx := getWorkflowTemplateServer() - wftReq := workflowtemplatepkg.WorkflowTemplateDeleteRequest{ - Namespace: "default", - Name: "workflow-template-whalesay-template2", - } - _, err := server.DeleteWorkflowTemplate(ctx, &wftReq) - assert.NoError(t, err) - + t.Run("Labelled", func(t *testing.T) { + _, err := server.DeleteWorkflowTemplate(ctx, &workflowtemplatepkg.WorkflowTemplateDeleteRequest{Namespace: "default", Name: "workflow-template-whalesay-template2"}) + assert.NoError(t, err) + }) + t.Run("Unlabelled", func(t *testing.T) { + _, err := server.DeleteWorkflowTemplate(ctx, &workflowtemplatepkg.WorkflowTemplateDeleteRequest{Namespace: "default", Name: "unlabelled"}) + assert.Error(t, err) + }) } -func TestWorkflowTemplateServer_UpdateWorkflowTemplate(t *testing.T) { +func TestWorkflowTemplateServer_LintWorkflowTemplate(t *testing.T) { server, ctx := getWorkflowTemplateServer() - var wftObj1 v1alpha1.WorkflowTemplate - err := json.Unmarshal([]byte(wftStr2), &wftObj1) - if err != nil { - panic(err) - } - wftObj1.Spec.Templates[0].Container.Image = "alpine:latest" - wftReq := workflowtemplatepkg.WorkflowTemplateUpdateRequest{ - Namespace: "default", - Name: "workflow-template-whalesay-template2", - Template: &wftObj1, - } - wftRsp, err := server.UpdateWorkflowTemplate(ctx, &wftReq) - + tmpl, err := server.LintWorkflowTemplate(ctx, &workflowtemplatepkg.WorkflowTemplateLintRequest{ + Template: &v1alpha1.WorkflowTemplate{}, + }) if assert.NoError(t, err) { - assert.Equal(t, "alpine:latest", wftRsp.Spec.Templates[0].Container.Image) + assert.Contains(t, tmpl.Labels, common.LabelKeyControllerInstanceID) } } + +func TestWorkflowTemplateServer_UpdateWorkflowTemplate(t *testing.T) { + server, ctx := getWorkflowTemplateServer() + t.Run("Labelled", func(t *testing.T) { + var wftObj1 v1alpha1.WorkflowTemplate + testutil.MustUnmarshallJSON(wftStr2, &wftObj1) + wftObj1.Spec.Templates[0].Container.Image = "alpine:latest" + wftRsp, err := server.UpdateWorkflowTemplate(ctx, &workflowtemplatepkg.WorkflowTemplateUpdateRequest{ + Namespace: "default", + Template: &wftObj1, + }) + if assert.NoError(t, err) { + assert.Equal(t, "alpine:latest", wftRsp.Spec.Templates[0].Container.Image) + } + }) + t.Run("Unlabelled", func(t *testing.T) { + _, err := server.UpdateWorkflowTemplate(ctx, &workflowtemplatepkg.WorkflowTemplateUpdateRequest{ + Template: &v1alpha1.WorkflowTemplate{ + ObjectMeta: metav1.ObjectMeta{Name: "unlabelled"}, + }, + }) + assert.Error(t, err) + }) +}