{
  "description": "TenantResource allows a Tenant Owner, if enabled with proper RBAC, to propagate resources in its Namespace.\nThe object must be deployed in a Tenant Namespace, and cannot reference object living in non-Tenant namespaces.\nFor such cases, the GlobalTenantResource must be used.",
  "properties": {
    "apiVersion": {
      "description": "APIVersion defines the versioned schema of this representation of an object.\nServers should convert recognized schemas to the latest internal value, and\nmay reject unrecognized values.\nMore 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.\nServers may infer this from the endpoint the client submits requests to.\nCannot be updated.\nIn CamelCase.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
      "type": "string"
    },
    "metadata": {
      "type": "object"
    },
    "spec": {
      "description": "TenantResourceSpec defines the desired state of TenantResource.",
      "properties": {
        "pruningOnDelete": {
          "default": true,
          "description": "When the replicated resource manifest is deleted, all the objects replicated so far will be automatically deleted.\nDisable this to keep replicated resources although the deletion of the replication manifest.",
          "type": "boolean"
        },
        "resources": {
          "description": "Defines the rules to select targeting Namespace, along with the objects that must be replicated.",
          "items": {
            "properties": {
              "additionalMetadata": {
                "description": "Besides the Capsule metadata required by TenantResource controller, defines additional metadata that must be\nadded to the replicated resources.",
                "properties": {
                  "annotations": {
                    "additionalProperties": {
                      "type": "string"
                    },
                    "type": "object"
                  },
                  "labels": {
                    "additionalProperties": {
                      "type": "string"
                    },
                    "type": "object"
                  }
                },
                "type": "object",
                "additionalProperties": false
              },
              "namespaceSelector": {
                "description": "Defines the Namespace selector to select the Tenant Namespaces on which the resources must be propagated.\nIn case of nil value, all the Tenant Namespaces are targeted.",
                "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\nrelates 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.\nValid 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,\nthe values array must be non-empty. If the operator is Exists or DoesNotExist,\nthe values array must be empty. This array is replaced during a strategic\nmerge patch.",
                          "items": {
                            "type": "string"
                          },
                          "type": "array",
                          "x-kubernetes-list-type": "atomic"
                        }
                      },
                      "required": [
                        "key",
                        "operator"
                      ],
                      "type": "object",
                      "additionalProperties": false
                    },
                    "type": "array",
                    "x-kubernetes-list-type": "atomic"
                  },
                  "matchLabels": {
                    "additionalProperties": {
                      "type": "string"
                    },
                    "description": "matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels\nmap is equivalent to an element of matchExpressions, whose key field is \"key\", the\noperator is \"In\", and the values array contains only \"value\". The requirements are ANDed.",
                    "type": "object"
                  }
                },
                "type": "object",
                "x-kubernetes-map-type": "atomic",
                "additionalProperties": false
              },
              "namespacedItems": {
                "description": "List of the resources already existing in other Namespaces that must be replicated.",
                "items": {
                  "properties": {
                    "apiVersion": {
                      "description": "API version of the referent.",
                      "type": "string"
                    },
                    "kind": {
                      "description": "Kind of the referent.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
                      "type": "string"
                    },
                    "namespace": {
                      "description": "Namespace of the referent.\nMore info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/",
                      "type": "string"
                    },
                    "selector": {
                      "description": "Label selector used to select the given resources in the given Namespace.",
                      "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\nrelates 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.\nValid 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,\nthe values array must be non-empty. If the operator is Exists or DoesNotExist,\nthe values array must be empty. This array is replaced during a strategic\nmerge patch.",
                                "items": {
                                  "type": "string"
                                },
                                "type": "array",
                                "x-kubernetes-list-type": "atomic"
                              }
                            },
                            "required": [
                              "key",
                              "operator"
                            ],
                            "type": "object",
                            "additionalProperties": false
                          },
                          "type": "array",
                          "x-kubernetes-list-type": "atomic"
                        },
                        "matchLabels": {
                          "additionalProperties": {
                            "type": "string"
                          },
                          "description": "matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels\nmap is equivalent to an element of matchExpressions, whose key field is \"key\", the\noperator 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": [
                    "kind",
                    "namespace",
                    "selector"
                  ],
                  "type": "object",
                  "additionalProperties": false
                },
                "type": "array"
              },
              "rawItems": {
                "description": "List of raw resources that must be replicated.",
                "items": {
                  "type": "object",
                  "x-kubernetes-embedded-resource": true,
                  "x-kubernetes-preserve-unknown-fields": true
                },
                "type": "array"
              }
            },
            "type": "object",
            "additionalProperties": false
          },
          "type": "array"
        },
        "resyncPeriod": {
          "default": "60s",
          "description": "Define the period of time upon a second reconciliation must be invoked.\nKeep in mind that any change to the manifests will trigger a new reconciliation.",
          "type": "string"
        }
      },
      "required": [
        "resources",
        "resyncPeriod"
      ],
      "type": "object",
      "additionalProperties": false
    },
    "status": {
      "description": "TenantResourceStatus defines the observed state of TenantResource.",
      "properties": {
        "processedItems": {
          "description": "List of the replicated resources for the given TenantResource.",
          "items": {
            "properties": {
              "apiVersion": {
                "description": "API version of the referent.",
                "type": "string"
              },
              "kind": {
                "description": "Kind of the referent.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
                "type": "string"
              },
              "name": {
                "description": "Name of the referent.\nMore info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names",
                "type": "string"
              },
              "namespace": {
                "description": "Namespace of the referent.\nMore info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/",
                "type": "string"
              }
            },
            "required": [
              "kind",
              "name",
              "namespace"
            ],
            "type": "object",
            "additionalProperties": false
          },
          "type": "array"
        }
      },
      "required": [
        "processedItems"
      ],
      "type": "object",
      "additionalProperties": false
    }
  },
  "type": "object"
}
