Validating a Kubernetes schema
New Kubernetes versions can come with API version deprecations and removals. For example, in release 1.16 for CustomResourceDefinition, the apiextensions.k8s.io/v1 version was introduced, while in apiextensions.k8s.io/v1beta1 it was deprecated, and later, in version 1.22, it was completely removed. So, if you used apiextensions.k8s.io/v1beta1 for CustomResourceDefinitions starting with Kubernetes version 1.16, you would get a deprecation warning, while if you used it with version 1.22, you would get an error because the version doesn’t exist anymore.
Usually, the problem is not only about applying older and unsupported API versions to a Kubernetes cluster; instead, it may be more likely that you have a deprecated version already installed with some applications, after which you upgrade the cluster to a version where the API is completely removed. Normally, you should catch it while you upgrade the development or testing clusters, but there is...