#[non_exhaustive]pub struct AdmissionRule {
pub evaluation_mode: EvaluationMode,
pub require_attestations_by: Vec<String>,
pub enforcement_mode: EnforcementMode,
/* private fields */
}
Expand description
An admission rule specifies either that all container images used in a pod creation request must be attested to by one or more attestors, that all pod creations will be allowed, or that all pod creations will be denied.
Images matching an admission allowlist pattern are exempted from admission rules and will never block a pod creation.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.evaluation_mode: EvaluationMode
Required. How this admission rule will be evaluated.
require_attestations_by: Vec<String>
Optional. The resource names of the attestors that must attest to
a container image, in the format projects/*/attestors/*
. Each
attestor must exist before a policy can reference it. To add an attestor
to a policy the principal issuing the policy change request must be able
to read the attestor resource.
Note: this field must be non-empty when the evaluation_mode field specifies REQUIRE_ATTESTATION, otherwise it must be empty.
enforcement_mode: EnforcementMode
Required. The action when a pod creation is denied by the admission rule.
Implementations§
Source§impl AdmissionRule
impl AdmissionRule
pub fn new() -> Self
Sourcepub fn set_evaluation_mode<T: Into<EvaluationMode>>(self, v: T) -> Self
pub fn set_evaluation_mode<T: Into<EvaluationMode>>(self, v: T) -> Self
Sets the value of evaluation_mode.
Sourcepub fn set_require_attestations_by<T, V>(self, v: T) -> Self
pub fn set_require_attestations_by<T, V>(self, v: T) -> Self
Sets the value of require_attestations_by.
Sourcepub fn set_enforcement_mode<T: Into<EnforcementMode>>(self, v: T) -> Self
pub fn set_enforcement_mode<T: Into<EnforcementMode>>(self, v: T) -> Self
Sets the value of enforcement_mode.
Trait Implementations§
Source§impl Clone for AdmissionRule
impl Clone for AdmissionRule
Source§fn clone(&self) -> AdmissionRule
fn clone(&self) -> AdmissionRule
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more