Skip to content

Commit

Permalink
derive the Default trait for all APIs
Browse files Browse the repository at this point in the history
Update the kopium command in `update.sh` so that all APIs auto-dervie
the Default trait.

Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
  • Loading branch information
aryan9600 committed Mar 10, 2024
1 parent eb078e5 commit e5148f9
Show file tree
Hide file tree
Showing 13 changed files with 185 additions and 185 deletions.
8 changes: 4 additions & 4 deletions 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 -Af -
// kopium command: kopium --schema=derived --derive=JsonSchema --derive=Default --docs -f -
// kopium version: 0.17.0

use kube::CustomResource;
Expand All @@ -8,7 +8,7 @@ use serde::{Serialize, Deserialize};
use k8s_openapi::apimachinery::pkg::apis::meta::v1::Condition;

/// Spec defines the desired state of GatewayClass.
#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, JsonSchema)]
#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, JsonSchema, Default)]
#[kube(group = "gateway.networking.k8s.io", version = "v1", kind = "GatewayClass", plural = "gatewayclasses")]
#[kube(status = "GatewayClassStatus")]
pub struct GatewayClassSpec {
Expand Down Expand Up @@ -62,7 +62,7 @@ pub struct GatewayClassSpec {
///
///
/// Support: Implementation-specific
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema)]
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default)]
pub struct GatewayClassParametersRef {
/// Group is the group of the referent.
pub group: String,
Expand All @@ -82,7 +82,7 @@ pub struct GatewayClassParametersRef {
///
/// Implementations MUST populate status on all GatewayClass resources which
/// specify their controller name.
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema)]
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default)]
pub struct GatewayClassStatus {
/// Conditions is the current status from the controller for
/// this GatewayClass.
Expand Down
32 changes: 16 additions & 16 deletions 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 -Af -
// kopium command: kopium --schema=derived --derive=JsonSchema --derive=Default --docs -f -
// kopium version: 0.17.0

use kube::CustomResource;
Expand All @@ -9,7 +9,7 @@ use std::collections::BTreeMap;
use k8s_openapi::apimachinery::pkg::apis::meta::v1::Condition;

/// Spec defines the desired state of Gateway.
#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, JsonSchema)]
#[derive(CustomResource, Serialize, Deserialize, Clone, Debug, JsonSchema, Default)]
#[kube(group = "gateway.networking.k8s.io", version = "v1", kind = "Gateway", plural = "gateways")]
#[kube(namespaced)]
#[kube(status = "GatewayStatus")]
Expand Down Expand Up @@ -204,7 +204,7 @@ pub struct GatewaySpec {
}

/// GatewayAddress describes an address that can be bound to a Gateway.
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema)]
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default)]
pub struct GatewayAddresses {
/// Type of the address.
#[serde(default, skip_serializing_if = "Option::is_none", rename = "type")]
Expand All @@ -224,7 +224,7 @@ pub struct GatewayAddresses {
///
///
///
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema)]
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default)]
pub struct GatewayInfrastructure {
/// Annotations that SHOULD be applied to any resources created in response to this Gateway.
///
Expand Down Expand Up @@ -256,7 +256,7 @@ pub struct GatewayInfrastructure {

/// Listener embodies the concept of a logical endpoint where a Gateway accepts
/// network connections.
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema)]
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default)]
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 @@ -384,7 +384,7 @@ pub struct GatewayListeners {
///
///
/// Support: Core
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema)]
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default)]
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 @@ -411,7 +411,7 @@ pub struct GatewayListenersAllowedRoutes {
}

/// RouteGroupKind indicates the group and kind of a Route resource.
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema)]
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default)]
pub struct GatewayListenersAllowedRoutesKinds {
/// Group is the group of the Route.
#[serde(default, skip_serializing_if = "Option::is_none")]
Expand All @@ -425,7 +425,7 @@ pub struct GatewayListenersAllowedRoutesKinds {
///
///
/// Support: Core
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema)]
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default)]
pub struct GatewayListenersAllowedRoutesNamespaces {
/// From indicates where Routes will be selected for this Gateway. Possible
/// values are:
Expand Down Expand Up @@ -468,7 +468,7 @@ pub enum GatewayListenersAllowedRoutesNamespacesFrom {
///
///
/// Support: Core
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema)]
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default)]
pub struct GatewayListenersAllowedRoutesNamespacesSelector {
/// matchExpressions is a list of label selector requirements. The requirements are ANDed.
#[serde(default, skip_serializing_if = "Option::is_none", rename = "matchExpressions")]
Expand All @@ -482,7 +482,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)]
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default)]
pub struct GatewayListenersAllowedRoutesNamespacesSelectorMatchExpressions {
/// key is the label key that the selector applies to.
pub key: String,
Expand Down Expand Up @@ -511,7 +511,7 @@ pub struct GatewayListenersAllowedRoutesNamespacesSelectorMatchExpressions {
///
///
/// Support: Core
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema)]
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default)]
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 @@ -589,7 +589,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)]
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default)]
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 @@ -636,7 +636,7 @@ pub enum GatewayListenersTlsMode {
}

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

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

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

/// RouteGroupKind indicates the group and kind of a Route resource.
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema)]
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema, Default)]
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 e5148f9

Please sign in to comment.