argoproj / argoproj/argo-workflows
One invalid WorkflowTemplate make all WorkflowTemlate invisible
- Dominant language
- Go
- Stars
- 17k
- Forks
- 3.7k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 138
Description
### Pre-requisites
- [X] I have double-checked my configuration
- [X] I can confirm the issues exists when I tested with `:latest`
- [ ] I'd like to contribute the fix myself (see [contributing guide](https://github.com/argoproj/argo-workflows/blob/master/docs/CONTRIBUTING.md))
### What happened/what you expected to happen?
- If we have one invalid `WorkflowTemplates` the `argo-server` returns error response `InternalServeError`, then entire `WorkflowTemplates` are invisible.
- 
- cli
```console
$ argo template -n argo-workflows list
2023/06/29 21:08:17 rpc error: code = Internal desc = json: cannot unmarshal string into Go struct field Container.items.spec.templates.container.command of type []string
```
### Version
latest(v3.4.8)
### Paste a small workflow that reproduces the issue. We must be able to run the workflow; don't enter a workflows that uses private images.
```YAML
apiVersion: argoproj.io/v1alpha1
kind: WorkflowTemplate
metadata:
name: good
namespace: argo-workflows
spec:
entrypoint: whalesay-template
templates:
- name: whalesay-template
container:
image: docker/whalesay
command: [cowsay]
---
apiVersion: argoproj.io/v1alpha1
kind: WorkflowTemplate
metadata:
name: bad
namespace: argo-workflows
spec:
entrypoint: whalesay-template
templates:
- name: whalesay-template
container:
image: docker/whalesay
command: this-is-invalid
-
```
### Logs from the workflow controller
```text
Logs from workflow server
argo-workflows-server-69ffff554c-7qskg argo-server time="2023-06-29T12:08:03.355Z" level=info duration=6.17825ms method=GET path=/api/v1/workflows/argo size=52 status=0
argo-workflows-server-69ffff554c-7qskg argo-server time="2023-06-29T12:08:17.239Z" level=error msg="finished unary call with code Internal" error="rpc error: code = Internal desc = json: cannot unmarshal string into Go struct field Container.items.spec.templates.container.command of type []string" grpc.code=Internal grpc.method=ListWorkflowTemplates grpc.service=workflowtemplate.WorkflowTemplateService grpc.start_time="2023-06-29T12:08:17Z" grpc.time_ms=2.287 span.kind=server system=grpc
argo-workflows-server-69ffff554c-7qskg argo-server time="2023-06-29T12:08:17.239Z" level=info duration=2.655417ms method=GET path=/api/v1/workflow-templates/argo-workflows size=140 status=500
```
### Logs from in your workflow's wait container
```text
N/A
```
Contributor guide
Research direction
Start at the argo-server ListWorkflowTemplates gRPC method exercised by `argo template -n argo-workflows list`, and reproduce the failure with the provided good and bad WorkflowTemplate YAML. Done means an invalid template no longer prevents valid templates from being listed, with test coverage for this mixed-validity case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, grpc, kubernetes
- Domain
- api, backend, cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100