Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing property in manifest, but has a default value in schema -- should not fail, but does. #292

Open
ESmithaaS opened this issue Oct 7, 2024 · 0 comments

Comments

@ESmithaaS
Copy link

managementState.zip

I'm attaching a zip file that contains the CRD schema, the Custom Resource, and the failure message.

The OpenTelemetryCollector schema for v1beta1 has a property at spec.managementState that has a default value of "managed". If the property is not defined in the manifest file, then it fails the schema validation. So, the current behavior is to fail for missing the property instead of expecting the resource to use the default property and value. It seems that kubeconform is looking for default properties to be explicitly defined in the manifest file. This does not seem to be correct behavior.

{
  "resources": [
    {
      "filename": "tag-auth/vault-cloudwatch/collector.yaml",
      "kind": "OpenTelemetryCollector",
      "name": "vault-cloudwatch-collector",
      "version": "opentelemetry.io/v1beta1",
      "status": "statusInvalid",
      "msg": "problem validating schema. Check JSON formatting: jsonschema: '/spec' does not validate with file:///Users/edwinsmith/.datree/crdSchemas/opentelemetrycollector_v1beta1.json#/properties/spec/required: missing properties: 'managementState'",
      "validationErrors": [
        {
          "path": "/spec",
          "msg": "missing properties: 'managementState'"
        }
      ]
    }
  ],
  "summary": {
    "valid": 0,
    "invalid": 1,
    "errors": 0,
    "skipped": 0
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant