k8s_crds_gateway_api/referencegrants.rs
1// WARNING: generated by kopium - manual changes will be overwritten
2// kopium command: kopium -f referencegrants.yml --schema=derived --docs -b
3// kopium version: 0.16.2
4
5use kube_derive::CustomResource;
6#[cfg(feature = "schemars")]
7use schemars::JsonSchema;
8use serde::{Deserialize, Serialize};
9#[cfg(feature = "builder")]
10use typed_builder::TypedBuilder;
11
12/// Spec defines the desired state of ReferenceGrant.
13#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, PartialEq, Default)]
14#[cfg_attr(feature = "builder", derive(TypedBuilder))]
15#[cfg_attr(feature = "schemars", derive(JsonSchema))]
16#[cfg_attr(not(feature = "schemars"), kube(schema = "disabled"))]
17#[kube(
18 group = "gateway.networking.k8s.io",
19 version = "v1beta1",
20 kind = "ReferenceGrant",
21 plural = "referencegrants"
22)]
23#[kube(namespaced)]
24pub struct ReferenceGrantSpec {
25 /// From describes the trusted namespaces and kinds that can reference the resources described in "To". Each entry in this list MUST be considered to be an additional place that references can be valid from, or to put this another way, entries MUST be combined using OR.
26 /// Support: Core
27 #[cfg_attr(feature = "builder", builder(default))]
28 pub from: Vec<ReferenceGrantFrom>,
29 /// To describes the resources that may be referenced by the resources described in "From". Each entry in this list MUST be considered to be an additional place that references can be valid to, or to put this another way, entries MUST be combined using OR.
30 /// Support: Core
31 #[cfg_attr(feature = "builder", builder(default))]
32 pub to: Vec<ReferenceGrantTo>,
33}
34
35/// ReferenceGrantFrom describes trusted namespaces and kinds.
36#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Default)]
37#[cfg_attr(feature = "builder", derive(TypedBuilder))]
38#[cfg_attr(feature = "schemars", derive(JsonSchema))]
39pub struct ReferenceGrantFrom {
40 /// Group is the group of the referent. When empty, the Kubernetes core API group is inferred.
41 /// Support: Core
42 pub group: String,
43 /// Kind is the kind of the referent. Although implementations may support additional resources, the following types are part of the "Core" support level for this field.
44 /// When used to permit a SecretObjectReference:
45 /// * Gateway
46 /// When used to permit a BackendObjectReference:
47 /// * GRPCRoute * HTTPRoute * TCPRoute * TLSRoute * UDPRoute
48 pub kind: String,
49 /// Namespace is the namespace of the referent.
50 /// Support: Core
51 pub namespace: String,
52}
53
54/// ReferenceGrantTo describes what Kinds are allowed as targets of the references.
55#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Default)]
56#[cfg_attr(feature = "builder", derive(TypedBuilder))]
57#[cfg_attr(feature = "schemars", derive(JsonSchema))]
58pub struct ReferenceGrantTo {
59 /// Group is the group of the referent. When empty, the Kubernetes core API group is inferred.
60 /// Support: Core
61 pub group: String,
62 /// Kind is the kind of the referent. Although implementations may support additional resources, the following types are part of the "Core" support level for this field:
63 /// * Secret when used to permit a SecretObjectReference * Service when used to permit a BackendObjectReference
64 pub kind: String,
65 /// Name is the name of the referent. When unspecified, this policy refers to all resources of the specified Group and Kind in the local namespace.
66 #[serde(default, skip_serializing_if = "Option::is_none")]
67 #[cfg_attr(feature = "builder", builder(default, setter(strip_option)))]
68 pub name: Option<String>,
69}