Open
Description
Digging around in validation we realized that several resources end up calling duplicate validation logic on updates - they call ValidateFoo() and then ValidateFooUpdate() which calls validateFoo() internally. I'd call this a BUG.
So why have we never seen it? Because kubectl de-dups errors.
$ k --context=diy apply -f /tmp/rc.yaml
The ReplicationController "nginx" is invalid: spec.replicas: Invalid value: -1: must be greater than or equal to 0
$ k -v 9 --context=diy apply -f /tmp/rc.yaml 2>&1 | tail -5 | grep '"kind":"Status"' | jq .
{
"kind": "Status",
"apiVersion": "v1",
"metadata": {},
"status": "Failure",
"message": "ReplicationController \"nginx\" is invalid: spec.replicas: Invalid value: -1: must be greater than or equal to 0",
"reason": "Invalid",
"details": {
"name": "nginx",
"kind": "ReplicationController",
"causes": [
{
"reason": "FieldValueInvalid",
"message": "Invalid value: -1: must be greater than or equal to 0",
"field": "spec.replicas"
},
{
"reason": "FieldValueInvalid",
"message": "Invalid value: -1: must be greater than or equal to 0",
"field": "spec.replicas"
}
]
},
"code": 422
}
Is this a feature or a bug?
Metadata
Metadata
Assignees
Labels
Type
Projects
Status