From 3a3a02f846983d65938517e9be11e48375c8932c Mon Sep 17 00:00:00 2001 From: Arnavion Date: Sat, 25 Feb 2023 10:45:55 -0800 Subject: [PATCH] Split ObjectMeta into ObjectMeta, ClusterObjectMeta and SubObjectMeta. Ref: #134 --- k8s-openapi-codegen-common/src/lib.rs | 59 +- .../src/templates/mod.rs | 27 +- k8s-openapi-codegen/src/fixups/special.rs | 64 ++ k8s-openapi-codegen/src/supported_version.rs | 1 + .../v1/mutating_webhook_configuration.rs | 2 +- .../v1/validating_webhook_configuration.rs | 2 +- .../v1beta1/mutating_webhook_configuration.rs | 2 +- .../validating_webhook_configuration.rs | 2 +- .../v1alpha1/storage_version.rs | 2 +- .../api/authentication/v1/token_request.rs | 2 +- .../api/authentication/v1/token_review.rs | 2 +- .../authentication/v1beta1/token_review.rs | 2 +- .../v1/self_subject_access_review.rs | 2 +- .../v1/self_subject_rules_review.rs | 2 +- .../authorization/v1/subject_access_review.rs | 2 +- .../v1beta1/self_subject_access_review.rs | 2 +- .../v1beta1/self_subject_rules_review.rs | 2 +- .../v1beta1/subject_access_review.rs | 2 +- src/v1_20/api/autoscaling/v1/scale.rs | 2 +- .../v1/certificate_signing_request.rs | 2 +- .../v1beta1/certificate_signing_request.rs | 2 +- src/v1_20/api/core/v1/component_status.rs | 2 +- src/v1_20/api/core/v1/namespace.rs | 2 +- src/v1_20/api/core/v1/node.rs | 2 +- src/v1_20/api/core/v1/persistent_volume.rs | 2 +- .../api/flowcontrol/v1alpha1/flow_schema.rs | 2 +- .../v1alpha1/priority_level_configuration.rs | 2 +- .../api/flowcontrol/v1beta1/flow_schema.rs | 2 +- .../v1beta1/priority_level_configuration.rs | 2 +- src/v1_20/api/networking/v1/ingress_class.rs | 2 +- .../api/networking/v1beta1/ingress_class.rs | 2 +- src/v1_20/api/node/v1/runtime_class.rs | 2 +- src/v1_20/api/node/v1alpha1/runtime_class.rs | 2 +- src/v1_20/api/node/v1beta1/runtime_class.rs | 2 +- src/v1_20/api/policy/v1beta1/eviction.rs | 2 +- .../api/policy/v1beta1/pod_security_policy.rs | 2 +- src/v1_20/api/rbac/v1/cluster_role.rs | 2 +- src/v1_20/api/rbac/v1/cluster_role_binding.rs | 2 +- src/v1_20/api/rbac/v1alpha1/cluster_role.rs | 2 +- .../api/rbac/v1alpha1/cluster_role_binding.rs | 2 +- src/v1_20/api/rbac/v1beta1/cluster_role.rs | 2 +- .../api/rbac/v1beta1/cluster_role_binding.rs | 2 +- src/v1_20/api/scheduling/v1/priority_class.rs | 2 +- .../api/scheduling/v1alpha1/priority_class.rs | 2 +- .../api/scheduling/v1beta1/priority_class.rs | 2 +- src/v1_20/api/storage/v1/csi_driver.rs | 2 +- src/v1_20/api/storage/v1/csi_node.rs | 2 +- src/v1_20/api/storage/v1/storage_class.rs | 2 +- src/v1_20/api/storage/v1/volume_attachment.rs | 2 +- .../api/storage/v1alpha1/volume_attachment.rs | 2 +- src/v1_20/api/storage/v1beta1/csi_driver.rs | 2 +- src/v1_20/api/storage/v1beta1/csi_node.rs | 2 +- .../api/storage/v1beta1/storage_class.rs | 2 +- .../api/storage/v1beta1/volume_attachment.rs | 2 +- .../v1/custom_resource_definition.rs | 2 +- .../v1beta1/custom_resource_definition.rs | 2 +- .../pkg/apis/meta/v1/cluster_object_meta.rs | 528 +++++++++++++++++ .../apimachinery/pkg/apis/meta/v1/mod.rs | 6 + .../pkg/apis/meta/v1/object_meta.rs | 13 +- .../pkg/apis/meta/v1/sub_object_meta.rs | 555 ++++++++++++++++++ .../apis/apiregistration/v1/api_service.rs | 2 +- .../apiregistration/v1beta1/api_service.rs | 2 +- .../v1/mutating_webhook_configuration.rs | 2 +- .../v1/validating_webhook_configuration.rs | 2 +- .../v1beta1/mutating_webhook_configuration.rs | 2 +- .../validating_webhook_configuration.rs | 2 +- .../v1alpha1/storage_version.rs | 2 +- .../api/authentication/v1/token_request.rs | 2 +- .../api/authentication/v1/token_review.rs | 2 +- .../authentication/v1beta1/token_review.rs | 2 +- .../v1/self_subject_access_review.rs | 2 +- .../v1/self_subject_rules_review.rs | 2 +- .../authorization/v1/subject_access_review.rs | 2 +- .../v1beta1/self_subject_access_review.rs | 2 +- .../v1beta1/self_subject_rules_review.rs | 2 +- .../v1beta1/subject_access_review.rs | 2 +- src/v1_21/api/autoscaling/v1/scale.rs | 2 +- .../v1/certificate_signing_request.rs | 2 +- .../v1beta1/certificate_signing_request.rs | 2 +- src/v1_21/api/core/v1/component_status.rs | 2 +- src/v1_21/api/core/v1/ephemeral_containers.rs | 2 +- src/v1_21/api/core/v1/namespace.rs | 2 +- src/v1_21/api/core/v1/node.rs | 2 +- src/v1_21/api/core/v1/persistent_volume.rs | 2 +- .../api/flowcontrol/v1beta1/flow_schema.rs | 2 +- .../v1beta1/priority_level_configuration.rs | 2 +- src/v1_21/api/networking/v1/ingress_class.rs | 2 +- .../api/networking/v1beta1/ingress_class.rs | 2 +- src/v1_21/api/node/v1/runtime_class.rs | 2 +- src/v1_21/api/node/v1alpha1/runtime_class.rs | 2 +- src/v1_21/api/node/v1beta1/runtime_class.rs | 2 +- src/v1_21/api/policy/v1beta1/eviction.rs | 2 +- .../api/policy/v1beta1/pod_security_policy.rs | 2 +- src/v1_21/api/rbac/v1/cluster_role.rs | 2 +- src/v1_21/api/rbac/v1/cluster_role_binding.rs | 2 +- src/v1_21/api/rbac/v1alpha1/cluster_role.rs | 2 +- .../api/rbac/v1alpha1/cluster_role_binding.rs | 2 +- src/v1_21/api/rbac/v1beta1/cluster_role.rs | 2 +- .../api/rbac/v1beta1/cluster_role_binding.rs | 2 +- src/v1_21/api/scheduling/v1/priority_class.rs | 2 +- .../api/scheduling/v1alpha1/priority_class.rs | 2 +- .../api/scheduling/v1beta1/priority_class.rs | 2 +- src/v1_21/api/storage/v1/csi_driver.rs | 2 +- src/v1_21/api/storage/v1/csi_node.rs | 2 +- src/v1_21/api/storage/v1/storage_class.rs | 2 +- src/v1_21/api/storage/v1/volume_attachment.rs | 2 +- .../api/storage/v1alpha1/volume_attachment.rs | 2 +- src/v1_21/api/storage/v1beta1/csi_driver.rs | 2 +- src/v1_21/api/storage/v1beta1/csi_node.rs | 2 +- .../api/storage/v1beta1/storage_class.rs | 2 +- .../api/storage/v1beta1/volume_attachment.rs | 2 +- .../v1/custom_resource_definition.rs | 2 +- .../v1beta1/custom_resource_definition.rs | 2 +- .../pkg/apis/meta/v1/cluster_object_meta.rs | 528 +++++++++++++++++ .../apimachinery/pkg/apis/meta/v1/mod.rs | 6 + .../pkg/apis/meta/v1/object_meta.rs | 13 +- .../pkg/apis/meta/v1/sub_object_meta.rs | 555 ++++++++++++++++++ .../apis/apiregistration/v1/api_service.rs | 2 +- .../apiregistration/v1beta1/api_service.rs | 2 +- .../v1/mutating_webhook_configuration.rs | 2 +- .../v1/validating_webhook_configuration.rs | 2 +- .../v1alpha1/storage_version.rs | 2 +- .../api/authentication/v1/token_request.rs | 2 +- .../api/authentication/v1/token_review.rs | 2 +- .../v1/self_subject_access_review.rs | 2 +- .../v1/self_subject_rules_review.rs | 2 +- .../authorization/v1/subject_access_review.rs | 2 +- src/v1_22/api/autoscaling/v1/scale.rs | 2 +- .../v1/certificate_signing_request.rs | 2 +- src/v1_22/api/core/v1/component_status.rs | 2 +- src/v1_22/api/core/v1/namespace.rs | 2 +- src/v1_22/api/core/v1/node.rs | 2 +- src/v1_22/api/core/v1/persistent_volume.rs | 2 +- .../api/flowcontrol/v1beta1/flow_schema.rs | 2 +- .../v1beta1/priority_level_configuration.rs | 2 +- src/v1_22/api/networking/v1/ingress_class.rs | 2 +- src/v1_22/api/node/v1/runtime_class.rs | 2 +- src/v1_22/api/node/v1alpha1/runtime_class.rs | 2 +- src/v1_22/api/node/v1beta1/runtime_class.rs | 2 +- src/v1_22/api/policy/v1/eviction.rs | 2 +- .../api/policy/v1beta1/pod_security_policy.rs | 2 +- src/v1_22/api/rbac/v1/cluster_role.rs | 2 +- src/v1_22/api/rbac/v1/cluster_role_binding.rs | 2 +- src/v1_22/api/rbac/v1alpha1/cluster_role.rs | 2 +- .../api/rbac/v1alpha1/cluster_role_binding.rs | 2 +- src/v1_22/api/scheduling/v1/priority_class.rs | 2 +- .../api/scheduling/v1alpha1/priority_class.rs | 2 +- src/v1_22/api/storage/v1/csi_driver.rs | 2 +- src/v1_22/api/storage/v1/csi_node.rs | 2 +- src/v1_22/api/storage/v1/storage_class.rs | 2 +- src/v1_22/api/storage/v1/volume_attachment.rs | 2 +- .../api/storage/v1alpha1/volume_attachment.rs | 2 +- .../v1/custom_resource_definition.rs | 2 +- .../pkg/apis/meta/v1/cluster_object_meta.rs | 528 +++++++++++++++++ .../apimachinery/pkg/apis/meta/v1/mod.rs | 6 + .../pkg/apis/meta/v1/object_meta.rs | 13 +- .../pkg/apis/meta/v1/sub_object_meta.rs | 555 ++++++++++++++++++ .../apis/apiregistration/v1/api_service.rs | 2 +- .../v1/mutating_webhook_configuration.rs | 2 +- .../v1/validating_webhook_configuration.rs | 2 +- .../v1alpha1/storage_version.rs | 2 +- .../api/authentication/v1/token_request.rs | 2 +- .../api/authentication/v1/token_review.rs | 2 +- .../v1/self_subject_access_review.rs | 2 +- .../v1/self_subject_rules_review.rs | 2 +- .../authorization/v1/subject_access_review.rs | 2 +- src/v1_23/api/autoscaling/v1/scale.rs | 2 +- .../v1/certificate_signing_request.rs | 2 +- src/v1_23/api/core/v1/component_status.rs | 2 +- src/v1_23/api/core/v1/namespace.rs | 2 +- src/v1_23/api/core/v1/node.rs | 2 +- src/v1_23/api/core/v1/persistent_volume.rs | 2 +- .../api/flowcontrol/v1beta1/flow_schema.rs | 2 +- .../v1beta1/priority_level_configuration.rs | 2 +- .../api/flowcontrol/v1beta2/flow_schema.rs | 2 +- .../v1beta2/priority_level_configuration.rs | 2 +- src/v1_23/api/networking/v1/ingress_class.rs | 2 +- src/v1_23/api/node/v1/runtime_class.rs | 2 +- src/v1_23/api/node/v1alpha1/runtime_class.rs | 2 +- src/v1_23/api/node/v1beta1/runtime_class.rs | 2 +- src/v1_23/api/policy/v1/eviction.rs | 2 +- .../api/policy/v1beta1/pod_security_policy.rs | 2 +- src/v1_23/api/rbac/v1/cluster_role.rs | 2 +- src/v1_23/api/rbac/v1/cluster_role_binding.rs | 2 +- src/v1_23/api/scheduling/v1/priority_class.rs | 2 +- src/v1_23/api/storage/v1/csi_driver.rs | 2 +- src/v1_23/api/storage/v1/csi_node.rs | 2 +- src/v1_23/api/storage/v1/storage_class.rs | 2 +- src/v1_23/api/storage/v1/volume_attachment.rs | 2 +- .../v1/custom_resource_definition.rs | 2 +- .../pkg/apis/meta/v1/cluster_object_meta.rs | 528 +++++++++++++++++ .../apimachinery/pkg/apis/meta/v1/mod.rs | 6 + .../pkg/apis/meta/v1/object_meta.rs | 13 +- .../pkg/apis/meta/v1/sub_object_meta.rs | 555 ++++++++++++++++++ .../apis/apiregistration/v1/api_service.rs | 2 +- .../v1/mutating_webhook_configuration.rs | 2 +- .../v1/validating_webhook_configuration.rs | 2 +- .../v1alpha1/storage_version.rs | 2 +- .../api/authentication/v1/token_request.rs | 2 +- .../api/authentication/v1/token_review.rs | 2 +- .../v1/self_subject_access_review.rs | 2 +- .../v1/self_subject_rules_review.rs | 2 +- .../authorization/v1/subject_access_review.rs | 2 +- src/v1_24/api/autoscaling/v1/scale.rs | 2 +- .../v1/certificate_signing_request.rs | 2 +- src/v1_24/api/core/v1/component_status.rs | 2 +- src/v1_24/api/core/v1/namespace.rs | 2 +- src/v1_24/api/core/v1/node.rs | 2 +- src/v1_24/api/core/v1/persistent_volume.rs | 2 +- .../api/flowcontrol/v1beta1/flow_schema.rs | 2 +- .../v1beta1/priority_level_configuration.rs | 2 +- .../api/flowcontrol/v1beta2/flow_schema.rs | 2 +- .../v1beta2/priority_level_configuration.rs | 2 +- src/v1_24/api/networking/v1/ingress_class.rs | 2 +- src/v1_24/api/node/v1/runtime_class.rs | 2 +- src/v1_24/api/node/v1beta1/runtime_class.rs | 2 +- src/v1_24/api/policy/v1/eviction.rs | 2 +- .../api/policy/v1beta1/pod_security_policy.rs | 2 +- src/v1_24/api/rbac/v1/cluster_role.rs | 2 +- src/v1_24/api/rbac/v1/cluster_role_binding.rs | 2 +- src/v1_24/api/scheduling/v1/priority_class.rs | 2 +- src/v1_24/api/storage/v1/csi_driver.rs | 2 +- src/v1_24/api/storage/v1/csi_node.rs | 2 +- src/v1_24/api/storage/v1/storage_class.rs | 2 +- src/v1_24/api/storage/v1/volume_attachment.rs | 2 +- .../v1/custom_resource_definition.rs | 2 +- .../pkg/apis/meta/v1/cluster_object_meta.rs | 528 +++++++++++++++++ .../apimachinery/pkg/apis/meta/v1/mod.rs | 6 + .../pkg/apis/meta/v1/object_meta.rs | 13 +- .../pkg/apis/meta/v1/sub_object_meta.rs | 555 ++++++++++++++++++ .../apis/apiregistration/v1/api_service.rs | 2 +- .../v1/mutating_webhook_configuration.rs | 2 +- .../v1/validating_webhook_configuration.rs | 2 +- .../v1alpha1/storage_version.rs | 2 +- .../api/authentication/v1/token_request.rs | 2 +- .../api/authentication/v1/token_review.rs | 2 +- .../v1/self_subject_access_review.rs | 2 +- .../v1/self_subject_rules_review.rs | 2 +- .../authorization/v1/subject_access_review.rs | 2 +- src/v1_25/api/autoscaling/v1/scale.rs | 2 +- .../v1/certificate_signing_request.rs | 2 +- src/v1_25/api/core/v1/component_status.rs | 2 +- src/v1_25/api/core/v1/namespace.rs | 2 +- src/v1_25/api/core/v1/node.rs | 2 +- src/v1_25/api/core/v1/persistent_volume.rs | 2 +- .../api/flowcontrol/v1beta1/flow_schema.rs | 2 +- .../v1beta1/priority_level_configuration.rs | 2 +- .../api/flowcontrol/v1beta2/flow_schema.rs | 2 +- .../v1beta2/priority_level_configuration.rs | 2 +- src/v1_25/api/networking/v1/ingress_class.rs | 2 +- .../api/networking/v1alpha1/cluster_cidr.rs | 2 +- src/v1_25/api/node/v1/runtime_class.rs | 2 +- src/v1_25/api/policy/v1/eviction.rs | 2 +- src/v1_25/api/rbac/v1/cluster_role.rs | 2 +- src/v1_25/api/rbac/v1/cluster_role_binding.rs | 2 +- src/v1_25/api/scheduling/v1/priority_class.rs | 2 +- src/v1_25/api/storage/v1/csi_driver.rs | 2 +- src/v1_25/api/storage/v1/csi_node.rs | 2 +- src/v1_25/api/storage/v1/storage_class.rs | 2 +- src/v1_25/api/storage/v1/volume_attachment.rs | 2 +- .../v1/custom_resource_definition.rs | 2 +- .../pkg/apis/meta/v1/cluster_object_meta.rs | 501 ++++++++++++++++ .../apimachinery/pkg/apis/meta/v1/mod.rs | 6 + .../pkg/apis/meta/v1/object_meta.rs | 13 +- .../pkg/apis/meta/v1/sub_object_meta.rs | 528 +++++++++++++++++ .../apis/apiregistration/v1/api_service.rs | 2 +- .../v1/mutating_webhook_configuration.rs | 2 +- .../v1/validating_webhook_configuration.rs | 2 +- .../v1alpha1/validating_admission_policy.rs | 2 +- .../validating_admission_policy_binding.rs | 2 +- .../v1alpha1/storage_version.rs | 2 +- .../api/authentication/v1/token_request.rs | 2 +- .../api/authentication/v1/token_review.rs | 2 +- .../v1alpha1/self_subject_review.rs | 2 +- .../v1/self_subject_access_review.rs | 2 +- .../v1/self_subject_rules_review.rs | 2 +- .../authorization/v1/subject_access_review.rs | 2 +- src/v1_26/api/autoscaling/v1/scale.rs | 2 +- .../v1/certificate_signing_request.rs | 2 +- src/v1_26/api/core/v1/component_status.rs | 2 +- src/v1_26/api/core/v1/namespace.rs | 2 +- src/v1_26/api/core/v1/node.rs | 2 +- src/v1_26/api/core/v1/persistent_volume.rs | 2 +- .../api/flowcontrol/v1beta2/flow_schema.rs | 2 +- .../v1beta2/priority_level_configuration.rs | 2 +- .../api/flowcontrol/v1beta3/flow_schema.rs | 2 +- .../v1beta3/priority_level_configuration.rs | 2 +- src/v1_26/api/networking/v1/ingress_class.rs | 2 +- .../api/networking/v1alpha1/cluster_cidr.rs | 2 +- src/v1_26/api/node/v1/runtime_class.rs | 2 +- src/v1_26/api/policy/v1/eviction.rs | 2 +- src/v1_26/api/rbac/v1/cluster_role.rs | 2 +- src/v1_26/api/rbac/v1/cluster_role_binding.rs | 2 +- .../api/resource/v1alpha1/resource_class.rs | 2 +- src/v1_26/api/scheduling/v1/priority_class.rs | 2 +- src/v1_26/api/storage/v1/csi_driver.rs | 2 +- src/v1_26/api/storage/v1/csi_node.rs | 2 +- src/v1_26/api/storage/v1/storage_class.rs | 2 +- src/v1_26/api/storage/v1/volume_attachment.rs | 2 +- .../v1/custom_resource_definition.rs | 2 +- .../pkg/apis/meta/v1/cluster_object_meta.rs | 501 ++++++++++++++++ .../apimachinery/pkg/apis/meta/v1/mod.rs | 6 + .../pkg/apis/meta/v1/object_meta.rs | 13 +- .../pkg/apis/meta/v1/sub_object_meta.rs | 528 +++++++++++++++++ .../apis/apiregistration/v1/api_service.rs | 2 +- 305 files changed, 7963 insertions(+), 340 deletions(-) create mode 100644 src/v1_20/apimachinery/pkg/apis/meta/v1/cluster_object_meta.rs create mode 100644 src/v1_20/apimachinery/pkg/apis/meta/v1/sub_object_meta.rs create mode 100644 src/v1_21/apimachinery/pkg/apis/meta/v1/cluster_object_meta.rs create mode 100644 src/v1_21/apimachinery/pkg/apis/meta/v1/sub_object_meta.rs create mode 100644 src/v1_22/apimachinery/pkg/apis/meta/v1/cluster_object_meta.rs create mode 100644 src/v1_22/apimachinery/pkg/apis/meta/v1/sub_object_meta.rs create mode 100644 src/v1_23/apimachinery/pkg/apis/meta/v1/cluster_object_meta.rs create mode 100644 src/v1_23/apimachinery/pkg/apis/meta/v1/sub_object_meta.rs create mode 100644 src/v1_24/apimachinery/pkg/apis/meta/v1/cluster_object_meta.rs create mode 100644 src/v1_24/apimachinery/pkg/apis/meta/v1/sub_object_meta.rs create mode 100644 src/v1_25/apimachinery/pkg/apis/meta/v1/cluster_object_meta.rs create mode 100644 src/v1_25/apimachinery/pkg/apis/meta/v1/sub_object_meta.rs create mode 100644 src/v1_26/apimachinery/pkg/apis/meta/v1/cluster_object_meta.rs create mode 100644 src/v1_26/apimachinery/pkg/apis/meta/v1/sub_object_meta.rs diff --git a/k8s-openapi-codegen-common/src/lib.rs b/k8s-openapi-codegen-common/src/lib.rs index 0ea7c0ab8f..8e58e65f20 100644 --- a/k8s-openapi-codegen-common/src/lib.rs +++ b/k8s-openapi-codegen-common/src/lib.rs @@ -415,35 +415,35 @@ pub fn run( ("{name}", Some(url_path_segment), Some("{namespace}"), Some("namespaces")) => ( format!("{url_path_segment:?}"), - format!("{local}NamespaceResourceScope"), + templates::ResourceScope::Namespace { local: &local }, &mut namespace_or_cluster_scoped_url_path_segment_and_scope, ), ("{name}", Some(url_path_segment), _, _) => ( format!("{url_path_segment:?}"), - format!("{local}ClusterResourceScope"), + templates::ResourceScope::Cluster { local: &local }, &mut namespace_or_cluster_scoped_url_path_segment_and_scope, ), (url_path_segment, Some("{name}"), _, _) => ( format!("{url_path_segment:?}"), - format!("{local}SubResourceScope"), + templates::ResourceScope::Sub { local: &local }, &mut subresource_url_path_segment_and_scope, ), (url_path_segment, Some("{namespace}"), Some("namespaces"), _) => ( format!("{url_path_segment:?}"), - format!("{local}NamespaceResourceScope"), + templates::ResourceScope::Namespace { local: &local }, &mut namespace_or_cluster_scoped_url_path_segment_and_scope, ), (url_path_segment, _, _, _) => ( format!("{url_path_segment:?}"), - format!("{local}ClusterResourceScope"), + templates::ResourceScope::Cluster { local: &local }, &mut namespace_or_cluster_scoped_url_path_segment_and_scope, ), }; @@ -465,9 +465,9 @@ pub fn run( "io.k8s.apimachinery.pkg.apis.meta.v1.APIGroupList" | "io.k8s.apimachinery.pkg.apis.meta.v1.APIResourceList" | "io.k8s.apimachinery.pkg.apis.meta.v1.APIVersions" => - namespace_or_cluster_scoped_url_path_segment_and_scope.push((r#""""#.to_owned(), format!("{local}ClusterResourceScope"))), + namespace_or_cluster_scoped_url_path_segment_and_scope.push((r#""""#.to_owned(), templates::ResourceScope::Cluster { local: &local })), "io.k8s.apimachinery.pkg.apis.meta.v1.Status" => - subresource_url_path_segment_and_scope.push((r#""status""#.to_owned(), format!("{local}SubResourceScope"))), + subresource_url_path_segment_and_scope.push((r#""status""#.to_owned(), templates::ResourceScope::Sub { local: &local })), _ => (), } @@ -478,16 +478,10 @@ pub fn run( ( Some((api_version, group, kind, version, list_kind)), Some((metadata_ty, templates::PropertyRequired::Required { is_default: _ })), - ) => Some(templates::ResourceMetadata { - api_version, - group, - kind, - version, - list_kind: list_kind.as_deref(), - metadata_ty: Some(metadata_ty), - url_path_segment_and_scope: match (&*namespace_or_cluster_scoped_url_path_segment_and_scope, &*subresource_url_path_segment_and_scope) { + ) => { + let url_path_segment_and_scope = match (&*namespace_or_cluster_scoped_url_path_segment_and_scope, &*subresource_url_path_segment_and_scope) { ([(url_path_segment, scope)], _) | - ([], [(url_path_segment, scope)]) => (&**url_path_segment, &**scope), + ([], [(url_path_segment, scope)]) => (&**url_path_segment, *scope), ([], []) => return Err(format!( "definition {definition_path} is a Resource but its URL path segment and scope could not be inferred").into()), @@ -495,8 +489,31 @@ pub fn run( "definition {definition_path} is a Resource but was inferred to have multiple scopes {namespace_or_cluster_scoped_url_path_segment_and_scope:?}").into()), ([], [_, ..]) => return Err(format!( "definition {definition_path} is a Resource but was inferred to have multiple scopes {subresource_url_path_segment_and_scope:?}").into()), - }, - }), + }; + + let metadata_ty: std::borrow::Cow<'_, str> = + if *metadata_ty == *format!("{local}apimachinery::pkg::apis::meta::v1::ObjectMeta") { + match url_path_segment_and_scope.1 { + templates::ResourceScope::Cluster { local } => format!("{local}apimachinery::pkg::apis::meta::v1::ClusterObjectMeta").into(), + templates::ResourceScope::Inherit { ty: _ } => unreachable!(), + templates::ResourceScope::Namespace { local: _ } => (&**metadata_ty).into(), + templates::ResourceScope::Sub { local } => format!("{local}apimachinery::pkg::apis::meta::v1::SubObjectMeta").into(), + } + } + else { + (&**metadata_ty).into() + }; + + Some(templates::ResourceMetadata { + api_version, + group, + kind, + version, + list_kind: list_kind.as_deref(), + metadata_ty: Some(metadata_ty), + url_path_segment_and_scope, + }) + }, (Some(_), Some((_, templates::PropertyRequired::Optional | templates::PropertyRequired::OptionalDefault))) => return Err(format!("definition {definition_path} has optional metadata").into()), @@ -513,7 +530,7 @@ pub fn run( metadata_ty: None, url_path_segment_and_scope: match (&*namespace_or_cluster_scoped_url_path_segment_and_scope, &*subresource_url_path_segment_and_scope) { ([(url_path_segment, scope)], _) | - ([], [(url_path_segment, scope)]) => (&**url_path_segment, &**scope), + ([], [(url_path_segment, scope)]) => (&**url_path_segment, *scope), ([], []) => return Err(format!( "definition {definition_path} is a Resource but its URL path segment and scope could not be inferred").into()), @@ -692,8 +709,8 @@ pub fn run( kind: "::LIST_KIND", version: "::VERSION", list_kind: None, - metadata_ty: Some(&metadata_rust_type), - url_path_segment_and_scope: (r#""""#, "::Scope"), + metadata_ty: Some(metadata_rust_type), + url_path_segment_and_scope: (r#""""#, templates::ResourceScope::Inherit { ty: "T" }), }; templates::r#struct::generate( diff --git a/k8s-openapi-codegen-common/src/templates/mod.rs b/k8s-openapi-codegen-common/src/templates/mod.rs index 98946ee072..8a62ef6657 100644 --- a/k8s-openapi-codegen-common/src/templates/mod.rs +++ b/k8s-openapi-codegen-common/src/templates/mod.rs @@ -45,7 +45,7 @@ pub(crate) struct Property<'a> { pub(crate) is_flattened: bool, } -#[derive(Clone, Copy)] +#[derive(Clone, Copy, Debug)] pub(crate) enum PropertyRequired { Required { is_default: bool }, Optional, @@ -57,15 +57,15 @@ pub(crate) enum PropertyRequired { OptionalDefault, } -#[derive(Clone, Copy)] +#[derive(Clone)] pub(crate) struct ResourceMetadata<'a> { pub(crate) api_version: &'a str, pub(crate) group: &'a str, pub(crate) kind: &'a str, pub(crate) version: &'a str, pub(crate) list_kind: Option<&'a str>, - pub(crate) metadata_ty: Option<&'a str>, - pub(crate) url_path_segment_and_scope: (&'a str, &'a str), + pub(crate) metadata_ty: Option>, + pub(crate) url_path_segment_and_scope: (&'a str, ResourceScope<'a>), } #[derive(Clone, Copy)] @@ -74,3 +74,22 @@ pub(crate) enum DateTimeSerializationFormat { SixDecimalDigits, ZeroDecimalDigits, } + +#[derive(Clone, Copy, Debug, Eq, PartialEq)] +pub(crate) enum ResourceScope<'a> { + Cluster { local: &'a str }, + Inherit { ty: &'static str }, + Namespace { local: &'a str }, + Sub { local: &'a str }, +} + +impl std::fmt::Display for ResourceScope<'_> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + ResourceScope::Cluster { local } => write!(f, "{local}ClusterResourceScope"), + ResourceScope::Inherit { ty } => write!(f, "<{ty} as crate::Resource>::Scope"), + ResourceScope::Namespace { local } => write!(f, "{local}NamespaceResourceScope"), + ResourceScope::Sub { local } => write!(f, "{local}SubResourceScope"), + } + } +} diff --git a/k8s-openapi-codegen/src/fixups/special.rs b/k8s-openapi-codegen/src/fixups/special.rs index 26a72d27a0..c3c157237c 100644 --- a/k8s-openapi-codegen/src/fixups/special.rs +++ b/k8s-openapi-codegen/src/fixups/special.rs @@ -1139,3 +1139,67 @@ pub(crate) fn resource_metadata_not_optional(spec: &mut crate::swagger20::Spec) Err("never applied override to make resource metadata non-optional".into()) } } + +// The default `apimachinery::pkg::apis::meta::v1::ObjectMeta` type has a `namespace: Option` field because it handles both +// namespaced resources and non-namespaced resources. But it's a pain for Rust code to have to deal with the `Option`-ality for namespaced resources, +// especially since namespaced resources are far more common than non-namespaced resources. +// +// This fixup splits the type into `ObjectMeta`, `ClusterObjectMeta` and `SubObjectMeta`. +// +// - `ObjectMeta` has a `namespace: String` field. Namespace-scoped resources will use this as their `metadata` field type. +// - `ClusterObjectMeta` has no `namespace` field. Cluster-scoped resources will use this as their `metadata` field type. +// - `SubObjectMeta` has a `namespace: Option` field. Sub resources will use this as their `metadata` field type. +pub(crate) fn resource_namespace_not_optional_for_namespaced(spec: &mut crate::swagger20::Spec) -> Result<(), crate::Error> { + let default_object_meta_definition = + spec.definitions + .get_mut("io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta") + .ok_or("could not find ObjectMeta definition")?; + + let crate::swagger20::SchemaKind::Properties(properties) = &mut default_object_meta_definition.kind else { + return Err("ObjectMeta does not have SchemaKind::Properties kind".into()); + }; + + let (_, namespace_property_required) = properties.get_mut("namespace").ok_or("ObjectMeta does not have namespace property")?; + if *namespace_property_required { + return Err("ObjectMeta::namespace is already required".into()); + } + + *namespace_property_required = true; + + let default_object_meta_definition = default_object_meta_definition.clone(); + + { + let mut cluster_object_meta_definition = default_object_meta_definition.clone(); + + let crate::swagger20::SchemaKind::Properties(properties) = &mut cluster_object_meta_definition.kind else { unreachable!(); }; + + properties.remove("namespace"); + + let default_cluster_object_meta_definition = + spec.definitions.insert( + crate::swagger20::DefinitionPath("io.k8s.apimachinery.pkg.apis.meta.v1.ClusterObjectMeta".to_owned()), + cluster_object_meta_definition); + if let Some(default_cluster_object_meta_definition) = default_cluster_object_meta_definition { + return Err(format!("spec already had definition for ClusterObjectMeta: {default_cluster_object_meta_definition:?}").into()); + } + } + + { + let mut sub_object_meta_definition = default_object_meta_definition; + + let crate::swagger20::SchemaKind::Properties(properties) = &mut sub_object_meta_definition.kind else { unreachable!(); }; + + let Some((_, namespace_property_required)) = properties.get_mut("namespace") else { unreachable!(); }; + *namespace_property_required = false; + + let default_sub_object_meta_definition = + spec.definitions.insert( + crate::swagger20::DefinitionPath("io.k8s.apimachinery.pkg.apis.meta.v1.SubObjectMeta".to_owned()), + sub_object_meta_definition); + if let Some(default_sub_object_meta_definition) = default_sub_object_meta_definition { + return Err(format!("spec already had definition for SubObjectMeta: {default_sub_object_meta_definition:?}").into()); + } + } + + Ok(()) +} diff --git a/k8s-openapi-codegen/src/supported_version.rs b/k8s-openapi-codegen/src/supported_version.rs index be5c78ebdb..c30e8c7fed 100644 --- a/k8s-openapi-codegen/src/supported_version.rs +++ b/k8s-openapi-codegen/src/supported_version.rs @@ -127,6 +127,7 @@ impl SupportedVersion { crate::fixups::special::list, // Must run after separate_watch_from_list_operations crate::fixups::special::response_types, crate::fixups::special::resource_metadata_not_optional, + crate::fixups::special::resource_namespace_not_optional_for_namespaced, ]; for fixup in upstream_bugs_fixups.iter().chain(special_fixups) { diff --git a/src/v1_20/api/admissionregistration/v1/mutating_webhook_configuration.rs b/src/v1_20/api/admissionregistration/v1/mutating_webhook_configuration.rs index cb8ec8f5af..e0f9531189 100644 --- a/src/v1_20/api/admissionregistration/v1/mutating_webhook_configuration.rs +++ b/src/v1_20/api/admissionregistration/v1/mutating_webhook_configuration.rs @@ -360,7 +360,7 @@ impl crate::ListableResource for MutatingWebhookConfiguration { } impl crate::Metadata for MutatingWebhookConfiguration { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_20/api/admissionregistration/v1/validating_webhook_configuration.rs b/src/v1_20/api/admissionregistration/v1/validating_webhook_configuration.rs index 4c520b0eeb..4cf73a02cb 100644 --- a/src/v1_20/api/admissionregistration/v1/validating_webhook_configuration.rs +++ b/src/v1_20/api/admissionregistration/v1/validating_webhook_configuration.rs @@ -360,7 +360,7 @@ impl crate::ListableResource for ValidatingWebhookConfiguration { } impl crate::Metadata for ValidatingWebhookConfiguration { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_20/api/admissionregistration/v1beta1/mutating_webhook_configuration.rs b/src/v1_20/api/admissionregistration/v1beta1/mutating_webhook_configuration.rs index 775b511d0d..4f79bd4b80 100644 --- a/src/v1_20/api/admissionregistration/v1beta1/mutating_webhook_configuration.rs +++ b/src/v1_20/api/admissionregistration/v1beta1/mutating_webhook_configuration.rs @@ -360,7 +360,7 @@ impl crate::ListableResource for MutatingWebhookConfiguration { } impl crate::Metadata for MutatingWebhookConfiguration { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_20/api/admissionregistration/v1beta1/validating_webhook_configuration.rs b/src/v1_20/api/admissionregistration/v1beta1/validating_webhook_configuration.rs index 5caa78900d..a818e121d7 100644 --- a/src/v1_20/api/admissionregistration/v1beta1/validating_webhook_configuration.rs +++ b/src/v1_20/api/admissionregistration/v1beta1/validating_webhook_configuration.rs @@ -360,7 +360,7 @@ impl crate::ListableResource for ValidatingWebhookConfiguration { } impl crate::Metadata for ValidatingWebhookConfiguration { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_20/api/apiserverinternal/v1alpha1/storage_version.rs b/src/v1_20/api/apiserverinternal/v1alpha1/storage_version.rs index 6b8779e542..600f1c0e24 100644 --- a/src/v1_20/api/apiserverinternal/v1alpha1/storage_version.rs +++ b/src/v1_20/api/apiserverinternal/v1alpha1/storage_version.rs @@ -517,7 +517,7 @@ impl crate::ListableResource for StorageVersion { } impl crate::Metadata for StorageVersion { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_20/api/authentication/v1/token_request.rs b/src/v1_20/api/authentication/v1/token_request.rs index 8a781af27c..234eab8f56 100644 --- a/src/v1_20/api/authentication/v1/token_request.rs +++ b/src/v1_20/api/authentication/v1/token_request.rs @@ -71,7 +71,7 @@ impl crate::Resource for TokenRequest { } impl crate::Metadata for TokenRequest { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::SubObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_20/api/authentication/v1/token_review.rs b/src/v1_20/api/authentication/v1/token_review.rs index f092debcd9..2110fe60e7 100644 --- a/src/v1_20/api/authentication/v1/token_review.rs +++ b/src/v1_20/api/authentication/v1/token_review.rs @@ -60,7 +60,7 @@ impl crate::Resource for TokenReview { } impl crate::Metadata for TokenReview { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_20/api/authentication/v1beta1/token_review.rs b/src/v1_20/api/authentication/v1beta1/token_review.rs index 4c5f53d424..a0d9b9e7a3 100644 --- a/src/v1_20/api/authentication/v1beta1/token_review.rs +++ b/src/v1_20/api/authentication/v1beta1/token_review.rs @@ -60,7 +60,7 @@ impl crate::Resource for TokenReview { } impl crate::Metadata for TokenReview { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_20/api/authorization/v1/self_subject_access_review.rs b/src/v1_20/api/authorization/v1/self_subject_access_review.rs index b6b08560f9..7af26ffb79 100644 --- a/src/v1_20/api/authorization/v1/self_subject_access_review.rs +++ b/src/v1_20/api/authorization/v1/self_subject_access_review.rs @@ -60,7 +60,7 @@ impl crate::Resource for SelfSubjectAccessReview { } impl crate::Metadata for SelfSubjectAccessReview { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_20/api/authorization/v1/self_subject_rules_review.rs b/src/v1_20/api/authorization/v1/self_subject_rules_review.rs index 9d4ff4b605..d380041f8e 100644 --- a/src/v1_20/api/authorization/v1/self_subject_rules_review.rs +++ b/src/v1_20/api/authorization/v1/self_subject_rules_review.rs @@ -60,7 +60,7 @@ impl crate::Resource for SelfSubjectRulesReview { } impl crate::Metadata for SelfSubjectRulesReview { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_20/api/authorization/v1/subject_access_review.rs b/src/v1_20/api/authorization/v1/subject_access_review.rs index 878707a834..e204ed491e 100644 --- a/src/v1_20/api/authorization/v1/subject_access_review.rs +++ b/src/v1_20/api/authorization/v1/subject_access_review.rs @@ -60,7 +60,7 @@ impl crate::Resource for SubjectAccessReview { } impl crate::Metadata for SubjectAccessReview { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_20/api/authorization/v1beta1/self_subject_access_review.rs b/src/v1_20/api/authorization/v1beta1/self_subject_access_review.rs index 6b8498e470..af2870fd1d 100644 --- a/src/v1_20/api/authorization/v1beta1/self_subject_access_review.rs +++ b/src/v1_20/api/authorization/v1beta1/self_subject_access_review.rs @@ -60,7 +60,7 @@ impl crate::Resource for SelfSubjectAccessReview { } impl crate::Metadata for SelfSubjectAccessReview { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_20/api/authorization/v1beta1/self_subject_rules_review.rs b/src/v1_20/api/authorization/v1beta1/self_subject_rules_review.rs index 4b9453f127..0b9ee49b3a 100644 --- a/src/v1_20/api/authorization/v1beta1/self_subject_rules_review.rs +++ b/src/v1_20/api/authorization/v1beta1/self_subject_rules_review.rs @@ -60,7 +60,7 @@ impl crate::Resource for SelfSubjectRulesReview { } impl crate::Metadata for SelfSubjectRulesReview { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_20/api/authorization/v1beta1/subject_access_review.rs b/src/v1_20/api/authorization/v1beta1/subject_access_review.rs index 503835cea6..01a7cd6650 100644 --- a/src/v1_20/api/authorization/v1beta1/subject_access_review.rs +++ b/src/v1_20/api/authorization/v1beta1/subject_access_review.rs @@ -60,7 +60,7 @@ impl crate::Resource for SubjectAccessReview { } impl crate::Metadata for SubjectAccessReview { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_20/api/autoscaling/v1/scale.rs b/src/v1_20/api/autoscaling/v1/scale.rs index 89a7024529..3fb0a7ea47 100644 --- a/src/v1_20/api/autoscaling/v1/scale.rs +++ b/src/v1_20/api/autoscaling/v1/scale.rs @@ -711,7 +711,7 @@ impl crate::Resource for Scale { } impl crate::Metadata for Scale { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::SubObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_20/api/certificates/v1/certificate_signing_request.rs b/src/v1_20/api/certificates/v1/certificate_signing_request.rs index 32030b6c3f..c94a31d4ad 100644 --- a/src/v1_20/api/certificates/v1/certificate_signing_request.rs +++ b/src/v1_20/api/certificates/v1/certificate_signing_request.rs @@ -674,7 +674,7 @@ impl crate::ListableResource for CertificateSigningRequest { } impl crate::Metadata for CertificateSigningRequest { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_20/api/certificates/v1beta1/certificate_signing_request.rs b/src/v1_20/api/certificates/v1beta1/certificate_signing_request.rs index 8522453ec0..b089f7e398 100644 --- a/src/v1_20/api/certificates/v1beta1/certificate_signing_request.rs +++ b/src/v1_20/api/certificates/v1beta1/certificate_signing_request.rs @@ -668,7 +668,7 @@ impl crate::ListableResource for CertificateSigningRequest { } impl crate::Metadata for CertificateSigningRequest { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_20/api/core/v1/component_status.rs b/src/v1_20/api/core/v1/component_status.rs index ecddf82170..ba505704c7 100644 --- a/src/v1_20/api/core/v1/component_status.rs +++ b/src/v1_20/api/core/v1/component_status.rs @@ -159,7 +159,7 @@ impl crate::ListableResource for ComponentStatus { } impl crate::Metadata for ComponentStatus { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_20/api/core/v1/namespace.rs b/src/v1_20/api/core/v1/namespace.rs index df31cdc0da..6600f8a3bb 100644 --- a/src/v1_20/api/core/v1/namespace.rs +++ b/src/v1_20/api/core/v1/namespace.rs @@ -516,7 +516,7 @@ impl crate::ListableResource for Namespace { } impl crate::Metadata for Namespace { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_20/api/core/v1/node.rs b/src/v1_20/api/core/v1/node.rs index 5a5694b818..d6e0aa6dfb 100644 --- a/src/v1_20/api/core/v1/node.rs +++ b/src/v1_20/api/core/v1/node.rs @@ -996,7 +996,7 @@ impl crate::ListableResource for Node { } impl crate::Metadata for Node { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_20/api/core/v1/persistent_volume.rs b/src/v1_20/api/core/v1/persistent_volume.rs index fada89f48e..7bd79040b6 100644 --- a/src/v1_20/api/core/v1/persistent_volume.rs +++ b/src/v1_20/api/core/v1/persistent_volume.rs @@ -516,7 +516,7 @@ impl crate::ListableResource for PersistentVolume { } impl crate::Metadata for PersistentVolume { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_20/api/flowcontrol/v1alpha1/flow_schema.rs b/src/v1_20/api/flowcontrol/v1alpha1/flow_schema.rs index 6641f0e49b..e624dbac57 100644 --- a/src/v1_20/api/flowcontrol/v1alpha1/flow_schema.rs +++ b/src/v1_20/api/flowcontrol/v1alpha1/flow_schema.rs @@ -516,7 +516,7 @@ impl crate::ListableResource for FlowSchema { } impl crate::Metadata for FlowSchema { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_20/api/flowcontrol/v1alpha1/priority_level_configuration.rs b/src/v1_20/api/flowcontrol/v1alpha1/priority_level_configuration.rs index f7a2fd73fd..078d592376 100644 --- a/src/v1_20/api/flowcontrol/v1alpha1/priority_level_configuration.rs +++ b/src/v1_20/api/flowcontrol/v1alpha1/priority_level_configuration.rs @@ -516,7 +516,7 @@ impl crate::ListableResource for PriorityLevelConfiguration { } impl crate::Metadata for PriorityLevelConfiguration { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_20/api/flowcontrol/v1beta1/flow_schema.rs b/src/v1_20/api/flowcontrol/v1beta1/flow_schema.rs index 1d0546a710..e74328c4ec 100644 --- a/src/v1_20/api/flowcontrol/v1beta1/flow_schema.rs +++ b/src/v1_20/api/flowcontrol/v1beta1/flow_schema.rs @@ -516,7 +516,7 @@ impl crate::ListableResource for FlowSchema { } impl crate::Metadata for FlowSchema { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_20/api/flowcontrol/v1beta1/priority_level_configuration.rs b/src/v1_20/api/flowcontrol/v1beta1/priority_level_configuration.rs index 4cbe999e32..d4f148709d 100644 --- a/src/v1_20/api/flowcontrol/v1beta1/priority_level_configuration.rs +++ b/src/v1_20/api/flowcontrol/v1beta1/priority_level_configuration.rs @@ -516,7 +516,7 @@ impl crate::ListableResource for PriorityLevelConfiguration { } impl crate::Metadata for PriorityLevelConfiguration { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_20/api/networking/v1/ingress_class.rs b/src/v1_20/api/networking/v1/ingress_class.rs index d3ab7820c7..657d7e9809 100644 --- a/src/v1_20/api/networking/v1/ingress_class.rs +++ b/src/v1_20/api/networking/v1/ingress_class.rs @@ -360,7 +360,7 @@ impl crate::ListableResource for IngressClass { } impl crate::Metadata for IngressClass { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_20/api/networking/v1beta1/ingress_class.rs b/src/v1_20/api/networking/v1beta1/ingress_class.rs index 5be215bb48..98ba544a3a 100644 --- a/src/v1_20/api/networking/v1beta1/ingress_class.rs +++ b/src/v1_20/api/networking/v1beta1/ingress_class.rs @@ -360,7 +360,7 @@ impl crate::ListableResource for IngressClass { } impl crate::Metadata for IngressClass { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_20/api/node/v1/runtime_class.rs b/src/v1_20/api/node/v1/runtime_class.rs index b8b7e6e539..c36ce5ed64 100644 --- a/src/v1_20/api/node/v1/runtime_class.rs +++ b/src/v1_20/api/node/v1/runtime_class.rs @@ -368,7 +368,7 @@ impl crate::ListableResource for RuntimeClass { } impl crate::Metadata for RuntimeClass { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_20/api/node/v1alpha1/runtime_class.rs b/src/v1_20/api/node/v1alpha1/runtime_class.rs index df1df669f8..060e4c1d30 100644 --- a/src/v1_20/api/node/v1alpha1/runtime_class.rs +++ b/src/v1_20/api/node/v1alpha1/runtime_class.rs @@ -360,7 +360,7 @@ impl crate::ListableResource for RuntimeClass { } impl crate::Metadata for RuntimeClass { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_20/api/node/v1beta1/runtime_class.rs b/src/v1_20/api/node/v1beta1/runtime_class.rs index fc8dfaf5cc..cb28fb6aad 100644 --- a/src/v1_20/api/node/v1beta1/runtime_class.rs +++ b/src/v1_20/api/node/v1beta1/runtime_class.rs @@ -366,7 +366,7 @@ impl crate::ListableResource for RuntimeClass { } impl crate::Metadata for RuntimeClass { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_20/api/policy/v1beta1/eviction.rs b/src/v1_20/api/policy/v1beta1/eviction.rs index 2b2b23df89..a0c1c18d37 100644 --- a/src/v1_20/api/policy/v1beta1/eviction.rs +++ b/src/v1_20/api/policy/v1beta1/eviction.rs @@ -71,7 +71,7 @@ impl crate::Resource for Eviction { } impl crate::Metadata for Eviction { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::SubObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_20/api/policy/v1beta1/pod_security_policy.rs b/src/v1_20/api/policy/v1beta1/pod_security_policy.rs index 69efd50636..5fde6bc2f0 100644 --- a/src/v1_20/api/policy/v1beta1/pod_security_policy.rs +++ b/src/v1_20/api/policy/v1beta1/pod_security_policy.rs @@ -360,7 +360,7 @@ impl crate::ListableResource for PodSecurityPolicy { } impl crate::Metadata for PodSecurityPolicy { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_20/api/rbac/v1/cluster_role.rs b/src/v1_20/api/rbac/v1/cluster_role.rs index 8336e14c92..541d57c8ee 100644 --- a/src/v1_20/api/rbac/v1/cluster_role.rs +++ b/src/v1_20/api/rbac/v1/cluster_role.rs @@ -363,7 +363,7 @@ impl crate::ListableResource for ClusterRole { } impl crate::Metadata for ClusterRole { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_20/api/rbac/v1/cluster_role_binding.rs b/src/v1_20/api/rbac/v1/cluster_role_binding.rs index 0162a1128e..0f02a028d1 100644 --- a/src/v1_20/api/rbac/v1/cluster_role_binding.rs +++ b/src/v1_20/api/rbac/v1/cluster_role_binding.rs @@ -363,7 +363,7 @@ impl crate::ListableResource for ClusterRoleBinding { } impl crate::Metadata for ClusterRoleBinding { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_20/api/rbac/v1alpha1/cluster_role.rs b/src/v1_20/api/rbac/v1alpha1/cluster_role.rs index 751ea258ce..49459caa0b 100644 --- a/src/v1_20/api/rbac/v1alpha1/cluster_role.rs +++ b/src/v1_20/api/rbac/v1alpha1/cluster_role.rs @@ -363,7 +363,7 @@ impl crate::ListableResource for ClusterRole { } impl crate::Metadata for ClusterRole { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_20/api/rbac/v1alpha1/cluster_role_binding.rs b/src/v1_20/api/rbac/v1alpha1/cluster_role_binding.rs index 8d275bec1a..de6fe83e42 100644 --- a/src/v1_20/api/rbac/v1alpha1/cluster_role_binding.rs +++ b/src/v1_20/api/rbac/v1alpha1/cluster_role_binding.rs @@ -363,7 +363,7 @@ impl crate::ListableResource for ClusterRoleBinding { } impl crate::Metadata for ClusterRoleBinding { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_20/api/rbac/v1beta1/cluster_role.rs b/src/v1_20/api/rbac/v1beta1/cluster_role.rs index 4931e2d651..1bc0ab6d82 100644 --- a/src/v1_20/api/rbac/v1beta1/cluster_role.rs +++ b/src/v1_20/api/rbac/v1beta1/cluster_role.rs @@ -363,7 +363,7 @@ impl crate::ListableResource for ClusterRole { } impl crate::Metadata for ClusterRole { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_20/api/rbac/v1beta1/cluster_role_binding.rs b/src/v1_20/api/rbac/v1beta1/cluster_role_binding.rs index d2773b7e9c..8e59185e75 100644 --- a/src/v1_20/api/rbac/v1beta1/cluster_role_binding.rs +++ b/src/v1_20/api/rbac/v1beta1/cluster_role_binding.rs @@ -363,7 +363,7 @@ impl crate::ListableResource for ClusterRoleBinding { } impl crate::Metadata for ClusterRoleBinding { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_20/api/scheduling/v1/priority_class.rs b/src/v1_20/api/scheduling/v1/priority_class.rs index a7dba60fbd..f59c63c3e0 100644 --- a/src/v1_20/api/scheduling/v1/priority_class.rs +++ b/src/v1_20/api/scheduling/v1/priority_class.rs @@ -369,7 +369,7 @@ impl crate::ListableResource for PriorityClass { } impl crate::Metadata for PriorityClass { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_20/api/scheduling/v1alpha1/priority_class.rs b/src/v1_20/api/scheduling/v1alpha1/priority_class.rs index 992756ff0f..30b20699c8 100644 --- a/src/v1_20/api/scheduling/v1alpha1/priority_class.rs +++ b/src/v1_20/api/scheduling/v1alpha1/priority_class.rs @@ -369,7 +369,7 @@ impl crate::ListableResource for PriorityClass { } impl crate::Metadata for PriorityClass { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_20/api/scheduling/v1beta1/priority_class.rs b/src/v1_20/api/scheduling/v1beta1/priority_class.rs index a453b71f00..39e2649f33 100644 --- a/src/v1_20/api/scheduling/v1beta1/priority_class.rs +++ b/src/v1_20/api/scheduling/v1beta1/priority_class.rs @@ -369,7 +369,7 @@ impl crate::ListableResource for PriorityClass { } impl crate::Metadata for PriorityClass { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_20/api/storage/v1/csi_driver.rs b/src/v1_20/api/storage/v1/csi_driver.rs index 0dc419fa28..841c350667 100644 --- a/src/v1_20/api/storage/v1/csi_driver.rs +++ b/src/v1_20/api/storage/v1/csi_driver.rs @@ -360,7 +360,7 @@ impl crate::ListableResource for CSIDriver { } impl crate::Metadata for CSIDriver { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_20/api/storage/v1/csi_node.rs b/src/v1_20/api/storage/v1/csi_node.rs index a514ce9bf0..2ae2dc489a 100644 --- a/src/v1_20/api/storage/v1/csi_node.rs +++ b/src/v1_20/api/storage/v1/csi_node.rs @@ -360,7 +360,7 @@ impl crate::ListableResource for CSINode { } impl crate::Metadata for CSINode { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_20/api/storage/v1/storage_class.rs b/src/v1_20/api/storage/v1/storage_class.rs index 2bf8e65456..e8e1996616 100644 --- a/src/v1_20/api/storage/v1/storage_class.rs +++ b/src/v1_20/api/storage/v1/storage_class.rs @@ -380,7 +380,7 @@ impl crate::ListableResource for StorageClass { } impl crate::Metadata for StorageClass { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_20/api/storage/v1/volume_attachment.rs b/src/v1_20/api/storage/v1/volume_attachment.rs index f6b6972639..51e070f07b 100644 --- a/src/v1_20/api/storage/v1/volume_attachment.rs +++ b/src/v1_20/api/storage/v1/volume_attachment.rs @@ -518,7 +518,7 @@ impl crate::ListableResource for VolumeAttachment { } impl crate::Metadata for VolumeAttachment { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_20/api/storage/v1alpha1/volume_attachment.rs b/src/v1_20/api/storage/v1alpha1/volume_attachment.rs index 650e9a415f..7e3661d48d 100644 --- a/src/v1_20/api/storage/v1alpha1/volume_attachment.rs +++ b/src/v1_20/api/storage/v1alpha1/volume_attachment.rs @@ -365,7 +365,7 @@ impl crate::ListableResource for VolumeAttachment { } impl crate::Metadata for VolumeAttachment { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_20/api/storage/v1beta1/csi_driver.rs b/src/v1_20/api/storage/v1beta1/csi_driver.rs index ff6e91deb5..0d1fe5d882 100644 --- a/src/v1_20/api/storage/v1beta1/csi_driver.rs +++ b/src/v1_20/api/storage/v1beta1/csi_driver.rs @@ -360,7 +360,7 @@ impl crate::ListableResource for CSIDriver { } impl crate::Metadata for CSIDriver { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_20/api/storage/v1beta1/csi_node.rs b/src/v1_20/api/storage/v1beta1/csi_node.rs index 24267a2e78..cbf1f45ebc 100644 --- a/src/v1_20/api/storage/v1beta1/csi_node.rs +++ b/src/v1_20/api/storage/v1beta1/csi_node.rs @@ -360,7 +360,7 @@ impl crate::ListableResource for CSINode { } impl crate::Metadata for CSINode { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_20/api/storage/v1beta1/storage_class.rs b/src/v1_20/api/storage/v1beta1/storage_class.rs index d8e2c027b2..fa9961b35d 100644 --- a/src/v1_20/api/storage/v1beta1/storage_class.rs +++ b/src/v1_20/api/storage/v1beta1/storage_class.rs @@ -380,7 +380,7 @@ impl crate::ListableResource for StorageClass { } impl crate::Metadata for StorageClass { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_20/api/storage/v1beta1/volume_attachment.rs b/src/v1_20/api/storage/v1beta1/volume_attachment.rs index 92ca144edc..3a5c6e3001 100644 --- a/src/v1_20/api/storage/v1beta1/volume_attachment.rs +++ b/src/v1_20/api/storage/v1beta1/volume_attachment.rs @@ -365,7 +365,7 @@ impl crate::ListableResource for VolumeAttachment { } impl crate::Metadata for VolumeAttachment { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_20/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition.rs b/src/v1_20/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition.rs index 56d6f38d96..d400233d9b 100644 --- a/src/v1_20/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition.rs +++ b/src/v1_20/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition.rs @@ -515,7 +515,7 @@ impl crate::ListableResource for CustomResourceDefinition { } impl crate::Metadata for CustomResourceDefinition { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_20/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/custom_resource_definition.rs b/src/v1_20/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/custom_resource_definition.rs index ed4d82ee89..b322020ae1 100644 --- a/src/v1_20/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/custom_resource_definition.rs +++ b/src/v1_20/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/custom_resource_definition.rs @@ -515,7 +515,7 @@ impl crate::ListableResource for CustomResourceDefinition { } impl crate::Metadata for CustomResourceDefinition { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_20/apimachinery/pkg/apis/meta/v1/cluster_object_meta.rs b/src/v1_20/apimachinery/pkg/apis/meta/v1/cluster_object_meta.rs new file mode 100644 index 0000000000..b3dfa1403f --- /dev/null +++ b/src/v1_20/apimachinery/pkg/apis/meta/v1/cluster_object_meta.rs @@ -0,0 +1,528 @@ +// Generated from definition io.k8s.apimachinery.pkg.apis.meta.v1.ClusterObjectMeta + +/// ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create. +#[derive(Clone, Debug, Default, PartialEq)] +pub struct ClusterObjectMeta { + /// Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations + pub annotations: Option>, + + /// The name of the cluster which the object belongs to. This is used to distinguish resources with same name and namespace in different clusters. This field is not set anywhere right now and apiserver is going to ignore it if set in create or update request. + pub cluster_name: Option, + + /// CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC. + /// + /// Populated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + pub creation_timestamp: Option, + + /// Number of seconds allowed for this object to gracefully terminate before it will be removed from the system. Only set when deletionTimestamp is also set. May only be shortened. Read-only. + pub deletion_grace_period_seconds: Option, + + /// DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This field is set by the server when a graceful deletion is requested by the user, and is not directly settable by a client. The resource is expected to be deleted (no longer visible from resource lists, and not reachable by name) after the time in this field, once the finalizers list is empty. As long as the finalizers list contains items, deletion is blocked. Once the deletionTimestamp is set, this value may not be unset or be set further into the future, although it may be shortened or the resource may be deleted prior to this time. For example, a user may request that a pod is deleted in 30 seconds. The Kubelet will react by sending a graceful termination signal to the containers in the pod. After that 30 seconds, the Kubelet will send a hard termination signal (SIGKILL) to the container and after cleanup, remove the pod from the API. In the presence of network partitions, this object may still exist after this timestamp, until an administrator or automated process can determine the resource is fully terminated. If not set, graceful deletion of the object has not been requested. + /// + /// Populated by the system when a graceful deletion is requested. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + pub deletion_timestamp: Option, + + /// Must be empty before the object is deleted from the registry. Each entry is an identifier for the responsible component that will remove the entry from the list. If the deletionTimestamp of the object is non-nil, entries in this list can only be removed. Finalizers may be processed and removed in any order. Order is NOT enforced because it introduces significant risk of stuck finalizers. finalizers is a shared field, any actor with permission can reorder it. If the finalizer list is processed in order, then this can lead to a situation in which the component responsible for the first finalizer in the list is waiting for a signal (field value, external system, or other) produced by a component responsible for a finalizer later in the list, resulting in a deadlock. Without enforced ordering finalizers are free to order amongst themselves and are not vulnerable to ordering changes in the list. + pub finalizers: Option>, + + /// GenerateName is an optional prefix, used by the server, to generate a unique name ONLY IF the Name field has not been provided. If this field is used, the name returned to the client will be different than the name passed. This value will also be combined with a unique suffix. The provided value has the same validation rules as the Name field, and may be truncated by the length of the suffix required to make the value unique on the server. + /// + /// If this field is specified and the generated name exists, the server will NOT return a 409 - instead, it will either return 201 Created or 500 with Reason ServerTimeout indicating a unique name could not be found in the time allotted, and the client should retry (optionally after the time indicated in the Retry-After header). + /// + /// Applied only if Name is not specified. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#idempotency + pub generate_name: Option, + + /// A sequence number representing a specific generation of the desired state. Populated by the system. Read-only. + pub generation: Option, + + /// Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels + pub labels: Option>, + + /// ManagedFields maps workflow-id and version to the set of fields that are managed by that workflow. This is mostly for internal housekeeping, and users typically shouldn't need to set or understand this field. A workflow can be the user's name, a controller's name, or the name of a specific apply path like "ci-cd". The set of fields is always in the version that the workflow used when modifying the object. + pub managed_fields: Option>, + + /// Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names + pub name: Option, + + /// List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller. + pub owner_references: Option>, + + /// An opaque value that represents the internal version of this object that can be used by clients to determine when objects have changed. May be used for optimistic concurrency, change detection, and the watch operation on a resource or set of resources. Clients must treat these values as opaque and passed unmodified back to the server. They may only be valid for a particular resource or set of resources. + /// + /// Populated by the system. Read-only. Value must be treated as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency + pub resource_version: Option, + + /// SelfLink is a URL representing this object. Populated by the system. Read-only. + /// + /// DEPRECATED Kubernetes will stop propagating this field in 1.20 release and the field is planned to be removed in 1.21 release. + pub self_link: Option, + + /// UID is the unique in time and space value for this object. It is typically generated by the server on successful creation of a resource and is not allowed to change on PUT operations. + /// + /// Populated by the system. Read-only. More info: http://kubernetes.io/docs/user-guide/identifiers#uids + pub uid: Option, +} + +impl crate::DeepMerge for ClusterObjectMeta { + fn merge_from(&mut self, other: Self) { + crate::DeepMerge::merge_from(&mut self.annotations, other.annotations); + crate::DeepMerge::merge_from(&mut self.cluster_name, other.cluster_name); + crate::DeepMerge::merge_from(&mut self.creation_timestamp, other.creation_timestamp); + crate::DeepMerge::merge_from(&mut self.deletion_grace_period_seconds, other.deletion_grace_period_seconds); + crate::DeepMerge::merge_from(&mut self.deletion_timestamp, other.deletion_timestamp); + crate::DeepMerge::merge_from(&mut self.finalizers, other.finalizers); + crate::DeepMerge::merge_from(&mut self.generate_name, other.generate_name); + crate::DeepMerge::merge_from(&mut self.generation, other.generation); + crate::DeepMerge::merge_from(&mut self.labels, other.labels); + crate::DeepMerge::merge_from(&mut self.managed_fields, other.managed_fields); + crate::DeepMerge::merge_from(&mut self.name, other.name); + crate::DeepMerge::merge_from(&mut self.owner_references, other.owner_references); + crate::DeepMerge::merge_from(&mut self.resource_version, other.resource_version); + crate::DeepMerge::merge_from(&mut self.self_link, other.self_link); + crate::DeepMerge::merge_from(&mut self.uid, other.uid); + } +} + +impl<'de> crate::serde::Deserialize<'de> for ClusterObjectMeta { + fn deserialize(deserializer: D) -> Result where D: crate::serde::Deserializer<'de> { + #[allow(non_camel_case_types)] + enum Field { + Key_annotations, + Key_cluster_name, + Key_creation_timestamp, + Key_deletion_grace_period_seconds, + Key_deletion_timestamp, + Key_finalizers, + Key_generate_name, + Key_generation, + Key_labels, + Key_managed_fields, + Key_name, + Key_owner_references, + Key_resource_version, + Key_self_link, + Key_uid, + Other, + } + + impl<'de> crate::serde::Deserialize<'de> for Field { + fn deserialize(deserializer: D) -> Result where D: crate::serde::Deserializer<'de> { + struct Visitor; + + impl<'de> crate::serde::de::Visitor<'de> for Visitor { + type Value = Field; + + fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.write_str("field identifier") + } + + fn visit_str(self, v: &str) -> Result where E: crate::serde::de::Error { + Ok(match v { + "annotations" => Field::Key_annotations, + "clusterName" => Field::Key_cluster_name, + "creationTimestamp" => Field::Key_creation_timestamp, + "deletionGracePeriodSeconds" => Field::Key_deletion_grace_period_seconds, + "deletionTimestamp" => Field::Key_deletion_timestamp, + "finalizers" => Field::Key_finalizers, + "generateName" => Field::Key_generate_name, + "generation" => Field::Key_generation, + "labels" => Field::Key_labels, + "managedFields" => Field::Key_managed_fields, + "name" => Field::Key_name, + "ownerReferences" => Field::Key_owner_references, + "resourceVersion" => Field::Key_resource_version, + "selfLink" => Field::Key_self_link, + "uid" => Field::Key_uid, + _ => Field::Other, + }) + } + } + + deserializer.deserialize_identifier(Visitor) + } + } + + struct Visitor; + + impl<'de> crate::serde::de::Visitor<'de> for Visitor { + type Value = ClusterObjectMeta; + + fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.write_str("ClusterObjectMeta") + } + + fn visit_map(self, mut map: A) -> Result where A: crate::serde::de::MapAccess<'de> { + let mut value_annotations: Option> = None; + let mut value_cluster_name: Option = None; + let mut value_creation_timestamp: Option = None; + let mut value_deletion_grace_period_seconds: Option = None; + let mut value_deletion_timestamp: Option = None; + let mut value_finalizers: Option> = None; + let mut value_generate_name: Option = None; + let mut value_generation: Option = None; + let mut value_labels: Option> = None; + let mut value_managed_fields: Option> = None; + let mut value_name: Option = None; + let mut value_owner_references: Option> = None; + let mut value_resource_version: Option = None; + let mut value_self_link: Option = None; + let mut value_uid: Option = None; + + while let Some(key) = crate::serde::de::MapAccess::next_key::(&mut map)? { + match key { + Field::Key_annotations => value_annotations = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_cluster_name => value_cluster_name = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_creation_timestamp => value_creation_timestamp = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_deletion_grace_period_seconds => value_deletion_grace_period_seconds = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_deletion_timestamp => value_deletion_timestamp = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_finalizers => value_finalizers = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_generate_name => value_generate_name = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_generation => value_generation = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_labels => value_labels = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_managed_fields => value_managed_fields = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_name => value_name = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_owner_references => value_owner_references = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_resource_version => value_resource_version = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_self_link => value_self_link = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_uid => value_uid = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Other => { let _: crate::serde::de::IgnoredAny = crate::serde::de::MapAccess::next_value(&mut map)?; }, + } + } + + Ok(ClusterObjectMeta { + annotations: value_annotations, + cluster_name: value_cluster_name, + creation_timestamp: value_creation_timestamp, + deletion_grace_period_seconds: value_deletion_grace_period_seconds, + deletion_timestamp: value_deletion_timestamp, + finalizers: value_finalizers, + generate_name: value_generate_name, + generation: value_generation, + labels: value_labels, + managed_fields: value_managed_fields, + name: value_name, + owner_references: value_owner_references, + resource_version: value_resource_version, + self_link: value_self_link, + uid: value_uid, + }) + } + } + + deserializer.deserialize_struct( + "ClusterObjectMeta", + &[ + "annotations", + "clusterName", + "creationTimestamp", + "deletionGracePeriodSeconds", + "deletionTimestamp", + "finalizers", + "generateName", + "generation", + "labels", + "managedFields", + "name", + "ownerReferences", + "resourceVersion", + "selfLink", + "uid", + ], + Visitor, + ) + } +} + +impl crate::serde::Serialize for ClusterObjectMeta { + fn serialize(&self, serializer: S) -> Result where S: crate::serde::Serializer { + let mut state = serializer.serialize_struct( + "ClusterObjectMeta", + self.annotations.as_ref().map_or(0, |_| 1) + + self.cluster_name.as_ref().map_or(0, |_| 1) + + self.creation_timestamp.as_ref().map_or(0, |_| 1) + + self.deletion_grace_period_seconds.as_ref().map_or(0, |_| 1) + + self.deletion_timestamp.as_ref().map_or(0, |_| 1) + + self.finalizers.as_ref().map_or(0, |_| 1) + + self.generate_name.as_ref().map_or(0, |_| 1) + + self.generation.as_ref().map_or(0, |_| 1) + + self.labels.as_ref().map_or(0, |_| 1) + + self.managed_fields.as_ref().map_or(0, |_| 1) + + self.name.as_ref().map_or(0, |_| 1) + + self.owner_references.as_ref().map_or(0, |_| 1) + + self.resource_version.as_ref().map_or(0, |_| 1) + + self.self_link.as_ref().map_or(0, |_| 1) + + self.uid.as_ref().map_or(0, |_| 1), + )?; + if let Some(value) = &self.annotations { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "annotations", value)?; + } + if let Some(value) = &self.cluster_name { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "clusterName", value)?; + } + if let Some(value) = &self.creation_timestamp { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "creationTimestamp", value)?; + } + if let Some(value) = &self.deletion_grace_period_seconds { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "deletionGracePeriodSeconds", value)?; + } + if let Some(value) = &self.deletion_timestamp { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "deletionTimestamp", value)?; + } + if let Some(value) = &self.finalizers { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "finalizers", value)?; + } + if let Some(value) = &self.generate_name { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "generateName", value)?; + } + if let Some(value) = &self.generation { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "generation", value)?; + } + if let Some(value) = &self.labels { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "labels", value)?; + } + if let Some(value) = &self.managed_fields { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "managedFields", value)?; + } + if let Some(value) = &self.name { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "name", value)?; + } + if let Some(value) = &self.owner_references { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "ownerReferences", value)?; + } + if let Some(value) = &self.resource_version { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "resourceVersion", value)?; + } + if let Some(value) = &self.self_link { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "selfLink", value)?; + } + if let Some(value) = &self.uid { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "uid", value)?; + } + crate::serde::ser::SerializeStruct::end(state) + } +} + +#[cfg(feature = "schemars")] +impl crate::schemars::JsonSchema for ClusterObjectMeta { + fn schema_name() -> String { + "io.k8s.apimachinery.pkg.apis.meta.v1.ClusterObjectMeta".to_owned() + } + + fn json_schema(__gen: &mut crate::schemars::gen::SchemaGenerator) -> crate::schemars::schema::Schema { + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Object))), + object: Some(Box::new(crate::schemars::schema::ObjectValidation { + properties: [ + ( + "annotations".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Object))), + object: Some(Box::new(crate::schemars::schema::ObjectValidation { + additional_properties: Some(Box::new( + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }) + )), + ..Default::default() + })), + ..Default::default() + }), + ), + ( + "clusterName".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("The name of the cluster which the object belongs to. This is used to distinguish resources with same name and namespace in different clusters. This field is not set anywhere right now and apiserver is going to ignore it if set in create or update request.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ( + "creationTimestamp".to_owned(), + { + let mut schema_obj = __gen.subschema_for::().into_object(); + schema_obj.metadata = Some(Box::new(crate::schemars::schema::Metadata { + description: Some("CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC.\n\nPopulated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata".to_owned()), + ..Default::default() + })); + crate::schemars::schema::Schema::Object(schema_obj) + }, + ), + ( + "deletionGracePeriodSeconds".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Number of seconds allowed for this object to gracefully terminate before it will be removed from the system. Only set when deletionTimestamp is also set. May only be shortened. Read-only.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Integer))), + format: Some("int64".to_owned()), + ..Default::default() + }), + ), + ( + "deletionTimestamp".to_owned(), + { + let mut schema_obj = __gen.subschema_for::().into_object(); + schema_obj.metadata = Some(Box::new(crate::schemars::schema::Metadata { + description: Some("DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This field is set by the server when a graceful deletion is requested by the user, and is not directly settable by a client. The resource is expected to be deleted (no longer visible from resource lists, and not reachable by name) after the time in this field, once the finalizers list is empty. As long as the finalizers list contains items, deletion is blocked. Once the deletionTimestamp is set, this value may not be unset or be set further into the future, although it may be shortened or the resource may be deleted prior to this time. For example, a user may request that a pod is deleted in 30 seconds. The Kubelet will react by sending a graceful termination signal to the containers in the pod. After that 30 seconds, the Kubelet will send a hard termination signal (SIGKILL) to the container and after cleanup, remove the pod from the API. In the presence of network partitions, this object may still exist after this timestamp, until an administrator or automated process can determine the resource is fully terminated. If not set, graceful deletion of the object has not been requested.\n\nPopulated by the system when a graceful deletion is requested. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata".to_owned()), + ..Default::default() + })); + crate::schemars::schema::Schema::Object(schema_obj) + }, + ), + ( + "finalizers".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Must be empty before the object is deleted from the registry. Each entry is an identifier for the responsible component that will remove the entry from the list. If the deletionTimestamp of the object is non-nil, entries in this list can only be removed. Finalizers may be processed and removed in any order. Order is NOT enforced because it introduces significant risk of stuck finalizers. finalizers is a shared field, any actor with permission can reorder it. If the finalizer list is processed in order, then this can lead to a situation in which the component responsible for the first finalizer in the list is waiting for a signal (field value, external system, or other) produced by a component responsible for a finalizer later in the list, resulting in a deadlock. Without enforced ordering finalizers are free to order amongst themselves and are not vulnerable to ordering changes in the list.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Array))), + array: Some(Box::new(crate::schemars::schema::ArrayValidation { + items: Some(crate::schemars::schema::SingleOrVec::Single(Box::new( + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }) + ))), + ..Default::default() + })), + ..Default::default() + }), + ), + ( + "generateName".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("GenerateName is an optional prefix, used by the server, to generate a unique name ONLY IF the Name field has not been provided. If this field is used, the name returned to the client will be different than the name passed. This value will also be combined with a unique suffix. The provided value has the same validation rules as the Name field, and may be truncated by the length of the suffix required to make the value unique on the server.\n\nIf this field is specified and the generated name exists, the server will NOT return a 409 - instead, it will either return 201 Created or 500 with Reason ServerTimeout indicating a unique name could not be found in the time allotted, and the client should retry (optionally after the time indicated in the Retry-After header).\n\nApplied only if Name is not specified. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#idempotency".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ( + "generation".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("A sequence number representing a specific generation of the desired state. Populated by the system. Read-only.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Integer))), + format: Some("int64".to_owned()), + ..Default::default() + }), + ), + ( + "labels".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Object))), + object: Some(Box::new(crate::schemars::schema::ObjectValidation { + additional_properties: Some(Box::new( + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }) + )), + ..Default::default() + })), + ..Default::default() + }), + ), + ( + "managedFields".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("ManagedFields maps workflow-id and version to the set of fields that are managed by that workflow. This is mostly for internal housekeeping, and users typically shouldn't need to set or understand this field. A workflow can be the user's name, a controller's name, or the name of a specific apply path like \"ci-cd\". The set of fields is always in the version that the workflow used when modifying the object.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Array))), + array: Some(Box::new(crate::schemars::schema::ArrayValidation { + items: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(__gen.subschema_for::()))), + ..Default::default() + })), + ..Default::default() + }), + ), + ( + "name".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ( + "ownerReferences".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Array))), + array: Some(Box::new(crate::schemars::schema::ArrayValidation { + items: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(__gen.subschema_for::()))), + ..Default::default() + })), + ..Default::default() + }), + ), + ( + "resourceVersion".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("An opaque value that represents the internal version of this object that can be used by clients to determine when objects have changed. May be used for optimistic concurrency, change detection, and the watch operation on a resource or set of resources. Clients must treat these values as opaque and passed unmodified back to the server. They may only be valid for a particular resource or set of resources.\n\nPopulated by the system. Read-only. Value must be treated as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ( + "selfLink".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("SelfLink is a URL representing this object. Populated by the system. Read-only.\n\nDEPRECATED Kubernetes will stop propagating this field in 1.20 release and the field is planned to be removed in 1.21 release.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ( + "uid".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("UID is the unique in time and space value for this object. It is typically generated by the server on successful creation of a resource and is not allowed to change on PUT operations.\n\nPopulated by the system. Read-only. More info: http://kubernetes.io/docs/user-guide/identifiers#uids".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ].into(), + ..Default::default() + })), + ..Default::default() + }) + } +} diff --git a/src/v1_20/apimachinery/pkg/apis/meta/v1/mod.rs b/src/v1_20/apimachinery/pkg/apis/meta/v1/mod.rs index 9424127582..221a712e6d 100644 --- a/src/v1_20/apimachinery/pkg/apis/meta/v1/mod.rs +++ b/src/v1_20/apimachinery/pkg/apis/meta/v1/mod.rs @@ -14,6 +14,9 @@ pub use self::api_resource_list::APIResourceList; mod api_versions; pub use self::api_versions::APIVersions; +mod cluster_object_meta; +pub use self::cluster_object_meta::ClusterObjectMeta; + mod condition; pub use self::condition::Condition; @@ -65,6 +68,9 @@ pub use self::status_cause::StatusCause; mod status_details; pub use self::status_details::StatusDetails; +mod sub_object_meta; +pub use self::sub_object_meta::SubObjectMeta; + mod time; pub use self::time::Time; diff --git a/src/v1_20/apimachinery/pkg/apis/meta/v1/object_meta.rs b/src/v1_20/apimachinery/pkg/apis/meta/v1/object_meta.rs index c6b37624f5..8dd25439cd 100644 --- a/src/v1_20/apimachinery/pkg/apis/meta/v1/object_meta.rs +++ b/src/v1_20/apimachinery/pkg/apis/meta/v1/object_meta.rs @@ -47,7 +47,7 @@ pub struct ObjectMeta { /// Namespace defines the space within which each name must be unique. An empty namespace is equivalent to the "default" namespace, but "default" is the canonical representation. Not all objects are required to be scoped to a namespace - the value of this field for those objects will be empty. /// /// Must be a DNS_LABEL. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/namespaces - pub namespace: Option, + pub namespace: String, /// List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller. pub owner_references: Option>, @@ -211,7 +211,7 @@ impl<'de> crate::serde::Deserialize<'de> for ObjectMeta { labels: value_labels, managed_fields: value_managed_fields, name: value_name, - namespace: value_namespace, + namespace: value_namespace.unwrap_or_default(), owner_references: value_owner_references, resource_version: value_resource_version, self_link: value_self_link, @@ -249,6 +249,7 @@ impl crate::serde::Serialize for ObjectMeta { fn serialize(&self, serializer: S) -> Result where S: crate::serde::Serializer { let mut state = serializer.serialize_struct( "ObjectMeta", + 1 + self.annotations.as_ref().map_or(0, |_| 1) + self.cluster_name.as_ref().map_or(0, |_| 1) + self.creation_timestamp.as_ref().map_or(0, |_| 1) + @@ -260,7 +261,6 @@ impl crate::serde::Serialize for ObjectMeta { self.labels.as_ref().map_or(0, |_| 1) + self.managed_fields.as_ref().map_or(0, |_| 1) + self.name.as_ref().map_or(0, |_| 1) + - self.namespace.as_ref().map_or(0, |_| 1) + self.owner_references.as_ref().map_or(0, |_| 1) + self.resource_version.as_ref().map_or(0, |_| 1) + self.self_link.as_ref().map_or(0, |_| 1) + @@ -299,9 +299,7 @@ impl crate::serde::Serialize for ObjectMeta { if let Some(value) = &self.name { crate::serde::ser::SerializeStruct::serialize_field(&mut state, "name", value)?; } - if let Some(value) = &self.namespace { - crate::serde::ser::SerializeStruct::serialize_field(&mut state, "namespace", value)?; - } + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "namespace", &self.namespace)?; if let Some(value) = &self.owner_references { crate::serde::ser::SerializeStruct::serialize_field(&mut state, "ownerReferences", value)?; } @@ -547,6 +545,9 @@ impl crate::schemars::JsonSchema for ObjectMeta { }), ), ].into(), + required: [ + "namespace".to_owned(), + ].into(), ..Default::default() })), ..Default::default() diff --git a/src/v1_20/apimachinery/pkg/apis/meta/v1/sub_object_meta.rs b/src/v1_20/apimachinery/pkg/apis/meta/v1/sub_object_meta.rs new file mode 100644 index 0000000000..61046989c6 --- /dev/null +++ b/src/v1_20/apimachinery/pkg/apis/meta/v1/sub_object_meta.rs @@ -0,0 +1,555 @@ +// Generated from definition io.k8s.apimachinery.pkg.apis.meta.v1.SubObjectMeta + +/// ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create. +#[derive(Clone, Debug, Default, PartialEq)] +pub struct SubObjectMeta { + /// Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations + pub annotations: Option>, + + /// The name of the cluster which the object belongs to. This is used to distinguish resources with same name and namespace in different clusters. This field is not set anywhere right now and apiserver is going to ignore it if set in create or update request. + pub cluster_name: Option, + + /// CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC. + /// + /// Populated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + pub creation_timestamp: Option, + + /// Number of seconds allowed for this object to gracefully terminate before it will be removed from the system. Only set when deletionTimestamp is also set. May only be shortened. Read-only. + pub deletion_grace_period_seconds: Option, + + /// DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This field is set by the server when a graceful deletion is requested by the user, and is not directly settable by a client. The resource is expected to be deleted (no longer visible from resource lists, and not reachable by name) after the time in this field, once the finalizers list is empty. As long as the finalizers list contains items, deletion is blocked. Once the deletionTimestamp is set, this value may not be unset or be set further into the future, although it may be shortened or the resource may be deleted prior to this time. For example, a user may request that a pod is deleted in 30 seconds. The Kubelet will react by sending a graceful termination signal to the containers in the pod. After that 30 seconds, the Kubelet will send a hard termination signal (SIGKILL) to the container and after cleanup, remove the pod from the API. In the presence of network partitions, this object may still exist after this timestamp, until an administrator or automated process can determine the resource is fully terminated. If not set, graceful deletion of the object has not been requested. + /// + /// Populated by the system when a graceful deletion is requested. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + pub deletion_timestamp: Option, + + /// Must be empty before the object is deleted from the registry. Each entry is an identifier for the responsible component that will remove the entry from the list. If the deletionTimestamp of the object is non-nil, entries in this list can only be removed. Finalizers may be processed and removed in any order. Order is NOT enforced because it introduces significant risk of stuck finalizers. finalizers is a shared field, any actor with permission can reorder it. If the finalizer list is processed in order, then this can lead to a situation in which the component responsible for the first finalizer in the list is waiting for a signal (field value, external system, or other) produced by a component responsible for a finalizer later in the list, resulting in a deadlock. Without enforced ordering finalizers are free to order amongst themselves and are not vulnerable to ordering changes in the list. + pub finalizers: Option>, + + /// GenerateName is an optional prefix, used by the server, to generate a unique name ONLY IF the Name field has not been provided. If this field is used, the name returned to the client will be different than the name passed. This value will also be combined with a unique suffix. The provided value has the same validation rules as the Name field, and may be truncated by the length of the suffix required to make the value unique on the server. + /// + /// If this field is specified and the generated name exists, the server will NOT return a 409 - instead, it will either return 201 Created or 500 with Reason ServerTimeout indicating a unique name could not be found in the time allotted, and the client should retry (optionally after the time indicated in the Retry-After header). + /// + /// Applied only if Name is not specified. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#idempotency + pub generate_name: Option, + + /// A sequence number representing a specific generation of the desired state. Populated by the system. Read-only. + pub generation: Option, + + /// Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels + pub labels: Option>, + + /// ManagedFields maps workflow-id and version to the set of fields that are managed by that workflow. This is mostly for internal housekeeping, and users typically shouldn't need to set or understand this field. A workflow can be the user's name, a controller's name, or the name of a specific apply path like "ci-cd". The set of fields is always in the version that the workflow used when modifying the object. + pub managed_fields: Option>, + + /// Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names + pub name: Option, + + /// Namespace defines the space within which each name must be unique. An empty namespace is equivalent to the "default" namespace, but "default" is the canonical representation. Not all objects are required to be scoped to a namespace - the value of this field for those objects will be empty. + /// + /// Must be a DNS_LABEL. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/namespaces + pub namespace: Option, + + /// List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller. + pub owner_references: Option>, + + /// An opaque value that represents the internal version of this object that can be used by clients to determine when objects have changed. May be used for optimistic concurrency, change detection, and the watch operation on a resource or set of resources. Clients must treat these values as opaque and passed unmodified back to the server. They may only be valid for a particular resource or set of resources. + /// + /// Populated by the system. Read-only. Value must be treated as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency + pub resource_version: Option, + + /// SelfLink is a URL representing this object. Populated by the system. Read-only. + /// + /// DEPRECATED Kubernetes will stop propagating this field in 1.20 release and the field is planned to be removed in 1.21 release. + pub self_link: Option, + + /// UID is the unique in time and space value for this object. It is typically generated by the server on successful creation of a resource and is not allowed to change on PUT operations. + /// + /// Populated by the system. Read-only. More info: http://kubernetes.io/docs/user-guide/identifiers#uids + pub uid: Option, +} + +impl crate::DeepMerge for SubObjectMeta { + fn merge_from(&mut self, other: Self) { + crate::DeepMerge::merge_from(&mut self.annotations, other.annotations); + crate::DeepMerge::merge_from(&mut self.cluster_name, other.cluster_name); + crate::DeepMerge::merge_from(&mut self.creation_timestamp, other.creation_timestamp); + crate::DeepMerge::merge_from(&mut self.deletion_grace_period_seconds, other.deletion_grace_period_seconds); + crate::DeepMerge::merge_from(&mut self.deletion_timestamp, other.deletion_timestamp); + crate::DeepMerge::merge_from(&mut self.finalizers, other.finalizers); + crate::DeepMerge::merge_from(&mut self.generate_name, other.generate_name); + crate::DeepMerge::merge_from(&mut self.generation, other.generation); + crate::DeepMerge::merge_from(&mut self.labels, other.labels); + crate::DeepMerge::merge_from(&mut self.managed_fields, other.managed_fields); + crate::DeepMerge::merge_from(&mut self.name, other.name); + crate::DeepMerge::merge_from(&mut self.namespace, other.namespace); + crate::DeepMerge::merge_from(&mut self.owner_references, other.owner_references); + crate::DeepMerge::merge_from(&mut self.resource_version, other.resource_version); + crate::DeepMerge::merge_from(&mut self.self_link, other.self_link); + crate::DeepMerge::merge_from(&mut self.uid, other.uid); + } +} + +impl<'de> crate::serde::Deserialize<'de> for SubObjectMeta { + fn deserialize(deserializer: D) -> Result where D: crate::serde::Deserializer<'de> { + #[allow(non_camel_case_types)] + enum Field { + Key_annotations, + Key_cluster_name, + Key_creation_timestamp, + Key_deletion_grace_period_seconds, + Key_deletion_timestamp, + Key_finalizers, + Key_generate_name, + Key_generation, + Key_labels, + Key_managed_fields, + Key_name, + Key_namespace, + Key_owner_references, + Key_resource_version, + Key_self_link, + Key_uid, + Other, + } + + impl<'de> crate::serde::Deserialize<'de> for Field { + fn deserialize(deserializer: D) -> Result where D: crate::serde::Deserializer<'de> { + struct Visitor; + + impl<'de> crate::serde::de::Visitor<'de> for Visitor { + type Value = Field; + + fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.write_str("field identifier") + } + + fn visit_str(self, v: &str) -> Result where E: crate::serde::de::Error { + Ok(match v { + "annotations" => Field::Key_annotations, + "clusterName" => Field::Key_cluster_name, + "creationTimestamp" => Field::Key_creation_timestamp, + "deletionGracePeriodSeconds" => Field::Key_deletion_grace_period_seconds, + "deletionTimestamp" => Field::Key_deletion_timestamp, + "finalizers" => Field::Key_finalizers, + "generateName" => Field::Key_generate_name, + "generation" => Field::Key_generation, + "labels" => Field::Key_labels, + "managedFields" => Field::Key_managed_fields, + "name" => Field::Key_name, + "namespace" => Field::Key_namespace, + "ownerReferences" => Field::Key_owner_references, + "resourceVersion" => Field::Key_resource_version, + "selfLink" => Field::Key_self_link, + "uid" => Field::Key_uid, + _ => Field::Other, + }) + } + } + + deserializer.deserialize_identifier(Visitor) + } + } + + struct Visitor; + + impl<'de> crate::serde::de::Visitor<'de> for Visitor { + type Value = SubObjectMeta; + + fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.write_str("SubObjectMeta") + } + + fn visit_map(self, mut map: A) -> Result where A: crate::serde::de::MapAccess<'de> { + let mut value_annotations: Option> = None; + let mut value_cluster_name: Option = None; + let mut value_creation_timestamp: Option = None; + let mut value_deletion_grace_period_seconds: Option = None; + let mut value_deletion_timestamp: Option = None; + let mut value_finalizers: Option> = None; + let mut value_generate_name: Option = None; + let mut value_generation: Option = None; + let mut value_labels: Option> = None; + let mut value_managed_fields: Option> = None; + let mut value_name: Option = None; + let mut value_namespace: Option = None; + let mut value_owner_references: Option> = None; + let mut value_resource_version: Option = None; + let mut value_self_link: Option = None; + let mut value_uid: Option = None; + + while let Some(key) = crate::serde::de::MapAccess::next_key::(&mut map)? { + match key { + Field::Key_annotations => value_annotations = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_cluster_name => value_cluster_name = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_creation_timestamp => value_creation_timestamp = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_deletion_grace_period_seconds => value_deletion_grace_period_seconds = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_deletion_timestamp => value_deletion_timestamp = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_finalizers => value_finalizers = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_generate_name => value_generate_name = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_generation => value_generation = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_labels => value_labels = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_managed_fields => value_managed_fields = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_name => value_name = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_namespace => value_namespace = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_owner_references => value_owner_references = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_resource_version => value_resource_version = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_self_link => value_self_link = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_uid => value_uid = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Other => { let _: crate::serde::de::IgnoredAny = crate::serde::de::MapAccess::next_value(&mut map)?; }, + } + } + + Ok(SubObjectMeta { + annotations: value_annotations, + cluster_name: value_cluster_name, + creation_timestamp: value_creation_timestamp, + deletion_grace_period_seconds: value_deletion_grace_period_seconds, + deletion_timestamp: value_deletion_timestamp, + finalizers: value_finalizers, + generate_name: value_generate_name, + generation: value_generation, + labels: value_labels, + managed_fields: value_managed_fields, + name: value_name, + namespace: value_namespace, + owner_references: value_owner_references, + resource_version: value_resource_version, + self_link: value_self_link, + uid: value_uid, + }) + } + } + + deserializer.deserialize_struct( + "SubObjectMeta", + &[ + "annotations", + "clusterName", + "creationTimestamp", + "deletionGracePeriodSeconds", + "deletionTimestamp", + "finalizers", + "generateName", + "generation", + "labels", + "managedFields", + "name", + "namespace", + "ownerReferences", + "resourceVersion", + "selfLink", + "uid", + ], + Visitor, + ) + } +} + +impl crate::serde::Serialize for SubObjectMeta { + fn serialize(&self, serializer: S) -> Result where S: crate::serde::Serializer { + let mut state = serializer.serialize_struct( + "SubObjectMeta", + self.annotations.as_ref().map_or(0, |_| 1) + + self.cluster_name.as_ref().map_or(0, |_| 1) + + self.creation_timestamp.as_ref().map_or(0, |_| 1) + + self.deletion_grace_period_seconds.as_ref().map_or(0, |_| 1) + + self.deletion_timestamp.as_ref().map_or(0, |_| 1) + + self.finalizers.as_ref().map_or(0, |_| 1) + + self.generate_name.as_ref().map_or(0, |_| 1) + + self.generation.as_ref().map_or(0, |_| 1) + + self.labels.as_ref().map_or(0, |_| 1) + + self.managed_fields.as_ref().map_or(0, |_| 1) + + self.name.as_ref().map_or(0, |_| 1) + + self.namespace.as_ref().map_or(0, |_| 1) + + self.owner_references.as_ref().map_or(0, |_| 1) + + self.resource_version.as_ref().map_or(0, |_| 1) + + self.self_link.as_ref().map_or(0, |_| 1) + + self.uid.as_ref().map_or(0, |_| 1), + )?; + if let Some(value) = &self.annotations { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "annotations", value)?; + } + if let Some(value) = &self.cluster_name { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "clusterName", value)?; + } + if let Some(value) = &self.creation_timestamp { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "creationTimestamp", value)?; + } + if let Some(value) = &self.deletion_grace_period_seconds { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "deletionGracePeriodSeconds", value)?; + } + if let Some(value) = &self.deletion_timestamp { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "deletionTimestamp", value)?; + } + if let Some(value) = &self.finalizers { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "finalizers", value)?; + } + if let Some(value) = &self.generate_name { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "generateName", value)?; + } + if let Some(value) = &self.generation { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "generation", value)?; + } + if let Some(value) = &self.labels { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "labels", value)?; + } + if let Some(value) = &self.managed_fields { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "managedFields", value)?; + } + if let Some(value) = &self.name { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "name", value)?; + } + if let Some(value) = &self.namespace { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "namespace", value)?; + } + if let Some(value) = &self.owner_references { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "ownerReferences", value)?; + } + if let Some(value) = &self.resource_version { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "resourceVersion", value)?; + } + if let Some(value) = &self.self_link { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "selfLink", value)?; + } + if let Some(value) = &self.uid { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "uid", value)?; + } + crate::serde::ser::SerializeStruct::end(state) + } +} + +#[cfg(feature = "schemars")] +impl crate::schemars::JsonSchema for SubObjectMeta { + fn schema_name() -> String { + "io.k8s.apimachinery.pkg.apis.meta.v1.SubObjectMeta".to_owned() + } + + fn json_schema(__gen: &mut crate::schemars::gen::SchemaGenerator) -> crate::schemars::schema::Schema { + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Object))), + object: Some(Box::new(crate::schemars::schema::ObjectValidation { + properties: [ + ( + "annotations".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Object))), + object: Some(Box::new(crate::schemars::schema::ObjectValidation { + additional_properties: Some(Box::new( + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }) + )), + ..Default::default() + })), + ..Default::default() + }), + ), + ( + "clusterName".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("The name of the cluster which the object belongs to. This is used to distinguish resources with same name and namespace in different clusters. This field is not set anywhere right now and apiserver is going to ignore it if set in create or update request.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ( + "creationTimestamp".to_owned(), + { + let mut schema_obj = __gen.subschema_for::().into_object(); + schema_obj.metadata = Some(Box::new(crate::schemars::schema::Metadata { + description: Some("CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC.\n\nPopulated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata".to_owned()), + ..Default::default() + })); + crate::schemars::schema::Schema::Object(schema_obj) + }, + ), + ( + "deletionGracePeriodSeconds".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Number of seconds allowed for this object to gracefully terminate before it will be removed from the system. Only set when deletionTimestamp is also set. May only be shortened. Read-only.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Integer))), + format: Some("int64".to_owned()), + ..Default::default() + }), + ), + ( + "deletionTimestamp".to_owned(), + { + let mut schema_obj = __gen.subschema_for::().into_object(); + schema_obj.metadata = Some(Box::new(crate::schemars::schema::Metadata { + description: Some("DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This field is set by the server when a graceful deletion is requested by the user, and is not directly settable by a client. The resource is expected to be deleted (no longer visible from resource lists, and not reachable by name) after the time in this field, once the finalizers list is empty. As long as the finalizers list contains items, deletion is blocked. Once the deletionTimestamp is set, this value may not be unset or be set further into the future, although it may be shortened or the resource may be deleted prior to this time. For example, a user may request that a pod is deleted in 30 seconds. The Kubelet will react by sending a graceful termination signal to the containers in the pod. After that 30 seconds, the Kubelet will send a hard termination signal (SIGKILL) to the container and after cleanup, remove the pod from the API. In the presence of network partitions, this object may still exist after this timestamp, until an administrator or automated process can determine the resource is fully terminated. If not set, graceful deletion of the object has not been requested.\n\nPopulated by the system when a graceful deletion is requested. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata".to_owned()), + ..Default::default() + })); + crate::schemars::schema::Schema::Object(schema_obj) + }, + ), + ( + "finalizers".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Must be empty before the object is deleted from the registry. Each entry is an identifier for the responsible component that will remove the entry from the list. If the deletionTimestamp of the object is non-nil, entries in this list can only be removed. Finalizers may be processed and removed in any order. Order is NOT enforced because it introduces significant risk of stuck finalizers. finalizers is a shared field, any actor with permission can reorder it. If the finalizer list is processed in order, then this can lead to a situation in which the component responsible for the first finalizer in the list is waiting for a signal (field value, external system, or other) produced by a component responsible for a finalizer later in the list, resulting in a deadlock. Without enforced ordering finalizers are free to order amongst themselves and are not vulnerable to ordering changes in the list.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Array))), + array: Some(Box::new(crate::schemars::schema::ArrayValidation { + items: Some(crate::schemars::schema::SingleOrVec::Single(Box::new( + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }) + ))), + ..Default::default() + })), + ..Default::default() + }), + ), + ( + "generateName".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("GenerateName is an optional prefix, used by the server, to generate a unique name ONLY IF the Name field has not been provided. If this field is used, the name returned to the client will be different than the name passed. This value will also be combined with a unique suffix. The provided value has the same validation rules as the Name field, and may be truncated by the length of the suffix required to make the value unique on the server.\n\nIf this field is specified and the generated name exists, the server will NOT return a 409 - instead, it will either return 201 Created or 500 with Reason ServerTimeout indicating a unique name could not be found in the time allotted, and the client should retry (optionally after the time indicated in the Retry-After header).\n\nApplied only if Name is not specified. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#idempotency".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ( + "generation".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("A sequence number representing a specific generation of the desired state. Populated by the system. Read-only.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Integer))), + format: Some("int64".to_owned()), + ..Default::default() + }), + ), + ( + "labels".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Object))), + object: Some(Box::new(crate::schemars::schema::ObjectValidation { + additional_properties: Some(Box::new( + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }) + )), + ..Default::default() + })), + ..Default::default() + }), + ), + ( + "managedFields".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("ManagedFields maps workflow-id and version to the set of fields that are managed by that workflow. This is mostly for internal housekeeping, and users typically shouldn't need to set or understand this field. A workflow can be the user's name, a controller's name, or the name of a specific apply path like \"ci-cd\". The set of fields is always in the version that the workflow used when modifying the object.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Array))), + array: Some(Box::new(crate::schemars::schema::ArrayValidation { + items: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(__gen.subschema_for::()))), + ..Default::default() + })), + ..Default::default() + }), + ), + ( + "name".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ( + "namespace".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Namespace defines the space within which each name must be unique. An empty namespace is equivalent to the \"default\" namespace, but \"default\" is the canonical representation. Not all objects are required to be scoped to a namespace - the value of this field for those objects will be empty.\n\nMust be a DNS_LABEL. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/namespaces".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ( + "ownerReferences".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Array))), + array: Some(Box::new(crate::schemars::schema::ArrayValidation { + items: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(__gen.subschema_for::()))), + ..Default::default() + })), + ..Default::default() + }), + ), + ( + "resourceVersion".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("An opaque value that represents the internal version of this object that can be used by clients to determine when objects have changed. May be used for optimistic concurrency, change detection, and the watch operation on a resource or set of resources. Clients must treat these values as opaque and passed unmodified back to the server. They may only be valid for a particular resource or set of resources.\n\nPopulated by the system. Read-only. Value must be treated as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ( + "selfLink".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("SelfLink is a URL representing this object. Populated by the system. Read-only.\n\nDEPRECATED Kubernetes will stop propagating this field in 1.20 release and the field is planned to be removed in 1.21 release.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ( + "uid".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("UID is the unique in time and space value for this object. It is typically generated by the server on successful creation of a resource and is not allowed to change on PUT operations.\n\nPopulated by the system. Read-only. More info: http://kubernetes.io/docs/user-guide/identifiers#uids".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ].into(), + ..Default::default() + })), + ..Default::default() + }) + } +} diff --git a/src/v1_20/kube_aggregator/pkg/apis/apiregistration/v1/api_service.rs b/src/v1_20/kube_aggregator/pkg/apis/apiregistration/v1/api_service.rs index 0f9b7b9c11..6322aca412 100644 --- a/src/v1_20/kube_aggregator/pkg/apis/apiregistration/v1/api_service.rs +++ b/src/v1_20/kube_aggregator/pkg/apis/apiregistration/v1/api_service.rs @@ -515,7 +515,7 @@ impl crate::ListableResource for APIService { } impl crate::Metadata for APIService { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_20/kube_aggregator/pkg/apis/apiregistration/v1beta1/api_service.rs b/src/v1_20/kube_aggregator/pkg/apis/apiregistration/v1beta1/api_service.rs index 14feb9453e..b28ee8ecb9 100644 --- a/src/v1_20/kube_aggregator/pkg/apis/apiregistration/v1beta1/api_service.rs +++ b/src/v1_20/kube_aggregator/pkg/apis/apiregistration/v1beta1/api_service.rs @@ -515,7 +515,7 @@ impl crate::ListableResource for APIService { } impl crate::Metadata for APIService { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_21/api/admissionregistration/v1/mutating_webhook_configuration.rs b/src/v1_21/api/admissionregistration/v1/mutating_webhook_configuration.rs index cb8ec8f5af..e0f9531189 100644 --- a/src/v1_21/api/admissionregistration/v1/mutating_webhook_configuration.rs +++ b/src/v1_21/api/admissionregistration/v1/mutating_webhook_configuration.rs @@ -360,7 +360,7 @@ impl crate::ListableResource for MutatingWebhookConfiguration { } impl crate::Metadata for MutatingWebhookConfiguration { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_21/api/admissionregistration/v1/validating_webhook_configuration.rs b/src/v1_21/api/admissionregistration/v1/validating_webhook_configuration.rs index 4c520b0eeb..4cf73a02cb 100644 --- a/src/v1_21/api/admissionregistration/v1/validating_webhook_configuration.rs +++ b/src/v1_21/api/admissionregistration/v1/validating_webhook_configuration.rs @@ -360,7 +360,7 @@ impl crate::ListableResource for ValidatingWebhookConfiguration { } impl crate::Metadata for ValidatingWebhookConfiguration { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_21/api/admissionregistration/v1beta1/mutating_webhook_configuration.rs b/src/v1_21/api/admissionregistration/v1beta1/mutating_webhook_configuration.rs index 775b511d0d..4f79bd4b80 100644 --- a/src/v1_21/api/admissionregistration/v1beta1/mutating_webhook_configuration.rs +++ b/src/v1_21/api/admissionregistration/v1beta1/mutating_webhook_configuration.rs @@ -360,7 +360,7 @@ impl crate::ListableResource for MutatingWebhookConfiguration { } impl crate::Metadata for MutatingWebhookConfiguration { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_21/api/admissionregistration/v1beta1/validating_webhook_configuration.rs b/src/v1_21/api/admissionregistration/v1beta1/validating_webhook_configuration.rs index 5caa78900d..a818e121d7 100644 --- a/src/v1_21/api/admissionregistration/v1beta1/validating_webhook_configuration.rs +++ b/src/v1_21/api/admissionregistration/v1beta1/validating_webhook_configuration.rs @@ -360,7 +360,7 @@ impl crate::ListableResource for ValidatingWebhookConfiguration { } impl crate::Metadata for ValidatingWebhookConfiguration { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_21/api/apiserverinternal/v1alpha1/storage_version.rs b/src/v1_21/api/apiserverinternal/v1alpha1/storage_version.rs index 6b8779e542..600f1c0e24 100644 --- a/src/v1_21/api/apiserverinternal/v1alpha1/storage_version.rs +++ b/src/v1_21/api/apiserverinternal/v1alpha1/storage_version.rs @@ -517,7 +517,7 @@ impl crate::ListableResource for StorageVersion { } impl crate::Metadata for StorageVersion { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_21/api/authentication/v1/token_request.rs b/src/v1_21/api/authentication/v1/token_request.rs index 8a781af27c..234eab8f56 100644 --- a/src/v1_21/api/authentication/v1/token_request.rs +++ b/src/v1_21/api/authentication/v1/token_request.rs @@ -71,7 +71,7 @@ impl crate::Resource for TokenRequest { } impl crate::Metadata for TokenRequest { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::SubObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_21/api/authentication/v1/token_review.rs b/src/v1_21/api/authentication/v1/token_review.rs index f092debcd9..2110fe60e7 100644 --- a/src/v1_21/api/authentication/v1/token_review.rs +++ b/src/v1_21/api/authentication/v1/token_review.rs @@ -60,7 +60,7 @@ impl crate::Resource for TokenReview { } impl crate::Metadata for TokenReview { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_21/api/authentication/v1beta1/token_review.rs b/src/v1_21/api/authentication/v1beta1/token_review.rs index 4c5f53d424..a0d9b9e7a3 100644 --- a/src/v1_21/api/authentication/v1beta1/token_review.rs +++ b/src/v1_21/api/authentication/v1beta1/token_review.rs @@ -60,7 +60,7 @@ impl crate::Resource for TokenReview { } impl crate::Metadata for TokenReview { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_21/api/authorization/v1/self_subject_access_review.rs b/src/v1_21/api/authorization/v1/self_subject_access_review.rs index b6b08560f9..7af26ffb79 100644 --- a/src/v1_21/api/authorization/v1/self_subject_access_review.rs +++ b/src/v1_21/api/authorization/v1/self_subject_access_review.rs @@ -60,7 +60,7 @@ impl crate::Resource for SelfSubjectAccessReview { } impl crate::Metadata for SelfSubjectAccessReview { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_21/api/authorization/v1/self_subject_rules_review.rs b/src/v1_21/api/authorization/v1/self_subject_rules_review.rs index 9d4ff4b605..d380041f8e 100644 --- a/src/v1_21/api/authorization/v1/self_subject_rules_review.rs +++ b/src/v1_21/api/authorization/v1/self_subject_rules_review.rs @@ -60,7 +60,7 @@ impl crate::Resource for SelfSubjectRulesReview { } impl crate::Metadata for SelfSubjectRulesReview { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_21/api/authorization/v1/subject_access_review.rs b/src/v1_21/api/authorization/v1/subject_access_review.rs index 878707a834..e204ed491e 100644 --- a/src/v1_21/api/authorization/v1/subject_access_review.rs +++ b/src/v1_21/api/authorization/v1/subject_access_review.rs @@ -60,7 +60,7 @@ impl crate::Resource for SubjectAccessReview { } impl crate::Metadata for SubjectAccessReview { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_21/api/authorization/v1beta1/self_subject_access_review.rs b/src/v1_21/api/authorization/v1beta1/self_subject_access_review.rs index 6b8498e470..af2870fd1d 100644 --- a/src/v1_21/api/authorization/v1beta1/self_subject_access_review.rs +++ b/src/v1_21/api/authorization/v1beta1/self_subject_access_review.rs @@ -60,7 +60,7 @@ impl crate::Resource for SelfSubjectAccessReview { } impl crate::Metadata for SelfSubjectAccessReview { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_21/api/authorization/v1beta1/self_subject_rules_review.rs b/src/v1_21/api/authorization/v1beta1/self_subject_rules_review.rs index 4b9453f127..0b9ee49b3a 100644 --- a/src/v1_21/api/authorization/v1beta1/self_subject_rules_review.rs +++ b/src/v1_21/api/authorization/v1beta1/self_subject_rules_review.rs @@ -60,7 +60,7 @@ impl crate::Resource for SelfSubjectRulesReview { } impl crate::Metadata for SelfSubjectRulesReview { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_21/api/authorization/v1beta1/subject_access_review.rs b/src/v1_21/api/authorization/v1beta1/subject_access_review.rs index 503835cea6..01a7cd6650 100644 --- a/src/v1_21/api/authorization/v1beta1/subject_access_review.rs +++ b/src/v1_21/api/authorization/v1beta1/subject_access_review.rs @@ -60,7 +60,7 @@ impl crate::Resource for SubjectAccessReview { } impl crate::Metadata for SubjectAccessReview { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_21/api/autoscaling/v1/scale.rs b/src/v1_21/api/autoscaling/v1/scale.rs index 89a7024529..3fb0a7ea47 100644 --- a/src/v1_21/api/autoscaling/v1/scale.rs +++ b/src/v1_21/api/autoscaling/v1/scale.rs @@ -711,7 +711,7 @@ impl crate::Resource for Scale { } impl crate::Metadata for Scale { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::SubObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_21/api/certificates/v1/certificate_signing_request.rs b/src/v1_21/api/certificates/v1/certificate_signing_request.rs index 32030b6c3f..c94a31d4ad 100644 --- a/src/v1_21/api/certificates/v1/certificate_signing_request.rs +++ b/src/v1_21/api/certificates/v1/certificate_signing_request.rs @@ -674,7 +674,7 @@ impl crate::ListableResource for CertificateSigningRequest { } impl crate::Metadata for CertificateSigningRequest { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_21/api/certificates/v1beta1/certificate_signing_request.rs b/src/v1_21/api/certificates/v1beta1/certificate_signing_request.rs index 8522453ec0..b089f7e398 100644 --- a/src/v1_21/api/certificates/v1beta1/certificate_signing_request.rs +++ b/src/v1_21/api/certificates/v1beta1/certificate_signing_request.rs @@ -668,7 +668,7 @@ impl crate::ListableResource for CertificateSigningRequest { } impl crate::Metadata for CertificateSigningRequest { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_21/api/core/v1/component_status.rs b/src/v1_21/api/core/v1/component_status.rs index ecddf82170..ba505704c7 100644 --- a/src/v1_21/api/core/v1/component_status.rs +++ b/src/v1_21/api/core/v1/component_status.rs @@ -159,7 +159,7 @@ impl crate::ListableResource for ComponentStatus { } impl crate::Metadata for ComponentStatus { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_21/api/core/v1/ephemeral_containers.rs b/src/v1_21/api/core/v1/ephemeral_containers.rs index 1eaeeda13f..21b84d2765 100644 --- a/src/v1_21/api/core/v1/ephemeral_containers.rs +++ b/src/v1_21/api/core/v1/ephemeral_containers.rs @@ -194,7 +194,7 @@ impl crate::Resource for EphemeralContainers { } impl crate::Metadata for EphemeralContainers { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::SubObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_21/api/core/v1/namespace.rs b/src/v1_21/api/core/v1/namespace.rs index df31cdc0da..6600f8a3bb 100644 --- a/src/v1_21/api/core/v1/namespace.rs +++ b/src/v1_21/api/core/v1/namespace.rs @@ -516,7 +516,7 @@ impl crate::ListableResource for Namespace { } impl crate::Metadata for Namespace { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_21/api/core/v1/node.rs b/src/v1_21/api/core/v1/node.rs index 5a5694b818..d6e0aa6dfb 100644 --- a/src/v1_21/api/core/v1/node.rs +++ b/src/v1_21/api/core/v1/node.rs @@ -996,7 +996,7 @@ impl crate::ListableResource for Node { } impl crate::Metadata for Node { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_21/api/core/v1/persistent_volume.rs b/src/v1_21/api/core/v1/persistent_volume.rs index fada89f48e..7bd79040b6 100644 --- a/src/v1_21/api/core/v1/persistent_volume.rs +++ b/src/v1_21/api/core/v1/persistent_volume.rs @@ -516,7 +516,7 @@ impl crate::ListableResource for PersistentVolume { } impl crate::Metadata for PersistentVolume { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_21/api/flowcontrol/v1beta1/flow_schema.rs b/src/v1_21/api/flowcontrol/v1beta1/flow_schema.rs index 1d0546a710..e74328c4ec 100644 --- a/src/v1_21/api/flowcontrol/v1beta1/flow_schema.rs +++ b/src/v1_21/api/flowcontrol/v1beta1/flow_schema.rs @@ -516,7 +516,7 @@ impl crate::ListableResource for FlowSchema { } impl crate::Metadata for FlowSchema { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_21/api/flowcontrol/v1beta1/priority_level_configuration.rs b/src/v1_21/api/flowcontrol/v1beta1/priority_level_configuration.rs index 4cbe999e32..d4f148709d 100644 --- a/src/v1_21/api/flowcontrol/v1beta1/priority_level_configuration.rs +++ b/src/v1_21/api/flowcontrol/v1beta1/priority_level_configuration.rs @@ -516,7 +516,7 @@ impl crate::ListableResource for PriorityLevelConfiguration { } impl crate::Metadata for PriorityLevelConfiguration { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_21/api/networking/v1/ingress_class.rs b/src/v1_21/api/networking/v1/ingress_class.rs index d3ab7820c7..657d7e9809 100644 --- a/src/v1_21/api/networking/v1/ingress_class.rs +++ b/src/v1_21/api/networking/v1/ingress_class.rs @@ -360,7 +360,7 @@ impl crate::ListableResource for IngressClass { } impl crate::Metadata for IngressClass { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_21/api/networking/v1beta1/ingress_class.rs b/src/v1_21/api/networking/v1beta1/ingress_class.rs index 5be215bb48..98ba544a3a 100644 --- a/src/v1_21/api/networking/v1beta1/ingress_class.rs +++ b/src/v1_21/api/networking/v1beta1/ingress_class.rs @@ -360,7 +360,7 @@ impl crate::ListableResource for IngressClass { } impl crate::Metadata for IngressClass { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_21/api/node/v1/runtime_class.rs b/src/v1_21/api/node/v1/runtime_class.rs index b8b7e6e539..c36ce5ed64 100644 --- a/src/v1_21/api/node/v1/runtime_class.rs +++ b/src/v1_21/api/node/v1/runtime_class.rs @@ -368,7 +368,7 @@ impl crate::ListableResource for RuntimeClass { } impl crate::Metadata for RuntimeClass { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_21/api/node/v1alpha1/runtime_class.rs b/src/v1_21/api/node/v1alpha1/runtime_class.rs index df1df669f8..060e4c1d30 100644 --- a/src/v1_21/api/node/v1alpha1/runtime_class.rs +++ b/src/v1_21/api/node/v1alpha1/runtime_class.rs @@ -360,7 +360,7 @@ impl crate::ListableResource for RuntimeClass { } impl crate::Metadata for RuntimeClass { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_21/api/node/v1beta1/runtime_class.rs b/src/v1_21/api/node/v1beta1/runtime_class.rs index fc8dfaf5cc..cb28fb6aad 100644 --- a/src/v1_21/api/node/v1beta1/runtime_class.rs +++ b/src/v1_21/api/node/v1beta1/runtime_class.rs @@ -366,7 +366,7 @@ impl crate::ListableResource for RuntimeClass { } impl crate::Metadata for RuntimeClass { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_21/api/policy/v1beta1/eviction.rs b/src/v1_21/api/policy/v1beta1/eviction.rs index 2b2b23df89..a0c1c18d37 100644 --- a/src/v1_21/api/policy/v1beta1/eviction.rs +++ b/src/v1_21/api/policy/v1beta1/eviction.rs @@ -71,7 +71,7 @@ impl crate::Resource for Eviction { } impl crate::Metadata for Eviction { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::SubObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_21/api/policy/v1beta1/pod_security_policy.rs b/src/v1_21/api/policy/v1beta1/pod_security_policy.rs index 1a515209d1..fc536300b2 100644 --- a/src/v1_21/api/policy/v1beta1/pod_security_policy.rs +++ b/src/v1_21/api/policy/v1beta1/pod_security_policy.rs @@ -360,7 +360,7 @@ impl crate::ListableResource for PodSecurityPolicy { } impl crate::Metadata for PodSecurityPolicy { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_21/api/rbac/v1/cluster_role.rs b/src/v1_21/api/rbac/v1/cluster_role.rs index 8336e14c92..541d57c8ee 100644 --- a/src/v1_21/api/rbac/v1/cluster_role.rs +++ b/src/v1_21/api/rbac/v1/cluster_role.rs @@ -363,7 +363,7 @@ impl crate::ListableResource for ClusterRole { } impl crate::Metadata for ClusterRole { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_21/api/rbac/v1/cluster_role_binding.rs b/src/v1_21/api/rbac/v1/cluster_role_binding.rs index 0162a1128e..0f02a028d1 100644 --- a/src/v1_21/api/rbac/v1/cluster_role_binding.rs +++ b/src/v1_21/api/rbac/v1/cluster_role_binding.rs @@ -363,7 +363,7 @@ impl crate::ListableResource for ClusterRoleBinding { } impl crate::Metadata for ClusterRoleBinding { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_21/api/rbac/v1alpha1/cluster_role.rs b/src/v1_21/api/rbac/v1alpha1/cluster_role.rs index 751ea258ce..49459caa0b 100644 --- a/src/v1_21/api/rbac/v1alpha1/cluster_role.rs +++ b/src/v1_21/api/rbac/v1alpha1/cluster_role.rs @@ -363,7 +363,7 @@ impl crate::ListableResource for ClusterRole { } impl crate::Metadata for ClusterRole { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_21/api/rbac/v1alpha1/cluster_role_binding.rs b/src/v1_21/api/rbac/v1alpha1/cluster_role_binding.rs index 8d275bec1a..de6fe83e42 100644 --- a/src/v1_21/api/rbac/v1alpha1/cluster_role_binding.rs +++ b/src/v1_21/api/rbac/v1alpha1/cluster_role_binding.rs @@ -363,7 +363,7 @@ impl crate::ListableResource for ClusterRoleBinding { } impl crate::Metadata for ClusterRoleBinding { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_21/api/rbac/v1beta1/cluster_role.rs b/src/v1_21/api/rbac/v1beta1/cluster_role.rs index 4931e2d651..1bc0ab6d82 100644 --- a/src/v1_21/api/rbac/v1beta1/cluster_role.rs +++ b/src/v1_21/api/rbac/v1beta1/cluster_role.rs @@ -363,7 +363,7 @@ impl crate::ListableResource for ClusterRole { } impl crate::Metadata for ClusterRole { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_21/api/rbac/v1beta1/cluster_role_binding.rs b/src/v1_21/api/rbac/v1beta1/cluster_role_binding.rs index d2773b7e9c..8e59185e75 100644 --- a/src/v1_21/api/rbac/v1beta1/cluster_role_binding.rs +++ b/src/v1_21/api/rbac/v1beta1/cluster_role_binding.rs @@ -363,7 +363,7 @@ impl crate::ListableResource for ClusterRoleBinding { } impl crate::Metadata for ClusterRoleBinding { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_21/api/scheduling/v1/priority_class.rs b/src/v1_21/api/scheduling/v1/priority_class.rs index a7dba60fbd..f59c63c3e0 100644 --- a/src/v1_21/api/scheduling/v1/priority_class.rs +++ b/src/v1_21/api/scheduling/v1/priority_class.rs @@ -369,7 +369,7 @@ impl crate::ListableResource for PriorityClass { } impl crate::Metadata for PriorityClass { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_21/api/scheduling/v1alpha1/priority_class.rs b/src/v1_21/api/scheduling/v1alpha1/priority_class.rs index 992756ff0f..30b20699c8 100644 --- a/src/v1_21/api/scheduling/v1alpha1/priority_class.rs +++ b/src/v1_21/api/scheduling/v1alpha1/priority_class.rs @@ -369,7 +369,7 @@ impl crate::ListableResource for PriorityClass { } impl crate::Metadata for PriorityClass { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_21/api/scheduling/v1beta1/priority_class.rs b/src/v1_21/api/scheduling/v1beta1/priority_class.rs index a453b71f00..39e2649f33 100644 --- a/src/v1_21/api/scheduling/v1beta1/priority_class.rs +++ b/src/v1_21/api/scheduling/v1beta1/priority_class.rs @@ -369,7 +369,7 @@ impl crate::ListableResource for PriorityClass { } impl crate::Metadata for PriorityClass { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_21/api/storage/v1/csi_driver.rs b/src/v1_21/api/storage/v1/csi_driver.rs index 0dc419fa28..841c350667 100644 --- a/src/v1_21/api/storage/v1/csi_driver.rs +++ b/src/v1_21/api/storage/v1/csi_driver.rs @@ -360,7 +360,7 @@ impl crate::ListableResource for CSIDriver { } impl crate::Metadata for CSIDriver { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_21/api/storage/v1/csi_node.rs b/src/v1_21/api/storage/v1/csi_node.rs index a514ce9bf0..2ae2dc489a 100644 --- a/src/v1_21/api/storage/v1/csi_node.rs +++ b/src/v1_21/api/storage/v1/csi_node.rs @@ -360,7 +360,7 @@ impl crate::ListableResource for CSINode { } impl crate::Metadata for CSINode { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_21/api/storage/v1/storage_class.rs b/src/v1_21/api/storage/v1/storage_class.rs index 2bf8e65456..e8e1996616 100644 --- a/src/v1_21/api/storage/v1/storage_class.rs +++ b/src/v1_21/api/storage/v1/storage_class.rs @@ -380,7 +380,7 @@ impl crate::ListableResource for StorageClass { } impl crate::Metadata for StorageClass { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_21/api/storage/v1/volume_attachment.rs b/src/v1_21/api/storage/v1/volume_attachment.rs index f6b6972639..51e070f07b 100644 --- a/src/v1_21/api/storage/v1/volume_attachment.rs +++ b/src/v1_21/api/storage/v1/volume_attachment.rs @@ -518,7 +518,7 @@ impl crate::ListableResource for VolumeAttachment { } impl crate::Metadata for VolumeAttachment { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_21/api/storage/v1alpha1/volume_attachment.rs b/src/v1_21/api/storage/v1alpha1/volume_attachment.rs index 650e9a415f..7e3661d48d 100644 --- a/src/v1_21/api/storage/v1alpha1/volume_attachment.rs +++ b/src/v1_21/api/storage/v1alpha1/volume_attachment.rs @@ -365,7 +365,7 @@ impl crate::ListableResource for VolumeAttachment { } impl crate::Metadata for VolumeAttachment { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_21/api/storage/v1beta1/csi_driver.rs b/src/v1_21/api/storage/v1beta1/csi_driver.rs index ff6e91deb5..0d1fe5d882 100644 --- a/src/v1_21/api/storage/v1beta1/csi_driver.rs +++ b/src/v1_21/api/storage/v1beta1/csi_driver.rs @@ -360,7 +360,7 @@ impl crate::ListableResource for CSIDriver { } impl crate::Metadata for CSIDriver { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_21/api/storage/v1beta1/csi_node.rs b/src/v1_21/api/storage/v1beta1/csi_node.rs index 24267a2e78..cbf1f45ebc 100644 --- a/src/v1_21/api/storage/v1beta1/csi_node.rs +++ b/src/v1_21/api/storage/v1beta1/csi_node.rs @@ -360,7 +360,7 @@ impl crate::ListableResource for CSINode { } impl crate::Metadata for CSINode { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_21/api/storage/v1beta1/storage_class.rs b/src/v1_21/api/storage/v1beta1/storage_class.rs index d8e2c027b2..fa9961b35d 100644 --- a/src/v1_21/api/storage/v1beta1/storage_class.rs +++ b/src/v1_21/api/storage/v1beta1/storage_class.rs @@ -380,7 +380,7 @@ impl crate::ListableResource for StorageClass { } impl crate::Metadata for StorageClass { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_21/api/storage/v1beta1/volume_attachment.rs b/src/v1_21/api/storage/v1beta1/volume_attachment.rs index 92ca144edc..3a5c6e3001 100644 --- a/src/v1_21/api/storage/v1beta1/volume_attachment.rs +++ b/src/v1_21/api/storage/v1beta1/volume_attachment.rs @@ -365,7 +365,7 @@ impl crate::ListableResource for VolumeAttachment { } impl crate::Metadata for VolumeAttachment { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_21/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition.rs b/src/v1_21/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition.rs index 56d6f38d96..d400233d9b 100644 --- a/src/v1_21/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition.rs +++ b/src/v1_21/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition.rs @@ -515,7 +515,7 @@ impl crate::ListableResource for CustomResourceDefinition { } impl crate::Metadata for CustomResourceDefinition { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_21/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/custom_resource_definition.rs b/src/v1_21/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/custom_resource_definition.rs index ed4d82ee89..b322020ae1 100644 --- a/src/v1_21/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/custom_resource_definition.rs +++ b/src/v1_21/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/custom_resource_definition.rs @@ -515,7 +515,7 @@ impl crate::ListableResource for CustomResourceDefinition { } impl crate::Metadata for CustomResourceDefinition { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_21/apimachinery/pkg/apis/meta/v1/cluster_object_meta.rs b/src/v1_21/apimachinery/pkg/apis/meta/v1/cluster_object_meta.rs new file mode 100644 index 0000000000..b3dfa1403f --- /dev/null +++ b/src/v1_21/apimachinery/pkg/apis/meta/v1/cluster_object_meta.rs @@ -0,0 +1,528 @@ +// Generated from definition io.k8s.apimachinery.pkg.apis.meta.v1.ClusterObjectMeta + +/// ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create. +#[derive(Clone, Debug, Default, PartialEq)] +pub struct ClusterObjectMeta { + /// Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations + pub annotations: Option>, + + /// The name of the cluster which the object belongs to. This is used to distinguish resources with same name and namespace in different clusters. This field is not set anywhere right now and apiserver is going to ignore it if set in create or update request. + pub cluster_name: Option, + + /// CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC. + /// + /// Populated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + pub creation_timestamp: Option, + + /// Number of seconds allowed for this object to gracefully terminate before it will be removed from the system. Only set when deletionTimestamp is also set. May only be shortened. Read-only. + pub deletion_grace_period_seconds: Option, + + /// DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This field is set by the server when a graceful deletion is requested by the user, and is not directly settable by a client. The resource is expected to be deleted (no longer visible from resource lists, and not reachable by name) after the time in this field, once the finalizers list is empty. As long as the finalizers list contains items, deletion is blocked. Once the deletionTimestamp is set, this value may not be unset or be set further into the future, although it may be shortened or the resource may be deleted prior to this time. For example, a user may request that a pod is deleted in 30 seconds. The Kubelet will react by sending a graceful termination signal to the containers in the pod. After that 30 seconds, the Kubelet will send a hard termination signal (SIGKILL) to the container and after cleanup, remove the pod from the API. In the presence of network partitions, this object may still exist after this timestamp, until an administrator or automated process can determine the resource is fully terminated. If not set, graceful deletion of the object has not been requested. + /// + /// Populated by the system when a graceful deletion is requested. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + pub deletion_timestamp: Option, + + /// Must be empty before the object is deleted from the registry. Each entry is an identifier for the responsible component that will remove the entry from the list. If the deletionTimestamp of the object is non-nil, entries in this list can only be removed. Finalizers may be processed and removed in any order. Order is NOT enforced because it introduces significant risk of stuck finalizers. finalizers is a shared field, any actor with permission can reorder it. If the finalizer list is processed in order, then this can lead to a situation in which the component responsible for the first finalizer in the list is waiting for a signal (field value, external system, or other) produced by a component responsible for a finalizer later in the list, resulting in a deadlock. Without enforced ordering finalizers are free to order amongst themselves and are not vulnerable to ordering changes in the list. + pub finalizers: Option>, + + /// GenerateName is an optional prefix, used by the server, to generate a unique name ONLY IF the Name field has not been provided. If this field is used, the name returned to the client will be different than the name passed. This value will also be combined with a unique suffix. The provided value has the same validation rules as the Name field, and may be truncated by the length of the suffix required to make the value unique on the server. + /// + /// If this field is specified and the generated name exists, the server will NOT return a 409 - instead, it will either return 201 Created or 500 with Reason ServerTimeout indicating a unique name could not be found in the time allotted, and the client should retry (optionally after the time indicated in the Retry-After header). + /// + /// Applied only if Name is not specified. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#idempotency + pub generate_name: Option, + + /// A sequence number representing a specific generation of the desired state. Populated by the system. Read-only. + pub generation: Option, + + /// Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels + pub labels: Option>, + + /// ManagedFields maps workflow-id and version to the set of fields that are managed by that workflow. This is mostly for internal housekeeping, and users typically shouldn't need to set or understand this field. A workflow can be the user's name, a controller's name, or the name of a specific apply path like "ci-cd". The set of fields is always in the version that the workflow used when modifying the object. + pub managed_fields: Option>, + + /// Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names + pub name: Option, + + /// List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller. + pub owner_references: Option>, + + /// An opaque value that represents the internal version of this object that can be used by clients to determine when objects have changed. May be used for optimistic concurrency, change detection, and the watch operation on a resource or set of resources. Clients must treat these values as opaque and passed unmodified back to the server. They may only be valid for a particular resource or set of resources. + /// + /// Populated by the system. Read-only. Value must be treated as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency + pub resource_version: Option, + + /// SelfLink is a URL representing this object. Populated by the system. Read-only. + /// + /// DEPRECATED Kubernetes will stop propagating this field in 1.20 release and the field is planned to be removed in 1.21 release. + pub self_link: Option, + + /// UID is the unique in time and space value for this object. It is typically generated by the server on successful creation of a resource and is not allowed to change on PUT operations. + /// + /// Populated by the system. Read-only. More info: http://kubernetes.io/docs/user-guide/identifiers#uids + pub uid: Option, +} + +impl crate::DeepMerge for ClusterObjectMeta { + fn merge_from(&mut self, other: Self) { + crate::DeepMerge::merge_from(&mut self.annotations, other.annotations); + crate::DeepMerge::merge_from(&mut self.cluster_name, other.cluster_name); + crate::DeepMerge::merge_from(&mut self.creation_timestamp, other.creation_timestamp); + crate::DeepMerge::merge_from(&mut self.deletion_grace_period_seconds, other.deletion_grace_period_seconds); + crate::DeepMerge::merge_from(&mut self.deletion_timestamp, other.deletion_timestamp); + crate::DeepMerge::merge_from(&mut self.finalizers, other.finalizers); + crate::DeepMerge::merge_from(&mut self.generate_name, other.generate_name); + crate::DeepMerge::merge_from(&mut self.generation, other.generation); + crate::DeepMerge::merge_from(&mut self.labels, other.labels); + crate::DeepMerge::merge_from(&mut self.managed_fields, other.managed_fields); + crate::DeepMerge::merge_from(&mut self.name, other.name); + crate::DeepMerge::merge_from(&mut self.owner_references, other.owner_references); + crate::DeepMerge::merge_from(&mut self.resource_version, other.resource_version); + crate::DeepMerge::merge_from(&mut self.self_link, other.self_link); + crate::DeepMerge::merge_from(&mut self.uid, other.uid); + } +} + +impl<'de> crate::serde::Deserialize<'de> for ClusterObjectMeta { + fn deserialize(deserializer: D) -> Result where D: crate::serde::Deserializer<'de> { + #[allow(non_camel_case_types)] + enum Field { + Key_annotations, + Key_cluster_name, + Key_creation_timestamp, + Key_deletion_grace_period_seconds, + Key_deletion_timestamp, + Key_finalizers, + Key_generate_name, + Key_generation, + Key_labels, + Key_managed_fields, + Key_name, + Key_owner_references, + Key_resource_version, + Key_self_link, + Key_uid, + Other, + } + + impl<'de> crate::serde::Deserialize<'de> for Field { + fn deserialize(deserializer: D) -> Result where D: crate::serde::Deserializer<'de> { + struct Visitor; + + impl<'de> crate::serde::de::Visitor<'de> for Visitor { + type Value = Field; + + fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.write_str("field identifier") + } + + fn visit_str(self, v: &str) -> Result where E: crate::serde::de::Error { + Ok(match v { + "annotations" => Field::Key_annotations, + "clusterName" => Field::Key_cluster_name, + "creationTimestamp" => Field::Key_creation_timestamp, + "deletionGracePeriodSeconds" => Field::Key_deletion_grace_period_seconds, + "deletionTimestamp" => Field::Key_deletion_timestamp, + "finalizers" => Field::Key_finalizers, + "generateName" => Field::Key_generate_name, + "generation" => Field::Key_generation, + "labels" => Field::Key_labels, + "managedFields" => Field::Key_managed_fields, + "name" => Field::Key_name, + "ownerReferences" => Field::Key_owner_references, + "resourceVersion" => Field::Key_resource_version, + "selfLink" => Field::Key_self_link, + "uid" => Field::Key_uid, + _ => Field::Other, + }) + } + } + + deserializer.deserialize_identifier(Visitor) + } + } + + struct Visitor; + + impl<'de> crate::serde::de::Visitor<'de> for Visitor { + type Value = ClusterObjectMeta; + + fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.write_str("ClusterObjectMeta") + } + + fn visit_map(self, mut map: A) -> Result where A: crate::serde::de::MapAccess<'de> { + let mut value_annotations: Option> = None; + let mut value_cluster_name: Option = None; + let mut value_creation_timestamp: Option = None; + let mut value_deletion_grace_period_seconds: Option = None; + let mut value_deletion_timestamp: Option = None; + let mut value_finalizers: Option> = None; + let mut value_generate_name: Option = None; + let mut value_generation: Option = None; + let mut value_labels: Option> = None; + let mut value_managed_fields: Option> = None; + let mut value_name: Option = None; + let mut value_owner_references: Option> = None; + let mut value_resource_version: Option = None; + let mut value_self_link: Option = None; + let mut value_uid: Option = None; + + while let Some(key) = crate::serde::de::MapAccess::next_key::(&mut map)? { + match key { + Field::Key_annotations => value_annotations = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_cluster_name => value_cluster_name = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_creation_timestamp => value_creation_timestamp = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_deletion_grace_period_seconds => value_deletion_grace_period_seconds = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_deletion_timestamp => value_deletion_timestamp = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_finalizers => value_finalizers = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_generate_name => value_generate_name = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_generation => value_generation = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_labels => value_labels = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_managed_fields => value_managed_fields = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_name => value_name = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_owner_references => value_owner_references = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_resource_version => value_resource_version = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_self_link => value_self_link = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_uid => value_uid = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Other => { let _: crate::serde::de::IgnoredAny = crate::serde::de::MapAccess::next_value(&mut map)?; }, + } + } + + Ok(ClusterObjectMeta { + annotations: value_annotations, + cluster_name: value_cluster_name, + creation_timestamp: value_creation_timestamp, + deletion_grace_period_seconds: value_deletion_grace_period_seconds, + deletion_timestamp: value_deletion_timestamp, + finalizers: value_finalizers, + generate_name: value_generate_name, + generation: value_generation, + labels: value_labels, + managed_fields: value_managed_fields, + name: value_name, + owner_references: value_owner_references, + resource_version: value_resource_version, + self_link: value_self_link, + uid: value_uid, + }) + } + } + + deserializer.deserialize_struct( + "ClusterObjectMeta", + &[ + "annotations", + "clusterName", + "creationTimestamp", + "deletionGracePeriodSeconds", + "deletionTimestamp", + "finalizers", + "generateName", + "generation", + "labels", + "managedFields", + "name", + "ownerReferences", + "resourceVersion", + "selfLink", + "uid", + ], + Visitor, + ) + } +} + +impl crate::serde::Serialize for ClusterObjectMeta { + fn serialize(&self, serializer: S) -> Result where S: crate::serde::Serializer { + let mut state = serializer.serialize_struct( + "ClusterObjectMeta", + self.annotations.as_ref().map_or(0, |_| 1) + + self.cluster_name.as_ref().map_or(0, |_| 1) + + self.creation_timestamp.as_ref().map_or(0, |_| 1) + + self.deletion_grace_period_seconds.as_ref().map_or(0, |_| 1) + + self.deletion_timestamp.as_ref().map_or(0, |_| 1) + + self.finalizers.as_ref().map_or(0, |_| 1) + + self.generate_name.as_ref().map_or(0, |_| 1) + + self.generation.as_ref().map_or(0, |_| 1) + + self.labels.as_ref().map_or(0, |_| 1) + + self.managed_fields.as_ref().map_or(0, |_| 1) + + self.name.as_ref().map_or(0, |_| 1) + + self.owner_references.as_ref().map_or(0, |_| 1) + + self.resource_version.as_ref().map_or(0, |_| 1) + + self.self_link.as_ref().map_or(0, |_| 1) + + self.uid.as_ref().map_or(0, |_| 1), + )?; + if let Some(value) = &self.annotations { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "annotations", value)?; + } + if let Some(value) = &self.cluster_name { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "clusterName", value)?; + } + if let Some(value) = &self.creation_timestamp { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "creationTimestamp", value)?; + } + if let Some(value) = &self.deletion_grace_period_seconds { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "deletionGracePeriodSeconds", value)?; + } + if let Some(value) = &self.deletion_timestamp { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "deletionTimestamp", value)?; + } + if let Some(value) = &self.finalizers { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "finalizers", value)?; + } + if let Some(value) = &self.generate_name { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "generateName", value)?; + } + if let Some(value) = &self.generation { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "generation", value)?; + } + if let Some(value) = &self.labels { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "labels", value)?; + } + if let Some(value) = &self.managed_fields { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "managedFields", value)?; + } + if let Some(value) = &self.name { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "name", value)?; + } + if let Some(value) = &self.owner_references { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "ownerReferences", value)?; + } + if let Some(value) = &self.resource_version { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "resourceVersion", value)?; + } + if let Some(value) = &self.self_link { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "selfLink", value)?; + } + if let Some(value) = &self.uid { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "uid", value)?; + } + crate::serde::ser::SerializeStruct::end(state) + } +} + +#[cfg(feature = "schemars")] +impl crate::schemars::JsonSchema for ClusterObjectMeta { + fn schema_name() -> String { + "io.k8s.apimachinery.pkg.apis.meta.v1.ClusterObjectMeta".to_owned() + } + + fn json_schema(__gen: &mut crate::schemars::gen::SchemaGenerator) -> crate::schemars::schema::Schema { + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Object))), + object: Some(Box::new(crate::schemars::schema::ObjectValidation { + properties: [ + ( + "annotations".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Object))), + object: Some(Box::new(crate::schemars::schema::ObjectValidation { + additional_properties: Some(Box::new( + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }) + )), + ..Default::default() + })), + ..Default::default() + }), + ), + ( + "clusterName".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("The name of the cluster which the object belongs to. This is used to distinguish resources with same name and namespace in different clusters. This field is not set anywhere right now and apiserver is going to ignore it if set in create or update request.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ( + "creationTimestamp".to_owned(), + { + let mut schema_obj = __gen.subschema_for::().into_object(); + schema_obj.metadata = Some(Box::new(crate::schemars::schema::Metadata { + description: Some("CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC.\n\nPopulated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata".to_owned()), + ..Default::default() + })); + crate::schemars::schema::Schema::Object(schema_obj) + }, + ), + ( + "deletionGracePeriodSeconds".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Number of seconds allowed for this object to gracefully terminate before it will be removed from the system. Only set when deletionTimestamp is also set. May only be shortened. Read-only.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Integer))), + format: Some("int64".to_owned()), + ..Default::default() + }), + ), + ( + "deletionTimestamp".to_owned(), + { + let mut schema_obj = __gen.subschema_for::().into_object(); + schema_obj.metadata = Some(Box::new(crate::schemars::schema::Metadata { + description: Some("DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This field is set by the server when a graceful deletion is requested by the user, and is not directly settable by a client. The resource is expected to be deleted (no longer visible from resource lists, and not reachable by name) after the time in this field, once the finalizers list is empty. As long as the finalizers list contains items, deletion is blocked. Once the deletionTimestamp is set, this value may not be unset or be set further into the future, although it may be shortened or the resource may be deleted prior to this time. For example, a user may request that a pod is deleted in 30 seconds. The Kubelet will react by sending a graceful termination signal to the containers in the pod. After that 30 seconds, the Kubelet will send a hard termination signal (SIGKILL) to the container and after cleanup, remove the pod from the API. In the presence of network partitions, this object may still exist after this timestamp, until an administrator or automated process can determine the resource is fully terminated. If not set, graceful deletion of the object has not been requested.\n\nPopulated by the system when a graceful deletion is requested. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata".to_owned()), + ..Default::default() + })); + crate::schemars::schema::Schema::Object(schema_obj) + }, + ), + ( + "finalizers".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Must be empty before the object is deleted from the registry. Each entry is an identifier for the responsible component that will remove the entry from the list. If the deletionTimestamp of the object is non-nil, entries in this list can only be removed. Finalizers may be processed and removed in any order. Order is NOT enforced because it introduces significant risk of stuck finalizers. finalizers is a shared field, any actor with permission can reorder it. If the finalizer list is processed in order, then this can lead to a situation in which the component responsible for the first finalizer in the list is waiting for a signal (field value, external system, or other) produced by a component responsible for a finalizer later in the list, resulting in a deadlock. Without enforced ordering finalizers are free to order amongst themselves and are not vulnerable to ordering changes in the list.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Array))), + array: Some(Box::new(crate::schemars::schema::ArrayValidation { + items: Some(crate::schemars::schema::SingleOrVec::Single(Box::new( + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }) + ))), + ..Default::default() + })), + ..Default::default() + }), + ), + ( + "generateName".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("GenerateName is an optional prefix, used by the server, to generate a unique name ONLY IF the Name field has not been provided. If this field is used, the name returned to the client will be different than the name passed. This value will also be combined with a unique suffix. The provided value has the same validation rules as the Name field, and may be truncated by the length of the suffix required to make the value unique on the server.\n\nIf this field is specified and the generated name exists, the server will NOT return a 409 - instead, it will either return 201 Created or 500 with Reason ServerTimeout indicating a unique name could not be found in the time allotted, and the client should retry (optionally after the time indicated in the Retry-After header).\n\nApplied only if Name is not specified. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#idempotency".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ( + "generation".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("A sequence number representing a specific generation of the desired state. Populated by the system. Read-only.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Integer))), + format: Some("int64".to_owned()), + ..Default::default() + }), + ), + ( + "labels".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Object))), + object: Some(Box::new(crate::schemars::schema::ObjectValidation { + additional_properties: Some(Box::new( + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }) + )), + ..Default::default() + })), + ..Default::default() + }), + ), + ( + "managedFields".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("ManagedFields maps workflow-id and version to the set of fields that are managed by that workflow. This is mostly for internal housekeeping, and users typically shouldn't need to set or understand this field. A workflow can be the user's name, a controller's name, or the name of a specific apply path like \"ci-cd\". The set of fields is always in the version that the workflow used when modifying the object.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Array))), + array: Some(Box::new(crate::schemars::schema::ArrayValidation { + items: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(__gen.subschema_for::()))), + ..Default::default() + })), + ..Default::default() + }), + ), + ( + "name".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ( + "ownerReferences".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Array))), + array: Some(Box::new(crate::schemars::schema::ArrayValidation { + items: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(__gen.subschema_for::()))), + ..Default::default() + })), + ..Default::default() + }), + ), + ( + "resourceVersion".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("An opaque value that represents the internal version of this object that can be used by clients to determine when objects have changed. May be used for optimistic concurrency, change detection, and the watch operation on a resource or set of resources. Clients must treat these values as opaque and passed unmodified back to the server. They may only be valid for a particular resource or set of resources.\n\nPopulated by the system. Read-only. Value must be treated as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ( + "selfLink".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("SelfLink is a URL representing this object. Populated by the system. Read-only.\n\nDEPRECATED Kubernetes will stop propagating this field in 1.20 release and the field is planned to be removed in 1.21 release.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ( + "uid".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("UID is the unique in time and space value for this object. It is typically generated by the server on successful creation of a resource and is not allowed to change on PUT operations.\n\nPopulated by the system. Read-only. More info: http://kubernetes.io/docs/user-guide/identifiers#uids".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ].into(), + ..Default::default() + })), + ..Default::default() + }) + } +} diff --git a/src/v1_21/apimachinery/pkg/apis/meta/v1/mod.rs b/src/v1_21/apimachinery/pkg/apis/meta/v1/mod.rs index 9424127582..221a712e6d 100644 --- a/src/v1_21/apimachinery/pkg/apis/meta/v1/mod.rs +++ b/src/v1_21/apimachinery/pkg/apis/meta/v1/mod.rs @@ -14,6 +14,9 @@ pub use self::api_resource_list::APIResourceList; mod api_versions; pub use self::api_versions::APIVersions; +mod cluster_object_meta; +pub use self::cluster_object_meta::ClusterObjectMeta; + mod condition; pub use self::condition::Condition; @@ -65,6 +68,9 @@ pub use self::status_cause::StatusCause; mod status_details; pub use self::status_details::StatusDetails; +mod sub_object_meta; +pub use self::sub_object_meta::SubObjectMeta; + mod time; pub use self::time::Time; diff --git a/src/v1_21/apimachinery/pkg/apis/meta/v1/object_meta.rs b/src/v1_21/apimachinery/pkg/apis/meta/v1/object_meta.rs index c6b37624f5..8dd25439cd 100644 --- a/src/v1_21/apimachinery/pkg/apis/meta/v1/object_meta.rs +++ b/src/v1_21/apimachinery/pkg/apis/meta/v1/object_meta.rs @@ -47,7 +47,7 @@ pub struct ObjectMeta { /// Namespace defines the space within which each name must be unique. An empty namespace is equivalent to the "default" namespace, but "default" is the canonical representation. Not all objects are required to be scoped to a namespace - the value of this field for those objects will be empty. /// /// Must be a DNS_LABEL. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/namespaces - pub namespace: Option, + pub namespace: String, /// List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller. pub owner_references: Option>, @@ -211,7 +211,7 @@ impl<'de> crate::serde::Deserialize<'de> for ObjectMeta { labels: value_labels, managed_fields: value_managed_fields, name: value_name, - namespace: value_namespace, + namespace: value_namespace.unwrap_or_default(), owner_references: value_owner_references, resource_version: value_resource_version, self_link: value_self_link, @@ -249,6 +249,7 @@ impl crate::serde::Serialize for ObjectMeta { fn serialize(&self, serializer: S) -> Result where S: crate::serde::Serializer { let mut state = serializer.serialize_struct( "ObjectMeta", + 1 + self.annotations.as_ref().map_or(0, |_| 1) + self.cluster_name.as_ref().map_or(0, |_| 1) + self.creation_timestamp.as_ref().map_or(0, |_| 1) + @@ -260,7 +261,6 @@ impl crate::serde::Serialize for ObjectMeta { self.labels.as_ref().map_or(0, |_| 1) + self.managed_fields.as_ref().map_or(0, |_| 1) + self.name.as_ref().map_or(0, |_| 1) + - self.namespace.as_ref().map_or(0, |_| 1) + self.owner_references.as_ref().map_or(0, |_| 1) + self.resource_version.as_ref().map_or(0, |_| 1) + self.self_link.as_ref().map_or(0, |_| 1) + @@ -299,9 +299,7 @@ impl crate::serde::Serialize for ObjectMeta { if let Some(value) = &self.name { crate::serde::ser::SerializeStruct::serialize_field(&mut state, "name", value)?; } - if let Some(value) = &self.namespace { - crate::serde::ser::SerializeStruct::serialize_field(&mut state, "namespace", value)?; - } + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "namespace", &self.namespace)?; if let Some(value) = &self.owner_references { crate::serde::ser::SerializeStruct::serialize_field(&mut state, "ownerReferences", value)?; } @@ -547,6 +545,9 @@ impl crate::schemars::JsonSchema for ObjectMeta { }), ), ].into(), + required: [ + "namespace".to_owned(), + ].into(), ..Default::default() })), ..Default::default() diff --git a/src/v1_21/apimachinery/pkg/apis/meta/v1/sub_object_meta.rs b/src/v1_21/apimachinery/pkg/apis/meta/v1/sub_object_meta.rs new file mode 100644 index 0000000000..61046989c6 --- /dev/null +++ b/src/v1_21/apimachinery/pkg/apis/meta/v1/sub_object_meta.rs @@ -0,0 +1,555 @@ +// Generated from definition io.k8s.apimachinery.pkg.apis.meta.v1.SubObjectMeta + +/// ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create. +#[derive(Clone, Debug, Default, PartialEq)] +pub struct SubObjectMeta { + /// Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations + pub annotations: Option>, + + /// The name of the cluster which the object belongs to. This is used to distinguish resources with same name and namespace in different clusters. This field is not set anywhere right now and apiserver is going to ignore it if set in create or update request. + pub cluster_name: Option, + + /// CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC. + /// + /// Populated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + pub creation_timestamp: Option, + + /// Number of seconds allowed for this object to gracefully terminate before it will be removed from the system. Only set when deletionTimestamp is also set. May only be shortened. Read-only. + pub deletion_grace_period_seconds: Option, + + /// DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This field is set by the server when a graceful deletion is requested by the user, and is not directly settable by a client. The resource is expected to be deleted (no longer visible from resource lists, and not reachable by name) after the time in this field, once the finalizers list is empty. As long as the finalizers list contains items, deletion is blocked. Once the deletionTimestamp is set, this value may not be unset or be set further into the future, although it may be shortened or the resource may be deleted prior to this time. For example, a user may request that a pod is deleted in 30 seconds. The Kubelet will react by sending a graceful termination signal to the containers in the pod. After that 30 seconds, the Kubelet will send a hard termination signal (SIGKILL) to the container and after cleanup, remove the pod from the API. In the presence of network partitions, this object may still exist after this timestamp, until an administrator or automated process can determine the resource is fully terminated. If not set, graceful deletion of the object has not been requested. + /// + /// Populated by the system when a graceful deletion is requested. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + pub deletion_timestamp: Option, + + /// Must be empty before the object is deleted from the registry. Each entry is an identifier for the responsible component that will remove the entry from the list. If the deletionTimestamp of the object is non-nil, entries in this list can only be removed. Finalizers may be processed and removed in any order. Order is NOT enforced because it introduces significant risk of stuck finalizers. finalizers is a shared field, any actor with permission can reorder it. If the finalizer list is processed in order, then this can lead to a situation in which the component responsible for the first finalizer in the list is waiting for a signal (field value, external system, or other) produced by a component responsible for a finalizer later in the list, resulting in a deadlock. Without enforced ordering finalizers are free to order amongst themselves and are not vulnerable to ordering changes in the list. + pub finalizers: Option>, + + /// GenerateName is an optional prefix, used by the server, to generate a unique name ONLY IF the Name field has not been provided. If this field is used, the name returned to the client will be different than the name passed. This value will also be combined with a unique suffix. The provided value has the same validation rules as the Name field, and may be truncated by the length of the suffix required to make the value unique on the server. + /// + /// If this field is specified and the generated name exists, the server will NOT return a 409 - instead, it will either return 201 Created or 500 with Reason ServerTimeout indicating a unique name could not be found in the time allotted, and the client should retry (optionally after the time indicated in the Retry-After header). + /// + /// Applied only if Name is not specified. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#idempotency + pub generate_name: Option, + + /// A sequence number representing a specific generation of the desired state. Populated by the system. Read-only. + pub generation: Option, + + /// Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels + pub labels: Option>, + + /// ManagedFields maps workflow-id and version to the set of fields that are managed by that workflow. This is mostly for internal housekeeping, and users typically shouldn't need to set or understand this field. A workflow can be the user's name, a controller's name, or the name of a specific apply path like "ci-cd". The set of fields is always in the version that the workflow used when modifying the object. + pub managed_fields: Option>, + + /// Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names + pub name: Option, + + /// Namespace defines the space within which each name must be unique. An empty namespace is equivalent to the "default" namespace, but "default" is the canonical representation. Not all objects are required to be scoped to a namespace - the value of this field for those objects will be empty. + /// + /// Must be a DNS_LABEL. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/namespaces + pub namespace: Option, + + /// List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller. + pub owner_references: Option>, + + /// An opaque value that represents the internal version of this object that can be used by clients to determine when objects have changed. May be used for optimistic concurrency, change detection, and the watch operation on a resource or set of resources. Clients must treat these values as opaque and passed unmodified back to the server. They may only be valid for a particular resource or set of resources. + /// + /// Populated by the system. Read-only. Value must be treated as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency + pub resource_version: Option, + + /// SelfLink is a URL representing this object. Populated by the system. Read-only. + /// + /// DEPRECATED Kubernetes will stop propagating this field in 1.20 release and the field is planned to be removed in 1.21 release. + pub self_link: Option, + + /// UID is the unique in time and space value for this object. It is typically generated by the server on successful creation of a resource and is not allowed to change on PUT operations. + /// + /// Populated by the system. Read-only. More info: http://kubernetes.io/docs/user-guide/identifiers#uids + pub uid: Option, +} + +impl crate::DeepMerge for SubObjectMeta { + fn merge_from(&mut self, other: Self) { + crate::DeepMerge::merge_from(&mut self.annotations, other.annotations); + crate::DeepMerge::merge_from(&mut self.cluster_name, other.cluster_name); + crate::DeepMerge::merge_from(&mut self.creation_timestamp, other.creation_timestamp); + crate::DeepMerge::merge_from(&mut self.deletion_grace_period_seconds, other.deletion_grace_period_seconds); + crate::DeepMerge::merge_from(&mut self.deletion_timestamp, other.deletion_timestamp); + crate::DeepMerge::merge_from(&mut self.finalizers, other.finalizers); + crate::DeepMerge::merge_from(&mut self.generate_name, other.generate_name); + crate::DeepMerge::merge_from(&mut self.generation, other.generation); + crate::DeepMerge::merge_from(&mut self.labels, other.labels); + crate::DeepMerge::merge_from(&mut self.managed_fields, other.managed_fields); + crate::DeepMerge::merge_from(&mut self.name, other.name); + crate::DeepMerge::merge_from(&mut self.namespace, other.namespace); + crate::DeepMerge::merge_from(&mut self.owner_references, other.owner_references); + crate::DeepMerge::merge_from(&mut self.resource_version, other.resource_version); + crate::DeepMerge::merge_from(&mut self.self_link, other.self_link); + crate::DeepMerge::merge_from(&mut self.uid, other.uid); + } +} + +impl<'de> crate::serde::Deserialize<'de> for SubObjectMeta { + fn deserialize(deserializer: D) -> Result where D: crate::serde::Deserializer<'de> { + #[allow(non_camel_case_types)] + enum Field { + Key_annotations, + Key_cluster_name, + Key_creation_timestamp, + Key_deletion_grace_period_seconds, + Key_deletion_timestamp, + Key_finalizers, + Key_generate_name, + Key_generation, + Key_labels, + Key_managed_fields, + Key_name, + Key_namespace, + Key_owner_references, + Key_resource_version, + Key_self_link, + Key_uid, + Other, + } + + impl<'de> crate::serde::Deserialize<'de> for Field { + fn deserialize(deserializer: D) -> Result where D: crate::serde::Deserializer<'de> { + struct Visitor; + + impl<'de> crate::serde::de::Visitor<'de> for Visitor { + type Value = Field; + + fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.write_str("field identifier") + } + + fn visit_str(self, v: &str) -> Result where E: crate::serde::de::Error { + Ok(match v { + "annotations" => Field::Key_annotations, + "clusterName" => Field::Key_cluster_name, + "creationTimestamp" => Field::Key_creation_timestamp, + "deletionGracePeriodSeconds" => Field::Key_deletion_grace_period_seconds, + "deletionTimestamp" => Field::Key_deletion_timestamp, + "finalizers" => Field::Key_finalizers, + "generateName" => Field::Key_generate_name, + "generation" => Field::Key_generation, + "labels" => Field::Key_labels, + "managedFields" => Field::Key_managed_fields, + "name" => Field::Key_name, + "namespace" => Field::Key_namespace, + "ownerReferences" => Field::Key_owner_references, + "resourceVersion" => Field::Key_resource_version, + "selfLink" => Field::Key_self_link, + "uid" => Field::Key_uid, + _ => Field::Other, + }) + } + } + + deserializer.deserialize_identifier(Visitor) + } + } + + struct Visitor; + + impl<'de> crate::serde::de::Visitor<'de> for Visitor { + type Value = SubObjectMeta; + + fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.write_str("SubObjectMeta") + } + + fn visit_map(self, mut map: A) -> Result where A: crate::serde::de::MapAccess<'de> { + let mut value_annotations: Option> = None; + let mut value_cluster_name: Option = None; + let mut value_creation_timestamp: Option = None; + let mut value_deletion_grace_period_seconds: Option = None; + let mut value_deletion_timestamp: Option = None; + let mut value_finalizers: Option> = None; + let mut value_generate_name: Option = None; + let mut value_generation: Option = None; + let mut value_labels: Option> = None; + let mut value_managed_fields: Option> = None; + let mut value_name: Option = None; + let mut value_namespace: Option = None; + let mut value_owner_references: Option> = None; + let mut value_resource_version: Option = None; + let mut value_self_link: Option = None; + let mut value_uid: Option = None; + + while let Some(key) = crate::serde::de::MapAccess::next_key::(&mut map)? { + match key { + Field::Key_annotations => value_annotations = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_cluster_name => value_cluster_name = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_creation_timestamp => value_creation_timestamp = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_deletion_grace_period_seconds => value_deletion_grace_period_seconds = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_deletion_timestamp => value_deletion_timestamp = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_finalizers => value_finalizers = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_generate_name => value_generate_name = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_generation => value_generation = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_labels => value_labels = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_managed_fields => value_managed_fields = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_name => value_name = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_namespace => value_namespace = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_owner_references => value_owner_references = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_resource_version => value_resource_version = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_self_link => value_self_link = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_uid => value_uid = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Other => { let _: crate::serde::de::IgnoredAny = crate::serde::de::MapAccess::next_value(&mut map)?; }, + } + } + + Ok(SubObjectMeta { + annotations: value_annotations, + cluster_name: value_cluster_name, + creation_timestamp: value_creation_timestamp, + deletion_grace_period_seconds: value_deletion_grace_period_seconds, + deletion_timestamp: value_deletion_timestamp, + finalizers: value_finalizers, + generate_name: value_generate_name, + generation: value_generation, + labels: value_labels, + managed_fields: value_managed_fields, + name: value_name, + namespace: value_namespace, + owner_references: value_owner_references, + resource_version: value_resource_version, + self_link: value_self_link, + uid: value_uid, + }) + } + } + + deserializer.deserialize_struct( + "SubObjectMeta", + &[ + "annotations", + "clusterName", + "creationTimestamp", + "deletionGracePeriodSeconds", + "deletionTimestamp", + "finalizers", + "generateName", + "generation", + "labels", + "managedFields", + "name", + "namespace", + "ownerReferences", + "resourceVersion", + "selfLink", + "uid", + ], + Visitor, + ) + } +} + +impl crate::serde::Serialize for SubObjectMeta { + fn serialize(&self, serializer: S) -> Result where S: crate::serde::Serializer { + let mut state = serializer.serialize_struct( + "SubObjectMeta", + self.annotations.as_ref().map_or(0, |_| 1) + + self.cluster_name.as_ref().map_or(0, |_| 1) + + self.creation_timestamp.as_ref().map_or(0, |_| 1) + + self.deletion_grace_period_seconds.as_ref().map_or(0, |_| 1) + + self.deletion_timestamp.as_ref().map_or(0, |_| 1) + + self.finalizers.as_ref().map_or(0, |_| 1) + + self.generate_name.as_ref().map_or(0, |_| 1) + + self.generation.as_ref().map_or(0, |_| 1) + + self.labels.as_ref().map_or(0, |_| 1) + + self.managed_fields.as_ref().map_or(0, |_| 1) + + self.name.as_ref().map_or(0, |_| 1) + + self.namespace.as_ref().map_or(0, |_| 1) + + self.owner_references.as_ref().map_or(0, |_| 1) + + self.resource_version.as_ref().map_or(0, |_| 1) + + self.self_link.as_ref().map_or(0, |_| 1) + + self.uid.as_ref().map_or(0, |_| 1), + )?; + if let Some(value) = &self.annotations { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "annotations", value)?; + } + if let Some(value) = &self.cluster_name { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "clusterName", value)?; + } + if let Some(value) = &self.creation_timestamp { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "creationTimestamp", value)?; + } + if let Some(value) = &self.deletion_grace_period_seconds { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "deletionGracePeriodSeconds", value)?; + } + if let Some(value) = &self.deletion_timestamp { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "deletionTimestamp", value)?; + } + if let Some(value) = &self.finalizers { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "finalizers", value)?; + } + if let Some(value) = &self.generate_name { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "generateName", value)?; + } + if let Some(value) = &self.generation { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "generation", value)?; + } + if let Some(value) = &self.labels { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "labels", value)?; + } + if let Some(value) = &self.managed_fields { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "managedFields", value)?; + } + if let Some(value) = &self.name { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "name", value)?; + } + if let Some(value) = &self.namespace { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "namespace", value)?; + } + if let Some(value) = &self.owner_references { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "ownerReferences", value)?; + } + if let Some(value) = &self.resource_version { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "resourceVersion", value)?; + } + if let Some(value) = &self.self_link { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "selfLink", value)?; + } + if let Some(value) = &self.uid { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "uid", value)?; + } + crate::serde::ser::SerializeStruct::end(state) + } +} + +#[cfg(feature = "schemars")] +impl crate::schemars::JsonSchema for SubObjectMeta { + fn schema_name() -> String { + "io.k8s.apimachinery.pkg.apis.meta.v1.SubObjectMeta".to_owned() + } + + fn json_schema(__gen: &mut crate::schemars::gen::SchemaGenerator) -> crate::schemars::schema::Schema { + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Object))), + object: Some(Box::new(crate::schemars::schema::ObjectValidation { + properties: [ + ( + "annotations".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Object))), + object: Some(Box::new(crate::schemars::schema::ObjectValidation { + additional_properties: Some(Box::new( + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }) + )), + ..Default::default() + })), + ..Default::default() + }), + ), + ( + "clusterName".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("The name of the cluster which the object belongs to. This is used to distinguish resources with same name and namespace in different clusters. This field is not set anywhere right now and apiserver is going to ignore it if set in create or update request.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ( + "creationTimestamp".to_owned(), + { + let mut schema_obj = __gen.subschema_for::().into_object(); + schema_obj.metadata = Some(Box::new(crate::schemars::schema::Metadata { + description: Some("CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC.\n\nPopulated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata".to_owned()), + ..Default::default() + })); + crate::schemars::schema::Schema::Object(schema_obj) + }, + ), + ( + "deletionGracePeriodSeconds".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Number of seconds allowed for this object to gracefully terminate before it will be removed from the system. Only set when deletionTimestamp is also set. May only be shortened. Read-only.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Integer))), + format: Some("int64".to_owned()), + ..Default::default() + }), + ), + ( + "deletionTimestamp".to_owned(), + { + let mut schema_obj = __gen.subschema_for::().into_object(); + schema_obj.metadata = Some(Box::new(crate::schemars::schema::Metadata { + description: Some("DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This field is set by the server when a graceful deletion is requested by the user, and is not directly settable by a client. The resource is expected to be deleted (no longer visible from resource lists, and not reachable by name) after the time in this field, once the finalizers list is empty. As long as the finalizers list contains items, deletion is blocked. Once the deletionTimestamp is set, this value may not be unset or be set further into the future, although it may be shortened or the resource may be deleted prior to this time. For example, a user may request that a pod is deleted in 30 seconds. The Kubelet will react by sending a graceful termination signal to the containers in the pod. After that 30 seconds, the Kubelet will send a hard termination signal (SIGKILL) to the container and after cleanup, remove the pod from the API. In the presence of network partitions, this object may still exist after this timestamp, until an administrator or automated process can determine the resource is fully terminated. If not set, graceful deletion of the object has not been requested.\n\nPopulated by the system when a graceful deletion is requested. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata".to_owned()), + ..Default::default() + })); + crate::schemars::schema::Schema::Object(schema_obj) + }, + ), + ( + "finalizers".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Must be empty before the object is deleted from the registry. Each entry is an identifier for the responsible component that will remove the entry from the list. If the deletionTimestamp of the object is non-nil, entries in this list can only be removed. Finalizers may be processed and removed in any order. Order is NOT enforced because it introduces significant risk of stuck finalizers. finalizers is a shared field, any actor with permission can reorder it. If the finalizer list is processed in order, then this can lead to a situation in which the component responsible for the first finalizer in the list is waiting for a signal (field value, external system, or other) produced by a component responsible for a finalizer later in the list, resulting in a deadlock. Without enforced ordering finalizers are free to order amongst themselves and are not vulnerable to ordering changes in the list.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Array))), + array: Some(Box::new(crate::schemars::schema::ArrayValidation { + items: Some(crate::schemars::schema::SingleOrVec::Single(Box::new( + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }) + ))), + ..Default::default() + })), + ..Default::default() + }), + ), + ( + "generateName".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("GenerateName is an optional prefix, used by the server, to generate a unique name ONLY IF the Name field has not been provided. If this field is used, the name returned to the client will be different than the name passed. This value will also be combined with a unique suffix. The provided value has the same validation rules as the Name field, and may be truncated by the length of the suffix required to make the value unique on the server.\n\nIf this field is specified and the generated name exists, the server will NOT return a 409 - instead, it will either return 201 Created or 500 with Reason ServerTimeout indicating a unique name could not be found in the time allotted, and the client should retry (optionally after the time indicated in the Retry-After header).\n\nApplied only if Name is not specified. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#idempotency".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ( + "generation".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("A sequence number representing a specific generation of the desired state. Populated by the system. Read-only.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Integer))), + format: Some("int64".to_owned()), + ..Default::default() + }), + ), + ( + "labels".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Object))), + object: Some(Box::new(crate::schemars::schema::ObjectValidation { + additional_properties: Some(Box::new( + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }) + )), + ..Default::default() + })), + ..Default::default() + }), + ), + ( + "managedFields".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("ManagedFields maps workflow-id and version to the set of fields that are managed by that workflow. This is mostly for internal housekeeping, and users typically shouldn't need to set or understand this field. A workflow can be the user's name, a controller's name, or the name of a specific apply path like \"ci-cd\". The set of fields is always in the version that the workflow used when modifying the object.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Array))), + array: Some(Box::new(crate::schemars::schema::ArrayValidation { + items: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(__gen.subschema_for::()))), + ..Default::default() + })), + ..Default::default() + }), + ), + ( + "name".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ( + "namespace".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Namespace defines the space within which each name must be unique. An empty namespace is equivalent to the \"default\" namespace, but \"default\" is the canonical representation. Not all objects are required to be scoped to a namespace - the value of this field for those objects will be empty.\n\nMust be a DNS_LABEL. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/namespaces".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ( + "ownerReferences".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Array))), + array: Some(Box::new(crate::schemars::schema::ArrayValidation { + items: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(__gen.subschema_for::()))), + ..Default::default() + })), + ..Default::default() + }), + ), + ( + "resourceVersion".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("An opaque value that represents the internal version of this object that can be used by clients to determine when objects have changed. May be used for optimistic concurrency, change detection, and the watch operation on a resource or set of resources. Clients must treat these values as opaque and passed unmodified back to the server. They may only be valid for a particular resource or set of resources.\n\nPopulated by the system. Read-only. Value must be treated as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ( + "selfLink".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("SelfLink is a URL representing this object. Populated by the system. Read-only.\n\nDEPRECATED Kubernetes will stop propagating this field in 1.20 release and the field is planned to be removed in 1.21 release.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ( + "uid".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("UID is the unique in time and space value for this object. It is typically generated by the server on successful creation of a resource and is not allowed to change on PUT operations.\n\nPopulated by the system. Read-only. More info: http://kubernetes.io/docs/user-guide/identifiers#uids".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ].into(), + ..Default::default() + })), + ..Default::default() + }) + } +} diff --git a/src/v1_21/kube_aggregator/pkg/apis/apiregistration/v1/api_service.rs b/src/v1_21/kube_aggregator/pkg/apis/apiregistration/v1/api_service.rs index 0f9b7b9c11..6322aca412 100644 --- a/src/v1_21/kube_aggregator/pkg/apis/apiregistration/v1/api_service.rs +++ b/src/v1_21/kube_aggregator/pkg/apis/apiregistration/v1/api_service.rs @@ -515,7 +515,7 @@ impl crate::ListableResource for APIService { } impl crate::Metadata for APIService { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_21/kube_aggregator/pkg/apis/apiregistration/v1beta1/api_service.rs b/src/v1_21/kube_aggregator/pkg/apis/apiregistration/v1beta1/api_service.rs index 14feb9453e..b28ee8ecb9 100644 --- a/src/v1_21/kube_aggregator/pkg/apis/apiregistration/v1beta1/api_service.rs +++ b/src/v1_21/kube_aggregator/pkg/apis/apiregistration/v1beta1/api_service.rs @@ -515,7 +515,7 @@ impl crate::ListableResource for APIService { } impl crate::Metadata for APIService { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_22/api/admissionregistration/v1/mutating_webhook_configuration.rs b/src/v1_22/api/admissionregistration/v1/mutating_webhook_configuration.rs index cb8ec8f5af..e0f9531189 100644 --- a/src/v1_22/api/admissionregistration/v1/mutating_webhook_configuration.rs +++ b/src/v1_22/api/admissionregistration/v1/mutating_webhook_configuration.rs @@ -360,7 +360,7 @@ impl crate::ListableResource for MutatingWebhookConfiguration { } impl crate::Metadata for MutatingWebhookConfiguration { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_22/api/admissionregistration/v1/validating_webhook_configuration.rs b/src/v1_22/api/admissionregistration/v1/validating_webhook_configuration.rs index 4c520b0eeb..4cf73a02cb 100644 --- a/src/v1_22/api/admissionregistration/v1/validating_webhook_configuration.rs +++ b/src/v1_22/api/admissionregistration/v1/validating_webhook_configuration.rs @@ -360,7 +360,7 @@ impl crate::ListableResource for ValidatingWebhookConfiguration { } impl crate::Metadata for ValidatingWebhookConfiguration { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_22/api/apiserverinternal/v1alpha1/storage_version.rs b/src/v1_22/api/apiserverinternal/v1alpha1/storage_version.rs index 6b8779e542..600f1c0e24 100644 --- a/src/v1_22/api/apiserverinternal/v1alpha1/storage_version.rs +++ b/src/v1_22/api/apiserverinternal/v1alpha1/storage_version.rs @@ -517,7 +517,7 @@ impl crate::ListableResource for StorageVersion { } impl crate::Metadata for StorageVersion { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_22/api/authentication/v1/token_request.rs b/src/v1_22/api/authentication/v1/token_request.rs index 1f864e2ac3..995fbc9e76 100644 --- a/src/v1_22/api/authentication/v1/token_request.rs +++ b/src/v1_22/api/authentication/v1/token_request.rs @@ -74,7 +74,7 @@ impl crate::Resource for TokenRequest { } impl crate::Metadata for TokenRequest { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::SubObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_22/api/authentication/v1/token_review.rs b/src/v1_22/api/authentication/v1/token_review.rs index e4ed490482..e608079249 100644 --- a/src/v1_22/api/authentication/v1/token_review.rs +++ b/src/v1_22/api/authentication/v1/token_review.rs @@ -61,7 +61,7 @@ impl crate::Resource for TokenReview { } impl crate::Metadata for TokenReview { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_22/api/authorization/v1/self_subject_access_review.rs b/src/v1_22/api/authorization/v1/self_subject_access_review.rs index bf549beb13..a61121e9eb 100644 --- a/src/v1_22/api/authorization/v1/self_subject_access_review.rs +++ b/src/v1_22/api/authorization/v1/self_subject_access_review.rs @@ -61,7 +61,7 @@ impl crate::Resource for SelfSubjectAccessReview { } impl crate::Metadata for SelfSubjectAccessReview { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_22/api/authorization/v1/self_subject_rules_review.rs b/src/v1_22/api/authorization/v1/self_subject_rules_review.rs index 60defd6f35..d290dea234 100644 --- a/src/v1_22/api/authorization/v1/self_subject_rules_review.rs +++ b/src/v1_22/api/authorization/v1/self_subject_rules_review.rs @@ -61,7 +61,7 @@ impl crate::Resource for SelfSubjectRulesReview { } impl crate::Metadata for SelfSubjectRulesReview { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_22/api/authorization/v1/subject_access_review.rs b/src/v1_22/api/authorization/v1/subject_access_review.rs index 8735a9f0bc..c983461e5a 100644 --- a/src/v1_22/api/authorization/v1/subject_access_review.rs +++ b/src/v1_22/api/authorization/v1/subject_access_review.rs @@ -61,7 +61,7 @@ impl crate::Resource for SubjectAccessReview { } impl crate::Metadata for SubjectAccessReview { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_22/api/autoscaling/v1/scale.rs b/src/v1_22/api/autoscaling/v1/scale.rs index 89a7024529..3fb0a7ea47 100644 --- a/src/v1_22/api/autoscaling/v1/scale.rs +++ b/src/v1_22/api/autoscaling/v1/scale.rs @@ -711,7 +711,7 @@ impl crate::Resource for Scale { } impl crate::Metadata for Scale { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::SubObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_22/api/certificates/v1/certificate_signing_request.rs b/src/v1_22/api/certificates/v1/certificate_signing_request.rs index 066a900b7c..90721fc6e0 100644 --- a/src/v1_22/api/certificates/v1/certificate_signing_request.rs +++ b/src/v1_22/api/certificates/v1/certificate_signing_request.rs @@ -674,7 +674,7 @@ impl crate::ListableResource for CertificateSigningRequest { } impl crate::Metadata for CertificateSigningRequest { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_22/api/core/v1/component_status.rs b/src/v1_22/api/core/v1/component_status.rs index ecddf82170..ba505704c7 100644 --- a/src/v1_22/api/core/v1/component_status.rs +++ b/src/v1_22/api/core/v1/component_status.rs @@ -159,7 +159,7 @@ impl crate::ListableResource for ComponentStatus { } impl crate::Metadata for ComponentStatus { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_22/api/core/v1/namespace.rs b/src/v1_22/api/core/v1/namespace.rs index df31cdc0da..6600f8a3bb 100644 --- a/src/v1_22/api/core/v1/namespace.rs +++ b/src/v1_22/api/core/v1/namespace.rs @@ -516,7 +516,7 @@ impl crate::ListableResource for Namespace { } impl crate::Metadata for Namespace { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_22/api/core/v1/node.rs b/src/v1_22/api/core/v1/node.rs index 5a5694b818..d6e0aa6dfb 100644 --- a/src/v1_22/api/core/v1/node.rs +++ b/src/v1_22/api/core/v1/node.rs @@ -996,7 +996,7 @@ impl crate::ListableResource for Node { } impl crate::Metadata for Node { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_22/api/core/v1/persistent_volume.rs b/src/v1_22/api/core/v1/persistent_volume.rs index fada89f48e..7bd79040b6 100644 --- a/src/v1_22/api/core/v1/persistent_volume.rs +++ b/src/v1_22/api/core/v1/persistent_volume.rs @@ -516,7 +516,7 @@ impl crate::ListableResource for PersistentVolume { } impl crate::Metadata for PersistentVolume { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_22/api/flowcontrol/v1beta1/flow_schema.rs b/src/v1_22/api/flowcontrol/v1beta1/flow_schema.rs index 1d0546a710..e74328c4ec 100644 --- a/src/v1_22/api/flowcontrol/v1beta1/flow_schema.rs +++ b/src/v1_22/api/flowcontrol/v1beta1/flow_schema.rs @@ -516,7 +516,7 @@ impl crate::ListableResource for FlowSchema { } impl crate::Metadata for FlowSchema { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_22/api/flowcontrol/v1beta1/priority_level_configuration.rs b/src/v1_22/api/flowcontrol/v1beta1/priority_level_configuration.rs index 4cbe999e32..d4f148709d 100644 --- a/src/v1_22/api/flowcontrol/v1beta1/priority_level_configuration.rs +++ b/src/v1_22/api/flowcontrol/v1beta1/priority_level_configuration.rs @@ -516,7 +516,7 @@ impl crate::ListableResource for PriorityLevelConfiguration { } impl crate::Metadata for PriorityLevelConfiguration { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_22/api/networking/v1/ingress_class.rs b/src/v1_22/api/networking/v1/ingress_class.rs index d3ab7820c7..657d7e9809 100644 --- a/src/v1_22/api/networking/v1/ingress_class.rs +++ b/src/v1_22/api/networking/v1/ingress_class.rs @@ -360,7 +360,7 @@ impl crate::ListableResource for IngressClass { } impl crate::Metadata for IngressClass { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_22/api/node/v1/runtime_class.rs b/src/v1_22/api/node/v1/runtime_class.rs index b8b7e6e539..c36ce5ed64 100644 --- a/src/v1_22/api/node/v1/runtime_class.rs +++ b/src/v1_22/api/node/v1/runtime_class.rs @@ -368,7 +368,7 @@ impl crate::ListableResource for RuntimeClass { } impl crate::Metadata for RuntimeClass { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_22/api/node/v1alpha1/runtime_class.rs b/src/v1_22/api/node/v1alpha1/runtime_class.rs index 3d28fafe49..72a2cf8f2f 100644 --- a/src/v1_22/api/node/v1alpha1/runtime_class.rs +++ b/src/v1_22/api/node/v1alpha1/runtime_class.rs @@ -360,7 +360,7 @@ impl crate::ListableResource for RuntimeClass { } impl crate::Metadata for RuntimeClass { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_22/api/node/v1beta1/runtime_class.rs b/src/v1_22/api/node/v1beta1/runtime_class.rs index 9963c70a08..e1fb65037f 100644 --- a/src/v1_22/api/node/v1beta1/runtime_class.rs +++ b/src/v1_22/api/node/v1beta1/runtime_class.rs @@ -366,7 +366,7 @@ impl crate::ListableResource for RuntimeClass { } impl crate::Metadata for RuntimeClass { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_22/api/policy/v1/eviction.rs b/src/v1_22/api/policy/v1/eviction.rs index e92ebe2f3a..fe63d30d4c 100644 --- a/src/v1_22/api/policy/v1/eviction.rs +++ b/src/v1_22/api/policy/v1/eviction.rs @@ -71,7 +71,7 @@ impl crate::Resource for Eviction { } impl crate::Metadata for Eviction { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::SubObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_22/api/policy/v1beta1/pod_security_policy.rs b/src/v1_22/api/policy/v1beta1/pod_security_policy.rs index 1a515209d1..fc536300b2 100644 --- a/src/v1_22/api/policy/v1beta1/pod_security_policy.rs +++ b/src/v1_22/api/policy/v1beta1/pod_security_policy.rs @@ -360,7 +360,7 @@ impl crate::ListableResource for PodSecurityPolicy { } impl crate::Metadata for PodSecurityPolicy { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_22/api/rbac/v1/cluster_role.rs b/src/v1_22/api/rbac/v1/cluster_role.rs index 8336e14c92..541d57c8ee 100644 --- a/src/v1_22/api/rbac/v1/cluster_role.rs +++ b/src/v1_22/api/rbac/v1/cluster_role.rs @@ -363,7 +363,7 @@ impl crate::ListableResource for ClusterRole { } impl crate::Metadata for ClusterRole { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_22/api/rbac/v1/cluster_role_binding.rs b/src/v1_22/api/rbac/v1/cluster_role_binding.rs index 0162a1128e..0f02a028d1 100644 --- a/src/v1_22/api/rbac/v1/cluster_role_binding.rs +++ b/src/v1_22/api/rbac/v1/cluster_role_binding.rs @@ -363,7 +363,7 @@ impl crate::ListableResource for ClusterRoleBinding { } impl crate::Metadata for ClusterRoleBinding { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_22/api/rbac/v1alpha1/cluster_role.rs b/src/v1_22/api/rbac/v1alpha1/cluster_role.rs index 751ea258ce..49459caa0b 100644 --- a/src/v1_22/api/rbac/v1alpha1/cluster_role.rs +++ b/src/v1_22/api/rbac/v1alpha1/cluster_role.rs @@ -363,7 +363,7 @@ impl crate::ListableResource for ClusterRole { } impl crate::Metadata for ClusterRole { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_22/api/rbac/v1alpha1/cluster_role_binding.rs b/src/v1_22/api/rbac/v1alpha1/cluster_role_binding.rs index 8d275bec1a..de6fe83e42 100644 --- a/src/v1_22/api/rbac/v1alpha1/cluster_role_binding.rs +++ b/src/v1_22/api/rbac/v1alpha1/cluster_role_binding.rs @@ -363,7 +363,7 @@ impl crate::ListableResource for ClusterRoleBinding { } impl crate::Metadata for ClusterRoleBinding { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_22/api/scheduling/v1/priority_class.rs b/src/v1_22/api/scheduling/v1/priority_class.rs index a7dba60fbd..f59c63c3e0 100644 --- a/src/v1_22/api/scheduling/v1/priority_class.rs +++ b/src/v1_22/api/scheduling/v1/priority_class.rs @@ -369,7 +369,7 @@ impl crate::ListableResource for PriorityClass { } impl crate::Metadata for PriorityClass { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_22/api/scheduling/v1alpha1/priority_class.rs b/src/v1_22/api/scheduling/v1alpha1/priority_class.rs index 992756ff0f..30b20699c8 100644 --- a/src/v1_22/api/scheduling/v1alpha1/priority_class.rs +++ b/src/v1_22/api/scheduling/v1alpha1/priority_class.rs @@ -369,7 +369,7 @@ impl crate::ListableResource for PriorityClass { } impl crate::Metadata for PriorityClass { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_22/api/storage/v1/csi_driver.rs b/src/v1_22/api/storage/v1/csi_driver.rs index 0dc419fa28..841c350667 100644 --- a/src/v1_22/api/storage/v1/csi_driver.rs +++ b/src/v1_22/api/storage/v1/csi_driver.rs @@ -360,7 +360,7 @@ impl crate::ListableResource for CSIDriver { } impl crate::Metadata for CSIDriver { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_22/api/storage/v1/csi_node.rs b/src/v1_22/api/storage/v1/csi_node.rs index a514ce9bf0..2ae2dc489a 100644 --- a/src/v1_22/api/storage/v1/csi_node.rs +++ b/src/v1_22/api/storage/v1/csi_node.rs @@ -360,7 +360,7 @@ impl crate::ListableResource for CSINode { } impl crate::Metadata for CSINode { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_22/api/storage/v1/storage_class.rs b/src/v1_22/api/storage/v1/storage_class.rs index 2bf8e65456..e8e1996616 100644 --- a/src/v1_22/api/storage/v1/storage_class.rs +++ b/src/v1_22/api/storage/v1/storage_class.rs @@ -380,7 +380,7 @@ impl crate::ListableResource for StorageClass { } impl crate::Metadata for StorageClass { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_22/api/storage/v1/volume_attachment.rs b/src/v1_22/api/storage/v1/volume_attachment.rs index f6b6972639..51e070f07b 100644 --- a/src/v1_22/api/storage/v1/volume_attachment.rs +++ b/src/v1_22/api/storage/v1/volume_attachment.rs @@ -518,7 +518,7 @@ impl crate::ListableResource for VolumeAttachment { } impl crate::Metadata for VolumeAttachment { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_22/api/storage/v1alpha1/volume_attachment.rs b/src/v1_22/api/storage/v1alpha1/volume_attachment.rs index 650e9a415f..7e3661d48d 100644 --- a/src/v1_22/api/storage/v1alpha1/volume_attachment.rs +++ b/src/v1_22/api/storage/v1alpha1/volume_attachment.rs @@ -365,7 +365,7 @@ impl crate::ListableResource for VolumeAttachment { } impl crate::Metadata for VolumeAttachment { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_22/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition.rs b/src/v1_22/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition.rs index c05e8ea174..5ab4dfa8ca 100644 --- a/src/v1_22/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition.rs +++ b/src/v1_22/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition.rs @@ -516,7 +516,7 @@ impl crate::ListableResource for CustomResourceDefinition { } impl crate::Metadata for CustomResourceDefinition { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_22/apimachinery/pkg/apis/meta/v1/cluster_object_meta.rs b/src/v1_22/apimachinery/pkg/apis/meta/v1/cluster_object_meta.rs new file mode 100644 index 0000000000..b3dfa1403f --- /dev/null +++ b/src/v1_22/apimachinery/pkg/apis/meta/v1/cluster_object_meta.rs @@ -0,0 +1,528 @@ +// Generated from definition io.k8s.apimachinery.pkg.apis.meta.v1.ClusterObjectMeta + +/// ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create. +#[derive(Clone, Debug, Default, PartialEq)] +pub struct ClusterObjectMeta { + /// Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations + pub annotations: Option>, + + /// The name of the cluster which the object belongs to. This is used to distinguish resources with same name and namespace in different clusters. This field is not set anywhere right now and apiserver is going to ignore it if set in create or update request. + pub cluster_name: Option, + + /// CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC. + /// + /// Populated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + pub creation_timestamp: Option, + + /// Number of seconds allowed for this object to gracefully terminate before it will be removed from the system. Only set when deletionTimestamp is also set. May only be shortened. Read-only. + pub deletion_grace_period_seconds: Option, + + /// DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This field is set by the server when a graceful deletion is requested by the user, and is not directly settable by a client. The resource is expected to be deleted (no longer visible from resource lists, and not reachable by name) after the time in this field, once the finalizers list is empty. As long as the finalizers list contains items, deletion is blocked. Once the deletionTimestamp is set, this value may not be unset or be set further into the future, although it may be shortened or the resource may be deleted prior to this time. For example, a user may request that a pod is deleted in 30 seconds. The Kubelet will react by sending a graceful termination signal to the containers in the pod. After that 30 seconds, the Kubelet will send a hard termination signal (SIGKILL) to the container and after cleanup, remove the pod from the API. In the presence of network partitions, this object may still exist after this timestamp, until an administrator or automated process can determine the resource is fully terminated. If not set, graceful deletion of the object has not been requested. + /// + /// Populated by the system when a graceful deletion is requested. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + pub deletion_timestamp: Option, + + /// Must be empty before the object is deleted from the registry. Each entry is an identifier for the responsible component that will remove the entry from the list. If the deletionTimestamp of the object is non-nil, entries in this list can only be removed. Finalizers may be processed and removed in any order. Order is NOT enforced because it introduces significant risk of stuck finalizers. finalizers is a shared field, any actor with permission can reorder it. If the finalizer list is processed in order, then this can lead to a situation in which the component responsible for the first finalizer in the list is waiting for a signal (field value, external system, or other) produced by a component responsible for a finalizer later in the list, resulting in a deadlock. Without enforced ordering finalizers are free to order amongst themselves and are not vulnerable to ordering changes in the list. + pub finalizers: Option>, + + /// GenerateName is an optional prefix, used by the server, to generate a unique name ONLY IF the Name field has not been provided. If this field is used, the name returned to the client will be different than the name passed. This value will also be combined with a unique suffix. The provided value has the same validation rules as the Name field, and may be truncated by the length of the suffix required to make the value unique on the server. + /// + /// If this field is specified and the generated name exists, the server will NOT return a 409 - instead, it will either return 201 Created or 500 with Reason ServerTimeout indicating a unique name could not be found in the time allotted, and the client should retry (optionally after the time indicated in the Retry-After header). + /// + /// Applied only if Name is not specified. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#idempotency + pub generate_name: Option, + + /// A sequence number representing a specific generation of the desired state. Populated by the system. Read-only. + pub generation: Option, + + /// Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels + pub labels: Option>, + + /// ManagedFields maps workflow-id and version to the set of fields that are managed by that workflow. This is mostly for internal housekeeping, and users typically shouldn't need to set or understand this field. A workflow can be the user's name, a controller's name, or the name of a specific apply path like "ci-cd". The set of fields is always in the version that the workflow used when modifying the object. + pub managed_fields: Option>, + + /// Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names + pub name: Option, + + /// List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller. + pub owner_references: Option>, + + /// An opaque value that represents the internal version of this object that can be used by clients to determine when objects have changed. May be used for optimistic concurrency, change detection, and the watch operation on a resource or set of resources. Clients must treat these values as opaque and passed unmodified back to the server. They may only be valid for a particular resource or set of resources. + /// + /// Populated by the system. Read-only. Value must be treated as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency + pub resource_version: Option, + + /// SelfLink is a URL representing this object. Populated by the system. Read-only. + /// + /// DEPRECATED Kubernetes will stop propagating this field in 1.20 release and the field is planned to be removed in 1.21 release. + pub self_link: Option, + + /// UID is the unique in time and space value for this object. It is typically generated by the server on successful creation of a resource and is not allowed to change on PUT operations. + /// + /// Populated by the system. Read-only. More info: http://kubernetes.io/docs/user-guide/identifiers#uids + pub uid: Option, +} + +impl crate::DeepMerge for ClusterObjectMeta { + fn merge_from(&mut self, other: Self) { + crate::DeepMerge::merge_from(&mut self.annotations, other.annotations); + crate::DeepMerge::merge_from(&mut self.cluster_name, other.cluster_name); + crate::DeepMerge::merge_from(&mut self.creation_timestamp, other.creation_timestamp); + crate::DeepMerge::merge_from(&mut self.deletion_grace_period_seconds, other.deletion_grace_period_seconds); + crate::DeepMerge::merge_from(&mut self.deletion_timestamp, other.deletion_timestamp); + crate::DeepMerge::merge_from(&mut self.finalizers, other.finalizers); + crate::DeepMerge::merge_from(&mut self.generate_name, other.generate_name); + crate::DeepMerge::merge_from(&mut self.generation, other.generation); + crate::DeepMerge::merge_from(&mut self.labels, other.labels); + crate::DeepMerge::merge_from(&mut self.managed_fields, other.managed_fields); + crate::DeepMerge::merge_from(&mut self.name, other.name); + crate::DeepMerge::merge_from(&mut self.owner_references, other.owner_references); + crate::DeepMerge::merge_from(&mut self.resource_version, other.resource_version); + crate::DeepMerge::merge_from(&mut self.self_link, other.self_link); + crate::DeepMerge::merge_from(&mut self.uid, other.uid); + } +} + +impl<'de> crate::serde::Deserialize<'de> for ClusterObjectMeta { + fn deserialize(deserializer: D) -> Result where D: crate::serde::Deserializer<'de> { + #[allow(non_camel_case_types)] + enum Field { + Key_annotations, + Key_cluster_name, + Key_creation_timestamp, + Key_deletion_grace_period_seconds, + Key_deletion_timestamp, + Key_finalizers, + Key_generate_name, + Key_generation, + Key_labels, + Key_managed_fields, + Key_name, + Key_owner_references, + Key_resource_version, + Key_self_link, + Key_uid, + Other, + } + + impl<'de> crate::serde::Deserialize<'de> for Field { + fn deserialize(deserializer: D) -> Result where D: crate::serde::Deserializer<'de> { + struct Visitor; + + impl<'de> crate::serde::de::Visitor<'de> for Visitor { + type Value = Field; + + fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.write_str("field identifier") + } + + fn visit_str(self, v: &str) -> Result where E: crate::serde::de::Error { + Ok(match v { + "annotations" => Field::Key_annotations, + "clusterName" => Field::Key_cluster_name, + "creationTimestamp" => Field::Key_creation_timestamp, + "deletionGracePeriodSeconds" => Field::Key_deletion_grace_period_seconds, + "deletionTimestamp" => Field::Key_deletion_timestamp, + "finalizers" => Field::Key_finalizers, + "generateName" => Field::Key_generate_name, + "generation" => Field::Key_generation, + "labels" => Field::Key_labels, + "managedFields" => Field::Key_managed_fields, + "name" => Field::Key_name, + "ownerReferences" => Field::Key_owner_references, + "resourceVersion" => Field::Key_resource_version, + "selfLink" => Field::Key_self_link, + "uid" => Field::Key_uid, + _ => Field::Other, + }) + } + } + + deserializer.deserialize_identifier(Visitor) + } + } + + struct Visitor; + + impl<'de> crate::serde::de::Visitor<'de> for Visitor { + type Value = ClusterObjectMeta; + + fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.write_str("ClusterObjectMeta") + } + + fn visit_map(self, mut map: A) -> Result where A: crate::serde::de::MapAccess<'de> { + let mut value_annotations: Option> = None; + let mut value_cluster_name: Option = None; + let mut value_creation_timestamp: Option = None; + let mut value_deletion_grace_period_seconds: Option = None; + let mut value_deletion_timestamp: Option = None; + let mut value_finalizers: Option> = None; + let mut value_generate_name: Option = None; + let mut value_generation: Option = None; + let mut value_labels: Option> = None; + let mut value_managed_fields: Option> = None; + let mut value_name: Option = None; + let mut value_owner_references: Option> = None; + let mut value_resource_version: Option = None; + let mut value_self_link: Option = None; + let mut value_uid: Option = None; + + while let Some(key) = crate::serde::de::MapAccess::next_key::(&mut map)? { + match key { + Field::Key_annotations => value_annotations = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_cluster_name => value_cluster_name = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_creation_timestamp => value_creation_timestamp = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_deletion_grace_period_seconds => value_deletion_grace_period_seconds = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_deletion_timestamp => value_deletion_timestamp = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_finalizers => value_finalizers = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_generate_name => value_generate_name = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_generation => value_generation = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_labels => value_labels = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_managed_fields => value_managed_fields = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_name => value_name = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_owner_references => value_owner_references = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_resource_version => value_resource_version = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_self_link => value_self_link = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_uid => value_uid = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Other => { let _: crate::serde::de::IgnoredAny = crate::serde::de::MapAccess::next_value(&mut map)?; }, + } + } + + Ok(ClusterObjectMeta { + annotations: value_annotations, + cluster_name: value_cluster_name, + creation_timestamp: value_creation_timestamp, + deletion_grace_period_seconds: value_deletion_grace_period_seconds, + deletion_timestamp: value_deletion_timestamp, + finalizers: value_finalizers, + generate_name: value_generate_name, + generation: value_generation, + labels: value_labels, + managed_fields: value_managed_fields, + name: value_name, + owner_references: value_owner_references, + resource_version: value_resource_version, + self_link: value_self_link, + uid: value_uid, + }) + } + } + + deserializer.deserialize_struct( + "ClusterObjectMeta", + &[ + "annotations", + "clusterName", + "creationTimestamp", + "deletionGracePeriodSeconds", + "deletionTimestamp", + "finalizers", + "generateName", + "generation", + "labels", + "managedFields", + "name", + "ownerReferences", + "resourceVersion", + "selfLink", + "uid", + ], + Visitor, + ) + } +} + +impl crate::serde::Serialize for ClusterObjectMeta { + fn serialize(&self, serializer: S) -> Result where S: crate::serde::Serializer { + let mut state = serializer.serialize_struct( + "ClusterObjectMeta", + self.annotations.as_ref().map_or(0, |_| 1) + + self.cluster_name.as_ref().map_or(0, |_| 1) + + self.creation_timestamp.as_ref().map_or(0, |_| 1) + + self.deletion_grace_period_seconds.as_ref().map_or(0, |_| 1) + + self.deletion_timestamp.as_ref().map_or(0, |_| 1) + + self.finalizers.as_ref().map_or(0, |_| 1) + + self.generate_name.as_ref().map_or(0, |_| 1) + + self.generation.as_ref().map_or(0, |_| 1) + + self.labels.as_ref().map_or(0, |_| 1) + + self.managed_fields.as_ref().map_or(0, |_| 1) + + self.name.as_ref().map_or(0, |_| 1) + + self.owner_references.as_ref().map_or(0, |_| 1) + + self.resource_version.as_ref().map_or(0, |_| 1) + + self.self_link.as_ref().map_or(0, |_| 1) + + self.uid.as_ref().map_or(0, |_| 1), + )?; + if let Some(value) = &self.annotations { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "annotations", value)?; + } + if let Some(value) = &self.cluster_name { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "clusterName", value)?; + } + if let Some(value) = &self.creation_timestamp { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "creationTimestamp", value)?; + } + if let Some(value) = &self.deletion_grace_period_seconds { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "deletionGracePeriodSeconds", value)?; + } + if let Some(value) = &self.deletion_timestamp { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "deletionTimestamp", value)?; + } + if let Some(value) = &self.finalizers { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "finalizers", value)?; + } + if let Some(value) = &self.generate_name { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "generateName", value)?; + } + if let Some(value) = &self.generation { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "generation", value)?; + } + if let Some(value) = &self.labels { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "labels", value)?; + } + if let Some(value) = &self.managed_fields { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "managedFields", value)?; + } + if let Some(value) = &self.name { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "name", value)?; + } + if let Some(value) = &self.owner_references { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "ownerReferences", value)?; + } + if let Some(value) = &self.resource_version { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "resourceVersion", value)?; + } + if let Some(value) = &self.self_link { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "selfLink", value)?; + } + if let Some(value) = &self.uid { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "uid", value)?; + } + crate::serde::ser::SerializeStruct::end(state) + } +} + +#[cfg(feature = "schemars")] +impl crate::schemars::JsonSchema for ClusterObjectMeta { + fn schema_name() -> String { + "io.k8s.apimachinery.pkg.apis.meta.v1.ClusterObjectMeta".to_owned() + } + + fn json_schema(__gen: &mut crate::schemars::gen::SchemaGenerator) -> crate::schemars::schema::Schema { + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Object))), + object: Some(Box::new(crate::schemars::schema::ObjectValidation { + properties: [ + ( + "annotations".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Object))), + object: Some(Box::new(crate::schemars::schema::ObjectValidation { + additional_properties: Some(Box::new( + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }) + )), + ..Default::default() + })), + ..Default::default() + }), + ), + ( + "clusterName".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("The name of the cluster which the object belongs to. This is used to distinguish resources with same name and namespace in different clusters. This field is not set anywhere right now and apiserver is going to ignore it if set in create or update request.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ( + "creationTimestamp".to_owned(), + { + let mut schema_obj = __gen.subschema_for::().into_object(); + schema_obj.metadata = Some(Box::new(crate::schemars::schema::Metadata { + description: Some("CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC.\n\nPopulated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata".to_owned()), + ..Default::default() + })); + crate::schemars::schema::Schema::Object(schema_obj) + }, + ), + ( + "deletionGracePeriodSeconds".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Number of seconds allowed for this object to gracefully terminate before it will be removed from the system. Only set when deletionTimestamp is also set. May only be shortened. Read-only.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Integer))), + format: Some("int64".to_owned()), + ..Default::default() + }), + ), + ( + "deletionTimestamp".to_owned(), + { + let mut schema_obj = __gen.subschema_for::().into_object(); + schema_obj.metadata = Some(Box::new(crate::schemars::schema::Metadata { + description: Some("DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This field is set by the server when a graceful deletion is requested by the user, and is not directly settable by a client. The resource is expected to be deleted (no longer visible from resource lists, and not reachable by name) after the time in this field, once the finalizers list is empty. As long as the finalizers list contains items, deletion is blocked. Once the deletionTimestamp is set, this value may not be unset or be set further into the future, although it may be shortened or the resource may be deleted prior to this time. For example, a user may request that a pod is deleted in 30 seconds. The Kubelet will react by sending a graceful termination signal to the containers in the pod. After that 30 seconds, the Kubelet will send a hard termination signal (SIGKILL) to the container and after cleanup, remove the pod from the API. In the presence of network partitions, this object may still exist after this timestamp, until an administrator or automated process can determine the resource is fully terminated. If not set, graceful deletion of the object has not been requested.\n\nPopulated by the system when a graceful deletion is requested. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata".to_owned()), + ..Default::default() + })); + crate::schemars::schema::Schema::Object(schema_obj) + }, + ), + ( + "finalizers".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Must be empty before the object is deleted from the registry. Each entry is an identifier for the responsible component that will remove the entry from the list. If the deletionTimestamp of the object is non-nil, entries in this list can only be removed. Finalizers may be processed and removed in any order. Order is NOT enforced because it introduces significant risk of stuck finalizers. finalizers is a shared field, any actor with permission can reorder it. If the finalizer list is processed in order, then this can lead to a situation in which the component responsible for the first finalizer in the list is waiting for a signal (field value, external system, or other) produced by a component responsible for a finalizer later in the list, resulting in a deadlock. Without enforced ordering finalizers are free to order amongst themselves and are not vulnerable to ordering changes in the list.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Array))), + array: Some(Box::new(crate::schemars::schema::ArrayValidation { + items: Some(crate::schemars::schema::SingleOrVec::Single(Box::new( + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }) + ))), + ..Default::default() + })), + ..Default::default() + }), + ), + ( + "generateName".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("GenerateName is an optional prefix, used by the server, to generate a unique name ONLY IF the Name field has not been provided. If this field is used, the name returned to the client will be different than the name passed. This value will also be combined with a unique suffix. The provided value has the same validation rules as the Name field, and may be truncated by the length of the suffix required to make the value unique on the server.\n\nIf this field is specified and the generated name exists, the server will NOT return a 409 - instead, it will either return 201 Created or 500 with Reason ServerTimeout indicating a unique name could not be found in the time allotted, and the client should retry (optionally after the time indicated in the Retry-After header).\n\nApplied only if Name is not specified. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#idempotency".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ( + "generation".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("A sequence number representing a specific generation of the desired state. Populated by the system. Read-only.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Integer))), + format: Some("int64".to_owned()), + ..Default::default() + }), + ), + ( + "labels".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Object))), + object: Some(Box::new(crate::schemars::schema::ObjectValidation { + additional_properties: Some(Box::new( + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }) + )), + ..Default::default() + })), + ..Default::default() + }), + ), + ( + "managedFields".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("ManagedFields maps workflow-id and version to the set of fields that are managed by that workflow. This is mostly for internal housekeeping, and users typically shouldn't need to set or understand this field. A workflow can be the user's name, a controller's name, or the name of a specific apply path like \"ci-cd\". The set of fields is always in the version that the workflow used when modifying the object.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Array))), + array: Some(Box::new(crate::schemars::schema::ArrayValidation { + items: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(__gen.subschema_for::()))), + ..Default::default() + })), + ..Default::default() + }), + ), + ( + "name".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ( + "ownerReferences".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Array))), + array: Some(Box::new(crate::schemars::schema::ArrayValidation { + items: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(__gen.subschema_for::()))), + ..Default::default() + })), + ..Default::default() + }), + ), + ( + "resourceVersion".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("An opaque value that represents the internal version of this object that can be used by clients to determine when objects have changed. May be used for optimistic concurrency, change detection, and the watch operation on a resource or set of resources. Clients must treat these values as opaque and passed unmodified back to the server. They may only be valid for a particular resource or set of resources.\n\nPopulated by the system. Read-only. Value must be treated as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ( + "selfLink".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("SelfLink is a URL representing this object. Populated by the system. Read-only.\n\nDEPRECATED Kubernetes will stop propagating this field in 1.20 release and the field is planned to be removed in 1.21 release.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ( + "uid".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("UID is the unique in time and space value for this object. It is typically generated by the server on successful creation of a resource and is not allowed to change on PUT operations.\n\nPopulated by the system. Read-only. More info: http://kubernetes.io/docs/user-guide/identifiers#uids".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ].into(), + ..Default::default() + })), + ..Default::default() + }) + } +} diff --git a/src/v1_22/apimachinery/pkg/apis/meta/v1/mod.rs b/src/v1_22/apimachinery/pkg/apis/meta/v1/mod.rs index 9424127582..221a712e6d 100644 --- a/src/v1_22/apimachinery/pkg/apis/meta/v1/mod.rs +++ b/src/v1_22/apimachinery/pkg/apis/meta/v1/mod.rs @@ -14,6 +14,9 @@ pub use self::api_resource_list::APIResourceList; mod api_versions; pub use self::api_versions::APIVersions; +mod cluster_object_meta; +pub use self::cluster_object_meta::ClusterObjectMeta; + mod condition; pub use self::condition::Condition; @@ -65,6 +68,9 @@ pub use self::status_cause::StatusCause; mod status_details; pub use self::status_details::StatusDetails; +mod sub_object_meta; +pub use self::sub_object_meta::SubObjectMeta; + mod time; pub use self::time::Time; diff --git a/src/v1_22/apimachinery/pkg/apis/meta/v1/object_meta.rs b/src/v1_22/apimachinery/pkg/apis/meta/v1/object_meta.rs index c6b37624f5..8dd25439cd 100644 --- a/src/v1_22/apimachinery/pkg/apis/meta/v1/object_meta.rs +++ b/src/v1_22/apimachinery/pkg/apis/meta/v1/object_meta.rs @@ -47,7 +47,7 @@ pub struct ObjectMeta { /// Namespace defines the space within which each name must be unique. An empty namespace is equivalent to the "default" namespace, but "default" is the canonical representation. Not all objects are required to be scoped to a namespace - the value of this field for those objects will be empty. /// /// Must be a DNS_LABEL. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/namespaces - pub namespace: Option, + pub namespace: String, /// List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller. pub owner_references: Option>, @@ -211,7 +211,7 @@ impl<'de> crate::serde::Deserialize<'de> for ObjectMeta { labels: value_labels, managed_fields: value_managed_fields, name: value_name, - namespace: value_namespace, + namespace: value_namespace.unwrap_or_default(), owner_references: value_owner_references, resource_version: value_resource_version, self_link: value_self_link, @@ -249,6 +249,7 @@ impl crate::serde::Serialize for ObjectMeta { fn serialize(&self, serializer: S) -> Result where S: crate::serde::Serializer { let mut state = serializer.serialize_struct( "ObjectMeta", + 1 + self.annotations.as_ref().map_or(0, |_| 1) + self.cluster_name.as_ref().map_or(0, |_| 1) + self.creation_timestamp.as_ref().map_or(0, |_| 1) + @@ -260,7 +261,6 @@ impl crate::serde::Serialize for ObjectMeta { self.labels.as_ref().map_or(0, |_| 1) + self.managed_fields.as_ref().map_or(0, |_| 1) + self.name.as_ref().map_or(0, |_| 1) + - self.namespace.as_ref().map_or(0, |_| 1) + self.owner_references.as_ref().map_or(0, |_| 1) + self.resource_version.as_ref().map_or(0, |_| 1) + self.self_link.as_ref().map_or(0, |_| 1) + @@ -299,9 +299,7 @@ impl crate::serde::Serialize for ObjectMeta { if let Some(value) = &self.name { crate::serde::ser::SerializeStruct::serialize_field(&mut state, "name", value)?; } - if let Some(value) = &self.namespace { - crate::serde::ser::SerializeStruct::serialize_field(&mut state, "namespace", value)?; - } + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "namespace", &self.namespace)?; if let Some(value) = &self.owner_references { crate::serde::ser::SerializeStruct::serialize_field(&mut state, "ownerReferences", value)?; } @@ -547,6 +545,9 @@ impl crate::schemars::JsonSchema for ObjectMeta { }), ), ].into(), + required: [ + "namespace".to_owned(), + ].into(), ..Default::default() })), ..Default::default() diff --git a/src/v1_22/apimachinery/pkg/apis/meta/v1/sub_object_meta.rs b/src/v1_22/apimachinery/pkg/apis/meta/v1/sub_object_meta.rs new file mode 100644 index 0000000000..61046989c6 --- /dev/null +++ b/src/v1_22/apimachinery/pkg/apis/meta/v1/sub_object_meta.rs @@ -0,0 +1,555 @@ +// Generated from definition io.k8s.apimachinery.pkg.apis.meta.v1.SubObjectMeta + +/// ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create. +#[derive(Clone, Debug, Default, PartialEq)] +pub struct SubObjectMeta { + /// Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations + pub annotations: Option>, + + /// The name of the cluster which the object belongs to. This is used to distinguish resources with same name and namespace in different clusters. This field is not set anywhere right now and apiserver is going to ignore it if set in create or update request. + pub cluster_name: Option, + + /// CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC. + /// + /// Populated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + pub creation_timestamp: Option, + + /// Number of seconds allowed for this object to gracefully terminate before it will be removed from the system. Only set when deletionTimestamp is also set. May only be shortened. Read-only. + pub deletion_grace_period_seconds: Option, + + /// DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This field is set by the server when a graceful deletion is requested by the user, and is not directly settable by a client. The resource is expected to be deleted (no longer visible from resource lists, and not reachable by name) after the time in this field, once the finalizers list is empty. As long as the finalizers list contains items, deletion is blocked. Once the deletionTimestamp is set, this value may not be unset or be set further into the future, although it may be shortened or the resource may be deleted prior to this time. For example, a user may request that a pod is deleted in 30 seconds. The Kubelet will react by sending a graceful termination signal to the containers in the pod. After that 30 seconds, the Kubelet will send a hard termination signal (SIGKILL) to the container and after cleanup, remove the pod from the API. In the presence of network partitions, this object may still exist after this timestamp, until an administrator or automated process can determine the resource is fully terminated. If not set, graceful deletion of the object has not been requested. + /// + /// Populated by the system when a graceful deletion is requested. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + pub deletion_timestamp: Option, + + /// Must be empty before the object is deleted from the registry. Each entry is an identifier for the responsible component that will remove the entry from the list. If the deletionTimestamp of the object is non-nil, entries in this list can only be removed. Finalizers may be processed and removed in any order. Order is NOT enforced because it introduces significant risk of stuck finalizers. finalizers is a shared field, any actor with permission can reorder it. If the finalizer list is processed in order, then this can lead to a situation in which the component responsible for the first finalizer in the list is waiting for a signal (field value, external system, or other) produced by a component responsible for a finalizer later in the list, resulting in a deadlock. Without enforced ordering finalizers are free to order amongst themselves and are not vulnerable to ordering changes in the list. + pub finalizers: Option>, + + /// GenerateName is an optional prefix, used by the server, to generate a unique name ONLY IF the Name field has not been provided. If this field is used, the name returned to the client will be different than the name passed. This value will also be combined with a unique suffix. The provided value has the same validation rules as the Name field, and may be truncated by the length of the suffix required to make the value unique on the server. + /// + /// If this field is specified and the generated name exists, the server will NOT return a 409 - instead, it will either return 201 Created or 500 with Reason ServerTimeout indicating a unique name could not be found in the time allotted, and the client should retry (optionally after the time indicated in the Retry-After header). + /// + /// Applied only if Name is not specified. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#idempotency + pub generate_name: Option, + + /// A sequence number representing a specific generation of the desired state. Populated by the system. Read-only. + pub generation: Option, + + /// Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels + pub labels: Option>, + + /// ManagedFields maps workflow-id and version to the set of fields that are managed by that workflow. This is mostly for internal housekeeping, and users typically shouldn't need to set or understand this field. A workflow can be the user's name, a controller's name, or the name of a specific apply path like "ci-cd". The set of fields is always in the version that the workflow used when modifying the object. + pub managed_fields: Option>, + + /// Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names + pub name: Option, + + /// Namespace defines the space within which each name must be unique. An empty namespace is equivalent to the "default" namespace, but "default" is the canonical representation. Not all objects are required to be scoped to a namespace - the value of this field for those objects will be empty. + /// + /// Must be a DNS_LABEL. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/namespaces + pub namespace: Option, + + /// List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller. + pub owner_references: Option>, + + /// An opaque value that represents the internal version of this object that can be used by clients to determine when objects have changed. May be used for optimistic concurrency, change detection, and the watch operation on a resource or set of resources. Clients must treat these values as opaque and passed unmodified back to the server. They may only be valid for a particular resource or set of resources. + /// + /// Populated by the system. Read-only. Value must be treated as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency + pub resource_version: Option, + + /// SelfLink is a URL representing this object. Populated by the system. Read-only. + /// + /// DEPRECATED Kubernetes will stop propagating this field in 1.20 release and the field is planned to be removed in 1.21 release. + pub self_link: Option, + + /// UID is the unique in time and space value for this object. It is typically generated by the server on successful creation of a resource and is not allowed to change on PUT operations. + /// + /// Populated by the system. Read-only. More info: http://kubernetes.io/docs/user-guide/identifiers#uids + pub uid: Option, +} + +impl crate::DeepMerge for SubObjectMeta { + fn merge_from(&mut self, other: Self) { + crate::DeepMerge::merge_from(&mut self.annotations, other.annotations); + crate::DeepMerge::merge_from(&mut self.cluster_name, other.cluster_name); + crate::DeepMerge::merge_from(&mut self.creation_timestamp, other.creation_timestamp); + crate::DeepMerge::merge_from(&mut self.deletion_grace_period_seconds, other.deletion_grace_period_seconds); + crate::DeepMerge::merge_from(&mut self.deletion_timestamp, other.deletion_timestamp); + crate::DeepMerge::merge_from(&mut self.finalizers, other.finalizers); + crate::DeepMerge::merge_from(&mut self.generate_name, other.generate_name); + crate::DeepMerge::merge_from(&mut self.generation, other.generation); + crate::DeepMerge::merge_from(&mut self.labels, other.labels); + crate::DeepMerge::merge_from(&mut self.managed_fields, other.managed_fields); + crate::DeepMerge::merge_from(&mut self.name, other.name); + crate::DeepMerge::merge_from(&mut self.namespace, other.namespace); + crate::DeepMerge::merge_from(&mut self.owner_references, other.owner_references); + crate::DeepMerge::merge_from(&mut self.resource_version, other.resource_version); + crate::DeepMerge::merge_from(&mut self.self_link, other.self_link); + crate::DeepMerge::merge_from(&mut self.uid, other.uid); + } +} + +impl<'de> crate::serde::Deserialize<'de> for SubObjectMeta { + fn deserialize(deserializer: D) -> Result where D: crate::serde::Deserializer<'de> { + #[allow(non_camel_case_types)] + enum Field { + Key_annotations, + Key_cluster_name, + Key_creation_timestamp, + Key_deletion_grace_period_seconds, + Key_deletion_timestamp, + Key_finalizers, + Key_generate_name, + Key_generation, + Key_labels, + Key_managed_fields, + Key_name, + Key_namespace, + Key_owner_references, + Key_resource_version, + Key_self_link, + Key_uid, + Other, + } + + impl<'de> crate::serde::Deserialize<'de> for Field { + fn deserialize(deserializer: D) -> Result where D: crate::serde::Deserializer<'de> { + struct Visitor; + + impl<'de> crate::serde::de::Visitor<'de> for Visitor { + type Value = Field; + + fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.write_str("field identifier") + } + + fn visit_str(self, v: &str) -> Result where E: crate::serde::de::Error { + Ok(match v { + "annotations" => Field::Key_annotations, + "clusterName" => Field::Key_cluster_name, + "creationTimestamp" => Field::Key_creation_timestamp, + "deletionGracePeriodSeconds" => Field::Key_deletion_grace_period_seconds, + "deletionTimestamp" => Field::Key_deletion_timestamp, + "finalizers" => Field::Key_finalizers, + "generateName" => Field::Key_generate_name, + "generation" => Field::Key_generation, + "labels" => Field::Key_labels, + "managedFields" => Field::Key_managed_fields, + "name" => Field::Key_name, + "namespace" => Field::Key_namespace, + "ownerReferences" => Field::Key_owner_references, + "resourceVersion" => Field::Key_resource_version, + "selfLink" => Field::Key_self_link, + "uid" => Field::Key_uid, + _ => Field::Other, + }) + } + } + + deserializer.deserialize_identifier(Visitor) + } + } + + struct Visitor; + + impl<'de> crate::serde::de::Visitor<'de> for Visitor { + type Value = SubObjectMeta; + + fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.write_str("SubObjectMeta") + } + + fn visit_map(self, mut map: A) -> Result where A: crate::serde::de::MapAccess<'de> { + let mut value_annotations: Option> = None; + let mut value_cluster_name: Option = None; + let mut value_creation_timestamp: Option = None; + let mut value_deletion_grace_period_seconds: Option = None; + let mut value_deletion_timestamp: Option = None; + let mut value_finalizers: Option> = None; + let mut value_generate_name: Option = None; + let mut value_generation: Option = None; + let mut value_labels: Option> = None; + let mut value_managed_fields: Option> = None; + let mut value_name: Option = None; + let mut value_namespace: Option = None; + let mut value_owner_references: Option> = None; + let mut value_resource_version: Option = None; + let mut value_self_link: Option = None; + let mut value_uid: Option = None; + + while let Some(key) = crate::serde::de::MapAccess::next_key::(&mut map)? { + match key { + Field::Key_annotations => value_annotations = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_cluster_name => value_cluster_name = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_creation_timestamp => value_creation_timestamp = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_deletion_grace_period_seconds => value_deletion_grace_period_seconds = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_deletion_timestamp => value_deletion_timestamp = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_finalizers => value_finalizers = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_generate_name => value_generate_name = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_generation => value_generation = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_labels => value_labels = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_managed_fields => value_managed_fields = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_name => value_name = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_namespace => value_namespace = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_owner_references => value_owner_references = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_resource_version => value_resource_version = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_self_link => value_self_link = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_uid => value_uid = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Other => { let _: crate::serde::de::IgnoredAny = crate::serde::de::MapAccess::next_value(&mut map)?; }, + } + } + + Ok(SubObjectMeta { + annotations: value_annotations, + cluster_name: value_cluster_name, + creation_timestamp: value_creation_timestamp, + deletion_grace_period_seconds: value_deletion_grace_period_seconds, + deletion_timestamp: value_deletion_timestamp, + finalizers: value_finalizers, + generate_name: value_generate_name, + generation: value_generation, + labels: value_labels, + managed_fields: value_managed_fields, + name: value_name, + namespace: value_namespace, + owner_references: value_owner_references, + resource_version: value_resource_version, + self_link: value_self_link, + uid: value_uid, + }) + } + } + + deserializer.deserialize_struct( + "SubObjectMeta", + &[ + "annotations", + "clusterName", + "creationTimestamp", + "deletionGracePeriodSeconds", + "deletionTimestamp", + "finalizers", + "generateName", + "generation", + "labels", + "managedFields", + "name", + "namespace", + "ownerReferences", + "resourceVersion", + "selfLink", + "uid", + ], + Visitor, + ) + } +} + +impl crate::serde::Serialize for SubObjectMeta { + fn serialize(&self, serializer: S) -> Result where S: crate::serde::Serializer { + let mut state = serializer.serialize_struct( + "SubObjectMeta", + self.annotations.as_ref().map_or(0, |_| 1) + + self.cluster_name.as_ref().map_or(0, |_| 1) + + self.creation_timestamp.as_ref().map_or(0, |_| 1) + + self.deletion_grace_period_seconds.as_ref().map_or(0, |_| 1) + + self.deletion_timestamp.as_ref().map_or(0, |_| 1) + + self.finalizers.as_ref().map_or(0, |_| 1) + + self.generate_name.as_ref().map_or(0, |_| 1) + + self.generation.as_ref().map_or(0, |_| 1) + + self.labels.as_ref().map_or(0, |_| 1) + + self.managed_fields.as_ref().map_or(0, |_| 1) + + self.name.as_ref().map_or(0, |_| 1) + + self.namespace.as_ref().map_or(0, |_| 1) + + self.owner_references.as_ref().map_or(0, |_| 1) + + self.resource_version.as_ref().map_or(0, |_| 1) + + self.self_link.as_ref().map_or(0, |_| 1) + + self.uid.as_ref().map_or(0, |_| 1), + )?; + if let Some(value) = &self.annotations { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "annotations", value)?; + } + if let Some(value) = &self.cluster_name { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "clusterName", value)?; + } + if let Some(value) = &self.creation_timestamp { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "creationTimestamp", value)?; + } + if let Some(value) = &self.deletion_grace_period_seconds { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "deletionGracePeriodSeconds", value)?; + } + if let Some(value) = &self.deletion_timestamp { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "deletionTimestamp", value)?; + } + if let Some(value) = &self.finalizers { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "finalizers", value)?; + } + if let Some(value) = &self.generate_name { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "generateName", value)?; + } + if let Some(value) = &self.generation { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "generation", value)?; + } + if let Some(value) = &self.labels { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "labels", value)?; + } + if let Some(value) = &self.managed_fields { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "managedFields", value)?; + } + if let Some(value) = &self.name { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "name", value)?; + } + if let Some(value) = &self.namespace { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "namespace", value)?; + } + if let Some(value) = &self.owner_references { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "ownerReferences", value)?; + } + if let Some(value) = &self.resource_version { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "resourceVersion", value)?; + } + if let Some(value) = &self.self_link { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "selfLink", value)?; + } + if let Some(value) = &self.uid { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "uid", value)?; + } + crate::serde::ser::SerializeStruct::end(state) + } +} + +#[cfg(feature = "schemars")] +impl crate::schemars::JsonSchema for SubObjectMeta { + fn schema_name() -> String { + "io.k8s.apimachinery.pkg.apis.meta.v1.SubObjectMeta".to_owned() + } + + fn json_schema(__gen: &mut crate::schemars::gen::SchemaGenerator) -> crate::schemars::schema::Schema { + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Object))), + object: Some(Box::new(crate::schemars::schema::ObjectValidation { + properties: [ + ( + "annotations".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Object))), + object: Some(Box::new(crate::schemars::schema::ObjectValidation { + additional_properties: Some(Box::new( + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }) + )), + ..Default::default() + })), + ..Default::default() + }), + ), + ( + "clusterName".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("The name of the cluster which the object belongs to. This is used to distinguish resources with same name and namespace in different clusters. This field is not set anywhere right now and apiserver is going to ignore it if set in create or update request.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ( + "creationTimestamp".to_owned(), + { + let mut schema_obj = __gen.subschema_for::().into_object(); + schema_obj.metadata = Some(Box::new(crate::schemars::schema::Metadata { + description: Some("CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC.\n\nPopulated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata".to_owned()), + ..Default::default() + })); + crate::schemars::schema::Schema::Object(schema_obj) + }, + ), + ( + "deletionGracePeriodSeconds".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Number of seconds allowed for this object to gracefully terminate before it will be removed from the system. Only set when deletionTimestamp is also set. May only be shortened. Read-only.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Integer))), + format: Some("int64".to_owned()), + ..Default::default() + }), + ), + ( + "deletionTimestamp".to_owned(), + { + let mut schema_obj = __gen.subschema_for::().into_object(); + schema_obj.metadata = Some(Box::new(crate::schemars::schema::Metadata { + description: Some("DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This field is set by the server when a graceful deletion is requested by the user, and is not directly settable by a client. The resource is expected to be deleted (no longer visible from resource lists, and not reachable by name) after the time in this field, once the finalizers list is empty. As long as the finalizers list contains items, deletion is blocked. Once the deletionTimestamp is set, this value may not be unset or be set further into the future, although it may be shortened or the resource may be deleted prior to this time. For example, a user may request that a pod is deleted in 30 seconds. The Kubelet will react by sending a graceful termination signal to the containers in the pod. After that 30 seconds, the Kubelet will send a hard termination signal (SIGKILL) to the container and after cleanup, remove the pod from the API. In the presence of network partitions, this object may still exist after this timestamp, until an administrator or automated process can determine the resource is fully terminated. If not set, graceful deletion of the object has not been requested.\n\nPopulated by the system when a graceful deletion is requested. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata".to_owned()), + ..Default::default() + })); + crate::schemars::schema::Schema::Object(schema_obj) + }, + ), + ( + "finalizers".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Must be empty before the object is deleted from the registry. Each entry is an identifier for the responsible component that will remove the entry from the list. If the deletionTimestamp of the object is non-nil, entries in this list can only be removed. Finalizers may be processed and removed in any order. Order is NOT enforced because it introduces significant risk of stuck finalizers. finalizers is a shared field, any actor with permission can reorder it. If the finalizer list is processed in order, then this can lead to a situation in which the component responsible for the first finalizer in the list is waiting for a signal (field value, external system, or other) produced by a component responsible for a finalizer later in the list, resulting in a deadlock. Without enforced ordering finalizers are free to order amongst themselves and are not vulnerable to ordering changes in the list.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Array))), + array: Some(Box::new(crate::schemars::schema::ArrayValidation { + items: Some(crate::schemars::schema::SingleOrVec::Single(Box::new( + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }) + ))), + ..Default::default() + })), + ..Default::default() + }), + ), + ( + "generateName".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("GenerateName is an optional prefix, used by the server, to generate a unique name ONLY IF the Name field has not been provided. If this field is used, the name returned to the client will be different than the name passed. This value will also be combined with a unique suffix. The provided value has the same validation rules as the Name field, and may be truncated by the length of the suffix required to make the value unique on the server.\n\nIf this field is specified and the generated name exists, the server will NOT return a 409 - instead, it will either return 201 Created or 500 with Reason ServerTimeout indicating a unique name could not be found in the time allotted, and the client should retry (optionally after the time indicated in the Retry-After header).\n\nApplied only if Name is not specified. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#idempotency".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ( + "generation".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("A sequence number representing a specific generation of the desired state. Populated by the system. Read-only.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Integer))), + format: Some("int64".to_owned()), + ..Default::default() + }), + ), + ( + "labels".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Object))), + object: Some(Box::new(crate::schemars::schema::ObjectValidation { + additional_properties: Some(Box::new( + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }) + )), + ..Default::default() + })), + ..Default::default() + }), + ), + ( + "managedFields".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("ManagedFields maps workflow-id and version to the set of fields that are managed by that workflow. This is mostly for internal housekeeping, and users typically shouldn't need to set or understand this field. A workflow can be the user's name, a controller's name, or the name of a specific apply path like \"ci-cd\". The set of fields is always in the version that the workflow used when modifying the object.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Array))), + array: Some(Box::new(crate::schemars::schema::ArrayValidation { + items: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(__gen.subschema_for::()))), + ..Default::default() + })), + ..Default::default() + }), + ), + ( + "name".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ( + "namespace".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Namespace defines the space within which each name must be unique. An empty namespace is equivalent to the \"default\" namespace, but \"default\" is the canonical representation. Not all objects are required to be scoped to a namespace - the value of this field for those objects will be empty.\n\nMust be a DNS_LABEL. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/namespaces".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ( + "ownerReferences".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Array))), + array: Some(Box::new(crate::schemars::schema::ArrayValidation { + items: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(__gen.subschema_for::()))), + ..Default::default() + })), + ..Default::default() + }), + ), + ( + "resourceVersion".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("An opaque value that represents the internal version of this object that can be used by clients to determine when objects have changed. May be used for optimistic concurrency, change detection, and the watch operation on a resource or set of resources. Clients must treat these values as opaque and passed unmodified back to the server. They may only be valid for a particular resource or set of resources.\n\nPopulated by the system. Read-only. Value must be treated as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ( + "selfLink".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("SelfLink is a URL representing this object. Populated by the system. Read-only.\n\nDEPRECATED Kubernetes will stop propagating this field in 1.20 release and the field is planned to be removed in 1.21 release.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ( + "uid".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("UID is the unique in time and space value for this object. It is typically generated by the server on successful creation of a resource and is not allowed to change on PUT operations.\n\nPopulated by the system. Read-only. More info: http://kubernetes.io/docs/user-guide/identifiers#uids".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ].into(), + ..Default::default() + })), + ..Default::default() + }) + } +} diff --git a/src/v1_22/kube_aggregator/pkg/apis/apiregistration/v1/api_service.rs b/src/v1_22/kube_aggregator/pkg/apis/apiregistration/v1/api_service.rs index cff7ff1489..587f0a528a 100644 --- a/src/v1_22/kube_aggregator/pkg/apis/apiregistration/v1/api_service.rs +++ b/src/v1_22/kube_aggregator/pkg/apis/apiregistration/v1/api_service.rs @@ -516,7 +516,7 @@ impl crate::ListableResource for APIService { } impl crate::Metadata for APIService { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_23/api/admissionregistration/v1/mutating_webhook_configuration.rs b/src/v1_23/api/admissionregistration/v1/mutating_webhook_configuration.rs index cb8ec8f5af..e0f9531189 100644 --- a/src/v1_23/api/admissionregistration/v1/mutating_webhook_configuration.rs +++ b/src/v1_23/api/admissionregistration/v1/mutating_webhook_configuration.rs @@ -360,7 +360,7 @@ impl crate::ListableResource for MutatingWebhookConfiguration { } impl crate::Metadata for MutatingWebhookConfiguration { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_23/api/admissionregistration/v1/validating_webhook_configuration.rs b/src/v1_23/api/admissionregistration/v1/validating_webhook_configuration.rs index 4c520b0eeb..4cf73a02cb 100644 --- a/src/v1_23/api/admissionregistration/v1/validating_webhook_configuration.rs +++ b/src/v1_23/api/admissionregistration/v1/validating_webhook_configuration.rs @@ -360,7 +360,7 @@ impl crate::ListableResource for ValidatingWebhookConfiguration { } impl crate::Metadata for ValidatingWebhookConfiguration { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_23/api/apiserverinternal/v1alpha1/storage_version.rs b/src/v1_23/api/apiserverinternal/v1alpha1/storage_version.rs index c5d811a2fd..7e41c6b9c1 100644 --- a/src/v1_23/api/apiserverinternal/v1alpha1/storage_version.rs +++ b/src/v1_23/api/apiserverinternal/v1alpha1/storage_version.rs @@ -516,7 +516,7 @@ impl crate::ListableResource for StorageVersion { } impl crate::Metadata for StorageVersion { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_23/api/authentication/v1/token_request.rs b/src/v1_23/api/authentication/v1/token_request.rs index 1f864e2ac3..995fbc9e76 100644 --- a/src/v1_23/api/authentication/v1/token_request.rs +++ b/src/v1_23/api/authentication/v1/token_request.rs @@ -74,7 +74,7 @@ impl crate::Resource for TokenRequest { } impl crate::Metadata for TokenRequest { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::SubObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_23/api/authentication/v1/token_review.rs b/src/v1_23/api/authentication/v1/token_review.rs index e4ed490482..e608079249 100644 --- a/src/v1_23/api/authentication/v1/token_review.rs +++ b/src/v1_23/api/authentication/v1/token_review.rs @@ -61,7 +61,7 @@ impl crate::Resource for TokenReview { } impl crate::Metadata for TokenReview { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_23/api/authorization/v1/self_subject_access_review.rs b/src/v1_23/api/authorization/v1/self_subject_access_review.rs index bf549beb13..a61121e9eb 100644 --- a/src/v1_23/api/authorization/v1/self_subject_access_review.rs +++ b/src/v1_23/api/authorization/v1/self_subject_access_review.rs @@ -61,7 +61,7 @@ impl crate::Resource for SelfSubjectAccessReview { } impl crate::Metadata for SelfSubjectAccessReview { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_23/api/authorization/v1/self_subject_rules_review.rs b/src/v1_23/api/authorization/v1/self_subject_rules_review.rs index 60defd6f35..d290dea234 100644 --- a/src/v1_23/api/authorization/v1/self_subject_rules_review.rs +++ b/src/v1_23/api/authorization/v1/self_subject_rules_review.rs @@ -61,7 +61,7 @@ impl crate::Resource for SelfSubjectRulesReview { } impl crate::Metadata for SelfSubjectRulesReview { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_23/api/authorization/v1/subject_access_review.rs b/src/v1_23/api/authorization/v1/subject_access_review.rs index 8735a9f0bc..c983461e5a 100644 --- a/src/v1_23/api/authorization/v1/subject_access_review.rs +++ b/src/v1_23/api/authorization/v1/subject_access_review.rs @@ -61,7 +61,7 @@ impl crate::Resource for SubjectAccessReview { } impl crate::Metadata for SubjectAccessReview { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_23/api/autoscaling/v1/scale.rs b/src/v1_23/api/autoscaling/v1/scale.rs index 89a7024529..3fb0a7ea47 100644 --- a/src/v1_23/api/autoscaling/v1/scale.rs +++ b/src/v1_23/api/autoscaling/v1/scale.rs @@ -711,7 +711,7 @@ impl crate::Resource for Scale { } impl crate::Metadata for Scale { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::SubObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_23/api/certificates/v1/certificate_signing_request.rs b/src/v1_23/api/certificates/v1/certificate_signing_request.rs index 066a900b7c..90721fc6e0 100644 --- a/src/v1_23/api/certificates/v1/certificate_signing_request.rs +++ b/src/v1_23/api/certificates/v1/certificate_signing_request.rs @@ -674,7 +674,7 @@ impl crate::ListableResource for CertificateSigningRequest { } impl crate::Metadata for CertificateSigningRequest { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_23/api/core/v1/component_status.rs b/src/v1_23/api/core/v1/component_status.rs index ecddf82170..ba505704c7 100644 --- a/src/v1_23/api/core/v1/component_status.rs +++ b/src/v1_23/api/core/v1/component_status.rs @@ -159,7 +159,7 @@ impl crate::ListableResource for ComponentStatus { } impl crate::Metadata for ComponentStatus { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_23/api/core/v1/namespace.rs b/src/v1_23/api/core/v1/namespace.rs index df31cdc0da..6600f8a3bb 100644 --- a/src/v1_23/api/core/v1/namespace.rs +++ b/src/v1_23/api/core/v1/namespace.rs @@ -516,7 +516,7 @@ impl crate::ListableResource for Namespace { } impl crate::Metadata for Namespace { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_23/api/core/v1/node.rs b/src/v1_23/api/core/v1/node.rs index 5a5694b818..d6e0aa6dfb 100644 --- a/src/v1_23/api/core/v1/node.rs +++ b/src/v1_23/api/core/v1/node.rs @@ -996,7 +996,7 @@ impl crate::ListableResource for Node { } impl crate::Metadata for Node { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_23/api/core/v1/persistent_volume.rs b/src/v1_23/api/core/v1/persistent_volume.rs index fada89f48e..7bd79040b6 100644 --- a/src/v1_23/api/core/v1/persistent_volume.rs +++ b/src/v1_23/api/core/v1/persistent_volume.rs @@ -516,7 +516,7 @@ impl crate::ListableResource for PersistentVolume { } impl crate::Metadata for PersistentVolume { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_23/api/flowcontrol/v1beta1/flow_schema.rs b/src/v1_23/api/flowcontrol/v1beta1/flow_schema.rs index 1d0546a710..e74328c4ec 100644 --- a/src/v1_23/api/flowcontrol/v1beta1/flow_schema.rs +++ b/src/v1_23/api/flowcontrol/v1beta1/flow_schema.rs @@ -516,7 +516,7 @@ impl crate::ListableResource for FlowSchema { } impl crate::Metadata for FlowSchema { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_23/api/flowcontrol/v1beta1/priority_level_configuration.rs b/src/v1_23/api/flowcontrol/v1beta1/priority_level_configuration.rs index 4cbe999e32..d4f148709d 100644 --- a/src/v1_23/api/flowcontrol/v1beta1/priority_level_configuration.rs +++ b/src/v1_23/api/flowcontrol/v1beta1/priority_level_configuration.rs @@ -516,7 +516,7 @@ impl crate::ListableResource for PriorityLevelConfiguration { } impl crate::Metadata for PriorityLevelConfiguration { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_23/api/flowcontrol/v1beta2/flow_schema.rs b/src/v1_23/api/flowcontrol/v1beta2/flow_schema.rs index 71d13230a3..7efa4158ac 100644 --- a/src/v1_23/api/flowcontrol/v1beta2/flow_schema.rs +++ b/src/v1_23/api/flowcontrol/v1beta2/flow_schema.rs @@ -516,7 +516,7 @@ impl crate::ListableResource for FlowSchema { } impl crate::Metadata for FlowSchema { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_23/api/flowcontrol/v1beta2/priority_level_configuration.rs b/src/v1_23/api/flowcontrol/v1beta2/priority_level_configuration.rs index 91ebc9f1f5..982df6b6a7 100644 --- a/src/v1_23/api/flowcontrol/v1beta2/priority_level_configuration.rs +++ b/src/v1_23/api/flowcontrol/v1beta2/priority_level_configuration.rs @@ -516,7 +516,7 @@ impl crate::ListableResource for PriorityLevelConfiguration { } impl crate::Metadata for PriorityLevelConfiguration { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_23/api/networking/v1/ingress_class.rs b/src/v1_23/api/networking/v1/ingress_class.rs index d3ab7820c7..657d7e9809 100644 --- a/src/v1_23/api/networking/v1/ingress_class.rs +++ b/src/v1_23/api/networking/v1/ingress_class.rs @@ -360,7 +360,7 @@ impl crate::ListableResource for IngressClass { } impl crate::Metadata for IngressClass { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_23/api/node/v1/runtime_class.rs b/src/v1_23/api/node/v1/runtime_class.rs index b8b7e6e539..c36ce5ed64 100644 --- a/src/v1_23/api/node/v1/runtime_class.rs +++ b/src/v1_23/api/node/v1/runtime_class.rs @@ -368,7 +368,7 @@ impl crate::ListableResource for RuntimeClass { } impl crate::Metadata for RuntimeClass { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_23/api/node/v1alpha1/runtime_class.rs b/src/v1_23/api/node/v1alpha1/runtime_class.rs index 3d28fafe49..72a2cf8f2f 100644 --- a/src/v1_23/api/node/v1alpha1/runtime_class.rs +++ b/src/v1_23/api/node/v1alpha1/runtime_class.rs @@ -360,7 +360,7 @@ impl crate::ListableResource for RuntimeClass { } impl crate::Metadata for RuntimeClass { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_23/api/node/v1beta1/runtime_class.rs b/src/v1_23/api/node/v1beta1/runtime_class.rs index 9963c70a08..e1fb65037f 100644 --- a/src/v1_23/api/node/v1beta1/runtime_class.rs +++ b/src/v1_23/api/node/v1beta1/runtime_class.rs @@ -366,7 +366,7 @@ impl crate::ListableResource for RuntimeClass { } impl crate::Metadata for RuntimeClass { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_23/api/policy/v1/eviction.rs b/src/v1_23/api/policy/v1/eviction.rs index e92ebe2f3a..fe63d30d4c 100644 --- a/src/v1_23/api/policy/v1/eviction.rs +++ b/src/v1_23/api/policy/v1/eviction.rs @@ -71,7 +71,7 @@ impl crate::Resource for Eviction { } impl crate::Metadata for Eviction { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::SubObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_23/api/policy/v1beta1/pod_security_policy.rs b/src/v1_23/api/policy/v1beta1/pod_security_policy.rs index 1a515209d1..fc536300b2 100644 --- a/src/v1_23/api/policy/v1beta1/pod_security_policy.rs +++ b/src/v1_23/api/policy/v1beta1/pod_security_policy.rs @@ -360,7 +360,7 @@ impl crate::ListableResource for PodSecurityPolicy { } impl crate::Metadata for PodSecurityPolicy { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_23/api/rbac/v1/cluster_role.rs b/src/v1_23/api/rbac/v1/cluster_role.rs index 8336e14c92..541d57c8ee 100644 --- a/src/v1_23/api/rbac/v1/cluster_role.rs +++ b/src/v1_23/api/rbac/v1/cluster_role.rs @@ -363,7 +363,7 @@ impl crate::ListableResource for ClusterRole { } impl crate::Metadata for ClusterRole { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_23/api/rbac/v1/cluster_role_binding.rs b/src/v1_23/api/rbac/v1/cluster_role_binding.rs index 0162a1128e..0f02a028d1 100644 --- a/src/v1_23/api/rbac/v1/cluster_role_binding.rs +++ b/src/v1_23/api/rbac/v1/cluster_role_binding.rs @@ -363,7 +363,7 @@ impl crate::ListableResource for ClusterRoleBinding { } impl crate::Metadata for ClusterRoleBinding { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_23/api/scheduling/v1/priority_class.rs b/src/v1_23/api/scheduling/v1/priority_class.rs index a7dba60fbd..f59c63c3e0 100644 --- a/src/v1_23/api/scheduling/v1/priority_class.rs +++ b/src/v1_23/api/scheduling/v1/priority_class.rs @@ -369,7 +369,7 @@ impl crate::ListableResource for PriorityClass { } impl crate::Metadata for PriorityClass { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_23/api/storage/v1/csi_driver.rs b/src/v1_23/api/storage/v1/csi_driver.rs index 0dc419fa28..841c350667 100644 --- a/src/v1_23/api/storage/v1/csi_driver.rs +++ b/src/v1_23/api/storage/v1/csi_driver.rs @@ -360,7 +360,7 @@ impl crate::ListableResource for CSIDriver { } impl crate::Metadata for CSIDriver { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_23/api/storage/v1/csi_node.rs b/src/v1_23/api/storage/v1/csi_node.rs index a514ce9bf0..2ae2dc489a 100644 --- a/src/v1_23/api/storage/v1/csi_node.rs +++ b/src/v1_23/api/storage/v1/csi_node.rs @@ -360,7 +360,7 @@ impl crate::ListableResource for CSINode { } impl crate::Metadata for CSINode { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_23/api/storage/v1/storage_class.rs b/src/v1_23/api/storage/v1/storage_class.rs index 2bf8e65456..e8e1996616 100644 --- a/src/v1_23/api/storage/v1/storage_class.rs +++ b/src/v1_23/api/storage/v1/storage_class.rs @@ -380,7 +380,7 @@ impl crate::ListableResource for StorageClass { } impl crate::Metadata for StorageClass { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_23/api/storage/v1/volume_attachment.rs b/src/v1_23/api/storage/v1/volume_attachment.rs index f6b6972639..51e070f07b 100644 --- a/src/v1_23/api/storage/v1/volume_attachment.rs +++ b/src/v1_23/api/storage/v1/volume_attachment.rs @@ -518,7 +518,7 @@ impl crate::ListableResource for VolumeAttachment { } impl crate::Metadata for VolumeAttachment { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_23/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition.rs b/src/v1_23/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition.rs index c05e8ea174..5ab4dfa8ca 100644 --- a/src/v1_23/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition.rs +++ b/src/v1_23/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition.rs @@ -516,7 +516,7 @@ impl crate::ListableResource for CustomResourceDefinition { } impl crate::Metadata for CustomResourceDefinition { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_23/apimachinery/pkg/apis/meta/v1/cluster_object_meta.rs b/src/v1_23/apimachinery/pkg/apis/meta/v1/cluster_object_meta.rs new file mode 100644 index 0000000000..b3dfa1403f --- /dev/null +++ b/src/v1_23/apimachinery/pkg/apis/meta/v1/cluster_object_meta.rs @@ -0,0 +1,528 @@ +// Generated from definition io.k8s.apimachinery.pkg.apis.meta.v1.ClusterObjectMeta + +/// ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create. +#[derive(Clone, Debug, Default, PartialEq)] +pub struct ClusterObjectMeta { + /// Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations + pub annotations: Option>, + + /// The name of the cluster which the object belongs to. This is used to distinguish resources with same name and namespace in different clusters. This field is not set anywhere right now and apiserver is going to ignore it if set in create or update request. + pub cluster_name: Option, + + /// CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC. + /// + /// Populated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + pub creation_timestamp: Option, + + /// Number of seconds allowed for this object to gracefully terminate before it will be removed from the system. Only set when deletionTimestamp is also set. May only be shortened. Read-only. + pub deletion_grace_period_seconds: Option, + + /// DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This field is set by the server when a graceful deletion is requested by the user, and is not directly settable by a client. The resource is expected to be deleted (no longer visible from resource lists, and not reachable by name) after the time in this field, once the finalizers list is empty. As long as the finalizers list contains items, deletion is blocked. Once the deletionTimestamp is set, this value may not be unset or be set further into the future, although it may be shortened or the resource may be deleted prior to this time. For example, a user may request that a pod is deleted in 30 seconds. The Kubelet will react by sending a graceful termination signal to the containers in the pod. After that 30 seconds, the Kubelet will send a hard termination signal (SIGKILL) to the container and after cleanup, remove the pod from the API. In the presence of network partitions, this object may still exist after this timestamp, until an administrator or automated process can determine the resource is fully terminated. If not set, graceful deletion of the object has not been requested. + /// + /// Populated by the system when a graceful deletion is requested. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + pub deletion_timestamp: Option, + + /// Must be empty before the object is deleted from the registry. Each entry is an identifier for the responsible component that will remove the entry from the list. If the deletionTimestamp of the object is non-nil, entries in this list can only be removed. Finalizers may be processed and removed in any order. Order is NOT enforced because it introduces significant risk of stuck finalizers. finalizers is a shared field, any actor with permission can reorder it. If the finalizer list is processed in order, then this can lead to a situation in which the component responsible for the first finalizer in the list is waiting for a signal (field value, external system, or other) produced by a component responsible for a finalizer later in the list, resulting in a deadlock. Without enforced ordering finalizers are free to order amongst themselves and are not vulnerable to ordering changes in the list. + pub finalizers: Option>, + + /// GenerateName is an optional prefix, used by the server, to generate a unique name ONLY IF the Name field has not been provided. If this field is used, the name returned to the client will be different than the name passed. This value will also be combined with a unique suffix. The provided value has the same validation rules as the Name field, and may be truncated by the length of the suffix required to make the value unique on the server. + /// + /// If this field is specified and the generated name exists, the server will NOT return a 409 - instead, it will either return 201 Created or 500 with Reason ServerTimeout indicating a unique name could not be found in the time allotted, and the client should retry (optionally after the time indicated in the Retry-After header). + /// + /// Applied only if Name is not specified. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#idempotency + pub generate_name: Option, + + /// A sequence number representing a specific generation of the desired state. Populated by the system. Read-only. + pub generation: Option, + + /// Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels + pub labels: Option>, + + /// ManagedFields maps workflow-id and version to the set of fields that are managed by that workflow. This is mostly for internal housekeeping, and users typically shouldn't need to set or understand this field. A workflow can be the user's name, a controller's name, or the name of a specific apply path like "ci-cd". The set of fields is always in the version that the workflow used when modifying the object. + pub managed_fields: Option>, + + /// Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names + pub name: Option, + + /// List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller. + pub owner_references: Option>, + + /// An opaque value that represents the internal version of this object that can be used by clients to determine when objects have changed. May be used for optimistic concurrency, change detection, and the watch operation on a resource or set of resources. Clients must treat these values as opaque and passed unmodified back to the server. They may only be valid for a particular resource or set of resources. + /// + /// Populated by the system. Read-only. Value must be treated as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency + pub resource_version: Option, + + /// SelfLink is a URL representing this object. Populated by the system. Read-only. + /// + /// DEPRECATED Kubernetes will stop propagating this field in 1.20 release and the field is planned to be removed in 1.21 release. + pub self_link: Option, + + /// UID is the unique in time and space value for this object. It is typically generated by the server on successful creation of a resource and is not allowed to change on PUT operations. + /// + /// Populated by the system. Read-only. More info: http://kubernetes.io/docs/user-guide/identifiers#uids + pub uid: Option, +} + +impl crate::DeepMerge for ClusterObjectMeta { + fn merge_from(&mut self, other: Self) { + crate::DeepMerge::merge_from(&mut self.annotations, other.annotations); + crate::DeepMerge::merge_from(&mut self.cluster_name, other.cluster_name); + crate::DeepMerge::merge_from(&mut self.creation_timestamp, other.creation_timestamp); + crate::DeepMerge::merge_from(&mut self.deletion_grace_period_seconds, other.deletion_grace_period_seconds); + crate::DeepMerge::merge_from(&mut self.deletion_timestamp, other.deletion_timestamp); + crate::DeepMerge::merge_from(&mut self.finalizers, other.finalizers); + crate::DeepMerge::merge_from(&mut self.generate_name, other.generate_name); + crate::DeepMerge::merge_from(&mut self.generation, other.generation); + crate::DeepMerge::merge_from(&mut self.labels, other.labels); + crate::DeepMerge::merge_from(&mut self.managed_fields, other.managed_fields); + crate::DeepMerge::merge_from(&mut self.name, other.name); + crate::DeepMerge::merge_from(&mut self.owner_references, other.owner_references); + crate::DeepMerge::merge_from(&mut self.resource_version, other.resource_version); + crate::DeepMerge::merge_from(&mut self.self_link, other.self_link); + crate::DeepMerge::merge_from(&mut self.uid, other.uid); + } +} + +impl<'de> crate::serde::Deserialize<'de> for ClusterObjectMeta { + fn deserialize(deserializer: D) -> Result where D: crate::serde::Deserializer<'de> { + #[allow(non_camel_case_types)] + enum Field { + Key_annotations, + Key_cluster_name, + Key_creation_timestamp, + Key_deletion_grace_period_seconds, + Key_deletion_timestamp, + Key_finalizers, + Key_generate_name, + Key_generation, + Key_labels, + Key_managed_fields, + Key_name, + Key_owner_references, + Key_resource_version, + Key_self_link, + Key_uid, + Other, + } + + impl<'de> crate::serde::Deserialize<'de> for Field { + fn deserialize(deserializer: D) -> Result where D: crate::serde::Deserializer<'de> { + struct Visitor; + + impl<'de> crate::serde::de::Visitor<'de> for Visitor { + type Value = Field; + + fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.write_str("field identifier") + } + + fn visit_str(self, v: &str) -> Result where E: crate::serde::de::Error { + Ok(match v { + "annotations" => Field::Key_annotations, + "clusterName" => Field::Key_cluster_name, + "creationTimestamp" => Field::Key_creation_timestamp, + "deletionGracePeriodSeconds" => Field::Key_deletion_grace_period_seconds, + "deletionTimestamp" => Field::Key_deletion_timestamp, + "finalizers" => Field::Key_finalizers, + "generateName" => Field::Key_generate_name, + "generation" => Field::Key_generation, + "labels" => Field::Key_labels, + "managedFields" => Field::Key_managed_fields, + "name" => Field::Key_name, + "ownerReferences" => Field::Key_owner_references, + "resourceVersion" => Field::Key_resource_version, + "selfLink" => Field::Key_self_link, + "uid" => Field::Key_uid, + _ => Field::Other, + }) + } + } + + deserializer.deserialize_identifier(Visitor) + } + } + + struct Visitor; + + impl<'de> crate::serde::de::Visitor<'de> for Visitor { + type Value = ClusterObjectMeta; + + fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.write_str("ClusterObjectMeta") + } + + fn visit_map(self, mut map: A) -> Result where A: crate::serde::de::MapAccess<'de> { + let mut value_annotations: Option> = None; + let mut value_cluster_name: Option = None; + let mut value_creation_timestamp: Option = None; + let mut value_deletion_grace_period_seconds: Option = None; + let mut value_deletion_timestamp: Option = None; + let mut value_finalizers: Option> = None; + let mut value_generate_name: Option = None; + let mut value_generation: Option = None; + let mut value_labels: Option> = None; + let mut value_managed_fields: Option> = None; + let mut value_name: Option = None; + let mut value_owner_references: Option> = None; + let mut value_resource_version: Option = None; + let mut value_self_link: Option = None; + let mut value_uid: Option = None; + + while let Some(key) = crate::serde::de::MapAccess::next_key::(&mut map)? { + match key { + Field::Key_annotations => value_annotations = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_cluster_name => value_cluster_name = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_creation_timestamp => value_creation_timestamp = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_deletion_grace_period_seconds => value_deletion_grace_period_seconds = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_deletion_timestamp => value_deletion_timestamp = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_finalizers => value_finalizers = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_generate_name => value_generate_name = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_generation => value_generation = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_labels => value_labels = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_managed_fields => value_managed_fields = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_name => value_name = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_owner_references => value_owner_references = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_resource_version => value_resource_version = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_self_link => value_self_link = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_uid => value_uid = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Other => { let _: crate::serde::de::IgnoredAny = crate::serde::de::MapAccess::next_value(&mut map)?; }, + } + } + + Ok(ClusterObjectMeta { + annotations: value_annotations, + cluster_name: value_cluster_name, + creation_timestamp: value_creation_timestamp, + deletion_grace_period_seconds: value_deletion_grace_period_seconds, + deletion_timestamp: value_deletion_timestamp, + finalizers: value_finalizers, + generate_name: value_generate_name, + generation: value_generation, + labels: value_labels, + managed_fields: value_managed_fields, + name: value_name, + owner_references: value_owner_references, + resource_version: value_resource_version, + self_link: value_self_link, + uid: value_uid, + }) + } + } + + deserializer.deserialize_struct( + "ClusterObjectMeta", + &[ + "annotations", + "clusterName", + "creationTimestamp", + "deletionGracePeriodSeconds", + "deletionTimestamp", + "finalizers", + "generateName", + "generation", + "labels", + "managedFields", + "name", + "ownerReferences", + "resourceVersion", + "selfLink", + "uid", + ], + Visitor, + ) + } +} + +impl crate::serde::Serialize for ClusterObjectMeta { + fn serialize(&self, serializer: S) -> Result where S: crate::serde::Serializer { + let mut state = serializer.serialize_struct( + "ClusterObjectMeta", + self.annotations.as_ref().map_or(0, |_| 1) + + self.cluster_name.as_ref().map_or(0, |_| 1) + + self.creation_timestamp.as_ref().map_or(0, |_| 1) + + self.deletion_grace_period_seconds.as_ref().map_or(0, |_| 1) + + self.deletion_timestamp.as_ref().map_or(0, |_| 1) + + self.finalizers.as_ref().map_or(0, |_| 1) + + self.generate_name.as_ref().map_or(0, |_| 1) + + self.generation.as_ref().map_or(0, |_| 1) + + self.labels.as_ref().map_or(0, |_| 1) + + self.managed_fields.as_ref().map_or(0, |_| 1) + + self.name.as_ref().map_or(0, |_| 1) + + self.owner_references.as_ref().map_or(0, |_| 1) + + self.resource_version.as_ref().map_or(0, |_| 1) + + self.self_link.as_ref().map_or(0, |_| 1) + + self.uid.as_ref().map_or(0, |_| 1), + )?; + if let Some(value) = &self.annotations { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "annotations", value)?; + } + if let Some(value) = &self.cluster_name { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "clusterName", value)?; + } + if let Some(value) = &self.creation_timestamp { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "creationTimestamp", value)?; + } + if let Some(value) = &self.deletion_grace_period_seconds { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "deletionGracePeriodSeconds", value)?; + } + if let Some(value) = &self.deletion_timestamp { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "deletionTimestamp", value)?; + } + if let Some(value) = &self.finalizers { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "finalizers", value)?; + } + if let Some(value) = &self.generate_name { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "generateName", value)?; + } + if let Some(value) = &self.generation { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "generation", value)?; + } + if let Some(value) = &self.labels { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "labels", value)?; + } + if let Some(value) = &self.managed_fields { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "managedFields", value)?; + } + if let Some(value) = &self.name { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "name", value)?; + } + if let Some(value) = &self.owner_references { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "ownerReferences", value)?; + } + if let Some(value) = &self.resource_version { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "resourceVersion", value)?; + } + if let Some(value) = &self.self_link { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "selfLink", value)?; + } + if let Some(value) = &self.uid { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "uid", value)?; + } + crate::serde::ser::SerializeStruct::end(state) + } +} + +#[cfg(feature = "schemars")] +impl crate::schemars::JsonSchema for ClusterObjectMeta { + fn schema_name() -> String { + "io.k8s.apimachinery.pkg.apis.meta.v1.ClusterObjectMeta".to_owned() + } + + fn json_schema(__gen: &mut crate::schemars::gen::SchemaGenerator) -> crate::schemars::schema::Schema { + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Object))), + object: Some(Box::new(crate::schemars::schema::ObjectValidation { + properties: [ + ( + "annotations".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Object))), + object: Some(Box::new(crate::schemars::schema::ObjectValidation { + additional_properties: Some(Box::new( + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }) + )), + ..Default::default() + })), + ..Default::default() + }), + ), + ( + "clusterName".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("The name of the cluster which the object belongs to. This is used to distinguish resources with same name and namespace in different clusters. This field is not set anywhere right now and apiserver is going to ignore it if set in create or update request.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ( + "creationTimestamp".to_owned(), + { + let mut schema_obj = __gen.subschema_for::().into_object(); + schema_obj.metadata = Some(Box::new(crate::schemars::schema::Metadata { + description: Some("CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC.\n\nPopulated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata".to_owned()), + ..Default::default() + })); + crate::schemars::schema::Schema::Object(schema_obj) + }, + ), + ( + "deletionGracePeriodSeconds".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Number of seconds allowed for this object to gracefully terminate before it will be removed from the system. Only set when deletionTimestamp is also set. May only be shortened. Read-only.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Integer))), + format: Some("int64".to_owned()), + ..Default::default() + }), + ), + ( + "deletionTimestamp".to_owned(), + { + let mut schema_obj = __gen.subschema_for::().into_object(); + schema_obj.metadata = Some(Box::new(crate::schemars::schema::Metadata { + description: Some("DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This field is set by the server when a graceful deletion is requested by the user, and is not directly settable by a client. The resource is expected to be deleted (no longer visible from resource lists, and not reachable by name) after the time in this field, once the finalizers list is empty. As long as the finalizers list contains items, deletion is blocked. Once the deletionTimestamp is set, this value may not be unset or be set further into the future, although it may be shortened or the resource may be deleted prior to this time. For example, a user may request that a pod is deleted in 30 seconds. The Kubelet will react by sending a graceful termination signal to the containers in the pod. After that 30 seconds, the Kubelet will send a hard termination signal (SIGKILL) to the container and after cleanup, remove the pod from the API. In the presence of network partitions, this object may still exist after this timestamp, until an administrator or automated process can determine the resource is fully terminated. If not set, graceful deletion of the object has not been requested.\n\nPopulated by the system when a graceful deletion is requested. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata".to_owned()), + ..Default::default() + })); + crate::schemars::schema::Schema::Object(schema_obj) + }, + ), + ( + "finalizers".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Must be empty before the object is deleted from the registry. Each entry is an identifier for the responsible component that will remove the entry from the list. If the deletionTimestamp of the object is non-nil, entries in this list can only be removed. Finalizers may be processed and removed in any order. Order is NOT enforced because it introduces significant risk of stuck finalizers. finalizers is a shared field, any actor with permission can reorder it. If the finalizer list is processed in order, then this can lead to a situation in which the component responsible for the first finalizer in the list is waiting for a signal (field value, external system, or other) produced by a component responsible for a finalizer later in the list, resulting in a deadlock. Without enforced ordering finalizers are free to order amongst themselves and are not vulnerable to ordering changes in the list.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Array))), + array: Some(Box::new(crate::schemars::schema::ArrayValidation { + items: Some(crate::schemars::schema::SingleOrVec::Single(Box::new( + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }) + ))), + ..Default::default() + })), + ..Default::default() + }), + ), + ( + "generateName".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("GenerateName is an optional prefix, used by the server, to generate a unique name ONLY IF the Name field has not been provided. If this field is used, the name returned to the client will be different than the name passed. This value will also be combined with a unique suffix. The provided value has the same validation rules as the Name field, and may be truncated by the length of the suffix required to make the value unique on the server.\n\nIf this field is specified and the generated name exists, the server will NOT return a 409 - instead, it will either return 201 Created or 500 with Reason ServerTimeout indicating a unique name could not be found in the time allotted, and the client should retry (optionally after the time indicated in the Retry-After header).\n\nApplied only if Name is not specified. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#idempotency".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ( + "generation".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("A sequence number representing a specific generation of the desired state. Populated by the system. Read-only.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Integer))), + format: Some("int64".to_owned()), + ..Default::default() + }), + ), + ( + "labels".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Object))), + object: Some(Box::new(crate::schemars::schema::ObjectValidation { + additional_properties: Some(Box::new( + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }) + )), + ..Default::default() + })), + ..Default::default() + }), + ), + ( + "managedFields".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("ManagedFields maps workflow-id and version to the set of fields that are managed by that workflow. This is mostly for internal housekeeping, and users typically shouldn't need to set or understand this field. A workflow can be the user's name, a controller's name, or the name of a specific apply path like \"ci-cd\". The set of fields is always in the version that the workflow used when modifying the object.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Array))), + array: Some(Box::new(crate::schemars::schema::ArrayValidation { + items: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(__gen.subschema_for::()))), + ..Default::default() + })), + ..Default::default() + }), + ), + ( + "name".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ( + "ownerReferences".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Array))), + array: Some(Box::new(crate::schemars::schema::ArrayValidation { + items: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(__gen.subschema_for::()))), + ..Default::default() + })), + ..Default::default() + }), + ), + ( + "resourceVersion".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("An opaque value that represents the internal version of this object that can be used by clients to determine when objects have changed. May be used for optimistic concurrency, change detection, and the watch operation on a resource or set of resources. Clients must treat these values as opaque and passed unmodified back to the server. They may only be valid for a particular resource or set of resources.\n\nPopulated by the system. Read-only. Value must be treated as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ( + "selfLink".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("SelfLink is a URL representing this object. Populated by the system. Read-only.\n\nDEPRECATED Kubernetes will stop propagating this field in 1.20 release and the field is planned to be removed in 1.21 release.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ( + "uid".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("UID is the unique in time and space value for this object. It is typically generated by the server on successful creation of a resource and is not allowed to change on PUT operations.\n\nPopulated by the system. Read-only. More info: http://kubernetes.io/docs/user-guide/identifiers#uids".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ].into(), + ..Default::default() + })), + ..Default::default() + }) + } +} diff --git a/src/v1_23/apimachinery/pkg/apis/meta/v1/mod.rs b/src/v1_23/apimachinery/pkg/apis/meta/v1/mod.rs index 9424127582..221a712e6d 100644 --- a/src/v1_23/apimachinery/pkg/apis/meta/v1/mod.rs +++ b/src/v1_23/apimachinery/pkg/apis/meta/v1/mod.rs @@ -14,6 +14,9 @@ pub use self::api_resource_list::APIResourceList; mod api_versions; pub use self::api_versions::APIVersions; +mod cluster_object_meta; +pub use self::cluster_object_meta::ClusterObjectMeta; + mod condition; pub use self::condition::Condition; @@ -65,6 +68,9 @@ pub use self::status_cause::StatusCause; mod status_details; pub use self::status_details::StatusDetails; +mod sub_object_meta; +pub use self::sub_object_meta::SubObjectMeta; + mod time; pub use self::time::Time; diff --git a/src/v1_23/apimachinery/pkg/apis/meta/v1/object_meta.rs b/src/v1_23/apimachinery/pkg/apis/meta/v1/object_meta.rs index c6b37624f5..8dd25439cd 100644 --- a/src/v1_23/apimachinery/pkg/apis/meta/v1/object_meta.rs +++ b/src/v1_23/apimachinery/pkg/apis/meta/v1/object_meta.rs @@ -47,7 +47,7 @@ pub struct ObjectMeta { /// Namespace defines the space within which each name must be unique. An empty namespace is equivalent to the "default" namespace, but "default" is the canonical representation. Not all objects are required to be scoped to a namespace - the value of this field for those objects will be empty. /// /// Must be a DNS_LABEL. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/namespaces - pub namespace: Option, + pub namespace: String, /// List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller. pub owner_references: Option>, @@ -211,7 +211,7 @@ impl<'de> crate::serde::Deserialize<'de> for ObjectMeta { labels: value_labels, managed_fields: value_managed_fields, name: value_name, - namespace: value_namespace, + namespace: value_namespace.unwrap_or_default(), owner_references: value_owner_references, resource_version: value_resource_version, self_link: value_self_link, @@ -249,6 +249,7 @@ impl crate::serde::Serialize for ObjectMeta { fn serialize(&self, serializer: S) -> Result where S: crate::serde::Serializer { let mut state = serializer.serialize_struct( "ObjectMeta", + 1 + self.annotations.as_ref().map_or(0, |_| 1) + self.cluster_name.as_ref().map_or(0, |_| 1) + self.creation_timestamp.as_ref().map_or(0, |_| 1) + @@ -260,7 +261,6 @@ impl crate::serde::Serialize for ObjectMeta { self.labels.as_ref().map_or(0, |_| 1) + self.managed_fields.as_ref().map_or(0, |_| 1) + self.name.as_ref().map_or(0, |_| 1) + - self.namespace.as_ref().map_or(0, |_| 1) + self.owner_references.as_ref().map_or(0, |_| 1) + self.resource_version.as_ref().map_or(0, |_| 1) + self.self_link.as_ref().map_or(0, |_| 1) + @@ -299,9 +299,7 @@ impl crate::serde::Serialize for ObjectMeta { if let Some(value) = &self.name { crate::serde::ser::SerializeStruct::serialize_field(&mut state, "name", value)?; } - if let Some(value) = &self.namespace { - crate::serde::ser::SerializeStruct::serialize_field(&mut state, "namespace", value)?; - } + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "namespace", &self.namespace)?; if let Some(value) = &self.owner_references { crate::serde::ser::SerializeStruct::serialize_field(&mut state, "ownerReferences", value)?; } @@ -547,6 +545,9 @@ impl crate::schemars::JsonSchema for ObjectMeta { }), ), ].into(), + required: [ + "namespace".to_owned(), + ].into(), ..Default::default() })), ..Default::default() diff --git a/src/v1_23/apimachinery/pkg/apis/meta/v1/sub_object_meta.rs b/src/v1_23/apimachinery/pkg/apis/meta/v1/sub_object_meta.rs new file mode 100644 index 0000000000..61046989c6 --- /dev/null +++ b/src/v1_23/apimachinery/pkg/apis/meta/v1/sub_object_meta.rs @@ -0,0 +1,555 @@ +// Generated from definition io.k8s.apimachinery.pkg.apis.meta.v1.SubObjectMeta + +/// ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create. +#[derive(Clone, Debug, Default, PartialEq)] +pub struct SubObjectMeta { + /// Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations + pub annotations: Option>, + + /// The name of the cluster which the object belongs to. This is used to distinguish resources with same name and namespace in different clusters. This field is not set anywhere right now and apiserver is going to ignore it if set in create or update request. + pub cluster_name: Option, + + /// CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC. + /// + /// Populated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + pub creation_timestamp: Option, + + /// Number of seconds allowed for this object to gracefully terminate before it will be removed from the system. Only set when deletionTimestamp is also set. May only be shortened. Read-only. + pub deletion_grace_period_seconds: Option, + + /// DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This field is set by the server when a graceful deletion is requested by the user, and is not directly settable by a client. The resource is expected to be deleted (no longer visible from resource lists, and not reachable by name) after the time in this field, once the finalizers list is empty. As long as the finalizers list contains items, deletion is blocked. Once the deletionTimestamp is set, this value may not be unset or be set further into the future, although it may be shortened or the resource may be deleted prior to this time. For example, a user may request that a pod is deleted in 30 seconds. The Kubelet will react by sending a graceful termination signal to the containers in the pod. After that 30 seconds, the Kubelet will send a hard termination signal (SIGKILL) to the container and after cleanup, remove the pod from the API. In the presence of network partitions, this object may still exist after this timestamp, until an administrator or automated process can determine the resource is fully terminated. If not set, graceful deletion of the object has not been requested. + /// + /// Populated by the system when a graceful deletion is requested. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + pub deletion_timestamp: Option, + + /// Must be empty before the object is deleted from the registry. Each entry is an identifier for the responsible component that will remove the entry from the list. If the deletionTimestamp of the object is non-nil, entries in this list can only be removed. Finalizers may be processed and removed in any order. Order is NOT enforced because it introduces significant risk of stuck finalizers. finalizers is a shared field, any actor with permission can reorder it. If the finalizer list is processed in order, then this can lead to a situation in which the component responsible for the first finalizer in the list is waiting for a signal (field value, external system, or other) produced by a component responsible for a finalizer later in the list, resulting in a deadlock. Without enforced ordering finalizers are free to order amongst themselves and are not vulnerable to ordering changes in the list. + pub finalizers: Option>, + + /// GenerateName is an optional prefix, used by the server, to generate a unique name ONLY IF the Name field has not been provided. If this field is used, the name returned to the client will be different than the name passed. This value will also be combined with a unique suffix. The provided value has the same validation rules as the Name field, and may be truncated by the length of the suffix required to make the value unique on the server. + /// + /// If this field is specified and the generated name exists, the server will NOT return a 409 - instead, it will either return 201 Created or 500 with Reason ServerTimeout indicating a unique name could not be found in the time allotted, and the client should retry (optionally after the time indicated in the Retry-After header). + /// + /// Applied only if Name is not specified. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#idempotency + pub generate_name: Option, + + /// A sequence number representing a specific generation of the desired state. Populated by the system. Read-only. + pub generation: Option, + + /// Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels + pub labels: Option>, + + /// ManagedFields maps workflow-id and version to the set of fields that are managed by that workflow. This is mostly for internal housekeeping, and users typically shouldn't need to set or understand this field. A workflow can be the user's name, a controller's name, or the name of a specific apply path like "ci-cd". The set of fields is always in the version that the workflow used when modifying the object. + pub managed_fields: Option>, + + /// Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names + pub name: Option, + + /// Namespace defines the space within which each name must be unique. An empty namespace is equivalent to the "default" namespace, but "default" is the canonical representation. Not all objects are required to be scoped to a namespace - the value of this field for those objects will be empty. + /// + /// Must be a DNS_LABEL. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/namespaces + pub namespace: Option, + + /// List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller. + pub owner_references: Option>, + + /// An opaque value that represents the internal version of this object that can be used by clients to determine when objects have changed. May be used for optimistic concurrency, change detection, and the watch operation on a resource or set of resources. Clients must treat these values as opaque and passed unmodified back to the server. They may only be valid for a particular resource or set of resources. + /// + /// Populated by the system. Read-only. Value must be treated as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency + pub resource_version: Option, + + /// SelfLink is a URL representing this object. Populated by the system. Read-only. + /// + /// DEPRECATED Kubernetes will stop propagating this field in 1.20 release and the field is planned to be removed in 1.21 release. + pub self_link: Option, + + /// UID is the unique in time and space value for this object. It is typically generated by the server on successful creation of a resource and is not allowed to change on PUT operations. + /// + /// Populated by the system. Read-only. More info: http://kubernetes.io/docs/user-guide/identifiers#uids + pub uid: Option, +} + +impl crate::DeepMerge for SubObjectMeta { + fn merge_from(&mut self, other: Self) { + crate::DeepMerge::merge_from(&mut self.annotations, other.annotations); + crate::DeepMerge::merge_from(&mut self.cluster_name, other.cluster_name); + crate::DeepMerge::merge_from(&mut self.creation_timestamp, other.creation_timestamp); + crate::DeepMerge::merge_from(&mut self.deletion_grace_period_seconds, other.deletion_grace_period_seconds); + crate::DeepMerge::merge_from(&mut self.deletion_timestamp, other.deletion_timestamp); + crate::DeepMerge::merge_from(&mut self.finalizers, other.finalizers); + crate::DeepMerge::merge_from(&mut self.generate_name, other.generate_name); + crate::DeepMerge::merge_from(&mut self.generation, other.generation); + crate::DeepMerge::merge_from(&mut self.labels, other.labels); + crate::DeepMerge::merge_from(&mut self.managed_fields, other.managed_fields); + crate::DeepMerge::merge_from(&mut self.name, other.name); + crate::DeepMerge::merge_from(&mut self.namespace, other.namespace); + crate::DeepMerge::merge_from(&mut self.owner_references, other.owner_references); + crate::DeepMerge::merge_from(&mut self.resource_version, other.resource_version); + crate::DeepMerge::merge_from(&mut self.self_link, other.self_link); + crate::DeepMerge::merge_from(&mut self.uid, other.uid); + } +} + +impl<'de> crate::serde::Deserialize<'de> for SubObjectMeta { + fn deserialize(deserializer: D) -> Result where D: crate::serde::Deserializer<'de> { + #[allow(non_camel_case_types)] + enum Field { + Key_annotations, + Key_cluster_name, + Key_creation_timestamp, + Key_deletion_grace_period_seconds, + Key_deletion_timestamp, + Key_finalizers, + Key_generate_name, + Key_generation, + Key_labels, + Key_managed_fields, + Key_name, + Key_namespace, + Key_owner_references, + Key_resource_version, + Key_self_link, + Key_uid, + Other, + } + + impl<'de> crate::serde::Deserialize<'de> for Field { + fn deserialize(deserializer: D) -> Result where D: crate::serde::Deserializer<'de> { + struct Visitor; + + impl<'de> crate::serde::de::Visitor<'de> for Visitor { + type Value = Field; + + fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.write_str("field identifier") + } + + fn visit_str(self, v: &str) -> Result where E: crate::serde::de::Error { + Ok(match v { + "annotations" => Field::Key_annotations, + "clusterName" => Field::Key_cluster_name, + "creationTimestamp" => Field::Key_creation_timestamp, + "deletionGracePeriodSeconds" => Field::Key_deletion_grace_period_seconds, + "deletionTimestamp" => Field::Key_deletion_timestamp, + "finalizers" => Field::Key_finalizers, + "generateName" => Field::Key_generate_name, + "generation" => Field::Key_generation, + "labels" => Field::Key_labels, + "managedFields" => Field::Key_managed_fields, + "name" => Field::Key_name, + "namespace" => Field::Key_namespace, + "ownerReferences" => Field::Key_owner_references, + "resourceVersion" => Field::Key_resource_version, + "selfLink" => Field::Key_self_link, + "uid" => Field::Key_uid, + _ => Field::Other, + }) + } + } + + deserializer.deserialize_identifier(Visitor) + } + } + + struct Visitor; + + impl<'de> crate::serde::de::Visitor<'de> for Visitor { + type Value = SubObjectMeta; + + fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.write_str("SubObjectMeta") + } + + fn visit_map(self, mut map: A) -> Result where A: crate::serde::de::MapAccess<'de> { + let mut value_annotations: Option> = None; + let mut value_cluster_name: Option = None; + let mut value_creation_timestamp: Option = None; + let mut value_deletion_grace_period_seconds: Option = None; + let mut value_deletion_timestamp: Option = None; + let mut value_finalizers: Option> = None; + let mut value_generate_name: Option = None; + let mut value_generation: Option = None; + let mut value_labels: Option> = None; + let mut value_managed_fields: Option> = None; + let mut value_name: Option = None; + let mut value_namespace: Option = None; + let mut value_owner_references: Option> = None; + let mut value_resource_version: Option = None; + let mut value_self_link: Option = None; + let mut value_uid: Option = None; + + while let Some(key) = crate::serde::de::MapAccess::next_key::(&mut map)? { + match key { + Field::Key_annotations => value_annotations = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_cluster_name => value_cluster_name = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_creation_timestamp => value_creation_timestamp = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_deletion_grace_period_seconds => value_deletion_grace_period_seconds = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_deletion_timestamp => value_deletion_timestamp = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_finalizers => value_finalizers = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_generate_name => value_generate_name = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_generation => value_generation = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_labels => value_labels = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_managed_fields => value_managed_fields = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_name => value_name = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_namespace => value_namespace = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_owner_references => value_owner_references = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_resource_version => value_resource_version = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_self_link => value_self_link = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_uid => value_uid = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Other => { let _: crate::serde::de::IgnoredAny = crate::serde::de::MapAccess::next_value(&mut map)?; }, + } + } + + Ok(SubObjectMeta { + annotations: value_annotations, + cluster_name: value_cluster_name, + creation_timestamp: value_creation_timestamp, + deletion_grace_period_seconds: value_deletion_grace_period_seconds, + deletion_timestamp: value_deletion_timestamp, + finalizers: value_finalizers, + generate_name: value_generate_name, + generation: value_generation, + labels: value_labels, + managed_fields: value_managed_fields, + name: value_name, + namespace: value_namespace, + owner_references: value_owner_references, + resource_version: value_resource_version, + self_link: value_self_link, + uid: value_uid, + }) + } + } + + deserializer.deserialize_struct( + "SubObjectMeta", + &[ + "annotations", + "clusterName", + "creationTimestamp", + "deletionGracePeriodSeconds", + "deletionTimestamp", + "finalizers", + "generateName", + "generation", + "labels", + "managedFields", + "name", + "namespace", + "ownerReferences", + "resourceVersion", + "selfLink", + "uid", + ], + Visitor, + ) + } +} + +impl crate::serde::Serialize for SubObjectMeta { + fn serialize(&self, serializer: S) -> Result where S: crate::serde::Serializer { + let mut state = serializer.serialize_struct( + "SubObjectMeta", + self.annotations.as_ref().map_or(0, |_| 1) + + self.cluster_name.as_ref().map_or(0, |_| 1) + + self.creation_timestamp.as_ref().map_or(0, |_| 1) + + self.deletion_grace_period_seconds.as_ref().map_or(0, |_| 1) + + self.deletion_timestamp.as_ref().map_or(0, |_| 1) + + self.finalizers.as_ref().map_or(0, |_| 1) + + self.generate_name.as_ref().map_or(0, |_| 1) + + self.generation.as_ref().map_or(0, |_| 1) + + self.labels.as_ref().map_or(0, |_| 1) + + self.managed_fields.as_ref().map_or(0, |_| 1) + + self.name.as_ref().map_or(0, |_| 1) + + self.namespace.as_ref().map_or(0, |_| 1) + + self.owner_references.as_ref().map_or(0, |_| 1) + + self.resource_version.as_ref().map_or(0, |_| 1) + + self.self_link.as_ref().map_or(0, |_| 1) + + self.uid.as_ref().map_or(0, |_| 1), + )?; + if let Some(value) = &self.annotations { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "annotations", value)?; + } + if let Some(value) = &self.cluster_name { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "clusterName", value)?; + } + if let Some(value) = &self.creation_timestamp { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "creationTimestamp", value)?; + } + if let Some(value) = &self.deletion_grace_period_seconds { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "deletionGracePeriodSeconds", value)?; + } + if let Some(value) = &self.deletion_timestamp { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "deletionTimestamp", value)?; + } + if let Some(value) = &self.finalizers { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "finalizers", value)?; + } + if let Some(value) = &self.generate_name { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "generateName", value)?; + } + if let Some(value) = &self.generation { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "generation", value)?; + } + if let Some(value) = &self.labels { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "labels", value)?; + } + if let Some(value) = &self.managed_fields { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "managedFields", value)?; + } + if let Some(value) = &self.name { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "name", value)?; + } + if let Some(value) = &self.namespace { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "namespace", value)?; + } + if let Some(value) = &self.owner_references { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "ownerReferences", value)?; + } + if let Some(value) = &self.resource_version { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "resourceVersion", value)?; + } + if let Some(value) = &self.self_link { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "selfLink", value)?; + } + if let Some(value) = &self.uid { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "uid", value)?; + } + crate::serde::ser::SerializeStruct::end(state) + } +} + +#[cfg(feature = "schemars")] +impl crate::schemars::JsonSchema for SubObjectMeta { + fn schema_name() -> String { + "io.k8s.apimachinery.pkg.apis.meta.v1.SubObjectMeta".to_owned() + } + + fn json_schema(__gen: &mut crate::schemars::gen::SchemaGenerator) -> crate::schemars::schema::Schema { + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Object))), + object: Some(Box::new(crate::schemars::schema::ObjectValidation { + properties: [ + ( + "annotations".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Object))), + object: Some(Box::new(crate::schemars::schema::ObjectValidation { + additional_properties: Some(Box::new( + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }) + )), + ..Default::default() + })), + ..Default::default() + }), + ), + ( + "clusterName".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("The name of the cluster which the object belongs to. This is used to distinguish resources with same name and namespace in different clusters. This field is not set anywhere right now and apiserver is going to ignore it if set in create or update request.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ( + "creationTimestamp".to_owned(), + { + let mut schema_obj = __gen.subschema_for::().into_object(); + schema_obj.metadata = Some(Box::new(crate::schemars::schema::Metadata { + description: Some("CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC.\n\nPopulated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata".to_owned()), + ..Default::default() + })); + crate::schemars::schema::Schema::Object(schema_obj) + }, + ), + ( + "deletionGracePeriodSeconds".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Number of seconds allowed for this object to gracefully terminate before it will be removed from the system. Only set when deletionTimestamp is also set. May only be shortened. Read-only.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Integer))), + format: Some("int64".to_owned()), + ..Default::default() + }), + ), + ( + "deletionTimestamp".to_owned(), + { + let mut schema_obj = __gen.subschema_for::().into_object(); + schema_obj.metadata = Some(Box::new(crate::schemars::schema::Metadata { + description: Some("DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This field is set by the server when a graceful deletion is requested by the user, and is not directly settable by a client. The resource is expected to be deleted (no longer visible from resource lists, and not reachable by name) after the time in this field, once the finalizers list is empty. As long as the finalizers list contains items, deletion is blocked. Once the deletionTimestamp is set, this value may not be unset or be set further into the future, although it may be shortened or the resource may be deleted prior to this time. For example, a user may request that a pod is deleted in 30 seconds. The Kubelet will react by sending a graceful termination signal to the containers in the pod. After that 30 seconds, the Kubelet will send a hard termination signal (SIGKILL) to the container and after cleanup, remove the pod from the API. In the presence of network partitions, this object may still exist after this timestamp, until an administrator or automated process can determine the resource is fully terminated. If not set, graceful deletion of the object has not been requested.\n\nPopulated by the system when a graceful deletion is requested. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata".to_owned()), + ..Default::default() + })); + crate::schemars::schema::Schema::Object(schema_obj) + }, + ), + ( + "finalizers".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Must be empty before the object is deleted from the registry. Each entry is an identifier for the responsible component that will remove the entry from the list. If the deletionTimestamp of the object is non-nil, entries in this list can only be removed. Finalizers may be processed and removed in any order. Order is NOT enforced because it introduces significant risk of stuck finalizers. finalizers is a shared field, any actor with permission can reorder it. If the finalizer list is processed in order, then this can lead to a situation in which the component responsible for the first finalizer in the list is waiting for a signal (field value, external system, or other) produced by a component responsible for a finalizer later in the list, resulting in a deadlock. Without enforced ordering finalizers are free to order amongst themselves and are not vulnerable to ordering changes in the list.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Array))), + array: Some(Box::new(crate::schemars::schema::ArrayValidation { + items: Some(crate::schemars::schema::SingleOrVec::Single(Box::new( + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }) + ))), + ..Default::default() + })), + ..Default::default() + }), + ), + ( + "generateName".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("GenerateName is an optional prefix, used by the server, to generate a unique name ONLY IF the Name field has not been provided. If this field is used, the name returned to the client will be different than the name passed. This value will also be combined with a unique suffix. The provided value has the same validation rules as the Name field, and may be truncated by the length of the suffix required to make the value unique on the server.\n\nIf this field is specified and the generated name exists, the server will NOT return a 409 - instead, it will either return 201 Created or 500 with Reason ServerTimeout indicating a unique name could not be found in the time allotted, and the client should retry (optionally after the time indicated in the Retry-After header).\n\nApplied only if Name is not specified. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#idempotency".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ( + "generation".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("A sequence number representing a specific generation of the desired state. Populated by the system. Read-only.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Integer))), + format: Some("int64".to_owned()), + ..Default::default() + }), + ), + ( + "labels".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Object))), + object: Some(Box::new(crate::schemars::schema::ObjectValidation { + additional_properties: Some(Box::new( + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }) + )), + ..Default::default() + })), + ..Default::default() + }), + ), + ( + "managedFields".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("ManagedFields maps workflow-id and version to the set of fields that are managed by that workflow. This is mostly for internal housekeeping, and users typically shouldn't need to set or understand this field. A workflow can be the user's name, a controller's name, or the name of a specific apply path like \"ci-cd\". The set of fields is always in the version that the workflow used when modifying the object.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Array))), + array: Some(Box::new(crate::schemars::schema::ArrayValidation { + items: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(__gen.subschema_for::()))), + ..Default::default() + })), + ..Default::default() + }), + ), + ( + "name".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ( + "namespace".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Namespace defines the space within which each name must be unique. An empty namespace is equivalent to the \"default\" namespace, but \"default\" is the canonical representation. Not all objects are required to be scoped to a namespace - the value of this field for those objects will be empty.\n\nMust be a DNS_LABEL. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/namespaces".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ( + "ownerReferences".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Array))), + array: Some(Box::new(crate::schemars::schema::ArrayValidation { + items: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(__gen.subschema_for::()))), + ..Default::default() + })), + ..Default::default() + }), + ), + ( + "resourceVersion".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("An opaque value that represents the internal version of this object that can be used by clients to determine when objects have changed. May be used for optimistic concurrency, change detection, and the watch operation on a resource or set of resources. Clients must treat these values as opaque and passed unmodified back to the server. They may only be valid for a particular resource or set of resources.\n\nPopulated by the system. Read-only. Value must be treated as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ( + "selfLink".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("SelfLink is a URL representing this object. Populated by the system. Read-only.\n\nDEPRECATED Kubernetes will stop propagating this field in 1.20 release and the field is planned to be removed in 1.21 release.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ( + "uid".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("UID is the unique in time and space value for this object. It is typically generated by the server on successful creation of a resource and is not allowed to change on PUT operations.\n\nPopulated by the system. Read-only. More info: http://kubernetes.io/docs/user-guide/identifiers#uids".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ].into(), + ..Default::default() + })), + ..Default::default() + }) + } +} diff --git a/src/v1_23/kube_aggregator/pkg/apis/apiregistration/v1/api_service.rs b/src/v1_23/kube_aggregator/pkg/apis/apiregistration/v1/api_service.rs index cff7ff1489..587f0a528a 100644 --- a/src/v1_23/kube_aggregator/pkg/apis/apiregistration/v1/api_service.rs +++ b/src/v1_23/kube_aggregator/pkg/apis/apiregistration/v1/api_service.rs @@ -516,7 +516,7 @@ impl crate::ListableResource for APIService { } impl crate::Metadata for APIService { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_24/api/admissionregistration/v1/mutating_webhook_configuration.rs b/src/v1_24/api/admissionregistration/v1/mutating_webhook_configuration.rs index cb8ec8f5af..e0f9531189 100644 --- a/src/v1_24/api/admissionregistration/v1/mutating_webhook_configuration.rs +++ b/src/v1_24/api/admissionregistration/v1/mutating_webhook_configuration.rs @@ -360,7 +360,7 @@ impl crate::ListableResource for MutatingWebhookConfiguration { } impl crate::Metadata for MutatingWebhookConfiguration { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_24/api/admissionregistration/v1/validating_webhook_configuration.rs b/src/v1_24/api/admissionregistration/v1/validating_webhook_configuration.rs index 4c520b0eeb..4cf73a02cb 100644 --- a/src/v1_24/api/admissionregistration/v1/validating_webhook_configuration.rs +++ b/src/v1_24/api/admissionregistration/v1/validating_webhook_configuration.rs @@ -360,7 +360,7 @@ impl crate::ListableResource for ValidatingWebhookConfiguration { } impl crate::Metadata for ValidatingWebhookConfiguration { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_24/api/apiserverinternal/v1alpha1/storage_version.rs b/src/v1_24/api/apiserverinternal/v1alpha1/storage_version.rs index c5d811a2fd..7e41c6b9c1 100644 --- a/src/v1_24/api/apiserverinternal/v1alpha1/storage_version.rs +++ b/src/v1_24/api/apiserverinternal/v1alpha1/storage_version.rs @@ -516,7 +516,7 @@ impl crate::ListableResource for StorageVersion { } impl crate::Metadata for StorageVersion { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_24/api/authentication/v1/token_request.rs b/src/v1_24/api/authentication/v1/token_request.rs index 1f864e2ac3..995fbc9e76 100644 --- a/src/v1_24/api/authentication/v1/token_request.rs +++ b/src/v1_24/api/authentication/v1/token_request.rs @@ -74,7 +74,7 @@ impl crate::Resource for TokenRequest { } impl crate::Metadata for TokenRequest { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::SubObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_24/api/authentication/v1/token_review.rs b/src/v1_24/api/authentication/v1/token_review.rs index e4ed490482..e608079249 100644 --- a/src/v1_24/api/authentication/v1/token_review.rs +++ b/src/v1_24/api/authentication/v1/token_review.rs @@ -61,7 +61,7 @@ impl crate::Resource for TokenReview { } impl crate::Metadata for TokenReview { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_24/api/authorization/v1/self_subject_access_review.rs b/src/v1_24/api/authorization/v1/self_subject_access_review.rs index bf549beb13..a61121e9eb 100644 --- a/src/v1_24/api/authorization/v1/self_subject_access_review.rs +++ b/src/v1_24/api/authorization/v1/self_subject_access_review.rs @@ -61,7 +61,7 @@ impl crate::Resource for SelfSubjectAccessReview { } impl crate::Metadata for SelfSubjectAccessReview { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_24/api/authorization/v1/self_subject_rules_review.rs b/src/v1_24/api/authorization/v1/self_subject_rules_review.rs index 60defd6f35..d290dea234 100644 --- a/src/v1_24/api/authorization/v1/self_subject_rules_review.rs +++ b/src/v1_24/api/authorization/v1/self_subject_rules_review.rs @@ -61,7 +61,7 @@ impl crate::Resource for SelfSubjectRulesReview { } impl crate::Metadata for SelfSubjectRulesReview { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_24/api/authorization/v1/subject_access_review.rs b/src/v1_24/api/authorization/v1/subject_access_review.rs index 8735a9f0bc..c983461e5a 100644 --- a/src/v1_24/api/authorization/v1/subject_access_review.rs +++ b/src/v1_24/api/authorization/v1/subject_access_review.rs @@ -61,7 +61,7 @@ impl crate::Resource for SubjectAccessReview { } impl crate::Metadata for SubjectAccessReview { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_24/api/autoscaling/v1/scale.rs b/src/v1_24/api/autoscaling/v1/scale.rs index 89a7024529..3fb0a7ea47 100644 --- a/src/v1_24/api/autoscaling/v1/scale.rs +++ b/src/v1_24/api/autoscaling/v1/scale.rs @@ -711,7 +711,7 @@ impl crate::Resource for Scale { } impl crate::Metadata for Scale { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::SubObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_24/api/certificates/v1/certificate_signing_request.rs b/src/v1_24/api/certificates/v1/certificate_signing_request.rs index 066a900b7c..90721fc6e0 100644 --- a/src/v1_24/api/certificates/v1/certificate_signing_request.rs +++ b/src/v1_24/api/certificates/v1/certificate_signing_request.rs @@ -674,7 +674,7 @@ impl crate::ListableResource for CertificateSigningRequest { } impl crate::Metadata for CertificateSigningRequest { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_24/api/core/v1/component_status.rs b/src/v1_24/api/core/v1/component_status.rs index ecddf82170..ba505704c7 100644 --- a/src/v1_24/api/core/v1/component_status.rs +++ b/src/v1_24/api/core/v1/component_status.rs @@ -159,7 +159,7 @@ impl crate::ListableResource for ComponentStatus { } impl crate::Metadata for ComponentStatus { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_24/api/core/v1/namespace.rs b/src/v1_24/api/core/v1/namespace.rs index df31cdc0da..6600f8a3bb 100644 --- a/src/v1_24/api/core/v1/namespace.rs +++ b/src/v1_24/api/core/v1/namespace.rs @@ -516,7 +516,7 @@ impl crate::ListableResource for Namespace { } impl crate::Metadata for Namespace { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_24/api/core/v1/node.rs b/src/v1_24/api/core/v1/node.rs index 5a5694b818..d6e0aa6dfb 100644 --- a/src/v1_24/api/core/v1/node.rs +++ b/src/v1_24/api/core/v1/node.rs @@ -996,7 +996,7 @@ impl crate::ListableResource for Node { } impl crate::Metadata for Node { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_24/api/core/v1/persistent_volume.rs b/src/v1_24/api/core/v1/persistent_volume.rs index c3d9dde5a2..f74469a702 100644 --- a/src/v1_24/api/core/v1/persistent_volume.rs +++ b/src/v1_24/api/core/v1/persistent_volume.rs @@ -516,7 +516,7 @@ impl crate::ListableResource for PersistentVolume { } impl crate::Metadata for PersistentVolume { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_24/api/flowcontrol/v1beta1/flow_schema.rs b/src/v1_24/api/flowcontrol/v1beta1/flow_schema.rs index 1d0546a710..e74328c4ec 100644 --- a/src/v1_24/api/flowcontrol/v1beta1/flow_schema.rs +++ b/src/v1_24/api/flowcontrol/v1beta1/flow_schema.rs @@ -516,7 +516,7 @@ impl crate::ListableResource for FlowSchema { } impl crate::Metadata for FlowSchema { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_24/api/flowcontrol/v1beta1/priority_level_configuration.rs b/src/v1_24/api/flowcontrol/v1beta1/priority_level_configuration.rs index 4cbe999e32..d4f148709d 100644 --- a/src/v1_24/api/flowcontrol/v1beta1/priority_level_configuration.rs +++ b/src/v1_24/api/flowcontrol/v1beta1/priority_level_configuration.rs @@ -516,7 +516,7 @@ impl crate::ListableResource for PriorityLevelConfiguration { } impl crate::Metadata for PriorityLevelConfiguration { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_24/api/flowcontrol/v1beta2/flow_schema.rs b/src/v1_24/api/flowcontrol/v1beta2/flow_schema.rs index 71d13230a3..7efa4158ac 100644 --- a/src/v1_24/api/flowcontrol/v1beta2/flow_schema.rs +++ b/src/v1_24/api/flowcontrol/v1beta2/flow_schema.rs @@ -516,7 +516,7 @@ impl crate::ListableResource for FlowSchema { } impl crate::Metadata for FlowSchema { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_24/api/flowcontrol/v1beta2/priority_level_configuration.rs b/src/v1_24/api/flowcontrol/v1beta2/priority_level_configuration.rs index 91ebc9f1f5..982df6b6a7 100644 --- a/src/v1_24/api/flowcontrol/v1beta2/priority_level_configuration.rs +++ b/src/v1_24/api/flowcontrol/v1beta2/priority_level_configuration.rs @@ -516,7 +516,7 @@ impl crate::ListableResource for PriorityLevelConfiguration { } impl crate::Metadata for PriorityLevelConfiguration { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_24/api/networking/v1/ingress_class.rs b/src/v1_24/api/networking/v1/ingress_class.rs index d3ab7820c7..657d7e9809 100644 --- a/src/v1_24/api/networking/v1/ingress_class.rs +++ b/src/v1_24/api/networking/v1/ingress_class.rs @@ -360,7 +360,7 @@ impl crate::ListableResource for IngressClass { } impl crate::Metadata for IngressClass { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_24/api/node/v1/runtime_class.rs b/src/v1_24/api/node/v1/runtime_class.rs index 470b9f902d..0fb771fb5f 100644 --- a/src/v1_24/api/node/v1/runtime_class.rs +++ b/src/v1_24/api/node/v1/runtime_class.rs @@ -367,7 +367,7 @@ impl crate::ListableResource for RuntimeClass { } impl crate::Metadata for RuntimeClass { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_24/api/node/v1beta1/runtime_class.rs b/src/v1_24/api/node/v1beta1/runtime_class.rs index 31fffa9653..5124a2372e 100644 --- a/src/v1_24/api/node/v1beta1/runtime_class.rs +++ b/src/v1_24/api/node/v1beta1/runtime_class.rs @@ -366,7 +366,7 @@ impl crate::ListableResource for RuntimeClass { } impl crate::Metadata for RuntimeClass { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_24/api/policy/v1/eviction.rs b/src/v1_24/api/policy/v1/eviction.rs index e92ebe2f3a..fe63d30d4c 100644 --- a/src/v1_24/api/policy/v1/eviction.rs +++ b/src/v1_24/api/policy/v1/eviction.rs @@ -71,7 +71,7 @@ impl crate::Resource for Eviction { } impl crate::Metadata for Eviction { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::SubObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_24/api/policy/v1beta1/pod_security_policy.rs b/src/v1_24/api/policy/v1beta1/pod_security_policy.rs index 1a515209d1..fc536300b2 100644 --- a/src/v1_24/api/policy/v1beta1/pod_security_policy.rs +++ b/src/v1_24/api/policy/v1beta1/pod_security_policy.rs @@ -360,7 +360,7 @@ impl crate::ListableResource for PodSecurityPolicy { } impl crate::Metadata for PodSecurityPolicy { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_24/api/rbac/v1/cluster_role.rs b/src/v1_24/api/rbac/v1/cluster_role.rs index 8336e14c92..541d57c8ee 100644 --- a/src/v1_24/api/rbac/v1/cluster_role.rs +++ b/src/v1_24/api/rbac/v1/cluster_role.rs @@ -363,7 +363,7 @@ impl crate::ListableResource for ClusterRole { } impl crate::Metadata for ClusterRole { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_24/api/rbac/v1/cluster_role_binding.rs b/src/v1_24/api/rbac/v1/cluster_role_binding.rs index 0162a1128e..0f02a028d1 100644 --- a/src/v1_24/api/rbac/v1/cluster_role_binding.rs +++ b/src/v1_24/api/rbac/v1/cluster_role_binding.rs @@ -363,7 +363,7 @@ impl crate::ListableResource for ClusterRoleBinding { } impl crate::Metadata for ClusterRoleBinding { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_24/api/scheduling/v1/priority_class.rs b/src/v1_24/api/scheduling/v1/priority_class.rs index f13f535704..3cbab648f7 100644 --- a/src/v1_24/api/scheduling/v1/priority_class.rs +++ b/src/v1_24/api/scheduling/v1/priority_class.rs @@ -369,7 +369,7 @@ impl crate::ListableResource for PriorityClass { } impl crate::Metadata for PriorityClass { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_24/api/storage/v1/csi_driver.rs b/src/v1_24/api/storage/v1/csi_driver.rs index 0dc419fa28..841c350667 100644 --- a/src/v1_24/api/storage/v1/csi_driver.rs +++ b/src/v1_24/api/storage/v1/csi_driver.rs @@ -360,7 +360,7 @@ impl crate::ListableResource for CSIDriver { } impl crate::Metadata for CSIDriver { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_24/api/storage/v1/csi_node.rs b/src/v1_24/api/storage/v1/csi_node.rs index a514ce9bf0..2ae2dc489a 100644 --- a/src/v1_24/api/storage/v1/csi_node.rs +++ b/src/v1_24/api/storage/v1/csi_node.rs @@ -360,7 +360,7 @@ impl crate::ListableResource for CSINode { } impl crate::Metadata for CSINode { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_24/api/storage/v1/storage_class.rs b/src/v1_24/api/storage/v1/storage_class.rs index 2bf8e65456..e8e1996616 100644 --- a/src/v1_24/api/storage/v1/storage_class.rs +++ b/src/v1_24/api/storage/v1/storage_class.rs @@ -380,7 +380,7 @@ impl crate::ListableResource for StorageClass { } impl crate::Metadata for StorageClass { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_24/api/storage/v1/volume_attachment.rs b/src/v1_24/api/storage/v1/volume_attachment.rs index f6b6972639..51e070f07b 100644 --- a/src/v1_24/api/storage/v1/volume_attachment.rs +++ b/src/v1_24/api/storage/v1/volume_attachment.rs @@ -518,7 +518,7 @@ impl crate::ListableResource for VolumeAttachment { } impl crate::Metadata for VolumeAttachment { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_24/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition.rs b/src/v1_24/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition.rs index c05e8ea174..5ab4dfa8ca 100644 --- a/src/v1_24/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition.rs +++ b/src/v1_24/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition.rs @@ -516,7 +516,7 @@ impl crate::ListableResource for CustomResourceDefinition { } impl crate::Metadata for CustomResourceDefinition { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_24/apimachinery/pkg/apis/meta/v1/cluster_object_meta.rs b/src/v1_24/apimachinery/pkg/apis/meta/v1/cluster_object_meta.rs new file mode 100644 index 0000000000..72f7493cd1 --- /dev/null +++ b/src/v1_24/apimachinery/pkg/apis/meta/v1/cluster_object_meta.rs @@ -0,0 +1,528 @@ +// Generated from definition io.k8s.apimachinery.pkg.apis.meta.v1.ClusterObjectMeta + +/// ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create. +#[derive(Clone, Debug, Default, PartialEq)] +pub struct ClusterObjectMeta { + /// Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations + pub annotations: Option>, + + /// Deprecated: ClusterName is a legacy field that was always cleared by the system and never used; it will be removed completely in 1.25. + /// + /// The name in the go struct is changed to help clients detect accidental use. + pub cluster_name: Option, + + /// CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC. + /// + /// Populated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + pub creation_timestamp: Option, + + /// Number of seconds allowed for this object to gracefully terminate before it will be removed from the system. Only set when deletionTimestamp is also set. May only be shortened. Read-only. + pub deletion_grace_period_seconds: Option, + + /// DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This field is set by the server when a graceful deletion is requested by the user, and is not directly settable by a client. The resource is expected to be deleted (no longer visible from resource lists, and not reachable by name) after the time in this field, once the finalizers list is empty. As long as the finalizers list contains items, deletion is blocked. Once the deletionTimestamp is set, this value may not be unset or be set further into the future, although it may be shortened or the resource may be deleted prior to this time. For example, a user may request that a pod is deleted in 30 seconds. The Kubelet will react by sending a graceful termination signal to the containers in the pod. After that 30 seconds, the Kubelet will send a hard termination signal (SIGKILL) to the container and after cleanup, remove the pod from the API. In the presence of network partitions, this object may still exist after this timestamp, until an administrator or automated process can determine the resource is fully terminated. If not set, graceful deletion of the object has not been requested. + /// + /// Populated by the system when a graceful deletion is requested. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + pub deletion_timestamp: Option, + + /// Must be empty before the object is deleted from the registry. Each entry is an identifier for the responsible component that will remove the entry from the list. If the deletionTimestamp of the object is non-nil, entries in this list can only be removed. Finalizers may be processed and removed in any order. Order is NOT enforced because it introduces significant risk of stuck finalizers. finalizers is a shared field, any actor with permission can reorder it. If the finalizer list is processed in order, then this can lead to a situation in which the component responsible for the first finalizer in the list is waiting for a signal (field value, external system, or other) produced by a component responsible for a finalizer later in the list, resulting in a deadlock. Without enforced ordering finalizers are free to order amongst themselves and are not vulnerable to ordering changes in the list. + pub finalizers: Option>, + + /// GenerateName is an optional prefix, used by the server, to generate a unique name ONLY IF the Name field has not been provided. If this field is used, the name returned to the client will be different than the name passed. This value will also be combined with a unique suffix. The provided value has the same validation rules as the Name field, and may be truncated by the length of the suffix required to make the value unique on the server. + /// + /// If this field is specified and the generated name exists, the server will return a 409. + /// + /// Applied only if Name is not specified. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#idempotency + pub generate_name: Option, + + /// A sequence number representing a specific generation of the desired state. Populated by the system. Read-only. + pub generation: Option, + + /// Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels + pub labels: Option>, + + /// ManagedFields maps workflow-id and version to the set of fields that are managed by that workflow. This is mostly for internal housekeeping, and users typically shouldn't need to set or understand this field. A workflow can be the user's name, a controller's name, or the name of a specific apply path like "ci-cd". The set of fields is always in the version that the workflow used when modifying the object. + pub managed_fields: Option>, + + /// Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names + pub name: Option, + + /// List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller. + pub owner_references: Option>, + + /// An opaque value that represents the internal version of this object that can be used by clients to determine when objects have changed. May be used for optimistic concurrency, change detection, and the watch operation on a resource or set of resources. Clients must treat these values as opaque and passed unmodified back to the server. They may only be valid for a particular resource or set of resources. + /// + /// Populated by the system. Read-only. Value must be treated as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency + pub resource_version: Option, + + /// Deprecated: selfLink is a legacy read-only field that is no longer populated by the system. + pub self_link: Option, + + /// UID is the unique in time and space value for this object. It is typically generated by the server on successful creation of a resource and is not allowed to change on PUT operations. + /// + /// Populated by the system. Read-only. More info: http://kubernetes.io/docs/user-guide/identifiers#uids + pub uid: Option, +} + +impl crate::DeepMerge for ClusterObjectMeta { + fn merge_from(&mut self, other: Self) { + crate::DeepMerge::merge_from(&mut self.annotations, other.annotations); + crate::DeepMerge::merge_from(&mut self.cluster_name, other.cluster_name); + crate::DeepMerge::merge_from(&mut self.creation_timestamp, other.creation_timestamp); + crate::DeepMerge::merge_from(&mut self.deletion_grace_period_seconds, other.deletion_grace_period_seconds); + crate::DeepMerge::merge_from(&mut self.deletion_timestamp, other.deletion_timestamp); + crate::DeepMerge::merge_from(&mut self.finalizers, other.finalizers); + crate::DeepMerge::merge_from(&mut self.generate_name, other.generate_name); + crate::DeepMerge::merge_from(&mut self.generation, other.generation); + crate::DeepMerge::merge_from(&mut self.labels, other.labels); + crate::DeepMerge::merge_from(&mut self.managed_fields, other.managed_fields); + crate::DeepMerge::merge_from(&mut self.name, other.name); + crate::DeepMerge::merge_from(&mut self.owner_references, other.owner_references); + crate::DeepMerge::merge_from(&mut self.resource_version, other.resource_version); + crate::DeepMerge::merge_from(&mut self.self_link, other.self_link); + crate::DeepMerge::merge_from(&mut self.uid, other.uid); + } +} + +impl<'de> crate::serde::Deserialize<'de> for ClusterObjectMeta { + fn deserialize(deserializer: D) -> Result where D: crate::serde::Deserializer<'de> { + #[allow(non_camel_case_types)] + enum Field { + Key_annotations, + Key_cluster_name, + Key_creation_timestamp, + Key_deletion_grace_period_seconds, + Key_deletion_timestamp, + Key_finalizers, + Key_generate_name, + Key_generation, + Key_labels, + Key_managed_fields, + Key_name, + Key_owner_references, + Key_resource_version, + Key_self_link, + Key_uid, + Other, + } + + impl<'de> crate::serde::Deserialize<'de> for Field { + fn deserialize(deserializer: D) -> Result where D: crate::serde::Deserializer<'de> { + struct Visitor; + + impl<'de> crate::serde::de::Visitor<'de> for Visitor { + type Value = Field; + + fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.write_str("field identifier") + } + + fn visit_str(self, v: &str) -> Result where E: crate::serde::de::Error { + Ok(match v { + "annotations" => Field::Key_annotations, + "clusterName" => Field::Key_cluster_name, + "creationTimestamp" => Field::Key_creation_timestamp, + "deletionGracePeriodSeconds" => Field::Key_deletion_grace_period_seconds, + "deletionTimestamp" => Field::Key_deletion_timestamp, + "finalizers" => Field::Key_finalizers, + "generateName" => Field::Key_generate_name, + "generation" => Field::Key_generation, + "labels" => Field::Key_labels, + "managedFields" => Field::Key_managed_fields, + "name" => Field::Key_name, + "ownerReferences" => Field::Key_owner_references, + "resourceVersion" => Field::Key_resource_version, + "selfLink" => Field::Key_self_link, + "uid" => Field::Key_uid, + _ => Field::Other, + }) + } + } + + deserializer.deserialize_identifier(Visitor) + } + } + + struct Visitor; + + impl<'de> crate::serde::de::Visitor<'de> for Visitor { + type Value = ClusterObjectMeta; + + fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.write_str("ClusterObjectMeta") + } + + fn visit_map(self, mut map: A) -> Result where A: crate::serde::de::MapAccess<'de> { + let mut value_annotations: Option> = None; + let mut value_cluster_name: Option = None; + let mut value_creation_timestamp: Option = None; + let mut value_deletion_grace_period_seconds: Option = None; + let mut value_deletion_timestamp: Option = None; + let mut value_finalizers: Option> = None; + let mut value_generate_name: Option = None; + let mut value_generation: Option = None; + let mut value_labels: Option> = None; + let mut value_managed_fields: Option> = None; + let mut value_name: Option = None; + let mut value_owner_references: Option> = None; + let mut value_resource_version: Option = None; + let mut value_self_link: Option = None; + let mut value_uid: Option = None; + + while let Some(key) = crate::serde::de::MapAccess::next_key::(&mut map)? { + match key { + Field::Key_annotations => value_annotations = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_cluster_name => value_cluster_name = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_creation_timestamp => value_creation_timestamp = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_deletion_grace_period_seconds => value_deletion_grace_period_seconds = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_deletion_timestamp => value_deletion_timestamp = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_finalizers => value_finalizers = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_generate_name => value_generate_name = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_generation => value_generation = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_labels => value_labels = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_managed_fields => value_managed_fields = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_name => value_name = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_owner_references => value_owner_references = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_resource_version => value_resource_version = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_self_link => value_self_link = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_uid => value_uid = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Other => { let _: crate::serde::de::IgnoredAny = crate::serde::de::MapAccess::next_value(&mut map)?; }, + } + } + + Ok(ClusterObjectMeta { + annotations: value_annotations, + cluster_name: value_cluster_name, + creation_timestamp: value_creation_timestamp, + deletion_grace_period_seconds: value_deletion_grace_period_seconds, + deletion_timestamp: value_deletion_timestamp, + finalizers: value_finalizers, + generate_name: value_generate_name, + generation: value_generation, + labels: value_labels, + managed_fields: value_managed_fields, + name: value_name, + owner_references: value_owner_references, + resource_version: value_resource_version, + self_link: value_self_link, + uid: value_uid, + }) + } + } + + deserializer.deserialize_struct( + "ClusterObjectMeta", + &[ + "annotations", + "clusterName", + "creationTimestamp", + "deletionGracePeriodSeconds", + "deletionTimestamp", + "finalizers", + "generateName", + "generation", + "labels", + "managedFields", + "name", + "ownerReferences", + "resourceVersion", + "selfLink", + "uid", + ], + Visitor, + ) + } +} + +impl crate::serde::Serialize for ClusterObjectMeta { + fn serialize(&self, serializer: S) -> Result where S: crate::serde::Serializer { + let mut state = serializer.serialize_struct( + "ClusterObjectMeta", + self.annotations.as_ref().map_or(0, |_| 1) + + self.cluster_name.as_ref().map_or(0, |_| 1) + + self.creation_timestamp.as_ref().map_or(0, |_| 1) + + self.deletion_grace_period_seconds.as_ref().map_or(0, |_| 1) + + self.deletion_timestamp.as_ref().map_or(0, |_| 1) + + self.finalizers.as_ref().map_or(0, |_| 1) + + self.generate_name.as_ref().map_or(0, |_| 1) + + self.generation.as_ref().map_or(0, |_| 1) + + self.labels.as_ref().map_or(0, |_| 1) + + self.managed_fields.as_ref().map_or(0, |_| 1) + + self.name.as_ref().map_or(0, |_| 1) + + self.owner_references.as_ref().map_or(0, |_| 1) + + self.resource_version.as_ref().map_or(0, |_| 1) + + self.self_link.as_ref().map_or(0, |_| 1) + + self.uid.as_ref().map_or(0, |_| 1), + )?; + if let Some(value) = &self.annotations { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "annotations", value)?; + } + if let Some(value) = &self.cluster_name { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "clusterName", value)?; + } + if let Some(value) = &self.creation_timestamp { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "creationTimestamp", value)?; + } + if let Some(value) = &self.deletion_grace_period_seconds { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "deletionGracePeriodSeconds", value)?; + } + if let Some(value) = &self.deletion_timestamp { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "deletionTimestamp", value)?; + } + if let Some(value) = &self.finalizers { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "finalizers", value)?; + } + if let Some(value) = &self.generate_name { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "generateName", value)?; + } + if let Some(value) = &self.generation { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "generation", value)?; + } + if let Some(value) = &self.labels { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "labels", value)?; + } + if let Some(value) = &self.managed_fields { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "managedFields", value)?; + } + if let Some(value) = &self.name { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "name", value)?; + } + if let Some(value) = &self.owner_references { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "ownerReferences", value)?; + } + if let Some(value) = &self.resource_version { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "resourceVersion", value)?; + } + if let Some(value) = &self.self_link { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "selfLink", value)?; + } + if let Some(value) = &self.uid { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "uid", value)?; + } + crate::serde::ser::SerializeStruct::end(state) + } +} + +#[cfg(feature = "schemars")] +impl crate::schemars::JsonSchema for ClusterObjectMeta { + fn schema_name() -> String { + "io.k8s.apimachinery.pkg.apis.meta.v1.ClusterObjectMeta".to_owned() + } + + fn json_schema(__gen: &mut crate::schemars::gen::SchemaGenerator) -> crate::schemars::schema::Schema { + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Object))), + object: Some(Box::new(crate::schemars::schema::ObjectValidation { + properties: [ + ( + "annotations".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Object))), + object: Some(Box::new(crate::schemars::schema::ObjectValidation { + additional_properties: Some(Box::new( + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }) + )), + ..Default::default() + })), + ..Default::default() + }), + ), + ( + "clusterName".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Deprecated: ClusterName is a legacy field that was always cleared by the system and never used; it will be removed completely in 1.25.\n\nThe name in the go struct is changed to help clients detect accidental use.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ( + "creationTimestamp".to_owned(), + { + let mut schema_obj = __gen.subschema_for::().into_object(); + schema_obj.metadata = Some(Box::new(crate::schemars::schema::Metadata { + description: Some("CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC.\n\nPopulated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata".to_owned()), + ..Default::default() + })); + crate::schemars::schema::Schema::Object(schema_obj) + }, + ), + ( + "deletionGracePeriodSeconds".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Number of seconds allowed for this object to gracefully terminate before it will be removed from the system. Only set when deletionTimestamp is also set. May only be shortened. Read-only.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Integer))), + format: Some("int64".to_owned()), + ..Default::default() + }), + ), + ( + "deletionTimestamp".to_owned(), + { + let mut schema_obj = __gen.subschema_for::().into_object(); + schema_obj.metadata = Some(Box::new(crate::schemars::schema::Metadata { + description: Some("DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This field is set by the server when a graceful deletion is requested by the user, and is not directly settable by a client. The resource is expected to be deleted (no longer visible from resource lists, and not reachable by name) after the time in this field, once the finalizers list is empty. As long as the finalizers list contains items, deletion is blocked. Once the deletionTimestamp is set, this value may not be unset or be set further into the future, although it may be shortened or the resource may be deleted prior to this time. For example, a user may request that a pod is deleted in 30 seconds. The Kubelet will react by sending a graceful termination signal to the containers in the pod. After that 30 seconds, the Kubelet will send a hard termination signal (SIGKILL) to the container and after cleanup, remove the pod from the API. In the presence of network partitions, this object may still exist after this timestamp, until an administrator or automated process can determine the resource is fully terminated. If not set, graceful deletion of the object has not been requested.\n\nPopulated by the system when a graceful deletion is requested. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata".to_owned()), + ..Default::default() + })); + crate::schemars::schema::Schema::Object(schema_obj) + }, + ), + ( + "finalizers".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Must be empty before the object is deleted from the registry. Each entry is an identifier for the responsible component that will remove the entry from the list. If the deletionTimestamp of the object is non-nil, entries in this list can only be removed. Finalizers may be processed and removed in any order. Order is NOT enforced because it introduces significant risk of stuck finalizers. finalizers is a shared field, any actor with permission can reorder it. If the finalizer list is processed in order, then this can lead to a situation in which the component responsible for the first finalizer in the list is waiting for a signal (field value, external system, or other) produced by a component responsible for a finalizer later in the list, resulting in a deadlock. Without enforced ordering finalizers are free to order amongst themselves and are not vulnerable to ordering changes in the list.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Array))), + array: Some(Box::new(crate::schemars::schema::ArrayValidation { + items: Some(crate::schemars::schema::SingleOrVec::Single(Box::new( + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }) + ))), + ..Default::default() + })), + ..Default::default() + }), + ), + ( + "generateName".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("GenerateName is an optional prefix, used by the server, to generate a unique name ONLY IF the Name field has not been provided. If this field is used, the name returned to the client will be different than the name passed. This value will also be combined with a unique suffix. The provided value has the same validation rules as the Name field, and may be truncated by the length of the suffix required to make the value unique on the server.\n\nIf this field is specified and the generated name exists, the server will return a 409.\n\nApplied only if Name is not specified. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#idempotency".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ( + "generation".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("A sequence number representing a specific generation of the desired state. Populated by the system. Read-only.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Integer))), + format: Some("int64".to_owned()), + ..Default::default() + }), + ), + ( + "labels".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Object))), + object: Some(Box::new(crate::schemars::schema::ObjectValidation { + additional_properties: Some(Box::new( + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }) + )), + ..Default::default() + })), + ..Default::default() + }), + ), + ( + "managedFields".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("ManagedFields maps workflow-id and version to the set of fields that are managed by that workflow. This is mostly for internal housekeeping, and users typically shouldn't need to set or understand this field. A workflow can be the user's name, a controller's name, or the name of a specific apply path like \"ci-cd\". The set of fields is always in the version that the workflow used when modifying the object.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Array))), + array: Some(Box::new(crate::schemars::schema::ArrayValidation { + items: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(__gen.subschema_for::()))), + ..Default::default() + })), + ..Default::default() + }), + ), + ( + "name".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ( + "ownerReferences".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Array))), + array: Some(Box::new(crate::schemars::schema::ArrayValidation { + items: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(__gen.subschema_for::()))), + ..Default::default() + })), + ..Default::default() + }), + ), + ( + "resourceVersion".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("An opaque value that represents the internal version of this object that can be used by clients to determine when objects have changed. May be used for optimistic concurrency, change detection, and the watch operation on a resource or set of resources. Clients must treat these values as opaque and passed unmodified back to the server. They may only be valid for a particular resource or set of resources.\n\nPopulated by the system. Read-only. Value must be treated as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ( + "selfLink".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Deprecated: selfLink is a legacy read-only field that is no longer populated by the system.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ( + "uid".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("UID is the unique in time and space value for this object. It is typically generated by the server on successful creation of a resource and is not allowed to change on PUT operations.\n\nPopulated by the system. Read-only. More info: http://kubernetes.io/docs/user-guide/identifiers#uids".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ].into(), + ..Default::default() + })), + ..Default::default() + }) + } +} diff --git a/src/v1_24/apimachinery/pkg/apis/meta/v1/mod.rs b/src/v1_24/apimachinery/pkg/apis/meta/v1/mod.rs index 9424127582..221a712e6d 100644 --- a/src/v1_24/apimachinery/pkg/apis/meta/v1/mod.rs +++ b/src/v1_24/apimachinery/pkg/apis/meta/v1/mod.rs @@ -14,6 +14,9 @@ pub use self::api_resource_list::APIResourceList; mod api_versions; pub use self::api_versions::APIVersions; +mod cluster_object_meta; +pub use self::cluster_object_meta::ClusterObjectMeta; + mod condition; pub use self::condition::Condition; @@ -65,6 +68,9 @@ pub use self::status_cause::StatusCause; mod status_details; pub use self::status_details::StatusDetails; +mod sub_object_meta; +pub use self::sub_object_meta::SubObjectMeta; + mod time; pub use self::time::Time; diff --git a/src/v1_24/apimachinery/pkg/apis/meta/v1/object_meta.rs b/src/v1_24/apimachinery/pkg/apis/meta/v1/object_meta.rs index d38a046880..acdb003cd1 100644 --- a/src/v1_24/apimachinery/pkg/apis/meta/v1/object_meta.rs +++ b/src/v1_24/apimachinery/pkg/apis/meta/v1/object_meta.rs @@ -49,7 +49,7 @@ pub struct ObjectMeta { /// Namespace defines the space within which each name must be unique. An empty namespace is equivalent to the "default" namespace, but "default" is the canonical representation. Not all objects are required to be scoped to a namespace - the value of this field for those objects will be empty. /// /// Must be a DNS_LABEL. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/namespaces - pub namespace: Option, + pub namespace: String, /// List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller. pub owner_references: Option>, @@ -211,7 +211,7 @@ impl<'de> crate::serde::Deserialize<'de> for ObjectMeta { labels: value_labels, managed_fields: value_managed_fields, name: value_name, - namespace: value_namespace, + namespace: value_namespace.unwrap_or_default(), owner_references: value_owner_references, resource_version: value_resource_version, self_link: value_self_link, @@ -249,6 +249,7 @@ impl crate::serde::Serialize for ObjectMeta { fn serialize(&self, serializer: S) -> Result where S: crate::serde::Serializer { let mut state = serializer.serialize_struct( "ObjectMeta", + 1 + self.annotations.as_ref().map_or(0, |_| 1) + self.cluster_name.as_ref().map_or(0, |_| 1) + self.creation_timestamp.as_ref().map_or(0, |_| 1) + @@ -260,7 +261,6 @@ impl crate::serde::Serialize for ObjectMeta { self.labels.as_ref().map_or(0, |_| 1) + self.managed_fields.as_ref().map_or(0, |_| 1) + self.name.as_ref().map_or(0, |_| 1) + - self.namespace.as_ref().map_or(0, |_| 1) + self.owner_references.as_ref().map_or(0, |_| 1) + self.resource_version.as_ref().map_or(0, |_| 1) + self.self_link.as_ref().map_or(0, |_| 1) + @@ -299,9 +299,7 @@ impl crate::serde::Serialize for ObjectMeta { if let Some(value) = &self.name { crate::serde::ser::SerializeStruct::serialize_field(&mut state, "name", value)?; } - if let Some(value) = &self.namespace { - crate::serde::ser::SerializeStruct::serialize_field(&mut state, "namespace", value)?; - } + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "namespace", &self.namespace)?; if let Some(value) = &self.owner_references { crate::serde::ser::SerializeStruct::serialize_field(&mut state, "ownerReferences", value)?; } @@ -547,6 +545,9 @@ impl crate::schemars::JsonSchema for ObjectMeta { }), ), ].into(), + required: [ + "namespace".to_owned(), + ].into(), ..Default::default() })), ..Default::default() diff --git a/src/v1_24/apimachinery/pkg/apis/meta/v1/sub_object_meta.rs b/src/v1_24/apimachinery/pkg/apis/meta/v1/sub_object_meta.rs new file mode 100644 index 0000000000..e7ff2dd248 --- /dev/null +++ b/src/v1_24/apimachinery/pkg/apis/meta/v1/sub_object_meta.rs @@ -0,0 +1,555 @@ +// Generated from definition io.k8s.apimachinery.pkg.apis.meta.v1.SubObjectMeta + +/// ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create. +#[derive(Clone, Debug, Default, PartialEq)] +pub struct SubObjectMeta { + /// Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations + pub annotations: Option>, + + /// Deprecated: ClusterName is a legacy field that was always cleared by the system and never used; it will be removed completely in 1.25. + /// + /// The name in the go struct is changed to help clients detect accidental use. + pub cluster_name: Option, + + /// CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC. + /// + /// Populated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + pub creation_timestamp: Option, + + /// Number of seconds allowed for this object to gracefully terminate before it will be removed from the system. Only set when deletionTimestamp is also set. May only be shortened. Read-only. + pub deletion_grace_period_seconds: Option, + + /// DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This field is set by the server when a graceful deletion is requested by the user, and is not directly settable by a client. The resource is expected to be deleted (no longer visible from resource lists, and not reachable by name) after the time in this field, once the finalizers list is empty. As long as the finalizers list contains items, deletion is blocked. Once the deletionTimestamp is set, this value may not be unset or be set further into the future, although it may be shortened or the resource may be deleted prior to this time. For example, a user may request that a pod is deleted in 30 seconds. The Kubelet will react by sending a graceful termination signal to the containers in the pod. After that 30 seconds, the Kubelet will send a hard termination signal (SIGKILL) to the container and after cleanup, remove the pod from the API. In the presence of network partitions, this object may still exist after this timestamp, until an administrator or automated process can determine the resource is fully terminated. If not set, graceful deletion of the object has not been requested. + /// + /// Populated by the system when a graceful deletion is requested. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + pub deletion_timestamp: Option, + + /// Must be empty before the object is deleted from the registry. Each entry is an identifier for the responsible component that will remove the entry from the list. If the deletionTimestamp of the object is non-nil, entries in this list can only be removed. Finalizers may be processed and removed in any order. Order is NOT enforced because it introduces significant risk of stuck finalizers. finalizers is a shared field, any actor with permission can reorder it. If the finalizer list is processed in order, then this can lead to a situation in which the component responsible for the first finalizer in the list is waiting for a signal (field value, external system, or other) produced by a component responsible for a finalizer later in the list, resulting in a deadlock. Without enforced ordering finalizers are free to order amongst themselves and are not vulnerable to ordering changes in the list. + pub finalizers: Option>, + + /// GenerateName is an optional prefix, used by the server, to generate a unique name ONLY IF the Name field has not been provided. If this field is used, the name returned to the client will be different than the name passed. This value will also be combined with a unique suffix. The provided value has the same validation rules as the Name field, and may be truncated by the length of the suffix required to make the value unique on the server. + /// + /// If this field is specified and the generated name exists, the server will return a 409. + /// + /// Applied only if Name is not specified. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#idempotency + pub generate_name: Option, + + /// A sequence number representing a specific generation of the desired state. Populated by the system. Read-only. + pub generation: Option, + + /// Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels + pub labels: Option>, + + /// ManagedFields maps workflow-id and version to the set of fields that are managed by that workflow. This is mostly for internal housekeeping, and users typically shouldn't need to set or understand this field. A workflow can be the user's name, a controller's name, or the name of a specific apply path like "ci-cd". The set of fields is always in the version that the workflow used when modifying the object. + pub managed_fields: Option>, + + /// Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names + pub name: Option, + + /// Namespace defines the space within which each name must be unique. An empty namespace is equivalent to the "default" namespace, but "default" is the canonical representation. Not all objects are required to be scoped to a namespace - the value of this field for those objects will be empty. + /// + /// Must be a DNS_LABEL. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/namespaces + pub namespace: Option, + + /// List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller. + pub owner_references: Option>, + + /// An opaque value that represents the internal version of this object that can be used by clients to determine when objects have changed. May be used for optimistic concurrency, change detection, and the watch operation on a resource or set of resources. Clients must treat these values as opaque and passed unmodified back to the server. They may only be valid for a particular resource or set of resources. + /// + /// Populated by the system. Read-only. Value must be treated as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency + pub resource_version: Option, + + /// Deprecated: selfLink is a legacy read-only field that is no longer populated by the system. + pub self_link: Option, + + /// UID is the unique in time and space value for this object. It is typically generated by the server on successful creation of a resource and is not allowed to change on PUT operations. + /// + /// Populated by the system. Read-only. More info: http://kubernetes.io/docs/user-guide/identifiers#uids + pub uid: Option, +} + +impl crate::DeepMerge for SubObjectMeta { + fn merge_from(&mut self, other: Self) { + crate::DeepMerge::merge_from(&mut self.annotations, other.annotations); + crate::DeepMerge::merge_from(&mut self.cluster_name, other.cluster_name); + crate::DeepMerge::merge_from(&mut self.creation_timestamp, other.creation_timestamp); + crate::DeepMerge::merge_from(&mut self.deletion_grace_period_seconds, other.deletion_grace_period_seconds); + crate::DeepMerge::merge_from(&mut self.deletion_timestamp, other.deletion_timestamp); + crate::DeepMerge::merge_from(&mut self.finalizers, other.finalizers); + crate::DeepMerge::merge_from(&mut self.generate_name, other.generate_name); + crate::DeepMerge::merge_from(&mut self.generation, other.generation); + crate::DeepMerge::merge_from(&mut self.labels, other.labels); + crate::DeepMerge::merge_from(&mut self.managed_fields, other.managed_fields); + crate::DeepMerge::merge_from(&mut self.name, other.name); + crate::DeepMerge::merge_from(&mut self.namespace, other.namespace); + crate::DeepMerge::merge_from(&mut self.owner_references, other.owner_references); + crate::DeepMerge::merge_from(&mut self.resource_version, other.resource_version); + crate::DeepMerge::merge_from(&mut self.self_link, other.self_link); + crate::DeepMerge::merge_from(&mut self.uid, other.uid); + } +} + +impl<'de> crate::serde::Deserialize<'de> for SubObjectMeta { + fn deserialize(deserializer: D) -> Result where D: crate::serde::Deserializer<'de> { + #[allow(non_camel_case_types)] + enum Field { + Key_annotations, + Key_cluster_name, + Key_creation_timestamp, + Key_deletion_grace_period_seconds, + Key_deletion_timestamp, + Key_finalizers, + Key_generate_name, + Key_generation, + Key_labels, + Key_managed_fields, + Key_name, + Key_namespace, + Key_owner_references, + Key_resource_version, + Key_self_link, + Key_uid, + Other, + } + + impl<'de> crate::serde::Deserialize<'de> for Field { + fn deserialize(deserializer: D) -> Result where D: crate::serde::Deserializer<'de> { + struct Visitor; + + impl<'de> crate::serde::de::Visitor<'de> for Visitor { + type Value = Field; + + fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.write_str("field identifier") + } + + fn visit_str(self, v: &str) -> Result where E: crate::serde::de::Error { + Ok(match v { + "annotations" => Field::Key_annotations, + "clusterName" => Field::Key_cluster_name, + "creationTimestamp" => Field::Key_creation_timestamp, + "deletionGracePeriodSeconds" => Field::Key_deletion_grace_period_seconds, + "deletionTimestamp" => Field::Key_deletion_timestamp, + "finalizers" => Field::Key_finalizers, + "generateName" => Field::Key_generate_name, + "generation" => Field::Key_generation, + "labels" => Field::Key_labels, + "managedFields" => Field::Key_managed_fields, + "name" => Field::Key_name, + "namespace" => Field::Key_namespace, + "ownerReferences" => Field::Key_owner_references, + "resourceVersion" => Field::Key_resource_version, + "selfLink" => Field::Key_self_link, + "uid" => Field::Key_uid, + _ => Field::Other, + }) + } + } + + deserializer.deserialize_identifier(Visitor) + } + } + + struct Visitor; + + impl<'de> crate::serde::de::Visitor<'de> for Visitor { + type Value = SubObjectMeta; + + fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.write_str("SubObjectMeta") + } + + fn visit_map(self, mut map: A) -> Result where A: crate::serde::de::MapAccess<'de> { + let mut value_annotations: Option> = None; + let mut value_cluster_name: Option = None; + let mut value_creation_timestamp: Option = None; + let mut value_deletion_grace_period_seconds: Option = None; + let mut value_deletion_timestamp: Option = None; + let mut value_finalizers: Option> = None; + let mut value_generate_name: Option = None; + let mut value_generation: Option = None; + let mut value_labels: Option> = None; + let mut value_managed_fields: Option> = None; + let mut value_name: Option = None; + let mut value_namespace: Option = None; + let mut value_owner_references: Option> = None; + let mut value_resource_version: Option = None; + let mut value_self_link: Option = None; + let mut value_uid: Option = None; + + while let Some(key) = crate::serde::de::MapAccess::next_key::(&mut map)? { + match key { + Field::Key_annotations => value_annotations = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_cluster_name => value_cluster_name = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_creation_timestamp => value_creation_timestamp = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_deletion_grace_period_seconds => value_deletion_grace_period_seconds = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_deletion_timestamp => value_deletion_timestamp = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_finalizers => value_finalizers = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_generate_name => value_generate_name = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_generation => value_generation = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_labels => value_labels = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_managed_fields => value_managed_fields = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_name => value_name = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_namespace => value_namespace = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_owner_references => value_owner_references = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_resource_version => value_resource_version = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_self_link => value_self_link = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_uid => value_uid = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Other => { let _: crate::serde::de::IgnoredAny = crate::serde::de::MapAccess::next_value(&mut map)?; }, + } + } + + Ok(SubObjectMeta { + annotations: value_annotations, + cluster_name: value_cluster_name, + creation_timestamp: value_creation_timestamp, + deletion_grace_period_seconds: value_deletion_grace_period_seconds, + deletion_timestamp: value_deletion_timestamp, + finalizers: value_finalizers, + generate_name: value_generate_name, + generation: value_generation, + labels: value_labels, + managed_fields: value_managed_fields, + name: value_name, + namespace: value_namespace, + owner_references: value_owner_references, + resource_version: value_resource_version, + self_link: value_self_link, + uid: value_uid, + }) + } + } + + deserializer.deserialize_struct( + "SubObjectMeta", + &[ + "annotations", + "clusterName", + "creationTimestamp", + "deletionGracePeriodSeconds", + "deletionTimestamp", + "finalizers", + "generateName", + "generation", + "labels", + "managedFields", + "name", + "namespace", + "ownerReferences", + "resourceVersion", + "selfLink", + "uid", + ], + Visitor, + ) + } +} + +impl crate::serde::Serialize for SubObjectMeta { + fn serialize(&self, serializer: S) -> Result where S: crate::serde::Serializer { + let mut state = serializer.serialize_struct( + "SubObjectMeta", + self.annotations.as_ref().map_or(0, |_| 1) + + self.cluster_name.as_ref().map_or(0, |_| 1) + + self.creation_timestamp.as_ref().map_or(0, |_| 1) + + self.deletion_grace_period_seconds.as_ref().map_or(0, |_| 1) + + self.deletion_timestamp.as_ref().map_or(0, |_| 1) + + self.finalizers.as_ref().map_or(0, |_| 1) + + self.generate_name.as_ref().map_or(0, |_| 1) + + self.generation.as_ref().map_or(0, |_| 1) + + self.labels.as_ref().map_or(0, |_| 1) + + self.managed_fields.as_ref().map_or(0, |_| 1) + + self.name.as_ref().map_or(0, |_| 1) + + self.namespace.as_ref().map_or(0, |_| 1) + + self.owner_references.as_ref().map_or(0, |_| 1) + + self.resource_version.as_ref().map_or(0, |_| 1) + + self.self_link.as_ref().map_or(0, |_| 1) + + self.uid.as_ref().map_or(0, |_| 1), + )?; + if let Some(value) = &self.annotations { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "annotations", value)?; + } + if let Some(value) = &self.cluster_name { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "clusterName", value)?; + } + if let Some(value) = &self.creation_timestamp { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "creationTimestamp", value)?; + } + if let Some(value) = &self.deletion_grace_period_seconds { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "deletionGracePeriodSeconds", value)?; + } + if let Some(value) = &self.deletion_timestamp { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "deletionTimestamp", value)?; + } + if let Some(value) = &self.finalizers { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "finalizers", value)?; + } + if let Some(value) = &self.generate_name { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "generateName", value)?; + } + if let Some(value) = &self.generation { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "generation", value)?; + } + if let Some(value) = &self.labels { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "labels", value)?; + } + if let Some(value) = &self.managed_fields { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "managedFields", value)?; + } + if let Some(value) = &self.name { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "name", value)?; + } + if let Some(value) = &self.namespace { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "namespace", value)?; + } + if let Some(value) = &self.owner_references { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "ownerReferences", value)?; + } + if let Some(value) = &self.resource_version { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "resourceVersion", value)?; + } + if let Some(value) = &self.self_link { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "selfLink", value)?; + } + if let Some(value) = &self.uid { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "uid", value)?; + } + crate::serde::ser::SerializeStruct::end(state) + } +} + +#[cfg(feature = "schemars")] +impl crate::schemars::JsonSchema for SubObjectMeta { + fn schema_name() -> String { + "io.k8s.apimachinery.pkg.apis.meta.v1.SubObjectMeta".to_owned() + } + + fn json_schema(__gen: &mut crate::schemars::gen::SchemaGenerator) -> crate::schemars::schema::Schema { + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Object))), + object: Some(Box::new(crate::schemars::schema::ObjectValidation { + properties: [ + ( + "annotations".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Object))), + object: Some(Box::new(crate::schemars::schema::ObjectValidation { + additional_properties: Some(Box::new( + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }) + )), + ..Default::default() + })), + ..Default::default() + }), + ), + ( + "clusterName".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Deprecated: ClusterName is a legacy field that was always cleared by the system and never used; it will be removed completely in 1.25.\n\nThe name in the go struct is changed to help clients detect accidental use.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ( + "creationTimestamp".to_owned(), + { + let mut schema_obj = __gen.subschema_for::().into_object(); + schema_obj.metadata = Some(Box::new(crate::schemars::schema::Metadata { + description: Some("CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC.\n\nPopulated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata".to_owned()), + ..Default::default() + })); + crate::schemars::schema::Schema::Object(schema_obj) + }, + ), + ( + "deletionGracePeriodSeconds".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Number of seconds allowed for this object to gracefully terminate before it will be removed from the system. Only set when deletionTimestamp is also set. May only be shortened. Read-only.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Integer))), + format: Some("int64".to_owned()), + ..Default::default() + }), + ), + ( + "deletionTimestamp".to_owned(), + { + let mut schema_obj = __gen.subschema_for::().into_object(); + schema_obj.metadata = Some(Box::new(crate::schemars::schema::Metadata { + description: Some("DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This field is set by the server when a graceful deletion is requested by the user, and is not directly settable by a client. The resource is expected to be deleted (no longer visible from resource lists, and not reachable by name) after the time in this field, once the finalizers list is empty. As long as the finalizers list contains items, deletion is blocked. Once the deletionTimestamp is set, this value may not be unset or be set further into the future, although it may be shortened or the resource may be deleted prior to this time. For example, a user may request that a pod is deleted in 30 seconds. The Kubelet will react by sending a graceful termination signal to the containers in the pod. After that 30 seconds, the Kubelet will send a hard termination signal (SIGKILL) to the container and after cleanup, remove the pod from the API. In the presence of network partitions, this object may still exist after this timestamp, until an administrator or automated process can determine the resource is fully terminated. If not set, graceful deletion of the object has not been requested.\n\nPopulated by the system when a graceful deletion is requested. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata".to_owned()), + ..Default::default() + })); + crate::schemars::schema::Schema::Object(schema_obj) + }, + ), + ( + "finalizers".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Must be empty before the object is deleted from the registry. Each entry is an identifier for the responsible component that will remove the entry from the list. If the deletionTimestamp of the object is non-nil, entries in this list can only be removed. Finalizers may be processed and removed in any order. Order is NOT enforced because it introduces significant risk of stuck finalizers. finalizers is a shared field, any actor with permission can reorder it. If the finalizer list is processed in order, then this can lead to a situation in which the component responsible for the first finalizer in the list is waiting for a signal (field value, external system, or other) produced by a component responsible for a finalizer later in the list, resulting in a deadlock. Without enforced ordering finalizers are free to order amongst themselves and are not vulnerable to ordering changes in the list.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Array))), + array: Some(Box::new(crate::schemars::schema::ArrayValidation { + items: Some(crate::schemars::schema::SingleOrVec::Single(Box::new( + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }) + ))), + ..Default::default() + })), + ..Default::default() + }), + ), + ( + "generateName".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("GenerateName is an optional prefix, used by the server, to generate a unique name ONLY IF the Name field has not been provided. If this field is used, the name returned to the client will be different than the name passed. This value will also be combined with a unique suffix. The provided value has the same validation rules as the Name field, and may be truncated by the length of the suffix required to make the value unique on the server.\n\nIf this field is specified and the generated name exists, the server will return a 409.\n\nApplied only if Name is not specified. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#idempotency".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ( + "generation".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("A sequence number representing a specific generation of the desired state. Populated by the system. Read-only.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Integer))), + format: Some("int64".to_owned()), + ..Default::default() + }), + ), + ( + "labels".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Object))), + object: Some(Box::new(crate::schemars::schema::ObjectValidation { + additional_properties: Some(Box::new( + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }) + )), + ..Default::default() + })), + ..Default::default() + }), + ), + ( + "managedFields".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("ManagedFields maps workflow-id and version to the set of fields that are managed by that workflow. This is mostly for internal housekeeping, and users typically shouldn't need to set or understand this field. A workflow can be the user's name, a controller's name, or the name of a specific apply path like \"ci-cd\". The set of fields is always in the version that the workflow used when modifying the object.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Array))), + array: Some(Box::new(crate::schemars::schema::ArrayValidation { + items: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(__gen.subschema_for::()))), + ..Default::default() + })), + ..Default::default() + }), + ), + ( + "name".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ( + "namespace".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Namespace defines the space within which each name must be unique. An empty namespace is equivalent to the \"default\" namespace, but \"default\" is the canonical representation. Not all objects are required to be scoped to a namespace - the value of this field for those objects will be empty.\n\nMust be a DNS_LABEL. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/namespaces".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ( + "ownerReferences".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Array))), + array: Some(Box::new(crate::schemars::schema::ArrayValidation { + items: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(__gen.subschema_for::()))), + ..Default::default() + })), + ..Default::default() + }), + ), + ( + "resourceVersion".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("An opaque value that represents the internal version of this object that can be used by clients to determine when objects have changed. May be used for optimistic concurrency, change detection, and the watch operation on a resource or set of resources. Clients must treat these values as opaque and passed unmodified back to the server. They may only be valid for a particular resource or set of resources.\n\nPopulated by the system. Read-only. Value must be treated as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ( + "selfLink".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Deprecated: selfLink is a legacy read-only field that is no longer populated by the system.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ( + "uid".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("UID is the unique in time and space value for this object. It is typically generated by the server on successful creation of a resource and is not allowed to change on PUT operations.\n\nPopulated by the system. Read-only. More info: http://kubernetes.io/docs/user-guide/identifiers#uids".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ].into(), + ..Default::default() + })), + ..Default::default() + }) + } +} diff --git a/src/v1_24/kube_aggregator/pkg/apis/apiregistration/v1/api_service.rs b/src/v1_24/kube_aggregator/pkg/apis/apiregistration/v1/api_service.rs index cff7ff1489..587f0a528a 100644 --- a/src/v1_24/kube_aggregator/pkg/apis/apiregistration/v1/api_service.rs +++ b/src/v1_24/kube_aggregator/pkg/apis/apiregistration/v1/api_service.rs @@ -516,7 +516,7 @@ impl crate::ListableResource for APIService { } impl crate::Metadata for APIService { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_25/api/admissionregistration/v1/mutating_webhook_configuration.rs b/src/v1_25/api/admissionregistration/v1/mutating_webhook_configuration.rs index cb8ec8f5af..e0f9531189 100644 --- a/src/v1_25/api/admissionregistration/v1/mutating_webhook_configuration.rs +++ b/src/v1_25/api/admissionregistration/v1/mutating_webhook_configuration.rs @@ -360,7 +360,7 @@ impl crate::ListableResource for MutatingWebhookConfiguration { } impl crate::Metadata for MutatingWebhookConfiguration { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_25/api/admissionregistration/v1/validating_webhook_configuration.rs b/src/v1_25/api/admissionregistration/v1/validating_webhook_configuration.rs index 4c520b0eeb..4cf73a02cb 100644 --- a/src/v1_25/api/admissionregistration/v1/validating_webhook_configuration.rs +++ b/src/v1_25/api/admissionregistration/v1/validating_webhook_configuration.rs @@ -360,7 +360,7 @@ impl crate::ListableResource for ValidatingWebhookConfiguration { } impl crate::Metadata for ValidatingWebhookConfiguration { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_25/api/apiserverinternal/v1alpha1/storage_version.rs b/src/v1_25/api/apiserverinternal/v1alpha1/storage_version.rs index c5d811a2fd..7e41c6b9c1 100644 --- a/src/v1_25/api/apiserverinternal/v1alpha1/storage_version.rs +++ b/src/v1_25/api/apiserverinternal/v1alpha1/storage_version.rs @@ -516,7 +516,7 @@ impl crate::ListableResource for StorageVersion { } impl crate::Metadata for StorageVersion { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_25/api/authentication/v1/token_request.rs b/src/v1_25/api/authentication/v1/token_request.rs index 1f864e2ac3..995fbc9e76 100644 --- a/src/v1_25/api/authentication/v1/token_request.rs +++ b/src/v1_25/api/authentication/v1/token_request.rs @@ -74,7 +74,7 @@ impl crate::Resource for TokenRequest { } impl crate::Metadata for TokenRequest { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::SubObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_25/api/authentication/v1/token_review.rs b/src/v1_25/api/authentication/v1/token_review.rs index e4ed490482..e608079249 100644 --- a/src/v1_25/api/authentication/v1/token_review.rs +++ b/src/v1_25/api/authentication/v1/token_review.rs @@ -61,7 +61,7 @@ impl crate::Resource for TokenReview { } impl crate::Metadata for TokenReview { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_25/api/authorization/v1/self_subject_access_review.rs b/src/v1_25/api/authorization/v1/self_subject_access_review.rs index bf549beb13..a61121e9eb 100644 --- a/src/v1_25/api/authorization/v1/self_subject_access_review.rs +++ b/src/v1_25/api/authorization/v1/self_subject_access_review.rs @@ -61,7 +61,7 @@ impl crate::Resource for SelfSubjectAccessReview { } impl crate::Metadata for SelfSubjectAccessReview { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_25/api/authorization/v1/self_subject_rules_review.rs b/src/v1_25/api/authorization/v1/self_subject_rules_review.rs index 60defd6f35..d290dea234 100644 --- a/src/v1_25/api/authorization/v1/self_subject_rules_review.rs +++ b/src/v1_25/api/authorization/v1/self_subject_rules_review.rs @@ -61,7 +61,7 @@ impl crate::Resource for SelfSubjectRulesReview { } impl crate::Metadata for SelfSubjectRulesReview { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_25/api/authorization/v1/subject_access_review.rs b/src/v1_25/api/authorization/v1/subject_access_review.rs index 8735a9f0bc..c983461e5a 100644 --- a/src/v1_25/api/authorization/v1/subject_access_review.rs +++ b/src/v1_25/api/authorization/v1/subject_access_review.rs @@ -61,7 +61,7 @@ impl crate::Resource for SubjectAccessReview { } impl crate::Metadata for SubjectAccessReview { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_25/api/autoscaling/v1/scale.rs b/src/v1_25/api/autoscaling/v1/scale.rs index 89a7024529..3fb0a7ea47 100644 --- a/src/v1_25/api/autoscaling/v1/scale.rs +++ b/src/v1_25/api/autoscaling/v1/scale.rs @@ -711,7 +711,7 @@ impl crate::Resource for Scale { } impl crate::Metadata for Scale { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::SubObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_25/api/certificates/v1/certificate_signing_request.rs b/src/v1_25/api/certificates/v1/certificate_signing_request.rs index 066a900b7c..90721fc6e0 100644 --- a/src/v1_25/api/certificates/v1/certificate_signing_request.rs +++ b/src/v1_25/api/certificates/v1/certificate_signing_request.rs @@ -674,7 +674,7 @@ impl crate::ListableResource for CertificateSigningRequest { } impl crate::Metadata for CertificateSigningRequest { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_25/api/core/v1/component_status.rs b/src/v1_25/api/core/v1/component_status.rs index ecddf82170..ba505704c7 100644 --- a/src/v1_25/api/core/v1/component_status.rs +++ b/src/v1_25/api/core/v1/component_status.rs @@ -159,7 +159,7 @@ impl crate::ListableResource for ComponentStatus { } impl crate::Metadata for ComponentStatus { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_25/api/core/v1/namespace.rs b/src/v1_25/api/core/v1/namespace.rs index df31cdc0da..6600f8a3bb 100644 --- a/src/v1_25/api/core/v1/namespace.rs +++ b/src/v1_25/api/core/v1/namespace.rs @@ -516,7 +516,7 @@ impl crate::ListableResource for Namespace { } impl crate::Metadata for Namespace { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_25/api/core/v1/node.rs b/src/v1_25/api/core/v1/node.rs index 5a5694b818..d6e0aa6dfb 100644 --- a/src/v1_25/api/core/v1/node.rs +++ b/src/v1_25/api/core/v1/node.rs @@ -996,7 +996,7 @@ impl crate::ListableResource for Node { } impl crate::Metadata for Node { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_25/api/core/v1/persistent_volume.rs b/src/v1_25/api/core/v1/persistent_volume.rs index c3d9dde5a2..f74469a702 100644 --- a/src/v1_25/api/core/v1/persistent_volume.rs +++ b/src/v1_25/api/core/v1/persistent_volume.rs @@ -516,7 +516,7 @@ impl crate::ListableResource for PersistentVolume { } impl crate::Metadata for PersistentVolume { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_25/api/flowcontrol/v1beta1/flow_schema.rs b/src/v1_25/api/flowcontrol/v1beta1/flow_schema.rs index 1d0546a710..e74328c4ec 100644 --- a/src/v1_25/api/flowcontrol/v1beta1/flow_schema.rs +++ b/src/v1_25/api/flowcontrol/v1beta1/flow_schema.rs @@ -516,7 +516,7 @@ impl crate::ListableResource for FlowSchema { } impl crate::Metadata for FlowSchema { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_25/api/flowcontrol/v1beta1/priority_level_configuration.rs b/src/v1_25/api/flowcontrol/v1beta1/priority_level_configuration.rs index 4cbe999e32..d4f148709d 100644 --- a/src/v1_25/api/flowcontrol/v1beta1/priority_level_configuration.rs +++ b/src/v1_25/api/flowcontrol/v1beta1/priority_level_configuration.rs @@ -516,7 +516,7 @@ impl crate::ListableResource for PriorityLevelConfiguration { } impl crate::Metadata for PriorityLevelConfiguration { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_25/api/flowcontrol/v1beta2/flow_schema.rs b/src/v1_25/api/flowcontrol/v1beta2/flow_schema.rs index 71d13230a3..7efa4158ac 100644 --- a/src/v1_25/api/flowcontrol/v1beta2/flow_schema.rs +++ b/src/v1_25/api/flowcontrol/v1beta2/flow_schema.rs @@ -516,7 +516,7 @@ impl crate::ListableResource for FlowSchema { } impl crate::Metadata for FlowSchema { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_25/api/flowcontrol/v1beta2/priority_level_configuration.rs b/src/v1_25/api/flowcontrol/v1beta2/priority_level_configuration.rs index 91ebc9f1f5..982df6b6a7 100644 --- a/src/v1_25/api/flowcontrol/v1beta2/priority_level_configuration.rs +++ b/src/v1_25/api/flowcontrol/v1beta2/priority_level_configuration.rs @@ -516,7 +516,7 @@ impl crate::ListableResource for PriorityLevelConfiguration { } impl crate::Metadata for PriorityLevelConfiguration { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_25/api/networking/v1/ingress_class.rs b/src/v1_25/api/networking/v1/ingress_class.rs index d3ab7820c7..657d7e9809 100644 --- a/src/v1_25/api/networking/v1/ingress_class.rs +++ b/src/v1_25/api/networking/v1/ingress_class.rs @@ -360,7 +360,7 @@ impl crate::ListableResource for IngressClass { } impl crate::Metadata for IngressClass { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_25/api/networking/v1alpha1/cluster_cidr.rs b/src/v1_25/api/networking/v1alpha1/cluster_cidr.rs index bead0f8dcf..ad340d91b8 100644 --- a/src/v1_25/api/networking/v1alpha1/cluster_cidr.rs +++ b/src/v1_25/api/networking/v1alpha1/cluster_cidr.rs @@ -360,7 +360,7 @@ impl crate::ListableResource for ClusterCIDR { } impl crate::Metadata for ClusterCIDR { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_25/api/node/v1/runtime_class.rs b/src/v1_25/api/node/v1/runtime_class.rs index 470b9f902d..0fb771fb5f 100644 --- a/src/v1_25/api/node/v1/runtime_class.rs +++ b/src/v1_25/api/node/v1/runtime_class.rs @@ -367,7 +367,7 @@ impl crate::ListableResource for RuntimeClass { } impl crate::Metadata for RuntimeClass { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_25/api/policy/v1/eviction.rs b/src/v1_25/api/policy/v1/eviction.rs index e92ebe2f3a..fe63d30d4c 100644 --- a/src/v1_25/api/policy/v1/eviction.rs +++ b/src/v1_25/api/policy/v1/eviction.rs @@ -71,7 +71,7 @@ impl crate::Resource for Eviction { } impl crate::Metadata for Eviction { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::SubObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_25/api/rbac/v1/cluster_role.rs b/src/v1_25/api/rbac/v1/cluster_role.rs index 8336e14c92..541d57c8ee 100644 --- a/src/v1_25/api/rbac/v1/cluster_role.rs +++ b/src/v1_25/api/rbac/v1/cluster_role.rs @@ -363,7 +363,7 @@ impl crate::ListableResource for ClusterRole { } impl crate::Metadata for ClusterRole { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_25/api/rbac/v1/cluster_role_binding.rs b/src/v1_25/api/rbac/v1/cluster_role_binding.rs index 0162a1128e..0f02a028d1 100644 --- a/src/v1_25/api/rbac/v1/cluster_role_binding.rs +++ b/src/v1_25/api/rbac/v1/cluster_role_binding.rs @@ -363,7 +363,7 @@ impl crate::ListableResource for ClusterRoleBinding { } impl crate::Metadata for ClusterRoleBinding { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_25/api/scheduling/v1/priority_class.rs b/src/v1_25/api/scheduling/v1/priority_class.rs index f13f535704..3cbab648f7 100644 --- a/src/v1_25/api/scheduling/v1/priority_class.rs +++ b/src/v1_25/api/scheduling/v1/priority_class.rs @@ -369,7 +369,7 @@ impl crate::ListableResource for PriorityClass { } impl crate::Metadata for PriorityClass { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_25/api/storage/v1/csi_driver.rs b/src/v1_25/api/storage/v1/csi_driver.rs index 0dc419fa28..841c350667 100644 --- a/src/v1_25/api/storage/v1/csi_driver.rs +++ b/src/v1_25/api/storage/v1/csi_driver.rs @@ -360,7 +360,7 @@ impl crate::ListableResource for CSIDriver { } impl crate::Metadata for CSIDriver { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_25/api/storage/v1/csi_node.rs b/src/v1_25/api/storage/v1/csi_node.rs index a514ce9bf0..2ae2dc489a 100644 --- a/src/v1_25/api/storage/v1/csi_node.rs +++ b/src/v1_25/api/storage/v1/csi_node.rs @@ -360,7 +360,7 @@ impl crate::ListableResource for CSINode { } impl crate::Metadata for CSINode { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_25/api/storage/v1/storage_class.rs b/src/v1_25/api/storage/v1/storage_class.rs index 2bf8e65456..e8e1996616 100644 --- a/src/v1_25/api/storage/v1/storage_class.rs +++ b/src/v1_25/api/storage/v1/storage_class.rs @@ -380,7 +380,7 @@ impl crate::ListableResource for StorageClass { } impl crate::Metadata for StorageClass { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_25/api/storage/v1/volume_attachment.rs b/src/v1_25/api/storage/v1/volume_attachment.rs index f6b6972639..51e070f07b 100644 --- a/src/v1_25/api/storage/v1/volume_attachment.rs +++ b/src/v1_25/api/storage/v1/volume_attachment.rs @@ -518,7 +518,7 @@ impl crate::ListableResource for VolumeAttachment { } impl crate::Metadata for VolumeAttachment { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_25/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition.rs b/src/v1_25/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition.rs index c05e8ea174..5ab4dfa8ca 100644 --- a/src/v1_25/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition.rs +++ b/src/v1_25/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition.rs @@ -516,7 +516,7 @@ impl crate::ListableResource for CustomResourceDefinition { } impl crate::Metadata for CustomResourceDefinition { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_25/apimachinery/pkg/apis/meta/v1/cluster_object_meta.rs b/src/v1_25/apimachinery/pkg/apis/meta/v1/cluster_object_meta.rs new file mode 100644 index 0000000000..5b7b4dade6 --- /dev/null +++ b/src/v1_25/apimachinery/pkg/apis/meta/v1/cluster_object_meta.rs @@ -0,0 +1,501 @@ +// Generated from definition io.k8s.apimachinery.pkg.apis.meta.v1.ClusterObjectMeta + +/// ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create. +#[derive(Clone, Debug, Default, PartialEq)] +pub struct ClusterObjectMeta { + /// Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations + pub annotations: Option>, + + /// CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC. + /// + /// Populated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + pub creation_timestamp: Option, + + /// Number of seconds allowed for this object to gracefully terminate before it will be removed from the system. Only set when deletionTimestamp is also set. May only be shortened. Read-only. + pub deletion_grace_period_seconds: Option, + + /// DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This field is set by the server when a graceful deletion is requested by the user, and is not directly settable by a client. The resource is expected to be deleted (no longer visible from resource lists, and not reachable by name) after the time in this field, once the finalizers list is empty. As long as the finalizers list contains items, deletion is blocked. Once the deletionTimestamp is set, this value may not be unset or be set further into the future, although it may be shortened or the resource may be deleted prior to this time. For example, a user may request that a pod is deleted in 30 seconds. The Kubelet will react by sending a graceful termination signal to the containers in the pod. After that 30 seconds, the Kubelet will send a hard termination signal (SIGKILL) to the container and after cleanup, remove the pod from the API. In the presence of network partitions, this object may still exist after this timestamp, until an administrator or automated process can determine the resource is fully terminated. If not set, graceful deletion of the object has not been requested. + /// + /// Populated by the system when a graceful deletion is requested. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + pub deletion_timestamp: Option, + + /// Must be empty before the object is deleted from the registry. Each entry is an identifier for the responsible component that will remove the entry from the list. If the deletionTimestamp of the object is non-nil, entries in this list can only be removed. Finalizers may be processed and removed in any order. Order is NOT enforced because it introduces significant risk of stuck finalizers. finalizers is a shared field, any actor with permission can reorder it. If the finalizer list is processed in order, then this can lead to a situation in which the component responsible for the first finalizer in the list is waiting for a signal (field value, external system, or other) produced by a component responsible for a finalizer later in the list, resulting in a deadlock. Without enforced ordering finalizers are free to order amongst themselves and are not vulnerable to ordering changes in the list. + pub finalizers: Option>, + + /// GenerateName is an optional prefix, used by the server, to generate a unique name ONLY IF the Name field has not been provided. If this field is used, the name returned to the client will be different than the name passed. This value will also be combined with a unique suffix. The provided value has the same validation rules as the Name field, and may be truncated by the length of the suffix required to make the value unique on the server. + /// + /// If this field is specified and the generated name exists, the server will return a 409. + /// + /// Applied only if Name is not specified. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#idempotency + pub generate_name: Option, + + /// A sequence number representing a specific generation of the desired state. Populated by the system. Read-only. + pub generation: Option, + + /// Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels + pub labels: Option>, + + /// ManagedFields maps workflow-id and version to the set of fields that are managed by that workflow. This is mostly for internal housekeeping, and users typically shouldn't need to set or understand this field. A workflow can be the user's name, a controller's name, or the name of a specific apply path like "ci-cd". The set of fields is always in the version that the workflow used when modifying the object. + pub managed_fields: Option>, + + /// Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names + pub name: Option, + + /// List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller. + pub owner_references: Option>, + + /// An opaque value that represents the internal version of this object that can be used by clients to determine when objects have changed. May be used for optimistic concurrency, change detection, and the watch operation on a resource or set of resources. Clients must treat these values as opaque and passed unmodified back to the server. They may only be valid for a particular resource or set of resources. + /// + /// Populated by the system. Read-only. Value must be treated as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency + pub resource_version: Option, + + /// Deprecated: selfLink is a legacy read-only field that is no longer populated by the system. + pub self_link: Option, + + /// UID is the unique in time and space value for this object. It is typically generated by the server on successful creation of a resource and is not allowed to change on PUT operations. + /// + /// Populated by the system. Read-only. More info: http://kubernetes.io/docs/user-guide/identifiers#uids + pub uid: Option, +} + +impl crate::DeepMerge for ClusterObjectMeta { + fn merge_from(&mut self, other: Self) { + crate::DeepMerge::merge_from(&mut self.annotations, other.annotations); + crate::DeepMerge::merge_from(&mut self.creation_timestamp, other.creation_timestamp); + crate::DeepMerge::merge_from(&mut self.deletion_grace_period_seconds, other.deletion_grace_period_seconds); + crate::DeepMerge::merge_from(&mut self.deletion_timestamp, other.deletion_timestamp); + crate::DeepMerge::merge_from(&mut self.finalizers, other.finalizers); + crate::DeepMerge::merge_from(&mut self.generate_name, other.generate_name); + crate::DeepMerge::merge_from(&mut self.generation, other.generation); + crate::DeepMerge::merge_from(&mut self.labels, other.labels); + crate::DeepMerge::merge_from(&mut self.managed_fields, other.managed_fields); + crate::DeepMerge::merge_from(&mut self.name, other.name); + crate::DeepMerge::merge_from(&mut self.owner_references, other.owner_references); + crate::DeepMerge::merge_from(&mut self.resource_version, other.resource_version); + crate::DeepMerge::merge_from(&mut self.self_link, other.self_link); + crate::DeepMerge::merge_from(&mut self.uid, other.uid); + } +} + +impl<'de> crate::serde::Deserialize<'de> for ClusterObjectMeta { + fn deserialize(deserializer: D) -> Result where D: crate::serde::Deserializer<'de> { + #[allow(non_camel_case_types)] + enum Field { + Key_annotations, + Key_creation_timestamp, + Key_deletion_grace_period_seconds, + Key_deletion_timestamp, + Key_finalizers, + Key_generate_name, + Key_generation, + Key_labels, + Key_managed_fields, + Key_name, + Key_owner_references, + Key_resource_version, + Key_self_link, + Key_uid, + Other, + } + + impl<'de> crate::serde::Deserialize<'de> for Field { + fn deserialize(deserializer: D) -> Result where D: crate::serde::Deserializer<'de> { + struct Visitor; + + impl<'de> crate::serde::de::Visitor<'de> for Visitor { + type Value = Field; + + fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.write_str("field identifier") + } + + fn visit_str(self, v: &str) -> Result where E: crate::serde::de::Error { + Ok(match v { + "annotations" => Field::Key_annotations, + "creationTimestamp" => Field::Key_creation_timestamp, + "deletionGracePeriodSeconds" => Field::Key_deletion_grace_period_seconds, + "deletionTimestamp" => Field::Key_deletion_timestamp, + "finalizers" => Field::Key_finalizers, + "generateName" => Field::Key_generate_name, + "generation" => Field::Key_generation, + "labels" => Field::Key_labels, + "managedFields" => Field::Key_managed_fields, + "name" => Field::Key_name, + "ownerReferences" => Field::Key_owner_references, + "resourceVersion" => Field::Key_resource_version, + "selfLink" => Field::Key_self_link, + "uid" => Field::Key_uid, + _ => Field::Other, + }) + } + } + + deserializer.deserialize_identifier(Visitor) + } + } + + struct Visitor; + + impl<'de> crate::serde::de::Visitor<'de> for Visitor { + type Value = ClusterObjectMeta; + + fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.write_str("ClusterObjectMeta") + } + + fn visit_map(self, mut map: A) -> Result where A: crate::serde::de::MapAccess<'de> { + let mut value_annotations: Option> = None; + let mut value_creation_timestamp: Option = None; + let mut value_deletion_grace_period_seconds: Option = None; + let mut value_deletion_timestamp: Option = None; + let mut value_finalizers: Option> = None; + let mut value_generate_name: Option = None; + let mut value_generation: Option = None; + let mut value_labels: Option> = None; + let mut value_managed_fields: Option> = None; + let mut value_name: Option = None; + let mut value_owner_references: Option> = None; + let mut value_resource_version: Option = None; + let mut value_self_link: Option = None; + let mut value_uid: Option = None; + + while let Some(key) = crate::serde::de::MapAccess::next_key::(&mut map)? { + match key { + Field::Key_annotations => value_annotations = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_creation_timestamp => value_creation_timestamp = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_deletion_grace_period_seconds => value_deletion_grace_period_seconds = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_deletion_timestamp => value_deletion_timestamp = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_finalizers => value_finalizers = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_generate_name => value_generate_name = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_generation => value_generation = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_labels => value_labels = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_managed_fields => value_managed_fields = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_name => value_name = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_owner_references => value_owner_references = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_resource_version => value_resource_version = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_self_link => value_self_link = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_uid => value_uid = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Other => { let _: crate::serde::de::IgnoredAny = crate::serde::de::MapAccess::next_value(&mut map)?; }, + } + } + + Ok(ClusterObjectMeta { + annotations: value_annotations, + creation_timestamp: value_creation_timestamp, + deletion_grace_period_seconds: value_deletion_grace_period_seconds, + deletion_timestamp: value_deletion_timestamp, + finalizers: value_finalizers, + generate_name: value_generate_name, + generation: value_generation, + labels: value_labels, + managed_fields: value_managed_fields, + name: value_name, + owner_references: value_owner_references, + resource_version: value_resource_version, + self_link: value_self_link, + uid: value_uid, + }) + } + } + + deserializer.deserialize_struct( + "ClusterObjectMeta", + &[ + "annotations", + "creationTimestamp", + "deletionGracePeriodSeconds", + "deletionTimestamp", + "finalizers", + "generateName", + "generation", + "labels", + "managedFields", + "name", + "ownerReferences", + "resourceVersion", + "selfLink", + "uid", + ], + Visitor, + ) + } +} + +impl crate::serde::Serialize for ClusterObjectMeta { + fn serialize(&self, serializer: S) -> Result where S: crate::serde::Serializer { + let mut state = serializer.serialize_struct( + "ClusterObjectMeta", + self.annotations.as_ref().map_or(0, |_| 1) + + self.creation_timestamp.as_ref().map_or(0, |_| 1) + + self.deletion_grace_period_seconds.as_ref().map_or(0, |_| 1) + + self.deletion_timestamp.as_ref().map_or(0, |_| 1) + + self.finalizers.as_ref().map_or(0, |_| 1) + + self.generate_name.as_ref().map_or(0, |_| 1) + + self.generation.as_ref().map_or(0, |_| 1) + + self.labels.as_ref().map_or(0, |_| 1) + + self.managed_fields.as_ref().map_or(0, |_| 1) + + self.name.as_ref().map_or(0, |_| 1) + + self.owner_references.as_ref().map_or(0, |_| 1) + + self.resource_version.as_ref().map_or(0, |_| 1) + + self.self_link.as_ref().map_or(0, |_| 1) + + self.uid.as_ref().map_or(0, |_| 1), + )?; + if let Some(value) = &self.annotations { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "annotations", value)?; + } + if let Some(value) = &self.creation_timestamp { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "creationTimestamp", value)?; + } + if let Some(value) = &self.deletion_grace_period_seconds { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "deletionGracePeriodSeconds", value)?; + } + if let Some(value) = &self.deletion_timestamp { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "deletionTimestamp", value)?; + } + if let Some(value) = &self.finalizers { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "finalizers", value)?; + } + if let Some(value) = &self.generate_name { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "generateName", value)?; + } + if let Some(value) = &self.generation { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "generation", value)?; + } + if let Some(value) = &self.labels { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "labels", value)?; + } + if let Some(value) = &self.managed_fields { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "managedFields", value)?; + } + if let Some(value) = &self.name { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "name", value)?; + } + if let Some(value) = &self.owner_references { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "ownerReferences", value)?; + } + if let Some(value) = &self.resource_version { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "resourceVersion", value)?; + } + if let Some(value) = &self.self_link { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "selfLink", value)?; + } + if let Some(value) = &self.uid { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "uid", value)?; + } + crate::serde::ser::SerializeStruct::end(state) + } +} + +#[cfg(feature = "schemars")] +impl crate::schemars::JsonSchema for ClusterObjectMeta { + fn schema_name() -> String { + "io.k8s.apimachinery.pkg.apis.meta.v1.ClusterObjectMeta".to_owned() + } + + fn json_schema(__gen: &mut crate::schemars::gen::SchemaGenerator) -> crate::schemars::schema::Schema { + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Object))), + object: Some(Box::new(crate::schemars::schema::ObjectValidation { + properties: [ + ( + "annotations".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Object))), + object: Some(Box::new(crate::schemars::schema::ObjectValidation { + additional_properties: Some(Box::new( + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }) + )), + ..Default::default() + })), + ..Default::default() + }), + ), + ( + "creationTimestamp".to_owned(), + { + let mut schema_obj = __gen.subschema_for::().into_object(); + schema_obj.metadata = Some(Box::new(crate::schemars::schema::Metadata { + description: Some("CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC.\n\nPopulated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata".to_owned()), + ..Default::default() + })); + crate::schemars::schema::Schema::Object(schema_obj) + }, + ), + ( + "deletionGracePeriodSeconds".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Number of seconds allowed for this object to gracefully terminate before it will be removed from the system. Only set when deletionTimestamp is also set. May only be shortened. Read-only.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Integer))), + format: Some("int64".to_owned()), + ..Default::default() + }), + ), + ( + "deletionTimestamp".to_owned(), + { + let mut schema_obj = __gen.subschema_for::().into_object(); + schema_obj.metadata = Some(Box::new(crate::schemars::schema::Metadata { + description: Some("DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This field is set by the server when a graceful deletion is requested by the user, and is not directly settable by a client. The resource is expected to be deleted (no longer visible from resource lists, and not reachable by name) after the time in this field, once the finalizers list is empty. As long as the finalizers list contains items, deletion is blocked. Once the deletionTimestamp is set, this value may not be unset or be set further into the future, although it may be shortened or the resource may be deleted prior to this time. For example, a user may request that a pod is deleted in 30 seconds. The Kubelet will react by sending a graceful termination signal to the containers in the pod. After that 30 seconds, the Kubelet will send a hard termination signal (SIGKILL) to the container and after cleanup, remove the pod from the API. In the presence of network partitions, this object may still exist after this timestamp, until an administrator or automated process can determine the resource is fully terminated. If not set, graceful deletion of the object has not been requested.\n\nPopulated by the system when a graceful deletion is requested. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata".to_owned()), + ..Default::default() + })); + crate::schemars::schema::Schema::Object(schema_obj) + }, + ), + ( + "finalizers".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Must be empty before the object is deleted from the registry. Each entry is an identifier for the responsible component that will remove the entry from the list. If the deletionTimestamp of the object is non-nil, entries in this list can only be removed. Finalizers may be processed and removed in any order. Order is NOT enforced because it introduces significant risk of stuck finalizers. finalizers is a shared field, any actor with permission can reorder it. If the finalizer list is processed in order, then this can lead to a situation in which the component responsible for the first finalizer in the list is waiting for a signal (field value, external system, or other) produced by a component responsible for a finalizer later in the list, resulting in a deadlock. Without enforced ordering finalizers are free to order amongst themselves and are not vulnerable to ordering changes in the list.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Array))), + array: Some(Box::new(crate::schemars::schema::ArrayValidation { + items: Some(crate::schemars::schema::SingleOrVec::Single(Box::new( + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }) + ))), + ..Default::default() + })), + ..Default::default() + }), + ), + ( + "generateName".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("GenerateName is an optional prefix, used by the server, to generate a unique name ONLY IF the Name field has not been provided. If this field is used, the name returned to the client will be different than the name passed. This value will also be combined with a unique suffix. The provided value has the same validation rules as the Name field, and may be truncated by the length of the suffix required to make the value unique on the server.\n\nIf this field is specified and the generated name exists, the server will return a 409.\n\nApplied only if Name is not specified. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#idempotency".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ( + "generation".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("A sequence number representing a specific generation of the desired state. Populated by the system. Read-only.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Integer))), + format: Some("int64".to_owned()), + ..Default::default() + }), + ), + ( + "labels".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Object))), + object: Some(Box::new(crate::schemars::schema::ObjectValidation { + additional_properties: Some(Box::new( + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }) + )), + ..Default::default() + })), + ..Default::default() + }), + ), + ( + "managedFields".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("ManagedFields maps workflow-id and version to the set of fields that are managed by that workflow. This is mostly for internal housekeeping, and users typically shouldn't need to set or understand this field. A workflow can be the user's name, a controller's name, or the name of a specific apply path like \"ci-cd\". The set of fields is always in the version that the workflow used when modifying the object.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Array))), + array: Some(Box::new(crate::schemars::schema::ArrayValidation { + items: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(__gen.subschema_for::()))), + ..Default::default() + })), + ..Default::default() + }), + ), + ( + "name".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ( + "ownerReferences".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Array))), + array: Some(Box::new(crate::schemars::schema::ArrayValidation { + items: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(__gen.subschema_for::()))), + ..Default::default() + })), + ..Default::default() + }), + ), + ( + "resourceVersion".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("An opaque value that represents the internal version of this object that can be used by clients to determine when objects have changed. May be used for optimistic concurrency, change detection, and the watch operation on a resource or set of resources. Clients must treat these values as opaque and passed unmodified back to the server. They may only be valid for a particular resource or set of resources.\n\nPopulated by the system. Read-only. Value must be treated as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ( + "selfLink".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Deprecated: selfLink is a legacy read-only field that is no longer populated by the system.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ( + "uid".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("UID is the unique in time and space value for this object. It is typically generated by the server on successful creation of a resource and is not allowed to change on PUT operations.\n\nPopulated by the system. Read-only. More info: http://kubernetes.io/docs/user-guide/identifiers#uids".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ].into(), + ..Default::default() + })), + ..Default::default() + }) + } +} diff --git a/src/v1_25/apimachinery/pkg/apis/meta/v1/mod.rs b/src/v1_25/apimachinery/pkg/apis/meta/v1/mod.rs index 9424127582..221a712e6d 100644 --- a/src/v1_25/apimachinery/pkg/apis/meta/v1/mod.rs +++ b/src/v1_25/apimachinery/pkg/apis/meta/v1/mod.rs @@ -14,6 +14,9 @@ pub use self::api_resource_list::APIResourceList; mod api_versions; pub use self::api_versions::APIVersions; +mod cluster_object_meta; +pub use self::cluster_object_meta::ClusterObjectMeta; + mod condition; pub use self::condition::Condition; @@ -65,6 +68,9 @@ pub use self::status_cause::StatusCause; mod status_details; pub use self::status_details::StatusDetails; +mod sub_object_meta; +pub use self::sub_object_meta::SubObjectMeta; + mod time; pub use self::time::Time; diff --git a/src/v1_25/apimachinery/pkg/apis/meta/v1/object_meta.rs b/src/v1_25/apimachinery/pkg/apis/meta/v1/object_meta.rs index 8d7007f3a3..bb215ca04f 100644 --- a/src/v1_25/apimachinery/pkg/apis/meta/v1/object_meta.rs +++ b/src/v1_25/apimachinery/pkg/apis/meta/v1/object_meta.rs @@ -44,7 +44,7 @@ pub struct ObjectMeta { /// Namespace defines the space within which each name must be unique. An empty namespace is equivalent to the "default" namespace, but "default" is the canonical representation. Not all objects are required to be scoped to a namespace - the value of this field for those objects will be empty. /// /// Must be a DNS_LABEL. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/namespaces - pub namespace: Option, + pub namespace: String, /// List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller. pub owner_references: Option>, @@ -200,7 +200,7 @@ impl<'de> crate::serde::Deserialize<'de> for ObjectMeta { labels: value_labels, managed_fields: value_managed_fields, name: value_name, - namespace: value_namespace, + namespace: value_namespace.unwrap_or_default(), owner_references: value_owner_references, resource_version: value_resource_version, self_link: value_self_link, @@ -237,6 +237,7 @@ impl crate::serde::Serialize for ObjectMeta { fn serialize(&self, serializer: S) -> Result where S: crate::serde::Serializer { let mut state = serializer.serialize_struct( "ObjectMeta", + 1 + self.annotations.as_ref().map_or(0, |_| 1) + self.creation_timestamp.as_ref().map_or(0, |_| 1) + self.deletion_grace_period_seconds.as_ref().map_or(0, |_| 1) + @@ -247,7 +248,6 @@ impl crate::serde::Serialize for ObjectMeta { self.labels.as_ref().map_or(0, |_| 1) + self.managed_fields.as_ref().map_or(0, |_| 1) + self.name.as_ref().map_or(0, |_| 1) + - self.namespace.as_ref().map_or(0, |_| 1) + self.owner_references.as_ref().map_or(0, |_| 1) + self.resource_version.as_ref().map_or(0, |_| 1) + self.self_link.as_ref().map_or(0, |_| 1) + @@ -283,9 +283,7 @@ impl crate::serde::Serialize for ObjectMeta { if let Some(value) = &self.name { crate::serde::ser::SerializeStruct::serialize_field(&mut state, "name", value)?; } - if let Some(value) = &self.namespace { - crate::serde::ser::SerializeStruct::serialize_field(&mut state, "namespace", value)?; - } + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "namespace", &self.namespace)?; if let Some(value) = &self.owner_references { crate::serde::ser::SerializeStruct::serialize_field(&mut state, "ownerReferences", value)?; } @@ -520,6 +518,9 @@ impl crate::schemars::JsonSchema for ObjectMeta { }), ), ].into(), + required: [ + "namespace".to_owned(), + ].into(), ..Default::default() })), ..Default::default() diff --git a/src/v1_25/apimachinery/pkg/apis/meta/v1/sub_object_meta.rs b/src/v1_25/apimachinery/pkg/apis/meta/v1/sub_object_meta.rs new file mode 100644 index 0000000000..ed66c322b5 --- /dev/null +++ b/src/v1_25/apimachinery/pkg/apis/meta/v1/sub_object_meta.rs @@ -0,0 +1,528 @@ +// Generated from definition io.k8s.apimachinery.pkg.apis.meta.v1.SubObjectMeta + +/// ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create. +#[derive(Clone, Debug, Default, PartialEq)] +pub struct SubObjectMeta { + /// Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations + pub annotations: Option>, + + /// CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC. + /// + /// Populated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + pub creation_timestamp: Option, + + /// Number of seconds allowed for this object to gracefully terminate before it will be removed from the system. Only set when deletionTimestamp is also set. May only be shortened. Read-only. + pub deletion_grace_period_seconds: Option, + + /// DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This field is set by the server when a graceful deletion is requested by the user, and is not directly settable by a client. The resource is expected to be deleted (no longer visible from resource lists, and not reachable by name) after the time in this field, once the finalizers list is empty. As long as the finalizers list contains items, deletion is blocked. Once the deletionTimestamp is set, this value may not be unset or be set further into the future, although it may be shortened or the resource may be deleted prior to this time. For example, a user may request that a pod is deleted in 30 seconds. The Kubelet will react by sending a graceful termination signal to the containers in the pod. After that 30 seconds, the Kubelet will send a hard termination signal (SIGKILL) to the container and after cleanup, remove the pod from the API. In the presence of network partitions, this object may still exist after this timestamp, until an administrator or automated process can determine the resource is fully terminated. If not set, graceful deletion of the object has not been requested. + /// + /// Populated by the system when a graceful deletion is requested. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + pub deletion_timestamp: Option, + + /// Must be empty before the object is deleted from the registry. Each entry is an identifier for the responsible component that will remove the entry from the list. If the deletionTimestamp of the object is non-nil, entries in this list can only be removed. Finalizers may be processed and removed in any order. Order is NOT enforced because it introduces significant risk of stuck finalizers. finalizers is a shared field, any actor with permission can reorder it. If the finalizer list is processed in order, then this can lead to a situation in which the component responsible for the first finalizer in the list is waiting for a signal (field value, external system, or other) produced by a component responsible for a finalizer later in the list, resulting in a deadlock. Without enforced ordering finalizers are free to order amongst themselves and are not vulnerable to ordering changes in the list. + pub finalizers: Option>, + + /// GenerateName is an optional prefix, used by the server, to generate a unique name ONLY IF the Name field has not been provided. If this field is used, the name returned to the client will be different than the name passed. This value will also be combined with a unique suffix. The provided value has the same validation rules as the Name field, and may be truncated by the length of the suffix required to make the value unique on the server. + /// + /// If this field is specified and the generated name exists, the server will return a 409. + /// + /// Applied only if Name is not specified. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#idempotency + pub generate_name: Option, + + /// A sequence number representing a specific generation of the desired state. Populated by the system. Read-only. + pub generation: Option, + + /// Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels + pub labels: Option>, + + /// ManagedFields maps workflow-id and version to the set of fields that are managed by that workflow. This is mostly for internal housekeeping, and users typically shouldn't need to set or understand this field. A workflow can be the user's name, a controller's name, or the name of a specific apply path like "ci-cd". The set of fields is always in the version that the workflow used when modifying the object. + pub managed_fields: Option>, + + /// Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names + pub name: Option, + + /// Namespace defines the space within which each name must be unique. An empty namespace is equivalent to the "default" namespace, but "default" is the canonical representation. Not all objects are required to be scoped to a namespace - the value of this field for those objects will be empty. + /// + /// Must be a DNS_LABEL. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/namespaces + pub namespace: Option, + + /// List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller. + pub owner_references: Option>, + + /// An opaque value that represents the internal version of this object that can be used by clients to determine when objects have changed. May be used for optimistic concurrency, change detection, and the watch operation on a resource or set of resources. Clients must treat these values as opaque and passed unmodified back to the server. They may only be valid for a particular resource or set of resources. + /// + /// Populated by the system. Read-only. Value must be treated as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency + pub resource_version: Option, + + /// Deprecated: selfLink is a legacy read-only field that is no longer populated by the system. + pub self_link: Option, + + /// UID is the unique in time and space value for this object. It is typically generated by the server on successful creation of a resource and is not allowed to change on PUT operations. + /// + /// Populated by the system. Read-only. More info: http://kubernetes.io/docs/user-guide/identifiers#uids + pub uid: Option, +} + +impl crate::DeepMerge for SubObjectMeta { + fn merge_from(&mut self, other: Self) { + crate::DeepMerge::merge_from(&mut self.annotations, other.annotations); + crate::DeepMerge::merge_from(&mut self.creation_timestamp, other.creation_timestamp); + crate::DeepMerge::merge_from(&mut self.deletion_grace_period_seconds, other.deletion_grace_period_seconds); + crate::DeepMerge::merge_from(&mut self.deletion_timestamp, other.deletion_timestamp); + crate::DeepMerge::merge_from(&mut self.finalizers, other.finalizers); + crate::DeepMerge::merge_from(&mut self.generate_name, other.generate_name); + crate::DeepMerge::merge_from(&mut self.generation, other.generation); + crate::DeepMerge::merge_from(&mut self.labels, other.labels); + crate::DeepMerge::merge_from(&mut self.managed_fields, other.managed_fields); + crate::DeepMerge::merge_from(&mut self.name, other.name); + crate::DeepMerge::merge_from(&mut self.namespace, other.namespace); + crate::DeepMerge::merge_from(&mut self.owner_references, other.owner_references); + crate::DeepMerge::merge_from(&mut self.resource_version, other.resource_version); + crate::DeepMerge::merge_from(&mut self.self_link, other.self_link); + crate::DeepMerge::merge_from(&mut self.uid, other.uid); + } +} + +impl<'de> crate::serde::Deserialize<'de> for SubObjectMeta { + fn deserialize(deserializer: D) -> Result where D: crate::serde::Deserializer<'de> { + #[allow(non_camel_case_types)] + enum Field { + Key_annotations, + Key_creation_timestamp, + Key_deletion_grace_period_seconds, + Key_deletion_timestamp, + Key_finalizers, + Key_generate_name, + Key_generation, + Key_labels, + Key_managed_fields, + Key_name, + Key_namespace, + Key_owner_references, + Key_resource_version, + Key_self_link, + Key_uid, + Other, + } + + impl<'de> crate::serde::Deserialize<'de> for Field { + fn deserialize(deserializer: D) -> Result where D: crate::serde::Deserializer<'de> { + struct Visitor; + + impl<'de> crate::serde::de::Visitor<'de> for Visitor { + type Value = Field; + + fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.write_str("field identifier") + } + + fn visit_str(self, v: &str) -> Result where E: crate::serde::de::Error { + Ok(match v { + "annotations" => Field::Key_annotations, + "creationTimestamp" => Field::Key_creation_timestamp, + "deletionGracePeriodSeconds" => Field::Key_deletion_grace_period_seconds, + "deletionTimestamp" => Field::Key_deletion_timestamp, + "finalizers" => Field::Key_finalizers, + "generateName" => Field::Key_generate_name, + "generation" => Field::Key_generation, + "labels" => Field::Key_labels, + "managedFields" => Field::Key_managed_fields, + "name" => Field::Key_name, + "namespace" => Field::Key_namespace, + "ownerReferences" => Field::Key_owner_references, + "resourceVersion" => Field::Key_resource_version, + "selfLink" => Field::Key_self_link, + "uid" => Field::Key_uid, + _ => Field::Other, + }) + } + } + + deserializer.deserialize_identifier(Visitor) + } + } + + struct Visitor; + + impl<'de> crate::serde::de::Visitor<'de> for Visitor { + type Value = SubObjectMeta; + + fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.write_str("SubObjectMeta") + } + + fn visit_map(self, mut map: A) -> Result where A: crate::serde::de::MapAccess<'de> { + let mut value_annotations: Option> = None; + let mut value_creation_timestamp: Option = None; + let mut value_deletion_grace_period_seconds: Option = None; + let mut value_deletion_timestamp: Option = None; + let mut value_finalizers: Option> = None; + let mut value_generate_name: Option = None; + let mut value_generation: Option = None; + let mut value_labels: Option> = None; + let mut value_managed_fields: Option> = None; + let mut value_name: Option = None; + let mut value_namespace: Option = None; + let mut value_owner_references: Option> = None; + let mut value_resource_version: Option = None; + let mut value_self_link: Option = None; + let mut value_uid: Option = None; + + while let Some(key) = crate::serde::de::MapAccess::next_key::(&mut map)? { + match key { + Field::Key_annotations => value_annotations = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_creation_timestamp => value_creation_timestamp = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_deletion_grace_period_seconds => value_deletion_grace_period_seconds = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_deletion_timestamp => value_deletion_timestamp = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_finalizers => value_finalizers = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_generate_name => value_generate_name = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_generation => value_generation = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_labels => value_labels = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_managed_fields => value_managed_fields = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_name => value_name = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_namespace => value_namespace = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_owner_references => value_owner_references = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_resource_version => value_resource_version = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_self_link => value_self_link = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_uid => value_uid = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Other => { let _: crate::serde::de::IgnoredAny = crate::serde::de::MapAccess::next_value(&mut map)?; }, + } + } + + Ok(SubObjectMeta { + annotations: value_annotations, + creation_timestamp: value_creation_timestamp, + deletion_grace_period_seconds: value_deletion_grace_period_seconds, + deletion_timestamp: value_deletion_timestamp, + finalizers: value_finalizers, + generate_name: value_generate_name, + generation: value_generation, + labels: value_labels, + managed_fields: value_managed_fields, + name: value_name, + namespace: value_namespace, + owner_references: value_owner_references, + resource_version: value_resource_version, + self_link: value_self_link, + uid: value_uid, + }) + } + } + + deserializer.deserialize_struct( + "SubObjectMeta", + &[ + "annotations", + "creationTimestamp", + "deletionGracePeriodSeconds", + "deletionTimestamp", + "finalizers", + "generateName", + "generation", + "labels", + "managedFields", + "name", + "namespace", + "ownerReferences", + "resourceVersion", + "selfLink", + "uid", + ], + Visitor, + ) + } +} + +impl crate::serde::Serialize for SubObjectMeta { + fn serialize(&self, serializer: S) -> Result where S: crate::serde::Serializer { + let mut state = serializer.serialize_struct( + "SubObjectMeta", + self.annotations.as_ref().map_or(0, |_| 1) + + self.creation_timestamp.as_ref().map_or(0, |_| 1) + + self.deletion_grace_period_seconds.as_ref().map_or(0, |_| 1) + + self.deletion_timestamp.as_ref().map_or(0, |_| 1) + + self.finalizers.as_ref().map_or(0, |_| 1) + + self.generate_name.as_ref().map_or(0, |_| 1) + + self.generation.as_ref().map_or(0, |_| 1) + + self.labels.as_ref().map_or(0, |_| 1) + + self.managed_fields.as_ref().map_or(0, |_| 1) + + self.name.as_ref().map_or(0, |_| 1) + + self.namespace.as_ref().map_or(0, |_| 1) + + self.owner_references.as_ref().map_or(0, |_| 1) + + self.resource_version.as_ref().map_or(0, |_| 1) + + self.self_link.as_ref().map_or(0, |_| 1) + + self.uid.as_ref().map_or(0, |_| 1), + )?; + if let Some(value) = &self.annotations { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "annotations", value)?; + } + if let Some(value) = &self.creation_timestamp { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "creationTimestamp", value)?; + } + if let Some(value) = &self.deletion_grace_period_seconds { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "deletionGracePeriodSeconds", value)?; + } + if let Some(value) = &self.deletion_timestamp { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "deletionTimestamp", value)?; + } + if let Some(value) = &self.finalizers { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "finalizers", value)?; + } + if let Some(value) = &self.generate_name { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "generateName", value)?; + } + if let Some(value) = &self.generation { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "generation", value)?; + } + if let Some(value) = &self.labels { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "labels", value)?; + } + if let Some(value) = &self.managed_fields { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "managedFields", value)?; + } + if let Some(value) = &self.name { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "name", value)?; + } + if let Some(value) = &self.namespace { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "namespace", value)?; + } + if let Some(value) = &self.owner_references { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "ownerReferences", value)?; + } + if let Some(value) = &self.resource_version { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "resourceVersion", value)?; + } + if let Some(value) = &self.self_link { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "selfLink", value)?; + } + if let Some(value) = &self.uid { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "uid", value)?; + } + crate::serde::ser::SerializeStruct::end(state) + } +} + +#[cfg(feature = "schemars")] +impl crate::schemars::JsonSchema for SubObjectMeta { + fn schema_name() -> String { + "io.k8s.apimachinery.pkg.apis.meta.v1.SubObjectMeta".to_owned() + } + + fn json_schema(__gen: &mut crate::schemars::gen::SchemaGenerator) -> crate::schemars::schema::Schema { + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Object))), + object: Some(Box::new(crate::schemars::schema::ObjectValidation { + properties: [ + ( + "annotations".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Object))), + object: Some(Box::new(crate::schemars::schema::ObjectValidation { + additional_properties: Some(Box::new( + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }) + )), + ..Default::default() + })), + ..Default::default() + }), + ), + ( + "creationTimestamp".to_owned(), + { + let mut schema_obj = __gen.subschema_for::().into_object(); + schema_obj.metadata = Some(Box::new(crate::schemars::schema::Metadata { + description: Some("CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC.\n\nPopulated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata".to_owned()), + ..Default::default() + })); + crate::schemars::schema::Schema::Object(schema_obj) + }, + ), + ( + "deletionGracePeriodSeconds".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Number of seconds allowed for this object to gracefully terminate before it will be removed from the system. Only set when deletionTimestamp is also set. May only be shortened. Read-only.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Integer))), + format: Some("int64".to_owned()), + ..Default::default() + }), + ), + ( + "deletionTimestamp".to_owned(), + { + let mut schema_obj = __gen.subschema_for::().into_object(); + schema_obj.metadata = Some(Box::new(crate::schemars::schema::Metadata { + description: Some("DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This field is set by the server when a graceful deletion is requested by the user, and is not directly settable by a client. The resource is expected to be deleted (no longer visible from resource lists, and not reachable by name) after the time in this field, once the finalizers list is empty. As long as the finalizers list contains items, deletion is blocked. Once the deletionTimestamp is set, this value may not be unset or be set further into the future, although it may be shortened or the resource may be deleted prior to this time. For example, a user may request that a pod is deleted in 30 seconds. The Kubelet will react by sending a graceful termination signal to the containers in the pod. After that 30 seconds, the Kubelet will send a hard termination signal (SIGKILL) to the container and after cleanup, remove the pod from the API. In the presence of network partitions, this object may still exist after this timestamp, until an administrator or automated process can determine the resource is fully terminated. If not set, graceful deletion of the object has not been requested.\n\nPopulated by the system when a graceful deletion is requested. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata".to_owned()), + ..Default::default() + })); + crate::schemars::schema::Schema::Object(schema_obj) + }, + ), + ( + "finalizers".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Must be empty before the object is deleted from the registry. Each entry is an identifier for the responsible component that will remove the entry from the list. If the deletionTimestamp of the object is non-nil, entries in this list can only be removed. Finalizers may be processed and removed in any order. Order is NOT enforced because it introduces significant risk of stuck finalizers. finalizers is a shared field, any actor with permission can reorder it. If the finalizer list is processed in order, then this can lead to a situation in which the component responsible for the first finalizer in the list is waiting for a signal (field value, external system, or other) produced by a component responsible for a finalizer later in the list, resulting in a deadlock. Without enforced ordering finalizers are free to order amongst themselves and are not vulnerable to ordering changes in the list.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Array))), + array: Some(Box::new(crate::schemars::schema::ArrayValidation { + items: Some(crate::schemars::schema::SingleOrVec::Single(Box::new( + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }) + ))), + ..Default::default() + })), + ..Default::default() + }), + ), + ( + "generateName".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("GenerateName is an optional prefix, used by the server, to generate a unique name ONLY IF the Name field has not been provided. If this field is used, the name returned to the client will be different than the name passed. This value will also be combined with a unique suffix. The provided value has the same validation rules as the Name field, and may be truncated by the length of the suffix required to make the value unique on the server.\n\nIf this field is specified and the generated name exists, the server will return a 409.\n\nApplied only if Name is not specified. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#idempotency".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ( + "generation".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("A sequence number representing a specific generation of the desired state. Populated by the system. Read-only.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Integer))), + format: Some("int64".to_owned()), + ..Default::default() + }), + ), + ( + "labels".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Object))), + object: Some(Box::new(crate::schemars::schema::ObjectValidation { + additional_properties: Some(Box::new( + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }) + )), + ..Default::default() + })), + ..Default::default() + }), + ), + ( + "managedFields".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("ManagedFields maps workflow-id and version to the set of fields that are managed by that workflow. This is mostly for internal housekeeping, and users typically shouldn't need to set or understand this field. A workflow can be the user's name, a controller's name, or the name of a specific apply path like \"ci-cd\". The set of fields is always in the version that the workflow used when modifying the object.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Array))), + array: Some(Box::new(crate::schemars::schema::ArrayValidation { + items: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(__gen.subschema_for::()))), + ..Default::default() + })), + ..Default::default() + }), + ), + ( + "name".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ( + "namespace".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Namespace defines the space within which each name must be unique. An empty namespace is equivalent to the \"default\" namespace, but \"default\" is the canonical representation. Not all objects are required to be scoped to a namespace - the value of this field for those objects will be empty.\n\nMust be a DNS_LABEL. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/namespaces".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ( + "ownerReferences".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Array))), + array: Some(Box::new(crate::schemars::schema::ArrayValidation { + items: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(__gen.subschema_for::()))), + ..Default::default() + })), + ..Default::default() + }), + ), + ( + "resourceVersion".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("An opaque value that represents the internal version of this object that can be used by clients to determine when objects have changed. May be used for optimistic concurrency, change detection, and the watch operation on a resource or set of resources. Clients must treat these values as opaque and passed unmodified back to the server. They may only be valid for a particular resource or set of resources.\n\nPopulated by the system. Read-only. Value must be treated as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ( + "selfLink".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Deprecated: selfLink is a legacy read-only field that is no longer populated by the system.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ( + "uid".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("UID is the unique in time and space value for this object. It is typically generated by the server on successful creation of a resource and is not allowed to change on PUT operations.\n\nPopulated by the system. Read-only. More info: http://kubernetes.io/docs/user-guide/identifiers#uids".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ].into(), + ..Default::default() + })), + ..Default::default() + }) + } +} diff --git a/src/v1_25/kube_aggregator/pkg/apis/apiregistration/v1/api_service.rs b/src/v1_25/kube_aggregator/pkg/apis/apiregistration/v1/api_service.rs index cff7ff1489..587f0a528a 100644 --- a/src/v1_25/kube_aggregator/pkg/apis/apiregistration/v1/api_service.rs +++ b/src/v1_25/kube_aggregator/pkg/apis/apiregistration/v1/api_service.rs @@ -516,7 +516,7 @@ impl crate::ListableResource for APIService { } impl crate::Metadata for APIService { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_26/api/admissionregistration/v1/mutating_webhook_configuration.rs b/src/v1_26/api/admissionregistration/v1/mutating_webhook_configuration.rs index cb8ec8f5af..e0f9531189 100644 --- a/src/v1_26/api/admissionregistration/v1/mutating_webhook_configuration.rs +++ b/src/v1_26/api/admissionregistration/v1/mutating_webhook_configuration.rs @@ -360,7 +360,7 @@ impl crate::ListableResource for MutatingWebhookConfiguration { } impl crate::Metadata for MutatingWebhookConfiguration { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_26/api/admissionregistration/v1/validating_webhook_configuration.rs b/src/v1_26/api/admissionregistration/v1/validating_webhook_configuration.rs index 4c520b0eeb..4cf73a02cb 100644 --- a/src/v1_26/api/admissionregistration/v1/validating_webhook_configuration.rs +++ b/src/v1_26/api/admissionregistration/v1/validating_webhook_configuration.rs @@ -360,7 +360,7 @@ impl crate::ListableResource for ValidatingWebhookConfiguration { } impl crate::Metadata for ValidatingWebhookConfiguration { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_26/api/admissionregistration/v1alpha1/validating_admission_policy.rs b/src/v1_26/api/admissionregistration/v1alpha1/validating_admission_policy.rs index 68e0f477b1..81e0c95a25 100644 --- a/src/v1_26/api/admissionregistration/v1alpha1/validating_admission_policy.rs +++ b/src/v1_26/api/admissionregistration/v1alpha1/validating_admission_policy.rs @@ -360,7 +360,7 @@ impl crate::ListableResource for ValidatingAdmissionPolicy { } impl crate::Metadata for ValidatingAdmissionPolicy { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_26/api/admissionregistration/v1alpha1/validating_admission_policy_binding.rs b/src/v1_26/api/admissionregistration/v1alpha1/validating_admission_policy_binding.rs index 4a9d872694..b5190845dd 100644 --- a/src/v1_26/api/admissionregistration/v1alpha1/validating_admission_policy_binding.rs +++ b/src/v1_26/api/admissionregistration/v1alpha1/validating_admission_policy_binding.rs @@ -360,7 +360,7 @@ impl crate::ListableResource for ValidatingAdmissionPolicyBinding { } impl crate::Metadata for ValidatingAdmissionPolicyBinding { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_26/api/apiserverinternal/v1alpha1/storage_version.rs b/src/v1_26/api/apiserverinternal/v1alpha1/storage_version.rs index c5d811a2fd..7e41c6b9c1 100644 --- a/src/v1_26/api/apiserverinternal/v1alpha1/storage_version.rs +++ b/src/v1_26/api/apiserverinternal/v1alpha1/storage_version.rs @@ -516,7 +516,7 @@ impl crate::ListableResource for StorageVersion { } impl crate::Metadata for StorageVersion { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_26/api/authentication/v1/token_request.rs b/src/v1_26/api/authentication/v1/token_request.rs index 1f864e2ac3..995fbc9e76 100644 --- a/src/v1_26/api/authentication/v1/token_request.rs +++ b/src/v1_26/api/authentication/v1/token_request.rs @@ -74,7 +74,7 @@ impl crate::Resource for TokenRequest { } impl crate::Metadata for TokenRequest { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::SubObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_26/api/authentication/v1/token_review.rs b/src/v1_26/api/authentication/v1/token_review.rs index e4ed490482..e608079249 100644 --- a/src/v1_26/api/authentication/v1/token_review.rs +++ b/src/v1_26/api/authentication/v1/token_review.rs @@ -61,7 +61,7 @@ impl crate::Resource for TokenReview { } impl crate::Metadata for TokenReview { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_26/api/authentication/v1alpha1/self_subject_review.rs b/src/v1_26/api/authentication/v1alpha1/self_subject_review.rs index 0c1f7e1368..2af207bf2d 100644 --- a/src/v1_26/api/authentication/v1alpha1/self_subject_review.rs +++ b/src/v1_26/api/authentication/v1alpha1/self_subject_review.rs @@ -58,7 +58,7 @@ impl crate::Resource for SelfSubjectReview { } impl crate::Metadata for SelfSubjectReview { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_26/api/authorization/v1/self_subject_access_review.rs b/src/v1_26/api/authorization/v1/self_subject_access_review.rs index bf549beb13..a61121e9eb 100644 --- a/src/v1_26/api/authorization/v1/self_subject_access_review.rs +++ b/src/v1_26/api/authorization/v1/self_subject_access_review.rs @@ -61,7 +61,7 @@ impl crate::Resource for SelfSubjectAccessReview { } impl crate::Metadata for SelfSubjectAccessReview { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_26/api/authorization/v1/self_subject_rules_review.rs b/src/v1_26/api/authorization/v1/self_subject_rules_review.rs index 60defd6f35..d290dea234 100644 --- a/src/v1_26/api/authorization/v1/self_subject_rules_review.rs +++ b/src/v1_26/api/authorization/v1/self_subject_rules_review.rs @@ -61,7 +61,7 @@ impl crate::Resource for SelfSubjectRulesReview { } impl crate::Metadata for SelfSubjectRulesReview { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_26/api/authorization/v1/subject_access_review.rs b/src/v1_26/api/authorization/v1/subject_access_review.rs index 8735a9f0bc..c983461e5a 100644 --- a/src/v1_26/api/authorization/v1/subject_access_review.rs +++ b/src/v1_26/api/authorization/v1/subject_access_review.rs @@ -61,7 +61,7 @@ impl crate::Resource for SubjectAccessReview { } impl crate::Metadata for SubjectAccessReview { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_26/api/autoscaling/v1/scale.rs b/src/v1_26/api/autoscaling/v1/scale.rs index 89a7024529..3fb0a7ea47 100644 --- a/src/v1_26/api/autoscaling/v1/scale.rs +++ b/src/v1_26/api/autoscaling/v1/scale.rs @@ -711,7 +711,7 @@ impl crate::Resource for Scale { } impl crate::Metadata for Scale { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::SubObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_26/api/certificates/v1/certificate_signing_request.rs b/src/v1_26/api/certificates/v1/certificate_signing_request.rs index 066a900b7c..90721fc6e0 100644 --- a/src/v1_26/api/certificates/v1/certificate_signing_request.rs +++ b/src/v1_26/api/certificates/v1/certificate_signing_request.rs @@ -674,7 +674,7 @@ impl crate::ListableResource for CertificateSigningRequest { } impl crate::Metadata for CertificateSigningRequest { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_26/api/core/v1/component_status.rs b/src/v1_26/api/core/v1/component_status.rs index ecddf82170..ba505704c7 100644 --- a/src/v1_26/api/core/v1/component_status.rs +++ b/src/v1_26/api/core/v1/component_status.rs @@ -159,7 +159,7 @@ impl crate::ListableResource for ComponentStatus { } impl crate::Metadata for ComponentStatus { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_26/api/core/v1/namespace.rs b/src/v1_26/api/core/v1/namespace.rs index df31cdc0da..6600f8a3bb 100644 --- a/src/v1_26/api/core/v1/namespace.rs +++ b/src/v1_26/api/core/v1/namespace.rs @@ -516,7 +516,7 @@ impl crate::ListableResource for Namespace { } impl crate::Metadata for Namespace { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_26/api/core/v1/node.rs b/src/v1_26/api/core/v1/node.rs index 5a5694b818..d6e0aa6dfb 100644 --- a/src/v1_26/api/core/v1/node.rs +++ b/src/v1_26/api/core/v1/node.rs @@ -996,7 +996,7 @@ impl crate::ListableResource for Node { } impl crate::Metadata for Node { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_26/api/core/v1/persistent_volume.rs b/src/v1_26/api/core/v1/persistent_volume.rs index c3d9dde5a2..f74469a702 100644 --- a/src/v1_26/api/core/v1/persistent_volume.rs +++ b/src/v1_26/api/core/v1/persistent_volume.rs @@ -516,7 +516,7 @@ impl crate::ListableResource for PersistentVolume { } impl crate::Metadata for PersistentVolume { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_26/api/flowcontrol/v1beta2/flow_schema.rs b/src/v1_26/api/flowcontrol/v1beta2/flow_schema.rs index 71d13230a3..7efa4158ac 100644 --- a/src/v1_26/api/flowcontrol/v1beta2/flow_schema.rs +++ b/src/v1_26/api/flowcontrol/v1beta2/flow_schema.rs @@ -516,7 +516,7 @@ impl crate::ListableResource for FlowSchema { } impl crate::Metadata for FlowSchema { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_26/api/flowcontrol/v1beta2/priority_level_configuration.rs b/src/v1_26/api/flowcontrol/v1beta2/priority_level_configuration.rs index 91ebc9f1f5..982df6b6a7 100644 --- a/src/v1_26/api/flowcontrol/v1beta2/priority_level_configuration.rs +++ b/src/v1_26/api/flowcontrol/v1beta2/priority_level_configuration.rs @@ -516,7 +516,7 @@ impl crate::ListableResource for PriorityLevelConfiguration { } impl crate::Metadata for PriorityLevelConfiguration { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_26/api/flowcontrol/v1beta3/flow_schema.rs b/src/v1_26/api/flowcontrol/v1beta3/flow_schema.rs index 4890a5dcdc..0aa7b70aa2 100644 --- a/src/v1_26/api/flowcontrol/v1beta3/flow_schema.rs +++ b/src/v1_26/api/flowcontrol/v1beta3/flow_schema.rs @@ -516,7 +516,7 @@ impl crate::ListableResource for FlowSchema { } impl crate::Metadata for FlowSchema { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_26/api/flowcontrol/v1beta3/priority_level_configuration.rs b/src/v1_26/api/flowcontrol/v1beta3/priority_level_configuration.rs index 381c85611d..1fc7c7fb5d 100644 --- a/src/v1_26/api/flowcontrol/v1beta3/priority_level_configuration.rs +++ b/src/v1_26/api/flowcontrol/v1beta3/priority_level_configuration.rs @@ -516,7 +516,7 @@ impl crate::ListableResource for PriorityLevelConfiguration { } impl crate::Metadata for PriorityLevelConfiguration { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_26/api/networking/v1/ingress_class.rs b/src/v1_26/api/networking/v1/ingress_class.rs index d3ab7820c7..657d7e9809 100644 --- a/src/v1_26/api/networking/v1/ingress_class.rs +++ b/src/v1_26/api/networking/v1/ingress_class.rs @@ -360,7 +360,7 @@ impl crate::ListableResource for IngressClass { } impl crate::Metadata for IngressClass { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_26/api/networking/v1alpha1/cluster_cidr.rs b/src/v1_26/api/networking/v1alpha1/cluster_cidr.rs index bead0f8dcf..ad340d91b8 100644 --- a/src/v1_26/api/networking/v1alpha1/cluster_cidr.rs +++ b/src/v1_26/api/networking/v1alpha1/cluster_cidr.rs @@ -360,7 +360,7 @@ impl crate::ListableResource for ClusterCIDR { } impl crate::Metadata for ClusterCIDR { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_26/api/node/v1/runtime_class.rs b/src/v1_26/api/node/v1/runtime_class.rs index 470b9f902d..0fb771fb5f 100644 --- a/src/v1_26/api/node/v1/runtime_class.rs +++ b/src/v1_26/api/node/v1/runtime_class.rs @@ -367,7 +367,7 @@ impl crate::ListableResource for RuntimeClass { } impl crate::Metadata for RuntimeClass { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_26/api/policy/v1/eviction.rs b/src/v1_26/api/policy/v1/eviction.rs index e92ebe2f3a..fe63d30d4c 100644 --- a/src/v1_26/api/policy/v1/eviction.rs +++ b/src/v1_26/api/policy/v1/eviction.rs @@ -71,7 +71,7 @@ impl crate::Resource for Eviction { } impl crate::Metadata for Eviction { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::SubObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_26/api/rbac/v1/cluster_role.rs b/src/v1_26/api/rbac/v1/cluster_role.rs index 8336e14c92..541d57c8ee 100644 --- a/src/v1_26/api/rbac/v1/cluster_role.rs +++ b/src/v1_26/api/rbac/v1/cluster_role.rs @@ -363,7 +363,7 @@ impl crate::ListableResource for ClusterRole { } impl crate::Metadata for ClusterRole { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_26/api/rbac/v1/cluster_role_binding.rs b/src/v1_26/api/rbac/v1/cluster_role_binding.rs index 0162a1128e..0f02a028d1 100644 --- a/src/v1_26/api/rbac/v1/cluster_role_binding.rs +++ b/src/v1_26/api/rbac/v1/cluster_role_binding.rs @@ -363,7 +363,7 @@ impl crate::ListableResource for ClusterRoleBinding { } impl crate::Metadata for ClusterRoleBinding { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_26/api/resource/v1alpha1/resource_class.rs b/src/v1_26/api/resource/v1alpha1/resource_class.rs index afffe54d8e..d4596ca383 100644 --- a/src/v1_26/api/resource/v1alpha1/resource_class.rs +++ b/src/v1_26/api/resource/v1alpha1/resource_class.rs @@ -372,7 +372,7 @@ impl crate::ListableResource for ResourceClass { } impl crate::Metadata for ResourceClass { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_26/api/scheduling/v1/priority_class.rs b/src/v1_26/api/scheduling/v1/priority_class.rs index f13f535704..3cbab648f7 100644 --- a/src/v1_26/api/scheduling/v1/priority_class.rs +++ b/src/v1_26/api/scheduling/v1/priority_class.rs @@ -369,7 +369,7 @@ impl crate::ListableResource for PriorityClass { } impl crate::Metadata for PriorityClass { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_26/api/storage/v1/csi_driver.rs b/src/v1_26/api/storage/v1/csi_driver.rs index 0dc419fa28..841c350667 100644 --- a/src/v1_26/api/storage/v1/csi_driver.rs +++ b/src/v1_26/api/storage/v1/csi_driver.rs @@ -360,7 +360,7 @@ impl crate::ListableResource for CSIDriver { } impl crate::Metadata for CSIDriver { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_26/api/storage/v1/csi_node.rs b/src/v1_26/api/storage/v1/csi_node.rs index a514ce9bf0..2ae2dc489a 100644 --- a/src/v1_26/api/storage/v1/csi_node.rs +++ b/src/v1_26/api/storage/v1/csi_node.rs @@ -360,7 +360,7 @@ impl crate::ListableResource for CSINode { } impl crate::Metadata for CSINode { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_26/api/storage/v1/storage_class.rs b/src/v1_26/api/storage/v1/storage_class.rs index 2bf8e65456..e8e1996616 100644 --- a/src/v1_26/api/storage/v1/storage_class.rs +++ b/src/v1_26/api/storage/v1/storage_class.rs @@ -380,7 +380,7 @@ impl crate::ListableResource for StorageClass { } impl crate::Metadata for StorageClass { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_26/api/storage/v1/volume_attachment.rs b/src/v1_26/api/storage/v1/volume_attachment.rs index f6b6972639..51e070f07b 100644 --- a/src/v1_26/api/storage/v1/volume_attachment.rs +++ b/src/v1_26/api/storage/v1/volume_attachment.rs @@ -518,7 +518,7 @@ impl crate::ListableResource for VolumeAttachment { } impl crate::Metadata for VolumeAttachment { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_26/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition.rs b/src/v1_26/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition.rs index c05e8ea174..5ab4dfa8ca 100644 --- a/src/v1_26/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition.rs +++ b/src/v1_26/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition.rs @@ -516,7 +516,7 @@ impl crate::ListableResource for CustomResourceDefinition { } impl crate::Metadata for CustomResourceDefinition { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata diff --git a/src/v1_26/apimachinery/pkg/apis/meta/v1/cluster_object_meta.rs b/src/v1_26/apimachinery/pkg/apis/meta/v1/cluster_object_meta.rs new file mode 100644 index 0000000000..5b7b4dade6 --- /dev/null +++ b/src/v1_26/apimachinery/pkg/apis/meta/v1/cluster_object_meta.rs @@ -0,0 +1,501 @@ +// Generated from definition io.k8s.apimachinery.pkg.apis.meta.v1.ClusterObjectMeta + +/// ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create. +#[derive(Clone, Debug, Default, PartialEq)] +pub struct ClusterObjectMeta { + /// Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations + pub annotations: Option>, + + /// CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC. + /// + /// Populated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + pub creation_timestamp: Option, + + /// Number of seconds allowed for this object to gracefully terminate before it will be removed from the system. Only set when deletionTimestamp is also set. May only be shortened. Read-only. + pub deletion_grace_period_seconds: Option, + + /// DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This field is set by the server when a graceful deletion is requested by the user, and is not directly settable by a client. The resource is expected to be deleted (no longer visible from resource lists, and not reachable by name) after the time in this field, once the finalizers list is empty. As long as the finalizers list contains items, deletion is blocked. Once the deletionTimestamp is set, this value may not be unset or be set further into the future, although it may be shortened or the resource may be deleted prior to this time. For example, a user may request that a pod is deleted in 30 seconds. The Kubelet will react by sending a graceful termination signal to the containers in the pod. After that 30 seconds, the Kubelet will send a hard termination signal (SIGKILL) to the container and after cleanup, remove the pod from the API. In the presence of network partitions, this object may still exist after this timestamp, until an administrator or automated process can determine the resource is fully terminated. If not set, graceful deletion of the object has not been requested. + /// + /// Populated by the system when a graceful deletion is requested. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + pub deletion_timestamp: Option, + + /// Must be empty before the object is deleted from the registry. Each entry is an identifier for the responsible component that will remove the entry from the list. If the deletionTimestamp of the object is non-nil, entries in this list can only be removed. Finalizers may be processed and removed in any order. Order is NOT enforced because it introduces significant risk of stuck finalizers. finalizers is a shared field, any actor with permission can reorder it. If the finalizer list is processed in order, then this can lead to a situation in which the component responsible for the first finalizer in the list is waiting for a signal (field value, external system, or other) produced by a component responsible for a finalizer later in the list, resulting in a deadlock. Without enforced ordering finalizers are free to order amongst themselves and are not vulnerable to ordering changes in the list. + pub finalizers: Option>, + + /// GenerateName is an optional prefix, used by the server, to generate a unique name ONLY IF the Name field has not been provided. If this field is used, the name returned to the client will be different than the name passed. This value will also be combined with a unique suffix. The provided value has the same validation rules as the Name field, and may be truncated by the length of the suffix required to make the value unique on the server. + /// + /// If this field is specified and the generated name exists, the server will return a 409. + /// + /// Applied only if Name is not specified. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#idempotency + pub generate_name: Option, + + /// A sequence number representing a specific generation of the desired state. Populated by the system. Read-only. + pub generation: Option, + + /// Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels + pub labels: Option>, + + /// ManagedFields maps workflow-id and version to the set of fields that are managed by that workflow. This is mostly for internal housekeeping, and users typically shouldn't need to set or understand this field. A workflow can be the user's name, a controller's name, or the name of a specific apply path like "ci-cd". The set of fields is always in the version that the workflow used when modifying the object. + pub managed_fields: Option>, + + /// Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names + pub name: Option, + + /// List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller. + pub owner_references: Option>, + + /// An opaque value that represents the internal version of this object that can be used by clients to determine when objects have changed. May be used for optimistic concurrency, change detection, and the watch operation on a resource or set of resources. Clients must treat these values as opaque and passed unmodified back to the server. They may only be valid for a particular resource or set of resources. + /// + /// Populated by the system. Read-only. Value must be treated as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency + pub resource_version: Option, + + /// Deprecated: selfLink is a legacy read-only field that is no longer populated by the system. + pub self_link: Option, + + /// UID is the unique in time and space value for this object. It is typically generated by the server on successful creation of a resource and is not allowed to change on PUT operations. + /// + /// Populated by the system. Read-only. More info: http://kubernetes.io/docs/user-guide/identifiers#uids + pub uid: Option, +} + +impl crate::DeepMerge for ClusterObjectMeta { + fn merge_from(&mut self, other: Self) { + crate::DeepMerge::merge_from(&mut self.annotations, other.annotations); + crate::DeepMerge::merge_from(&mut self.creation_timestamp, other.creation_timestamp); + crate::DeepMerge::merge_from(&mut self.deletion_grace_period_seconds, other.deletion_grace_period_seconds); + crate::DeepMerge::merge_from(&mut self.deletion_timestamp, other.deletion_timestamp); + crate::DeepMerge::merge_from(&mut self.finalizers, other.finalizers); + crate::DeepMerge::merge_from(&mut self.generate_name, other.generate_name); + crate::DeepMerge::merge_from(&mut self.generation, other.generation); + crate::DeepMerge::merge_from(&mut self.labels, other.labels); + crate::DeepMerge::merge_from(&mut self.managed_fields, other.managed_fields); + crate::DeepMerge::merge_from(&mut self.name, other.name); + crate::DeepMerge::merge_from(&mut self.owner_references, other.owner_references); + crate::DeepMerge::merge_from(&mut self.resource_version, other.resource_version); + crate::DeepMerge::merge_from(&mut self.self_link, other.self_link); + crate::DeepMerge::merge_from(&mut self.uid, other.uid); + } +} + +impl<'de> crate::serde::Deserialize<'de> for ClusterObjectMeta { + fn deserialize(deserializer: D) -> Result where D: crate::serde::Deserializer<'de> { + #[allow(non_camel_case_types)] + enum Field { + Key_annotations, + Key_creation_timestamp, + Key_deletion_grace_period_seconds, + Key_deletion_timestamp, + Key_finalizers, + Key_generate_name, + Key_generation, + Key_labels, + Key_managed_fields, + Key_name, + Key_owner_references, + Key_resource_version, + Key_self_link, + Key_uid, + Other, + } + + impl<'de> crate::serde::Deserialize<'de> for Field { + fn deserialize(deserializer: D) -> Result where D: crate::serde::Deserializer<'de> { + struct Visitor; + + impl<'de> crate::serde::de::Visitor<'de> for Visitor { + type Value = Field; + + fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.write_str("field identifier") + } + + fn visit_str(self, v: &str) -> Result where E: crate::serde::de::Error { + Ok(match v { + "annotations" => Field::Key_annotations, + "creationTimestamp" => Field::Key_creation_timestamp, + "deletionGracePeriodSeconds" => Field::Key_deletion_grace_period_seconds, + "deletionTimestamp" => Field::Key_deletion_timestamp, + "finalizers" => Field::Key_finalizers, + "generateName" => Field::Key_generate_name, + "generation" => Field::Key_generation, + "labels" => Field::Key_labels, + "managedFields" => Field::Key_managed_fields, + "name" => Field::Key_name, + "ownerReferences" => Field::Key_owner_references, + "resourceVersion" => Field::Key_resource_version, + "selfLink" => Field::Key_self_link, + "uid" => Field::Key_uid, + _ => Field::Other, + }) + } + } + + deserializer.deserialize_identifier(Visitor) + } + } + + struct Visitor; + + impl<'de> crate::serde::de::Visitor<'de> for Visitor { + type Value = ClusterObjectMeta; + + fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.write_str("ClusterObjectMeta") + } + + fn visit_map(self, mut map: A) -> Result where A: crate::serde::de::MapAccess<'de> { + let mut value_annotations: Option> = None; + let mut value_creation_timestamp: Option = None; + let mut value_deletion_grace_period_seconds: Option = None; + let mut value_deletion_timestamp: Option = None; + let mut value_finalizers: Option> = None; + let mut value_generate_name: Option = None; + let mut value_generation: Option = None; + let mut value_labels: Option> = None; + let mut value_managed_fields: Option> = None; + let mut value_name: Option = None; + let mut value_owner_references: Option> = None; + let mut value_resource_version: Option = None; + let mut value_self_link: Option = None; + let mut value_uid: Option = None; + + while let Some(key) = crate::serde::de::MapAccess::next_key::(&mut map)? { + match key { + Field::Key_annotations => value_annotations = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_creation_timestamp => value_creation_timestamp = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_deletion_grace_period_seconds => value_deletion_grace_period_seconds = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_deletion_timestamp => value_deletion_timestamp = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_finalizers => value_finalizers = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_generate_name => value_generate_name = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_generation => value_generation = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_labels => value_labels = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_managed_fields => value_managed_fields = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_name => value_name = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_owner_references => value_owner_references = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_resource_version => value_resource_version = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_self_link => value_self_link = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_uid => value_uid = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Other => { let _: crate::serde::de::IgnoredAny = crate::serde::de::MapAccess::next_value(&mut map)?; }, + } + } + + Ok(ClusterObjectMeta { + annotations: value_annotations, + creation_timestamp: value_creation_timestamp, + deletion_grace_period_seconds: value_deletion_grace_period_seconds, + deletion_timestamp: value_deletion_timestamp, + finalizers: value_finalizers, + generate_name: value_generate_name, + generation: value_generation, + labels: value_labels, + managed_fields: value_managed_fields, + name: value_name, + owner_references: value_owner_references, + resource_version: value_resource_version, + self_link: value_self_link, + uid: value_uid, + }) + } + } + + deserializer.deserialize_struct( + "ClusterObjectMeta", + &[ + "annotations", + "creationTimestamp", + "deletionGracePeriodSeconds", + "deletionTimestamp", + "finalizers", + "generateName", + "generation", + "labels", + "managedFields", + "name", + "ownerReferences", + "resourceVersion", + "selfLink", + "uid", + ], + Visitor, + ) + } +} + +impl crate::serde::Serialize for ClusterObjectMeta { + fn serialize(&self, serializer: S) -> Result where S: crate::serde::Serializer { + let mut state = serializer.serialize_struct( + "ClusterObjectMeta", + self.annotations.as_ref().map_or(0, |_| 1) + + self.creation_timestamp.as_ref().map_or(0, |_| 1) + + self.deletion_grace_period_seconds.as_ref().map_or(0, |_| 1) + + self.deletion_timestamp.as_ref().map_or(0, |_| 1) + + self.finalizers.as_ref().map_or(0, |_| 1) + + self.generate_name.as_ref().map_or(0, |_| 1) + + self.generation.as_ref().map_or(0, |_| 1) + + self.labels.as_ref().map_or(0, |_| 1) + + self.managed_fields.as_ref().map_or(0, |_| 1) + + self.name.as_ref().map_or(0, |_| 1) + + self.owner_references.as_ref().map_or(0, |_| 1) + + self.resource_version.as_ref().map_or(0, |_| 1) + + self.self_link.as_ref().map_or(0, |_| 1) + + self.uid.as_ref().map_or(0, |_| 1), + )?; + if let Some(value) = &self.annotations { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "annotations", value)?; + } + if let Some(value) = &self.creation_timestamp { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "creationTimestamp", value)?; + } + if let Some(value) = &self.deletion_grace_period_seconds { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "deletionGracePeriodSeconds", value)?; + } + if let Some(value) = &self.deletion_timestamp { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "deletionTimestamp", value)?; + } + if let Some(value) = &self.finalizers { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "finalizers", value)?; + } + if let Some(value) = &self.generate_name { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "generateName", value)?; + } + if let Some(value) = &self.generation { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "generation", value)?; + } + if let Some(value) = &self.labels { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "labels", value)?; + } + if let Some(value) = &self.managed_fields { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "managedFields", value)?; + } + if let Some(value) = &self.name { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "name", value)?; + } + if let Some(value) = &self.owner_references { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "ownerReferences", value)?; + } + if let Some(value) = &self.resource_version { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "resourceVersion", value)?; + } + if let Some(value) = &self.self_link { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "selfLink", value)?; + } + if let Some(value) = &self.uid { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "uid", value)?; + } + crate::serde::ser::SerializeStruct::end(state) + } +} + +#[cfg(feature = "schemars")] +impl crate::schemars::JsonSchema for ClusterObjectMeta { + fn schema_name() -> String { + "io.k8s.apimachinery.pkg.apis.meta.v1.ClusterObjectMeta".to_owned() + } + + fn json_schema(__gen: &mut crate::schemars::gen::SchemaGenerator) -> crate::schemars::schema::Schema { + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Object))), + object: Some(Box::new(crate::schemars::schema::ObjectValidation { + properties: [ + ( + "annotations".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Object))), + object: Some(Box::new(crate::schemars::schema::ObjectValidation { + additional_properties: Some(Box::new( + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }) + )), + ..Default::default() + })), + ..Default::default() + }), + ), + ( + "creationTimestamp".to_owned(), + { + let mut schema_obj = __gen.subschema_for::().into_object(); + schema_obj.metadata = Some(Box::new(crate::schemars::schema::Metadata { + description: Some("CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC.\n\nPopulated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata".to_owned()), + ..Default::default() + })); + crate::schemars::schema::Schema::Object(schema_obj) + }, + ), + ( + "deletionGracePeriodSeconds".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Number of seconds allowed for this object to gracefully terminate before it will be removed from the system. Only set when deletionTimestamp is also set. May only be shortened. Read-only.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Integer))), + format: Some("int64".to_owned()), + ..Default::default() + }), + ), + ( + "deletionTimestamp".to_owned(), + { + let mut schema_obj = __gen.subschema_for::().into_object(); + schema_obj.metadata = Some(Box::new(crate::schemars::schema::Metadata { + description: Some("DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This field is set by the server when a graceful deletion is requested by the user, and is not directly settable by a client. The resource is expected to be deleted (no longer visible from resource lists, and not reachable by name) after the time in this field, once the finalizers list is empty. As long as the finalizers list contains items, deletion is blocked. Once the deletionTimestamp is set, this value may not be unset or be set further into the future, although it may be shortened or the resource may be deleted prior to this time. For example, a user may request that a pod is deleted in 30 seconds. The Kubelet will react by sending a graceful termination signal to the containers in the pod. After that 30 seconds, the Kubelet will send a hard termination signal (SIGKILL) to the container and after cleanup, remove the pod from the API. In the presence of network partitions, this object may still exist after this timestamp, until an administrator or automated process can determine the resource is fully terminated. If not set, graceful deletion of the object has not been requested.\n\nPopulated by the system when a graceful deletion is requested. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata".to_owned()), + ..Default::default() + })); + crate::schemars::schema::Schema::Object(schema_obj) + }, + ), + ( + "finalizers".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Must be empty before the object is deleted from the registry. Each entry is an identifier for the responsible component that will remove the entry from the list. If the deletionTimestamp of the object is non-nil, entries in this list can only be removed. Finalizers may be processed and removed in any order. Order is NOT enforced because it introduces significant risk of stuck finalizers. finalizers is a shared field, any actor with permission can reorder it. If the finalizer list is processed in order, then this can lead to a situation in which the component responsible for the first finalizer in the list is waiting for a signal (field value, external system, or other) produced by a component responsible for a finalizer later in the list, resulting in a deadlock. Without enforced ordering finalizers are free to order amongst themselves and are not vulnerable to ordering changes in the list.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Array))), + array: Some(Box::new(crate::schemars::schema::ArrayValidation { + items: Some(crate::schemars::schema::SingleOrVec::Single(Box::new( + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }) + ))), + ..Default::default() + })), + ..Default::default() + }), + ), + ( + "generateName".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("GenerateName is an optional prefix, used by the server, to generate a unique name ONLY IF the Name field has not been provided. If this field is used, the name returned to the client will be different than the name passed. This value will also be combined with a unique suffix. The provided value has the same validation rules as the Name field, and may be truncated by the length of the suffix required to make the value unique on the server.\n\nIf this field is specified and the generated name exists, the server will return a 409.\n\nApplied only if Name is not specified. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#idempotency".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ( + "generation".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("A sequence number representing a specific generation of the desired state. Populated by the system. Read-only.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Integer))), + format: Some("int64".to_owned()), + ..Default::default() + }), + ), + ( + "labels".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Object))), + object: Some(Box::new(crate::schemars::schema::ObjectValidation { + additional_properties: Some(Box::new( + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }) + )), + ..Default::default() + })), + ..Default::default() + }), + ), + ( + "managedFields".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("ManagedFields maps workflow-id and version to the set of fields that are managed by that workflow. This is mostly for internal housekeeping, and users typically shouldn't need to set or understand this field. A workflow can be the user's name, a controller's name, or the name of a specific apply path like \"ci-cd\". The set of fields is always in the version that the workflow used when modifying the object.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Array))), + array: Some(Box::new(crate::schemars::schema::ArrayValidation { + items: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(__gen.subschema_for::()))), + ..Default::default() + })), + ..Default::default() + }), + ), + ( + "name".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ( + "ownerReferences".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Array))), + array: Some(Box::new(crate::schemars::schema::ArrayValidation { + items: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(__gen.subschema_for::()))), + ..Default::default() + })), + ..Default::default() + }), + ), + ( + "resourceVersion".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("An opaque value that represents the internal version of this object that can be used by clients to determine when objects have changed. May be used for optimistic concurrency, change detection, and the watch operation on a resource or set of resources. Clients must treat these values as opaque and passed unmodified back to the server. They may only be valid for a particular resource or set of resources.\n\nPopulated by the system. Read-only. Value must be treated as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ( + "selfLink".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Deprecated: selfLink is a legacy read-only field that is no longer populated by the system.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ( + "uid".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("UID is the unique in time and space value for this object. It is typically generated by the server on successful creation of a resource and is not allowed to change on PUT operations.\n\nPopulated by the system. Read-only. More info: http://kubernetes.io/docs/user-guide/identifiers#uids".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ].into(), + ..Default::default() + })), + ..Default::default() + }) + } +} diff --git a/src/v1_26/apimachinery/pkg/apis/meta/v1/mod.rs b/src/v1_26/apimachinery/pkg/apis/meta/v1/mod.rs index 9424127582..221a712e6d 100644 --- a/src/v1_26/apimachinery/pkg/apis/meta/v1/mod.rs +++ b/src/v1_26/apimachinery/pkg/apis/meta/v1/mod.rs @@ -14,6 +14,9 @@ pub use self::api_resource_list::APIResourceList; mod api_versions; pub use self::api_versions::APIVersions; +mod cluster_object_meta; +pub use self::cluster_object_meta::ClusterObjectMeta; + mod condition; pub use self::condition::Condition; @@ -65,6 +68,9 @@ pub use self::status_cause::StatusCause; mod status_details; pub use self::status_details::StatusDetails; +mod sub_object_meta; +pub use self::sub_object_meta::SubObjectMeta; + mod time; pub use self::time::Time; diff --git a/src/v1_26/apimachinery/pkg/apis/meta/v1/object_meta.rs b/src/v1_26/apimachinery/pkg/apis/meta/v1/object_meta.rs index 8d7007f3a3..bb215ca04f 100644 --- a/src/v1_26/apimachinery/pkg/apis/meta/v1/object_meta.rs +++ b/src/v1_26/apimachinery/pkg/apis/meta/v1/object_meta.rs @@ -44,7 +44,7 @@ pub struct ObjectMeta { /// Namespace defines the space within which each name must be unique. An empty namespace is equivalent to the "default" namespace, but "default" is the canonical representation. Not all objects are required to be scoped to a namespace - the value of this field for those objects will be empty. /// /// Must be a DNS_LABEL. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/namespaces - pub namespace: Option, + pub namespace: String, /// List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller. pub owner_references: Option>, @@ -200,7 +200,7 @@ impl<'de> crate::serde::Deserialize<'de> for ObjectMeta { labels: value_labels, managed_fields: value_managed_fields, name: value_name, - namespace: value_namespace, + namespace: value_namespace.unwrap_or_default(), owner_references: value_owner_references, resource_version: value_resource_version, self_link: value_self_link, @@ -237,6 +237,7 @@ impl crate::serde::Serialize for ObjectMeta { fn serialize(&self, serializer: S) -> Result where S: crate::serde::Serializer { let mut state = serializer.serialize_struct( "ObjectMeta", + 1 + self.annotations.as_ref().map_or(0, |_| 1) + self.creation_timestamp.as_ref().map_or(0, |_| 1) + self.deletion_grace_period_seconds.as_ref().map_or(0, |_| 1) + @@ -247,7 +248,6 @@ impl crate::serde::Serialize for ObjectMeta { self.labels.as_ref().map_or(0, |_| 1) + self.managed_fields.as_ref().map_or(0, |_| 1) + self.name.as_ref().map_or(0, |_| 1) + - self.namespace.as_ref().map_or(0, |_| 1) + self.owner_references.as_ref().map_or(0, |_| 1) + self.resource_version.as_ref().map_or(0, |_| 1) + self.self_link.as_ref().map_or(0, |_| 1) + @@ -283,9 +283,7 @@ impl crate::serde::Serialize for ObjectMeta { if let Some(value) = &self.name { crate::serde::ser::SerializeStruct::serialize_field(&mut state, "name", value)?; } - if let Some(value) = &self.namespace { - crate::serde::ser::SerializeStruct::serialize_field(&mut state, "namespace", value)?; - } + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "namespace", &self.namespace)?; if let Some(value) = &self.owner_references { crate::serde::ser::SerializeStruct::serialize_field(&mut state, "ownerReferences", value)?; } @@ -520,6 +518,9 @@ impl crate::schemars::JsonSchema for ObjectMeta { }), ), ].into(), + required: [ + "namespace".to_owned(), + ].into(), ..Default::default() })), ..Default::default() diff --git a/src/v1_26/apimachinery/pkg/apis/meta/v1/sub_object_meta.rs b/src/v1_26/apimachinery/pkg/apis/meta/v1/sub_object_meta.rs new file mode 100644 index 0000000000..ed66c322b5 --- /dev/null +++ b/src/v1_26/apimachinery/pkg/apis/meta/v1/sub_object_meta.rs @@ -0,0 +1,528 @@ +// Generated from definition io.k8s.apimachinery.pkg.apis.meta.v1.SubObjectMeta + +/// ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create. +#[derive(Clone, Debug, Default, PartialEq)] +pub struct SubObjectMeta { + /// Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations + pub annotations: Option>, + + /// CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC. + /// + /// Populated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + pub creation_timestamp: Option, + + /// Number of seconds allowed for this object to gracefully terminate before it will be removed from the system. Only set when deletionTimestamp is also set. May only be shortened. Read-only. + pub deletion_grace_period_seconds: Option, + + /// DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This field is set by the server when a graceful deletion is requested by the user, and is not directly settable by a client. The resource is expected to be deleted (no longer visible from resource lists, and not reachable by name) after the time in this field, once the finalizers list is empty. As long as the finalizers list contains items, deletion is blocked. Once the deletionTimestamp is set, this value may not be unset or be set further into the future, although it may be shortened or the resource may be deleted prior to this time. For example, a user may request that a pod is deleted in 30 seconds. The Kubelet will react by sending a graceful termination signal to the containers in the pod. After that 30 seconds, the Kubelet will send a hard termination signal (SIGKILL) to the container and after cleanup, remove the pod from the API. In the presence of network partitions, this object may still exist after this timestamp, until an administrator or automated process can determine the resource is fully terminated. If not set, graceful deletion of the object has not been requested. + /// + /// Populated by the system when a graceful deletion is requested. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + pub deletion_timestamp: Option, + + /// Must be empty before the object is deleted from the registry. Each entry is an identifier for the responsible component that will remove the entry from the list. If the deletionTimestamp of the object is non-nil, entries in this list can only be removed. Finalizers may be processed and removed in any order. Order is NOT enforced because it introduces significant risk of stuck finalizers. finalizers is a shared field, any actor with permission can reorder it. If the finalizer list is processed in order, then this can lead to a situation in which the component responsible for the first finalizer in the list is waiting for a signal (field value, external system, or other) produced by a component responsible for a finalizer later in the list, resulting in a deadlock. Without enforced ordering finalizers are free to order amongst themselves and are not vulnerable to ordering changes in the list. + pub finalizers: Option>, + + /// GenerateName is an optional prefix, used by the server, to generate a unique name ONLY IF the Name field has not been provided. If this field is used, the name returned to the client will be different than the name passed. This value will also be combined with a unique suffix. The provided value has the same validation rules as the Name field, and may be truncated by the length of the suffix required to make the value unique on the server. + /// + /// If this field is specified and the generated name exists, the server will return a 409. + /// + /// Applied only if Name is not specified. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#idempotency + pub generate_name: Option, + + /// A sequence number representing a specific generation of the desired state. Populated by the system. Read-only. + pub generation: Option, + + /// Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels + pub labels: Option>, + + /// ManagedFields maps workflow-id and version to the set of fields that are managed by that workflow. This is mostly for internal housekeeping, and users typically shouldn't need to set or understand this field. A workflow can be the user's name, a controller's name, or the name of a specific apply path like "ci-cd". The set of fields is always in the version that the workflow used when modifying the object. + pub managed_fields: Option>, + + /// Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names + pub name: Option, + + /// Namespace defines the space within which each name must be unique. An empty namespace is equivalent to the "default" namespace, but "default" is the canonical representation. Not all objects are required to be scoped to a namespace - the value of this field for those objects will be empty. + /// + /// Must be a DNS_LABEL. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/namespaces + pub namespace: Option, + + /// List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller. + pub owner_references: Option>, + + /// An opaque value that represents the internal version of this object that can be used by clients to determine when objects have changed. May be used for optimistic concurrency, change detection, and the watch operation on a resource or set of resources. Clients must treat these values as opaque and passed unmodified back to the server. They may only be valid for a particular resource or set of resources. + /// + /// Populated by the system. Read-only. Value must be treated as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency + pub resource_version: Option, + + /// Deprecated: selfLink is a legacy read-only field that is no longer populated by the system. + pub self_link: Option, + + /// UID is the unique in time and space value for this object. It is typically generated by the server on successful creation of a resource and is not allowed to change on PUT operations. + /// + /// Populated by the system. Read-only. More info: http://kubernetes.io/docs/user-guide/identifiers#uids + pub uid: Option, +} + +impl crate::DeepMerge for SubObjectMeta { + fn merge_from(&mut self, other: Self) { + crate::DeepMerge::merge_from(&mut self.annotations, other.annotations); + crate::DeepMerge::merge_from(&mut self.creation_timestamp, other.creation_timestamp); + crate::DeepMerge::merge_from(&mut self.deletion_grace_period_seconds, other.deletion_grace_period_seconds); + crate::DeepMerge::merge_from(&mut self.deletion_timestamp, other.deletion_timestamp); + crate::DeepMerge::merge_from(&mut self.finalizers, other.finalizers); + crate::DeepMerge::merge_from(&mut self.generate_name, other.generate_name); + crate::DeepMerge::merge_from(&mut self.generation, other.generation); + crate::DeepMerge::merge_from(&mut self.labels, other.labels); + crate::DeepMerge::merge_from(&mut self.managed_fields, other.managed_fields); + crate::DeepMerge::merge_from(&mut self.name, other.name); + crate::DeepMerge::merge_from(&mut self.namespace, other.namespace); + crate::DeepMerge::merge_from(&mut self.owner_references, other.owner_references); + crate::DeepMerge::merge_from(&mut self.resource_version, other.resource_version); + crate::DeepMerge::merge_from(&mut self.self_link, other.self_link); + crate::DeepMerge::merge_from(&mut self.uid, other.uid); + } +} + +impl<'de> crate::serde::Deserialize<'de> for SubObjectMeta { + fn deserialize(deserializer: D) -> Result where D: crate::serde::Deserializer<'de> { + #[allow(non_camel_case_types)] + enum Field { + Key_annotations, + Key_creation_timestamp, + Key_deletion_grace_period_seconds, + Key_deletion_timestamp, + Key_finalizers, + Key_generate_name, + Key_generation, + Key_labels, + Key_managed_fields, + Key_name, + Key_namespace, + Key_owner_references, + Key_resource_version, + Key_self_link, + Key_uid, + Other, + } + + impl<'de> crate::serde::Deserialize<'de> for Field { + fn deserialize(deserializer: D) -> Result where D: crate::serde::Deserializer<'de> { + struct Visitor; + + impl<'de> crate::serde::de::Visitor<'de> for Visitor { + type Value = Field; + + fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.write_str("field identifier") + } + + fn visit_str(self, v: &str) -> Result where E: crate::serde::de::Error { + Ok(match v { + "annotations" => Field::Key_annotations, + "creationTimestamp" => Field::Key_creation_timestamp, + "deletionGracePeriodSeconds" => Field::Key_deletion_grace_period_seconds, + "deletionTimestamp" => Field::Key_deletion_timestamp, + "finalizers" => Field::Key_finalizers, + "generateName" => Field::Key_generate_name, + "generation" => Field::Key_generation, + "labels" => Field::Key_labels, + "managedFields" => Field::Key_managed_fields, + "name" => Field::Key_name, + "namespace" => Field::Key_namespace, + "ownerReferences" => Field::Key_owner_references, + "resourceVersion" => Field::Key_resource_version, + "selfLink" => Field::Key_self_link, + "uid" => Field::Key_uid, + _ => Field::Other, + }) + } + } + + deserializer.deserialize_identifier(Visitor) + } + } + + struct Visitor; + + impl<'de> crate::serde::de::Visitor<'de> for Visitor { + type Value = SubObjectMeta; + + fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.write_str("SubObjectMeta") + } + + fn visit_map(self, mut map: A) -> Result where A: crate::serde::de::MapAccess<'de> { + let mut value_annotations: Option> = None; + let mut value_creation_timestamp: Option = None; + let mut value_deletion_grace_period_seconds: Option = None; + let mut value_deletion_timestamp: Option = None; + let mut value_finalizers: Option> = None; + let mut value_generate_name: Option = None; + let mut value_generation: Option = None; + let mut value_labels: Option> = None; + let mut value_managed_fields: Option> = None; + let mut value_name: Option = None; + let mut value_namespace: Option = None; + let mut value_owner_references: Option> = None; + let mut value_resource_version: Option = None; + let mut value_self_link: Option = None; + let mut value_uid: Option = None; + + while let Some(key) = crate::serde::de::MapAccess::next_key::(&mut map)? { + match key { + Field::Key_annotations => value_annotations = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_creation_timestamp => value_creation_timestamp = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_deletion_grace_period_seconds => value_deletion_grace_period_seconds = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_deletion_timestamp => value_deletion_timestamp = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_finalizers => value_finalizers = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_generate_name => value_generate_name = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_generation => value_generation = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_labels => value_labels = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_managed_fields => value_managed_fields = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_name => value_name = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_namespace => value_namespace = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_owner_references => value_owner_references = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_resource_version => value_resource_version = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_self_link => value_self_link = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Key_uid => value_uid = crate::serde::de::MapAccess::next_value(&mut map)?, + Field::Other => { let _: crate::serde::de::IgnoredAny = crate::serde::de::MapAccess::next_value(&mut map)?; }, + } + } + + Ok(SubObjectMeta { + annotations: value_annotations, + creation_timestamp: value_creation_timestamp, + deletion_grace_period_seconds: value_deletion_grace_period_seconds, + deletion_timestamp: value_deletion_timestamp, + finalizers: value_finalizers, + generate_name: value_generate_name, + generation: value_generation, + labels: value_labels, + managed_fields: value_managed_fields, + name: value_name, + namespace: value_namespace, + owner_references: value_owner_references, + resource_version: value_resource_version, + self_link: value_self_link, + uid: value_uid, + }) + } + } + + deserializer.deserialize_struct( + "SubObjectMeta", + &[ + "annotations", + "creationTimestamp", + "deletionGracePeriodSeconds", + "deletionTimestamp", + "finalizers", + "generateName", + "generation", + "labels", + "managedFields", + "name", + "namespace", + "ownerReferences", + "resourceVersion", + "selfLink", + "uid", + ], + Visitor, + ) + } +} + +impl crate::serde::Serialize for SubObjectMeta { + fn serialize(&self, serializer: S) -> Result where S: crate::serde::Serializer { + let mut state = serializer.serialize_struct( + "SubObjectMeta", + self.annotations.as_ref().map_or(0, |_| 1) + + self.creation_timestamp.as_ref().map_or(0, |_| 1) + + self.deletion_grace_period_seconds.as_ref().map_or(0, |_| 1) + + self.deletion_timestamp.as_ref().map_or(0, |_| 1) + + self.finalizers.as_ref().map_or(0, |_| 1) + + self.generate_name.as_ref().map_or(0, |_| 1) + + self.generation.as_ref().map_or(0, |_| 1) + + self.labels.as_ref().map_or(0, |_| 1) + + self.managed_fields.as_ref().map_or(0, |_| 1) + + self.name.as_ref().map_or(0, |_| 1) + + self.namespace.as_ref().map_or(0, |_| 1) + + self.owner_references.as_ref().map_or(0, |_| 1) + + self.resource_version.as_ref().map_or(0, |_| 1) + + self.self_link.as_ref().map_or(0, |_| 1) + + self.uid.as_ref().map_or(0, |_| 1), + )?; + if let Some(value) = &self.annotations { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "annotations", value)?; + } + if let Some(value) = &self.creation_timestamp { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "creationTimestamp", value)?; + } + if let Some(value) = &self.deletion_grace_period_seconds { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "deletionGracePeriodSeconds", value)?; + } + if let Some(value) = &self.deletion_timestamp { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "deletionTimestamp", value)?; + } + if let Some(value) = &self.finalizers { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "finalizers", value)?; + } + if let Some(value) = &self.generate_name { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "generateName", value)?; + } + if let Some(value) = &self.generation { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "generation", value)?; + } + if let Some(value) = &self.labels { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "labels", value)?; + } + if let Some(value) = &self.managed_fields { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "managedFields", value)?; + } + if let Some(value) = &self.name { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "name", value)?; + } + if let Some(value) = &self.namespace { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "namespace", value)?; + } + if let Some(value) = &self.owner_references { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "ownerReferences", value)?; + } + if let Some(value) = &self.resource_version { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "resourceVersion", value)?; + } + if let Some(value) = &self.self_link { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "selfLink", value)?; + } + if let Some(value) = &self.uid { + crate::serde::ser::SerializeStruct::serialize_field(&mut state, "uid", value)?; + } + crate::serde::ser::SerializeStruct::end(state) + } +} + +#[cfg(feature = "schemars")] +impl crate::schemars::JsonSchema for SubObjectMeta { + fn schema_name() -> String { + "io.k8s.apimachinery.pkg.apis.meta.v1.SubObjectMeta".to_owned() + } + + fn json_schema(__gen: &mut crate::schemars::gen::SchemaGenerator) -> crate::schemars::schema::Schema { + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Object))), + object: Some(Box::new(crate::schemars::schema::ObjectValidation { + properties: [ + ( + "annotations".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Object))), + object: Some(Box::new(crate::schemars::schema::ObjectValidation { + additional_properties: Some(Box::new( + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }) + )), + ..Default::default() + })), + ..Default::default() + }), + ), + ( + "creationTimestamp".to_owned(), + { + let mut schema_obj = __gen.subschema_for::().into_object(); + schema_obj.metadata = Some(Box::new(crate::schemars::schema::Metadata { + description: Some("CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC.\n\nPopulated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata".to_owned()), + ..Default::default() + })); + crate::schemars::schema::Schema::Object(schema_obj) + }, + ), + ( + "deletionGracePeriodSeconds".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Number of seconds allowed for this object to gracefully terminate before it will be removed from the system. Only set when deletionTimestamp is also set. May only be shortened. Read-only.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Integer))), + format: Some("int64".to_owned()), + ..Default::default() + }), + ), + ( + "deletionTimestamp".to_owned(), + { + let mut schema_obj = __gen.subschema_for::().into_object(); + schema_obj.metadata = Some(Box::new(crate::schemars::schema::Metadata { + description: Some("DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This field is set by the server when a graceful deletion is requested by the user, and is not directly settable by a client. The resource is expected to be deleted (no longer visible from resource lists, and not reachable by name) after the time in this field, once the finalizers list is empty. As long as the finalizers list contains items, deletion is blocked. Once the deletionTimestamp is set, this value may not be unset or be set further into the future, although it may be shortened or the resource may be deleted prior to this time. For example, a user may request that a pod is deleted in 30 seconds. The Kubelet will react by sending a graceful termination signal to the containers in the pod. After that 30 seconds, the Kubelet will send a hard termination signal (SIGKILL) to the container and after cleanup, remove the pod from the API. In the presence of network partitions, this object may still exist after this timestamp, until an administrator or automated process can determine the resource is fully terminated. If not set, graceful deletion of the object has not been requested.\n\nPopulated by the system when a graceful deletion is requested. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata".to_owned()), + ..Default::default() + })); + crate::schemars::schema::Schema::Object(schema_obj) + }, + ), + ( + "finalizers".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Must be empty before the object is deleted from the registry. Each entry is an identifier for the responsible component that will remove the entry from the list. If the deletionTimestamp of the object is non-nil, entries in this list can only be removed. Finalizers may be processed and removed in any order. Order is NOT enforced because it introduces significant risk of stuck finalizers. finalizers is a shared field, any actor with permission can reorder it. If the finalizer list is processed in order, then this can lead to a situation in which the component responsible for the first finalizer in the list is waiting for a signal (field value, external system, or other) produced by a component responsible for a finalizer later in the list, resulting in a deadlock. Without enforced ordering finalizers are free to order amongst themselves and are not vulnerable to ordering changes in the list.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Array))), + array: Some(Box::new(crate::schemars::schema::ArrayValidation { + items: Some(crate::schemars::schema::SingleOrVec::Single(Box::new( + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }) + ))), + ..Default::default() + })), + ..Default::default() + }), + ), + ( + "generateName".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("GenerateName is an optional prefix, used by the server, to generate a unique name ONLY IF the Name field has not been provided. If this field is used, the name returned to the client will be different than the name passed. This value will also be combined with a unique suffix. The provided value has the same validation rules as the Name field, and may be truncated by the length of the suffix required to make the value unique on the server.\n\nIf this field is specified and the generated name exists, the server will return a 409.\n\nApplied only if Name is not specified. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#idempotency".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ( + "generation".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("A sequence number representing a specific generation of the desired state. Populated by the system. Read-only.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Integer))), + format: Some("int64".to_owned()), + ..Default::default() + }), + ), + ( + "labels".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Object))), + object: Some(Box::new(crate::schemars::schema::ObjectValidation { + additional_properties: Some(Box::new( + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }) + )), + ..Default::default() + })), + ..Default::default() + }), + ), + ( + "managedFields".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("ManagedFields maps workflow-id and version to the set of fields that are managed by that workflow. This is mostly for internal housekeeping, and users typically shouldn't need to set or understand this field. A workflow can be the user's name, a controller's name, or the name of a specific apply path like \"ci-cd\". The set of fields is always in the version that the workflow used when modifying the object.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Array))), + array: Some(Box::new(crate::schemars::schema::ArrayValidation { + items: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(__gen.subschema_for::()))), + ..Default::default() + })), + ..Default::default() + }), + ), + ( + "name".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ( + "namespace".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Namespace defines the space within which each name must be unique. An empty namespace is equivalent to the \"default\" namespace, but \"default\" is the canonical representation. Not all objects are required to be scoped to a namespace - the value of this field for those objects will be empty.\n\nMust be a DNS_LABEL. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/namespaces".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ( + "ownerReferences".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::Array))), + array: Some(Box::new(crate::schemars::schema::ArrayValidation { + items: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(__gen.subschema_for::()))), + ..Default::default() + })), + ..Default::default() + }), + ), + ( + "resourceVersion".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("An opaque value that represents the internal version of this object that can be used by clients to determine when objects have changed. May be used for optimistic concurrency, change detection, and the watch operation on a resource or set of resources. Clients must treat these values as opaque and passed unmodified back to the server. They may only be valid for a particular resource or set of resources.\n\nPopulated by the system. Read-only. Value must be treated as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ( + "selfLink".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("Deprecated: selfLink is a legacy read-only field that is no longer populated by the system.".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ( + "uid".to_owned(), + crate::schemars::schema::Schema::Object(crate::schemars::schema::SchemaObject { + metadata: Some(Box::new(crate::schemars::schema::Metadata { + description: Some("UID is the unique in time and space value for this object. It is typically generated by the server on successful creation of a resource and is not allowed to change on PUT operations.\n\nPopulated by the system. Read-only. More info: http://kubernetes.io/docs/user-guide/identifiers#uids".to_owned()), + ..Default::default() + })), + instance_type: Some(crate::schemars::schema::SingleOrVec::Single(Box::new(crate::schemars::schema::InstanceType::String))), + ..Default::default() + }), + ), + ].into(), + ..Default::default() + })), + ..Default::default() + }) + } +} diff --git a/src/v1_26/kube_aggregator/pkg/apis/apiregistration/v1/api_service.rs b/src/v1_26/kube_aggregator/pkg/apis/apiregistration/v1/api_service.rs index cff7ff1489..587f0a528a 100644 --- a/src/v1_26/kube_aggregator/pkg/apis/apiregistration/v1/api_service.rs +++ b/src/v1_26/kube_aggregator/pkg/apis/apiregistration/v1/api_service.rs @@ -516,7 +516,7 @@ impl crate::ListableResource for APIService { } impl crate::Metadata for APIService { - type Ty = crate::apimachinery::pkg::apis::meta::v1::ObjectMeta; + type Ty = crate::apimachinery::pkg::apis::meta::v1::ClusterObjectMeta; fn metadata(&self) -> &::Ty { &self.metadata