argoproj / argoproj/argo-workflows
PDB JSON Schema only allows String -- due to `IntOrString`
- Dominant language
- Go
- Stars
- 17k
- Forks
- 3.7k
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 138
Description
### Pre-requisites
- [X] I have double-checked my configuration
- [X] I have tested with the `:latest` image tag (i.e. `quay.io/argoproj/workflow-controller:latest`) and can confirm the issue still exists on `:latest`. If not, I have explained why, **in detail**, in my description below.
- [X] I have searched existing issues and could not find a match for this bug
- [ ] I'd like to contribute the fix myself (see [contributing guide](https://github.com/argoproj/argo-workflows/blob/main/docs/CONTRIBUTING.md))
### What happened? What did you expect to happen?
I recently deployed argo workflows in my organization's production cluster. I also wrote a wrapper cdk8s chart that engineers and data scientists use to deploy argo workflow charts. In developing the chart, we decided to add json schema validation in order to prevent errant workflow configurations being applied to the cluster.
In doing so we noticed that the pod disruption budget json schema is incorrect. "minAvailable" and "maxAvailable" cannot be set as a percentage for workflows or k8s jobs. They must be set as a numerical value. However, the json schema requires a string. This allows for "100%", etc, which will not work.
https://raw.githubusercontent.com/argoproj/argo-workflows/v3.5.8/api/jsonschema/schema.json
The offending definition:
```json
"io.k8s.apimachinery.pkg.util.intstr.IntOrString": {
"type": "string"
},
```
We changed this to "integer" in our forked schema.
related issues:
https://github.com/argoproj/argo-workflows/issues/6349
https://github.com/argoproj/argo-workflows/issues/6060
https://github.com/argoproj/argo-workflows/issues/4817#issuecomment-754819948
### Version(s)
v3.5.8
### Paste a minimal workflow that reproduces the issue. We must be able to run the workflow; don't enter a workflows that uses private images.
```YAML
N/A
```
### Logs from the workflow controller
```text
N/A
```
### Logs from in your workflow's wait container
```text
N/A
```
Contributor guide
Research direction
Start with api/jsonschema/schema.json and inspect the io.k8s.apimachinery.pkg.util.intstr.IntOrString definition described in the issue. Read the related issues for context on the intended PodDisruptionBudget validation. Done means the schema permits the required numerical minAvailable and maxAvailable values while rejecting percentage values for these fields.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, kubernetes
- Domain
- api
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100