Class MutatingAdmissionPolicySpec
- java.lang.Object
-
- io.fabric8.kubernetes.api.model.admissionregistration.v1beta1.MutatingAdmissionPolicySpec
-
- All Implemented Interfaces:
io.fabric8.kubernetes.api.builder.Editable<MutatingAdmissionPolicySpecBuilder>,io.fabric8.kubernetes.api.model.KubernetesResource,Serializable
@Generated("io.fabric8.kubernetes.schema.generator.model.ModelGenerator") public class MutatingAdmissionPolicySpec extends Object implements io.fabric8.kubernetes.api.builder.Editable<MutatingAdmissionPolicySpecBuilder>, io.fabric8.kubernetes.api.model.KubernetesResource
MutatingAdmissionPolicySpec is the specification of the desired behavior of the admission policy.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description MutatingAdmissionPolicySpec()No args constructor for use in serializationMutatingAdmissionPolicySpec(String failurePolicy, List<MatchCondition> matchConditions, MatchResources matchConstraints, List<Mutation> mutations, ParamKind paramKind, String reinvocationPolicy, List<Variable> variables)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MutatingAdmissionPolicySpecBuilderedit()Map<String,Object>getAdditionalProperties()StringgetFailurePolicy()failurePolicy defines how to handle failures for the admission policy.List<MatchCondition>getMatchConditions()matchConditions is a list of conditions that must be met for a request to be validated.MatchResourcesgetMatchConstraints()MutatingAdmissionPolicySpec is the specification of the desired behavior of the admission policy.List<Mutation>getMutations()mutations contain operations to perform on matching objects. mutations may not be empty; a minimum of one mutation is required. mutations are evaluated in order, and are reinvoked according to the reinvocationPolicy.ParamKindgetParamKind()MutatingAdmissionPolicySpec is the specification of the desired behavior of the admission policy.StringgetReinvocationPolicy()reinvocationPolicy indicates whether mutations may be called multiple times per MutatingAdmissionPolicyBinding as part of a single admission evaluation.List<Variable>getVariables()variables contain definitions of variables that can be used in composition of other expressions.voidsetAdditionalProperties(Map<String,Object> additionalProperties)voidsetAdditionalProperty(String name, Object value)voidsetFailurePolicy(String failurePolicy)failurePolicy defines how to handle failures for the admission policy.voidsetMatchConditions(List<MatchCondition> matchConditions)matchConditions is a list of conditions that must be met for a request to be validated.voidsetMatchConstraints(MatchResources matchConstraints)MutatingAdmissionPolicySpec is the specification of the desired behavior of the admission policy.voidsetMutations(List<Mutation> mutations)mutations contain operations to perform on matching objects. mutations may not be empty; a minimum of one mutation is required. mutations are evaluated in order, and are reinvoked according to the reinvocationPolicy.voidsetParamKind(ParamKind paramKind)MutatingAdmissionPolicySpec is the specification of the desired behavior of the admission policy.voidsetReinvocationPolicy(String reinvocationPolicy)reinvocationPolicy indicates whether mutations may be called multiple times per MutatingAdmissionPolicyBinding as part of a single admission evaluation.voidsetVariables(List<Variable> variables)variables contain definitions of variables that can be used in composition of other expressions.MutatingAdmissionPolicySpecBuildertoBuilder()
-
-
-
Constructor Detail
-
MutatingAdmissionPolicySpec
public MutatingAdmissionPolicySpec()
No args constructor for use in serialization
-
MutatingAdmissionPolicySpec
public MutatingAdmissionPolicySpec(String failurePolicy, List<MatchCondition> matchConditions, MatchResources matchConstraints, List<Mutation> mutations, ParamKind paramKind, String reinvocationPolicy, List<Variable> variables)
-
-
Method Detail
-
getFailurePolicy
public String getFailurePolicy()
failurePolicy defines how to handle failures for the admission policy. Failures can occur from CEL expression parse errors, type check errors, runtime errors and invalid or mis-configured policy definitions or bindings.A policy is invalid if paramKind refers to a non-existent Kind. A binding is invalid if paramRef.name refers to a non-existent resource.
failurePolicy does not define how validations that evaluate to false are handled.
Allowed values are Ignore or Fail. Defaults to Fail.
-
setFailurePolicy
public void setFailurePolicy(String failurePolicy)
failurePolicy defines how to handle failures for the admission policy. Failures can occur from CEL expression parse errors, type check errors, runtime errors and invalid or mis-configured policy definitions or bindings.A policy is invalid if paramKind refers to a non-existent Kind. A binding is invalid if paramRef.name refers to a non-existent resource.
failurePolicy does not define how validations that evaluate to false are handled.
Allowed values are Ignore or Fail. Defaults to Fail.
-
getMatchConditions
public List<MatchCondition> getMatchConditions()
matchConditions is a list of conditions that must be met for a request to be validated. Match conditions filter requests that have already been matched by the matchConstraints. An empty list of matchConditions matches all requests. There are a maximum of 64 match conditions allowed.If a parameter object is provided, it can be accessed via the `params` handle in the same manner as validation expressions.
The exact matching logic is (in order):
1. If ANY matchCondition evaluates to FALSE, the policy is skipped.
2. If ALL matchConditions evaluate to TRUE, the policy is evaluated.
3. If any matchCondition evaluates to an error (but none are FALSE):
- If failurePolicy=Fail, reject the request
- If failurePolicy=Ignore, the policy is skipped
-
setMatchConditions
public void setMatchConditions(List<MatchCondition> matchConditions)
matchConditions is a list of conditions that must be met for a request to be validated. Match conditions filter requests that have already been matched by the matchConstraints. An empty list of matchConditions matches all requests. There are a maximum of 64 match conditions allowed.If a parameter object is provided, it can be accessed via the `params` handle in the same manner as validation expressions.
The exact matching logic is (in order):
1. If ANY matchCondition evaluates to FALSE, the policy is skipped.
2. If ALL matchConditions evaluate to TRUE, the policy is evaluated.
3. If any matchCondition evaluates to an error (but none are FALSE):
- If failurePolicy=Fail, reject the request
- If failurePolicy=Ignore, the policy is skipped
-
getMatchConstraints
public MatchResources getMatchConstraints()
MutatingAdmissionPolicySpec is the specification of the desired behavior of the admission policy.
-
setMatchConstraints
public void setMatchConstraints(MatchResources matchConstraints)
MutatingAdmissionPolicySpec is the specification of the desired behavior of the admission policy.
-
getMutations
public List<Mutation> getMutations()
mutations contain operations to perform on matching objects. mutations may not be empty; a minimum of one mutation is required. mutations are evaluated in order, and are reinvoked according to the reinvocationPolicy. The mutations of a policy are invoked for each binding of this policy and reinvocation of mutations occurs on a per binding basis.
-
setMutations
public void setMutations(List<Mutation> mutations)
mutations contain operations to perform on matching objects. mutations may not be empty; a minimum of one mutation is required. mutations are evaluated in order, and are reinvoked according to the reinvocationPolicy. The mutations of a policy are invoked for each binding of this policy and reinvocation of mutations occurs on a per binding basis.
-
getParamKind
public ParamKind getParamKind()
MutatingAdmissionPolicySpec is the specification of the desired behavior of the admission policy.
-
setParamKind
public void setParamKind(ParamKind paramKind)
MutatingAdmissionPolicySpec is the specification of the desired behavior of the admission policy.
-
getReinvocationPolicy
public String getReinvocationPolicy()
reinvocationPolicy indicates whether mutations may be called multiple times per MutatingAdmissionPolicyBinding as part of a single admission evaluation. Allowed values are "Never" and "IfNeeded".Never: These mutations will not be called more than once per binding in a single admission evaluation.
IfNeeded: These mutations may be invoked more than once per binding for a single admission request and there is no guarantee of order with respect to other admission plugins, admission webhooks, bindings of this policy and admission policies. Mutations are only reinvoked when mutations change the object after this mutation is invoked. Required.
-
setReinvocationPolicy
public void setReinvocationPolicy(String reinvocationPolicy)
reinvocationPolicy indicates whether mutations may be called multiple times per MutatingAdmissionPolicyBinding as part of a single admission evaluation. Allowed values are "Never" and "IfNeeded".Never: These mutations will not be called more than once per binding in a single admission evaluation.
IfNeeded: These mutations may be invoked more than once per binding for a single admission request and there is no guarantee of order with respect to other admission plugins, admission webhooks, bindings of this policy and admission policies. Mutations are only reinvoked when mutations change the object after this mutation is invoked. Required.
-
getVariables
public List<Variable> getVariables()
variables contain definitions of variables that can be used in composition of other expressions. Each variable is defined as a named CEL expression. The variables defined here will be available under `variables` in other expressions of the policy except matchConditions because matchConditions are evaluated before the rest of the policy.The expression of a variable can refer to other variables defined earlier in the list but not those after. Thus, variables must be sorted by the order of first appearance and acyclic.
-
setVariables
public void setVariables(List<Variable> variables)
variables contain definitions of variables that can be used in composition of other expressions. Each variable is defined as a named CEL expression. The variables defined here will be available under `variables` in other expressions of the policy except matchConditions because matchConditions are evaluated before the rest of the policy.The expression of a variable can refer to other variables defined earlier in the list but not those after. Thus, variables must be sorted by the order of first appearance and acyclic.
-
edit
public MutatingAdmissionPolicySpecBuilder edit()
- Specified by:
editin interfaceio.fabric8.kubernetes.api.builder.Editable<MutatingAdmissionPolicySpecBuilder>
-
toBuilder
public MutatingAdmissionPolicySpecBuilder toBuilder()
-
-