Class ValidatingWebhook.Builder
- java.lang.Object
-
- com.marcnuri.yakc.model.io.k8s.api.admissionregistration.v1beta1.ValidatingWebhook.Builder
-
- Enclosing class:
- ValidatingWebhook
public static class ValidatingWebhook.Builder extends java.lang.Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ValidatingWebhook.Builder
addToAdmissionReviewVersions(java.lang.String addToAdmissionReviewVersions)
ValidatingWebhook.Builder
addToRules(RuleWithOperations addToRules)
ValidatingWebhook.Builder
admissionReviewVersions(java.util.Collection<? extends java.lang.String> admissionReviewVersions)
ValidatingWebhook
build()
ValidatingWebhook.Builder
clearAdmissionReviewVersions()
ValidatingWebhook.Builder
clearRules()
ValidatingWebhook.Builder
clientConfig(@NonNull WebhookClientConfig clientConfig)
ValidatingWebhook.Builder
failurePolicy(java.lang.String failurePolicy)
FailurePolicy defines how unrecognized errors from the admission endpoint are handled - allowed values are Ignore or Fail.ValidatingWebhook.Builder
matchPolicy(java.lang.String matchPolicy)
matchPolicy defines how the "rules" list is used to match incoming requests.ValidatingWebhook.Builder
name(@NonNull java.lang.String name)
The name of the admission webhook.ValidatingWebhook.Builder
namespaceSelector(LabelSelector namespaceSelector)
ValidatingWebhook.Builder
objectSelector(LabelSelector objectSelector)
ValidatingWebhook.Builder
rules(java.util.Collection<? extends RuleWithOperations> rules)
ValidatingWebhook.Builder
sideEffects(java.lang.String sideEffects)
SideEffects states whether this webhook has side effects.ValidatingWebhook.Builder
timeoutSeconds(java.lang.Number timeoutSeconds)
TimeoutSeconds specifies the timeout for this webhook.java.lang.String
toString()
-
-
-
Method Detail
-
addToAdmissionReviewVersions
public ValidatingWebhook.Builder addToAdmissionReviewVersions(java.lang.String addToAdmissionReviewVersions)
-
admissionReviewVersions
public ValidatingWebhook.Builder admissionReviewVersions(java.util.Collection<? extends java.lang.String> admissionReviewVersions)
-
clearAdmissionReviewVersions
public ValidatingWebhook.Builder clearAdmissionReviewVersions()
-
clientConfig
public ValidatingWebhook.Builder clientConfig(@NonNull @NonNull WebhookClientConfig clientConfig)
-
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
.
-
namespaceSelector
public ValidatingWebhook.Builder namespaceSelector(LabelSelector namespaceSelector)
-
objectSelector
public ValidatingWebhook.Builder objectSelector(LabelSelector objectSelector)
-
addToRules
public ValidatingWebhook.Builder addToRules(RuleWithOperations addToRules)
-
rules
public ValidatingWebhook.Builder rules(java.util.Collection<? extends RuleWithOperations> rules)
-
clearRules
public ValidatingWebhook.Builder clearRules()
-
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
.
-
build
public ValidatingWebhook build()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-