{
  "description": "TinkerbellMachineTemplate is the Schema for the tinkerbellmachinetemplates API.",
  "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": "TinkerbellMachineTemplateSpec defines the desired state of TinkerbellMachineTemplate.",
      "properties": {
        "template": {
          "description": "TinkerbellMachineTemplateResource describes the data needed to create am TinkerbellMachine from a template.",
          "properties": {
            "spec": {
              "description": "Spec is the specification of the desired behavior of the machine.",
              "properties": {
                "hardwareAffinity": {
                  "description": "HardwareAffinity allows filtering for hardware.",
                  "properties": {
                    "preferred": {
                      "description": "Preferred are the preferred hardware affinity terms. Hardware matching these terms are preferred according to the weights provided, but are not required.",
                      "items": {
                        "description": "WeightedHardwareAffinityTerm is a HardwareAffinityTerm with an associated weight.  The weights of all the matched WeightedHardwareAffinityTerm fields are added per-hardware to find the most preferred hardware.",
                        "properties": {
                          "hardwareAffinityTerm": {
                            "description": "HardwareAffinityTerm is the term associated with the corresponding weight.",
                            "properties": {
                              "labelSelector": {
                                "description": "LabelSelector is used to select for particular hardware by label.",
                                "properties": {
                                  "matchExpressions": {
                                    "description": "matchExpressions is a list of label selector requirements. The requirements are ANDed.",
                                    "items": {
                                      "description": "A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.",
                                      "properties": {
                                        "key": {
                                          "description": "key is the label key that the selector applies to.",
                                          "type": "string"
                                        },
                                        "operator": {
                                          "description": "operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.",
                                          "type": "string"
                                        },
                                        "values": {
                                          "description": "values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.",
                                          "items": {
                                            "type": "string"
                                          },
                                          "type": "array"
                                        }
                                      },
                                      "required": [
                                        "key",
                                        "operator"
                                      ],
                                      "type": "object",
                                      "additionalProperties": false
                                    },
                                    "type": "array"
                                  },
                                  "matchLabels": {
                                    "additionalProperties": {
                                      "type": "string"
                                    },
                                    "description": "matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is \"key\", the operator is \"In\", and the values array contains only \"value\". The requirements are ANDed.",
                                    "type": "object"
                                  }
                                },
                                "type": "object",
                                "x-kubernetes-map-type": "atomic",
                                "additionalProperties": false
                              }
                            },
                            "required": [
                              "labelSelector"
                            ],
                            "type": "object",
                            "additionalProperties": false
                          },
                          "weight": {
                            "description": "Weight associated with matching the corresponding hardwareAffinityTerm, in the range 1-100.",
                            "format": "int32",
                            "maximum": 100,
                            "minimum": 1,
                            "type": "integer"
                          }
                        },
                        "required": [
                          "hardwareAffinityTerm",
                          "weight"
                        ],
                        "type": "object",
                        "additionalProperties": false
                      },
                      "type": "array"
                    },
                    "required": {
                      "description": "Required are the required hardware affinity terms.  The terms are OR'd together, hardware must match one term to be considered.",
                      "items": {
                        "description": "HardwareAffinityTerm is used to select for a particular existing hardware resource.",
                        "properties": {
                          "labelSelector": {
                            "description": "LabelSelector is used to select for particular hardware by label.",
                            "properties": {
                              "matchExpressions": {
                                "description": "matchExpressions is a list of label selector requirements. The requirements are ANDed.",
                                "items": {
                                  "description": "A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.",
                                  "properties": {
                                    "key": {
                                      "description": "key is the label key that the selector applies to.",
                                      "type": "string"
                                    },
                                    "operator": {
                                      "description": "operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.",
                                      "type": "string"
                                    },
                                    "values": {
                                      "description": "values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.",
                                      "items": {
                                        "type": "string"
                                      },
                                      "type": "array"
                                    }
                                  },
                                  "required": [
                                    "key",
                                    "operator"
                                  ],
                                  "type": "object",
                                  "additionalProperties": false
                                },
                                "type": "array"
                              },
                              "matchLabels": {
                                "additionalProperties": {
                                  "type": "string"
                                },
                                "description": "matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is \"key\", the operator is \"In\", and the values array contains only \"value\". The requirements are ANDed.",
                                "type": "object"
                              }
                            },
                            "type": "object",
                            "x-kubernetes-map-type": "atomic",
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "labelSelector"
                        ],
                        "type": "object",
                        "additionalProperties": false
                      },
                      "type": "array"
                    }
                  },
                  "type": "object",
                  "additionalProperties": false
                },
                "hardwareName": {
                  "description": "Those fields are set programmatically, but they cannot be re-constructed from \"state of the world\", so we put them in spec instead of status.",
                  "type": "string"
                },
                "imageLookupBaseRegistry": {
                  "description": "ImageLookupBaseRegistry is the base Registry URL that is used for pulling images, if not set, the default will be to use ghcr.io/tinkerbell/cluster-api-provider-tinkerbell.",
                  "type": "string"
                },
                "imageLookupFormat": {
                  "description": "ImageLookupFormat is the URL naming format to use for machine images when a machine does not specify. When set, this will be used for all cluster machines unless a machine specifies a different ImageLookupFormat. Supports substitutions for {{.BaseRegistry}}, {{.OSDistro}}, {{.OSVersion}} and {{.KubernetesVersion}} with the basse URL, OS distribution, OS version, and kubernetes version, respectively. BaseRegistry will be the value in ImageLookupBaseRegistry or ghcr.io/tinkerbell/cluster-api-provider-tinkerbell (the default), OSDistro will be the value in ImageLookupOSDistro or ubuntu (the default), OSVersion will be the value in ImageLookupOSVersion or default based on the OSDistro (if known), and the kubernetes version as defined by the packages produced by kubernetes/release: v1.13.0, v1.12.5-mybuild.1, or v1.17.3. For example, the default image format of {{.BaseRegistry}}/{{.OSDistro}}-{{.OSVersion}}:{{.KubernetesVersion}}.gz will attempt to pull the image from that location. See also: https://golang.org/pkg/text/template/",
                  "type": "string"
                },
                "imageLookupOSDistro": {
                  "description": "ImageLookupOSDistro is the name of the OS distro to use when fetching machine images, if not set it will default to ubuntu.",
                  "type": "string"
                },
                "imageLookupOSVersion": {
                  "description": "ImageLookupOSVersion is the version of the OS distribution to use when fetching machine images. If not set it will default based on ImageLookupOSDistro.",
                  "type": "string"
                },
                "providerID": {
                  "type": "string"
                },
                "templateOverride": {
                  "description": "TemplateOverride overrides the default Tinkerbell template used by CAPT. You can learn more about Tinkerbell templates here: https://docs.tinkerbell.org/templates/",
                  "type": "string"
                }
              },
              "type": "object",
              "additionalProperties": false
            }
          },
          "required": [
            "spec"
          ],
          "type": "object",
          "additionalProperties": false
        }
      },
      "required": [
        "template"
      ],
      "type": "object",
      "additionalProperties": false
    }
  },
  "type": "object"
}
