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

feat: add x-kubernetes-group-version-kind to the schema #129

Merged
merged 1 commit into from
Oct 18, 2024

Conversation

Skarlso
Copy link
Owner

@Skarlso Skarlso commented Oct 17, 2024

Closes #128

@Skarlso
Copy link
Owner Author

Skarlso commented Oct 18, 2024

{
  "id": "https://crdtoyaml.com/KrokCommand.delivery.krok.app.v1alpha1.schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "description": "KrokCommand is the Schema for the krokcommands API",
  "type": "object",
  "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": {
      "type": "object"
    },
    "spec": {
      "description": "KrokCommandSpec defines the desired state of KrokCommand",
      "type": "object",
      "required": [
        "image"
      ],
      "properties": {
        "commandHasOutputToWrite": {
          "description": "CommandHasOutputToWrite if defined, it signals the underlying Job, to put its output into a generated and created secret.",
          "type": "boolean"
        },
        "dependencies": {
          "description": "Dependencies defines a list of command names that this command depends on.",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "enabled": {
          "description": "Enabled defines if this command can be executed or not.",
          "type": "boolean"
        },
        "image": {
          "description": "Image defines the image name and tag of the command example: krok-hook/slack-notification:v0.0.1",
          "type": "string"
        },
        "platforms": {
          "description": "Platforms holds all the platforms which this command supports.",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "readInputFromSecret": {
          "description": "ReadInputFromSecret if defined, the command will take a list of key/value pairs in a secret and apply them as arguments to the command.",
          "type": "object",
          "required": [
            "name",
            "namespace"
          ],
          "properties": {
            "name": {
              "type": "string"
            },
            "namespace": {
              "type": "string"
            }
          }
        },
        "schedule": {
          "description": "Schedule of the command. example: 0 * * * * // follows cron job syntax.",
          "type": "string"
        }
      }
    },
    "status": {
      "description": "KrokCommandStatus defines the observed state of KrokCommand",
      "type": "object"
    }
  },
  "x-kubernetes-group-version-kind": [
    {
      "kind": "KrokCommand",
      "version": "v1alpha1",
      "group": "delivery.krok.app"
    }
  ]
}

@Skarlso Skarlso force-pushed the extend-json-schema branch from 44656ea to f5c8066 Compare October 18, 2024 05:02
@Skarlso Skarlso merged commit aee2d44 into main Oct 18, 2024
4 checks passed
@Skarlso Skarlso deleted the extend-json-schema branch October 18, 2024 05:19
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

Successfully merging this pull request may close these issues.

Idea/FeatureRequest: Extend JSON Schemas with "x-kubernetes-group-version-kind" Property
1 participant