-
Notifications
You must be signed in to change notification settings - Fork 137
Description
Hi there,
We're using kubeval
to validate manifests, as well as to catch deprecation warnings (before upgrading to the new version of k8s).
Unfortunately, as far as I can see, this repository includes deprecated manifests alongside with normal ones, and fires a false negative in case an object is passing a validation but the schema is marked as deprecated.
Example:
when running kubeval manifest.yml -v1.16.0
I would expect the following manifest to fail the kubeval
checking:
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: depl
namespace: default
since extensions.v1beta1.Deployment
is not supported in k8s 1.16.0 anymore (it's been moved to apps.v1.Deployment
)
However, it passes, since the manifests for all old API groups for Deployment are still present in the repo, e.g.:
- https://github.com/instrumenta/kubernetes-json-schema/blob/master/v1.16.0/deployment-apps-v1beta1.json
- https://github.com/instrumenta/kubernetes-json-schema/blob/master/v1.16.0/deployment-apps-v1beta2.json
- https://github.com/instrumenta/kubernetes-json-schema/blob/master/v1.16.0/deployment-extensions-v1beta1.json
Not sure how this can be solved (as it seems coming from actual manifests for 1.16.0 that do have the manifests present), but one obvious solution could be creating a new set of manifest groups (e.g. v1.16.0-no-deprecated
, v1.17.0-no-deprecated
etc.) with manifests that have a DEPRECATED
string in their description excluded from it:
https://github.com/instrumenta/kubernetes-json-schema/blob/master/v1.16.0/deployment-extensions-v1beta1.json#L2