Class ValidatingWebhook.Builder

  • Enclosing class:
    ValidatingWebhook

    public static class ValidatingWebhook.Builder
    extends java.lang.Object
    • Method Detail

      • addToAdmissionReviewVersions

        public ValidatingWebhook.Builder addToAdmissionReviewVersions​(java.lang.String addToAdmissionReviewVersions)
      • admissionReviewVersions

        public ValidatingWebhook.Builder admissionReviewVersions​(java.util.Collection<? extends java.lang.String> admissionReviewVersions)
      • failurePolicy

        public ValidatingWebhook.Builder failurePolicy​(java.lang.String failurePolicy)
        FailurePolicy defines how unrecognized errors from the admission endpoint are handled - allowed values are Ignore or Fail. Defaults to Ignore.
        Returns:
        this.
      • matchPolicy

        public ValidatingWebhook.Builder matchPolicy​(java.lang.String matchPolicy)
        matchPolicy defines how the "rules" list is used to match incoming requests. Allowed values are "Exact" or "Equivalent".


        - Exact: match a request only if it exactly matches a specified rule. For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, but "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`, a request to apps/v1beta1 or extensions/v1beta1 would not be sent to the webhook.


        - Equivalent: match a request if modifies a resource listed in rules, even via another API group or version. For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1, and "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`, a request to apps/v1beta1 or extensions/v1beta1 would be converted to apps/v1 and sent to the webhook.


        Defaults to "Exact"

        Returns:
        this.
      • name

        public ValidatingWebhook.Builder name​(@NonNull
                                              @NonNull java.lang.String name)
        The name of the admission webhook. Name should be fully qualified, e.g., imagepolicy.kubernetes.io, where "imagepolicy" is the name of the webhook, and kubernetes.io is the name of the organization. Required.
        Returns:
        this.
      • sideEffects

        public ValidatingWebhook.Builder sideEffects​(java.lang.String sideEffects)
        SideEffects states whether this webhook has side effects. Acceptable values are: Unknown, None, Some, NoneOnDryRun Webhooks with side effects MUST implement a reconciliation system, since a request may be rejected by a future step in the admission chain and the side effects therefore need to be undone. Requests with the dryRun attribute will be auto-rejected if they match a webhook with sideEffects == Unknown or Some. Defaults to Unknown.
        Returns:
        this.
      • timeoutSeconds

        public ValidatingWebhook.Builder timeoutSeconds​(java.lang.Number timeoutSeconds)
        TimeoutSeconds specifies the timeout for this webhook. After the timeout passes, the webhook call will be ignored or the API call will fail based on the failure policy. The timeout value must be between 1 and 30 seconds. Default to 30 seconds.
        Returns:
        this.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object