k8s_gateway_api/
object_reference.rs

1use crate::*;
2
3/// LocalObjectReference identifies an API object within the namespace of the
4/// referrer.
5/// The API object must be valid in the cluster; the Group and Kind must
6/// be registered in the cluster for this reference to be valid.
7///
8/// References to objects with invalid Group and Kind are not valid, and must
9/// be rejected by the implementation, with appropriate Conditions set
10/// on the containing object.
11#[derive(
12    Clone, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize, schemars::JsonSchema,
13)]
14pub struct LocalObjectReference {
15    /// Group is the group of the referent. For example, "networking.k8s.io".
16    /// When unspecified (empty string), core API group is inferred.
17    pub group: Group,
18
19    /// Kind is kind of the referent. For example "HTTPRoute" or "Service".
20    pub kind: Kind,
21
22    /// Name is the name of the referent.
23    pub name: ObjectName,
24}
25
26/// SecretObjectReference identifies an API object including its namespace,
27/// defaulting to Secret.
28///
29/// The API object must be valid in the cluster; the Group and Kind must
30/// be registered in the cluster for this reference to be valid.
31///
32/// References to objects with invalid Group and Kind are not valid, and must
33/// be rejected by the implementation, with appropriate Conditions set
34/// on the containing object.
35#[derive(
36    Clone, Debug, Default, Eq, PartialEq, serde::Deserialize, serde::Serialize, schemars::JsonSchema,
37)]
38pub struct SecretObjectReference {
39    /// Group is the group of the referent. For example, "networking.k8s.io".
40    /// When unspecified (empty string), core API group is inferred.
41    pub group: Option<Group>,
42
43    /// Kind is kind of the referent. For example "HTTPRoute" or "Service".
44    pub kind: Option<Kind>,
45
46    /// Name is the name of the referent.
47    pub name: ObjectName,
48
49    /// Namespace is the namespace of the backend. When unspecified, the local
50    /// namespace is inferred.
51    ///
52    /// Note that when a namespace is specified, a ReferencePolicy object
53    /// is required in the referent namespace to allow that namespace's
54    /// owner to accept the reference. See the ReferencePolicy documentation
55    /// for details.
56    ///
57    /// Support: Core
58    pub namespace: Option<Namespace>,
59}
60
61/// BackendObjectReference defines how an ObjectReference that is
62/// specific to BackendRef. It includes a few additional fields and features
63/// than a regular ObjectReference.
64///
65/// Note that when a namespace is specified, a ReferencePolicy object
66/// is required in the referent namespace to allow that namespace's
67/// owner to accept the reference. See the ReferencePolicy documentation
68/// for details.
69///
70/// The API object must be valid in the cluster; the Group and Kind must
71/// be registered in the cluster for this reference to be valid.
72///
73/// References to objects with invalid Group and Kind are not valid, and must
74/// be rejected by the implementation, with appropriate Conditions set
75/// on the containing object.
76#[derive(
77    Clone, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize, schemars::JsonSchema,
78)]
79pub struct BackendObjectReference {
80    /// Group is the group of the referent. For example, "networking.k8s.io".
81    /// When unspecified (empty string), core API group is inferred.
82    pub group: Option<Group>,
83
84    /// Kind is kind of the referent. For example "HTTPRoute" or "Service".
85    /// Defaults to "Service" when not specified.
86    pub kind: Option<Kind>,
87
88    /// Name is the name of the referent.
89    pub name: ObjectName,
90
91    /// Namespace is the namespace of the backend. When unspecified, the local
92    /// namespace is inferred.
93    ///
94    /// Note that when a namespace is specified, a ReferencePolicy object
95    /// is required in the referent namespace to allow that namespace's
96    /// owner to accept the reference. See the ReferencePolicy documentation
97    /// for details.
98    ///
99    /// Support: Core
100    pub namespace: Option<Namespace>,
101
102    /// Port specifies the destination port number to use for this resource.
103    /// Port is required when the referent is a Kubernetes Service. For other
104    /// resources, destination port might be derived from the referent resource
105    /// or this field.
106    pub port: Option<PortNumber>,
107}