Class MatchResources
- java.lang.Object
-
- com.marcnuri.yakc.model.io.k8s.api.admissionregistration.v1beta1.MatchResources
-
- All Implemented Interfaces:
com.marcnuri.yakc.model.Model
public class MatchResources extends java.lang.Object implements com.marcnuri.yakc.model.Model
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)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MatchResources.Builder
-
Constructor Summary
Constructors Constructor Description MatchResources()
MatchResources(java.util.List<NamedRuleWithOperations> excludeResourceRules, java.lang.String matchPolicy, LabelSelector namespaceSelector, LabelSelector objectSelector, java.util.List<NamedRuleWithOperations> resourceRules)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static MatchResources.Builder
builder()
protected boolean
canEqual(java.lang.Object other)
boolean
equals(java.lang.Object o)
java.util.List<NamedRuleWithOperations>
getExcludeResourceRules()
ExcludeResourceRules describes what operations on what resources/subresources the ValidatingAdmissionPolicy should not care about.java.lang.String
getMatchPolicy()
matchPolicy defines how the "MatchResources" list is used to match incoming requests.LabelSelector
getNamespaceSelector()
LabelSelector
getObjectSelector()
java.util.List<NamedRuleWithOperations>
getResourceRules()
ResourceRules describes what operations on what resources/subresources the ValidatingAdmissionPolicy matches.int
hashCode()
void
setExcludeResourceRules(java.util.List<NamedRuleWithOperations> excludeResourceRules)
ExcludeResourceRules describes what operations on what resources/subresources the ValidatingAdmissionPolicy should not care about.void
setMatchPolicy(java.lang.String matchPolicy)
matchPolicy defines how the "MatchResources" list is used to match incoming requests.void
setNamespaceSelector(LabelSelector namespaceSelector)
void
setObjectSelector(LabelSelector objectSelector)
void
setResourceRules(java.util.List<NamedRuleWithOperations> resourceRules)
ResourceRules describes what operations on what resources/subresources the ValidatingAdmissionPolicy matches.MatchResources.Builder
toBuilder()
java.lang.String
toString()
-
-
-
Constructor Detail
-
MatchResources
public MatchResources(java.util.List<NamedRuleWithOperations> excludeResourceRules, java.lang.String matchPolicy, LabelSelector namespaceSelector, LabelSelector objectSelector, java.util.List<NamedRuleWithOperations> resourceRules)
-
MatchResources
public MatchResources()
-
-
Method Detail
-
builder
public static MatchResources.Builder builder()
-
toBuilder
public MatchResources.Builder toBuilder()
-
getExcludeResourceRules
public java.util.List<NamedRuleWithOperations> getExcludeResourceRules()
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)
-
getMatchPolicy
public java.lang.String getMatchPolicy()
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"
-
getNamespaceSelector
public LabelSelector getNamespaceSelector()
-
getObjectSelector
public LabelSelector getObjectSelector()
-
getResourceRules
public java.util.List<NamedRuleWithOperations> getResourceRules()
ResourceRules describes what operations on what resources/subresources the ValidatingAdmissionPolicy matches. The policy cares about an operation if it matches _any_ Rule.
-
setExcludeResourceRules
public void setExcludeResourceRules(java.util.List<NamedRuleWithOperations> 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)
-
setMatchPolicy
public void setMatchPolicy(java.lang.String 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"
-
setNamespaceSelector
public void setNamespaceSelector(LabelSelector namespaceSelector)
-
setObjectSelector
public void setObjectSelector(LabelSelector objectSelector)
-
setResourceRules
public void setResourceRules(java.util.List<NamedRuleWithOperations> resourceRules)
ResourceRules describes what operations on what resources/subresources the ValidatingAdmissionPolicy matches. The policy cares about an operation if it matches _any_ Rule.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
canEqual
protected boolean canEqual(java.lang.Object other)
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-