{
  "description": "ClusterAdmissionPolicy is the Schema for the clusteradmissionpolicies API",
  "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",
        "null"
      ]
    },
    "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",
        "null"
      ]
    },
    "metadata": {
      "type": [
        "object",
        "null"
      ]
    },
    "spec": {
      "additionalProperties": false,
      "description": "ClusterAdmissionPolicySpec defines the desired state of ClusterAdmissionPolicy.",
      "properties": {
        "failurePolicy": {
          "description": "FailurePolicy defines how unrecognized errors and timeout errors from the\npolicy are handled. Allowed values are \"Ignore\" or \"Fail\".\n* \"Ignore\" means that an error calling the webhook is ignored and the API\n  request is allowed to continue.\n* \"Fail\" means that an error calling the webhook causes the admission to\n  fail and the API request to be rejected.\nThe default behaviour is \"Fail\"",
          "type": [
            "string",
            "null"
          ]
        },
        "matchPolicy": {
          "description": "matchPolicy defines how the \"rules\" list is used to match incoming requests.\nAllowed values are \"Exact\" or \"Equivalent\".\n\u003cul\u003e\n\u003cli\u003e\nExact: match a request only if it exactly matches a specified rule.\nFor example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1,\nbut \"rules\" only included `apiGroups:[\"apps\"], apiVersions:[\"v1\"], resources: [\"deployments\"]`,\na request to apps/v1beta1 or extensions/v1beta1 would not be sent to the webhook.\n\u003c/li\u003e\n\u003cli\u003e\nEquivalent: match a request if modifies a resource listed in rules, even via another API group or version.\nFor example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1,\nand \"rules\" only included `apiGroups:[\"apps\"], apiVersions:[\"v1\"], resources: [\"deployments\"]`,\na request to apps/v1beta1 or extensions/v1beta1 would be converted to apps/v1 and sent to the webhook.\n\u003c/li\u003e\n\u003c/ul\u003e\nDefaults to \"Equivalent\"",
          "type": [
            "string",
            "null"
          ]
        },
        "mode": {
          "default": "protect",
          "description": "Mode defines the execution mode of this policy. Can be set to\neither \"protect\" or \"monitor\". If it's empty, it is defaulted to\n\"protect\".\nTransitioning this setting from \"monitor\" to \"protect\" is\nallowed, but is disallowed to transition from \"protect\" to\n\"monitor\". To perform this transition, the policy should be\nrecreated in \"monitor\" mode instead.",
          "enum": [
            "protect",
            "monitor"
          ],
          "type": [
            "string",
            "null"
          ]
        },
        "module": {
          "description": "Module is the location of the WASM module to be loaded. Can be a\nlocal file (file://), a remote file served by an HTTP server\n(http://, https://), or an artifact served by an OCI-compatible\nregistry (registry://).",
          "type": "string"
        },
        "mutating": {
          "description": "Mutating indicates whether a policy has the ability to mutate\nincoming requests or not.",
          "type": "boolean"
        },
        "namespaceSelector": {
          "additionalProperties": false,
          "description": "NamespaceSelector decides whether to run the webhook on an object based\non whether the namespace for that object matches the selector. If the\nobject itself is a namespace, the matching is performed on\nobject.metadata.labels. If the object is another cluster scoped resource,\nit never skips the webhook.\n\u003cbr/\u003e\u003cbr/\u003e\nFor example, to run the webhook on any objects whose namespace is not\nassociated with \"runlevel\" of \"0\" or \"1\";  you will set the selector as\nfollows:\n\u003cpre\u003e\n\"namespaceSelector\": \\{\u003cbr/\u003e\n\u0026nbsp;\u0026nbsp;\"matchExpressions\": [\u003cbr/\u003e\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\\{\u003cbr/\u003e\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\"key\": \"runlevel\",\u003cbr/\u003e\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\"operator\": \"NotIn\",\u003cbr/\u003e\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\"values\": [\u003cbr/\u003e\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\"0\",\u003cbr/\u003e\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\"1\"\u003cbr/\u003e\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;]\u003cbr/\u003e\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\\}\u003cbr/\u003e\n\u0026nbsp;\u0026nbsp;]\u003cbr/\u003e\n\\}\n\u003c/pre\u003e\nIf instead you want to only run the webhook on any objects whose\nnamespace is associated with the \"environment\" of \"prod\" or \"staging\";\nyou will set the selector as follows:\n\u003cpre\u003e\n\"namespaceSelector\": \\{\u003cbr/\u003e\n\u0026nbsp;\u0026nbsp;\"matchExpressions\": [\u003cbr/\u003e\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\\{\u003cbr/\u003e\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\"key\": \"environment\",\u003cbr/\u003e\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\"operator\": \"In\",\u003cbr/\u003e\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\"values\": [\u003cbr/\u003e\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\"prod\",\u003cbr/\u003e\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\"staging\"\u003cbr/\u003e\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;]\u003cbr/\u003e\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\\}\u003cbr/\u003e\n\u0026nbsp;\u0026nbsp;]\u003cbr/\u003e\n\\}\n\u003c/pre\u003e\nSee\nhttps://kubernetes.io/docs/concepts/overview/working-with-objects/labels\nfor more examples of label selectors.\n\u003cbr/\u003e\u003cbr/\u003e\nDefault to the empty LabelSelector, which matches everything.",
          "properties": {
            "matchExpressions": {
              "description": "matchExpressions is a list of label selector requirements. The requirements are ANDed.",
              "items": {
                "additionalProperties": false,
                "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",
                      "null"
                    ],
                    "x-kubernetes-list-type": "atomic"
                  }
                },
                "required": [
                  "key",
                  "operator"
                ],
                "type": "object"
              },
              "type": [
                "array",
                "null"
              ],
              "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",
                "null"
              ]
            }
          },
          "type": [
            "object",
            "null"
          ],
          "x-kubernetes-map-type": "atomic"
        },
        "objectSelector": {
          "additionalProperties": false,
          "description": "ObjectSelector decides whether to run the webhook based on if the\nobject has matching labels. objectSelector is evaluated against both\nthe oldObject and newObject that would be sent to the webhook, and\nis considered to match if either object matches the selector. A null\nobject (oldObject in the case of create, or newObject in the case of\ndelete) or an object that cannot have labels (like a\nDeploymentRollback or a PodProxyOptions object) is not considered to\nmatch.\nUse the object selector only if the webhook is opt-in, because end\nusers may skip the admission webhook by setting the labels.\nDefault to the empty LabelSelector, which matches everything.",
          "properties": {
            "matchExpressions": {
              "description": "matchExpressions is a list of label selector requirements. The requirements are ANDed.",
              "items": {
                "additionalProperties": false,
                "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",
                      "null"
                    ],
                    "x-kubernetes-list-type": "atomic"
                  }
                },
                "required": [
                  "key",
                  "operator"
                ],
                "type": "object"
              },
              "type": [
                "array",
                "null"
              ],
              "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",
                "null"
              ]
            }
          },
          "type": [
            "object",
            "null"
          ],
          "x-kubernetes-map-type": "atomic"
        },
        "policyServer": {
          "default": "default",
          "description": "PolicyServer identifies an existing PolicyServer resource.",
          "type": [
            "string",
            "null"
          ]
        },
        "rules": {
          "description": "Rules describes what operations on what resources/subresources the webhook cares about.\nThe webhook cares about an operation if it matches _any_ Rule.",
          "items": {
            "additionalProperties": false,
            "description": "RuleWithOperations is a tuple of Operations and Resources. It is recommended to make\nsure that all the tuple expansions are valid.",
            "properties": {
              "apiGroups": {
                "description": "apiGroups is the API groups the resources belong to. '*' is all groups.\nIf '*' is present, the length of the slice must be one.\nRequired.",
                "items": {
                  "type": "string"
                },
                "type": [
                  "array",
                  "null"
                ],
                "x-kubernetes-list-type": "atomic"
              },
              "apiVersions": {
                "description": "apiVersions is the API versions the resources belong to. '*' is all versions.\nIf '*' is present, the length of the slice must be one.\nRequired.",
                "items": {
                  "type": "string"
                },
                "type": [
                  "array",
                  "null"
                ],
                "x-kubernetes-list-type": "atomic"
              },
              "operations": {
                "description": "operations is the operations the admission hook cares about - CREATE, UPDATE, DELETE, CONNECT or *\nfor all of those operations and any future admission operations that are added.\nIf '*' is present, the length of the slice must be one.\nRequired.",
                "items": {
                  "description": "OperationType specifies an operation for a request.",
                  "type": "string"
                },
                "type": [
                  "array",
                  "null"
                ],
                "x-kubernetes-list-type": "atomic"
              },
              "resources": {
                "description": "resources is a list of resources this rule applies to.\n\nFor example:\n'pods' means pods.\n'pods/log' means the log subresource of pods.\n'*' means all resources, but not subresources.\n'pods/*' means all subresources of pods.\n'*/scale' means all scale subresources.\n'*/*' means all resources and their subresources.\n\nIf wildcard is present, the validation rule will ensure resources do not\noverlap with each other.\n\nDepending on the enclosing object, subresources might not be allowed.\nRequired.",
                "items": {
                  "type": "string"
                },
                "type": [
                  "array",
                  "null"
                ],
                "x-kubernetes-list-type": "atomic"
              },
              "scope": {
                "description": "scope specifies the scope of this rule.\nValid values are \"Cluster\", \"Namespaced\", and \"*\"\n\"Cluster\" means that only cluster-scoped resources will match this rule.\nNamespace API objects are cluster-scoped.\n\"Namespaced\" means that only namespaced resources will match this rule.\n\"*\" means that there are no scope restrictions.\nSubresources match the scope of their parent resource.\nDefault is \"*\".",
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "type": "object"
          },
          "type": "array"
        },
        "settings": {
          "description": "Settings is a free-form object that contains the policy configuration\nvalues.\nx-kubernetes-embedded-resource: false",
          "nullable": true,
          "type": [
            "object",
            "null"
          ],
          "x-kubernetes-preserve-unknown-fields": true
        },
        "sideEffects": {
          "description": "SideEffects states whether this webhook has side effects.\nAcceptable values are: None, NoneOnDryRun (webhooks created via v1beta1 may also specify Some or Unknown).\nWebhooks with side effects MUST implement a reconciliation system, since a request may be\nrejected by a future step in the admission change and the side effects therefore need to be undone.\nRequests with the dryRun attribute will be auto-rejected if they match a webhook with\nsideEffects == Unknown or Some.",
          "type": [
            "string",
            "null"
          ]
        },
        "timeoutSeconds": {
          "default": 10,
          "description": "TimeoutSeconds specifies the timeout for this webhook. After the timeout passes,\nthe webhook call will be ignored or the API call will fail based on the\nfailure policy.\nThe timeout value must be between 1 and 30 seconds.\nDefault to 10 seconds.",
          "format": "int32",
          "type": [
            "integer",
            "null"
          ]
        }
      },
      "required": [
        "module",
        "mutating",
        "rules"
      ],
      "type": [
        "object",
        "null"
      ]
    },
    "status": {
      "additionalProperties": false,
      "description": "PolicyStatus defines the observed state of ClusterAdmissionPolicy and AdmissionPolicy.",
      "properties": {
        "conditions": {
          "description": "Conditions represent the observed conditions of the\nClusterAdmissionPolicy resource.  Known .status.conditions.types\nare: \"PolicyServerSecretReconciled\",\n\"PolicyServerConfigMapReconciled\",\n\"PolicyServerDeploymentReconciled\",\n\"PolicyServerServiceReconciled\" and\n\"AdmissionPolicyActive\"",
          "items": {
            "additionalProperties": false,
            "description": "Condition contains details for one aspect of the current state of this API Resource.",
            "properties": {
              "lastTransitionTime": {
                "description": "lastTransitionTime is the last time the condition transitioned from one status to another.\nThis should be when the underlying condition changed.  If that is not known, then using the time when the API field changed is acceptable.",
                "format": "date-time",
                "type": "string"
              },
              "message": {
                "description": "message is a human readable message indicating details about the transition.\nThis may be an empty string.",
                "maxLength": 32768,
                "type": "string"
              },
              "observedGeneration": {
                "description": "observedGeneration represents the .metadata.generation that the condition was set based upon.\nFor instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date\nwith respect to the current state of the instance.",
                "format": "int64",
                "minimum": 0,
                "type": [
                  "integer",
                  "null"
                ]
              },
              "reason": {
                "description": "reason contains a programmatic identifier indicating the reason for the condition's last transition.\nProducers of specific condition types may define expected values and meanings for this field,\nand whether the values are considered a guaranteed API.\nThe value should be a CamelCase string.\nThis field may not be empty.",
                "maxLength": 1024,
                "minLength": 1,
                "pattern": "^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$",
                "type": "string"
              },
              "status": {
                "description": "status of the condition, one of True, False, Unknown.",
                "enum": [
                  "True",
                  "False",
                  "Unknown"
                ],
                "type": "string"
              },
              "type": {
                "description": "type of condition in CamelCase or in foo.example.com/CamelCase.",
                "maxLength": 316,
                "pattern": "^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$",
                "type": "string"
              }
            },
            "required": [
              "lastTransitionTime",
              "message",
              "reason",
              "status",
              "type"
            ],
            "type": "object"
          },
          "type": [
            "array",
            "null"
          ],
          "x-kubernetes-list-map-keys": [
            "type"
          ],
          "x-kubernetes-list-type": "map"
        },
        "mode": {
          "description": "PolicyMode represents the observed policy mode of this policy in\nthe associated PolicyServer configuration",
          "enum": [
            "protect",
            "monitor",
            "unknown"
          ],
          "type": [
            "string",
            "null"
          ]
        },
        "policyStatus": {
          "description": "PolicyStatus represents the observed status of the policy",
          "enum": [
            "unscheduled",
            "scheduled",
            "pending",
            "active"
          ],
          "type": "string"
        }
      },
      "required": [
        "policyStatus"
      ],
      "type": [
        "object",
        "null"
      ]
    }
  },
  "type": "object"
}