This repository was archived by the owner on Jun 6, 2024. It is now read-only.
This repository was archived by the owner on Jun 6, 2024. It is now read-only.
Missing openshift api-resources #828
Open
Description
Hey,
I am playing around with datree but fail to get a working validation with specific OpenShift api resources.
I exported the resources via the crd extractor tool but datree just throws an error:
helm template ~/work/mychart/ -f ~/work/mychart/values/myproject/values.yaml | datree test - --schema-location '$HOME/.datree/crdSchemas/{{.ResourceKind}}_{{.ResourceAPIVersion}}.json'
>> File: /tmp/datree_temp_362123854.yaml
[V] YAML validation
[X] Kubernetes schema validation
❌ k8s schema validation error: could not find schema for Group
❌ k8s schema validation error: could not find schema for Group
To troubleshoot: refer to our docs [https://hub.datree.io/troubleshooting#schema-validation-failure]
To ignore this failure: use the CLI flag `--ignore-missing-schemas`
[?] Policy check didn't run for this file
(Summary)
- Passing YAML validation: 1/1
- Passing Kubernetes (1.20.0) schema validation: 0/1
- Passing policy check: 0/1
+-----------------------------------+------------------------------------------------------+
| Enabled rules in policy "Default" | 21 |
| Configs tested against policy | 0 |
| Total rules evaluated | 0 |
| Total rules skipped | 0 |
| Total rules failed | 0 |
| Total rules passed | 0 |
| See all rules in policy | https://app.datree.io/login?t=xxxx |
+-----------------------------------+------------------------------------------------------+
I double checked what the crd extractor extracted and the group json schema is part of it:
{
"description": "Group represents a referenceable set of Users",
"type": "object",
"required": [
"users"
],
"properties": {
"apiVersion": {
"description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
"type": "string"
},
"kind": {
"description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
"type": "string"
},
"metadata": {
"$ref": "_definitions.json#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta"
},
"users": {
"description": "Users is the list of users in this group.",
"type": "array",
"items": {
"type": "string"
}
}
},
"x-kubernetes-group-version-kind": [
{
"group": "user.openshift.io",
"kind": "Group",
"version": "v1"
}
],
"$schema": "http://json-schema.org/schema#"
}
Is there something wrong with the schema?
Thanks