mia-platform / mia-platform/mlp
If env variables type validation fails, mlp error is not understandable
- Dominant language
- Go
- Stars
- 10
- Forks
- 3
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
When deploy a Deployment resource with env var not set to string, the error is not clear: `unrecognized type: string`
**Expected behavior**
I expect a more clear error on how to fix the resource, or at least the kind and name or the file path of the resource which has the problem.
**To Reproduce**
Steps to reproduce the behavior:
Try to deply a resource like:
```yml
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: test-case
spec:
concurrencyPolicy: Forbid
successfulJobsHistoryLimit: 3
failedJobsHistoryLimit: 1
schedule: '*/5 * * * *'
jobTemplate:
spec:
backoffLimit: 1
template:
metadata:
name: test-case
spec:
containers:
- name: test-case
image: busybox
env:
- name: SOME_ENV
value: 50
restartPolicy: Never
```
Contributor guide
Research direction
Start by reproducing the validation failure with the CronJob YAML shown in the issue, especially the numeric env value at spec.jobTemplate.spec.template.spec.containers[].env[].value. Trace where the `unrecognized type: string` error is produced. Done means the failure explains how to correct the resource and, when available, identifies its kind and name or file path.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, kubernetes
- Domain
- cli, infrastructure
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100