Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
com.pulumi.kubernetes.admissionregistration.v1beta1.inputs.MatchResourcesPatchArgs Maven / Gradle / Ivy
Go to download
A Pulumi package for creating and managing Kubernetes resources.
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package com.pulumi.kubernetes.admissionregistration.v1beta1.inputs;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
import com.pulumi.kubernetes.admissionregistration.v1beta1.inputs.NamedRuleWithOperationsPatchArgs;
import com.pulumi.kubernetes.meta.v1.inputs.LabelSelectorPatchArgs;
import java.lang.String;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;
/**
* MatchResources decides whether to run the admission control policy on an object based on whether it meets the match criteria. The exclude rules take precedence over include rules (if a resource matches both, it is excluded)
*
*/
public final class MatchResourcesPatchArgs extends com.pulumi.resources.ResourceArgs {
public static final MatchResourcesPatchArgs Empty = new MatchResourcesPatchArgs();
/**
* ExcludeResourceRules describes what operations on what resources/subresources the ValidatingAdmissionPolicy should not care about. The exclude rules take precedence over include rules (if a resource matches both, it is excluded)
*
*/
@Import(name="excludeResourceRules")
private @Nullable Output> excludeResourceRules;
/**
* @return ExcludeResourceRules describes what operations on what resources/subresources the ValidatingAdmissionPolicy should not care about. The exclude rules take precedence over include rules (if a resource matches both, it is excluded)
*
*/
public Optional>> excludeResourceRules() {
return Optional.ofNullable(this.excludeResourceRules);
}
/**
* matchPolicy defines how the "MatchResources" 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 ValidatingAdmissionPolicy.
*
* - 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 ValidatingAdmissionPolicy.
*
* Defaults to "Equivalent"
*
*/
@Import(name="matchPolicy")
private @Nullable Output matchPolicy;
/**
* @return matchPolicy defines how the "MatchResources" 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 ValidatingAdmissionPolicy.
*
* - 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 ValidatingAdmissionPolicy.
*
* Defaults to "Equivalent"
*
*/
public Optional> matchPolicy() {
return Optional.ofNullable(this.matchPolicy);
}
/**
* NamespaceSelector decides whether to run the admission control policy on an object based on whether the namespace for that object matches the selector. If the object itself is a namespace, the matching is performed on object.metadata.labels. If the object is another cluster scoped resource, it never skips the policy.
*
* For example, to run the webhook on any objects whose namespace is not associated with "runlevel" of "0" or "1"; you will set the selector as follows: "namespaceSelector": {
* "matchExpressions": [
* {
* "key": "runlevel",
* "operator": "NotIn",
* "values": [
* "0",
* "1"
* ]
* }
* ]
* }
*
* If instead you want to only run the policy on any objects whose namespace is associated with the "environment" of "prod" or "staging"; you will set the selector as follows: "namespaceSelector": {
* "matchExpressions": [
* {
* "key": "environment",
* "operator": "In",
* "values": [
* "prod",
* "staging"
* ]
* }
* ]
* }
*
* See https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ for more examples of label selectors.
*
* Default to the empty LabelSelector, which matches everything.
*
*/
@Import(name="namespaceSelector")
private @Nullable Output namespaceSelector;
/**
* @return NamespaceSelector decides whether to run the admission control policy on an object based on whether the namespace for that object matches the selector. If the object itself is a namespace, the matching is performed on object.metadata.labels. If the object is another cluster scoped resource, it never skips the policy.
*
* For example, to run the webhook on any objects whose namespace is not associated with "runlevel" of "0" or "1"; you will set the selector as follows: "namespaceSelector": {
* "matchExpressions": [
* {
* "key": "runlevel",
* "operator": "NotIn",
* "values": [
* "0",
* "1"
* ]
* }
* ]
* }
*
* If instead you want to only run the policy on any objects whose namespace is associated with the "environment" of "prod" or "staging"; you will set the selector as follows: "namespaceSelector": {
* "matchExpressions": [
* {
* "key": "environment",
* "operator": "In",
* "values": [
* "prod",
* "staging"
* ]
* }
* ]
* }
*
* See https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ for more examples of label selectors.
*
* Default to the empty LabelSelector, which matches everything.
*
*/
public Optional> namespaceSelector() {
return Optional.ofNullable(this.namespaceSelector);
}
/**
* ObjectSelector decides whether to run the validation based on if the object has matching labels. objectSelector is evaluated against both the oldObject and newObject that would be sent to the cel validation, and is considered to match if either object matches the selector. A null object (oldObject in the case of create, or newObject in the case of delete) or an object that cannot have labels (like a DeploymentRollback or a PodProxyOptions object) is not considered to match. Use the object selector only if the webhook is opt-in, because end users may skip the admission webhook by setting the labels. Default to the empty LabelSelector, which matches everything.
*
*/
@Import(name="objectSelector")
private @Nullable Output objectSelector;
/**
* @return ObjectSelector decides whether to run the validation based on if the object has matching labels. objectSelector is evaluated against both the oldObject and newObject that would be sent to the cel validation, and is considered to match if either object matches the selector. A null object (oldObject in the case of create, or newObject in the case of delete) or an object that cannot have labels (like a DeploymentRollback or a PodProxyOptions object) is not considered to match. Use the object selector only if the webhook is opt-in, because end users may skip the admission webhook by setting the labels. Default to the empty LabelSelector, which matches everything.
*
*/
public Optional> objectSelector() {
return Optional.ofNullable(this.objectSelector);
}
/**
* ResourceRules describes what operations on what resources/subresources the ValidatingAdmissionPolicy matches. The policy cares about an operation if it matches _any_ Rule.
*
*/
@Import(name="resourceRules")
private @Nullable Output> resourceRules;
/**
* @return ResourceRules describes what operations on what resources/subresources the ValidatingAdmissionPolicy matches. The policy cares about an operation if it matches _any_ Rule.
*
*/
public Optional>> resourceRules() {
return Optional.ofNullable(this.resourceRules);
}
private MatchResourcesPatchArgs() {}
private MatchResourcesPatchArgs(MatchResourcesPatchArgs $) {
this.excludeResourceRules = $.excludeResourceRules;
this.matchPolicy = $.matchPolicy;
this.namespaceSelector = $.namespaceSelector;
this.objectSelector = $.objectSelector;
this.resourceRules = $.resourceRules;
}
public static Builder builder() {
return new Builder();
}
public static Builder builder(MatchResourcesPatchArgs defaults) {
return new Builder(defaults);
}
public static final class Builder {
private MatchResourcesPatchArgs $;
public Builder() {
$ = new MatchResourcesPatchArgs();
}
public Builder(MatchResourcesPatchArgs defaults) {
$ = new MatchResourcesPatchArgs(Objects.requireNonNull(defaults));
}
/**
* @param excludeResourceRules ExcludeResourceRules describes what operations on what resources/subresources the ValidatingAdmissionPolicy should not care about. The exclude rules take precedence over include rules (if a resource matches both, it is excluded)
*
* @return builder
*
*/
public Builder excludeResourceRules(@Nullable Output> excludeResourceRules) {
$.excludeResourceRules = excludeResourceRules;
return this;
}
/**
* @param excludeResourceRules ExcludeResourceRules describes what operations on what resources/subresources the ValidatingAdmissionPolicy should not care about. The exclude rules take precedence over include rules (if a resource matches both, it is excluded)
*
* @return builder
*
*/
public Builder excludeResourceRules(List excludeResourceRules) {
return excludeResourceRules(Output.of(excludeResourceRules));
}
/**
* @param excludeResourceRules ExcludeResourceRules describes what operations on what resources/subresources the ValidatingAdmissionPolicy should not care about. The exclude rules take precedence over include rules (if a resource matches both, it is excluded)
*
* @return builder
*
*/
public Builder excludeResourceRules(NamedRuleWithOperationsPatchArgs... excludeResourceRules) {
return excludeResourceRules(List.of(excludeResourceRules));
}
/**
* @param matchPolicy matchPolicy defines how the "MatchResources" 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 ValidatingAdmissionPolicy.
*
* - 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 ValidatingAdmissionPolicy.
*
* Defaults to "Equivalent"
*
* @return builder
*
*/
public Builder matchPolicy(@Nullable Output matchPolicy) {
$.matchPolicy = matchPolicy;
return this;
}
/**
* @param matchPolicy matchPolicy defines how the "MatchResources" 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 ValidatingAdmissionPolicy.
*
* - 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 ValidatingAdmissionPolicy.
*
* Defaults to "Equivalent"
*
* @return builder
*
*/
public Builder matchPolicy(String matchPolicy) {
return matchPolicy(Output.of(matchPolicy));
}
/**
* @param namespaceSelector NamespaceSelector decides whether to run the admission control policy on an object based on whether the namespace for that object matches the selector. If the object itself is a namespace, the matching is performed on object.metadata.labels. If the object is another cluster scoped resource, it never skips the policy.
*
* For example, to run the webhook on any objects whose namespace is not associated with "runlevel" of "0" or "1"; you will set the selector as follows: "namespaceSelector": {
* "matchExpressions": [
* {
* "key": "runlevel",
* "operator": "NotIn",
* "values": [
* "0",
* "1"
* ]
* }
* ]
* }
*
* If instead you want to only run the policy on any objects whose namespace is associated with the "environment" of "prod" or "staging"; you will set the selector as follows: "namespaceSelector": {
* "matchExpressions": [
* {
* "key": "environment",
* "operator": "In",
* "values": [
* "prod",
* "staging"
* ]
* }
* ]
* }
*
* See https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ for more examples of label selectors.
*
* Default to the empty LabelSelector, which matches everything.
*
* @return builder
*
*/
public Builder namespaceSelector(@Nullable Output namespaceSelector) {
$.namespaceSelector = namespaceSelector;
return this;
}
/**
* @param namespaceSelector NamespaceSelector decides whether to run the admission control policy on an object based on whether the namespace for that object matches the selector. If the object itself is a namespace, the matching is performed on object.metadata.labels. If the object is another cluster scoped resource, it never skips the policy.
*
* For example, to run the webhook on any objects whose namespace is not associated with "runlevel" of "0" or "1"; you will set the selector as follows: "namespaceSelector": {
* "matchExpressions": [
* {
* "key": "runlevel",
* "operator": "NotIn",
* "values": [
* "0",
* "1"
* ]
* }
* ]
* }
*
* If instead you want to only run the policy on any objects whose namespace is associated with the "environment" of "prod" or "staging"; you will set the selector as follows: "namespaceSelector": {
* "matchExpressions": [
* {
* "key": "environment",
* "operator": "In",
* "values": [
* "prod",
* "staging"
* ]
* }
* ]
* }
*
* See https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ for more examples of label selectors.
*
* Default to the empty LabelSelector, which matches everything.
*
* @return builder
*
*/
public Builder namespaceSelector(LabelSelectorPatchArgs namespaceSelector) {
return namespaceSelector(Output.of(namespaceSelector));
}
/**
* @param objectSelector ObjectSelector decides whether to run the validation based on if the object has matching labels. objectSelector is evaluated against both the oldObject and newObject that would be sent to the cel validation, and is considered to match if either object matches the selector. A null object (oldObject in the case of create, or newObject in the case of delete) or an object that cannot have labels (like a DeploymentRollback or a PodProxyOptions object) is not considered to match. Use the object selector only if the webhook is opt-in, because end users may skip the admission webhook by setting the labels. Default to the empty LabelSelector, which matches everything.
*
* @return builder
*
*/
public Builder objectSelector(@Nullable Output objectSelector) {
$.objectSelector = objectSelector;
return this;
}
/**
* @param objectSelector ObjectSelector decides whether to run the validation based on if the object has matching labels. objectSelector is evaluated against both the oldObject and newObject that would be sent to the cel validation, and is considered to match if either object matches the selector. A null object (oldObject in the case of create, or newObject in the case of delete) or an object that cannot have labels (like a DeploymentRollback or a PodProxyOptions object) is not considered to match. Use the object selector only if the webhook is opt-in, because end users may skip the admission webhook by setting the labels. Default to the empty LabelSelector, which matches everything.
*
* @return builder
*
*/
public Builder objectSelector(LabelSelectorPatchArgs objectSelector) {
return objectSelector(Output.of(objectSelector));
}
/**
* @param resourceRules ResourceRules describes what operations on what resources/subresources the ValidatingAdmissionPolicy matches. The policy cares about an operation if it matches _any_ Rule.
*
* @return builder
*
*/
public Builder resourceRules(@Nullable Output> resourceRules) {
$.resourceRules = resourceRules;
return this;
}
/**
* @param resourceRules ResourceRules describes what operations on what resources/subresources the ValidatingAdmissionPolicy matches. The policy cares about an operation if it matches _any_ Rule.
*
* @return builder
*
*/
public Builder resourceRules(List resourceRules) {
return resourceRules(Output.of(resourceRules));
}
/**
* @param resourceRules ResourceRules describes what operations on what resources/subresources the ValidatingAdmissionPolicy matches. The policy cares about an operation if it matches _any_ Rule.
*
* @return builder
*
*/
public Builder resourceRules(NamedRuleWithOperationsPatchArgs... resourceRules) {
return resourceRules(List.of(resourceRules));
}
public MatchResourcesPatchArgs build() {
return $;
}
}
}