Skip to content

Commit

Permalink
add a PartialEq implementation to generated types
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Linsay <[email protected]>
  • Loading branch information
blinsay committed Sep 4, 2024
1 parent 891ca15 commit caa21a7
Show file tree
Hide file tree
Showing 16 changed files with 254 additions and 240 deletions.
8 changes: 4 additions & 4 deletions gateway-api/src/apis/experimental/constants.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// WARNING: generated file - manual changes will be overriden

#[derive(Debug)]
#[derive(Debug, PartialEq, Eq)]
pub enum GatewayConditionType {
Programmed,
Accepted,
Expand All @@ -13,7 +13,7 @@ impl std::fmt::Display for GatewayConditionType {
}
}

#[derive(Debug)]
#[derive(Debug, PartialEq, Eq)]
pub enum GatewayConditionReason {
Programmed,
Invalid,
Expand All @@ -35,7 +35,7 @@ impl std::fmt::Display for GatewayConditionReason {
}
}

#[derive(Debug)]
#[derive(Debug, PartialEq, Eq)]
pub enum ListenerConditionType {
Conflicted,
Accepted,
Expand All @@ -50,7 +50,7 @@ impl std::fmt::Display for ListenerConditionType {
}
}

#[derive(Debug)]
#[derive(Debug, PartialEq, Eq)]
pub enum ListenerConditionReason {
HostnameConflict,
ProtocolConflict,
Expand Down
9 changes: 5 additions & 4 deletions gateway-api/src/apis/experimental/gatewayclasses.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// WARNING: generated by kopium - manual changes will be overwritten
// kopium command: kopium --schema=derived --derive=JsonSchema --derive=Default --docs -f -
// kopium command: kopium --schema=derived --derive=JsonSchema --derive=Default --derive=PartialEq --docs -f -
// kopium version: 0.20.1

#[allow(unused_imports)]
Expand All @@ -12,7 +12,7 @@ mod prelude {
use self::prelude::*;

/// Spec defines the desired state of GatewayClass.
#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, JsonSchema, Default)]
#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
#[kube(
group = "gateway.networking.k8s.io",
version = "v1",
Expand All @@ -21,6 +21,7 @@ use self::prelude::*;
)]
#[kube(status = "GatewayClassStatus")]
#[kube(derive = "Default")]
#[kube(derive = "PartialEq")]
pub struct GatewayClassSpec {
/// ControllerName is the name of the controller that is managing Gateways of
/// this class. The value of this field MUST be a domain prefixed path.
Expand Down Expand Up @@ -86,7 +87,7 @@ pub struct GatewayClassSpec {
///
///
/// Support: Implementation-specific
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default)]
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
pub struct GatewayClassParametersRef {
/// Group is the group of the referent.
pub group: String,
Expand All @@ -106,7 +107,7 @@ pub struct GatewayClassParametersRef {
///
/// Implementations MUST populate status on all GatewayClass resources which
/// specify their controller name.
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default)]
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
pub struct GatewayClassStatus {
/// Conditions is the current status from the controller for
/// this GatewayClass.
Expand Down
43 changes: 22 additions & 21 deletions gateway-api/src/apis/experimental/gateways.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// WARNING: generated by kopium - manual changes will be overwritten
// kopium command: kopium --schema=derived --derive=JsonSchema --derive=Default --docs -f -
// kopium command: kopium --schema=derived --derive=JsonSchema --derive=Default --derive=PartialEq --docs -f -
// kopium version: 0.20.1

#[allow(unused_imports)]
Expand All @@ -13,7 +13,7 @@ mod prelude {
use self::prelude::*;

/// Spec defines the desired state of Gateway.
#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, JsonSchema, Default)]
#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
#[kube(
group = "gateway.networking.k8s.io",
version = "v1",
Expand All @@ -23,6 +23,7 @@ use self::prelude::*;
#[kube(namespaced)]
#[kube(status = "GatewayStatus")]
#[kube(derive = "Default")]
#[kube(derive = "PartialEq")]
pub struct GatewaySpec {
/// Addresses requested for this Gateway. This is optional and behavior can
/// depend on the implementation. If a value is set in the spec and the
Expand Down Expand Up @@ -214,7 +215,7 @@ pub struct GatewaySpec {
}

/// GatewayAddress describes an address that can be bound to a Gateway.
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default)]
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
pub struct GatewayAddresses {
/// Type of the address.
#[serde(default, skip_serializing_if = "Option::is_none", rename = "type")]
Expand All @@ -234,7 +235,7 @@ pub struct GatewayAddresses {
///
///
///
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default)]
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
pub struct GatewayInfrastructure {
/// Annotations that SHOULD be applied to any resources created in response to this Gateway.
///
Expand Down Expand Up @@ -298,7 +299,7 @@ pub struct GatewayInfrastructure {
///
///
/// Support: Implementation-specific
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default)]
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
pub struct GatewayInfrastructureParametersRef {
/// Group is the group of the referent.
pub group: String,
Expand All @@ -310,7 +311,7 @@ pub struct GatewayInfrastructureParametersRef {

/// Listener embodies the concept of a logical endpoint where a Gateway accepts
/// network connections.
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default)]
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
pub struct GatewayListeners {
/// AllowedRoutes defines the types of routes that MAY be attached to a
/// Listener and the trusted namespaces where those Route resources MAY be
Expand Down Expand Up @@ -442,7 +443,7 @@ pub struct GatewayListeners {
///
///
/// Support: Core
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default)]
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
pub struct GatewayListenersAllowedRoutes {
/// Kinds specifies the groups and kinds of Routes that are allowed to bind
/// to this Gateway Listener. When unspecified or empty, the kinds of Routes
Expand All @@ -469,7 +470,7 @@ pub struct GatewayListenersAllowedRoutes {
}

/// RouteGroupKind indicates the group and kind of a Route resource.
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default)]
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
pub struct GatewayListenersAllowedRoutesKinds {
/// Group is the group of the Route.
#[serde(default, skip_serializing_if = "Option::is_none")]
Expand All @@ -483,7 +484,7 @@ pub struct GatewayListenersAllowedRoutesKinds {
///
///
/// Support: Core
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default)]
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
pub struct GatewayListenersAllowedRoutesNamespaces {
/// From indicates where Routes will be selected for this Gateway. Possible
/// values are:
Expand Down Expand Up @@ -513,7 +514,7 @@ pub struct GatewayListenersAllowedRoutesNamespaces {
///
///
/// Support: Core
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema)]
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, PartialEq)]
pub enum GatewayListenersAllowedRoutesNamespacesFrom {
All,
Selector,
Expand All @@ -526,7 +527,7 @@ pub enum GatewayListenersAllowedRoutesNamespacesFrom {
///
///
/// Support: Core
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default)]
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
pub struct GatewayListenersAllowedRoutesNamespacesSelector {
/// matchExpressions is a list of label selector requirements. The requirements are ANDed.
#[serde(
Expand All @@ -549,7 +550,7 @@ pub struct GatewayListenersAllowedRoutesNamespacesSelector {

/// A label selector requirement is a selector that contains values, a key, and an operator that
/// relates the key and values.
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default)]
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
pub struct GatewayListenersAllowedRoutesNamespacesSelectorMatchExpressions {
/// key is the label key that the selector applies to.
pub key: String,
Expand Down Expand Up @@ -578,7 +579,7 @@ pub struct GatewayListenersAllowedRoutesNamespacesSelectorMatchExpressions {
///
///
/// Support: Core
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default)]
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
pub struct GatewayListenersTls {
/// CertificateRefs contains a series of references to Kubernetes objects that
/// contains TLS certificates and private keys. These certificates are used to
Expand Down Expand Up @@ -677,7 +678,7 @@ pub struct GatewayListenersTls {
/// References to objects with invalid Group and Kind are not valid, and must
/// be rejected by the implementation, with appropriate Conditions set
/// on the containing object.
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default)]
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
pub struct GatewayListenersTlsCertificateRefs {
/// Group is the group of the referent. For example, "gateway.networking.k8s.io".
/// When unspecified or empty string, core API group is inferred.
Expand Down Expand Up @@ -714,7 +715,7 @@ pub struct GatewayListenersTlsCertificateRefs {
///
///
///
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default)]
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
pub struct GatewayListenersTlsFrontendValidation {
/// CACertificateRefs contains one or more references to
/// Kubernetes objects that contain TLS certificates of
Expand Down Expand Up @@ -759,7 +760,7 @@ pub struct GatewayListenersTlsFrontendValidation {
/// References to objects with invalid Group and Kind are not valid, and must
/// be rejected by the implementation, with appropriate Conditions set
/// on the containing object.
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default)]
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
pub struct GatewayListenersTlsFrontendValidationCaCertificateRefs {
/// Group is the group of the referent. For example, "gateway.networking.k8s.io".
/// When unspecified or empty string, core API group is inferred.
Expand Down Expand Up @@ -797,14 +798,14 @@ pub struct GatewayListenersTlsFrontendValidationCaCertificateRefs {
///
///
/// Support: Core
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema)]
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, PartialEq)]
pub enum GatewayListenersTlsMode {
Terminate,
Passthrough,
}

/// Status defines the current state of Gateway.
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default)]
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
pub struct GatewayStatus {
/// Addresses lists the network addresses that have been bound to the
/// Gateway.
Expand Down Expand Up @@ -845,7 +846,7 @@ pub struct GatewayStatus {
}

/// GatewayStatusAddress describes a network address that is bound to a Gateway.
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default)]
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
pub struct GatewayStatusAddresses {
/// Type of the address.
#[serde(default, skip_serializing_if = "Option::is_none", rename = "type")]
Expand All @@ -859,7 +860,7 @@ pub struct GatewayStatusAddresses {
}

/// ListenerStatus is the status associated with a Listener.
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default)]
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
pub struct GatewayStatusListeners {
/// AttachedRoutes represents the total number of Routes that have been
/// successfully attached to this Listener.
Expand Down Expand Up @@ -901,7 +902,7 @@ pub struct GatewayStatusListeners {
}

/// RouteGroupKind indicates the group and kind of a Route resource.
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default)]
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default, PartialEq)]
pub struct GatewayStatusListenersSupportedKinds {
/// Group is the group of the Route.
#[serde(default, skip_serializing_if = "Option::is_none")]
Expand Down
Loading

0 comments on commit caa21a7

Please sign in to comment.