From c840bb410cc32b0620b605ed58c392933372ceea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Natalie=20Klestrup=20R=C3=B6ijezon?= Date: Fri, 31 Mar 2023 23:16:54 -0700 Subject: [PATCH] Implement deep merge strategies according to the OpenAPI spec. Fixes #128 Closes #138 --- k8s-openapi-codegen-common/src/lib.rs | 22 +- .../src/swagger20/definitions.rs | 91 ++++++++ .../src/swagger20/paths.rs | 2 + .../src/templates/impl_schema.rs | 9 +- .../src/templates/mod.rs | 1 + .../src/templates/query_string_optional.rs | 3 +- .../src/templates/struct_deep_merge.rs | 89 +++++++- k8s-openapi-codegen/src/fixups/special.rs | 15 ++ .../src/fixups/upstream_bugs.rs | 1 + .../src/custom_resource_definition.rs | 22 ++ k8s-openapi-tests-macro-deps/src/lib.rs | 2 +- .../src/custom_resource_definition.rs | 2 +- src/deep_merge.rs | 212 +++++++++++++++--- src/lib.rs | 2 +- .../v1/mutating_webhook.rs | 4 +- .../v1/mutating_webhook_configuration.rs | 9 +- .../v1/rule_with_operations.rs | 8 +- .../v1/validating_webhook.rs | 4 +- .../v1/validating_webhook_configuration.rs | 9 +- .../v1beta1/mutating_webhook.rs | 4 +- .../v1beta1/mutating_webhook_configuration.rs | 9 +- .../v1beta1/rule_with_operations.rs | 8 +- .../v1beta1/validating_webhook.rs | 4 +- .../validating_webhook_configuration.rs | 9 +- .../v1alpha1/server_storage_version.rs | 2 +- .../v1alpha1/storage_version_status.rs | 18 +- src/v1_20/api/apps/v1/daemon_set_status.rs | 9 +- src/v1_20/api/apps/v1/deployment_status.rs | 9 +- src/v1_20/api/apps/v1/replica_set_status.rs | 9 +- src/v1_20/api/apps/v1/stateful_set_spec.rs | 2 +- src/v1_20/api/apps/v1/stateful_set_status.rs | 9 +- .../authentication/v1/token_request_spec.rs | 2 +- .../authentication/v1/token_review_spec.rs | 2 +- .../authentication/v1/token_review_status.rs | 2 +- src/v1_20/api/authentication/v1/user_info.rs | 6 +- .../v1beta1/token_review_spec.rs | 2 +- .../v1beta1/token_review_status.rs | 2 +- .../api/authentication/v1beta1/user_info.rs | 6 +- .../api/authorization/v1/non_resource_rule.rs | 4 +- .../api/authorization/v1/resource_rule.rs | 8 +- .../v1/subject_access_review_spec.rs | 6 +- .../v1/subject_rules_review_status.rs | 4 +- .../v1beta1/non_resource_rule.rs | 4 +- .../authorization/v1beta1/resource_rule.rs | 8 +- .../v1beta1/subject_access_review_spec.rs | 6 +- .../v1beta1/subject_rules_review_status.rs | 4 +- .../v2beta1/horizontal_pod_autoscaler_spec.rs | 2 +- .../horizontal_pod_autoscaler_status.rs | 4 +- .../v2beta2/horizontal_pod_autoscaler_spec.rs | 2 +- .../horizontal_pod_autoscaler_status.rs | 4 +- .../autoscaling/v2beta2/hpa_scaling_rules.rs | 2 +- src/v1_20/api/batch/v1/job_status.rs | 9 +- .../api/batch/v1beta1/cron_job_status.rs | 2 +- .../api/batch/v2alpha1/cron_job_status.rs | 2 +- .../v1/certificate_signing_request_spec.rs | 8 +- .../v1/certificate_signing_request_status.rs | 9 +- .../certificate_signing_request_spec.rs | 8 +- .../certificate_signing_request_status.rs | 9 +- src/v1_20/api/core/v1/capabilities.rs | 4 +- .../v1/ceph_fs_persistent_volume_source.rs | 2 +- .../api/core/v1/ceph_fs_volume_source.rs | 2 +- src/v1_20/api/core/v1/component_status.rs | 9 +- src/v1_20/api/core/v1/config_map.rs | 8 +- .../api/core/v1/config_map_projection.rs | 2 +- .../api/core/v1/config_map_volume_source.rs | 2 +- src/v1_20/api/core/v1/container.rs | 42 +++- src/v1_20/api/core/v1/container_image.rs | 2 +- .../core/v1/csi_persistent_volume_source.rs | 4 +- src/v1_20/api/core/v1/csi_volume_source.rs | 4 +- .../api/core/v1/downward_api_projection.rs | 2 +- .../api/core/v1/downward_api_volume_source.rs | 2 +- src/v1_20/api/core/v1/endpoint_subset.rs | 6 +- src/v1_20/api/core/v1/endpoints.rs | 2 +- src/v1_20/api/core/v1/ephemeral_container.rs | 35 ++- src/v1_20/api/core/v1/exec_action.rs | 2 +- src/v1_20/api/core/v1/fc_volume_source.rs | 4 +- .../core/v1/flex_persistent_volume_source.rs | 4 +- src/v1_20/api/core/v1/flex_volume_source.rs | 4 +- src/v1_20/api/core/v1/host_alias.rs | 2 +- src/v1_20/api/core/v1/http_get_action.rs | 2 +- .../core/v1/iscsi_persistent_volume_source.rs | 2 +- src/v1_20/api/core/v1/iscsi_volume_source.rs | 2 +- src/v1_20/api/core/v1/limit_range_item.rs | 20 +- src/v1_20/api/core/v1/limit_range_spec.rs | 2 +- .../api/core/v1/load_balancer_ingress.rs | 2 +- src/v1_20/api/core/v1/load_balancer_status.rs | 2 +- src/v1_20/api/core/v1/namespace_spec.rs | 2 +- src/v1_20/api/core/v1/namespace_status.rs | 9 +- src/v1_20/api/core/v1/node_affinity.rs | 2 +- src/v1_20/api/core/v1/node_selector.rs | 2 +- .../api/core/v1/node_selector_requirement.rs | 2 +- src/v1_20/api/core/v1/node_selector_term.rs | 4 +- src/v1_20/api/core/v1/node_spec.rs | 4 +- src/v1_20/api/core/v1/node_status.rs | 32 ++- .../core/v1/persistent_volume_claim_spec.rs | 2 +- .../core/v1/persistent_volume_claim_status.rs | 15 +- .../api/core/v1/persistent_volume_spec.rs | 8 +- src/v1_20/api/core/v1/pod_affinity.rs | 4 +- src/v1_20/api/core/v1/pod_affinity_term.rs | 2 +- src/v1_20/api/core/v1/pod_anti_affinity.rs | 4 +- src/v1_20/api/core/v1/pod_dns_config.rs | 6 +- src/v1_20/api/core/v1/pod_security_context.rs | 4 +- src/v1_20/api/core/v1/pod_spec.rs | 75 ++++++- src/v1_20/api/core/v1/pod_status.rs | 24 +- .../api/core/v1/projected_volume_source.rs | 2 +- .../core/v1/rbd_persistent_volume_source.rs | 2 +- src/v1_20/api/core/v1/rbd_volume_source.rs | 2 +- .../core/v1/replication_controller_spec.rs | 4 +- .../core/v1/replication_controller_status.rs | 9 +- src/v1_20/api/core/v1/resource_quota_spec.rs | 6 +- .../api/core/v1/resource_quota_status.rs | 8 +- .../api/core/v1/resource_requirements.rs | 8 +- src/v1_20/api/core/v1/scope_selector.rs | 2 +- .../scoped_resource_selector_requirement.rs | 2 +- src/v1_20/api/core/v1/secret.rs | 8 +- src/v1_20/api/core/v1/secret_projection.rs | 2 +- src/v1_20/api/core/v1/secret_volume_source.rs | 2 +- src/v1_20/api/core/v1/service_account.rs | 11 +- src/v1_20/api/core/v1/service_spec.rs | 23 +- src/v1_20/api/core/v1/service_status.rs | 9 +- .../v1/topology_selector_label_requirement.rs | 2 +- .../api/core/v1/topology_selector_term.rs | 2 +- src/v1_20/api/discovery/v1beta1/endpoint.rs | 6 +- .../api/discovery/v1beta1/endpoint_slice.rs | 4 +- .../v1beta1/http_ingress_rule_value.rs | 2 +- .../api/extensions/v1beta1/ingress_spec.rs | 4 +- .../api/extensions/v1beta1/ingress_tls.rs | 2 +- .../flowcontrol/v1alpha1/flow_schema_spec.rs | 2 +- .../v1alpha1/flow_schema_status.rs | 9 +- .../v1alpha1/non_resource_policy_rule.rs | 4 +- .../v1alpha1/policy_rules_with_subjects.rs | 6 +- .../priority_level_configuration_status.rs | 9 +- .../v1alpha1/resource_policy_rule.rs | 8 +- .../flowcontrol/v1beta1/flow_schema_spec.rs | 2 +- .../flowcontrol/v1beta1/flow_schema_status.rs | 9 +- .../v1beta1/non_resource_policy_rule.rs | 4 +- .../v1beta1/policy_rules_with_subjects.rs | 6 +- .../priority_level_configuration_status.rs | 9 +- .../v1beta1/resource_policy_rule.rs | 8 +- .../networking/v1/http_ingress_rule_value.rs | 2 +- src/v1_20/api/networking/v1/ingress_spec.rs | 4 +- src/v1_20/api/networking/v1/ingress_tls.rs | 2 +- src/v1_20/api/networking/v1/ip_block.rs | 2 +- .../v1/network_policy_egress_rule.rs | 4 +- .../v1/network_policy_ingress_rule.rs | 4 +- .../api/networking/v1/network_policy_spec.rs | 6 +- .../v1beta1/http_ingress_rule_value.rs | 2 +- .../api/networking/v1beta1/ingress_spec.rs | 4 +- .../api/networking/v1beta1/ingress_tls.rs | 2 +- src/v1_20/api/node/v1/overhead.rs | 4 +- src/v1_20/api/node/v1/scheduling.rs | 6 +- src/v1_20/api/node/v1alpha1/overhead.rs | 4 +- src/v1_20/api/node/v1alpha1/scheduling.rs | 6 +- src/v1_20/api/node/v1beta1/overhead.rs | 4 +- src/v1_20/api/node/v1beta1/scheduling.rs | 6 +- .../v1beta1/fs_group_strategy_options.rs | 2 +- .../v1beta1/pod_disruption_budget_status.rs | 4 +- .../v1beta1/pod_security_policy_spec.rs | 22 +- .../v1beta1/run_as_group_strategy_options.rs | 2 +- .../v1beta1/run_as_user_strategy_options.rs | 2 +- .../v1beta1/runtime_class_strategy_options.rs | 2 +- .../supplemental_groups_strategy_options.rs | 2 +- src/v1_20/api/rbac/v1/aggregation_rule.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/v1/policy_rule.rs | 10 +- src/v1_20/api/rbac/v1/role.rs | 2 +- src/v1_20/api/rbac/v1/role_binding.rs | 2 +- .../api/rbac/v1alpha1/aggregation_rule.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/v1alpha1/policy_rule.rs | 10 +- src/v1_20/api/rbac/v1alpha1/role.rs | 2 +- src/v1_20/api/rbac/v1alpha1/role_binding.rs | 2 +- .../api/rbac/v1beta1/aggregation_rule.rs | 2 +- src/v1_20/api/rbac/v1beta1/cluster_role.rs | 2 +- .../api/rbac/v1beta1/cluster_role_binding.rs | 2 +- src/v1_20/api/rbac/v1beta1/policy_rule.rs | 10 +- src/v1_20/api/rbac/v1beta1/role.rs | 2 +- src/v1_20/api/rbac/v1beta1/role_binding.rs | 2 +- src/v1_20/api/storage/v1/csi_driver_spec.rs | 4 +- src/v1_20/api/storage/v1/csi_node_driver.rs | 2 +- src/v1_20/api/storage/v1/csi_node_spec.rs | 9 +- src/v1_20/api/storage/v1/storage_class.rs | 8 +- .../storage/v1/volume_attachment_status.rs | 4 +- .../v1alpha1/volume_attachment_status.rs | 4 +- .../api/storage/v1beta1/csi_driver_spec.rs | 4 +- .../api/storage/v1beta1/csi_node_driver.rs | 2 +- .../api/storage/v1beta1/csi_node_spec.rs | 9 +- .../api/storage/v1beta1/storage_class.rs | 8 +- .../v1beta1/volume_attachment_status.rs | 4 +- .../v1/custom_resource_definition_names.rs | 4 +- .../v1/custom_resource_definition_spec.rs | 2 +- .../v1/custom_resource_definition_status.rs | 4 +- .../v1/custom_resource_definition_version.rs | 2 +- .../apiextensions/v1/json_schema_props.rs | 28 ++- .../apiextensions/v1/webhook_conversion.rs | 2 +- .../v1beta1/custom_resource_conversion.rs | 2 +- .../custom_resource_definition_names.rs | 4 +- .../custom_resource_definition_spec.rs | 4 +- .../custom_resource_definition_status.rs | 4 +- .../custom_resource_definition_version.rs | 2 +- .../v1beta1/json_schema_props.rs | 28 ++- .../pkg/apis/meta/v1/api_group.rs | 4 +- .../pkg/apis/meta/v1/api_group_list.rs | 2 +- .../pkg/apis/meta/v1/api_resource.rs | 6 +- .../pkg/apis/meta/v1/api_resource_list.rs | 2 +- .../pkg/apis/meta/v1/api_versions.rs | 4 +- .../pkg/apis/meta/v1/delete_options.rs | 2 +- .../pkg/apis/meta/v1/label_selector.rs | 6 +- .../meta/v1/label_selector_requirement.rs | 2 +- .../pkg/apis/meta/v1/object_meta.rs | 21 +- .../pkg/apis/meta/v1/status_details.rs | 2 +- .../apiregistration/v1/api_service_status.rs | 9 +- .../v1beta1/api_service_status.rs | 9 +- src/v1_20/list.rs | 11 +- .../v1/mutating_webhook.rs | 4 +- .../v1/mutating_webhook_configuration.rs | 9 +- .../v1/rule_with_operations.rs | 8 +- .../v1/validating_webhook.rs | 4 +- .../v1/validating_webhook_configuration.rs | 9 +- .../v1beta1/mutating_webhook.rs | 4 +- .../v1beta1/mutating_webhook_configuration.rs | 9 +- .../v1beta1/rule_with_operations.rs | 8 +- .../v1beta1/validating_webhook.rs | 4 +- .../validating_webhook_configuration.rs | 9 +- .../v1alpha1/server_storage_version.rs | 2 +- .../v1alpha1/storage_version_status.rs | 18 +- src/v1_21/api/apps/v1/daemon_set_status.rs | 9 +- src/v1_21/api/apps/v1/deployment_status.rs | 9 +- src/v1_21/api/apps/v1/replica_set_status.rs | 9 +- src/v1_21/api/apps/v1/stateful_set_spec.rs | 2 +- src/v1_21/api/apps/v1/stateful_set_status.rs | 9 +- .../authentication/v1/token_request_spec.rs | 2 +- .../authentication/v1/token_review_spec.rs | 2 +- .../authentication/v1/token_review_status.rs | 2 +- src/v1_21/api/authentication/v1/user_info.rs | 6 +- .../v1beta1/token_review_spec.rs | 2 +- .../v1beta1/token_review_status.rs | 2 +- .../api/authentication/v1beta1/user_info.rs | 6 +- .../api/authorization/v1/non_resource_rule.rs | 4 +- .../api/authorization/v1/resource_rule.rs | 8 +- .../v1/subject_access_review_spec.rs | 6 +- .../v1/subject_rules_review_status.rs | 4 +- .../v1beta1/non_resource_rule.rs | 4 +- .../authorization/v1beta1/resource_rule.rs | 8 +- .../v1beta1/subject_access_review_spec.rs | 6 +- .../v1beta1/subject_rules_review_status.rs | 4 +- .../v2beta1/horizontal_pod_autoscaler_spec.rs | 2 +- .../horizontal_pod_autoscaler_status.rs | 4 +- .../v2beta2/horizontal_pod_autoscaler_spec.rs | 2 +- .../horizontal_pod_autoscaler_status.rs | 4 +- .../autoscaling/v2beta2/hpa_scaling_rules.rs | 2 +- src/v1_21/api/batch/v1/cron_job_status.rs | 2 +- src/v1_21/api/batch/v1/job_status.rs | 9 +- .../api/batch/v1beta1/cron_job_status.rs | 2 +- .../v1/certificate_signing_request_spec.rs | 8 +- .../v1/certificate_signing_request_status.rs | 9 +- .../certificate_signing_request_spec.rs | 8 +- .../certificate_signing_request_status.rs | 9 +- src/v1_21/api/core/v1/capabilities.rs | 4 +- .../v1/ceph_fs_persistent_volume_source.rs | 2 +- .../api/core/v1/ceph_fs_volume_source.rs | 2 +- src/v1_21/api/core/v1/component_status.rs | 9 +- src/v1_21/api/core/v1/config_map.rs | 8 +- .../api/core/v1/config_map_projection.rs | 2 +- .../api/core/v1/config_map_volume_source.rs | 2 +- src/v1_21/api/core/v1/container.rs | 42 +++- src/v1_21/api/core/v1/container_image.rs | 2 +- .../core/v1/csi_persistent_volume_source.rs | 4 +- src/v1_21/api/core/v1/csi_volume_source.rs | 4 +- .../api/core/v1/downward_api_projection.rs | 2 +- .../api/core/v1/downward_api_volume_source.rs | 2 +- src/v1_21/api/core/v1/endpoint_subset.rs | 6 +- src/v1_21/api/core/v1/endpoints.rs | 2 +- src/v1_21/api/core/v1/ephemeral_container.rs | 35 ++- src/v1_21/api/core/v1/ephemeral_containers.rs | 9 +- src/v1_21/api/core/v1/exec_action.rs | 2 +- src/v1_21/api/core/v1/fc_volume_source.rs | 4 +- .../core/v1/flex_persistent_volume_source.rs | 4 +- src/v1_21/api/core/v1/flex_volume_source.rs | 4 +- src/v1_21/api/core/v1/host_alias.rs | 2 +- src/v1_21/api/core/v1/http_get_action.rs | 2 +- .../core/v1/iscsi_persistent_volume_source.rs | 2 +- src/v1_21/api/core/v1/iscsi_volume_source.rs | 2 +- src/v1_21/api/core/v1/limit_range_item.rs | 20 +- src/v1_21/api/core/v1/limit_range_spec.rs | 2 +- .../api/core/v1/load_balancer_ingress.rs | 2 +- src/v1_21/api/core/v1/load_balancer_status.rs | 2 +- src/v1_21/api/core/v1/namespace_spec.rs | 2 +- src/v1_21/api/core/v1/namespace_status.rs | 9 +- src/v1_21/api/core/v1/node_affinity.rs | 2 +- src/v1_21/api/core/v1/node_selector.rs | 2 +- .../api/core/v1/node_selector_requirement.rs | 2 +- src/v1_21/api/core/v1/node_selector_term.rs | 4 +- src/v1_21/api/core/v1/node_spec.rs | 4 +- src/v1_21/api/core/v1/node_status.rs | 32 ++- .../core/v1/persistent_volume_claim_spec.rs | 2 +- .../core/v1/persistent_volume_claim_status.rs | 15 +- .../api/core/v1/persistent_volume_spec.rs | 8 +- src/v1_21/api/core/v1/pod_affinity.rs | 4 +- src/v1_21/api/core/v1/pod_affinity_term.rs | 2 +- src/v1_21/api/core/v1/pod_anti_affinity.rs | 4 +- src/v1_21/api/core/v1/pod_dns_config.rs | 6 +- src/v1_21/api/core/v1/pod_security_context.rs | 4 +- src/v1_21/api/core/v1/pod_spec.rs | 75 ++++++- src/v1_21/api/core/v1/pod_status.rs | 24 +- .../api/core/v1/projected_volume_source.rs | 2 +- .../core/v1/rbd_persistent_volume_source.rs | 2 +- src/v1_21/api/core/v1/rbd_volume_source.rs | 2 +- .../core/v1/replication_controller_spec.rs | 4 +- .../core/v1/replication_controller_status.rs | 9 +- src/v1_21/api/core/v1/resource_quota_spec.rs | 6 +- .../api/core/v1/resource_quota_status.rs | 8 +- .../api/core/v1/resource_requirements.rs | 8 +- src/v1_21/api/core/v1/scope_selector.rs | 2 +- .../scoped_resource_selector_requirement.rs | 2 +- src/v1_21/api/core/v1/secret.rs | 8 +- src/v1_21/api/core/v1/secret_projection.rs | 2 +- src/v1_21/api/core/v1/secret_volume_source.rs | 2 +- src/v1_21/api/core/v1/service_account.rs | 11 +- src/v1_21/api/core/v1/service_spec.rs | 23 +- src/v1_21/api/core/v1/service_status.rs | 9 +- .../v1/topology_selector_label_requirement.rs | 2 +- .../api/core/v1/topology_selector_term.rs | 2 +- src/v1_21/api/discovery/v1/endpoint.rs | 6 +- src/v1_21/api/discovery/v1/endpoint_hints.rs | 2 +- src/v1_21/api/discovery/v1/endpoint_slice.rs | 4 +- src/v1_21/api/discovery/v1beta1/endpoint.rs | 6 +- .../api/discovery/v1beta1/endpoint_hints.rs | 2 +- .../api/discovery/v1beta1/endpoint_slice.rs | 4 +- .../v1beta1/http_ingress_rule_value.rs | 2 +- .../api/extensions/v1beta1/ingress_spec.rs | 4 +- .../api/extensions/v1beta1/ingress_tls.rs | 2 +- .../flowcontrol/v1beta1/flow_schema_spec.rs | 2 +- .../flowcontrol/v1beta1/flow_schema_status.rs | 9 +- .../v1beta1/non_resource_policy_rule.rs | 4 +- .../v1beta1/policy_rules_with_subjects.rs | 6 +- .../priority_level_configuration_status.rs | 9 +- .../v1beta1/resource_policy_rule.rs | 8 +- .../networking/v1/http_ingress_rule_value.rs | 2 +- src/v1_21/api/networking/v1/ingress_spec.rs | 4 +- src/v1_21/api/networking/v1/ingress_tls.rs | 2 +- src/v1_21/api/networking/v1/ip_block.rs | 2 +- .../v1/network_policy_egress_rule.rs | 4 +- .../v1/network_policy_ingress_rule.rs | 4 +- .../api/networking/v1/network_policy_spec.rs | 6 +- .../v1beta1/http_ingress_rule_value.rs | 2 +- .../api/networking/v1beta1/ingress_spec.rs | 4 +- .../api/networking/v1beta1/ingress_tls.rs | 2 +- src/v1_21/api/node/v1/overhead.rs | 4 +- src/v1_21/api/node/v1/scheduling.rs | 6 +- src/v1_21/api/node/v1alpha1/overhead.rs | 4 +- src/v1_21/api/node/v1alpha1/scheduling.rs | 6 +- src/v1_21/api/node/v1beta1/overhead.rs | 4 +- src/v1_21/api/node/v1beta1/scheduling.rs | 6 +- .../policy/v1/pod_disruption_budget_status.rs | 13 +- .../v1beta1/fs_group_strategy_options.rs | 2 +- .../v1beta1/pod_disruption_budget_status.rs | 13 +- .../v1beta1/pod_security_policy_spec.rs | 22 +- .../v1beta1/run_as_group_strategy_options.rs | 2 +- .../v1beta1/run_as_user_strategy_options.rs | 2 +- .../v1beta1/runtime_class_strategy_options.rs | 2 +- .../supplemental_groups_strategy_options.rs | 2 +- src/v1_21/api/rbac/v1/aggregation_rule.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/v1/policy_rule.rs | 10 +- src/v1_21/api/rbac/v1/role.rs | 2 +- src/v1_21/api/rbac/v1/role_binding.rs | 2 +- .../api/rbac/v1alpha1/aggregation_rule.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/v1alpha1/policy_rule.rs | 10 +- src/v1_21/api/rbac/v1alpha1/role.rs | 2 +- src/v1_21/api/rbac/v1alpha1/role_binding.rs | 2 +- .../api/rbac/v1beta1/aggregation_rule.rs | 2 +- src/v1_21/api/rbac/v1beta1/cluster_role.rs | 2 +- .../api/rbac/v1beta1/cluster_role_binding.rs | 2 +- src/v1_21/api/rbac/v1beta1/policy_rule.rs | 10 +- src/v1_21/api/rbac/v1beta1/role.rs | 2 +- src/v1_21/api/rbac/v1beta1/role_binding.rs | 2 +- src/v1_21/api/storage/v1/csi_driver_spec.rs | 4 +- src/v1_21/api/storage/v1/csi_node_driver.rs | 2 +- src/v1_21/api/storage/v1/csi_node_spec.rs | 9 +- src/v1_21/api/storage/v1/storage_class.rs | 8 +- .../storage/v1/volume_attachment_status.rs | 4 +- .../v1alpha1/volume_attachment_status.rs | 4 +- .../api/storage/v1beta1/csi_driver_spec.rs | 4 +- .../api/storage/v1beta1/csi_node_driver.rs | 2 +- .../api/storage/v1beta1/csi_node_spec.rs | 9 +- .../api/storage/v1beta1/storage_class.rs | 8 +- .../v1beta1/volume_attachment_status.rs | 4 +- .../v1/custom_resource_definition_names.rs | 4 +- .../v1/custom_resource_definition_spec.rs | 2 +- .../v1/custom_resource_definition_status.rs | 11 +- .../v1/custom_resource_definition_version.rs | 2 +- .../apiextensions/v1/json_schema_props.rs | 28 ++- .../apiextensions/v1/webhook_conversion.rs | 2 +- .../v1beta1/custom_resource_conversion.rs | 2 +- .../custom_resource_definition_names.rs | 4 +- .../custom_resource_definition_spec.rs | 4 +- .../custom_resource_definition_status.rs | 11 +- .../custom_resource_definition_version.rs | 2 +- .../v1beta1/json_schema_props.rs | 28 ++- .../pkg/apis/meta/v1/api_group.rs | 4 +- .../pkg/apis/meta/v1/api_group_list.rs | 2 +- .../pkg/apis/meta/v1/api_resource.rs | 6 +- .../pkg/apis/meta/v1/api_resource_list.rs | 2 +- .../pkg/apis/meta/v1/api_versions.rs | 4 +- .../pkg/apis/meta/v1/delete_options.rs | 2 +- .../pkg/apis/meta/v1/label_selector.rs | 6 +- .../meta/v1/label_selector_requirement.rs | 2 +- .../pkg/apis/meta/v1/object_meta.rs | 21 +- .../pkg/apis/meta/v1/status_details.rs | 2 +- .../apiregistration/v1/api_service_status.rs | 9 +- .../v1beta1/api_service_status.rs | 9 +- src/v1_21/list.rs | 11 +- .../v1/mutating_webhook.rs | 4 +- .../v1/mutating_webhook_configuration.rs | 9 +- .../v1/rule_with_operations.rs | 8 +- .../v1/validating_webhook.rs | 4 +- .../v1/validating_webhook_configuration.rs | 9 +- .../v1alpha1/server_storage_version.rs | 2 +- .../v1alpha1/storage_version_status.rs | 18 +- src/v1_22/api/apps/v1/daemon_set_status.rs | 9 +- src/v1_22/api/apps/v1/deployment_status.rs | 9 +- src/v1_22/api/apps/v1/replica_set_status.rs | 9 +- src/v1_22/api/apps/v1/stateful_set_spec.rs | 2 +- src/v1_22/api/apps/v1/stateful_set_status.rs | 9 +- .../authentication/v1/token_request_spec.rs | 2 +- .../authentication/v1/token_review_spec.rs | 2 +- .../authentication/v1/token_review_status.rs | 2 +- src/v1_22/api/authentication/v1/user_info.rs | 6 +- .../api/authorization/v1/non_resource_rule.rs | 4 +- .../api/authorization/v1/resource_rule.rs | 8 +- .../v1/subject_access_review_spec.rs | 6 +- .../v1/subject_rules_review_status.rs | 4 +- .../v2beta1/horizontal_pod_autoscaler_spec.rs | 2 +- .../horizontal_pod_autoscaler_status.rs | 4 +- .../v2beta2/horizontal_pod_autoscaler_spec.rs | 2 +- .../horizontal_pod_autoscaler_status.rs | 4 +- .../autoscaling/v2beta2/hpa_scaling_rules.rs | 2 +- src/v1_22/api/batch/v1/cron_job_status.rs | 2 +- src/v1_22/api/batch/v1/job_status.rs | 9 +- .../api/batch/v1/uncounted_terminated_pods.rs | 4 +- .../api/batch/v1beta1/cron_job_status.rs | 2 +- .../v1/certificate_signing_request_spec.rs | 8 +- .../v1/certificate_signing_request_status.rs | 9 +- src/v1_22/api/core/v1/capabilities.rs | 4 +- .../v1/ceph_fs_persistent_volume_source.rs | 2 +- .../api/core/v1/ceph_fs_volume_source.rs | 2 +- src/v1_22/api/core/v1/component_status.rs | 9 +- src/v1_22/api/core/v1/config_map.rs | 8 +- .../api/core/v1/config_map_projection.rs | 2 +- .../api/core/v1/config_map_volume_source.rs | 2 +- src/v1_22/api/core/v1/container.rs | 42 +++- src/v1_22/api/core/v1/container_image.rs | 2 +- .../core/v1/csi_persistent_volume_source.rs | 4 +- src/v1_22/api/core/v1/csi_volume_source.rs | 4 +- .../api/core/v1/downward_api_projection.rs | 2 +- .../api/core/v1/downward_api_volume_source.rs | 2 +- src/v1_22/api/core/v1/endpoint_subset.rs | 6 +- src/v1_22/api/core/v1/endpoints.rs | 2 +- src/v1_22/api/core/v1/ephemeral_container.rs | 35 ++- src/v1_22/api/core/v1/exec_action.rs | 2 +- src/v1_22/api/core/v1/fc_volume_source.rs | 4 +- .../core/v1/flex_persistent_volume_source.rs | 4 +- src/v1_22/api/core/v1/flex_volume_source.rs | 4 +- src/v1_22/api/core/v1/host_alias.rs | 2 +- src/v1_22/api/core/v1/http_get_action.rs | 2 +- .../core/v1/iscsi_persistent_volume_source.rs | 2 +- src/v1_22/api/core/v1/iscsi_volume_source.rs | 2 +- src/v1_22/api/core/v1/limit_range_item.rs | 20 +- src/v1_22/api/core/v1/limit_range_spec.rs | 2 +- .../api/core/v1/load_balancer_ingress.rs | 2 +- src/v1_22/api/core/v1/load_balancer_status.rs | 2 +- src/v1_22/api/core/v1/namespace_spec.rs | 2 +- src/v1_22/api/core/v1/namespace_status.rs | 9 +- src/v1_22/api/core/v1/node_affinity.rs | 2 +- src/v1_22/api/core/v1/node_selector.rs | 2 +- .../api/core/v1/node_selector_requirement.rs | 2 +- src/v1_22/api/core/v1/node_selector_term.rs | 4 +- src/v1_22/api/core/v1/node_spec.rs | 4 +- src/v1_22/api/core/v1/node_status.rs | 32 ++- .../core/v1/persistent_volume_claim_spec.rs | 2 +- .../core/v1/persistent_volume_claim_status.rs | 15 +- .../api/core/v1/persistent_volume_spec.rs | 8 +- src/v1_22/api/core/v1/pod_affinity.rs | 4 +- src/v1_22/api/core/v1/pod_affinity_term.rs | 2 +- src/v1_22/api/core/v1/pod_anti_affinity.rs | 4 +- src/v1_22/api/core/v1/pod_dns_config.rs | 6 +- src/v1_22/api/core/v1/pod_security_context.rs | 4 +- src/v1_22/api/core/v1/pod_spec.rs | 73 +++++- src/v1_22/api/core/v1/pod_status.rs | 24 +- .../api/core/v1/projected_volume_source.rs | 2 +- .../core/v1/rbd_persistent_volume_source.rs | 2 +- src/v1_22/api/core/v1/rbd_volume_source.rs | 2 +- .../core/v1/replication_controller_spec.rs | 2 +- .../core/v1/replication_controller_status.rs | 9 +- src/v1_22/api/core/v1/resource_quota_spec.rs | 6 +- .../api/core/v1/resource_quota_status.rs | 8 +- .../api/core/v1/resource_requirements.rs | 8 +- src/v1_22/api/core/v1/scope_selector.rs | 2 +- .../scoped_resource_selector_requirement.rs | 2 +- src/v1_22/api/core/v1/secret.rs | 8 +- src/v1_22/api/core/v1/secret_projection.rs | 2 +- src/v1_22/api/core/v1/secret_volume_source.rs | 2 +- src/v1_22/api/core/v1/service_account.rs | 11 +- src/v1_22/api/core/v1/service_spec.rs | 19 +- src/v1_22/api/core/v1/service_status.rs | 9 +- .../v1/topology_selector_label_requirement.rs | 2 +- .../api/core/v1/topology_selector_term.rs | 2 +- src/v1_22/api/discovery/v1/endpoint.rs | 6 +- src/v1_22/api/discovery/v1/endpoint_hints.rs | 2 +- src/v1_22/api/discovery/v1/endpoint_slice.rs | 4 +- src/v1_22/api/discovery/v1beta1/endpoint.rs | 6 +- .../api/discovery/v1beta1/endpoint_hints.rs | 2 +- .../api/discovery/v1beta1/endpoint_slice.rs | 4 +- .../flowcontrol/v1beta1/flow_schema_spec.rs | 2 +- .../flowcontrol/v1beta1/flow_schema_status.rs | 9 +- .../v1beta1/non_resource_policy_rule.rs | 4 +- .../v1beta1/policy_rules_with_subjects.rs | 6 +- .../priority_level_configuration_status.rs | 9 +- .../v1beta1/resource_policy_rule.rs | 8 +- .../networking/v1/http_ingress_rule_value.rs | 2 +- src/v1_22/api/networking/v1/ingress_spec.rs | 4 +- src/v1_22/api/networking/v1/ingress_tls.rs | 2 +- src/v1_22/api/networking/v1/ip_block.rs | 2 +- .../v1/network_policy_egress_rule.rs | 4 +- .../v1/network_policy_ingress_rule.rs | 4 +- .../api/networking/v1/network_policy_spec.rs | 6 +- src/v1_22/api/node/v1/overhead.rs | 4 +- src/v1_22/api/node/v1/scheduling.rs | 4 +- src/v1_22/api/node/v1alpha1/overhead.rs | 4 +- src/v1_22/api/node/v1alpha1/scheduling.rs | 4 +- src/v1_22/api/node/v1beta1/overhead.rs | 4 +- src/v1_22/api/node/v1beta1/scheduling.rs | 4 +- .../policy/v1/pod_disruption_budget_status.rs | 13 +- .../v1beta1/fs_group_strategy_options.rs | 2 +- .../v1beta1/pod_disruption_budget_status.rs | 13 +- .../v1beta1/pod_security_policy_spec.rs | 22 +- .../v1beta1/run_as_group_strategy_options.rs | 2 +- .../v1beta1/run_as_user_strategy_options.rs | 2 +- .../v1beta1/runtime_class_strategy_options.rs | 2 +- .../supplemental_groups_strategy_options.rs | 2 +- src/v1_22/api/rbac/v1/aggregation_rule.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/v1/policy_rule.rs | 10 +- src/v1_22/api/rbac/v1/role.rs | 2 +- src/v1_22/api/rbac/v1/role_binding.rs | 2 +- .../api/rbac/v1alpha1/aggregation_rule.rs | 2 +- src/v1_22/api/rbac/v1alpha1/cluster_role.rs | 2 +- .../api/rbac/v1alpha1/cluster_role_binding.rs | 2 +- src/v1_22/api/rbac/v1alpha1/policy_rule.rs | 10 +- src/v1_22/api/rbac/v1alpha1/role.rs | 2 +- src/v1_22/api/rbac/v1alpha1/role_binding.rs | 2 +- src/v1_22/api/storage/v1/csi_driver_spec.rs | 4 +- src/v1_22/api/storage/v1/csi_node_driver.rs | 2 +- src/v1_22/api/storage/v1/csi_node_spec.rs | 9 +- src/v1_22/api/storage/v1/storage_class.rs | 8 +- .../storage/v1/volume_attachment_status.rs | 4 +- .../v1alpha1/volume_attachment_status.rs | 4 +- .../v1/custom_resource_definition_names.rs | 4 +- .../v1/custom_resource_definition_spec.rs | 2 +- .../v1/custom_resource_definition_status.rs | 11 +- .../v1/custom_resource_definition_version.rs | 2 +- .../apiextensions/v1/json_schema_props.rs | 28 ++- .../apiextensions/v1/webhook_conversion.rs | 2 +- .../pkg/apis/meta/v1/api_group.rs | 4 +- .../pkg/apis/meta/v1/api_group_list.rs | 2 +- .../pkg/apis/meta/v1/api_resource.rs | 6 +- .../pkg/apis/meta/v1/api_resource_list.rs | 2 +- .../pkg/apis/meta/v1/api_versions.rs | 4 +- .../pkg/apis/meta/v1/delete_options.rs | 2 +- .../pkg/apis/meta/v1/label_selector.rs | 6 +- .../meta/v1/label_selector_requirement.rs | 2 +- .../pkg/apis/meta/v1/object_meta.rs | 21 +- .../pkg/apis/meta/v1/status_details.rs | 2 +- .../apiregistration/v1/api_service_status.rs | 9 +- src/v1_22/list.rs | 11 +- .../v1/mutating_webhook.rs | 4 +- .../v1/mutating_webhook_configuration.rs | 9 +- .../v1/rule_with_operations.rs | 8 +- .../v1/validating_webhook.rs | 4 +- .../v1/validating_webhook_configuration.rs | 9 +- .../v1alpha1/server_storage_version.rs | 2 +- .../v1alpha1/storage_version_status.rs | 18 +- src/v1_23/api/apps/v1/daemon_set_status.rs | 9 +- src/v1_23/api/apps/v1/deployment_status.rs | 9 +- src/v1_23/api/apps/v1/replica_set_status.rs | 9 +- src/v1_23/api/apps/v1/stateful_set_spec.rs | 2 +- src/v1_23/api/apps/v1/stateful_set_status.rs | 9 +- .../authentication/v1/token_request_spec.rs | 2 +- .../authentication/v1/token_review_spec.rs | 2 +- .../authentication/v1/token_review_status.rs | 2 +- src/v1_23/api/authentication/v1/user_info.rs | 6 +- .../api/authorization/v1/non_resource_rule.rs | 4 +- .../api/authorization/v1/resource_rule.rs | 8 +- .../v1/subject_access_review_spec.rs | 6 +- .../v1/subject_rules_review_status.rs | 4 +- .../v2/horizontal_pod_autoscaler_spec.rs | 2 +- .../v2/horizontal_pod_autoscaler_status.rs | 11 +- .../api/autoscaling/v2/hpa_scaling_rules.rs | 2 +- .../v2beta1/horizontal_pod_autoscaler_spec.rs | 2 +- .../horizontal_pod_autoscaler_status.rs | 4 +- .../v2beta2/horizontal_pod_autoscaler_spec.rs | 2 +- .../horizontal_pod_autoscaler_status.rs | 4 +- .../autoscaling/v2beta2/hpa_scaling_rules.rs | 2 +- src/v1_23/api/batch/v1/cron_job_status.rs | 2 +- src/v1_23/api/batch/v1/job_status.rs | 9 +- .../api/batch/v1/uncounted_terminated_pods.rs | 4 +- .../api/batch/v1beta1/cron_job_status.rs | 2 +- .../v1/certificate_signing_request_spec.rs | 8 +- .../v1/certificate_signing_request_status.rs | 9 +- src/v1_23/api/core/v1/capabilities.rs | 4 +- .../v1/ceph_fs_persistent_volume_source.rs | 2 +- .../api/core/v1/ceph_fs_volume_source.rs | 2 +- src/v1_23/api/core/v1/component_status.rs | 9 +- src/v1_23/api/core/v1/config_map.rs | 8 +- .../api/core/v1/config_map_projection.rs | 2 +- .../api/core/v1/config_map_volume_source.rs | 2 +- src/v1_23/api/core/v1/container.rs | 42 +++- src/v1_23/api/core/v1/container_image.rs | 2 +- .../core/v1/csi_persistent_volume_source.rs | 4 +- src/v1_23/api/core/v1/csi_volume_source.rs | 4 +- .../api/core/v1/downward_api_projection.rs | 2 +- .../api/core/v1/downward_api_volume_source.rs | 2 +- src/v1_23/api/core/v1/endpoint_subset.rs | 6 +- src/v1_23/api/core/v1/endpoints.rs | 2 +- src/v1_23/api/core/v1/ephemeral_container.rs | 42 +++- src/v1_23/api/core/v1/exec_action.rs | 2 +- src/v1_23/api/core/v1/fc_volume_source.rs | 4 +- .../core/v1/flex_persistent_volume_source.rs | 4 +- src/v1_23/api/core/v1/flex_volume_source.rs | 4 +- src/v1_23/api/core/v1/host_alias.rs | 2 +- src/v1_23/api/core/v1/http_get_action.rs | 2 +- .../core/v1/iscsi_persistent_volume_source.rs | 2 +- src/v1_23/api/core/v1/iscsi_volume_source.rs | 2 +- src/v1_23/api/core/v1/limit_range_item.rs | 20 +- src/v1_23/api/core/v1/limit_range_spec.rs | 2 +- .../api/core/v1/load_balancer_ingress.rs | 2 +- src/v1_23/api/core/v1/load_balancer_status.rs | 2 +- src/v1_23/api/core/v1/namespace_spec.rs | 2 +- src/v1_23/api/core/v1/namespace_status.rs | 9 +- src/v1_23/api/core/v1/node_affinity.rs | 2 +- src/v1_23/api/core/v1/node_selector.rs | 2 +- .../api/core/v1/node_selector_requirement.rs | 2 +- src/v1_23/api/core/v1/node_selector_term.rs | 4 +- src/v1_23/api/core/v1/node_spec.rs | 4 +- src/v1_23/api/core/v1/node_status.rs | 32 ++- .../core/v1/persistent_volume_claim_spec.rs | 2 +- .../core/v1/persistent_volume_claim_status.rs | 19 +- .../api/core/v1/persistent_volume_spec.rs | 8 +- src/v1_23/api/core/v1/pod_affinity.rs | 4 +- src/v1_23/api/core/v1/pod_affinity_term.rs | 2 +- src/v1_23/api/core/v1/pod_anti_affinity.rs | 4 +- src/v1_23/api/core/v1/pod_dns_config.rs | 6 +- src/v1_23/api/core/v1/pod_security_context.rs | 4 +- src/v1_23/api/core/v1/pod_spec.rs | 73 +++++- src/v1_23/api/core/v1/pod_status.rs | 24 +- .../api/core/v1/projected_volume_source.rs | 2 +- .../core/v1/rbd_persistent_volume_source.rs | 2 +- src/v1_23/api/core/v1/rbd_volume_source.rs | 2 +- .../core/v1/replication_controller_spec.rs | 2 +- .../core/v1/replication_controller_status.rs | 9 +- src/v1_23/api/core/v1/resource_quota_spec.rs | 6 +- .../api/core/v1/resource_quota_status.rs | 8 +- .../api/core/v1/resource_requirements.rs | 8 +- src/v1_23/api/core/v1/scope_selector.rs | 2 +- .../scoped_resource_selector_requirement.rs | 2 +- src/v1_23/api/core/v1/secret.rs | 8 +- src/v1_23/api/core/v1/secret_projection.rs | 2 +- src/v1_23/api/core/v1/secret_volume_source.rs | 2 +- src/v1_23/api/core/v1/service_account.rs | 11 +- src/v1_23/api/core/v1/service_spec.rs | 19 +- src/v1_23/api/core/v1/service_status.rs | 9 +- .../v1/topology_selector_label_requirement.rs | 2 +- .../api/core/v1/topology_selector_term.rs | 2 +- src/v1_23/api/discovery/v1/endpoint.rs | 6 +- src/v1_23/api/discovery/v1/endpoint_hints.rs | 2 +- src/v1_23/api/discovery/v1/endpoint_slice.rs | 4 +- src/v1_23/api/discovery/v1beta1/endpoint.rs | 6 +- .../api/discovery/v1beta1/endpoint_hints.rs | 2 +- .../api/discovery/v1beta1/endpoint_slice.rs | 4 +- .../flowcontrol/v1beta1/flow_schema_spec.rs | 2 +- .../flowcontrol/v1beta1/flow_schema_status.rs | 9 +- .../v1beta1/non_resource_policy_rule.rs | 4 +- .../v1beta1/policy_rules_with_subjects.rs | 6 +- .../priority_level_configuration_status.rs | 9 +- .../v1beta1/resource_policy_rule.rs | 8 +- .../flowcontrol/v1beta2/flow_schema_spec.rs | 2 +- .../flowcontrol/v1beta2/flow_schema_status.rs | 9 +- .../v1beta2/non_resource_policy_rule.rs | 4 +- .../v1beta2/policy_rules_with_subjects.rs | 6 +- .../priority_level_configuration_status.rs | 9 +- .../v1beta2/resource_policy_rule.rs | 8 +- .../networking/v1/http_ingress_rule_value.rs | 2 +- src/v1_23/api/networking/v1/ingress_spec.rs | 4 +- src/v1_23/api/networking/v1/ingress_tls.rs | 2 +- src/v1_23/api/networking/v1/ip_block.rs | 2 +- .../v1/network_policy_egress_rule.rs | 4 +- .../v1/network_policy_ingress_rule.rs | 4 +- .../api/networking/v1/network_policy_spec.rs | 6 +- src/v1_23/api/node/v1/overhead.rs | 4 +- src/v1_23/api/node/v1/scheduling.rs | 4 +- src/v1_23/api/node/v1alpha1/overhead.rs | 4 +- src/v1_23/api/node/v1alpha1/scheduling.rs | 4 +- src/v1_23/api/node/v1beta1/overhead.rs | 4 +- src/v1_23/api/node/v1beta1/scheduling.rs | 4 +- .../policy/v1/pod_disruption_budget_status.rs | 13 +- .../v1beta1/fs_group_strategy_options.rs | 2 +- .../v1beta1/pod_disruption_budget_status.rs | 13 +- .../v1beta1/pod_security_policy_spec.rs | 22 +- .../v1beta1/run_as_group_strategy_options.rs | 2 +- .../v1beta1/run_as_user_strategy_options.rs | 2 +- .../v1beta1/runtime_class_strategy_options.rs | 2 +- .../supplemental_groups_strategy_options.rs | 2 +- src/v1_23/api/rbac/v1/aggregation_rule.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/rbac/v1/policy_rule.rs | 10 +- src/v1_23/api/rbac/v1/role.rs | 2 +- src/v1_23/api/rbac/v1/role_binding.rs | 2 +- src/v1_23/api/storage/v1/csi_driver_spec.rs | 4 +- src/v1_23/api/storage/v1/csi_node_driver.rs | 2 +- src/v1_23/api/storage/v1/csi_node_spec.rs | 9 +- src/v1_23/api/storage/v1/storage_class.rs | 8 +- .../storage/v1/volume_attachment_status.rs | 4 +- .../v1/custom_resource_definition_names.rs | 4 +- .../v1/custom_resource_definition_spec.rs | 2 +- .../v1/custom_resource_definition_status.rs | 11 +- .../v1/custom_resource_definition_version.rs | 2 +- .../apiextensions/v1/json_schema_props.rs | 37 ++- .../apiextensions/v1/webhook_conversion.rs | 2 +- .../pkg/apis/meta/v1/api_group.rs | 4 +- .../pkg/apis/meta/v1/api_group_list.rs | 2 +- .../pkg/apis/meta/v1/api_resource.rs | 6 +- .../pkg/apis/meta/v1/api_resource_list.rs | 2 +- .../pkg/apis/meta/v1/api_versions.rs | 4 +- .../pkg/apis/meta/v1/delete_options.rs | 2 +- .../pkg/apis/meta/v1/label_selector.rs | 6 +- .../meta/v1/label_selector_requirement.rs | 2 +- .../pkg/apis/meta/v1/object_meta.rs | 21 +- .../pkg/apis/meta/v1/status_details.rs | 2 +- .../apiregistration/v1/api_service_status.rs | 9 +- src/v1_23/list.rs | 11 +- .../v1/mutating_webhook.rs | 4 +- .../v1/mutating_webhook_configuration.rs | 9 +- .../v1/rule_with_operations.rs | 8 +- .../v1/validating_webhook.rs | 4 +- .../v1/validating_webhook_configuration.rs | 9 +- .../v1alpha1/server_storage_version.rs | 2 +- .../v1alpha1/storage_version_status.rs | 18 +- src/v1_24/api/apps/v1/daemon_set_status.rs | 9 +- src/v1_24/api/apps/v1/deployment_status.rs | 9 +- src/v1_24/api/apps/v1/replica_set_status.rs | 9 +- src/v1_24/api/apps/v1/stateful_set_spec.rs | 2 +- src/v1_24/api/apps/v1/stateful_set_status.rs | 9 +- .../authentication/v1/token_request_spec.rs | 2 +- .../authentication/v1/token_review_spec.rs | 2 +- .../authentication/v1/token_review_status.rs | 2 +- src/v1_24/api/authentication/v1/user_info.rs | 6 +- .../api/authorization/v1/non_resource_rule.rs | 4 +- .../api/authorization/v1/resource_rule.rs | 8 +- .../v1/subject_access_review_spec.rs | 6 +- .../v1/subject_rules_review_status.rs | 4 +- .../v2/horizontal_pod_autoscaler_spec.rs | 2 +- .../v2/horizontal_pod_autoscaler_status.rs | 11 +- .../api/autoscaling/v2/hpa_scaling_rules.rs | 2 +- .../v2beta1/horizontal_pod_autoscaler_spec.rs | 2 +- .../horizontal_pod_autoscaler_status.rs | 4 +- .../v2beta2/horizontal_pod_autoscaler_spec.rs | 2 +- .../horizontal_pod_autoscaler_status.rs | 4 +- .../autoscaling/v2beta2/hpa_scaling_rules.rs | 2 +- src/v1_24/api/batch/v1/cron_job_status.rs | 2 +- src/v1_24/api/batch/v1/job_status.rs | 9 +- .../api/batch/v1/uncounted_terminated_pods.rs | 4 +- .../api/batch/v1beta1/cron_job_status.rs | 2 +- .../v1/certificate_signing_request_spec.rs | 8 +- .../v1/certificate_signing_request_status.rs | 9 +- src/v1_24/api/core/v1/capabilities.rs | 4 +- .../v1/ceph_fs_persistent_volume_source.rs | 2 +- .../api/core/v1/ceph_fs_volume_source.rs | 2 +- src/v1_24/api/core/v1/component_status.rs | 9 +- src/v1_24/api/core/v1/config_map.rs | 8 +- .../api/core/v1/config_map_projection.rs | 2 +- .../api/core/v1/config_map_volume_source.rs | 2 +- src/v1_24/api/core/v1/container.rs | 42 +++- src/v1_24/api/core/v1/container_image.rs | 2 +- .../core/v1/csi_persistent_volume_source.rs | 4 +- src/v1_24/api/core/v1/csi_volume_source.rs | 4 +- .../api/core/v1/downward_api_projection.rs | 2 +- .../api/core/v1/downward_api_volume_source.rs | 2 +- src/v1_24/api/core/v1/endpoint_subset.rs | 6 +- src/v1_24/api/core/v1/endpoints.rs | 2 +- src/v1_24/api/core/v1/ephemeral_container.rs | 42 +++- src/v1_24/api/core/v1/exec_action.rs | 2 +- src/v1_24/api/core/v1/fc_volume_source.rs | 4 +- .../core/v1/flex_persistent_volume_source.rs | 4 +- src/v1_24/api/core/v1/flex_volume_source.rs | 4 +- src/v1_24/api/core/v1/host_alias.rs | 2 +- src/v1_24/api/core/v1/http_get_action.rs | 2 +- .../core/v1/iscsi_persistent_volume_source.rs | 2 +- src/v1_24/api/core/v1/iscsi_volume_source.rs | 2 +- src/v1_24/api/core/v1/limit_range_item.rs | 20 +- src/v1_24/api/core/v1/limit_range_spec.rs | 2 +- .../api/core/v1/load_balancer_ingress.rs | 2 +- src/v1_24/api/core/v1/load_balancer_status.rs | 2 +- src/v1_24/api/core/v1/namespace_spec.rs | 2 +- src/v1_24/api/core/v1/namespace_status.rs | 9 +- src/v1_24/api/core/v1/node_affinity.rs | 2 +- src/v1_24/api/core/v1/node_selector.rs | 2 +- .../api/core/v1/node_selector_requirement.rs | 2 +- src/v1_24/api/core/v1/node_selector_term.rs | 4 +- src/v1_24/api/core/v1/node_spec.rs | 4 +- src/v1_24/api/core/v1/node_status.rs | 32 ++- .../core/v1/persistent_volume_claim_spec.rs | 2 +- .../core/v1/persistent_volume_claim_status.rs | 19 +- .../api/core/v1/persistent_volume_spec.rs | 8 +- src/v1_24/api/core/v1/pod_affinity.rs | 4 +- src/v1_24/api/core/v1/pod_affinity_term.rs | 2 +- src/v1_24/api/core/v1/pod_anti_affinity.rs | 4 +- src/v1_24/api/core/v1/pod_dns_config.rs | 6 +- src/v1_24/api/core/v1/pod_security_context.rs | 4 +- src/v1_24/api/core/v1/pod_spec.rs | 73 +++++- src/v1_24/api/core/v1/pod_status.rs | 24 +- .../api/core/v1/projected_volume_source.rs | 2 +- .../core/v1/rbd_persistent_volume_source.rs | 2 +- src/v1_24/api/core/v1/rbd_volume_source.rs | 2 +- .../core/v1/replication_controller_spec.rs | 2 +- .../core/v1/replication_controller_status.rs | 9 +- src/v1_24/api/core/v1/resource_quota_spec.rs | 6 +- .../api/core/v1/resource_quota_status.rs | 8 +- .../api/core/v1/resource_requirements.rs | 8 +- src/v1_24/api/core/v1/scope_selector.rs | 2 +- .../scoped_resource_selector_requirement.rs | 2 +- src/v1_24/api/core/v1/secret.rs | 8 +- src/v1_24/api/core/v1/secret_projection.rs | 2 +- src/v1_24/api/core/v1/secret_volume_source.rs | 2 +- src/v1_24/api/core/v1/service_account.rs | 11 +- src/v1_24/api/core/v1/service_spec.rs | 19 +- src/v1_24/api/core/v1/service_status.rs | 9 +- .../v1/topology_selector_label_requirement.rs | 2 +- .../api/core/v1/topology_selector_term.rs | 2 +- src/v1_24/api/discovery/v1/endpoint.rs | 6 +- src/v1_24/api/discovery/v1/endpoint_hints.rs | 2 +- src/v1_24/api/discovery/v1/endpoint_slice.rs | 4 +- src/v1_24/api/discovery/v1beta1/endpoint.rs | 6 +- .../api/discovery/v1beta1/endpoint_hints.rs | 2 +- .../api/discovery/v1beta1/endpoint_slice.rs | 4 +- .../flowcontrol/v1beta1/flow_schema_spec.rs | 2 +- .../flowcontrol/v1beta1/flow_schema_status.rs | 9 +- .../v1beta1/non_resource_policy_rule.rs | 4 +- .../v1beta1/policy_rules_with_subjects.rs | 6 +- .../priority_level_configuration_status.rs | 9 +- .../v1beta1/resource_policy_rule.rs | 8 +- .../flowcontrol/v1beta2/flow_schema_spec.rs | 2 +- .../flowcontrol/v1beta2/flow_schema_status.rs | 9 +- .../v1beta2/non_resource_policy_rule.rs | 4 +- .../v1beta2/policy_rules_with_subjects.rs | 6 +- .../priority_level_configuration_status.rs | 9 +- .../v1beta2/resource_policy_rule.rs | 8 +- .../networking/v1/http_ingress_rule_value.rs | 2 +- src/v1_24/api/networking/v1/ingress_spec.rs | 4 +- src/v1_24/api/networking/v1/ingress_tls.rs | 2 +- src/v1_24/api/networking/v1/ip_block.rs | 2 +- .../v1/network_policy_egress_rule.rs | 4 +- .../v1/network_policy_ingress_rule.rs | 4 +- .../api/networking/v1/network_policy_spec.rs | 6 +- .../networking/v1/network_policy_status.rs | 9 +- src/v1_24/api/node/v1/overhead.rs | 4 +- src/v1_24/api/node/v1/scheduling.rs | 4 +- src/v1_24/api/node/v1beta1/overhead.rs | 4 +- src/v1_24/api/node/v1beta1/scheduling.rs | 4 +- .../policy/v1/pod_disruption_budget_status.rs | 13 +- .../v1beta1/fs_group_strategy_options.rs | 2 +- .../v1beta1/pod_disruption_budget_status.rs | 13 +- .../v1beta1/pod_security_policy_spec.rs | 22 +- .../v1beta1/run_as_group_strategy_options.rs | 2 +- .../v1beta1/run_as_user_strategy_options.rs | 2 +- .../v1beta1/runtime_class_strategy_options.rs | 2 +- .../supplemental_groups_strategy_options.rs | 2 +- src/v1_24/api/rbac/v1/aggregation_rule.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/rbac/v1/policy_rule.rs | 10 +- src/v1_24/api/rbac/v1/role.rs | 2 +- src/v1_24/api/rbac/v1/role_binding.rs | 2 +- src/v1_24/api/storage/v1/csi_driver_spec.rs | 4 +- src/v1_24/api/storage/v1/csi_node_driver.rs | 2 +- src/v1_24/api/storage/v1/csi_node_spec.rs | 9 +- src/v1_24/api/storage/v1/storage_class.rs | 8 +- .../storage/v1/volume_attachment_status.rs | 4 +- .../v1/custom_resource_definition_names.rs | 4 +- .../v1/custom_resource_definition_spec.rs | 2 +- .../v1/custom_resource_definition_status.rs | 11 +- .../v1/custom_resource_definition_version.rs | 2 +- .../apiextensions/v1/json_schema_props.rs | 37 ++- .../apiextensions/v1/webhook_conversion.rs | 2 +- .../pkg/apis/meta/v1/api_group.rs | 4 +- .../pkg/apis/meta/v1/api_group_list.rs | 2 +- .../pkg/apis/meta/v1/api_resource.rs | 6 +- .../pkg/apis/meta/v1/api_resource_list.rs | 2 +- .../pkg/apis/meta/v1/api_versions.rs | 4 +- .../pkg/apis/meta/v1/delete_options.rs | 2 +- .../pkg/apis/meta/v1/label_selector.rs | 6 +- .../meta/v1/label_selector_requirement.rs | 2 +- .../pkg/apis/meta/v1/object_meta.rs | 21 +- .../pkg/apis/meta/v1/status_details.rs | 2 +- .../apiregistration/v1/api_service_status.rs | 9 +- src/v1_24/list.rs | 11 +- .../v1/mutating_webhook.rs | 4 +- .../v1/mutating_webhook_configuration.rs | 9 +- .../v1/rule_with_operations.rs | 8 +- .../v1/validating_webhook.rs | 4 +- .../v1/validating_webhook_configuration.rs | 9 +- .../v1alpha1/server_storage_version.rs | 2 +- .../v1alpha1/storage_version_status.rs | 18 +- src/v1_25/api/apps/v1/daemon_set_status.rs | 9 +- src/v1_25/api/apps/v1/deployment_status.rs | 9 +- src/v1_25/api/apps/v1/replica_set_status.rs | 9 +- src/v1_25/api/apps/v1/stateful_set_spec.rs | 2 +- src/v1_25/api/apps/v1/stateful_set_status.rs | 9 +- .../authentication/v1/token_request_spec.rs | 2 +- .../authentication/v1/token_review_spec.rs | 2 +- .../authentication/v1/token_review_status.rs | 2 +- src/v1_25/api/authentication/v1/user_info.rs | 6 +- .../api/authorization/v1/non_resource_rule.rs | 4 +- .../api/authorization/v1/resource_rule.rs | 8 +- .../v1/subject_access_review_spec.rs | 6 +- .../v1/subject_rules_review_status.rs | 4 +- .../v2/horizontal_pod_autoscaler_spec.rs | 2 +- .../v2/horizontal_pod_autoscaler_status.rs | 11 +- .../api/autoscaling/v2/hpa_scaling_rules.rs | 2 +- .../v2beta2/horizontal_pod_autoscaler_spec.rs | 2 +- .../horizontal_pod_autoscaler_status.rs | 4 +- .../autoscaling/v2beta2/hpa_scaling_rules.rs | 2 +- src/v1_25/api/batch/v1/cron_job_status.rs | 2 +- src/v1_25/api/batch/v1/job_status.rs | 9 +- src/v1_25/api/batch/v1/pod_failure_policy.rs | 2 +- ...ailure_policy_on_exit_codes_requirement.rs | 2 +- .../api/batch/v1/pod_failure_policy_rule.rs | 2 +- .../api/batch/v1/uncounted_terminated_pods.rs | 4 +- .../v1/certificate_signing_request_spec.rs | 8 +- .../v1/certificate_signing_request_status.rs | 9 +- src/v1_25/api/core/v1/capabilities.rs | 4 +- .../v1/ceph_fs_persistent_volume_source.rs | 2 +- .../api/core/v1/ceph_fs_volume_source.rs | 2 +- src/v1_25/api/core/v1/component_status.rs | 9 +- src/v1_25/api/core/v1/config_map.rs | 8 +- .../api/core/v1/config_map_projection.rs | 2 +- .../api/core/v1/config_map_volume_source.rs | 2 +- src/v1_25/api/core/v1/container.rs | 42 +++- src/v1_25/api/core/v1/container_image.rs | 2 +- .../core/v1/csi_persistent_volume_source.rs | 4 +- src/v1_25/api/core/v1/csi_volume_source.rs | 4 +- .../api/core/v1/downward_api_projection.rs | 2 +- .../api/core/v1/downward_api_volume_source.rs | 2 +- src/v1_25/api/core/v1/endpoint_subset.rs | 6 +- src/v1_25/api/core/v1/endpoints.rs | 2 +- src/v1_25/api/core/v1/ephemeral_container.rs | 42 +++- src/v1_25/api/core/v1/exec_action.rs | 2 +- src/v1_25/api/core/v1/fc_volume_source.rs | 4 +- .../core/v1/flex_persistent_volume_source.rs | 4 +- src/v1_25/api/core/v1/flex_volume_source.rs | 4 +- src/v1_25/api/core/v1/host_alias.rs | 2 +- src/v1_25/api/core/v1/http_get_action.rs | 2 +- .../core/v1/iscsi_persistent_volume_source.rs | 2 +- src/v1_25/api/core/v1/iscsi_volume_source.rs | 2 +- src/v1_25/api/core/v1/limit_range_item.rs | 20 +- src/v1_25/api/core/v1/limit_range_spec.rs | 2 +- .../api/core/v1/load_balancer_ingress.rs | 2 +- src/v1_25/api/core/v1/load_balancer_status.rs | 2 +- src/v1_25/api/core/v1/namespace_spec.rs | 2 +- src/v1_25/api/core/v1/namespace_status.rs | 9 +- src/v1_25/api/core/v1/node_affinity.rs | 2 +- src/v1_25/api/core/v1/node_selector.rs | 2 +- .../api/core/v1/node_selector_requirement.rs | 2 +- src/v1_25/api/core/v1/node_selector_term.rs | 4 +- src/v1_25/api/core/v1/node_spec.rs | 4 +- src/v1_25/api/core/v1/node_status.rs | 32 ++- .../core/v1/persistent_volume_claim_spec.rs | 2 +- .../core/v1/persistent_volume_claim_status.rs | 19 +- .../api/core/v1/persistent_volume_spec.rs | 8 +- src/v1_25/api/core/v1/pod_affinity.rs | 4 +- src/v1_25/api/core/v1/pod_affinity_term.rs | 2 +- src/v1_25/api/core/v1/pod_anti_affinity.rs | 4 +- src/v1_25/api/core/v1/pod_dns_config.rs | 6 +- src/v1_25/api/core/v1/pod_security_context.rs | 4 +- src/v1_25/api/core/v1/pod_spec.rs | 73 +++++- src/v1_25/api/core/v1/pod_status.rs | 24 +- .../api/core/v1/projected_volume_source.rs | 2 +- .../core/v1/rbd_persistent_volume_source.rs | 2 +- src/v1_25/api/core/v1/rbd_volume_source.rs | 2 +- .../core/v1/replication_controller_spec.rs | 2 +- .../core/v1/replication_controller_status.rs | 9 +- src/v1_25/api/core/v1/resource_quota_spec.rs | 6 +- .../api/core/v1/resource_quota_status.rs | 8 +- .../api/core/v1/resource_requirements.rs | 8 +- src/v1_25/api/core/v1/scope_selector.rs | 2 +- .../scoped_resource_selector_requirement.rs | 2 +- src/v1_25/api/core/v1/secret.rs | 8 +- src/v1_25/api/core/v1/secret_projection.rs | 2 +- src/v1_25/api/core/v1/secret_volume_source.rs | 2 +- src/v1_25/api/core/v1/service_account.rs | 11 +- src/v1_25/api/core/v1/service_spec.rs | 19 +- src/v1_25/api/core/v1/service_status.rs | 9 +- .../v1/topology_selector_label_requirement.rs | 2 +- .../api/core/v1/topology_selector_term.rs | 2 +- .../api/core/v1/topology_spread_constraint.rs | 2 +- src/v1_25/api/discovery/v1/endpoint.rs | 6 +- src/v1_25/api/discovery/v1/endpoint_hints.rs | 2 +- src/v1_25/api/discovery/v1/endpoint_slice.rs | 4 +- .../flowcontrol/v1beta1/flow_schema_spec.rs | 2 +- .../flowcontrol/v1beta1/flow_schema_status.rs | 9 +- .../v1beta1/non_resource_policy_rule.rs | 4 +- .../v1beta1/policy_rules_with_subjects.rs | 6 +- .../priority_level_configuration_status.rs | 9 +- .../v1beta1/resource_policy_rule.rs | 8 +- .../flowcontrol/v1beta2/flow_schema_spec.rs | 2 +- .../flowcontrol/v1beta2/flow_schema_status.rs | 9 +- .../v1beta2/non_resource_policy_rule.rs | 4 +- .../v1beta2/policy_rules_with_subjects.rs | 6 +- .../priority_level_configuration_status.rs | 9 +- .../v1beta2/resource_policy_rule.rs | 8 +- .../networking/v1/http_ingress_rule_value.rs | 2 +- src/v1_25/api/networking/v1/ingress_spec.rs | 4 +- src/v1_25/api/networking/v1/ingress_tls.rs | 2 +- src/v1_25/api/networking/v1/ip_block.rs | 2 +- .../v1/network_policy_egress_rule.rs | 4 +- .../v1/network_policy_ingress_rule.rs | 4 +- .../api/networking/v1/network_policy_spec.rs | 6 +- .../networking/v1/network_policy_status.rs | 9 +- src/v1_25/api/node/v1/overhead.rs | 4 +- src/v1_25/api/node/v1/scheduling.rs | 4 +- .../policy/v1/pod_disruption_budget_status.rs | 13 +- src/v1_25/api/rbac/v1/aggregation_rule.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/rbac/v1/policy_rule.rs | 10 +- src/v1_25/api/rbac/v1/role.rs | 2 +- src/v1_25/api/rbac/v1/role_binding.rs | 2 +- src/v1_25/api/storage/v1/csi_driver_spec.rs | 4 +- src/v1_25/api/storage/v1/csi_node_driver.rs | 2 +- src/v1_25/api/storage/v1/csi_node_spec.rs | 9 +- src/v1_25/api/storage/v1/storage_class.rs | 8 +- .../storage/v1/volume_attachment_status.rs | 4 +- .../v1/custom_resource_definition_names.rs | 4 +- .../v1/custom_resource_definition_spec.rs | 2 +- .../v1/custom_resource_definition_status.rs | 11 +- .../v1/custom_resource_definition_version.rs | 2 +- .../apiextensions/v1/json_schema_props.rs | 37 ++- .../apiextensions/v1/webhook_conversion.rs | 2 +- .../pkg/apis/meta/v1/api_group.rs | 4 +- .../pkg/apis/meta/v1/api_group_list.rs | 2 +- .../pkg/apis/meta/v1/api_resource.rs | 6 +- .../pkg/apis/meta/v1/api_resource_list.rs | 2 +- .../pkg/apis/meta/v1/api_versions.rs | 4 +- .../pkg/apis/meta/v1/delete_options.rs | 2 +- .../pkg/apis/meta/v1/label_selector.rs | 6 +- .../meta/v1/label_selector_requirement.rs | 2 +- .../pkg/apis/meta/v1/object_meta.rs | 21 +- .../pkg/apis/meta/v1/status_details.rs | 2 +- .../apiregistration/v1/api_service_status.rs | 9 +- src/v1_25/list.rs | 11 +- .../v1/mutating_webhook.rs | 4 +- .../v1/mutating_webhook_configuration.rs | 9 +- .../v1/rule_with_operations.rs | 8 +- .../v1/validating_webhook.rs | 4 +- .../v1/validating_webhook_configuration.rs | 9 +- .../v1alpha1/match_resources.rs | 4 +- .../v1alpha1/named_rule_with_operations.rs | 10 +- .../validating_admission_policy_spec.rs | 2 +- .../v1alpha1/server_storage_version.rs | 2 +- .../v1alpha1/storage_version_status.rs | 18 +- src/v1_26/api/apps/v1/daemon_set_status.rs | 9 +- src/v1_26/api/apps/v1/deployment_status.rs | 9 +- src/v1_26/api/apps/v1/replica_set_status.rs | 9 +- src/v1_26/api/apps/v1/stateful_set_spec.rs | 2 +- src/v1_26/api/apps/v1/stateful_set_status.rs | 9 +- .../authentication/v1/token_request_spec.rs | 2 +- .../authentication/v1/token_review_spec.rs | 2 +- .../authentication/v1/token_review_status.rs | 2 +- src/v1_26/api/authentication/v1/user_info.rs | 6 +- .../api/authorization/v1/non_resource_rule.rs | 4 +- .../api/authorization/v1/resource_rule.rs | 8 +- .../v1/subject_access_review_spec.rs | 6 +- .../v1/subject_rules_review_status.rs | 4 +- .../v2/horizontal_pod_autoscaler_spec.rs | 2 +- .../v2/horizontal_pod_autoscaler_status.rs | 11 +- .../api/autoscaling/v2/hpa_scaling_rules.rs | 2 +- src/v1_26/api/batch/v1/cron_job_status.rs | 2 +- src/v1_26/api/batch/v1/job_status.rs | 9 +- src/v1_26/api/batch/v1/pod_failure_policy.rs | 2 +- ...ailure_policy_on_exit_codes_requirement.rs | 2 +- .../api/batch/v1/pod_failure_policy_rule.rs | 2 +- .../api/batch/v1/uncounted_terminated_pods.rs | 4 +- .../v1/certificate_signing_request_spec.rs | 8 +- .../v1/certificate_signing_request_status.rs | 9 +- src/v1_26/api/core/v1/capabilities.rs | 4 +- .../v1/ceph_fs_persistent_volume_source.rs | 2 +- .../api/core/v1/ceph_fs_volume_source.rs | 2 +- src/v1_26/api/core/v1/component_status.rs | 9 +- src/v1_26/api/core/v1/config_map.rs | 8 +- .../api/core/v1/config_map_projection.rs | 2 +- .../api/core/v1/config_map_volume_source.rs | 2 +- src/v1_26/api/core/v1/container.rs | 42 +++- src/v1_26/api/core/v1/container_image.rs | 2 +- .../core/v1/csi_persistent_volume_source.rs | 4 +- src/v1_26/api/core/v1/csi_volume_source.rs | 4 +- .../api/core/v1/downward_api_projection.rs | 2 +- .../api/core/v1/downward_api_volume_source.rs | 2 +- src/v1_26/api/core/v1/endpoint_subset.rs | 6 +- src/v1_26/api/core/v1/endpoints.rs | 2 +- src/v1_26/api/core/v1/ephemeral_container.rs | 42 +++- src/v1_26/api/core/v1/exec_action.rs | 2 +- src/v1_26/api/core/v1/fc_volume_source.rs | 4 +- .../core/v1/flex_persistent_volume_source.rs | 4 +- src/v1_26/api/core/v1/flex_volume_source.rs | 4 +- src/v1_26/api/core/v1/host_alias.rs | 2 +- src/v1_26/api/core/v1/http_get_action.rs | 2 +- .../core/v1/iscsi_persistent_volume_source.rs | 2 +- src/v1_26/api/core/v1/iscsi_volume_source.rs | 2 +- src/v1_26/api/core/v1/limit_range_item.rs | 20 +- src/v1_26/api/core/v1/limit_range_spec.rs | 2 +- .../api/core/v1/load_balancer_ingress.rs | 2 +- src/v1_26/api/core/v1/load_balancer_status.rs | 2 +- src/v1_26/api/core/v1/namespace_spec.rs | 2 +- src/v1_26/api/core/v1/namespace_status.rs | 9 +- src/v1_26/api/core/v1/node_affinity.rs | 2 +- src/v1_26/api/core/v1/node_selector.rs | 2 +- .../api/core/v1/node_selector_requirement.rs | 2 +- src/v1_26/api/core/v1/node_selector_term.rs | 4 +- src/v1_26/api/core/v1/node_spec.rs | 4 +- src/v1_26/api/core/v1/node_status.rs | 32 ++- .../core/v1/persistent_volume_claim_spec.rs | 2 +- .../core/v1/persistent_volume_claim_status.rs | 19 +- .../api/core/v1/persistent_volume_spec.rs | 8 +- src/v1_26/api/core/v1/pod_affinity.rs | 4 +- src/v1_26/api/core/v1/pod_affinity_term.rs | 2 +- src/v1_26/api/core/v1/pod_anti_affinity.rs | 4 +- src/v1_26/api/core/v1/pod_dns_config.rs | 6 +- src/v1_26/api/core/v1/pod_security_context.rs | 4 +- src/v1_26/api/core/v1/pod_spec.rs | 91 ++++++-- src/v1_26/api/core/v1/pod_status.rs | 24 +- .../api/core/v1/projected_volume_source.rs | 2 +- .../core/v1/rbd_persistent_volume_source.rs | 2 +- src/v1_26/api/core/v1/rbd_volume_source.rs | 2 +- .../core/v1/replication_controller_spec.rs | 2 +- .../core/v1/replication_controller_status.rs | 9 +- src/v1_26/api/core/v1/resource_quota_spec.rs | 6 +- .../api/core/v1/resource_quota_status.rs | 8 +- .../api/core/v1/resource_requirements.rs | 17 +- src/v1_26/api/core/v1/scope_selector.rs | 2 +- .../scoped_resource_selector_requirement.rs | 2 +- src/v1_26/api/core/v1/secret.rs | 8 +- src/v1_26/api/core/v1/secret_projection.rs | 2 +- src/v1_26/api/core/v1/secret_volume_source.rs | 2 +- src/v1_26/api/core/v1/service_account.rs | 11 +- src/v1_26/api/core/v1/service_spec.rs | 19 +- src/v1_26/api/core/v1/service_status.rs | 9 +- .../v1/topology_selector_label_requirement.rs | 2 +- .../api/core/v1/topology_selector_term.rs | 2 +- .../api/core/v1/topology_spread_constraint.rs | 2 +- src/v1_26/api/discovery/v1/endpoint.rs | 6 +- src/v1_26/api/discovery/v1/endpoint_hints.rs | 2 +- src/v1_26/api/discovery/v1/endpoint_slice.rs | 4 +- .../flowcontrol/v1beta2/flow_schema_spec.rs | 2 +- .../flowcontrol/v1beta2/flow_schema_status.rs | 9 +- .../v1beta2/non_resource_policy_rule.rs | 4 +- .../v1beta2/policy_rules_with_subjects.rs | 6 +- .../priority_level_configuration_status.rs | 9 +- .../v1beta2/resource_policy_rule.rs | 8 +- .../flowcontrol/v1beta3/flow_schema_spec.rs | 2 +- .../flowcontrol/v1beta3/flow_schema_status.rs | 9 +- .../v1beta3/non_resource_policy_rule.rs | 4 +- .../v1beta3/policy_rules_with_subjects.rs | 6 +- .../priority_level_configuration_status.rs | 9 +- .../v1beta3/resource_policy_rule.rs | 8 +- .../networking/v1/http_ingress_rule_value.rs | 2 +- .../v1/ingress_load_balancer_ingress.rs | 2 +- .../v1/ingress_load_balancer_status.rs | 2 +- src/v1_26/api/networking/v1/ingress_spec.rs | 4 +- src/v1_26/api/networking/v1/ingress_tls.rs | 2 +- src/v1_26/api/networking/v1/ip_block.rs | 2 +- .../v1/network_policy_egress_rule.rs | 4 +- .../v1/network_policy_ingress_rule.rs | 4 +- .../api/networking/v1/network_policy_spec.rs | 6 +- .../networking/v1/network_policy_status.rs | 9 +- src/v1_26/api/node/v1/overhead.rs | 4 +- src/v1_26/api/node/v1/scheduling.rs | 4 +- .../policy/v1/pod_disruption_budget_status.rs | 13 +- src/v1_26/api/rbac/v1/aggregation_rule.rs | 2 +- src/v1_26/api/rbac/v1/cluster_role.rs | 2 +- src/v1_26/api/rbac/v1/cluster_role_binding.rs | 2 +- src/v1_26/api/rbac/v1/policy_rule.rs | 10 +- src/v1_26/api/rbac/v1/role.rs | 2 +- src/v1_26/api/rbac/v1/role_binding.rs | 2 +- .../resource/v1alpha1/pod_scheduling_spec.rs | 2 +- .../v1alpha1/pod_scheduling_status.rs | 9 +- .../resource_claim_scheduling_status.rs | 2 +- .../v1alpha1/resource_claim_status.rs | 9 +- src/v1_26/api/storage/v1/csi_driver_spec.rs | 4 +- src/v1_26/api/storage/v1/csi_node_driver.rs | 2 +- src/v1_26/api/storage/v1/csi_node_spec.rs | 9 +- src/v1_26/api/storage/v1/storage_class.rs | 8 +- .../storage/v1/volume_attachment_status.rs | 4 +- .../v1/custom_resource_definition_names.rs | 4 +- .../v1/custom_resource_definition_spec.rs | 2 +- .../v1/custom_resource_definition_status.rs | 11 +- .../v1/custom_resource_definition_version.rs | 2 +- .../apiextensions/v1/json_schema_props.rs | 37 ++- .../apiextensions/v1/webhook_conversion.rs | 2 +- .../pkg/apis/meta/v1/api_group.rs | 4 +- .../pkg/apis/meta/v1/api_group_list.rs | 2 +- .../pkg/apis/meta/v1/api_resource.rs | 6 +- .../pkg/apis/meta/v1/api_resource_list.rs | 2 +- .../pkg/apis/meta/v1/api_versions.rs | 4 +- .../pkg/apis/meta/v1/delete_options.rs | 2 +- .../pkg/apis/meta/v1/label_selector.rs | 6 +- .../meta/v1/label_selector_requirement.rs | 2 +- .../pkg/apis/meta/v1/object_meta.rs | 21 +- .../pkg/apis/meta/v1/status_details.rs | 2 +- .../apiregistration/v1/api_service_status.rs | 9 +- src/v1_26/list.rs | 11 +- 1227 files changed, 5760 insertions(+), 2314 deletions(-) diff --git a/k8s-openapi-codegen-common/src/lib.rs b/k8s-openapi-codegen-common/src/lib.rs index 0ea7c0ab8f..d5f771dfb7 100644 --- a/k8s-openapi-codegen-common/src/lib.rs +++ b/k8s-openapi-codegen-common/src/lib.rs @@ -319,6 +319,7 @@ pub fn run( field_type_name, required, is_flattened, + merge_type: &schema.merge_type, }); } @@ -666,6 +667,12 @@ pub fn run( where_part: Some(&template_generics_where_part), }; + let items_merge_type = swagger20::MergeType::List { + strategy: swagger20::KubernetesListType::Map, + keys: vec!["metadata().namespace".to_string(), "metadata().name".to_string()], + item_merge_type: Box::new(swagger20::MergeType::Default), + }; + let template_properties = vec![ templates::Property { name: "items", @@ -674,6 +681,7 @@ pub fn run( field_type_name: "Vec".to_owned(), required: templates::PropertyRequired::Required { is_default: true }, is_flattened: false, + merge_type: &items_merge_type, }, templates::Property { @@ -683,6 +691,7 @@ pub fn run( field_type_name: (*metadata_rust_type).to_owned(), required: templates::PropertyRequired::Required { is_default: true }, is_flattened: false, + merge_type: &swagger20::MergeType::Default, }, ]; @@ -729,6 +738,12 @@ pub fn run( )?; if definition.impl_deep_merge { + let template_generics_where_part = format!("T: {local}DeepMerge + {local}Metadata + {local}ListableResource"); + let template_generics = templates::Generics { + where_part: Some(&template_generics_where_part), + ..template_generics + }; + templates::struct_deep_merge::generate( &mut out, type_name, @@ -808,6 +823,7 @@ pub fn run( field_type_name, required: templates::PropertyRequired::Optional, is_flattened: false, + merge_type: &schema.merge_type, }); } @@ -1008,7 +1024,7 @@ pub fn run( schema_feature, map_namespace, )?; - } + } swagger20::SchemaKind::Ty(swagger20::Type::WatchEvent(_)) => { templates::impl_schema::generate( @@ -1441,7 +1457,7 @@ pub fn get_rust_ident(name: &str) -> std::borrow::Cow<'static, str> { } else { result.push(match c { - '.' | '-' => '_', + '-' => '_', c => c, }); } @@ -1691,7 +1707,7 @@ pub fn write_operation( path == "io.k8s.ListOptional" || path == "io.k8s.PatchOptional" || path == "io.k8s.ReplaceOptional" || - path == "io.k8s.WatchOptional" + path == "io.k8s.WatchOptional" } else { false diff --git a/k8s-openapi-codegen-common/src/swagger20/definitions.rs b/k8s-openapi-codegen-common/src/swagger20/definitions.rs index 6584f9e188..d5f1921fd7 100644 --- a/k8s-openapi-codegen-common/src/swagger20/definitions.rs +++ b/k8s-openapi-codegen-common/src/swagger20/definitions.rs @@ -30,6 +30,49 @@ pub enum IntegerFormat { Int64, } +/// The value of an `x-kubernetes-list-type` annotation on a property. +#[derive(Clone, Copy, Debug, Eq, PartialEq, Default, PartialOrd, Ord)] +#[cfg_attr(feature = "serde", derive(serde::Deserialize))] +pub enum KubernetesListType { + #[default] + #[cfg_attr(feature = "serde", serde(rename = "atomic"))] + Atomic, + + #[cfg_attr(feature = "serde", serde(rename = "map"))] + Map, + + #[cfg_attr(feature = "serde", serde(rename = "set"))] + Set, +} + +/// The value of an `x-kubernetes-map-type` annotation on a property. +#[derive(Clone, Copy, Debug, Eq, PartialEq, Default, PartialOrd, Ord)] +#[cfg_attr(feature = "serde", derive(serde::Deserialize))] +pub enum KubernetesMapType { + #[cfg_attr(feature = "serde", serde(rename = "atomic"))] + Atomic, + + #[default] + #[cfg_attr(feature = "serde", serde(rename = "granular"))] + Granular, +} + +#[derive(Clone, Debug, Eq, Ord, PartialEq, PartialOrd)] +pub enum MergeType { + Default, + + List { + strategy: KubernetesListType, + keys: Vec, + item_merge_type: Box, + }, + + Map { + strategy: KubernetesMapType, + value_merge_type: Box, + }, +} + /// A number format. This corresponds to the `"format"` property of a `"number"` schema type. #[derive(Clone, Copy, Debug, Eq, Ord, PartialEq, PartialOrd)] pub enum NumberFormat { @@ -109,6 +152,8 @@ pub struct Schema { pub kind: SchemaKind, pub kubernetes_group_kind_versions: Vec, + pub merge_type: MergeType, + /// Used to store the definition path of the corresponding list type, if any. pub list_kind: Option, @@ -134,6 +179,23 @@ impl<'de> serde::Deserialize<'de> for Schema { #[serde(default, rename = "x-kubernetes-group-version-kind")] kubernetes_group_kind_versions: Vec, + #[serde(default, rename = "x-kubernetes-list-map-keys")] + kubernetes_list_map_keys: Vec, + + #[serde(default, rename = "x-kubernetes-list-type")] + kubernetes_list_type: KubernetesListType, + + #[serde(default, rename = "x-kubernetes-map-type")] + kubernetes_map_type: KubernetesMapType, + + #[serde(default, rename = "x-kubernetes-patch-merge-key")] + kubernetes_patch_merge_key: Option, + + /// Comma-separated list of strategy tags. + /// Ref: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-api-machinery/strategic-merge-patch.md + #[serde(default, rename = "x-kubernetes-patch-strategy")] + kubernetes_patch_strategy: String, + properties: Option>, #[serde(rename = "$ref")] @@ -175,11 +237,40 @@ impl<'de> serde::Deserialize<'de> for Schema { SchemaKind::Ty(Type::Any) }; + if let Some(key) = value.kubernetes_patch_merge_key { + value.kubernetes_list_map_keys = vec![key]; + } + if value.kubernetes_patch_strategy.split(',').any(|x| x == "merge") { + value.kubernetes_list_type = + if value.kubernetes_list_map_keys.is_empty() { + KubernetesListType::Set + } + else { + KubernetesListType::Map + }; + } + + let merge_type = match &kind { + SchemaKind::Ty(Type::Array { items }) => MergeType::List { + strategy: value.kubernetes_list_type, + keys: value.kubernetes_list_map_keys, + item_merge_type: Box::new(items.merge_type.clone()), + }, + + SchemaKind::Ty(Type::Object { additional_properties }) => MergeType::Map { + strategy: value.kubernetes_map_type, + value_merge_type: Box::new(additional_properties.merge_type.clone()), + }, + + _ => MergeType::Default, + }; + Ok(Schema { description: value.description, kind, kubernetes_group_kind_versions: value.kubernetes_group_kind_versions, list_kind: None, + merge_type, impl_deep_merge: true, }) } diff --git a/k8s-openapi-codegen-common/src/swagger20/paths.rs b/k8s-openapi-codegen-common/src/swagger20/paths.rs index fe022fcbd5..61bd5b0cdc 100644 --- a/k8s-openapi-codegen-common/src/swagger20/paths.rs +++ b/k8s-openapi-codegen-common/src/swagger20/paths.rs @@ -126,6 +126,7 @@ impl<'de> serde::Deserialize<'de> for Parameter { kind: super::SchemaKind::Ty(super::Type::parse::(&ty, None, None, None)?), kubernetes_group_kind_versions: vec![], list_kind: None, + merge_type: crate::swagger20::MergeType::Default, impl_deep_merge: true, }, ), @@ -137,6 +138,7 @@ impl<'de> serde::Deserialize<'de> for Parameter { kind: super::SchemaKind::Ty(super::Type::parse::(&ty, None, None, None)?), kubernetes_group_kind_versions: vec![], list_kind: None, + merge_type: crate::swagger20::MergeType::Default, impl_deep_merge: true, }, ), diff --git a/k8s-openapi-codegen-common/src/templates/impl_schema.rs b/k8s-openapi-codegen-common/src/templates/impl_schema.rs index 869a2474de..cb3fa3b826 100644 --- a/k8s-openapi-codegen-common/src/templates/impl_schema.rs +++ b/k8s-openapi-codegen-common/src/templates/impl_schema.rs @@ -89,7 +89,8 @@ fn gen_schema( writeln!(props, "{indent} }}));")?; writeln!(props, "{indent} {local}schemars::schema::Schema::Object(schema_obj)")?; writeln!(props, "{indent} }},")?; - } else { + } + else { writeln!(props, "{indent} __gen.subschema_for::<{type_name}>(),")?; } @@ -279,7 +280,8 @@ fn gen_type( writeln!(out, "{indent} items: Some({local}schemars::schema::SingleOrVec::Single(Box::new(__gen.subschema_for::<{}>()))),", crate::get_fully_qualified_type_name(ref_path, map_namespace))?; - } else { + } + else { writeln!(out, "{indent} items: Some({local}schemars::schema::SingleOrVec::Single(Box::new(")?; gen_schema(out, items, local, map_namespace, depth + 2)?; writeln!(out, "{indent} ))),")?; @@ -326,7 +328,8 @@ fn gen_type( writeln!(out, "{indent} additional_properties: Some(Box::new(__gen.subschema_for::<{}>())),", crate::get_fully_qualified_type_name(ref_path, map_namespace))?; - } else { + } + else { writeln!(out, "{indent} additional_properties: Some(Box::new(")?; gen_schema(out, additional_properties, local, map_namespace, depth + 2)?; writeln!(out, "{indent} )),")?; diff --git a/k8s-openapi-codegen-common/src/templates/mod.rs b/k8s-openapi-codegen-common/src/templates/mod.rs index 98946ee072..4fec7418d5 100644 --- a/k8s-openapi-codegen-common/src/templates/mod.rs +++ b/k8s-openapi-codegen-common/src/templates/mod.rs @@ -43,6 +43,7 @@ pub(crate) struct Property<'a> { pub(crate) field_type_name: String, pub(crate) required: PropertyRequired, pub(crate) is_flattened: bool, + pub(crate) merge_type: &'a crate::swagger20::MergeType, } #[derive(Clone, Copy)] diff --git a/k8s-openapi-codegen-common/src/templates/query_string_optional.rs b/k8s-openapi-codegen-common/src/templates/query_string_optional.rs index 3d856a26cf..2166ed43d8 100644 --- a/k8s-openapi-codegen-common/src/templates/query_string_optional.rs +++ b/k8s-openapi-codegen-common/src/templates/query_string_optional.rs @@ -34,7 +34,8 @@ pub(crate) fn generate( let watch_append_pair = if is_watch { " __query_pairs.append_pair(\"watch\", \"true\");\n" - } else { + } + else { "" }; diff --git a/k8s-openapi-codegen-common/src/templates/struct_deep_merge.rs b/k8s-openapi-codegen-common/src/templates/struct_deep_merge.rs index aa84f2affe..b8936ccb97 100644 --- a/k8s-openapi-codegen-common/src/templates/struct_deep_merge.rs +++ b/k8s-openapi-codegen-common/src/templates/struct_deep_merge.rs @@ -5,18 +5,20 @@ pub(crate) fn generate( fields: &[super::Property<'_>], map_namespace: &impl crate::MapNamespace, ) -> Result<(), crate::Error> { - use std::fmt::Write; - let local = crate::map_namespace_local_to_string(map_namespace)?; let type_generics_type = generics.type_part.map(|part| format!("<{part}>")).unwrap_or_default(); let type_generics_where = generics.where_part.map(|part| format!(" where {part}")).unwrap_or_default(); let mut merge_body = String::new(); - for super::Property { field_name, .. } in fields { - writeln!( + for super::Property { field_name, merge_type, .. } in fields { + generate_field( &mut merge_body, - " {local}DeepMerge::merge_from(&mut self.{field_name}, other.{field_name});", + &local, + &format!("&mut self.{field_name}"), + &format!("other.{field_name}"), + merge_type, + 8, )?; } @@ -32,3 +34,80 @@ pub(crate) fn generate( Ok(()) } + +fn generate_field( + writer: &mut impl std::fmt::Write, + local: &str, + self_name: &str, + other_name: &str, + merge_type: &crate::swagger20::MergeType, + indent: usize, +) -> Result<(), crate::Error> { + const S: &str = ""; + + match merge_type { + crate::swagger20::MergeType::Default => writeln!( + writer, + "{S:indent$}{local}DeepMerge::merge_from({self_name}, {other_name});", + )?, + + crate::swagger20::MergeType::List { + strategy: crate::swagger20::KubernetesListType::Atomic, + keys: _, + item_merge_type: _, + } => writeln!( + writer, + "{S:indent$}{local}merge_strategies::list::atomic({self_name}, {other_name});", + )?, + + crate::swagger20::MergeType::List { + strategy: crate::swagger20::KubernetesListType::Map, + keys, + item_merge_type, + } => { + writeln!(writer, "{S:indent$}{local}merge_strategies::list::map(")?; + writeln!(writer, "{S:indent$} {self_name},")?; + writeln!(writer, "{S:indent$} {other_name},")?; + writeln!( + writer, + "{S:indent$} &[{keys}],", + keys = keys.iter().map(|k| format!("|lhs, rhs| lhs.{k} == rhs.{k}", k = crate::get_rust_ident(k))).collect::>().join(", "), + )?; + writeln!(writer, "{S:indent$} |current_item, other_item| {{")?; + generate_field(writer, local, "current_item", "other_item", item_merge_type, indent + 8)?; + writeln!(writer, "{S:indent$} }},")?; + writeln!(writer, "{S:indent$});")?; + }, + + crate::swagger20::MergeType::List { + strategy: crate::swagger20::KubernetesListType::Set, + keys: _, + item_merge_type: _, + } => writeln!( + writer, + "{S:indent$}{local}merge_strategies::list::set({self_name}, {other_name});", + )?, + + crate::swagger20::MergeType::Map { + strategy: crate::swagger20::KubernetesMapType::Granular, + value_merge_type, + } => { + writeln!( + writer, + "{S:indent$}{local}merge_strategies::map::granular({self_name}, {other_name}, |current_item, other_item| {{", + )?; + generate_field(writer, local, "current_item", "other_item", value_merge_type, indent + 4)?; + writeln!(writer, "{S:indent$}}});")?; + }, + + crate::swagger20::MergeType::Map { + strategy: crate::swagger20::KubernetesMapType::Atomic, + value_merge_type: _, + } => writeln!( + writer, + "{S:indent$}{local}merge_strategies::map::atomic({self_name}, {other_name});", + )?, + } + + Ok(()) +} diff --git a/k8s-openapi-codegen/src/fixups/special.rs b/k8s-openapi-codegen/src/fixups/special.rs index 26a72d27a0..6664d09959 100644 --- a/k8s-openapi-codegen/src/fixups/special.rs +++ b/k8s-openapi-codegen/src/fixups/special.rs @@ -99,6 +99,7 @@ pub(crate) fn create_delete_optional(spec: &mut crate::swagger20::Spec) -> Resul kind: crate::swagger20::SchemaKind::Ty(crate::swagger20::Type::DeleteOptional(delete_optional_properties)), kubernetes_group_kind_versions: vec![], list_kind: None, + merge_type: crate::swagger20::MergeType::Default, impl_deep_merge: true, }); @@ -135,6 +136,7 @@ pub(crate) fn create_optionals(spec: &mut crate::swagger20::Spec) -> Result<(), }), kubernetes_group_kind_versions: vec![], list_kind: None, + merge_type: crate::swagger20::MergeType::Default, impl_deep_merge: true, }, }); @@ -195,6 +197,7 @@ pub(crate) fn create_optionals(spec: &mut crate::swagger20::Spec) -> Result<(), kind: crate::swagger20::SchemaKind::Ty(ty(optional_definition)), kubernetes_group_kind_versions: vec![], list_kind: None, + merge_type: crate::swagger20::MergeType::Default, impl_deep_merge: true, }); } @@ -236,6 +239,7 @@ pub(crate) fn remove_delete_collection_operations_query_parameters(spec: &mut cr }), kubernetes_group_kind_versions: vec![], list_kind: None, + merge_type: crate::swagger20::MergeType::Default, impl_deep_merge: true, }, })); @@ -251,6 +255,7 @@ pub(crate) fn remove_delete_collection_operations_query_parameters(spec: &mut cr }), kubernetes_group_kind_versions: vec![], list_kind: None, + merge_type: crate::swagger20::MergeType::Default, impl_deep_merge: true, }, })); @@ -291,6 +296,7 @@ pub(crate) fn remove_delete_operations_query_parameters(spec: &mut crate::swagge }), kubernetes_group_kind_versions: vec![], list_kind: None, + merge_type: crate::swagger20::MergeType::Default, impl_deep_merge: true, }, })); @@ -416,6 +422,7 @@ pub(crate) fn separate_watch_from_list_operations(spec: &mut crate::swagger20::S kind: crate::swagger20::SchemaKind::Ty(crate::swagger20::Type::ListOptional(list_optional_definition)), kubernetes_group_kind_versions: vec![], list_kind: None, + merge_type: crate::swagger20::MergeType::Default, impl_deep_merge: true, }); @@ -424,6 +431,7 @@ pub(crate) fn separate_watch_from_list_operations(spec: &mut crate::swagger20::S kind: crate::swagger20::SchemaKind::Ty(crate::swagger20::Type::WatchOptional(watch_optional_definition)), kubernetes_group_kind_versions: vec![], list_kind: None, + merge_type: crate::swagger20::MergeType::Default, impl_deep_merge: true, }); @@ -439,6 +447,7 @@ pub(crate) fn separate_watch_from_list_operations(spec: &mut crate::swagger20::S }), kubernetes_group_kind_versions: vec![], list_kind: None, + merge_type: crate::swagger20::MergeType::Default, impl_deep_merge: true, }, }); @@ -455,6 +464,7 @@ pub(crate) fn separate_watch_from_list_operations(spec: &mut crate::swagger20::S }), kubernetes_group_kind_versions: vec![], list_kind: None, + merge_type: crate::swagger20::MergeType::Default, impl_deep_merge: true, }, }); @@ -524,6 +534,7 @@ pub(crate) fn separate_watch_from_list_operations(spec: &mut crate::swagger20::S }), kubernetes_group_kind_versions: vec![], list_kind: None, + merge_type: crate::swagger20::MergeType::Default, impl_deep_merge: true, }); @@ -660,11 +671,13 @@ pub(crate) fn list(spec: &mut crate::swagger20::Spec) -> Result<(), crate::Error }), kubernetes_group_kind_versions: vec![], list_kind: None, + merge_type: crate::swagger20::MergeType::Default, impl_deep_merge: true, }), }), kubernetes_group_kind_versions: vec![], list_kind: None, + merge_type: crate::swagger20::MergeType::Default, impl_deep_merge: true, }, true, @@ -687,6 +700,7 @@ pub(crate) fn list(spec: &mut crate::swagger20::Spec) -> Result<(), crate::Error kind: crate::swagger20::SchemaKind::Ty(crate::swagger20::Type::ListDef { metadata: Box::new(metadata_schema_kind) }), kubernetes_group_kind_versions: vec![], list_kind: None, + merge_type: crate::swagger20::MergeType::Default, impl_deep_merge: true, }); @@ -1097,6 +1111,7 @@ pub(crate) fn response_types(spec: &mut crate::swagger20::Spec) -> Result<(), cr kind: crate::swagger20::SchemaKind::Ty(ty), kubernetes_group_kind_versions: vec![], list_kind: None, + merge_type: crate::swagger20::MergeType::Default, impl_deep_merge: true, }); } diff --git a/k8s-openapi-codegen/src/fixups/upstream_bugs.rs b/k8s-openapi-codegen/src/fixups/upstream_bugs.rs index 0f3e5f4832..8ba177a873 100644 --- a/k8s-openapi-codegen/src/fixups/upstream_bugs.rs +++ b/k8s-openapi-codegen/src/fixups/upstream_bugs.rs @@ -68,6 +68,7 @@ pub(crate) fn pod_exec_command_parameter_type(spec: &mut crate::swagger20::Spec) kind: crate::swagger20::SchemaKind::Ty(crate::swagger20::Type::String { format: None }), kubernetes_group_kind_versions: vec![], list_kind: None, + merge_type: crate::swagger20::MergeType::Default, impl_deep_merge: true, }), }), diff --git a/k8s-openapi-derive/src/custom_resource_definition.rs b/k8s-openapi-derive/src/custom_resource_definition.rs index 7da5208863..f3d8032d2a 100644 --- a/k8s-openapi-derive/src/custom_resource_definition.rs +++ b/k8s-openapi-derive/src/custom_resource_definition.rs @@ -158,6 +158,7 @@ impl super::CustomDerive for CustomResourceDefinition { }), kubernetes_group_kind_versions: vec![], list_kind: None, + merge_type: swagger20::MergeType::Default, impl_deep_merge: true, }, }); @@ -172,6 +173,7 @@ impl super::CustomDerive for CustomResourceDefinition { kind: swagger20::SchemaKind::Ty(swagger20::Type::String { format: None }), kubernetes_group_kind_versions: vec![], list_kind: None, + merge_type: swagger20::MergeType::Default, impl_deep_merge: true, }, }); @@ -187,6 +189,7 @@ impl super::CustomDerive for CustomResourceDefinition { kind: swagger20::SchemaKind::Ty(swagger20::Type::String { format: None }), kubernetes_group_kind_versions: vec![], list_kind: None, + merge_type: swagger20::MergeType::Default, impl_deep_merge: true, }, })), "/namespaces/{namespace}") @@ -209,6 +212,7 @@ impl super::CustomDerive for CustomResourceDefinition { kind: swagger20::SchemaKind::Ty(swagger20::Type::String { format: None }), kubernetes_group_kind_versions: vec![], list_kind: None, + merge_type: swagger20::MergeType::Default, impl_deep_merge: true, }, false)), (swagger20::PropertyName("kind".to_owned()), (swagger20::Schema { @@ -216,6 +220,7 @@ impl super::CustomDerive for CustomResourceDefinition { kind: swagger20::SchemaKind::Ty(swagger20::Type::String { format: None }), kubernetes_group_kind_versions: vec![], list_kind: None, + merge_type: swagger20::MergeType::Default, impl_deep_merge: true, }, false)), (swagger20::PropertyName("metadata".to_owned()), (swagger20::Schema { @@ -226,6 +231,7 @@ impl super::CustomDerive for CustomResourceDefinition { }), kubernetes_group_kind_versions: vec![], list_kind: None, + merge_type: swagger20::MergeType::Default, impl_deep_merge: true, }, true)), (swagger20::PropertyName("spec".to_owned()), (swagger20::Schema { @@ -236,6 +242,7 @@ impl super::CustomDerive for CustomResourceDefinition { }), kubernetes_group_kind_versions: vec![], list_kind: None, + merge_type: swagger20::MergeType::Default, impl_deep_merge: true, }, false)), ].into_iter().chain( @@ -245,6 +252,7 @@ impl super::CustomDerive for CustomResourceDefinition { kind: swagger20::SchemaKind::Ty(swagger20::Type::CustomResourceSubresources(has_subresources)), kubernetes_group_kind_versions: vec![], list_kind: None, + merge_type: swagger20::MergeType::Default, impl_deep_merge: true, }, true))) ).collect()), @@ -256,6 +264,7 @@ impl super::CustomDerive for CustomResourceDefinition { }, ], list_kind: Some(format!("{cr_name}List")), + merge_type: swagger20::MergeType::Default, impl_deep_merge, }), ].into(), @@ -304,6 +313,7 @@ impl super::CustomDerive for CustomResourceDefinition { }), kubernetes_group_kind_versions: vec![], list_kind: None, + merge_type: swagger20::MergeType::Default, impl_deep_merge: true, }, })), @@ -337,6 +347,7 @@ impl super::CustomDerive for CustomResourceDefinition { }), kubernetes_group_kind_versions: vec![], list_kind: None, + merge_type: swagger20::MergeType::Default, impl_deep_merge: true, }, })), @@ -352,6 +363,7 @@ impl super::CustomDerive for CustomResourceDefinition { }), kubernetes_group_kind_versions: vec![], list_kind: None, + merge_type: swagger20::MergeType::Default, impl_deep_merge: true, }, })), @@ -385,6 +397,7 @@ impl super::CustomDerive for CustomResourceDefinition { }), kubernetes_group_kind_versions: vec![], list_kind: None, + merge_type: swagger20::MergeType::Default, impl_deep_merge: true, }, })), @@ -417,6 +430,7 @@ impl super::CustomDerive for CustomResourceDefinition { }), kubernetes_group_kind_versions: vec![], list_kind: None, + merge_type: swagger20::MergeType::Default, impl_deep_merge: true, }, })), @@ -434,6 +448,7 @@ impl super::CustomDerive for CustomResourceDefinition { }), kubernetes_group_kind_versions: vec![], list_kind: None, + merge_type: swagger20::MergeType::Default, impl_deep_merge: true, }, })), @@ -466,6 +481,7 @@ impl super::CustomDerive for CustomResourceDefinition { }), kubernetes_group_kind_versions: vec![], list_kind: None, + merge_type: swagger20::MergeType::Default, impl_deep_merge: true, }, })), @@ -483,6 +499,7 @@ impl super::CustomDerive for CustomResourceDefinition { }), kubernetes_group_kind_versions: vec![], list_kind: None, + merge_type: swagger20::MergeType::Default, impl_deep_merge: true, }, })), @@ -516,6 +533,7 @@ impl super::CustomDerive for CustomResourceDefinition { }), kubernetes_group_kind_versions: vec![], list_kind: None, + merge_type: swagger20::MergeType::Default, impl_deep_merge: true, }), ].into()), @@ -546,6 +564,7 @@ impl super::CustomDerive for CustomResourceDefinition { }), kubernetes_group_kind_versions: vec![], list_kind: None, + merge_type: swagger20::MergeType::Default, impl_deep_merge: true, }), ].into()), @@ -578,6 +597,7 @@ impl super::CustomDerive for CustomResourceDefinition { }), kubernetes_group_kind_versions: vec![], list_kind: None, + merge_type: swagger20::MergeType::Default, impl_deep_merge: true, }, })), @@ -613,6 +633,7 @@ impl super::CustomDerive for CustomResourceDefinition { }), kubernetes_group_kind_versions: vec![], list_kind: None, + merge_type: swagger20::MergeType::Default, impl_deep_merge: true, }, })), @@ -646,6 +667,7 @@ impl super::CustomDerive for CustomResourceDefinition { }), kubernetes_group_kind_versions: vec![], list_kind: None, + merge_type: swagger20::MergeType::Default, impl_deep_merge: true, }, })), diff --git a/k8s-openapi-tests-macro-deps/src/lib.rs b/k8s-openapi-tests-macro-deps/src/lib.rs index 33c6d97227..c7fa8b9ac4 100644 --- a/k8s-openapi-tests-macro-deps/src/lib.rs +++ b/k8s-openapi-tests-macro-deps/src/lib.rs @@ -39,7 +39,7 @@ impl k8s_openapi::serde::Serialize for FooBarSpec { impl k8s_openapi::DeepMerge for FooBarSpec { fn merge_from(&mut self, other: Self) where Self: Sized { self.prop1.merge_from(other.prop1); - self.prop2.merge_from(other.prop2); + k8s_openapi::merge_strategies::list::atomic(&mut self.prop2, other.prop2); self.prop3.merge_from(other.prop3); } } diff --git a/k8s-openapi-tests/src/custom_resource_definition.rs b/k8s-openapi-tests/src/custom_resource_definition.rs index f9c5dcb313..3a1bb6049f 100644 --- a/k8s-openapi-tests/src/custom_resource_definition.rs +++ b/k8s-openapi-tests/src/custom_resource_definition.rs @@ -31,7 +31,7 @@ async fn test() { impl k8s_openapi::DeepMerge for FooBarSpec { fn merge_from(&mut self, other: Self) where Self: Sized { self.prop1.merge_from(other.prop1); - self.prop2.merge_from(other.prop2); + k8s_openapi::merge_strategies::list::atomic(&mut self.prop2, other.prop2); self.prop3.merge_from(other.prop3); } } diff --git a/src/deep_merge.rs b/src/deep_merge.rs index 1a7ea0093f..3cb3f405eb 100644 --- a/src/deep_merge.rs +++ b/src/deep_merge.rs @@ -1,6 +1,6 @@ /// A trait applies to types that support deep merging. /// -/// `a.merge_from(b)` behaves in the following ways: +/// `current.merge_from(new)` behaves in the following ways: /// /// ## `struct`s /// @@ -28,25 +28,21 @@ /// /// ## `Option` /// -/// - If `b` is a `None`, `a` is unchanged. +/// - If `new` is a `None`, `current` is unchanged. /// -/// - If `b` is a `Some(b_inner)`: +/// - If `new` is a `Some(new_inner)`: /// -/// - If `a` is a `Some(a_inner)`, `a_inner` is merged with `b_inner`. +/// - If `current` is a `None`, `current` becomes `Some(new_inner)`. /// -/// - If `a` is a `None`, `a` becomes `Some(b_inner)`. +/// - If `current` is a `Some(current_inner)`, `current_inner` is merged with `new_inner`. /// /// ## `Vec` /// -/// The elements of `b` are appended to `a`. +/// Use an [explicit merge strategy.](`strategies::list`) /// /// ## `BTreeMap` /// -/// For each key `k` in `b`: -/// -/// - If `a` contains the key `k` too, the value in `a` is merged with the value in `b`. -/// -/// - If `a` does not contain the key `k`, the value in `b` is inserted into `a`. +/// Use an [explicit merge strategy.](`strategies::map`) /// /// ## `serde_json::Value` /// @@ -103,31 +99,195 @@ impl DeepMerge for Box where T: DeepMerge { } } -impl DeepMerge for std::collections::BTreeMap where K: Ord, V: DeepMerge { - fn merge_from(&mut self, other: Self) { - for (k, v) in other { - match self.entry(k) { - std::collections::btree_map::Entry::Vacant(e) => { e.insert(v); }, - std::collections::btree_map::Entry::Occupied(e) => e.into_mut().merge_from(v), - } - } - } -} - impl DeepMerge for Option where T: DeepMerge { fn merge_from(&mut self, other: Self) { if let Some(other) = other { if let Some(s) = self { s.merge_from(other); - } else { + } + else { *self = Some(other); } } } } -impl DeepMerge for Vec { - fn merge_from(&mut self, other: Self) { - self.extend(other); +/// Strategies for merging collections. +pub mod strategies { + /// Strategies for merging [`Vec`]s. + /// + /// These correspond to [`JSONSchemaProps.x-kubernetes-list-type`](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.26/#jsonschemaprops-v1-apiextensions-k8s-io). + pub mod list { + mod private { + pub trait AsOptVec { + type Item; + + fn set_if_some(&mut self, new: Self); + fn as_mut_opt(&mut self) -> Option<&mut Vec>; + fn into_opt(self) -> Option>; + } + + impl AsOptVec for Vec { + type Item = T; + + fn set_if_some(&mut self, new: Self) { + *self = new; + } + + fn as_mut_opt(&mut self) -> Option<&mut Self> { + Some(self) + } + + fn into_opt(self) -> Option { + Some(self) + } + } + + impl AsOptVec for Option> { + type Item = T; + + fn set_if_some(&mut self, new: Self) { + if new.is_some() { + *self = new; + } + } + + fn as_mut_opt(&mut self) -> Option<&mut Vec> { + self.as_mut() + } + + fn into_opt(self) -> Self { + self + } + } + } + use private::AsOptVec; + + /// The whole list is treated as one scalar value, and will be replaced with the new (non-[`None`]) value. + pub fn atomic(current: &mut V, new: V) where V: AsOptVec { + current.set_if_some(new); + } + + /// The list is treated as a map. + /// + /// Any items with matching keys will be deep-merged. Any items in `new` that are not in `current` will be appended to `current`. + pub fn map( + current: &mut V, + new: V, + key_comparators: &[fn(&V::Item, &V::Item) -> bool], + merge_item: fn(&mut V::Item, V::Item), + ) + where + V: AsOptVec, + { + if let Some(current) = current.as_mut_opt() { + for new_item in new.into_opt().into_iter().flatten() { + if let Some(current_item) = current.iter_mut().find(|current_item| key_comparators.iter().all(|&f| f(&**current_item, &new_item))) { + merge_item(current_item, new_item); + } + else { + current.push(new_item); + } + } + } + else { + current.set_if_some(new); + } + } + + /// The list is treated as a set. + /// + /// Items from `new` will be appended to `current`, _unless_ `current` already contains an equal item. + pub fn set(current: &mut V, new: V) where V: AsOptVec, V::Item: PartialEq { + if let Some(current) = current.as_mut_opt() { + for item in new.into_opt().into_iter().flatten() { + if !current.contains(&item) { + current.push(item); + } + } + } + else { + current.set_if_some(new); + } + } + } + + /// Strategies for merging [`BTreeMap`s.](std::collections::BTreeMap) + /// + /// These correspond to [`JSONSchemaProps.x-kubernetes-map-type`](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.26/#jsonschemaprops-v1-apiextensions-k8s-io). + pub mod map { + mod private { + use std::collections::BTreeMap; + + pub trait AsOptMap { + type Key; + type Value; + + fn set_if_some(&mut self, new: Self); + fn as_mut_opt(&mut self) -> Option<&mut BTreeMap>; + fn into_opt(self) -> Option>; + } + + impl AsOptMap for BTreeMap { + type Key = K; + type Value = V; + + fn set_if_some(&mut self, new: Self) { + *self = new; + } + + fn as_mut_opt(&mut self) -> Option<&mut Self> { + Some(self) + } + + fn into_opt(self) -> Option { + Some(self) + } + } + + impl AsOptMap for Option> { + type Key = K; + type Value = V; + + fn set_if_some(&mut self, new: Self) { + if new.is_some() { + *self = new; + } + } + + fn as_mut_opt(&mut self) -> Option<&mut BTreeMap> { + self.as_mut() + } + + fn into_opt(self) -> Self { + self + } + } + } + use private::AsOptMap; + + /// The whole map is treated as one scalar value, and will be replaced with the new (non-[`None`]) value. + pub fn atomic(current: &mut M, new: M) where M: AsOptMap { + current.set_if_some(new); + } + + /// Each value will be merged separately. + pub fn granular(current: &mut M, new: M, merge_value: fn(&mut M::Value, M::Value)) + where + M: AsOptMap, + M::Key: Ord, + { + if let Some(current) = current.as_mut_opt() { + for (k, new_v) in new.into_opt().into_iter().flatten() { + match current.entry(k) { + std::collections::btree_map::Entry::Vacant(entry) => { entry.insert(new_v); } + std::collections::btree_map::Entry::Occupied(entry) => merge_value(entry.into_mut(), new_v), + } + } + } + else { + current.set_if_some(new); + } + } } } diff --git a/src/lib.rs b/src/lib.rs index 158f2c9f72..8dc063f928 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -428,7 +428,7 @@ pub use _byte_string::ByteString; #[path = "deep_merge.rs"] mod _deep_merge; -pub use self::_deep_merge::DeepMerge; +pub use self::_deep_merge::{DeepMerge, strategies as merge_strategies}; #[path = "resource.rs"] mod _resource; diff --git a/src/v1_20/api/admissionregistration/v1/mutating_webhook.rs b/src/v1_20/api/admissionregistration/v1/mutating_webhook.rs index c6fccaeccb..26b0f30c86 100644 --- a/src/v1_20/api/admissionregistration/v1/mutating_webhook.rs +++ b/src/v1_20/api/admissionregistration/v1/mutating_webhook.rs @@ -81,7 +81,7 @@ pub struct MutatingWebhook { impl crate::DeepMerge for MutatingWebhook { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.admission_review_versions, other.admission_review_versions); + crate::merge_strategies::list::atomic(&mut self.admission_review_versions, other.admission_review_versions); crate::DeepMerge::merge_from(&mut self.client_config, other.client_config); crate::DeepMerge::merge_from(&mut self.failure_policy, other.failure_policy); crate::DeepMerge::merge_from(&mut self.match_policy, other.match_policy); @@ -89,7 +89,7 @@ impl crate::DeepMerge for MutatingWebhook { crate::DeepMerge::merge_from(&mut self.namespace_selector, other.namespace_selector); crate::DeepMerge::merge_from(&mut self.object_selector, other.object_selector); crate::DeepMerge::merge_from(&mut self.reinvocation_policy, other.reinvocation_policy); - crate::DeepMerge::merge_from(&mut self.rules, other.rules); + crate::merge_strategies::list::atomic(&mut self.rules, other.rules); crate::DeepMerge::merge_from(&mut self.side_effects, other.side_effects); crate::DeepMerge::merge_from(&mut self.timeout_seconds, other.timeout_seconds); } 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..156c7ccfcf 100644 --- a/src/v1_20/api/admissionregistration/v1/mutating_webhook_configuration.rs +++ b/src/v1_20/api/admissionregistration/v1/mutating_webhook_configuration.rs @@ -374,7 +374,14 @@ impl crate::Metadata for MutatingWebhookConfiguration { impl crate::DeepMerge for MutatingWebhookConfiguration { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.webhooks, other.webhooks); + crate::merge_strategies::list::map( + &mut self.webhooks, + other.webhooks, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_20/api/admissionregistration/v1/rule_with_operations.rs b/src/v1_20/api/admissionregistration/v1/rule_with_operations.rs index c45c425c57..441b9ab3fd 100644 --- a/src/v1_20/api/admissionregistration/v1/rule_with_operations.rs +++ b/src/v1_20/api/admissionregistration/v1/rule_with_operations.rs @@ -27,10 +27,10 @@ pub struct RuleWithOperations { impl crate::DeepMerge for RuleWithOperations { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.api_groups, other.api_groups); - crate::DeepMerge::merge_from(&mut self.api_versions, other.api_versions); - crate::DeepMerge::merge_from(&mut self.operations, other.operations); - crate::DeepMerge::merge_from(&mut self.resources, other.resources); + crate::merge_strategies::list::atomic(&mut self.api_groups, other.api_groups); + crate::merge_strategies::list::atomic(&mut self.api_versions, other.api_versions); + crate::merge_strategies::list::atomic(&mut self.operations, other.operations); + crate::merge_strategies::list::atomic(&mut self.resources, other.resources); crate::DeepMerge::merge_from(&mut self.scope, other.scope); } } diff --git a/src/v1_20/api/admissionregistration/v1/validating_webhook.rs b/src/v1_20/api/admissionregistration/v1/validating_webhook.rs index 1840fb0c02..d1e45bd019 100644 --- a/src/v1_20/api/admissionregistration/v1/validating_webhook.rs +++ b/src/v1_20/api/admissionregistration/v1/validating_webhook.rs @@ -72,14 +72,14 @@ pub struct ValidatingWebhook { impl crate::DeepMerge for ValidatingWebhook { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.admission_review_versions, other.admission_review_versions); + crate::merge_strategies::list::atomic(&mut self.admission_review_versions, other.admission_review_versions); crate::DeepMerge::merge_from(&mut self.client_config, other.client_config); crate::DeepMerge::merge_from(&mut self.failure_policy, other.failure_policy); crate::DeepMerge::merge_from(&mut self.match_policy, other.match_policy); crate::DeepMerge::merge_from(&mut self.name, other.name); crate::DeepMerge::merge_from(&mut self.namespace_selector, other.namespace_selector); crate::DeepMerge::merge_from(&mut self.object_selector, other.object_selector); - crate::DeepMerge::merge_from(&mut self.rules, other.rules); + crate::merge_strategies::list::atomic(&mut self.rules, other.rules); crate::DeepMerge::merge_from(&mut self.side_effects, other.side_effects); crate::DeepMerge::merge_from(&mut self.timeout_seconds, other.timeout_seconds); } 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..ff20990424 100644 --- a/src/v1_20/api/admissionregistration/v1/validating_webhook_configuration.rs +++ b/src/v1_20/api/admissionregistration/v1/validating_webhook_configuration.rs @@ -374,7 +374,14 @@ impl crate::Metadata for ValidatingWebhookConfiguration { impl crate::DeepMerge for ValidatingWebhookConfiguration { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.webhooks, other.webhooks); + crate::merge_strategies::list::map( + &mut self.webhooks, + other.webhooks, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_20/api/admissionregistration/v1beta1/mutating_webhook.rs b/src/v1_20/api/admissionregistration/v1beta1/mutating_webhook.rs index 8b168c8ba3..2792e7d153 100644 --- a/src/v1_20/api/admissionregistration/v1beta1/mutating_webhook.rs +++ b/src/v1_20/api/admissionregistration/v1beta1/mutating_webhook.rs @@ -81,7 +81,7 @@ pub struct MutatingWebhook { impl crate::DeepMerge for MutatingWebhook { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.admission_review_versions, other.admission_review_versions); + crate::merge_strategies::list::atomic(&mut self.admission_review_versions, other.admission_review_versions); crate::DeepMerge::merge_from(&mut self.client_config, other.client_config); crate::DeepMerge::merge_from(&mut self.failure_policy, other.failure_policy); crate::DeepMerge::merge_from(&mut self.match_policy, other.match_policy); @@ -89,7 +89,7 @@ impl crate::DeepMerge for MutatingWebhook { crate::DeepMerge::merge_from(&mut self.namespace_selector, other.namespace_selector); crate::DeepMerge::merge_from(&mut self.object_selector, other.object_selector); crate::DeepMerge::merge_from(&mut self.reinvocation_policy, other.reinvocation_policy); - crate::DeepMerge::merge_from(&mut self.rules, other.rules); + crate::merge_strategies::list::atomic(&mut self.rules, other.rules); crate::DeepMerge::merge_from(&mut self.side_effects, other.side_effects); crate::DeepMerge::merge_from(&mut self.timeout_seconds, other.timeout_seconds); } 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..52e2009675 100644 --- a/src/v1_20/api/admissionregistration/v1beta1/mutating_webhook_configuration.rs +++ b/src/v1_20/api/admissionregistration/v1beta1/mutating_webhook_configuration.rs @@ -374,7 +374,14 @@ impl crate::Metadata for MutatingWebhookConfiguration { impl crate::DeepMerge for MutatingWebhookConfiguration { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.webhooks, other.webhooks); + crate::merge_strategies::list::map( + &mut self.webhooks, + other.webhooks, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_20/api/admissionregistration/v1beta1/rule_with_operations.rs b/src/v1_20/api/admissionregistration/v1beta1/rule_with_operations.rs index 8b7e74b583..d6fa7b4157 100644 --- a/src/v1_20/api/admissionregistration/v1beta1/rule_with_operations.rs +++ b/src/v1_20/api/admissionregistration/v1beta1/rule_with_operations.rs @@ -27,10 +27,10 @@ pub struct RuleWithOperations { impl crate::DeepMerge for RuleWithOperations { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.api_groups, other.api_groups); - crate::DeepMerge::merge_from(&mut self.api_versions, other.api_versions); - crate::DeepMerge::merge_from(&mut self.operations, other.operations); - crate::DeepMerge::merge_from(&mut self.resources, other.resources); + crate::merge_strategies::list::atomic(&mut self.api_groups, other.api_groups); + crate::merge_strategies::list::atomic(&mut self.api_versions, other.api_versions); + crate::merge_strategies::list::atomic(&mut self.operations, other.operations); + crate::merge_strategies::list::atomic(&mut self.resources, other.resources); crate::DeepMerge::merge_from(&mut self.scope, other.scope); } } diff --git a/src/v1_20/api/admissionregistration/v1beta1/validating_webhook.rs b/src/v1_20/api/admissionregistration/v1beta1/validating_webhook.rs index 9a65ddd160..710905a521 100644 --- a/src/v1_20/api/admissionregistration/v1beta1/validating_webhook.rs +++ b/src/v1_20/api/admissionregistration/v1beta1/validating_webhook.rs @@ -72,14 +72,14 @@ pub struct ValidatingWebhook { impl crate::DeepMerge for ValidatingWebhook { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.admission_review_versions, other.admission_review_versions); + crate::merge_strategies::list::atomic(&mut self.admission_review_versions, other.admission_review_versions); crate::DeepMerge::merge_from(&mut self.client_config, other.client_config); crate::DeepMerge::merge_from(&mut self.failure_policy, other.failure_policy); crate::DeepMerge::merge_from(&mut self.match_policy, other.match_policy); crate::DeepMerge::merge_from(&mut self.name, other.name); crate::DeepMerge::merge_from(&mut self.namespace_selector, other.namespace_selector); crate::DeepMerge::merge_from(&mut self.object_selector, other.object_selector); - crate::DeepMerge::merge_from(&mut self.rules, other.rules); + crate::merge_strategies::list::atomic(&mut self.rules, other.rules); crate::DeepMerge::merge_from(&mut self.side_effects, other.side_effects); crate::DeepMerge::merge_from(&mut self.timeout_seconds, other.timeout_seconds); } 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..6e7cf12141 100644 --- a/src/v1_20/api/admissionregistration/v1beta1/validating_webhook_configuration.rs +++ b/src/v1_20/api/admissionregistration/v1beta1/validating_webhook_configuration.rs @@ -374,7 +374,14 @@ impl crate::Metadata for ValidatingWebhookConfiguration { impl crate::DeepMerge for ValidatingWebhookConfiguration { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.webhooks, other.webhooks); + crate::merge_strategies::list::map( + &mut self.webhooks, + other.webhooks, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_20/api/apiserverinternal/v1alpha1/server_storage_version.rs b/src/v1_20/api/apiserverinternal/v1alpha1/server_storage_version.rs index 1040b5e6d7..5a693d9e59 100644 --- a/src/v1_20/api/apiserverinternal/v1alpha1/server_storage_version.rs +++ b/src/v1_20/api/apiserverinternal/v1alpha1/server_storage_version.rs @@ -16,7 +16,7 @@ pub struct ServerStorageVersion { impl crate::DeepMerge for ServerStorageVersion { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.api_server_id, other.api_server_id); - crate::DeepMerge::merge_from(&mut self.decodable_versions, other.decodable_versions); + crate::merge_strategies::list::set(&mut self.decodable_versions, other.decodable_versions); crate::DeepMerge::merge_from(&mut self.encoding_version, other.encoding_version); } } diff --git a/src/v1_20/api/apiserverinternal/v1alpha1/storage_version_status.rs b/src/v1_20/api/apiserverinternal/v1alpha1/storage_version_status.rs index e63b469644..0d5b9bd3a1 100644 --- a/src/v1_20/api/apiserverinternal/v1alpha1/storage_version_status.rs +++ b/src/v1_20/api/apiserverinternal/v1alpha1/storage_version_status.rs @@ -16,8 +16,22 @@ pub struct StorageVersionStatus { impl crate::DeepMerge for StorageVersionStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.common_encoding_version, other.common_encoding_version); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); - crate::DeepMerge::merge_from(&mut self.storage_versions, other.storage_versions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::list::map( + &mut self.storage_versions, + other.storage_versions, + &[|lhs, rhs| lhs.api_server_id == rhs.api_server_id], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_20/api/apps/v1/daemon_set_status.rs b/src/v1_20/api/apps/v1/daemon_set_status.rs index 42df0deaa3..9d2564a3a3 100644 --- a/src/v1_20/api/apps/v1/daemon_set_status.rs +++ b/src/v1_20/api/apps/v1/daemon_set_status.rs @@ -37,7 +37,14 @@ pub struct DaemonSetStatus { impl crate::DeepMerge for DaemonSetStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.collision_count, other.collision_count); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.current_number_scheduled, other.current_number_scheduled); crate::DeepMerge::merge_from(&mut self.desired_number_scheduled, other.desired_number_scheduled); crate::DeepMerge::merge_from(&mut self.number_available, other.number_available); diff --git a/src/v1_20/api/apps/v1/deployment_status.rs b/src/v1_20/api/apps/v1/deployment_status.rs index 0eb14f47b4..c277884099 100644 --- a/src/v1_20/api/apps/v1/deployment_status.rs +++ b/src/v1_20/api/apps/v1/deployment_status.rs @@ -32,7 +32,14 @@ impl crate::DeepMerge for DeploymentStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.available_replicas, other.available_replicas); crate::DeepMerge::merge_from(&mut self.collision_count, other.collision_count); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.observed_generation, other.observed_generation); crate::DeepMerge::merge_from(&mut self.ready_replicas, other.ready_replicas); crate::DeepMerge::merge_from(&mut self.replicas, other.replicas); diff --git a/src/v1_20/api/apps/v1/replica_set_status.rs b/src/v1_20/api/apps/v1/replica_set_status.rs index 5873b11fdc..60d7e94dce 100644 --- a/src/v1_20/api/apps/v1/replica_set_status.rs +++ b/src/v1_20/api/apps/v1/replica_set_status.rs @@ -25,7 +25,14 @@ pub struct ReplicaSetStatus { impl crate::DeepMerge for ReplicaSetStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.available_replicas, other.available_replicas); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.fully_labeled_replicas, other.fully_labeled_replicas); crate::DeepMerge::merge_from(&mut self.observed_generation, other.observed_generation); crate::DeepMerge::merge_from(&mut self.ready_replicas, other.ready_replicas); diff --git a/src/v1_20/api/apps/v1/stateful_set_spec.rs b/src/v1_20/api/apps/v1/stateful_set_spec.rs index b5fe3f7c8f..f03d03124d 100644 --- a/src/v1_20/api/apps/v1/stateful_set_spec.rs +++ b/src/v1_20/api/apps/v1/stateful_set_spec.rs @@ -37,7 +37,7 @@ impl crate::DeepMerge for StatefulSetSpec { crate::DeepMerge::merge_from(&mut self.service_name, other.service_name); crate::DeepMerge::merge_from(&mut self.template, other.template); crate::DeepMerge::merge_from(&mut self.update_strategy, other.update_strategy); - crate::DeepMerge::merge_from(&mut self.volume_claim_templates, other.volume_claim_templates); + crate::merge_strategies::list::atomic(&mut self.volume_claim_templates, other.volume_claim_templates); } } diff --git a/src/v1_20/api/apps/v1/stateful_set_status.rs b/src/v1_20/api/apps/v1/stateful_set_status.rs index 516c495837..267eeba550 100644 --- a/src/v1_20/api/apps/v1/stateful_set_status.rs +++ b/src/v1_20/api/apps/v1/stateful_set_status.rs @@ -34,7 +34,14 @@ pub struct StatefulSetStatus { impl crate::DeepMerge for StatefulSetStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.collision_count, other.collision_count); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.current_replicas, other.current_replicas); crate::DeepMerge::merge_from(&mut self.current_revision, other.current_revision); crate::DeepMerge::merge_from(&mut self.observed_generation, other.observed_generation); diff --git a/src/v1_20/api/authentication/v1/token_request_spec.rs b/src/v1_20/api/authentication/v1/token_request_spec.rs index 4ec786f381..f10197a68c 100644 --- a/src/v1_20/api/authentication/v1/token_request_spec.rs +++ b/src/v1_20/api/authentication/v1/token_request_spec.rs @@ -15,7 +15,7 @@ pub struct TokenRequestSpec { impl crate::DeepMerge for TokenRequestSpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.audiences, other.audiences); + crate::merge_strategies::list::atomic(&mut self.audiences, other.audiences); crate::DeepMerge::merge_from(&mut self.bound_object_ref, other.bound_object_ref); crate::DeepMerge::merge_from(&mut self.expiration_seconds, other.expiration_seconds); } diff --git a/src/v1_20/api/authentication/v1/token_review_spec.rs b/src/v1_20/api/authentication/v1/token_review_spec.rs index fd84653924..281127b67d 100644 --- a/src/v1_20/api/authentication/v1/token_review_spec.rs +++ b/src/v1_20/api/authentication/v1/token_review_spec.rs @@ -12,7 +12,7 @@ pub struct TokenReviewSpec { impl crate::DeepMerge for TokenReviewSpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.audiences, other.audiences); + crate::merge_strategies::list::atomic(&mut self.audiences, other.audiences); crate::DeepMerge::merge_from(&mut self.token, other.token); } } diff --git a/src/v1_20/api/authentication/v1/token_review_status.rs b/src/v1_20/api/authentication/v1/token_review_status.rs index 464164bcf9..4dd5aacc3d 100644 --- a/src/v1_20/api/authentication/v1/token_review_status.rs +++ b/src/v1_20/api/authentication/v1/token_review_status.rs @@ -18,7 +18,7 @@ pub struct TokenReviewStatus { impl crate::DeepMerge for TokenReviewStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.audiences, other.audiences); + crate::merge_strategies::list::atomic(&mut self.audiences, other.audiences); crate::DeepMerge::merge_from(&mut self.authenticated, other.authenticated); crate::DeepMerge::merge_from(&mut self.error, other.error); crate::DeepMerge::merge_from(&mut self.user, other.user); diff --git a/src/v1_20/api/authentication/v1/user_info.rs b/src/v1_20/api/authentication/v1/user_info.rs index d6890119b7..3890788cda 100644 --- a/src/v1_20/api/authentication/v1/user_info.rs +++ b/src/v1_20/api/authentication/v1/user_info.rs @@ -18,8 +18,10 @@ pub struct UserInfo { impl crate::DeepMerge for UserInfo { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.extra, other.extra); - crate::DeepMerge::merge_from(&mut self.groups, other.groups); + crate::merge_strategies::map::granular(&mut self.extra, other.extra, |current_item, other_item| { + crate::merge_strategies::list::atomic(current_item, other_item); + }); + crate::merge_strategies::list::atomic(&mut self.groups, other.groups); crate::DeepMerge::merge_from(&mut self.uid, other.uid); crate::DeepMerge::merge_from(&mut self.username, other.username); } diff --git a/src/v1_20/api/authentication/v1beta1/token_review_spec.rs b/src/v1_20/api/authentication/v1beta1/token_review_spec.rs index f593603070..29b8fcdf67 100644 --- a/src/v1_20/api/authentication/v1beta1/token_review_spec.rs +++ b/src/v1_20/api/authentication/v1beta1/token_review_spec.rs @@ -12,7 +12,7 @@ pub struct TokenReviewSpec { impl crate::DeepMerge for TokenReviewSpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.audiences, other.audiences); + crate::merge_strategies::list::atomic(&mut self.audiences, other.audiences); crate::DeepMerge::merge_from(&mut self.token, other.token); } } diff --git a/src/v1_20/api/authentication/v1beta1/token_review_status.rs b/src/v1_20/api/authentication/v1beta1/token_review_status.rs index 16a21814be..536d772e90 100644 --- a/src/v1_20/api/authentication/v1beta1/token_review_status.rs +++ b/src/v1_20/api/authentication/v1beta1/token_review_status.rs @@ -18,7 +18,7 @@ pub struct TokenReviewStatus { impl crate::DeepMerge for TokenReviewStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.audiences, other.audiences); + crate::merge_strategies::list::atomic(&mut self.audiences, other.audiences); crate::DeepMerge::merge_from(&mut self.authenticated, other.authenticated); crate::DeepMerge::merge_from(&mut self.error, other.error); crate::DeepMerge::merge_from(&mut self.user, other.user); diff --git a/src/v1_20/api/authentication/v1beta1/user_info.rs b/src/v1_20/api/authentication/v1beta1/user_info.rs index 532cfc4699..72ce2a1d57 100644 --- a/src/v1_20/api/authentication/v1beta1/user_info.rs +++ b/src/v1_20/api/authentication/v1beta1/user_info.rs @@ -18,8 +18,10 @@ pub struct UserInfo { impl crate::DeepMerge for UserInfo { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.extra, other.extra); - crate::DeepMerge::merge_from(&mut self.groups, other.groups); + crate::merge_strategies::map::granular(&mut self.extra, other.extra, |current_item, other_item| { + crate::merge_strategies::list::atomic(current_item, other_item); + }); + crate::merge_strategies::list::atomic(&mut self.groups, other.groups); crate::DeepMerge::merge_from(&mut self.uid, other.uid); crate::DeepMerge::merge_from(&mut self.username, other.username); } diff --git a/src/v1_20/api/authorization/v1/non_resource_rule.rs b/src/v1_20/api/authorization/v1/non_resource_rule.rs index 7df269ffd7..db780454b8 100644 --- a/src/v1_20/api/authorization/v1/non_resource_rule.rs +++ b/src/v1_20/api/authorization/v1/non_resource_rule.rs @@ -12,8 +12,8 @@ pub struct NonResourceRule { impl crate::DeepMerge for NonResourceRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.non_resource_urls, other.non_resource_urls); - crate::DeepMerge::merge_from(&mut self.verbs, other.verbs); + crate::merge_strategies::list::atomic(&mut self.non_resource_urls, other.non_resource_urls); + crate::merge_strategies::list::atomic(&mut self.verbs, other.verbs); } } diff --git a/src/v1_20/api/authorization/v1/resource_rule.rs b/src/v1_20/api/authorization/v1/resource_rule.rs index 58b5e020a8..1af9333654 100644 --- a/src/v1_20/api/authorization/v1/resource_rule.rs +++ b/src/v1_20/api/authorization/v1/resource_rule.rs @@ -19,10 +19,10 @@ pub struct ResourceRule { impl crate::DeepMerge for ResourceRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.api_groups, other.api_groups); - crate::DeepMerge::merge_from(&mut self.resource_names, other.resource_names); - crate::DeepMerge::merge_from(&mut self.resources, other.resources); - crate::DeepMerge::merge_from(&mut self.verbs, other.verbs); + crate::merge_strategies::list::atomic(&mut self.api_groups, other.api_groups); + crate::merge_strategies::list::atomic(&mut self.resource_names, other.resource_names); + crate::merge_strategies::list::atomic(&mut self.resources, other.resources); + crate::merge_strategies::list::atomic(&mut self.verbs, other.verbs); } } diff --git a/src/v1_20/api/authorization/v1/subject_access_review_spec.rs b/src/v1_20/api/authorization/v1/subject_access_review_spec.rs index ae8fadafd9..a4c4af18ce 100644 --- a/src/v1_20/api/authorization/v1/subject_access_review_spec.rs +++ b/src/v1_20/api/authorization/v1/subject_access_review_spec.rs @@ -24,8 +24,10 @@ pub struct SubjectAccessReviewSpec { impl crate::DeepMerge for SubjectAccessReviewSpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.extra, other.extra); - crate::DeepMerge::merge_from(&mut self.groups, other.groups); + crate::merge_strategies::map::granular(&mut self.extra, other.extra, |current_item, other_item| { + crate::merge_strategies::list::atomic(current_item, other_item); + }); + crate::merge_strategies::list::atomic(&mut self.groups, other.groups); crate::DeepMerge::merge_from(&mut self.non_resource_attributes, other.non_resource_attributes); crate::DeepMerge::merge_from(&mut self.resource_attributes, other.resource_attributes); crate::DeepMerge::merge_from(&mut self.uid, other.uid); diff --git a/src/v1_20/api/authorization/v1/subject_rules_review_status.rs b/src/v1_20/api/authorization/v1/subject_rules_review_status.rs index 9d7fb042cf..9d1682a3c8 100644 --- a/src/v1_20/api/authorization/v1/subject_rules_review_status.rs +++ b/src/v1_20/api/authorization/v1/subject_rules_review_status.rs @@ -20,8 +20,8 @@ impl crate::DeepMerge for SubjectRulesReviewStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.evaluation_error, other.evaluation_error); crate::DeepMerge::merge_from(&mut self.incomplete, other.incomplete); - crate::DeepMerge::merge_from(&mut self.non_resource_rules, other.non_resource_rules); - crate::DeepMerge::merge_from(&mut self.resource_rules, other.resource_rules); + crate::merge_strategies::list::atomic(&mut self.non_resource_rules, other.non_resource_rules); + crate::merge_strategies::list::atomic(&mut self.resource_rules, other.resource_rules); } } diff --git a/src/v1_20/api/authorization/v1beta1/non_resource_rule.rs b/src/v1_20/api/authorization/v1beta1/non_resource_rule.rs index 101a985df1..d437d92b78 100644 --- a/src/v1_20/api/authorization/v1beta1/non_resource_rule.rs +++ b/src/v1_20/api/authorization/v1beta1/non_resource_rule.rs @@ -12,8 +12,8 @@ pub struct NonResourceRule { impl crate::DeepMerge for NonResourceRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.non_resource_urls, other.non_resource_urls); - crate::DeepMerge::merge_from(&mut self.verbs, other.verbs); + crate::merge_strategies::list::atomic(&mut self.non_resource_urls, other.non_resource_urls); + crate::merge_strategies::list::atomic(&mut self.verbs, other.verbs); } } diff --git a/src/v1_20/api/authorization/v1beta1/resource_rule.rs b/src/v1_20/api/authorization/v1beta1/resource_rule.rs index cb6a8ce89d..64eb336fc1 100644 --- a/src/v1_20/api/authorization/v1beta1/resource_rule.rs +++ b/src/v1_20/api/authorization/v1beta1/resource_rule.rs @@ -19,10 +19,10 @@ pub struct ResourceRule { impl crate::DeepMerge for ResourceRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.api_groups, other.api_groups); - crate::DeepMerge::merge_from(&mut self.resource_names, other.resource_names); - crate::DeepMerge::merge_from(&mut self.resources, other.resources); - crate::DeepMerge::merge_from(&mut self.verbs, other.verbs); + crate::merge_strategies::list::atomic(&mut self.api_groups, other.api_groups); + crate::merge_strategies::list::atomic(&mut self.resource_names, other.resource_names); + crate::merge_strategies::list::atomic(&mut self.resources, other.resources); + crate::merge_strategies::list::atomic(&mut self.verbs, other.verbs); } } diff --git a/src/v1_20/api/authorization/v1beta1/subject_access_review_spec.rs b/src/v1_20/api/authorization/v1beta1/subject_access_review_spec.rs index 60ec1ae2f7..26f0124880 100644 --- a/src/v1_20/api/authorization/v1beta1/subject_access_review_spec.rs +++ b/src/v1_20/api/authorization/v1beta1/subject_access_review_spec.rs @@ -24,8 +24,10 @@ pub struct SubjectAccessReviewSpec { impl crate::DeepMerge for SubjectAccessReviewSpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.extra, other.extra); - crate::DeepMerge::merge_from(&mut self.group, other.group); + crate::merge_strategies::map::granular(&mut self.extra, other.extra, |current_item, other_item| { + crate::merge_strategies::list::atomic(current_item, other_item); + }); + crate::merge_strategies::list::atomic(&mut self.group, other.group); crate::DeepMerge::merge_from(&mut self.non_resource_attributes, other.non_resource_attributes); crate::DeepMerge::merge_from(&mut self.resource_attributes, other.resource_attributes); crate::DeepMerge::merge_from(&mut self.uid, other.uid); diff --git a/src/v1_20/api/authorization/v1beta1/subject_rules_review_status.rs b/src/v1_20/api/authorization/v1beta1/subject_rules_review_status.rs index 229f6e0f41..2174973d32 100644 --- a/src/v1_20/api/authorization/v1beta1/subject_rules_review_status.rs +++ b/src/v1_20/api/authorization/v1beta1/subject_rules_review_status.rs @@ -20,8 +20,8 @@ impl crate::DeepMerge for SubjectRulesReviewStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.evaluation_error, other.evaluation_error); crate::DeepMerge::merge_from(&mut self.incomplete, other.incomplete); - crate::DeepMerge::merge_from(&mut self.non_resource_rules, other.non_resource_rules); - crate::DeepMerge::merge_from(&mut self.resource_rules, other.resource_rules); + crate::merge_strategies::list::atomic(&mut self.non_resource_rules, other.non_resource_rules); + crate::merge_strategies::list::atomic(&mut self.resource_rules, other.resource_rules); } } diff --git a/src/v1_20/api/autoscaling/v2beta1/horizontal_pod_autoscaler_spec.rs b/src/v1_20/api/autoscaling/v2beta1/horizontal_pod_autoscaler_spec.rs index dd2649f83e..c286723a24 100644 --- a/src/v1_20/api/autoscaling/v2beta1/horizontal_pod_autoscaler_spec.rs +++ b/src/v1_20/api/autoscaling/v2beta1/horizontal_pod_autoscaler_spec.rs @@ -19,7 +19,7 @@ pub struct HorizontalPodAutoscalerSpec { impl crate::DeepMerge for HorizontalPodAutoscalerSpec { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.max_replicas, other.max_replicas); - crate::DeepMerge::merge_from(&mut self.metrics, other.metrics); + crate::merge_strategies::list::atomic(&mut self.metrics, other.metrics); crate::DeepMerge::merge_from(&mut self.min_replicas, other.min_replicas); crate::DeepMerge::merge_from(&mut self.scale_target_ref, other.scale_target_ref); } diff --git a/src/v1_20/api/autoscaling/v2beta1/horizontal_pod_autoscaler_status.rs b/src/v1_20/api/autoscaling/v2beta1/horizontal_pod_autoscaler_status.rs index f626003266..a4dc183a7f 100644 --- a/src/v1_20/api/autoscaling/v2beta1/horizontal_pod_autoscaler_status.rs +++ b/src/v1_20/api/autoscaling/v2beta1/horizontal_pod_autoscaler_status.rs @@ -24,8 +24,8 @@ pub struct HorizontalPodAutoscalerStatus { impl crate::DeepMerge for HorizontalPodAutoscalerStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); - crate::DeepMerge::merge_from(&mut self.current_metrics, other.current_metrics); + crate::merge_strategies::list::atomic(&mut self.conditions, other.conditions); + crate::merge_strategies::list::atomic(&mut self.current_metrics, other.current_metrics); crate::DeepMerge::merge_from(&mut self.current_replicas, other.current_replicas); crate::DeepMerge::merge_from(&mut self.desired_replicas, other.desired_replicas); crate::DeepMerge::merge_from(&mut self.last_scale_time, other.last_scale_time); diff --git a/src/v1_20/api/autoscaling/v2beta2/horizontal_pod_autoscaler_spec.rs b/src/v1_20/api/autoscaling/v2beta2/horizontal_pod_autoscaler_spec.rs index c529e49162..681cf9c99b 100644 --- a/src/v1_20/api/autoscaling/v2beta2/horizontal_pod_autoscaler_spec.rs +++ b/src/v1_20/api/autoscaling/v2beta2/horizontal_pod_autoscaler_spec.rs @@ -23,7 +23,7 @@ impl crate::DeepMerge for HorizontalPodAutoscalerSpec { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.behavior, other.behavior); crate::DeepMerge::merge_from(&mut self.max_replicas, other.max_replicas); - crate::DeepMerge::merge_from(&mut self.metrics, other.metrics); + crate::merge_strategies::list::atomic(&mut self.metrics, other.metrics); crate::DeepMerge::merge_from(&mut self.min_replicas, other.min_replicas); crate::DeepMerge::merge_from(&mut self.scale_target_ref, other.scale_target_ref); } diff --git a/src/v1_20/api/autoscaling/v2beta2/horizontal_pod_autoscaler_status.rs b/src/v1_20/api/autoscaling/v2beta2/horizontal_pod_autoscaler_status.rs index ee1cef4668..1c3f421d0e 100644 --- a/src/v1_20/api/autoscaling/v2beta2/horizontal_pod_autoscaler_status.rs +++ b/src/v1_20/api/autoscaling/v2beta2/horizontal_pod_autoscaler_status.rs @@ -24,8 +24,8 @@ pub struct HorizontalPodAutoscalerStatus { impl crate::DeepMerge for HorizontalPodAutoscalerStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); - crate::DeepMerge::merge_from(&mut self.current_metrics, other.current_metrics); + crate::merge_strategies::list::atomic(&mut self.conditions, other.conditions); + crate::merge_strategies::list::atomic(&mut self.current_metrics, other.current_metrics); crate::DeepMerge::merge_from(&mut self.current_replicas, other.current_replicas); crate::DeepMerge::merge_from(&mut self.desired_replicas, other.desired_replicas); crate::DeepMerge::merge_from(&mut self.last_scale_time, other.last_scale_time); diff --git a/src/v1_20/api/autoscaling/v2beta2/hpa_scaling_rules.rs b/src/v1_20/api/autoscaling/v2beta2/hpa_scaling_rules.rs index 3b62f0dd91..fde69f31c4 100644 --- a/src/v1_20/api/autoscaling/v2beta2/hpa_scaling_rules.rs +++ b/src/v1_20/api/autoscaling/v2beta2/hpa_scaling_rules.rs @@ -15,7 +15,7 @@ pub struct HPAScalingRules { impl crate::DeepMerge for HPAScalingRules { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.policies, other.policies); + crate::merge_strategies::list::atomic(&mut self.policies, other.policies); crate::DeepMerge::merge_from(&mut self.select_policy, other.select_policy); crate::DeepMerge::merge_from(&mut self.stabilization_window_seconds, other.stabilization_window_seconds); } diff --git a/src/v1_20/api/batch/v1/job_status.rs b/src/v1_20/api/batch/v1/job_status.rs index 80a300c418..9ea07090b1 100644 --- a/src/v1_20/api/batch/v1/job_status.rs +++ b/src/v1_20/api/batch/v1/job_status.rs @@ -26,7 +26,14 @@ impl crate::DeepMerge for JobStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.active, other.active); crate::DeepMerge::merge_from(&mut self.completion_time, other.completion_time); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.failed, other.failed); crate::DeepMerge::merge_from(&mut self.start_time, other.start_time); crate::DeepMerge::merge_from(&mut self.succeeded, other.succeeded); diff --git a/src/v1_20/api/batch/v1beta1/cron_job_status.rs b/src/v1_20/api/batch/v1beta1/cron_job_status.rs index 305f3110b1..8a0a5957ed 100644 --- a/src/v1_20/api/batch/v1beta1/cron_job_status.rs +++ b/src/v1_20/api/batch/v1beta1/cron_job_status.rs @@ -12,7 +12,7 @@ pub struct CronJobStatus { impl crate::DeepMerge for CronJobStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.active, other.active); + crate::merge_strategies::list::atomic(&mut self.active, other.active); crate::DeepMerge::merge_from(&mut self.last_schedule_time, other.last_schedule_time); } } diff --git a/src/v1_20/api/batch/v2alpha1/cron_job_status.rs b/src/v1_20/api/batch/v2alpha1/cron_job_status.rs index a398c1843c..463cb4e804 100644 --- a/src/v1_20/api/batch/v2alpha1/cron_job_status.rs +++ b/src/v1_20/api/batch/v2alpha1/cron_job_status.rs @@ -12,7 +12,7 @@ pub struct CronJobStatus { impl crate::DeepMerge for CronJobStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.active, other.active); + crate::merge_strategies::list::atomic(&mut self.active, other.active); crate::DeepMerge::merge_from(&mut self.last_schedule_time, other.last_schedule_time); } } diff --git a/src/v1_20/api/certificates/v1/certificate_signing_request_spec.rs b/src/v1_20/api/certificates/v1/certificate_signing_request_spec.rs index 5dbb08bbac..567f830059 100644 --- a/src/v1_20/api/certificates/v1/certificate_signing_request_spec.rs +++ b/src/v1_20/api/certificates/v1/certificate_signing_request_spec.rs @@ -60,12 +60,14 @@ pub struct CertificateSigningRequestSpec { impl crate::DeepMerge for CertificateSigningRequestSpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.extra, other.extra); - crate::DeepMerge::merge_from(&mut self.groups, other.groups); + crate::merge_strategies::map::granular(&mut self.extra, other.extra, |current_item, other_item| { + crate::merge_strategies::list::atomic(current_item, other_item); + }); + crate::merge_strategies::list::atomic(&mut self.groups, other.groups); crate::DeepMerge::merge_from(&mut self.request, other.request); crate::DeepMerge::merge_from(&mut self.signer_name, other.signer_name); crate::DeepMerge::merge_from(&mut self.uid, other.uid); - crate::DeepMerge::merge_from(&mut self.usages, other.usages); + crate::merge_strategies::list::atomic(&mut self.usages, other.usages); crate::DeepMerge::merge_from(&mut self.username, other.username); } } diff --git a/src/v1_20/api/certificates/v1/certificate_signing_request_status.rs b/src/v1_20/api/certificates/v1/certificate_signing_request_status.rs index 81fb876580..d17c51933f 100644 --- a/src/v1_20/api/certificates/v1/certificate_signing_request_status.rs +++ b/src/v1_20/api/certificates/v1/certificate_signing_request_status.rs @@ -34,7 +34,14 @@ pub struct CertificateSigningRequestStatus { impl crate::DeepMerge for CertificateSigningRequestStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.certificate, other.certificate); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_20/api/certificates/v1beta1/certificate_signing_request_spec.rs b/src/v1_20/api/certificates/v1beta1/certificate_signing_request_spec.rs index 22f937550e..33f83c4f29 100644 --- a/src/v1_20/api/certificates/v1beta1/certificate_signing_request_spec.rs +++ b/src/v1_20/api/certificates/v1beta1/certificate_signing_request_spec.rs @@ -58,12 +58,14 @@ pub struct CertificateSigningRequestSpec { impl crate::DeepMerge for CertificateSigningRequestSpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.extra, other.extra); - crate::DeepMerge::merge_from(&mut self.groups, other.groups); + crate::merge_strategies::map::granular(&mut self.extra, other.extra, |current_item, other_item| { + crate::merge_strategies::list::atomic(current_item, other_item); + }); + crate::merge_strategies::list::atomic(&mut self.groups, other.groups); crate::DeepMerge::merge_from(&mut self.request, other.request); crate::DeepMerge::merge_from(&mut self.signer_name, other.signer_name); crate::DeepMerge::merge_from(&mut self.uid, other.uid); - crate::DeepMerge::merge_from(&mut self.usages, other.usages); + crate::merge_strategies::list::atomic(&mut self.usages, other.usages); crate::DeepMerge::merge_from(&mut self.username, other.username); } } diff --git a/src/v1_20/api/certificates/v1beta1/certificate_signing_request_status.rs b/src/v1_20/api/certificates/v1beta1/certificate_signing_request_status.rs index b7686fa483..1204917e51 100644 --- a/src/v1_20/api/certificates/v1beta1/certificate_signing_request_status.rs +++ b/src/v1_20/api/certificates/v1beta1/certificate_signing_request_status.rs @@ -12,7 +12,14 @@ pub struct CertificateSigningRequestStatus { impl crate::DeepMerge for CertificateSigningRequestStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.certificate, other.certificate); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_20/api/core/v1/capabilities.rs b/src/v1_20/api/core/v1/capabilities.rs index 6045e4f5d2..1a260b5256 100644 --- a/src/v1_20/api/core/v1/capabilities.rs +++ b/src/v1_20/api/core/v1/capabilities.rs @@ -12,8 +12,8 @@ pub struct Capabilities { impl crate::DeepMerge for Capabilities { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.add, other.add); - crate::DeepMerge::merge_from(&mut self.drop, other.drop); + crate::merge_strategies::list::atomic(&mut self.add, other.add); + crate::merge_strategies::list::atomic(&mut self.drop, other.drop); } } diff --git a/src/v1_20/api/core/v1/ceph_fs_persistent_volume_source.rs b/src/v1_20/api/core/v1/ceph_fs_persistent_volume_source.rs index 5db02966fd..708ee7615e 100644 --- a/src/v1_20/api/core/v1/ceph_fs_persistent_volume_source.rs +++ b/src/v1_20/api/core/v1/ceph_fs_persistent_volume_source.rs @@ -24,7 +24,7 @@ pub struct CephFSPersistentVolumeSource { impl crate::DeepMerge for CephFSPersistentVolumeSource { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.monitors, other.monitors); + crate::merge_strategies::list::atomic(&mut self.monitors, other.monitors); crate::DeepMerge::merge_from(&mut self.path, other.path); crate::DeepMerge::merge_from(&mut self.read_only, other.read_only); crate::DeepMerge::merge_from(&mut self.secret_file, other.secret_file); diff --git a/src/v1_20/api/core/v1/ceph_fs_volume_source.rs b/src/v1_20/api/core/v1/ceph_fs_volume_source.rs index 1be27ee35c..689608de39 100644 --- a/src/v1_20/api/core/v1/ceph_fs_volume_source.rs +++ b/src/v1_20/api/core/v1/ceph_fs_volume_source.rs @@ -24,7 +24,7 @@ pub struct CephFSVolumeSource { impl crate::DeepMerge for CephFSVolumeSource { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.monitors, other.monitors); + crate::merge_strategies::list::atomic(&mut self.monitors, other.monitors); crate::DeepMerge::merge_from(&mut self.path, other.path); crate::DeepMerge::merge_from(&mut self.read_only, other.read_only); crate::DeepMerge::merge_from(&mut self.secret_file, other.secret_file); diff --git a/src/v1_20/api/core/v1/component_status.rs b/src/v1_20/api/core/v1/component_status.rs index ecddf82170..50e55665e4 100644 --- a/src/v1_20/api/core/v1/component_status.rs +++ b/src/v1_20/api/core/v1/component_status.rs @@ -172,7 +172,14 @@ impl crate::Metadata for ComponentStatus { impl crate::DeepMerge for ComponentStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); } } diff --git a/src/v1_20/api/core/v1/config_map.rs b/src/v1_20/api/core/v1/config_map.rs index ddc3726220..c487d9c5a0 100644 --- a/src/v1_20/api/core/v1/config_map.rs +++ b/src/v1_20/api/core/v1/config_map.rs @@ -495,8 +495,12 @@ impl crate::Metadata for ConfigMap { impl crate::DeepMerge for ConfigMap { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.binary_data, other.binary_data); - crate::DeepMerge::merge_from(&mut self.data, other.data); + crate::merge_strategies::map::granular(&mut self.binary_data, other.binary_data, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.data, other.data, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.immutable, other.immutable); crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); } diff --git a/src/v1_20/api/core/v1/config_map_projection.rs b/src/v1_20/api/core/v1/config_map_projection.rs index 458f277bb3..e2a94bc391 100644 --- a/src/v1_20/api/core/v1/config_map_projection.rs +++ b/src/v1_20/api/core/v1/config_map_projection.rs @@ -17,7 +17,7 @@ pub struct ConfigMapProjection { impl crate::DeepMerge for ConfigMapProjection { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.items, other.items); + crate::merge_strategies::list::atomic(&mut self.items, other.items); crate::DeepMerge::merge_from(&mut self.name, other.name); crate::DeepMerge::merge_from(&mut self.optional, other.optional); } diff --git a/src/v1_20/api/core/v1/config_map_volume_source.rs b/src/v1_20/api/core/v1/config_map_volume_source.rs index 915b10bdcd..b612fcb857 100644 --- a/src/v1_20/api/core/v1/config_map_volume_source.rs +++ b/src/v1_20/api/core/v1/config_map_volume_source.rs @@ -21,7 +21,7 @@ pub struct ConfigMapVolumeSource { impl crate::DeepMerge for ConfigMapVolumeSource { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.default_mode, other.default_mode); - crate::DeepMerge::merge_from(&mut self.items, other.items); + crate::merge_strategies::list::atomic(&mut self.items, other.items); crate::DeepMerge::merge_from(&mut self.name, other.name); crate::DeepMerge::merge_from(&mut self.optional, other.optional); } diff --git a/src/v1_20/api/core/v1/container.rs b/src/v1_20/api/core/v1/container.rs index ac84799c76..9a53fd2230 100644 --- a/src/v1_20/api/core/v1/container.rs +++ b/src/v1_20/api/core/v1/container.rs @@ -72,16 +72,30 @@ pub struct Container { impl crate::DeepMerge for Container { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.args, other.args); - crate::DeepMerge::merge_from(&mut self.command, other.command); - crate::DeepMerge::merge_from(&mut self.env, other.env); - crate::DeepMerge::merge_from(&mut self.env_from, other.env_from); + crate::merge_strategies::list::atomic(&mut self.args, other.args); + crate::merge_strategies::list::atomic(&mut self.command, other.command); + crate::merge_strategies::list::map( + &mut self.env, + other.env, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::list::atomic(&mut self.env_from, other.env_from); crate::DeepMerge::merge_from(&mut self.image, other.image); crate::DeepMerge::merge_from(&mut self.image_pull_policy, other.image_pull_policy); crate::DeepMerge::merge_from(&mut self.lifecycle, other.lifecycle); crate::DeepMerge::merge_from(&mut self.liveness_probe, other.liveness_probe); crate::DeepMerge::merge_from(&mut self.name, other.name); - crate::DeepMerge::merge_from(&mut self.ports, other.ports); + crate::merge_strategies::list::map( + &mut self.ports, + other.ports, + &[|lhs, rhs| lhs.container_port == rhs.container_port], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.readiness_probe, other.readiness_probe); crate::DeepMerge::merge_from(&mut self.resources, other.resources); crate::DeepMerge::merge_from(&mut self.security_context, other.security_context); @@ -91,8 +105,22 @@ impl crate::DeepMerge for Container { crate::DeepMerge::merge_from(&mut self.termination_message_path, other.termination_message_path); crate::DeepMerge::merge_from(&mut self.termination_message_policy, other.termination_message_policy); crate::DeepMerge::merge_from(&mut self.tty, other.tty); - crate::DeepMerge::merge_from(&mut self.volume_devices, other.volume_devices); - crate::DeepMerge::merge_from(&mut self.volume_mounts, other.volume_mounts); + crate::merge_strategies::list::map( + &mut self.volume_devices, + other.volume_devices, + &[|lhs, rhs| lhs.device_path == rhs.device_path], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::list::map( + &mut self.volume_mounts, + other.volume_mounts, + &[|lhs, rhs| lhs.mount_path == rhs.mount_path], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.working_dir, other.working_dir); } } diff --git a/src/v1_20/api/core/v1/container_image.rs b/src/v1_20/api/core/v1/container_image.rs index 697ef4906e..871033f834 100644 --- a/src/v1_20/api/core/v1/container_image.rs +++ b/src/v1_20/api/core/v1/container_image.rs @@ -12,7 +12,7 @@ pub struct ContainerImage { impl crate::DeepMerge for ContainerImage { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.names, other.names); + crate::merge_strategies::list::atomic(&mut self.names, other.names); crate::DeepMerge::merge_from(&mut self.size_bytes, other.size_bytes); } } diff --git a/src/v1_20/api/core/v1/csi_persistent_volume_source.rs b/src/v1_20/api/core/v1/csi_persistent_volume_source.rs index b8b244ea2b..7d04fa8349 100644 --- a/src/v1_20/api/core/v1/csi_persistent_volume_source.rs +++ b/src/v1_20/api/core/v1/csi_persistent_volume_source.rs @@ -40,7 +40,9 @@ impl crate::DeepMerge for CSIPersistentVolumeSource { crate::DeepMerge::merge_from(&mut self.node_publish_secret_ref, other.node_publish_secret_ref); crate::DeepMerge::merge_from(&mut self.node_stage_secret_ref, other.node_stage_secret_ref); crate::DeepMerge::merge_from(&mut self.read_only, other.read_only); - crate::DeepMerge::merge_from(&mut self.volume_attributes, other.volume_attributes); + crate::merge_strategies::map::granular(&mut self.volume_attributes, other.volume_attributes, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.volume_handle, other.volume_handle); } } diff --git a/src/v1_20/api/core/v1/csi_volume_source.rs b/src/v1_20/api/core/v1/csi_volume_source.rs index e5a311c536..2b2f26aa48 100644 --- a/src/v1_20/api/core/v1/csi_volume_source.rs +++ b/src/v1_20/api/core/v1/csi_volume_source.rs @@ -25,7 +25,9 @@ impl crate::DeepMerge for CSIVolumeSource { crate::DeepMerge::merge_from(&mut self.fs_type, other.fs_type); crate::DeepMerge::merge_from(&mut self.node_publish_secret_ref, other.node_publish_secret_ref); crate::DeepMerge::merge_from(&mut self.read_only, other.read_only); - crate::DeepMerge::merge_from(&mut self.volume_attributes, other.volume_attributes); + crate::merge_strategies::map::granular(&mut self.volume_attributes, other.volume_attributes, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); } } diff --git a/src/v1_20/api/core/v1/downward_api_projection.rs b/src/v1_20/api/core/v1/downward_api_projection.rs index de0fca6185..950e2e5645 100644 --- a/src/v1_20/api/core/v1/downward_api_projection.rs +++ b/src/v1_20/api/core/v1/downward_api_projection.rs @@ -9,7 +9,7 @@ pub struct DownwardAPIProjection { impl crate::DeepMerge for DownwardAPIProjection { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.items, other.items); + crate::merge_strategies::list::atomic(&mut self.items, other.items); } } diff --git a/src/v1_20/api/core/v1/downward_api_volume_source.rs b/src/v1_20/api/core/v1/downward_api_volume_source.rs index 214c15f03f..96b4ebb987 100644 --- a/src/v1_20/api/core/v1/downward_api_volume_source.rs +++ b/src/v1_20/api/core/v1/downward_api_volume_source.rs @@ -13,7 +13,7 @@ pub struct DownwardAPIVolumeSource { impl crate::DeepMerge for DownwardAPIVolumeSource { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.default_mode, other.default_mode); - crate::DeepMerge::merge_from(&mut self.items, other.items); + crate::merge_strategies::list::atomic(&mut self.items, other.items); } } diff --git a/src/v1_20/api/core/v1/endpoint_subset.rs b/src/v1_20/api/core/v1/endpoint_subset.rs index c395596b77..20ca195e97 100644 --- a/src/v1_20/api/core/v1/endpoint_subset.rs +++ b/src/v1_20/api/core/v1/endpoint_subset.rs @@ -22,9 +22,9 @@ pub struct EndpointSubset { impl crate::DeepMerge for EndpointSubset { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.addresses, other.addresses); - crate::DeepMerge::merge_from(&mut self.not_ready_addresses, other.not_ready_addresses); - crate::DeepMerge::merge_from(&mut self.ports, other.ports); + crate::merge_strategies::list::atomic(&mut self.addresses, other.addresses); + crate::merge_strategies::list::atomic(&mut self.not_ready_addresses, other.not_ready_addresses); + crate::merge_strategies::list::atomic(&mut self.ports, other.ports); } } diff --git a/src/v1_20/api/core/v1/endpoints.rs b/src/v1_20/api/core/v1/endpoints.rs index c9b545e04c..7ce1fbc5ba 100644 --- a/src/v1_20/api/core/v1/endpoints.rs +++ b/src/v1_20/api/core/v1/endpoints.rs @@ -501,7 +501,7 @@ impl crate::Metadata for Endpoints { impl crate::DeepMerge for Endpoints { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.subsets, other.subsets); + crate::merge_strategies::list::atomic(&mut self.subsets, other.subsets); } } diff --git a/src/v1_20/api/core/v1/ephemeral_container.rs b/src/v1_20/api/core/v1/ephemeral_container.rs index 0a50a54162..3946cc6727 100644 --- a/src/v1_20/api/core/v1/ephemeral_container.rs +++ b/src/v1_20/api/core/v1/ephemeral_container.rs @@ -75,16 +75,23 @@ pub struct EphemeralContainer { impl crate::DeepMerge for EphemeralContainer { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.args, other.args); - crate::DeepMerge::merge_from(&mut self.command, other.command); - crate::DeepMerge::merge_from(&mut self.env, other.env); - crate::DeepMerge::merge_from(&mut self.env_from, other.env_from); + crate::merge_strategies::list::atomic(&mut self.args, other.args); + crate::merge_strategies::list::atomic(&mut self.command, other.command); + crate::merge_strategies::list::map( + &mut self.env, + other.env, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::list::atomic(&mut self.env_from, other.env_from); crate::DeepMerge::merge_from(&mut self.image, other.image); crate::DeepMerge::merge_from(&mut self.image_pull_policy, other.image_pull_policy); crate::DeepMerge::merge_from(&mut self.lifecycle, other.lifecycle); crate::DeepMerge::merge_from(&mut self.liveness_probe, other.liveness_probe); crate::DeepMerge::merge_from(&mut self.name, other.name); - crate::DeepMerge::merge_from(&mut self.ports, other.ports); + crate::merge_strategies::list::atomic(&mut self.ports, other.ports); crate::DeepMerge::merge_from(&mut self.readiness_probe, other.readiness_probe); crate::DeepMerge::merge_from(&mut self.resources, other.resources); crate::DeepMerge::merge_from(&mut self.security_context, other.security_context); @@ -95,8 +102,22 @@ impl crate::DeepMerge for EphemeralContainer { crate::DeepMerge::merge_from(&mut self.termination_message_path, other.termination_message_path); crate::DeepMerge::merge_from(&mut self.termination_message_policy, other.termination_message_policy); crate::DeepMerge::merge_from(&mut self.tty, other.tty); - crate::DeepMerge::merge_from(&mut self.volume_devices, other.volume_devices); - crate::DeepMerge::merge_from(&mut self.volume_mounts, other.volume_mounts); + crate::merge_strategies::list::map( + &mut self.volume_devices, + other.volume_devices, + &[|lhs, rhs| lhs.device_path == rhs.device_path], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::list::map( + &mut self.volume_mounts, + other.volume_mounts, + &[|lhs, rhs| lhs.mount_path == rhs.mount_path], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.working_dir, other.working_dir); } } diff --git a/src/v1_20/api/core/v1/exec_action.rs b/src/v1_20/api/core/v1/exec_action.rs index fc5ddd099a..07e888786c 100644 --- a/src/v1_20/api/core/v1/exec_action.rs +++ b/src/v1_20/api/core/v1/exec_action.rs @@ -9,7 +9,7 @@ pub struct ExecAction { impl crate::DeepMerge for ExecAction { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.command, other.command); + crate::merge_strategies::list::atomic(&mut self.command, other.command); } } diff --git a/src/v1_20/api/core/v1/fc_volume_source.rs b/src/v1_20/api/core/v1/fc_volume_source.rs index 932c210a2b..6477ad5ed5 100644 --- a/src/v1_20/api/core/v1/fc_volume_source.rs +++ b/src/v1_20/api/core/v1/fc_volume_source.rs @@ -24,8 +24,8 @@ impl crate::DeepMerge for FCVolumeSource { crate::DeepMerge::merge_from(&mut self.fs_type, other.fs_type); crate::DeepMerge::merge_from(&mut self.lun, other.lun); crate::DeepMerge::merge_from(&mut self.read_only, other.read_only); - crate::DeepMerge::merge_from(&mut self.target_wwns, other.target_wwns); - crate::DeepMerge::merge_from(&mut self.wwids, other.wwids); + crate::merge_strategies::list::atomic(&mut self.target_wwns, other.target_wwns); + crate::merge_strategies::list::atomic(&mut self.wwids, other.wwids); } } diff --git a/src/v1_20/api/core/v1/flex_persistent_volume_source.rs b/src/v1_20/api/core/v1/flex_persistent_volume_source.rs index 76d27f8583..10ebd43c4a 100644 --- a/src/v1_20/api/core/v1/flex_persistent_volume_source.rs +++ b/src/v1_20/api/core/v1/flex_persistent_volume_source.rs @@ -23,7 +23,9 @@ impl crate::DeepMerge for FlexPersistentVolumeSource { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.driver, other.driver); crate::DeepMerge::merge_from(&mut self.fs_type, other.fs_type); - crate::DeepMerge::merge_from(&mut self.options, other.options); + crate::merge_strategies::map::granular(&mut self.options, other.options, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.read_only, other.read_only); crate::DeepMerge::merge_from(&mut self.secret_ref, other.secret_ref); } diff --git a/src/v1_20/api/core/v1/flex_volume_source.rs b/src/v1_20/api/core/v1/flex_volume_source.rs index f9e64fcbf4..6075eadc1f 100644 --- a/src/v1_20/api/core/v1/flex_volume_source.rs +++ b/src/v1_20/api/core/v1/flex_volume_source.rs @@ -23,7 +23,9 @@ impl crate::DeepMerge for FlexVolumeSource { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.driver, other.driver); crate::DeepMerge::merge_from(&mut self.fs_type, other.fs_type); - crate::DeepMerge::merge_from(&mut self.options, other.options); + crate::merge_strategies::map::granular(&mut self.options, other.options, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.read_only, other.read_only); crate::DeepMerge::merge_from(&mut self.secret_ref, other.secret_ref); } diff --git a/src/v1_20/api/core/v1/host_alias.rs b/src/v1_20/api/core/v1/host_alias.rs index 9320f6d9e1..8ea648c7ad 100644 --- a/src/v1_20/api/core/v1/host_alias.rs +++ b/src/v1_20/api/core/v1/host_alias.rs @@ -12,7 +12,7 @@ pub struct HostAlias { impl crate::DeepMerge for HostAlias { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.hostnames, other.hostnames); + crate::merge_strategies::list::atomic(&mut self.hostnames, other.hostnames); crate::DeepMerge::merge_from(&mut self.ip, other.ip); } } diff --git a/src/v1_20/api/core/v1/http_get_action.rs b/src/v1_20/api/core/v1/http_get_action.rs index 6af211ad2c..10257ae1a2 100644 --- a/src/v1_20/api/core/v1/http_get_action.rs +++ b/src/v1_20/api/core/v1/http_get_action.rs @@ -22,7 +22,7 @@ pub struct HTTPGetAction { impl crate::DeepMerge for HTTPGetAction { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.host, other.host); - crate::DeepMerge::merge_from(&mut self.http_headers, other.http_headers); + crate::merge_strategies::list::atomic(&mut self.http_headers, other.http_headers); crate::DeepMerge::merge_from(&mut self.path, other.path); crate::DeepMerge::merge_from(&mut self.port, other.port); crate::DeepMerge::merge_from(&mut self.scheme, other.scheme); diff --git a/src/v1_20/api/core/v1/iscsi_persistent_volume_source.rs b/src/v1_20/api/core/v1/iscsi_persistent_volume_source.rs index 939da3bc50..842c901958 100644 --- a/src/v1_20/api/core/v1/iscsi_persistent_volume_source.rs +++ b/src/v1_20/api/core/v1/iscsi_persistent_volume_source.rs @@ -46,7 +46,7 @@ impl crate::DeepMerge for ISCSIPersistentVolumeSource { crate::DeepMerge::merge_from(&mut self.iqn, other.iqn); crate::DeepMerge::merge_from(&mut self.iscsi_interface, other.iscsi_interface); crate::DeepMerge::merge_from(&mut self.lun, other.lun); - crate::DeepMerge::merge_from(&mut self.portals, other.portals); + crate::merge_strategies::list::atomic(&mut self.portals, other.portals); crate::DeepMerge::merge_from(&mut self.read_only, other.read_only); crate::DeepMerge::merge_from(&mut self.secret_ref, other.secret_ref); crate::DeepMerge::merge_from(&mut self.target_portal, other.target_portal); diff --git a/src/v1_20/api/core/v1/iscsi_volume_source.rs b/src/v1_20/api/core/v1/iscsi_volume_source.rs index 1d75bc85e0..7b8f0324f4 100644 --- a/src/v1_20/api/core/v1/iscsi_volume_source.rs +++ b/src/v1_20/api/core/v1/iscsi_volume_source.rs @@ -46,7 +46,7 @@ impl crate::DeepMerge for ISCSIVolumeSource { crate::DeepMerge::merge_from(&mut self.iqn, other.iqn); crate::DeepMerge::merge_from(&mut self.iscsi_interface, other.iscsi_interface); crate::DeepMerge::merge_from(&mut self.lun, other.lun); - crate::DeepMerge::merge_from(&mut self.portals, other.portals); + crate::merge_strategies::list::atomic(&mut self.portals, other.portals); crate::DeepMerge::merge_from(&mut self.read_only, other.read_only); crate::DeepMerge::merge_from(&mut self.secret_ref, other.secret_ref); crate::DeepMerge::merge_from(&mut self.target_portal, other.target_portal); diff --git a/src/v1_20/api/core/v1/limit_range_item.rs b/src/v1_20/api/core/v1/limit_range_item.rs index 3aada5aaaa..d8431aec87 100644 --- a/src/v1_20/api/core/v1/limit_range_item.rs +++ b/src/v1_20/api/core/v1/limit_range_item.rs @@ -24,11 +24,21 @@ pub struct LimitRangeItem { impl crate::DeepMerge for LimitRangeItem { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.default, other.default); - crate::DeepMerge::merge_from(&mut self.default_request, other.default_request); - crate::DeepMerge::merge_from(&mut self.max, other.max); - crate::DeepMerge::merge_from(&mut self.max_limit_request_ratio, other.max_limit_request_ratio); - crate::DeepMerge::merge_from(&mut self.min, other.min); + crate::merge_strategies::map::granular(&mut self.default, other.default, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.default_request, other.default_request, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.max, other.max, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.max_limit_request_ratio, other.max_limit_request_ratio, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.min, other.min, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.type_, other.type_); } } diff --git a/src/v1_20/api/core/v1/limit_range_spec.rs b/src/v1_20/api/core/v1/limit_range_spec.rs index d3db20e828..14cacbd619 100644 --- a/src/v1_20/api/core/v1/limit_range_spec.rs +++ b/src/v1_20/api/core/v1/limit_range_spec.rs @@ -9,7 +9,7 @@ pub struct LimitRangeSpec { impl crate::DeepMerge for LimitRangeSpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.limits, other.limits); + crate::merge_strategies::list::atomic(&mut self.limits, other.limits); } } diff --git a/src/v1_20/api/core/v1/load_balancer_ingress.rs b/src/v1_20/api/core/v1/load_balancer_ingress.rs index fe804334cf..ffce22ba8b 100644 --- a/src/v1_20/api/core/v1/load_balancer_ingress.rs +++ b/src/v1_20/api/core/v1/load_balancer_ingress.rs @@ -17,7 +17,7 @@ impl crate::DeepMerge for LoadBalancerIngress { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.hostname, other.hostname); crate::DeepMerge::merge_from(&mut self.ip, other.ip); - crate::DeepMerge::merge_from(&mut self.ports, other.ports); + crate::merge_strategies::list::atomic(&mut self.ports, other.ports); } } diff --git a/src/v1_20/api/core/v1/load_balancer_status.rs b/src/v1_20/api/core/v1/load_balancer_status.rs index 46d791f8e1..67379f9e4e 100644 --- a/src/v1_20/api/core/v1/load_balancer_status.rs +++ b/src/v1_20/api/core/v1/load_balancer_status.rs @@ -9,7 +9,7 @@ pub struct LoadBalancerStatus { impl crate::DeepMerge for LoadBalancerStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.ingress, other.ingress); + crate::merge_strategies::list::atomic(&mut self.ingress, other.ingress); } } diff --git a/src/v1_20/api/core/v1/namespace_spec.rs b/src/v1_20/api/core/v1/namespace_spec.rs index 5ae9e5ef2e..cbf697e1e1 100644 --- a/src/v1_20/api/core/v1/namespace_spec.rs +++ b/src/v1_20/api/core/v1/namespace_spec.rs @@ -9,7 +9,7 @@ pub struct NamespaceSpec { impl crate::DeepMerge for NamespaceSpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.finalizers, other.finalizers); + crate::merge_strategies::list::atomic(&mut self.finalizers, other.finalizers); } } diff --git a/src/v1_20/api/core/v1/namespace_status.rs b/src/v1_20/api/core/v1/namespace_status.rs index 71546d290a..cc0ad15316 100644 --- a/src/v1_20/api/core/v1/namespace_status.rs +++ b/src/v1_20/api/core/v1/namespace_status.rs @@ -12,7 +12,14 @@ pub struct NamespaceStatus { impl crate::DeepMerge for NamespaceStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.phase, other.phase); } } diff --git a/src/v1_20/api/core/v1/node_affinity.rs b/src/v1_20/api/core/v1/node_affinity.rs index 2a70de8703..dfd14357a3 100644 --- a/src/v1_20/api/core/v1/node_affinity.rs +++ b/src/v1_20/api/core/v1/node_affinity.rs @@ -12,7 +12,7 @@ pub struct NodeAffinity { impl crate::DeepMerge for NodeAffinity { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.preferred_during_scheduling_ignored_during_execution, other.preferred_during_scheduling_ignored_during_execution); + crate::merge_strategies::list::atomic(&mut self.preferred_during_scheduling_ignored_during_execution, other.preferred_during_scheduling_ignored_during_execution); crate::DeepMerge::merge_from(&mut self.required_during_scheduling_ignored_during_execution, other.required_during_scheduling_ignored_during_execution); } } diff --git a/src/v1_20/api/core/v1/node_selector.rs b/src/v1_20/api/core/v1/node_selector.rs index 5b146c615e..997fba9ef3 100644 --- a/src/v1_20/api/core/v1/node_selector.rs +++ b/src/v1_20/api/core/v1/node_selector.rs @@ -9,7 +9,7 @@ pub struct NodeSelector { impl crate::DeepMerge for NodeSelector { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.node_selector_terms, other.node_selector_terms); + crate::merge_strategies::list::atomic(&mut self.node_selector_terms, other.node_selector_terms); } } diff --git a/src/v1_20/api/core/v1/node_selector_requirement.rs b/src/v1_20/api/core/v1/node_selector_requirement.rs index 4e0a41917c..d360d05de2 100644 --- a/src/v1_20/api/core/v1/node_selector_requirement.rs +++ b/src/v1_20/api/core/v1/node_selector_requirement.rs @@ -17,7 +17,7 @@ impl crate::DeepMerge for NodeSelectorRequirement { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.key, other.key); crate::DeepMerge::merge_from(&mut self.operator, other.operator); - crate::DeepMerge::merge_from(&mut self.values, other.values); + crate::merge_strategies::list::atomic(&mut self.values, other.values); } } diff --git a/src/v1_20/api/core/v1/node_selector_term.rs b/src/v1_20/api/core/v1/node_selector_term.rs index b0d28cc176..1237883670 100644 --- a/src/v1_20/api/core/v1/node_selector_term.rs +++ b/src/v1_20/api/core/v1/node_selector_term.rs @@ -12,8 +12,8 @@ pub struct NodeSelectorTerm { impl crate::DeepMerge for NodeSelectorTerm { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.match_expressions, other.match_expressions); - crate::DeepMerge::merge_from(&mut self.match_fields, other.match_fields); + crate::merge_strategies::list::atomic(&mut self.match_expressions, other.match_expressions); + crate::merge_strategies::list::atomic(&mut self.match_fields, other.match_fields); } } diff --git a/src/v1_20/api/core/v1/node_spec.rs b/src/v1_20/api/core/v1/node_spec.rs index 30387c2eb8..f1193088a6 100644 --- a/src/v1_20/api/core/v1/node_spec.rs +++ b/src/v1_20/api/core/v1/node_spec.rs @@ -30,9 +30,9 @@ impl crate::DeepMerge for NodeSpec { crate::DeepMerge::merge_from(&mut self.config_source, other.config_source); crate::DeepMerge::merge_from(&mut self.external_id, other.external_id); crate::DeepMerge::merge_from(&mut self.pod_cidr, other.pod_cidr); - crate::DeepMerge::merge_from(&mut self.pod_cidrs, other.pod_cidrs); + crate::merge_strategies::list::set(&mut self.pod_cidrs, other.pod_cidrs); crate::DeepMerge::merge_from(&mut self.provider_id, other.provider_id); - crate::DeepMerge::merge_from(&mut self.taints, other.taints); + crate::merge_strategies::list::atomic(&mut self.taints, other.taints); crate::DeepMerge::merge_from(&mut self.unschedulable, other.unschedulable); } } diff --git a/src/v1_20/api/core/v1/node_status.rs b/src/v1_20/api/core/v1/node_status.rs index c15202e84d..7a3fc56d2a 100644 --- a/src/v1_20/api/core/v1/node_status.rs +++ b/src/v1_20/api/core/v1/node_status.rs @@ -39,17 +39,35 @@ pub struct NodeStatus { impl crate::DeepMerge for NodeStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.addresses, other.addresses); - crate::DeepMerge::merge_from(&mut self.allocatable, other.allocatable); - crate::DeepMerge::merge_from(&mut self.capacity, other.capacity); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.addresses, + other.addresses, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::map::granular(&mut self.allocatable, other.allocatable, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.capacity, other.capacity, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.config, other.config); crate::DeepMerge::merge_from(&mut self.daemon_endpoints, other.daemon_endpoints); - crate::DeepMerge::merge_from(&mut self.images, other.images); + crate::merge_strategies::list::atomic(&mut self.images, other.images); crate::DeepMerge::merge_from(&mut self.node_info, other.node_info); crate::DeepMerge::merge_from(&mut self.phase, other.phase); - crate::DeepMerge::merge_from(&mut self.volumes_attached, other.volumes_attached); - crate::DeepMerge::merge_from(&mut self.volumes_in_use, other.volumes_in_use); + crate::merge_strategies::list::atomic(&mut self.volumes_attached, other.volumes_attached); + crate::merge_strategies::list::atomic(&mut self.volumes_in_use, other.volumes_in_use); } } diff --git a/src/v1_20/api/core/v1/persistent_volume_claim_spec.rs b/src/v1_20/api/core/v1/persistent_volume_claim_spec.rs index 41c3b623cb..9d70677b5a 100644 --- a/src/v1_20/api/core/v1/persistent_volume_claim_spec.rs +++ b/src/v1_20/api/core/v1/persistent_volume_claim_spec.rs @@ -27,7 +27,7 @@ pub struct PersistentVolumeClaimSpec { impl crate::DeepMerge for PersistentVolumeClaimSpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.access_modes, other.access_modes); + crate::merge_strategies::list::atomic(&mut self.access_modes, other.access_modes); crate::DeepMerge::merge_from(&mut self.data_source, other.data_source); crate::DeepMerge::merge_from(&mut self.resources, other.resources); crate::DeepMerge::merge_from(&mut self.selector, other.selector); diff --git a/src/v1_20/api/core/v1/persistent_volume_claim_status.rs b/src/v1_20/api/core/v1/persistent_volume_claim_status.rs index 1df895286f..4b2e8adf88 100644 --- a/src/v1_20/api/core/v1/persistent_volume_claim_status.rs +++ b/src/v1_20/api/core/v1/persistent_volume_claim_status.rs @@ -18,9 +18,18 @@ pub struct PersistentVolumeClaimStatus { impl crate::DeepMerge for PersistentVolumeClaimStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.access_modes, other.access_modes); - crate::DeepMerge::merge_from(&mut self.capacity, other.capacity); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::atomic(&mut self.access_modes, other.access_modes); + crate::merge_strategies::map::granular(&mut self.capacity, other.capacity, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.phase, other.phase); } } diff --git a/src/v1_20/api/core/v1/persistent_volume_spec.rs b/src/v1_20/api/core/v1/persistent_volume_spec.rs index 9e4ada4389..63c3cdae68 100644 --- a/src/v1_20/api/core/v1/persistent_volume_spec.rs +++ b/src/v1_20/api/core/v1/persistent_volume_spec.rs @@ -96,11 +96,13 @@ pub struct PersistentVolumeSpec { impl crate::DeepMerge for PersistentVolumeSpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.access_modes, other.access_modes); + crate::merge_strategies::list::atomic(&mut self.access_modes, other.access_modes); crate::DeepMerge::merge_from(&mut self.aws_elastic_block_store, other.aws_elastic_block_store); crate::DeepMerge::merge_from(&mut self.azure_disk, other.azure_disk); crate::DeepMerge::merge_from(&mut self.azure_file, other.azure_file); - crate::DeepMerge::merge_from(&mut self.capacity, other.capacity); + crate::merge_strategies::map::granular(&mut self.capacity, other.capacity, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.cephfs, other.cephfs); crate::DeepMerge::merge_from(&mut self.cinder, other.cinder); crate::DeepMerge::merge_from(&mut self.claim_ref, other.claim_ref); @@ -113,7 +115,7 @@ impl crate::DeepMerge for PersistentVolumeSpec { crate::DeepMerge::merge_from(&mut self.host_path, other.host_path); crate::DeepMerge::merge_from(&mut self.iscsi, other.iscsi); crate::DeepMerge::merge_from(&mut self.local, other.local); - crate::DeepMerge::merge_from(&mut self.mount_options, other.mount_options); + crate::merge_strategies::list::atomic(&mut self.mount_options, other.mount_options); crate::DeepMerge::merge_from(&mut self.nfs, other.nfs); crate::DeepMerge::merge_from(&mut self.node_affinity, other.node_affinity); crate::DeepMerge::merge_from(&mut self.persistent_volume_reclaim_policy, other.persistent_volume_reclaim_policy); diff --git a/src/v1_20/api/core/v1/pod_affinity.rs b/src/v1_20/api/core/v1/pod_affinity.rs index facc781ff6..a528250bbc 100644 --- a/src/v1_20/api/core/v1/pod_affinity.rs +++ b/src/v1_20/api/core/v1/pod_affinity.rs @@ -12,8 +12,8 @@ pub struct PodAffinity { impl crate::DeepMerge for PodAffinity { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.preferred_during_scheduling_ignored_during_execution, other.preferred_during_scheduling_ignored_during_execution); - crate::DeepMerge::merge_from(&mut self.required_during_scheduling_ignored_during_execution, other.required_during_scheduling_ignored_during_execution); + crate::merge_strategies::list::atomic(&mut self.preferred_during_scheduling_ignored_during_execution, other.preferred_during_scheduling_ignored_during_execution); + crate::merge_strategies::list::atomic(&mut self.required_during_scheduling_ignored_during_execution, other.required_during_scheduling_ignored_during_execution); } } diff --git a/src/v1_20/api/core/v1/pod_affinity_term.rs b/src/v1_20/api/core/v1/pod_affinity_term.rs index ecb1de3837..85fafcc41b 100644 --- a/src/v1_20/api/core/v1/pod_affinity_term.rs +++ b/src/v1_20/api/core/v1/pod_affinity_term.rs @@ -16,7 +16,7 @@ pub struct PodAffinityTerm { impl crate::DeepMerge for PodAffinityTerm { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.label_selector, other.label_selector); - crate::DeepMerge::merge_from(&mut self.namespaces, other.namespaces); + crate::merge_strategies::list::atomic(&mut self.namespaces, other.namespaces); crate::DeepMerge::merge_from(&mut self.topology_key, other.topology_key); } } diff --git a/src/v1_20/api/core/v1/pod_anti_affinity.rs b/src/v1_20/api/core/v1/pod_anti_affinity.rs index a6cd6aa584..86979017ac 100644 --- a/src/v1_20/api/core/v1/pod_anti_affinity.rs +++ b/src/v1_20/api/core/v1/pod_anti_affinity.rs @@ -12,8 +12,8 @@ pub struct PodAntiAffinity { impl crate::DeepMerge for PodAntiAffinity { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.preferred_during_scheduling_ignored_during_execution, other.preferred_during_scheduling_ignored_during_execution); - crate::DeepMerge::merge_from(&mut self.required_during_scheduling_ignored_during_execution, other.required_during_scheduling_ignored_during_execution); + crate::merge_strategies::list::atomic(&mut self.preferred_during_scheduling_ignored_during_execution, other.preferred_during_scheduling_ignored_during_execution); + crate::merge_strategies::list::atomic(&mut self.required_during_scheduling_ignored_during_execution, other.required_during_scheduling_ignored_during_execution); } } diff --git a/src/v1_20/api/core/v1/pod_dns_config.rs b/src/v1_20/api/core/v1/pod_dns_config.rs index b79282bb55..201eb4d69c 100644 --- a/src/v1_20/api/core/v1/pod_dns_config.rs +++ b/src/v1_20/api/core/v1/pod_dns_config.rs @@ -15,9 +15,9 @@ pub struct PodDNSConfig { impl crate::DeepMerge for PodDNSConfig { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.nameservers, other.nameservers); - crate::DeepMerge::merge_from(&mut self.options, other.options); - crate::DeepMerge::merge_from(&mut self.searches, other.searches); + crate::merge_strategies::list::atomic(&mut self.nameservers, other.nameservers); + crate::merge_strategies::list::atomic(&mut self.options, other.options); + crate::merge_strategies::list::atomic(&mut self.searches, other.searches); } } diff --git a/src/v1_20/api/core/v1/pod_security_context.rs b/src/v1_20/api/core/v1/pod_security_context.rs index 216148abb8..181672cde7 100644 --- a/src/v1_20/api/core/v1/pod_security_context.rs +++ b/src/v1_20/api/core/v1/pod_security_context.rs @@ -47,8 +47,8 @@ impl crate::DeepMerge for PodSecurityContext { crate::DeepMerge::merge_from(&mut self.run_as_user, other.run_as_user); crate::DeepMerge::merge_from(&mut self.se_linux_options, other.se_linux_options); crate::DeepMerge::merge_from(&mut self.seccomp_profile, other.seccomp_profile); - crate::DeepMerge::merge_from(&mut self.supplemental_groups, other.supplemental_groups); - crate::DeepMerge::merge_from(&mut self.sysctls, other.sysctls); + crate::merge_strategies::list::atomic(&mut self.supplemental_groups, other.supplemental_groups); + crate::merge_strategies::list::atomic(&mut self.sysctls, other.sysctls); crate::DeepMerge::merge_from(&mut self.windows_options, other.windows_options); } } diff --git a/src/v1_20/api/core/v1/pod_spec.rs b/src/v1_20/api/core/v1/pod_spec.rs index 9da1584895..8f0f62dcd1 100644 --- a/src/v1_20/api/core/v1/pod_spec.rs +++ b/src/v1_20/api/core/v1/pod_spec.rs @@ -114,25 +114,64 @@ impl crate::DeepMerge for PodSpec { crate::DeepMerge::merge_from(&mut self.active_deadline_seconds, other.active_deadline_seconds); crate::DeepMerge::merge_from(&mut self.affinity, other.affinity); crate::DeepMerge::merge_from(&mut self.automount_service_account_token, other.automount_service_account_token); - crate::DeepMerge::merge_from(&mut self.containers, other.containers); + crate::merge_strategies::list::map( + &mut self.containers, + other.containers, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.dns_config, other.dns_config); crate::DeepMerge::merge_from(&mut self.dns_policy, other.dns_policy); crate::DeepMerge::merge_from(&mut self.enable_service_links, other.enable_service_links); - crate::DeepMerge::merge_from(&mut self.ephemeral_containers, other.ephemeral_containers); - crate::DeepMerge::merge_from(&mut self.host_aliases, other.host_aliases); + crate::merge_strategies::list::map( + &mut self.ephemeral_containers, + other.ephemeral_containers, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::list::map( + &mut self.host_aliases, + other.host_aliases, + &[|lhs, rhs| lhs.ip == rhs.ip], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.host_ipc, other.host_ipc); crate::DeepMerge::merge_from(&mut self.host_network, other.host_network); crate::DeepMerge::merge_from(&mut self.host_pid, other.host_pid); crate::DeepMerge::merge_from(&mut self.hostname, other.hostname); - crate::DeepMerge::merge_from(&mut self.image_pull_secrets, other.image_pull_secrets); - crate::DeepMerge::merge_from(&mut self.init_containers, other.init_containers); + crate::merge_strategies::list::map( + &mut self.image_pull_secrets, + other.image_pull_secrets, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::list::map( + &mut self.init_containers, + other.init_containers, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.node_name, other.node_name); - crate::DeepMerge::merge_from(&mut self.node_selector, other.node_selector); - crate::DeepMerge::merge_from(&mut self.overhead, other.overhead); + crate::merge_strategies::map::granular(&mut self.node_selector, other.node_selector, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.overhead, other.overhead, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.preemption_policy, other.preemption_policy); crate::DeepMerge::merge_from(&mut self.priority, other.priority); crate::DeepMerge::merge_from(&mut self.priority_class_name, other.priority_class_name); - crate::DeepMerge::merge_from(&mut self.readiness_gates, other.readiness_gates); + crate::merge_strategies::list::atomic(&mut self.readiness_gates, other.readiness_gates); crate::DeepMerge::merge_from(&mut self.restart_policy, other.restart_policy); crate::DeepMerge::merge_from(&mut self.runtime_class_name, other.runtime_class_name); crate::DeepMerge::merge_from(&mut self.scheduler_name, other.scheduler_name); @@ -143,9 +182,23 @@ impl crate::DeepMerge for PodSpec { crate::DeepMerge::merge_from(&mut self.share_process_namespace, other.share_process_namespace); crate::DeepMerge::merge_from(&mut self.subdomain, other.subdomain); crate::DeepMerge::merge_from(&mut self.termination_grace_period_seconds, other.termination_grace_period_seconds); - crate::DeepMerge::merge_from(&mut self.tolerations, other.tolerations); - crate::DeepMerge::merge_from(&mut self.topology_spread_constraints, other.topology_spread_constraints); - crate::DeepMerge::merge_from(&mut self.volumes, other.volumes); + crate::merge_strategies::list::atomic(&mut self.tolerations, other.tolerations); + crate::merge_strategies::list::map( + &mut self.topology_spread_constraints, + other.topology_spread_constraints, + &[|lhs, rhs| lhs.topology_key == rhs.topology_key], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::list::map( + &mut self.volumes, + other.volumes, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_20/api/core/v1/pod_status.rs b/src/v1_20/api/core/v1/pod_status.rs index e1bfacf3db..b93586f4d8 100644 --- a/src/v1_20/api/core/v1/pod_status.rs +++ b/src/v1_20/api/core/v1/pod_status.rs @@ -49,16 +49,30 @@ pub struct PodStatus { impl crate::DeepMerge for PodStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); - crate::DeepMerge::merge_from(&mut self.container_statuses, other.container_statuses); - crate::DeepMerge::merge_from(&mut self.ephemeral_container_statuses, other.ephemeral_container_statuses); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::list::atomic(&mut self.container_statuses, other.container_statuses); + crate::merge_strategies::list::atomic(&mut self.ephemeral_container_statuses, other.ephemeral_container_statuses); crate::DeepMerge::merge_from(&mut self.host_ip, other.host_ip); - crate::DeepMerge::merge_from(&mut self.init_container_statuses, other.init_container_statuses); + crate::merge_strategies::list::atomic(&mut self.init_container_statuses, other.init_container_statuses); crate::DeepMerge::merge_from(&mut self.message, other.message); crate::DeepMerge::merge_from(&mut self.nominated_node_name, other.nominated_node_name); crate::DeepMerge::merge_from(&mut self.phase, other.phase); crate::DeepMerge::merge_from(&mut self.pod_ip, other.pod_ip); - crate::DeepMerge::merge_from(&mut self.pod_ips, other.pod_ips); + crate::merge_strategies::list::map( + &mut self.pod_ips, + other.pod_ips, + &[|lhs, rhs| lhs.ip == rhs.ip], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.qos_class, other.qos_class); crate::DeepMerge::merge_from(&mut self.reason, other.reason); crate::DeepMerge::merge_from(&mut self.start_time, other.start_time); diff --git a/src/v1_20/api/core/v1/projected_volume_source.rs b/src/v1_20/api/core/v1/projected_volume_source.rs index 8852dae377..650c07c7dc 100644 --- a/src/v1_20/api/core/v1/projected_volume_source.rs +++ b/src/v1_20/api/core/v1/projected_volume_source.rs @@ -13,7 +13,7 @@ pub struct ProjectedVolumeSource { impl crate::DeepMerge for ProjectedVolumeSource { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.default_mode, other.default_mode); - crate::DeepMerge::merge_from(&mut self.sources, other.sources); + crate::merge_strategies::list::atomic(&mut self.sources, other.sources); } } diff --git a/src/v1_20/api/core/v1/rbd_persistent_volume_source.rs b/src/v1_20/api/core/v1/rbd_persistent_volume_source.rs index 303bf915bc..d94e189fd5 100644 --- a/src/v1_20/api/core/v1/rbd_persistent_volume_source.rs +++ b/src/v1_20/api/core/v1/rbd_persistent_volume_source.rs @@ -33,7 +33,7 @@ impl crate::DeepMerge for RBDPersistentVolumeSource { crate::DeepMerge::merge_from(&mut self.fs_type, other.fs_type); crate::DeepMerge::merge_from(&mut self.image, other.image); crate::DeepMerge::merge_from(&mut self.keyring, other.keyring); - crate::DeepMerge::merge_from(&mut self.monitors, other.monitors); + crate::merge_strategies::list::atomic(&mut self.monitors, other.monitors); crate::DeepMerge::merge_from(&mut self.pool, other.pool); crate::DeepMerge::merge_from(&mut self.read_only, other.read_only); crate::DeepMerge::merge_from(&mut self.secret_ref, other.secret_ref); diff --git a/src/v1_20/api/core/v1/rbd_volume_source.rs b/src/v1_20/api/core/v1/rbd_volume_source.rs index 28d087cae2..c5521eac18 100644 --- a/src/v1_20/api/core/v1/rbd_volume_source.rs +++ b/src/v1_20/api/core/v1/rbd_volume_source.rs @@ -33,7 +33,7 @@ impl crate::DeepMerge for RBDVolumeSource { crate::DeepMerge::merge_from(&mut self.fs_type, other.fs_type); crate::DeepMerge::merge_from(&mut self.image, other.image); crate::DeepMerge::merge_from(&mut self.keyring, other.keyring); - crate::DeepMerge::merge_from(&mut self.monitors, other.monitors); + crate::merge_strategies::list::atomic(&mut self.monitors, other.monitors); crate::DeepMerge::merge_from(&mut self.pool, other.pool); crate::DeepMerge::merge_from(&mut self.read_only, other.read_only); crate::DeepMerge::merge_from(&mut self.secret_ref, other.secret_ref); diff --git a/src/v1_20/api/core/v1/replication_controller_spec.rs b/src/v1_20/api/core/v1/replication_controller_spec.rs index 293546b183..655e1e1eed 100644 --- a/src/v1_20/api/core/v1/replication_controller_spec.rs +++ b/src/v1_20/api/core/v1/replication_controller_spec.rs @@ -20,7 +20,9 @@ impl crate::DeepMerge for ReplicationControllerSpec { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.min_ready_seconds, other.min_ready_seconds); crate::DeepMerge::merge_from(&mut self.replicas, other.replicas); - crate::DeepMerge::merge_from(&mut self.selector, other.selector); + crate::merge_strategies::map::granular(&mut self.selector, other.selector, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.template, other.template); } } diff --git a/src/v1_20/api/core/v1/replication_controller_status.rs b/src/v1_20/api/core/v1/replication_controller_status.rs index d069722747..47ccceaeba 100644 --- a/src/v1_20/api/core/v1/replication_controller_status.rs +++ b/src/v1_20/api/core/v1/replication_controller_status.rs @@ -25,7 +25,14 @@ pub struct ReplicationControllerStatus { impl crate::DeepMerge for ReplicationControllerStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.available_replicas, other.available_replicas); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.fully_labeled_replicas, other.fully_labeled_replicas); crate::DeepMerge::merge_from(&mut self.observed_generation, other.observed_generation); crate::DeepMerge::merge_from(&mut self.ready_replicas, other.ready_replicas); diff --git a/src/v1_20/api/core/v1/resource_quota_spec.rs b/src/v1_20/api/core/v1/resource_quota_spec.rs index fab2b7970d..3468d8e9e0 100644 --- a/src/v1_20/api/core/v1/resource_quota_spec.rs +++ b/src/v1_20/api/core/v1/resource_quota_spec.rs @@ -15,9 +15,11 @@ pub struct ResourceQuotaSpec { impl crate::DeepMerge for ResourceQuotaSpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.hard, other.hard); + crate::merge_strategies::map::granular(&mut self.hard, other.hard, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.scope_selector, other.scope_selector); - crate::DeepMerge::merge_from(&mut self.scopes, other.scopes); + crate::merge_strategies::list::atomic(&mut self.scopes, other.scopes); } } diff --git a/src/v1_20/api/core/v1/resource_quota_status.rs b/src/v1_20/api/core/v1/resource_quota_status.rs index 100f418a69..74ee1efe3c 100644 --- a/src/v1_20/api/core/v1/resource_quota_status.rs +++ b/src/v1_20/api/core/v1/resource_quota_status.rs @@ -12,8 +12,12 @@ pub struct ResourceQuotaStatus { impl crate::DeepMerge for ResourceQuotaStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.hard, other.hard); - crate::DeepMerge::merge_from(&mut self.used, other.used); + crate::merge_strategies::map::granular(&mut self.hard, other.hard, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.used, other.used, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); } } diff --git a/src/v1_20/api/core/v1/resource_requirements.rs b/src/v1_20/api/core/v1/resource_requirements.rs index 4df72ca8a0..b631c4f79b 100644 --- a/src/v1_20/api/core/v1/resource_requirements.rs +++ b/src/v1_20/api/core/v1/resource_requirements.rs @@ -12,8 +12,12 @@ pub struct ResourceRequirements { impl crate::DeepMerge for ResourceRequirements { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.limits, other.limits); - crate::DeepMerge::merge_from(&mut self.requests, other.requests); + crate::merge_strategies::map::granular(&mut self.limits, other.limits, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.requests, other.requests, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); } } diff --git a/src/v1_20/api/core/v1/scope_selector.rs b/src/v1_20/api/core/v1/scope_selector.rs index 22ef180aeb..23ebdb0612 100644 --- a/src/v1_20/api/core/v1/scope_selector.rs +++ b/src/v1_20/api/core/v1/scope_selector.rs @@ -9,7 +9,7 @@ pub struct ScopeSelector { impl crate::DeepMerge for ScopeSelector { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.match_expressions, other.match_expressions); + crate::merge_strategies::list::atomic(&mut self.match_expressions, other.match_expressions); } } diff --git a/src/v1_20/api/core/v1/scoped_resource_selector_requirement.rs b/src/v1_20/api/core/v1/scoped_resource_selector_requirement.rs index 33c57f11ea..ed818218b2 100644 --- a/src/v1_20/api/core/v1/scoped_resource_selector_requirement.rs +++ b/src/v1_20/api/core/v1/scoped_resource_selector_requirement.rs @@ -17,7 +17,7 @@ impl crate::DeepMerge for ScopedResourceSelectorRequirement { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.operator, other.operator); crate::DeepMerge::merge_from(&mut self.scope_name, other.scope_name); - crate::DeepMerge::merge_from(&mut self.values, other.values); + crate::merge_strategies::list::atomic(&mut self.values, other.values); } } diff --git a/src/v1_20/api/core/v1/secret.rs b/src/v1_20/api/core/v1/secret.rs index 1f1573a484..5ea9a3de66 100644 --- a/src/v1_20/api/core/v1/secret.rs +++ b/src/v1_20/api/core/v1/secret.rs @@ -498,10 +498,14 @@ impl crate::Metadata for Secret { impl crate::DeepMerge for Secret { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.data, other.data); + crate::merge_strategies::map::granular(&mut self.data, other.data, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.immutable, other.immutable); crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.string_data, other.string_data); + crate::merge_strategies::map::granular(&mut self.string_data, other.string_data, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.type_, other.type_); } } diff --git a/src/v1_20/api/core/v1/secret_projection.rs b/src/v1_20/api/core/v1/secret_projection.rs index 41277f3645..df50709566 100644 --- a/src/v1_20/api/core/v1/secret_projection.rs +++ b/src/v1_20/api/core/v1/secret_projection.rs @@ -17,7 +17,7 @@ pub struct SecretProjection { impl crate::DeepMerge for SecretProjection { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.items, other.items); + crate::merge_strategies::list::atomic(&mut self.items, other.items); crate::DeepMerge::merge_from(&mut self.name, other.name); crate::DeepMerge::merge_from(&mut self.optional, other.optional); } diff --git a/src/v1_20/api/core/v1/secret_volume_source.rs b/src/v1_20/api/core/v1/secret_volume_source.rs index 6f0de3b8aa..7daa3928bd 100644 --- a/src/v1_20/api/core/v1/secret_volume_source.rs +++ b/src/v1_20/api/core/v1/secret_volume_source.rs @@ -21,7 +21,7 @@ pub struct SecretVolumeSource { impl crate::DeepMerge for SecretVolumeSource { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.default_mode, other.default_mode); - crate::DeepMerge::merge_from(&mut self.items, other.items); + crate::merge_strategies::list::atomic(&mut self.items, other.items); crate::DeepMerge::merge_from(&mut self.optional, other.optional); crate::DeepMerge::merge_from(&mut self.secret_name, other.secret_name); } diff --git a/src/v1_20/api/core/v1/service_account.rs b/src/v1_20/api/core/v1/service_account.rs index c1b334f710..c297d5be55 100644 --- a/src/v1_20/api/core/v1/service_account.rs +++ b/src/v1_20/api/core/v1/service_account.rs @@ -496,9 +496,16 @@ impl crate::Metadata for ServiceAccount { impl crate::DeepMerge for ServiceAccount { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.automount_service_account_token, other.automount_service_account_token); - crate::DeepMerge::merge_from(&mut self.image_pull_secrets, other.image_pull_secrets); + crate::merge_strategies::list::atomic(&mut self.image_pull_secrets, other.image_pull_secrets); crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.secrets, other.secrets); + crate::merge_strategies::list::map( + &mut self.secrets, + other.secrets, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_20/api/core/v1/service_spec.rs b/src/v1_20/api/core/v1/service_spec.rs index bced0f7dee..8e4a010b6f 100644 --- a/src/v1_20/api/core/v1/service_spec.rs +++ b/src/v1_20/api/core/v1/service_spec.rs @@ -66,21 +66,30 @@ impl crate::DeepMerge for ServiceSpec { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.allocate_load_balancer_node_ports, other.allocate_load_balancer_node_ports); crate::DeepMerge::merge_from(&mut self.cluster_ip, other.cluster_ip); - crate::DeepMerge::merge_from(&mut self.cluster_ips, other.cluster_ips); - crate::DeepMerge::merge_from(&mut self.external_ips, other.external_ips); + crate::merge_strategies::list::atomic(&mut self.cluster_ips, other.cluster_ips); + crate::merge_strategies::list::atomic(&mut self.external_ips, other.external_ips); crate::DeepMerge::merge_from(&mut self.external_name, other.external_name); crate::DeepMerge::merge_from(&mut self.external_traffic_policy, other.external_traffic_policy); crate::DeepMerge::merge_from(&mut self.health_check_node_port, other.health_check_node_port); - crate::DeepMerge::merge_from(&mut self.ip_families, other.ip_families); + crate::merge_strategies::list::atomic(&mut self.ip_families, other.ip_families); crate::DeepMerge::merge_from(&mut self.ip_family_policy, other.ip_family_policy); crate::DeepMerge::merge_from(&mut self.load_balancer_ip, other.load_balancer_ip); - crate::DeepMerge::merge_from(&mut self.load_balancer_source_ranges, other.load_balancer_source_ranges); - crate::DeepMerge::merge_from(&mut self.ports, other.ports); + crate::merge_strategies::list::atomic(&mut self.load_balancer_source_ranges, other.load_balancer_source_ranges); + crate::merge_strategies::list::map( + &mut self.ports, + other.ports, + &[|lhs, rhs| lhs.port == rhs.port], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.publish_not_ready_addresses, other.publish_not_ready_addresses); - crate::DeepMerge::merge_from(&mut self.selector, other.selector); + crate::merge_strategies::map::granular(&mut self.selector, other.selector, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.session_affinity, other.session_affinity); crate::DeepMerge::merge_from(&mut self.session_affinity_config, other.session_affinity_config); - crate::DeepMerge::merge_from(&mut self.topology_keys, other.topology_keys); + crate::merge_strategies::list::atomic(&mut self.topology_keys, other.topology_keys); crate::DeepMerge::merge_from(&mut self.type_, other.type_); } } diff --git a/src/v1_20/api/core/v1/service_status.rs b/src/v1_20/api/core/v1/service_status.rs index 6c3429fd70..6dece09b96 100644 --- a/src/v1_20/api/core/v1/service_status.rs +++ b/src/v1_20/api/core/v1/service_status.rs @@ -12,7 +12,14 @@ pub struct ServiceStatus { impl crate::DeepMerge for ServiceStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.load_balancer, other.load_balancer); } } diff --git a/src/v1_20/api/core/v1/topology_selector_label_requirement.rs b/src/v1_20/api/core/v1/topology_selector_label_requirement.rs index 3efed6ba65..50764252b6 100644 --- a/src/v1_20/api/core/v1/topology_selector_label_requirement.rs +++ b/src/v1_20/api/core/v1/topology_selector_label_requirement.rs @@ -13,7 +13,7 @@ pub struct TopologySelectorLabelRequirement { impl crate::DeepMerge for TopologySelectorLabelRequirement { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.key, other.key); - crate::DeepMerge::merge_from(&mut self.values, other.values); + crate::merge_strategies::list::atomic(&mut self.values, other.values); } } diff --git a/src/v1_20/api/core/v1/topology_selector_term.rs b/src/v1_20/api/core/v1/topology_selector_term.rs index 230f7ab530..df526d6f4d 100644 --- a/src/v1_20/api/core/v1/topology_selector_term.rs +++ b/src/v1_20/api/core/v1/topology_selector_term.rs @@ -9,7 +9,7 @@ pub struct TopologySelectorTerm { impl crate::DeepMerge for TopologySelectorTerm { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.match_label_expressions, other.match_label_expressions); + crate::merge_strategies::list::atomic(&mut self.match_label_expressions, other.match_label_expressions); } } diff --git a/src/v1_20/api/discovery/v1beta1/endpoint.rs b/src/v1_20/api/discovery/v1beta1/endpoint.rs index cfabe716d0..077102461d 100644 --- a/src/v1_20/api/discovery/v1beta1/endpoint.rs +++ b/src/v1_20/api/discovery/v1beta1/endpoint.rs @@ -31,12 +31,14 @@ pub struct Endpoint { impl crate::DeepMerge for Endpoint { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.addresses, other.addresses); + crate::merge_strategies::list::set(&mut self.addresses, other.addresses); crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); crate::DeepMerge::merge_from(&mut self.hostname, other.hostname); crate::DeepMerge::merge_from(&mut self.node_name, other.node_name); crate::DeepMerge::merge_from(&mut self.target_ref, other.target_ref); - crate::DeepMerge::merge_from(&mut self.topology, other.topology); + crate::merge_strategies::map::granular(&mut self.topology, other.topology, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); } } diff --git a/src/v1_20/api/discovery/v1beta1/endpoint_slice.rs b/src/v1_20/api/discovery/v1beta1/endpoint_slice.rs index cfe4553dc2..12d89081fa 100644 --- a/src/v1_20/api/discovery/v1beta1/endpoint_slice.rs +++ b/src/v1_20/api/discovery/v1beta1/endpoint_slice.rs @@ -496,9 +496,9 @@ impl crate::Metadata for EndpointSlice { impl crate::DeepMerge for EndpointSlice { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.address_type, other.address_type); - crate::DeepMerge::merge_from(&mut self.endpoints, other.endpoints); + crate::merge_strategies::list::atomic(&mut self.endpoints, other.endpoints); crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.ports, other.ports); + crate::merge_strategies::list::atomic(&mut self.ports, other.ports); } } diff --git a/src/v1_20/api/extensions/v1beta1/http_ingress_rule_value.rs b/src/v1_20/api/extensions/v1beta1/http_ingress_rule_value.rs index 1e7643afde..5dfc0dbb53 100644 --- a/src/v1_20/api/extensions/v1beta1/http_ingress_rule_value.rs +++ b/src/v1_20/api/extensions/v1beta1/http_ingress_rule_value.rs @@ -9,7 +9,7 @@ pub struct HTTPIngressRuleValue { impl crate::DeepMerge for HTTPIngressRuleValue { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.paths, other.paths); + crate::merge_strategies::list::atomic(&mut self.paths, other.paths); } } diff --git a/src/v1_20/api/extensions/v1beta1/ingress_spec.rs b/src/v1_20/api/extensions/v1beta1/ingress_spec.rs index 53c0e1428b..d58dfab749 100644 --- a/src/v1_20/api/extensions/v1beta1/ingress_spec.rs +++ b/src/v1_20/api/extensions/v1beta1/ingress_spec.rs @@ -20,8 +20,8 @@ impl crate::DeepMerge for IngressSpec { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.backend, other.backend); crate::DeepMerge::merge_from(&mut self.ingress_class_name, other.ingress_class_name); - crate::DeepMerge::merge_from(&mut self.rules, other.rules); - crate::DeepMerge::merge_from(&mut self.tls, other.tls); + crate::merge_strategies::list::atomic(&mut self.rules, other.rules); + crate::merge_strategies::list::atomic(&mut self.tls, other.tls); } } diff --git a/src/v1_20/api/extensions/v1beta1/ingress_tls.rs b/src/v1_20/api/extensions/v1beta1/ingress_tls.rs index 58e0fa32a6..21ad783832 100644 --- a/src/v1_20/api/extensions/v1beta1/ingress_tls.rs +++ b/src/v1_20/api/extensions/v1beta1/ingress_tls.rs @@ -12,7 +12,7 @@ pub struct IngressTLS { impl crate::DeepMerge for IngressTLS { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.hosts, other.hosts); + crate::merge_strategies::list::atomic(&mut self.hosts, other.hosts); crate::DeepMerge::merge_from(&mut self.secret_name, other.secret_name); } } diff --git a/src/v1_20/api/flowcontrol/v1alpha1/flow_schema_spec.rs b/src/v1_20/api/flowcontrol/v1alpha1/flow_schema_spec.rs index f94e23d54b..7e16bd6dbc 100644 --- a/src/v1_20/api/flowcontrol/v1alpha1/flow_schema_spec.rs +++ b/src/v1_20/api/flowcontrol/v1alpha1/flow_schema_spec.rs @@ -21,7 +21,7 @@ impl crate::DeepMerge for FlowSchemaSpec { crate::DeepMerge::merge_from(&mut self.distinguisher_method, other.distinguisher_method); crate::DeepMerge::merge_from(&mut self.matching_precedence, other.matching_precedence); crate::DeepMerge::merge_from(&mut self.priority_level_configuration, other.priority_level_configuration); - crate::DeepMerge::merge_from(&mut self.rules, other.rules); + crate::merge_strategies::list::atomic(&mut self.rules, other.rules); } } diff --git a/src/v1_20/api/flowcontrol/v1alpha1/flow_schema_status.rs b/src/v1_20/api/flowcontrol/v1alpha1/flow_schema_status.rs index 4cba1b5163..8fffd50284 100644 --- a/src/v1_20/api/flowcontrol/v1alpha1/flow_schema_status.rs +++ b/src/v1_20/api/flowcontrol/v1alpha1/flow_schema_status.rs @@ -9,7 +9,14 @@ pub struct FlowSchemaStatus { impl crate::DeepMerge for FlowSchemaStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_20/api/flowcontrol/v1alpha1/non_resource_policy_rule.rs b/src/v1_20/api/flowcontrol/v1alpha1/non_resource_policy_rule.rs index 1f59c5127f..c8b9137d2c 100644 --- a/src/v1_20/api/flowcontrol/v1alpha1/non_resource_policy_rule.rs +++ b/src/v1_20/api/flowcontrol/v1alpha1/non_resource_policy_rule.rs @@ -18,8 +18,8 @@ pub struct NonResourcePolicyRule { impl crate::DeepMerge for NonResourcePolicyRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.non_resource_urls, other.non_resource_urls); - crate::DeepMerge::merge_from(&mut self.verbs, other.verbs); + crate::merge_strategies::list::set(&mut self.non_resource_urls, other.non_resource_urls); + crate::merge_strategies::list::set(&mut self.verbs, other.verbs); } } diff --git a/src/v1_20/api/flowcontrol/v1alpha1/policy_rules_with_subjects.rs b/src/v1_20/api/flowcontrol/v1alpha1/policy_rules_with_subjects.rs index 1de2ce982d..1971db6e43 100644 --- a/src/v1_20/api/flowcontrol/v1alpha1/policy_rules_with_subjects.rs +++ b/src/v1_20/api/flowcontrol/v1alpha1/policy_rules_with_subjects.rs @@ -15,9 +15,9 @@ pub struct PolicyRulesWithSubjects { impl crate::DeepMerge for PolicyRulesWithSubjects { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.non_resource_rules, other.non_resource_rules); - crate::DeepMerge::merge_from(&mut self.resource_rules, other.resource_rules); - crate::DeepMerge::merge_from(&mut self.subjects, other.subjects); + crate::merge_strategies::list::atomic(&mut self.non_resource_rules, other.non_resource_rules); + crate::merge_strategies::list::atomic(&mut self.resource_rules, other.resource_rules); + crate::merge_strategies::list::atomic(&mut self.subjects, other.subjects); } } diff --git a/src/v1_20/api/flowcontrol/v1alpha1/priority_level_configuration_status.rs b/src/v1_20/api/flowcontrol/v1alpha1/priority_level_configuration_status.rs index fb42157519..de87b3815f 100644 --- a/src/v1_20/api/flowcontrol/v1alpha1/priority_level_configuration_status.rs +++ b/src/v1_20/api/flowcontrol/v1alpha1/priority_level_configuration_status.rs @@ -9,7 +9,14 @@ pub struct PriorityLevelConfigurationStatus { impl crate::DeepMerge for PriorityLevelConfigurationStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_20/api/flowcontrol/v1alpha1/resource_policy_rule.rs b/src/v1_20/api/flowcontrol/v1alpha1/resource_policy_rule.rs index f1717ae374..0df9df23e1 100644 --- a/src/v1_20/api/flowcontrol/v1alpha1/resource_policy_rule.rs +++ b/src/v1_20/api/flowcontrol/v1alpha1/resource_policy_rule.rs @@ -21,11 +21,11 @@ pub struct ResourcePolicyRule { impl crate::DeepMerge for ResourcePolicyRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.api_groups, other.api_groups); + crate::merge_strategies::list::set(&mut self.api_groups, other.api_groups); crate::DeepMerge::merge_from(&mut self.cluster_scope, other.cluster_scope); - crate::DeepMerge::merge_from(&mut self.namespaces, other.namespaces); - crate::DeepMerge::merge_from(&mut self.resources, other.resources); - crate::DeepMerge::merge_from(&mut self.verbs, other.verbs); + crate::merge_strategies::list::set(&mut self.namespaces, other.namespaces); + crate::merge_strategies::list::set(&mut self.resources, other.resources); + crate::merge_strategies::list::set(&mut self.verbs, other.verbs); } } diff --git a/src/v1_20/api/flowcontrol/v1beta1/flow_schema_spec.rs b/src/v1_20/api/flowcontrol/v1beta1/flow_schema_spec.rs index 40031e5acc..fb04b8c0af 100644 --- a/src/v1_20/api/flowcontrol/v1beta1/flow_schema_spec.rs +++ b/src/v1_20/api/flowcontrol/v1beta1/flow_schema_spec.rs @@ -21,7 +21,7 @@ impl crate::DeepMerge for FlowSchemaSpec { crate::DeepMerge::merge_from(&mut self.distinguisher_method, other.distinguisher_method); crate::DeepMerge::merge_from(&mut self.matching_precedence, other.matching_precedence); crate::DeepMerge::merge_from(&mut self.priority_level_configuration, other.priority_level_configuration); - crate::DeepMerge::merge_from(&mut self.rules, other.rules); + crate::merge_strategies::list::atomic(&mut self.rules, other.rules); } } diff --git a/src/v1_20/api/flowcontrol/v1beta1/flow_schema_status.rs b/src/v1_20/api/flowcontrol/v1beta1/flow_schema_status.rs index c463e68e6a..7de52a1a65 100644 --- a/src/v1_20/api/flowcontrol/v1beta1/flow_schema_status.rs +++ b/src/v1_20/api/flowcontrol/v1beta1/flow_schema_status.rs @@ -9,7 +9,14 @@ pub struct FlowSchemaStatus { impl crate::DeepMerge for FlowSchemaStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_20/api/flowcontrol/v1beta1/non_resource_policy_rule.rs b/src/v1_20/api/flowcontrol/v1beta1/non_resource_policy_rule.rs index 80b8803dc1..ac9b066b17 100644 --- a/src/v1_20/api/flowcontrol/v1beta1/non_resource_policy_rule.rs +++ b/src/v1_20/api/flowcontrol/v1beta1/non_resource_policy_rule.rs @@ -18,8 +18,8 @@ pub struct NonResourcePolicyRule { impl crate::DeepMerge for NonResourcePolicyRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.non_resource_urls, other.non_resource_urls); - crate::DeepMerge::merge_from(&mut self.verbs, other.verbs); + crate::merge_strategies::list::set(&mut self.non_resource_urls, other.non_resource_urls); + crate::merge_strategies::list::set(&mut self.verbs, other.verbs); } } diff --git a/src/v1_20/api/flowcontrol/v1beta1/policy_rules_with_subjects.rs b/src/v1_20/api/flowcontrol/v1beta1/policy_rules_with_subjects.rs index 780a347761..8a727117e0 100644 --- a/src/v1_20/api/flowcontrol/v1beta1/policy_rules_with_subjects.rs +++ b/src/v1_20/api/flowcontrol/v1beta1/policy_rules_with_subjects.rs @@ -15,9 +15,9 @@ pub struct PolicyRulesWithSubjects { impl crate::DeepMerge for PolicyRulesWithSubjects { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.non_resource_rules, other.non_resource_rules); - crate::DeepMerge::merge_from(&mut self.resource_rules, other.resource_rules); - crate::DeepMerge::merge_from(&mut self.subjects, other.subjects); + crate::merge_strategies::list::atomic(&mut self.non_resource_rules, other.non_resource_rules); + crate::merge_strategies::list::atomic(&mut self.resource_rules, other.resource_rules); + crate::merge_strategies::list::atomic(&mut self.subjects, other.subjects); } } diff --git a/src/v1_20/api/flowcontrol/v1beta1/priority_level_configuration_status.rs b/src/v1_20/api/flowcontrol/v1beta1/priority_level_configuration_status.rs index a356b4a6df..e35efdf597 100644 --- a/src/v1_20/api/flowcontrol/v1beta1/priority_level_configuration_status.rs +++ b/src/v1_20/api/flowcontrol/v1beta1/priority_level_configuration_status.rs @@ -9,7 +9,14 @@ pub struct PriorityLevelConfigurationStatus { impl crate::DeepMerge for PriorityLevelConfigurationStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_20/api/flowcontrol/v1beta1/resource_policy_rule.rs b/src/v1_20/api/flowcontrol/v1beta1/resource_policy_rule.rs index 14597a98fb..4d742498ed 100644 --- a/src/v1_20/api/flowcontrol/v1beta1/resource_policy_rule.rs +++ b/src/v1_20/api/flowcontrol/v1beta1/resource_policy_rule.rs @@ -21,11 +21,11 @@ pub struct ResourcePolicyRule { impl crate::DeepMerge for ResourcePolicyRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.api_groups, other.api_groups); + crate::merge_strategies::list::set(&mut self.api_groups, other.api_groups); crate::DeepMerge::merge_from(&mut self.cluster_scope, other.cluster_scope); - crate::DeepMerge::merge_from(&mut self.namespaces, other.namespaces); - crate::DeepMerge::merge_from(&mut self.resources, other.resources); - crate::DeepMerge::merge_from(&mut self.verbs, other.verbs); + crate::merge_strategies::list::set(&mut self.namespaces, other.namespaces); + crate::merge_strategies::list::set(&mut self.resources, other.resources); + crate::merge_strategies::list::set(&mut self.verbs, other.verbs); } } diff --git a/src/v1_20/api/networking/v1/http_ingress_rule_value.rs b/src/v1_20/api/networking/v1/http_ingress_rule_value.rs index acc836c728..3749783ee2 100644 --- a/src/v1_20/api/networking/v1/http_ingress_rule_value.rs +++ b/src/v1_20/api/networking/v1/http_ingress_rule_value.rs @@ -9,7 +9,7 @@ pub struct HTTPIngressRuleValue { impl crate::DeepMerge for HTTPIngressRuleValue { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.paths, other.paths); + crate::merge_strategies::list::atomic(&mut self.paths, other.paths); } } diff --git a/src/v1_20/api/networking/v1/ingress_spec.rs b/src/v1_20/api/networking/v1/ingress_spec.rs index 68e8606acb..2229a3c788 100644 --- a/src/v1_20/api/networking/v1/ingress_spec.rs +++ b/src/v1_20/api/networking/v1/ingress_spec.rs @@ -20,8 +20,8 @@ impl crate::DeepMerge for IngressSpec { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.default_backend, other.default_backend); crate::DeepMerge::merge_from(&mut self.ingress_class_name, other.ingress_class_name); - crate::DeepMerge::merge_from(&mut self.rules, other.rules); - crate::DeepMerge::merge_from(&mut self.tls, other.tls); + crate::merge_strategies::list::atomic(&mut self.rules, other.rules); + crate::merge_strategies::list::atomic(&mut self.tls, other.tls); } } diff --git a/src/v1_20/api/networking/v1/ingress_tls.rs b/src/v1_20/api/networking/v1/ingress_tls.rs index d48a83a0c4..92c66b754f 100644 --- a/src/v1_20/api/networking/v1/ingress_tls.rs +++ b/src/v1_20/api/networking/v1/ingress_tls.rs @@ -12,7 +12,7 @@ pub struct IngressTLS { impl crate::DeepMerge for IngressTLS { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.hosts, other.hosts); + crate::merge_strategies::list::atomic(&mut self.hosts, other.hosts); crate::DeepMerge::merge_from(&mut self.secret_name, other.secret_name); } } diff --git a/src/v1_20/api/networking/v1/ip_block.rs b/src/v1_20/api/networking/v1/ip_block.rs index 46458b01c5..08d9d2ab61 100644 --- a/src/v1_20/api/networking/v1/ip_block.rs +++ b/src/v1_20/api/networking/v1/ip_block.rs @@ -13,7 +13,7 @@ pub struct IPBlock { impl crate::DeepMerge for IPBlock { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.cidr, other.cidr); - crate::DeepMerge::merge_from(&mut self.except, other.except); + crate::merge_strategies::list::atomic(&mut self.except, other.except); } } diff --git a/src/v1_20/api/networking/v1/network_policy_egress_rule.rs b/src/v1_20/api/networking/v1/network_policy_egress_rule.rs index 33619be210..28eb6a21b6 100644 --- a/src/v1_20/api/networking/v1/network_policy_egress_rule.rs +++ b/src/v1_20/api/networking/v1/network_policy_egress_rule.rs @@ -12,8 +12,8 @@ pub struct NetworkPolicyEgressRule { impl crate::DeepMerge for NetworkPolicyEgressRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.ports, other.ports); - crate::DeepMerge::merge_from(&mut self.to, other.to); + crate::merge_strategies::list::atomic(&mut self.ports, other.ports); + crate::merge_strategies::list::atomic(&mut self.to, other.to); } } diff --git a/src/v1_20/api/networking/v1/network_policy_ingress_rule.rs b/src/v1_20/api/networking/v1/network_policy_ingress_rule.rs index 2c68ec44a7..517765f800 100644 --- a/src/v1_20/api/networking/v1/network_policy_ingress_rule.rs +++ b/src/v1_20/api/networking/v1/network_policy_ingress_rule.rs @@ -12,8 +12,8 @@ pub struct NetworkPolicyIngressRule { impl crate::DeepMerge for NetworkPolicyIngressRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.from, other.from); - crate::DeepMerge::merge_from(&mut self.ports, other.ports); + crate::merge_strategies::list::atomic(&mut self.from, other.from); + crate::merge_strategies::list::atomic(&mut self.ports, other.ports); } } diff --git a/src/v1_20/api/networking/v1/network_policy_spec.rs b/src/v1_20/api/networking/v1/network_policy_spec.rs index 6457366ac3..c847fb086a 100644 --- a/src/v1_20/api/networking/v1/network_policy_spec.rs +++ b/src/v1_20/api/networking/v1/network_policy_spec.rs @@ -18,10 +18,10 @@ pub struct NetworkPolicySpec { impl crate::DeepMerge for NetworkPolicySpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.egress, other.egress); - crate::DeepMerge::merge_from(&mut self.ingress, other.ingress); + crate::merge_strategies::list::atomic(&mut self.egress, other.egress); + crate::merge_strategies::list::atomic(&mut self.ingress, other.ingress); crate::DeepMerge::merge_from(&mut self.pod_selector, other.pod_selector); - crate::DeepMerge::merge_from(&mut self.policy_types, other.policy_types); + crate::merge_strategies::list::atomic(&mut self.policy_types, other.policy_types); } } diff --git a/src/v1_20/api/networking/v1beta1/http_ingress_rule_value.rs b/src/v1_20/api/networking/v1beta1/http_ingress_rule_value.rs index b000ab1552..85ef5a30b9 100644 --- a/src/v1_20/api/networking/v1beta1/http_ingress_rule_value.rs +++ b/src/v1_20/api/networking/v1beta1/http_ingress_rule_value.rs @@ -9,7 +9,7 @@ pub struct HTTPIngressRuleValue { impl crate::DeepMerge for HTTPIngressRuleValue { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.paths, other.paths); + crate::merge_strategies::list::atomic(&mut self.paths, other.paths); } } diff --git a/src/v1_20/api/networking/v1beta1/ingress_spec.rs b/src/v1_20/api/networking/v1beta1/ingress_spec.rs index fbb0c4990b..df01685fc2 100644 --- a/src/v1_20/api/networking/v1beta1/ingress_spec.rs +++ b/src/v1_20/api/networking/v1beta1/ingress_spec.rs @@ -20,8 +20,8 @@ impl crate::DeepMerge for IngressSpec { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.backend, other.backend); crate::DeepMerge::merge_from(&mut self.ingress_class_name, other.ingress_class_name); - crate::DeepMerge::merge_from(&mut self.rules, other.rules); - crate::DeepMerge::merge_from(&mut self.tls, other.tls); + crate::merge_strategies::list::atomic(&mut self.rules, other.rules); + crate::merge_strategies::list::atomic(&mut self.tls, other.tls); } } diff --git a/src/v1_20/api/networking/v1beta1/ingress_tls.rs b/src/v1_20/api/networking/v1beta1/ingress_tls.rs index 36040b3456..2a3158ed0d 100644 --- a/src/v1_20/api/networking/v1beta1/ingress_tls.rs +++ b/src/v1_20/api/networking/v1beta1/ingress_tls.rs @@ -12,7 +12,7 @@ pub struct IngressTLS { impl crate::DeepMerge for IngressTLS { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.hosts, other.hosts); + crate::merge_strategies::list::atomic(&mut self.hosts, other.hosts); crate::DeepMerge::merge_from(&mut self.secret_name, other.secret_name); } } diff --git a/src/v1_20/api/node/v1/overhead.rs b/src/v1_20/api/node/v1/overhead.rs index ef68cae1c1..2db70b80c4 100644 --- a/src/v1_20/api/node/v1/overhead.rs +++ b/src/v1_20/api/node/v1/overhead.rs @@ -9,7 +9,9 @@ pub struct Overhead { impl crate::DeepMerge for Overhead { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.pod_fixed, other.pod_fixed); + crate::merge_strategies::map::granular(&mut self.pod_fixed, other.pod_fixed, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); } } diff --git a/src/v1_20/api/node/v1/scheduling.rs b/src/v1_20/api/node/v1/scheduling.rs index 1c2b8a05c5..61afb4567f 100644 --- a/src/v1_20/api/node/v1/scheduling.rs +++ b/src/v1_20/api/node/v1/scheduling.rs @@ -12,8 +12,10 @@ pub struct Scheduling { impl crate::DeepMerge for Scheduling { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.node_selector, other.node_selector); - crate::DeepMerge::merge_from(&mut self.tolerations, other.tolerations); + crate::merge_strategies::map::granular(&mut self.node_selector, other.node_selector, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::list::atomic(&mut self.tolerations, other.tolerations); } } diff --git a/src/v1_20/api/node/v1alpha1/overhead.rs b/src/v1_20/api/node/v1alpha1/overhead.rs index 59efa7b8e1..eb3a0a48fb 100644 --- a/src/v1_20/api/node/v1alpha1/overhead.rs +++ b/src/v1_20/api/node/v1alpha1/overhead.rs @@ -9,7 +9,9 @@ pub struct Overhead { impl crate::DeepMerge for Overhead { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.pod_fixed, other.pod_fixed); + crate::merge_strategies::map::granular(&mut self.pod_fixed, other.pod_fixed, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); } } diff --git a/src/v1_20/api/node/v1alpha1/scheduling.rs b/src/v1_20/api/node/v1alpha1/scheduling.rs index f660e0dc43..e6704fd193 100644 --- a/src/v1_20/api/node/v1alpha1/scheduling.rs +++ b/src/v1_20/api/node/v1alpha1/scheduling.rs @@ -12,8 +12,10 @@ pub struct Scheduling { impl crate::DeepMerge for Scheduling { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.node_selector, other.node_selector); - crate::DeepMerge::merge_from(&mut self.tolerations, other.tolerations); + crate::merge_strategies::map::granular(&mut self.node_selector, other.node_selector, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::list::atomic(&mut self.tolerations, other.tolerations); } } diff --git a/src/v1_20/api/node/v1beta1/overhead.rs b/src/v1_20/api/node/v1beta1/overhead.rs index 53af362cd3..821323b5c0 100644 --- a/src/v1_20/api/node/v1beta1/overhead.rs +++ b/src/v1_20/api/node/v1beta1/overhead.rs @@ -9,7 +9,9 @@ pub struct Overhead { impl crate::DeepMerge for Overhead { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.pod_fixed, other.pod_fixed); + crate::merge_strategies::map::granular(&mut self.pod_fixed, other.pod_fixed, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); } } diff --git a/src/v1_20/api/node/v1beta1/scheduling.rs b/src/v1_20/api/node/v1beta1/scheduling.rs index 9b493fe4cf..b16882c761 100644 --- a/src/v1_20/api/node/v1beta1/scheduling.rs +++ b/src/v1_20/api/node/v1beta1/scheduling.rs @@ -12,8 +12,10 @@ pub struct Scheduling { impl crate::DeepMerge for Scheduling { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.node_selector, other.node_selector); - crate::DeepMerge::merge_from(&mut self.tolerations, other.tolerations); + crate::merge_strategies::map::granular(&mut self.node_selector, other.node_selector, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::list::atomic(&mut self.tolerations, other.tolerations); } } diff --git a/src/v1_20/api/policy/v1beta1/fs_group_strategy_options.rs b/src/v1_20/api/policy/v1beta1/fs_group_strategy_options.rs index 80e63553ac..c52d53d54c 100644 --- a/src/v1_20/api/policy/v1beta1/fs_group_strategy_options.rs +++ b/src/v1_20/api/policy/v1beta1/fs_group_strategy_options.rs @@ -12,7 +12,7 @@ pub struct FSGroupStrategyOptions { impl crate::DeepMerge for FSGroupStrategyOptions { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.ranges, other.ranges); + crate::merge_strategies::list::atomic(&mut self.ranges, other.ranges); crate::DeepMerge::merge_from(&mut self.rule, other.rule); } } diff --git a/src/v1_20/api/policy/v1beta1/pod_disruption_budget_status.rs b/src/v1_20/api/policy/v1beta1/pod_disruption_budget_status.rs index 285d213a80..ef37c69175 100644 --- a/src/v1_20/api/policy/v1beta1/pod_disruption_budget_status.rs +++ b/src/v1_20/api/policy/v1beta1/pod_disruption_budget_status.rs @@ -26,7 +26,9 @@ impl crate::DeepMerge for PodDisruptionBudgetStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.current_healthy, other.current_healthy); crate::DeepMerge::merge_from(&mut self.desired_healthy, other.desired_healthy); - crate::DeepMerge::merge_from(&mut self.disrupted_pods, other.disrupted_pods); + crate::merge_strategies::map::granular(&mut self.disrupted_pods, other.disrupted_pods, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.disruptions_allowed, other.disruptions_allowed); crate::DeepMerge::merge_from(&mut self.expected_pods, other.expected_pods); crate::DeepMerge::merge_from(&mut self.observed_generation, other.observed_generation); diff --git a/src/v1_20/api/policy/v1beta1/pod_security_policy_spec.rs b/src/v1_20/api/policy/v1beta1/pod_security_policy_spec.rs index b4f2ca8c67..e9a43ffbac 100644 --- a/src/v1_20/api/policy/v1beta1/pod_security_policy_spec.rs +++ b/src/v1_20/api/policy/v1beta1/pod_security_policy_spec.rs @@ -83,29 +83,29 @@ pub struct PodSecurityPolicySpec { impl crate::DeepMerge for PodSecurityPolicySpec { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.allow_privilege_escalation, other.allow_privilege_escalation); - crate::DeepMerge::merge_from(&mut self.allowed_csi_drivers, other.allowed_csi_drivers); - crate::DeepMerge::merge_from(&mut self.allowed_capabilities, other.allowed_capabilities); - crate::DeepMerge::merge_from(&mut self.allowed_flex_volumes, other.allowed_flex_volumes); - crate::DeepMerge::merge_from(&mut self.allowed_host_paths, other.allowed_host_paths); - crate::DeepMerge::merge_from(&mut self.allowed_proc_mount_types, other.allowed_proc_mount_types); - crate::DeepMerge::merge_from(&mut self.allowed_unsafe_sysctls, other.allowed_unsafe_sysctls); - crate::DeepMerge::merge_from(&mut self.default_add_capabilities, other.default_add_capabilities); + crate::merge_strategies::list::atomic(&mut self.allowed_csi_drivers, other.allowed_csi_drivers); + crate::merge_strategies::list::atomic(&mut self.allowed_capabilities, other.allowed_capabilities); + crate::merge_strategies::list::atomic(&mut self.allowed_flex_volumes, other.allowed_flex_volumes); + crate::merge_strategies::list::atomic(&mut self.allowed_host_paths, other.allowed_host_paths); + crate::merge_strategies::list::atomic(&mut self.allowed_proc_mount_types, other.allowed_proc_mount_types); + crate::merge_strategies::list::atomic(&mut self.allowed_unsafe_sysctls, other.allowed_unsafe_sysctls); + crate::merge_strategies::list::atomic(&mut self.default_add_capabilities, other.default_add_capabilities); crate::DeepMerge::merge_from(&mut self.default_allow_privilege_escalation, other.default_allow_privilege_escalation); - crate::DeepMerge::merge_from(&mut self.forbidden_sysctls, other.forbidden_sysctls); + crate::merge_strategies::list::atomic(&mut self.forbidden_sysctls, other.forbidden_sysctls); crate::DeepMerge::merge_from(&mut self.fs_group, other.fs_group); crate::DeepMerge::merge_from(&mut self.host_ipc, other.host_ipc); crate::DeepMerge::merge_from(&mut self.host_network, other.host_network); crate::DeepMerge::merge_from(&mut self.host_pid, other.host_pid); - crate::DeepMerge::merge_from(&mut self.host_ports, other.host_ports); + crate::merge_strategies::list::atomic(&mut self.host_ports, other.host_ports); crate::DeepMerge::merge_from(&mut self.privileged, other.privileged); crate::DeepMerge::merge_from(&mut self.read_only_root_filesystem, other.read_only_root_filesystem); - crate::DeepMerge::merge_from(&mut self.required_drop_capabilities, other.required_drop_capabilities); + crate::merge_strategies::list::atomic(&mut self.required_drop_capabilities, other.required_drop_capabilities); crate::DeepMerge::merge_from(&mut self.run_as_group, other.run_as_group); crate::DeepMerge::merge_from(&mut self.run_as_user, other.run_as_user); crate::DeepMerge::merge_from(&mut self.runtime_class, other.runtime_class); crate::DeepMerge::merge_from(&mut self.se_linux, other.se_linux); crate::DeepMerge::merge_from(&mut self.supplemental_groups, other.supplemental_groups); - crate::DeepMerge::merge_from(&mut self.volumes, other.volumes); + crate::merge_strategies::list::atomic(&mut self.volumes, other.volumes); } } diff --git a/src/v1_20/api/policy/v1beta1/run_as_group_strategy_options.rs b/src/v1_20/api/policy/v1beta1/run_as_group_strategy_options.rs index 89e97b5842..25aa6f1e66 100644 --- a/src/v1_20/api/policy/v1beta1/run_as_group_strategy_options.rs +++ b/src/v1_20/api/policy/v1beta1/run_as_group_strategy_options.rs @@ -12,7 +12,7 @@ pub struct RunAsGroupStrategyOptions { impl crate::DeepMerge for RunAsGroupStrategyOptions { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.ranges, other.ranges); + crate::merge_strategies::list::atomic(&mut self.ranges, other.ranges); crate::DeepMerge::merge_from(&mut self.rule, other.rule); } } diff --git a/src/v1_20/api/policy/v1beta1/run_as_user_strategy_options.rs b/src/v1_20/api/policy/v1beta1/run_as_user_strategy_options.rs index aeeda6f381..a28c259366 100644 --- a/src/v1_20/api/policy/v1beta1/run_as_user_strategy_options.rs +++ b/src/v1_20/api/policy/v1beta1/run_as_user_strategy_options.rs @@ -12,7 +12,7 @@ pub struct RunAsUserStrategyOptions { impl crate::DeepMerge for RunAsUserStrategyOptions { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.ranges, other.ranges); + crate::merge_strategies::list::atomic(&mut self.ranges, other.ranges); crate::DeepMerge::merge_from(&mut self.rule, other.rule); } } diff --git a/src/v1_20/api/policy/v1beta1/runtime_class_strategy_options.rs b/src/v1_20/api/policy/v1beta1/runtime_class_strategy_options.rs index 5f80a6b7e7..085d36d69f 100644 --- a/src/v1_20/api/policy/v1beta1/runtime_class_strategy_options.rs +++ b/src/v1_20/api/policy/v1beta1/runtime_class_strategy_options.rs @@ -12,7 +12,7 @@ pub struct RuntimeClassStrategyOptions { impl crate::DeepMerge for RuntimeClassStrategyOptions { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.allowed_runtime_class_names, other.allowed_runtime_class_names); + crate::merge_strategies::list::atomic(&mut self.allowed_runtime_class_names, other.allowed_runtime_class_names); crate::DeepMerge::merge_from(&mut self.default_runtime_class_name, other.default_runtime_class_name); } } diff --git a/src/v1_20/api/policy/v1beta1/supplemental_groups_strategy_options.rs b/src/v1_20/api/policy/v1beta1/supplemental_groups_strategy_options.rs index 7e83b2e756..4bcc23b7e2 100644 --- a/src/v1_20/api/policy/v1beta1/supplemental_groups_strategy_options.rs +++ b/src/v1_20/api/policy/v1beta1/supplemental_groups_strategy_options.rs @@ -12,7 +12,7 @@ pub struct SupplementalGroupsStrategyOptions { impl crate::DeepMerge for SupplementalGroupsStrategyOptions { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.ranges, other.ranges); + crate::merge_strategies::list::atomic(&mut self.ranges, other.ranges); crate::DeepMerge::merge_from(&mut self.rule, other.rule); } } diff --git a/src/v1_20/api/rbac/v1/aggregation_rule.rs b/src/v1_20/api/rbac/v1/aggregation_rule.rs index 5ccc4984f6..b20ce61705 100644 --- a/src/v1_20/api/rbac/v1/aggregation_rule.rs +++ b/src/v1_20/api/rbac/v1/aggregation_rule.rs @@ -9,7 +9,7 @@ pub struct AggregationRule { impl crate::DeepMerge for AggregationRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.cluster_role_selectors, other.cluster_role_selectors); + crate::merge_strategies::list::atomic(&mut self.cluster_role_selectors, other.cluster_role_selectors); } } diff --git a/src/v1_20/api/rbac/v1/cluster_role.rs b/src/v1_20/api/rbac/v1/cluster_role.rs index 8336e14c92..a6f832b593 100644 --- a/src/v1_20/api/rbac/v1/cluster_role.rs +++ b/src/v1_20/api/rbac/v1/cluster_role.rs @@ -378,7 +378,7 @@ impl crate::DeepMerge for ClusterRole { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.aggregation_rule, other.aggregation_rule); crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.rules, other.rules); + crate::merge_strategies::list::atomic(&mut self.rules, other.rules); } } 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..04fa2bd714 100644 --- a/src/v1_20/api/rbac/v1/cluster_role_binding.rs +++ b/src/v1_20/api/rbac/v1/cluster_role_binding.rs @@ -378,7 +378,7 @@ impl crate::DeepMerge for ClusterRoleBinding { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); crate::DeepMerge::merge_from(&mut self.role_ref, other.role_ref); - crate::DeepMerge::merge_from(&mut self.subjects, other.subjects); + crate::merge_strategies::list::atomic(&mut self.subjects, other.subjects); } } diff --git a/src/v1_20/api/rbac/v1/policy_rule.rs b/src/v1_20/api/rbac/v1/policy_rule.rs index f6ab14adc2..5d5c5e6d8e 100644 --- a/src/v1_20/api/rbac/v1/policy_rule.rs +++ b/src/v1_20/api/rbac/v1/policy_rule.rs @@ -21,11 +21,11 @@ pub struct PolicyRule { impl crate::DeepMerge for PolicyRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.api_groups, other.api_groups); - crate::DeepMerge::merge_from(&mut self.non_resource_urls, other.non_resource_urls); - crate::DeepMerge::merge_from(&mut self.resource_names, other.resource_names); - crate::DeepMerge::merge_from(&mut self.resources, other.resources); - crate::DeepMerge::merge_from(&mut self.verbs, other.verbs); + crate::merge_strategies::list::atomic(&mut self.api_groups, other.api_groups); + crate::merge_strategies::list::atomic(&mut self.non_resource_urls, other.non_resource_urls); + crate::merge_strategies::list::atomic(&mut self.resource_names, other.resource_names); + crate::merge_strategies::list::atomic(&mut self.resources, other.resources); + crate::merge_strategies::list::atomic(&mut self.verbs, other.verbs); } } diff --git a/src/v1_20/api/rbac/v1/role.rs b/src/v1_20/api/rbac/v1/role.rs index 9764bc7aa0..719ecb92b0 100644 --- a/src/v1_20/api/rbac/v1/role.rs +++ b/src/v1_20/api/rbac/v1/role.rs @@ -490,7 +490,7 @@ impl crate::Metadata for Role { impl crate::DeepMerge for Role { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.rules, other.rules); + crate::merge_strategies::list::atomic(&mut self.rules, other.rules); } } diff --git a/src/v1_20/api/rbac/v1/role_binding.rs b/src/v1_20/api/rbac/v1/role_binding.rs index ac11e857c2..7b9059076a 100644 --- a/src/v1_20/api/rbac/v1/role_binding.rs +++ b/src/v1_20/api/rbac/v1/role_binding.rs @@ -494,7 +494,7 @@ impl crate::DeepMerge for RoleBinding { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); crate::DeepMerge::merge_from(&mut self.role_ref, other.role_ref); - crate::DeepMerge::merge_from(&mut self.subjects, other.subjects); + crate::merge_strategies::list::atomic(&mut self.subjects, other.subjects); } } diff --git a/src/v1_20/api/rbac/v1alpha1/aggregation_rule.rs b/src/v1_20/api/rbac/v1alpha1/aggregation_rule.rs index ba1495c28c..4f4acecf3e 100644 --- a/src/v1_20/api/rbac/v1alpha1/aggregation_rule.rs +++ b/src/v1_20/api/rbac/v1alpha1/aggregation_rule.rs @@ -9,7 +9,7 @@ pub struct AggregationRule { impl crate::DeepMerge for AggregationRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.cluster_role_selectors, other.cluster_role_selectors); + crate::merge_strategies::list::atomic(&mut self.cluster_role_selectors, other.cluster_role_selectors); } } diff --git a/src/v1_20/api/rbac/v1alpha1/cluster_role.rs b/src/v1_20/api/rbac/v1alpha1/cluster_role.rs index 751ea258ce..1894462873 100644 --- a/src/v1_20/api/rbac/v1alpha1/cluster_role.rs +++ b/src/v1_20/api/rbac/v1alpha1/cluster_role.rs @@ -378,7 +378,7 @@ impl crate::DeepMerge for ClusterRole { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.aggregation_rule, other.aggregation_rule); crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.rules, other.rules); + crate::merge_strategies::list::atomic(&mut self.rules, other.rules); } } 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..9385e93337 100644 --- a/src/v1_20/api/rbac/v1alpha1/cluster_role_binding.rs +++ b/src/v1_20/api/rbac/v1alpha1/cluster_role_binding.rs @@ -378,7 +378,7 @@ impl crate::DeepMerge for ClusterRoleBinding { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); crate::DeepMerge::merge_from(&mut self.role_ref, other.role_ref); - crate::DeepMerge::merge_from(&mut self.subjects, other.subjects); + crate::merge_strategies::list::atomic(&mut self.subjects, other.subjects); } } diff --git a/src/v1_20/api/rbac/v1alpha1/policy_rule.rs b/src/v1_20/api/rbac/v1alpha1/policy_rule.rs index eee02e04ae..5d04dfadaf 100644 --- a/src/v1_20/api/rbac/v1alpha1/policy_rule.rs +++ b/src/v1_20/api/rbac/v1alpha1/policy_rule.rs @@ -21,11 +21,11 @@ pub struct PolicyRule { impl crate::DeepMerge for PolicyRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.api_groups, other.api_groups); - crate::DeepMerge::merge_from(&mut self.non_resource_urls, other.non_resource_urls); - crate::DeepMerge::merge_from(&mut self.resource_names, other.resource_names); - crate::DeepMerge::merge_from(&mut self.resources, other.resources); - crate::DeepMerge::merge_from(&mut self.verbs, other.verbs); + crate::merge_strategies::list::atomic(&mut self.api_groups, other.api_groups); + crate::merge_strategies::list::atomic(&mut self.non_resource_urls, other.non_resource_urls); + crate::merge_strategies::list::atomic(&mut self.resource_names, other.resource_names); + crate::merge_strategies::list::atomic(&mut self.resources, other.resources); + crate::merge_strategies::list::atomic(&mut self.verbs, other.verbs); } } diff --git a/src/v1_20/api/rbac/v1alpha1/role.rs b/src/v1_20/api/rbac/v1alpha1/role.rs index ed08658a2d..a21e1d75e2 100644 --- a/src/v1_20/api/rbac/v1alpha1/role.rs +++ b/src/v1_20/api/rbac/v1alpha1/role.rs @@ -490,7 +490,7 @@ impl crate::Metadata for Role { impl crate::DeepMerge for Role { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.rules, other.rules); + crate::merge_strategies::list::atomic(&mut self.rules, other.rules); } } diff --git a/src/v1_20/api/rbac/v1alpha1/role_binding.rs b/src/v1_20/api/rbac/v1alpha1/role_binding.rs index f965377b92..819c0b88f2 100644 --- a/src/v1_20/api/rbac/v1alpha1/role_binding.rs +++ b/src/v1_20/api/rbac/v1alpha1/role_binding.rs @@ -494,7 +494,7 @@ impl crate::DeepMerge for RoleBinding { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); crate::DeepMerge::merge_from(&mut self.role_ref, other.role_ref); - crate::DeepMerge::merge_from(&mut self.subjects, other.subjects); + crate::merge_strategies::list::atomic(&mut self.subjects, other.subjects); } } diff --git a/src/v1_20/api/rbac/v1beta1/aggregation_rule.rs b/src/v1_20/api/rbac/v1beta1/aggregation_rule.rs index 3ca92d3f83..c5444137be 100644 --- a/src/v1_20/api/rbac/v1beta1/aggregation_rule.rs +++ b/src/v1_20/api/rbac/v1beta1/aggregation_rule.rs @@ -9,7 +9,7 @@ pub struct AggregationRule { impl crate::DeepMerge for AggregationRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.cluster_role_selectors, other.cluster_role_selectors); + crate::merge_strategies::list::atomic(&mut self.cluster_role_selectors, other.cluster_role_selectors); } } diff --git a/src/v1_20/api/rbac/v1beta1/cluster_role.rs b/src/v1_20/api/rbac/v1beta1/cluster_role.rs index 4931e2d651..5a40b2d047 100644 --- a/src/v1_20/api/rbac/v1beta1/cluster_role.rs +++ b/src/v1_20/api/rbac/v1beta1/cluster_role.rs @@ -378,7 +378,7 @@ impl crate::DeepMerge for ClusterRole { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.aggregation_rule, other.aggregation_rule); crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.rules, other.rules); + crate::merge_strategies::list::atomic(&mut self.rules, other.rules); } } 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..bb007fa116 100644 --- a/src/v1_20/api/rbac/v1beta1/cluster_role_binding.rs +++ b/src/v1_20/api/rbac/v1beta1/cluster_role_binding.rs @@ -378,7 +378,7 @@ impl crate::DeepMerge for ClusterRoleBinding { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); crate::DeepMerge::merge_from(&mut self.role_ref, other.role_ref); - crate::DeepMerge::merge_from(&mut self.subjects, other.subjects); + crate::merge_strategies::list::atomic(&mut self.subjects, other.subjects); } } diff --git a/src/v1_20/api/rbac/v1beta1/policy_rule.rs b/src/v1_20/api/rbac/v1beta1/policy_rule.rs index 83e7907c1c..67a49c0667 100644 --- a/src/v1_20/api/rbac/v1beta1/policy_rule.rs +++ b/src/v1_20/api/rbac/v1beta1/policy_rule.rs @@ -21,11 +21,11 @@ pub struct PolicyRule { impl crate::DeepMerge for PolicyRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.api_groups, other.api_groups); - crate::DeepMerge::merge_from(&mut self.non_resource_urls, other.non_resource_urls); - crate::DeepMerge::merge_from(&mut self.resource_names, other.resource_names); - crate::DeepMerge::merge_from(&mut self.resources, other.resources); - crate::DeepMerge::merge_from(&mut self.verbs, other.verbs); + crate::merge_strategies::list::atomic(&mut self.api_groups, other.api_groups); + crate::merge_strategies::list::atomic(&mut self.non_resource_urls, other.non_resource_urls); + crate::merge_strategies::list::atomic(&mut self.resource_names, other.resource_names); + crate::merge_strategies::list::atomic(&mut self.resources, other.resources); + crate::merge_strategies::list::atomic(&mut self.verbs, other.verbs); } } diff --git a/src/v1_20/api/rbac/v1beta1/role.rs b/src/v1_20/api/rbac/v1beta1/role.rs index 44184b4f3b..2f94606aa1 100644 --- a/src/v1_20/api/rbac/v1beta1/role.rs +++ b/src/v1_20/api/rbac/v1beta1/role.rs @@ -490,7 +490,7 @@ impl crate::Metadata for Role { impl crate::DeepMerge for Role { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.rules, other.rules); + crate::merge_strategies::list::atomic(&mut self.rules, other.rules); } } diff --git a/src/v1_20/api/rbac/v1beta1/role_binding.rs b/src/v1_20/api/rbac/v1beta1/role_binding.rs index a49d33a668..a9498bfb85 100644 --- a/src/v1_20/api/rbac/v1beta1/role_binding.rs +++ b/src/v1_20/api/rbac/v1beta1/role_binding.rs @@ -494,7 +494,7 @@ impl crate::DeepMerge for RoleBinding { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); crate::DeepMerge::merge_from(&mut self.role_ref, other.role_ref); - crate::DeepMerge::merge_from(&mut self.subjects, other.subjects); + crate::merge_strategies::list::atomic(&mut self.subjects, other.subjects); } } diff --git a/src/v1_20/api/storage/v1/csi_driver_spec.rs b/src/v1_20/api/storage/v1/csi_driver_spec.rs index 471595e3f9..0323256adb 100644 --- a/src/v1_20/api/storage/v1/csi_driver_spec.rs +++ b/src/v1_20/api/storage/v1/csi_driver_spec.rs @@ -55,8 +55,8 @@ impl crate::DeepMerge for CSIDriverSpec { crate::DeepMerge::merge_from(&mut self.pod_info_on_mount, other.pod_info_on_mount); crate::DeepMerge::merge_from(&mut self.requires_republish, other.requires_republish); crate::DeepMerge::merge_from(&mut self.storage_capacity, other.storage_capacity); - crate::DeepMerge::merge_from(&mut self.token_requests, other.token_requests); - crate::DeepMerge::merge_from(&mut self.volume_lifecycle_modes, other.volume_lifecycle_modes); + crate::merge_strategies::list::atomic(&mut self.token_requests, other.token_requests); + crate::merge_strategies::list::set(&mut self.volume_lifecycle_modes, other.volume_lifecycle_modes); } } diff --git a/src/v1_20/api/storage/v1/csi_node_driver.rs b/src/v1_20/api/storage/v1/csi_node_driver.rs index c113299390..d8b79d89f3 100644 --- a/src/v1_20/api/storage/v1/csi_node_driver.rs +++ b/src/v1_20/api/storage/v1/csi_node_driver.rs @@ -21,7 +21,7 @@ impl crate::DeepMerge for CSINodeDriver { crate::DeepMerge::merge_from(&mut self.allocatable, other.allocatable); crate::DeepMerge::merge_from(&mut self.name, other.name); crate::DeepMerge::merge_from(&mut self.node_id, other.node_id); - crate::DeepMerge::merge_from(&mut self.topology_keys, other.topology_keys); + crate::merge_strategies::list::atomic(&mut self.topology_keys, other.topology_keys); } } diff --git a/src/v1_20/api/storage/v1/csi_node_spec.rs b/src/v1_20/api/storage/v1/csi_node_spec.rs index ea2a1ddb97..4717576df8 100644 --- a/src/v1_20/api/storage/v1/csi_node_spec.rs +++ b/src/v1_20/api/storage/v1/csi_node_spec.rs @@ -9,7 +9,14 @@ pub struct CSINodeSpec { impl crate::DeepMerge for CSINodeSpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.drivers, other.drivers); + crate::merge_strategies::list::map( + &mut self.drivers, + other.drivers, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_20/api/storage/v1/storage_class.rs b/src/v1_20/api/storage/v1/storage_class.rs index 2bf8e65456..12774ba320 100644 --- a/src/v1_20/api/storage/v1/storage_class.rs +++ b/src/v1_20/api/storage/v1/storage_class.rs @@ -394,10 +394,12 @@ impl crate::Metadata for StorageClass { impl crate::DeepMerge for StorageClass { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.allow_volume_expansion, other.allow_volume_expansion); - crate::DeepMerge::merge_from(&mut self.allowed_topologies, other.allowed_topologies); + crate::merge_strategies::list::atomic(&mut self.allowed_topologies, other.allowed_topologies); crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.mount_options, other.mount_options); - crate::DeepMerge::merge_from(&mut self.parameters, other.parameters); + crate::merge_strategies::list::atomic(&mut self.mount_options, other.mount_options); + crate::merge_strategies::map::granular(&mut self.parameters, other.parameters, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.provisioner, other.provisioner); crate::DeepMerge::merge_from(&mut self.reclaim_policy, other.reclaim_policy); crate::DeepMerge::merge_from(&mut self.volume_binding_mode, other.volume_binding_mode); diff --git a/src/v1_20/api/storage/v1/volume_attachment_status.rs b/src/v1_20/api/storage/v1/volume_attachment_status.rs index fb8e63d745..bb6ba3fe42 100644 --- a/src/v1_20/api/storage/v1/volume_attachment_status.rs +++ b/src/v1_20/api/storage/v1/volume_attachment_status.rs @@ -20,7 +20,9 @@ impl crate::DeepMerge for VolumeAttachmentStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.attach_error, other.attach_error); crate::DeepMerge::merge_from(&mut self.attached, other.attached); - crate::DeepMerge::merge_from(&mut self.attachment_metadata, other.attachment_metadata); + crate::merge_strategies::map::granular(&mut self.attachment_metadata, other.attachment_metadata, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.detach_error, other.detach_error); } } diff --git a/src/v1_20/api/storage/v1alpha1/volume_attachment_status.rs b/src/v1_20/api/storage/v1alpha1/volume_attachment_status.rs index db1529fd28..67dd47c5f6 100644 --- a/src/v1_20/api/storage/v1alpha1/volume_attachment_status.rs +++ b/src/v1_20/api/storage/v1alpha1/volume_attachment_status.rs @@ -20,7 +20,9 @@ impl crate::DeepMerge for VolumeAttachmentStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.attach_error, other.attach_error); crate::DeepMerge::merge_from(&mut self.attached, other.attached); - crate::DeepMerge::merge_from(&mut self.attachment_metadata, other.attachment_metadata); + crate::merge_strategies::map::granular(&mut self.attachment_metadata, other.attachment_metadata, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.detach_error, other.detach_error); } } diff --git a/src/v1_20/api/storage/v1beta1/csi_driver_spec.rs b/src/v1_20/api/storage/v1beta1/csi_driver_spec.rs index a880a0b548..99565b0323 100644 --- a/src/v1_20/api/storage/v1beta1/csi_driver_spec.rs +++ b/src/v1_20/api/storage/v1beta1/csi_driver_spec.rs @@ -55,8 +55,8 @@ impl crate::DeepMerge for CSIDriverSpec { crate::DeepMerge::merge_from(&mut self.pod_info_on_mount, other.pod_info_on_mount); crate::DeepMerge::merge_from(&mut self.requires_republish, other.requires_republish); crate::DeepMerge::merge_from(&mut self.storage_capacity, other.storage_capacity); - crate::DeepMerge::merge_from(&mut self.token_requests, other.token_requests); - crate::DeepMerge::merge_from(&mut self.volume_lifecycle_modes, other.volume_lifecycle_modes); + crate::merge_strategies::list::atomic(&mut self.token_requests, other.token_requests); + crate::merge_strategies::list::atomic(&mut self.volume_lifecycle_modes, other.volume_lifecycle_modes); } } diff --git a/src/v1_20/api/storage/v1beta1/csi_node_driver.rs b/src/v1_20/api/storage/v1beta1/csi_node_driver.rs index 8b6cf9b096..4adc37626c 100644 --- a/src/v1_20/api/storage/v1beta1/csi_node_driver.rs +++ b/src/v1_20/api/storage/v1beta1/csi_node_driver.rs @@ -21,7 +21,7 @@ impl crate::DeepMerge for CSINodeDriver { crate::DeepMerge::merge_from(&mut self.allocatable, other.allocatable); crate::DeepMerge::merge_from(&mut self.name, other.name); crate::DeepMerge::merge_from(&mut self.node_id, other.node_id); - crate::DeepMerge::merge_from(&mut self.topology_keys, other.topology_keys); + crate::merge_strategies::list::atomic(&mut self.topology_keys, other.topology_keys); } } diff --git a/src/v1_20/api/storage/v1beta1/csi_node_spec.rs b/src/v1_20/api/storage/v1beta1/csi_node_spec.rs index bcc7cca7fc..26851f4028 100644 --- a/src/v1_20/api/storage/v1beta1/csi_node_spec.rs +++ b/src/v1_20/api/storage/v1beta1/csi_node_spec.rs @@ -9,7 +9,14 @@ pub struct CSINodeSpec { impl crate::DeepMerge for CSINodeSpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.drivers, other.drivers); + crate::merge_strategies::list::map( + &mut self.drivers, + other.drivers, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_20/api/storage/v1beta1/storage_class.rs b/src/v1_20/api/storage/v1beta1/storage_class.rs index d8e2c027b2..2a91d4bb61 100644 --- a/src/v1_20/api/storage/v1beta1/storage_class.rs +++ b/src/v1_20/api/storage/v1beta1/storage_class.rs @@ -394,10 +394,12 @@ impl crate::Metadata for StorageClass { impl crate::DeepMerge for StorageClass { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.allow_volume_expansion, other.allow_volume_expansion); - crate::DeepMerge::merge_from(&mut self.allowed_topologies, other.allowed_topologies); + crate::merge_strategies::list::atomic(&mut self.allowed_topologies, other.allowed_topologies); crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.mount_options, other.mount_options); - crate::DeepMerge::merge_from(&mut self.parameters, other.parameters); + crate::merge_strategies::list::atomic(&mut self.mount_options, other.mount_options); + crate::merge_strategies::map::granular(&mut self.parameters, other.parameters, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.provisioner, other.provisioner); crate::DeepMerge::merge_from(&mut self.reclaim_policy, other.reclaim_policy); crate::DeepMerge::merge_from(&mut self.volume_binding_mode, other.volume_binding_mode); diff --git a/src/v1_20/api/storage/v1beta1/volume_attachment_status.rs b/src/v1_20/api/storage/v1beta1/volume_attachment_status.rs index d28e570d75..179cf3aad9 100644 --- a/src/v1_20/api/storage/v1beta1/volume_attachment_status.rs +++ b/src/v1_20/api/storage/v1beta1/volume_attachment_status.rs @@ -20,7 +20,9 @@ impl crate::DeepMerge for VolumeAttachmentStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.attach_error, other.attach_error); crate::DeepMerge::merge_from(&mut self.attached, other.attached); - crate::DeepMerge::merge_from(&mut self.attachment_metadata, other.attachment_metadata); + crate::merge_strategies::map::granular(&mut self.attachment_metadata, other.attachment_metadata, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.detach_error, other.detach_error); } } diff --git a/src/v1_20/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_names.rs b/src/v1_20/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_names.rs index f3a8d38696..d105542807 100644 --- a/src/v1_20/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_names.rs +++ b/src/v1_20/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_names.rs @@ -24,11 +24,11 @@ pub struct CustomResourceDefinitionNames { impl crate::DeepMerge for CustomResourceDefinitionNames { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.categories, other.categories); + crate::merge_strategies::list::atomic(&mut self.categories, other.categories); crate::DeepMerge::merge_from(&mut self.kind, other.kind); crate::DeepMerge::merge_from(&mut self.list_kind, other.list_kind); crate::DeepMerge::merge_from(&mut self.plural, other.plural); - crate::DeepMerge::merge_from(&mut self.short_names, other.short_names); + crate::merge_strategies::list::atomic(&mut self.short_names, other.short_names); crate::DeepMerge::merge_from(&mut self.singular, other.singular); } } diff --git a/src/v1_20/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_spec.rs b/src/v1_20/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_spec.rs index 40ffea9ed1..e3a881e9a4 100644 --- a/src/v1_20/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_spec.rs +++ b/src/v1_20/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_spec.rs @@ -29,7 +29,7 @@ impl crate::DeepMerge for CustomResourceDefinitionSpec { crate::DeepMerge::merge_from(&mut self.names, other.names); crate::DeepMerge::merge_from(&mut self.preserve_unknown_fields, other.preserve_unknown_fields); crate::DeepMerge::merge_from(&mut self.scope, other.scope); - crate::DeepMerge::merge_from(&mut self.versions, other.versions); + crate::merge_strategies::list::atomic(&mut self.versions, other.versions); } } diff --git a/src/v1_20/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_status.rs b/src/v1_20/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_status.rs index a7427347aa..c2cecbcb78 100644 --- a/src/v1_20/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_status.rs +++ b/src/v1_20/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_status.rs @@ -16,8 +16,8 @@ pub struct CustomResourceDefinitionStatus { impl crate::DeepMerge for CustomResourceDefinitionStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.accepted_names, other.accepted_names); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); - crate::DeepMerge::merge_from(&mut self.stored_versions, other.stored_versions); + crate::merge_strategies::list::atomic(&mut self.conditions, other.conditions); + crate::merge_strategies::list::atomic(&mut self.stored_versions, other.stored_versions); } } diff --git a/src/v1_20/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_version.rs b/src/v1_20/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_version.rs index 5b4d51a697..90a9bb5e32 100644 --- a/src/v1_20/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_version.rs +++ b/src/v1_20/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_version.rs @@ -30,7 +30,7 @@ pub struct CustomResourceDefinitionVersion { impl crate::DeepMerge for CustomResourceDefinitionVersion { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.additional_printer_columns, other.additional_printer_columns); + crate::merge_strategies::list::atomic(&mut self.additional_printer_columns, other.additional_printer_columns); crate::DeepMerge::merge_from(&mut self.deprecated, other.deprecated); crate::DeepMerge::merge_from(&mut self.deprecation_warning, other.deprecation_warning); crate::DeepMerge::merge_from(&mut self.name, other.name); diff --git a/src/v1_20/apiextensions_apiserver/pkg/apis/apiextensions/v1/json_schema_props.rs b/src/v1_20/apiextensions_apiserver/pkg/apis/apiextensions/v1/json_schema_props.rs index bd87461670..35c767acb8 100644 --- a/src/v1_20/apiextensions_apiserver/pkg/apis/apiextensions/v1/json_schema_props.rs +++ b/src/v1_20/apiextensions_apiserver/pkg/apis/apiextensions/v1/json_schema_props.rs @@ -139,13 +139,17 @@ impl crate::DeepMerge for JSONSchemaProps { crate::DeepMerge::merge_from(&mut self.schema, other.schema); crate::DeepMerge::merge_from(&mut self.additional_items, other.additional_items); crate::DeepMerge::merge_from(&mut self.additional_properties, other.additional_properties); - crate::DeepMerge::merge_from(&mut self.all_of, other.all_of); - crate::DeepMerge::merge_from(&mut self.any_of, other.any_of); + crate::merge_strategies::list::atomic(&mut self.all_of, other.all_of); + crate::merge_strategies::list::atomic(&mut self.any_of, other.any_of); crate::DeepMerge::merge_from(&mut self.default, other.default); - crate::DeepMerge::merge_from(&mut self.definitions, other.definitions); - crate::DeepMerge::merge_from(&mut self.dependencies, other.dependencies); + crate::merge_strategies::map::granular(&mut self.definitions, other.definitions, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.dependencies, other.dependencies, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.description, other.description); - crate::DeepMerge::merge_from(&mut self.enum_, other.enum_); + crate::merge_strategies::list::atomic(&mut self.enum_, other.enum_); crate::DeepMerge::merge_from(&mut self.example, other.example); crate::DeepMerge::merge_from(&mut self.exclusive_maximum, other.exclusive_maximum); crate::DeepMerge::merge_from(&mut self.exclusive_minimum, other.exclusive_minimum); @@ -164,17 +168,21 @@ impl crate::DeepMerge for JSONSchemaProps { crate::DeepMerge::merge_from(&mut self.multiple_of, other.multiple_of); crate::DeepMerge::merge_from(&mut self.not, other.not); crate::DeepMerge::merge_from(&mut self.nullable, other.nullable); - crate::DeepMerge::merge_from(&mut self.one_of, other.one_of); + crate::merge_strategies::list::atomic(&mut self.one_of, other.one_of); crate::DeepMerge::merge_from(&mut self.pattern, other.pattern); - crate::DeepMerge::merge_from(&mut self.pattern_properties, other.pattern_properties); - crate::DeepMerge::merge_from(&mut self.properties, other.properties); - crate::DeepMerge::merge_from(&mut self.required, other.required); + crate::merge_strategies::map::granular(&mut self.pattern_properties, other.pattern_properties, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.properties, other.properties, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::list::atomic(&mut self.required, other.required); crate::DeepMerge::merge_from(&mut self.title, other.title); crate::DeepMerge::merge_from(&mut self.type_, other.type_); crate::DeepMerge::merge_from(&mut self.unique_items, other.unique_items); crate::DeepMerge::merge_from(&mut self.x_kubernetes_embedded_resource, other.x_kubernetes_embedded_resource); crate::DeepMerge::merge_from(&mut self.x_kubernetes_int_or_string, other.x_kubernetes_int_or_string); - crate::DeepMerge::merge_from(&mut self.x_kubernetes_list_map_keys, other.x_kubernetes_list_map_keys); + crate::merge_strategies::list::atomic(&mut self.x_kubernetes_list_map_keys, other.x_kubernetes_list_map_keys); crate::DeepMerge::merge_from(&mut self.x_kubernetes_list_type, other.x_kubernetes_list_type); crate::DeepMerge::merge_from(&mut self.x_kubernetes_map_type, other.x_kubernetes_map_type); crate::DeepMerge::merge_from(&mut self.x_kubernetes_preserve_unknown_fields, other.x_kubernetes_preserve_unknown_fields); diff --git a/src/v1_20/apiextensions_apiserver/pkg/apis/apiextensions/v1/webhook_conversion.rs b/src/v1_20/apiextensions_apiserver/pkg/apis/apiextensions/v1/webhook_conversion.rs index aec75dfd39..69008b2dca 100644 --- a/src/v1_20/apiextensions_apiserver/pkg/apis/apiextensions/v1/webhook_conversion.rs +++ b/src/v1_20/apiextensions_apiserver/pkg/apis/apiextensions/v1/webhook_conversion.rs @@ -13,7 +13,7 @@ pub struct WebhookConversion { impl crate::DeepMerge for WebhookConversion { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.client_config, other.client_config); - crate::DeepMerge::merge_from(&mut self.conversion_review_versions, other.conversion_review_versions); + crate::merge_strategies::list::atomic(&mut self.conversion_review_versions, other.conversion_review_versions); } } diff --git a/src/v1_20/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/custom_resource_conversion.rs b/src/v1_20/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/custom_resource_conversion.rs index 2173424db1..7a03743224 100644 --- a/src/v1_20/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/custom_resource_conversion.rs +++ b/src/v1_20/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/custom_resource_conversion.rs @@ -16,7 +16,7 @@ pub struct CustomResourceConversion { impl crate::DeepMerge for CustomResourceConversion { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conversion_review_versions, other.conversion_review_versions); + crate::merge_strategies::list::atomic(&mut self.conversion_review_versions, other.conversion_review_versions); crate::DeepMerge::merge_from(&mut self.strategy, other.strategy); crate::DeepMerge::merge_from(&mut self.webhook_client_config, other.webhook_client_config); } diff --git a/src/v1_20/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/custom_resource_definition_names.rs b/src/v1_20/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/custom_resource_definition_names.rs index 9d4c789f42..dea8cc4418 100644 --- a/src/v1_20/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/custom_resource_definition_names.rs +++ b/src/v1_20/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/custom_resource_definition_names.rs @@ -24,11 +24,11 @@ pub struct CustomResourceDefinitionNames { impl crate::DeepMerge for CustomResourceDefinitionNames { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.categories, other.categories); + crate::merge_strategies::list::atomic(&mut self.categories, other.categories); crate::DeepMerge::merge_from(&mut self.kind, other.kind); crate::DeepMerge::merge_from(&mut self.list_kind, other.list_kind); crate::DeepMerge::merge_from(&mut self.plural, other.plural); - crate::DeepMerge::merge_from(&mut self.short_names, other.short_names); + crate::merge_strategies::list::atomic(&mut self.short_names, other.short_names); crate::DeepMerge::merge_from(&mut self.singular, other.singular); } } diff --git a/src/v1_20/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/custom_resource_definition_spec.rs b/src/v1_20/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/custom_resource_definition_spec.rs index cce6acb1df..851fe5eb77 100644 --- a/src/v1_20/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/custom_resource_definition_spec.rs +++ b/src/v1_20/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/custom_resource_definition_spec.rs @@ -36,7 +36,7 @@ pub struct CustomResourceDefinitionSpec { impl crate::DeepMerge for CustomResourceDefinitionSpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.additional_printer_columns, other.additional_printer_columns); + crate::merge_strategies::list::atomic(&mut self.additional_printer_columns, other.additional_printer_columns); crate::DeepMerge::merge_from(&mut self.conversion, other.conversion); crate::DeepMerge::merge_from(&mut self.group, other.group); crate::DeepMerge::merge_from(&mut self.names, other.names); @@ -45,7 +45,7 @@ impl crate::DeepMerge for CustomResourceDefinitionSpec { crate::DeepMerge::merge_from(&mut self.subresources, other.subresources); crate::DeepMerge::merge_from(&mut self.validation, other.validation); crate::DeepMerge::merge_from(&mut self.version, other.version); - crate::DeepMerge::merge_from(&mut self.versions, other.versions); + crate::merge_strategies::list::atomic(&mut self.versions, other.versions); } } diff --git a/src/v1_20/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/custom_resource_definition_status.rs b/src/v1_20/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/custom_resource_definition_status.rs index e1b4a437e1..d4c5b34301 100644 --- a/src/v1_20/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/custom_resource_definition_status.rs +++ b/src/v1_20/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/custom_resource_definition_status.rs @@ -16,8 +16,8 @@ pub struct CustomResourceDefinitionStatus { impl crate::DeepMerge for CustomResourceDefinitionStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.accepted_names, other.accepted_names); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); - crate::DeepMerge::merge_from(&mut self.stored_versions, other.stored_versions); + crate::merge_strategies::list::atomic(&mut self.conditions, other.conditions); + crate::merge_strategies::list::atomic(&mut self.stored_versions, other.stored_versions); } } diff --git a/src/v1_20/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/custom_resource_definition_version.rs b/src/v1_20/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/custom_resource_definition_version.rs index 77a776540d..2c2a84b5fc 100644 --- a/src/v1_20/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/custom_resource_definition_version.rs +++ b/src/v1_20/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/custom_resource_definition_version.rs @@ -30,7 +30,7 @@ pub struct CustomResourceDefinitionVersion { impl crate::DeepMerge for CustomResourceDefinitionVersion { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.additional_printer_columns, other.additional_printer_columns); + crate::merge_strategies::list::atomic(&mut self.additional_printer_columns, other.additional_printer_columns); crate::DeepMerge::merge_from(&mut self.deprecated, other.deprecated); crate::DeepMerge::merge_from(&mut self.deprecation_warning, other.deprecation_warning); crate::DeepMerge::merge_from(&mut self.name, other.name); diff --git a/src/v1_20/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/json_schema_props.rs b/src/v1_20/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/json_schema_props.rs index 15059ae615..7fee4a6b35 100644 --- a/src/v1_20/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/json_schema_props.rs +++ b/src/v1_20/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/json_schema_props.rs @@ -139,13 +139,17 @@ impl crate::DeepMerge for JSONSchemaProps { crate::DeepMerge::merge_from(&mut self.schema, other.schema); crate::DeepMerge::merge_from(&mut self.additional_items, other.additional_items); crate::DeepMerge::merge_from(&mut self.additional_properties, other.additional_properties); - crate::DeepMerge::merge_from(&mut self.all_of, other.all_of); - crate::DeepMerge::merge_from(&mut self.any_of, other.any_of); + crate::merge_strategies::list::atomic(&mut self.all_of, other.all_of); + crate::merge_strategies::list::atomic(&mut self.any_of, other.any_of); crate::DeepMerge::merge_from(&mut self.default, other.default); - crate::DeepMerge::merge_from(&mut self.definitions, other.definitions); - crate::DeepMerge::merge_from(&mut self.dependencies, other.dependencies); + crate::merge_strategies::map::granular(&mut self.definitions, other.definitions, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.dependencies, other.dependencies, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.description, other.description); - crate::DeepMerge::merge_from(&mut self.enum_, other.enum_); + crate::merge_strategies::list::atomic(&mut self.enum_, other.enum_); crate::DeepMerge::merge_from(&mut self.example, other.example); crate::DeepMerge::merge_from(&mut self.exclusive_maximum, other.exclusive_maximum); crate::DeepMerge::merge_from(&mut self.exclusive_minimum, other.exclusive_minimum); @@ -164,17 +168,21 @@ impl crate::DeepMerge for JSONSchemaProps { crate::DeepMerge::merge_from(&mut self.multiple_of, other.multiple_of); crate::DeepMerge::merge_from(&mut self.not, other.not); crate::DeepMerge::merge_from(&mut self.nullable, other.nullable); - crate::DeepMerge::merge_from(&mut self.one_of, other.one_of); + crate::merge_strategies::list::atomic(&mut self.one_of, other.one_of); crate::DeepMerge::merge_from(&mut self.pattern, other.pattern); - crate::DeepMerge::merge_from(&mut self.pattern_properties, other.pattern_properties); - crate::DeepMerge::merge_from(&mut self.properties, other.properties); - crate::DeepMerge::merge_from(&mut self.required, other.required); + crate::merge_strategies::map::granular(&mut self.pattern_properties, other.pattern_properties, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.properties, other.properties, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::list::atomic(&mut self.required, other.required); crate::DeepMerge::merge_from(&mut self.title, other.title); crate::DeepMerge::merge_from(&mut self.type_, other.type_); crate::DeepMerge::merge_from(&mut self.unique_items, other.unique_items); crate::DeepMerge::merge_from(&mut self.x_kubernetes_embedded_resource, other.x_kubernetes_embedded_resource); crate::DeepMerge::merge_from(&mut self.x_kubernetes_int_or_string, other.x_kubernetes_int_or_string); - crate::DeepMerge::merge_from(&mut self.x_kubernetes_list_map_keys, other.x_kubernetes_list_map_keys); + crate::merge_strategies::list::atomic(&mut self.x_kubernetes_list_map_keys, other.x_kubernetes_list_map_keys); crate::DeepMerge::merge_from(&mut self.x_kubernetes_list_type, other.x_kubernetes_list_type); crate::DeepMerge::merge_from(&mut self.x_kubernetes_map_type, other.x_kubernetes_map_type); crate::DeepMerge::merge_from(&mut self.x_kubernetes_preserve_unknown_fields, other.x_kubernetes_preserve_unknown_fields); diff --git a/src/v1_20/apimachinery/pkg/apis/meta/v1/api_group.rs b/src/v1_20/apimachinery/pkg/apis/meta/v1/api_group.rs index 3d36440e87..f83318ab08 100644 --- a/src/v1_20/apimachinery/pkg/apis/meta/v1/api_group.rs +++ b/src/v1_20/apimachinery/pkg/apis/meta/v1/api_group.rs @@ -29,8 +29,8 @@ impl crate::DeepMerge for APIGroup { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.name, other.name); crate::DeepMerge::merge_from(&mut self.preferred_version, other.preferred_version); - crate::DeepMerge::merge_from(&mut self.server_address_by_client_cidrs, other.server_address_by_client_cidrs); - crate::DeepMerge::merge_from(&mut self.versions, other.versions); + crate::merge_strategies::list::atomic(&mut self.server_address_by_client_cidrs, other.server_address_by_client_cidrs); + crate::merge_strategies::list::atomic(&mut self.versions, other.versions); } } diff --git a/src/v1_20/apimachinery/pkg/apis/meta/v1/api_group_list.rs b/src/v1_20/apimachinery/pkg/apis/meta/v1/api_group_list.rs index 167aeeabe0..e8a5d7e747 100644 --- a/src/v1_20/apimachinery/pkg/apis/meta/v1/api_group_list.rs +++ b/src/v1_20/apimachinery/pkg/apis/meta/v1/api_group_list.rs @@ -18,7 +18,7 @@ impl crate::Resource for APIGroupList { impl crate::DeepMerge for APIGroupList { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.groups, other.groups); + crate::merge_strategies::list::atomic(&mut self.groups, other.groups); } } diff --git a/src/v1_20/apimachinery/pkg/apis/meta/v1/api_resource.rs b/src/v1_20/apimachinery/pkg/apis/meta/v1/api_resource.rs index e679e8aa73..477c5ad98d 100644 --- a/src/v1_20/apimachinery/pkg/apis/meta/v1/api_resource.rs +++ b/src/v1_20/apimachinery/pkg/apis/meta/v1/api_resource.rs @@ -36,15 +36,15 @@ pub struct APIResource { impl crate::DeepMerge for APIResource { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.categories, other.categories); + crate::merge_strategies::list::atomic(&mut self.categories, other.categories); crate::DeepMerge::merge_from(&mut self.group, other.group); crate::DeepMerge::merge_from(&mut self.kind, other.kind); crate::DeepMerge::merge_from(&mut self.name, other.name); crate::DeepMerge::merge_from(&mut self.namespaced, other.namespaced); - crate::DeepMerge::merge_from(&mut self.short_names, other.short_names); + crate::merge_strategies::list::atomic(&mut self.short_names, other.short_names); crate::DeepMerge::merge_from(&mut self.singular_name, other.singular_name); crate::DeepMerge::merge_from(&mut self.storage_version_hash, other.storage_version_hash); - crate::DeepMerge::merge_from(&mut self.verbs, other.verbs); + crate::merge_strategies::list::atomic(&mut self.verbs, other.verbs); crate::DeepMerge::merge_from(&mut self.version, other.version); } } diff --git a/src/v1_20/apimachinery/pkg/apis/meta/v1/api_resource_list.rs b/src/v1_20/apimachinery/pkg/apis/meta/v1/api_resource_list.rs index a34ba733a3..4107b4f488 100644 --- a/src/v1_20/apimachinery/pkg/apis/meta/v1/api_resource_list.rs +++ b/src/v1_20/apimachinery/pkg/apis/meta/v1/api_resource_list.rs @@ -22,7 +22,7 @@ impl crate::Resource for APIResourceList { impl crate::DeepMerge for APIResourceList { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.group_version, other.group_version); - crate::DeepMerge::merge_from(&mut self.resources, other.resources); + crate::merge_strategies::list::atomic(&mut self.resources, other.resources); } } diff --git a/src/v1_20/apimachinery/pkg/apis/meta/v1/api_versions.rs b/src/v1_20/apimachinery/pkg/apis/meta/v1/api_versions.rs index a2d355ee8d..eda4a89785 100644 --- a/src/v1_20/apimachinery/pkg/apis/meta/v1/api_versions.rs +++ b/src/v1_20/apimachinery/pkg/apis/meta/v1/api_versions.rs @@ -21,8 +21,8 @@ impl crate::Resource for APIVersions { impl crate::DeepMerge for APIVersions { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.server_address_by_client_cidrs, other.server_address_by_client_cidrs); - crate::DeepMerge::merge_from(&mut self.versions, other.versions); + crate::merge_strategies::list::atomic(&mut self.server_address_by_client_cidrs, other.server_address_by_client_cidrs); + crate::merge_strategies::list::atomic(&mut self.versions, other.versions); } } diff --git a/src/v1_20/apimachinery/pkg/apis/meta/v1/delete_options.rs b/src/v1_20/apimachinery/pkg/apis/meta/v1/delete_options.rs index 04abc8215b..4ac6d24fb9 100644 --- a/src/v1_20/apimachinery/pkg/apis/meta/v1/delete_options.rs +++ b/src/v1_20/apimachinery/pkg/apis/meta/v1/delete_options.rs @@ -28,7 +28,7 @@ pub struct DeleteOptions { impl crate::DeepMerge for DeleteOptions { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.api_version, other.api_version); - crate::DeepMerge::merge_from(&mut self.dry_run, other.dry_run); + crate::merge_strategies::list::atomic(&mut self.dry_run, other.dry_run); crate::DeepMerge::merge_from(&mut self.grace_period_seconds, other.grace_period_seconds); crate::DeepMerge::merge_from(&mut self.kind, other.kind); crate::DeepMerge::merge_from(&mut self.orphan_dependents, other.orphan_dependents); diff --git a/src/v1_20/apimachinery/pkg/apis/meta/v1/label_selector.rs b/src/v1_20/apimachinery/pkg/apis/meta/v1/label_selector.rs index 877caad4dd..19028abb99 100644 --- a/src/v1_20/apimachinery/pkg/apis/meta/v1/label_selector.rs +++ b/src/v1_20/apimachinery/pkg/apis/meta/v1/label_selector.rs @@ -12,8 +12,10 @@ pub struct LabelSelector { impl crate::DeepMerge for LabelSelector { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.match_expressions, other.match_expressions); - crate::DeepMerge::merge_from(&mut self.match_labels, other.match_labels); + crate::merge_strategies::list::atomic(&mut self.match_expressions, other.match_expressions); + crate::merge_strategies::map::granular(&mut self.match_labels, other.match_labels, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); } } diff --git a/src/v1_20/apimachinery/pkg/apis/meta/v1/label_selector_requirement.rs b/src/v1_20/apimachinery/pkg/apis/meta/v1/label_selector_requirement.rs index 6570daea42..09c7dc7cc7 100644 --- a/src/v1_20/apimachinery/pkg/apis/meta/v1/label_selector_requirement.rs +++ b/src/v1_20/apimachinery/pkg/apis/meta/v1/label_selector_requirement.rs @@ -17,7 +17,7 @@ impl crate::DeepMerge for LabelSelectorRequirement { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.key, other.key); crate::DeepMerge::merge_from(&mut self.operator, other.operator); - crate::DeepMerge::merge_from(&mut self.values, other.values); + crate::merge_strategies::list::atomic(&mut self.values, other.values); } } 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..b1d8a3ec0d 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 @@ -70,19 +70,30 @@ pub struct ObjectMeta { impl crate::DeepMerge for ObjectMeta { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.annotations, other.annotations); + crate::merge_strategies::map::granular(&mut self.annotations, other.annotations, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); 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::merge_strategies::list::set(&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::merge_strategies::map::granular(&mut self.labels, other.labels, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::list::atomic(&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::merge_strategies::list::map( + &mut self.owner_references, + other.owner_references, + &[|lhs, rhs| lhs.uid == rhs.uid], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); 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); diff --git a/src/v1_20/apimachinery/pkg/apis/meta/v1/status_details.rs b/src/v1_20/apimachinery/pkg/apis/meta/v1/status_details.rs index 183b525d2c..28141f7f6f 100644 --- a/src/v1_20/apimachinery/pkg/apis/meta/v1/status_details.rs +++ b/src/v1_20/apimachinery/pkg/apis/meta/v1/status_details.rs @@ -24,7 +24,7 @@ pub struct StatusDetails { impl crate::DeepMerge for StatusDetails { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.causes, other.causes); + crate::merge_strategies::list::atomic(&mut self.causes, other.causes); crate::DeepMerge::merge_from(&mut self.group, other.group); crate::DeepMerge::merge_from(&mut self.kind, other.kind); crate::DeepMerge::merge_from(&mut self.name, other.name); diff --git a/src/v1_20/kube_aggregator/pkg/apis/apiregistration/v1/api_service_status.rs b/src/v1_20/kube_aggregator/pkg/apis/apiregistration/v1/api_service_status.rs index 658b6ca9ce..72a107b6ba 100644 --- a/src/v1_20/kube_aggregator/pkg/apis/apiregistration/v1/api_service_status.rs +++ b/src/v1_20/kube_aggregator/pkg/apis/apiregistration/v1/api_service_status.rs @@ -9,7 +9,14 @@ pub struct APIServiceStatus { impl crate::DeepMerge for APIServiceStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_20/kube_aggregator/pkg/apis/apiregistration/v1beta1/api_service_status.rs b/src/v1_20/kube_aggregator/pkg/apis/apiregistration/v1beta1/api_service_status.rs index df107a8667..f9830edaf5 100644 --- a/src/v1_20/kube_aggregator/pkg/apis/apiregistration/v1beta1/api_service_status.rs +++ b/src/v1_20/kube_aggregator/pkg/apis/apiregistration/v1beta1/api_service_status.rs @@ -9,7 +9,14 @@ pub struct APIServiceStatus { impl crate::DeepMerge for APIServiceStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_20/list.rs b/src/v1_20/list.rs index cc10bf672f..9863ef1855 100644 --- a/src/v1_20/list.rs +++ b/src/v1_20/list.rs @@ -31,9 +31,16 @@ impl crate::Metadata for List where T: crate::ListableResource { } } -impl crate::DeepMerge for List where T: crate::ListableResource { +impl crate::DeepMerge for List where T: crate::DeepMerge + crate::Metadata + crate::ListableResource { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.items, other.items); + crate::merge_strategies::list::map( + &mut self.items, + other.items, + &[|lhs, rhs| lhs.metadata().namespace == rhs.metadata().namespace, |lhs, rhs| lhs.metadata().name == rhs.metadata().name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); } } diff --git a/src/v1_21/api/admissionregistration/v1/mutating_webhook.rs b/src/v1_21/api/admissionregistration/v1/mutating_webhook.rs index 5b1a4d833f..783200c537 100644 --- a/src/v1_21/api/admissionregistration/v1/mutating_webhook.rs +++ b/src/v1_21/api/admissionregistration/v1/mutating_webhook.rs @@ -81,7 +81,7 @@ pub struct MutatingWebhook { impl crate::DeepMerge for MutatingWebhook { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.admission_review_versions, other.admission_review_versions); + crate::merge_strategies::list::atomic(&mut self.admission_review_versions, other.admission_review_versions); crate::DeepMerge::merge_from(&mut self.client_config, other.client_config); crate::DeepMerge::merge_from(&mut self.failure_policy, other.failure_policy); crate::DeepMerge::merge_from(&mut self.match_policy, other.match_policy); @@ -89,7 +89,7 @@ impl crate::DeepMerge for MutatingWebhook { crate::DeepMerge::merge_from(&mut self.namespace_selector, other.namespace_selector); crate::DeepMerge::merge_from(&mut self.object_selector, other.object_selector); crate::DeepMerge::merge_from(&mut self.reinvocation_policy, other.reinvocation_policy); - crate::DeepMerge::merge_from(&mut self.rules, other.rules); + crate::merge_strategies::list::atomic(&mut self.rules, other.rules); crate::DeepMerge::merge_from(&mut self.side_effects, other.side_effects); crate::DeepMerge::merge_from(&mut self.timeout_seconds, other.timeout_seconds); } 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..156c7ccfcf 100644 --- a/src/v1_21/api/admissionregistration/v1/mutating_webhook_configuration.rs +++ b/src/v1_21/api/admissionregistration/v1/mutating_webhook_configuration.rs @@ -374,7 +374,14 @@ impl crate::Metadata for MutatingWebhookConfiguration { impl crate::DeepMerge for MutatingWebhookConfiguration { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.webhooks, other.webhooks); + crate::merge_strategies::list::map( + &mut self.webhooks, + other.webhooks, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_21/api/admissionregistration/v1/rule_with_operations.rs b/src/v1_21/api/admissionregistration/v1/rule_with_operations.rs index c45c425c57..441b9ab3fd 100644 --- a/src/v1_21/api/admissionregistration/v1/rule_with_operations.rs +++ b/src/v1_21/api/admissionregistration/v1/rule_with_operations.rs @@ -27,10 +27,10 @@ pub struct RuleWithOperations { impl crate::DeepMerge for RuleWithOperations { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.api_groups, other.api_groups); - crate::DeepMerge::merge_from(&mut self.api_versions, other.api_versions); - crate::DeepMerge::merge_from(&mut self.operations, other.operations); - crate::DeepMerge::merge_from(&mut self.resources, other.resources); + crate::merge_strategies::list::atomic(&mut self.api_groups, other.api_groups); + crate::merge_strategies::list::atomic(&mut self.api_versions, other.api_versions); + crate::merge_strategies::list::atomic(&mut self.operations, other.operations); + crate::merge_strategies::list::atomic(&mut self.resources, other.resources); crate::DeepMerge::merge_from(&mut self.scope, other.scope); } } diff --git a/src/v1_21/api/admissionregistration/v1/validating_webhook.rs b/src/v1_21/api/admissionregistration/v1/validating_webhook.rs index 1a64d4e885..e594176265 100644 --- a/src/v1_21/api/admissionregistration/v1/validating_webhook.rs +++ b/src/v1_21/api/admissionregistration/v1/validating_webhook.rs @@ -72,14 +72,14 @@ pub struct ValidatingWebhook { impl crate::DeepMerge for ValidatingWebhook { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.admission_review_versions, other.admission_review_versions); + crate::merge_strategies::list::atomic(&mut self.admission_review_versions, other.admission_review_versions); crate::DeepMerge::merge_from(&mut self.client_config, other.client_config); crate::DeepMerge::merge_from(&mut self.failure_policy, other.failure_policy); crate::DeepMerge::merge_from(&mut self.match_policy, other.match_policy); crate::DeepMerge::merge_from(&mut self.name, other.name); crate::DeepMerge::merge_from(&mut self.namespace_selector, other.namespace_selector); crate::DeepMerge::merge_from(&mut self.object_selector, other.object_selector); - crate::DeepMerge::merge_from(&mut self.rules, other.rules); + crate::merge_strategies::list::atomic(&mut self.rules, other.rules); crate::DeepMerge::merge_from(&mut self.side_effects, other.side_effects); crate::DeepMerge::merge_from(&mut self.timeout_seconds, other.timeout_seconds); } 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..ff20990424 100644 --- a/src/v1_21/api/admissionregistration/v1/validating_webhook_configuration.rs +++ b/src/v1_21/api/admissionregistration/v1/validating_webhook_configuration.rs @@ -374,7 +374,14 @@ impl crate::Metadata for ValidatingWebhookConfiguration { impl crate::DeepMerge for ValidatingWebhookConfiguration { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.webhooks, other.webhooks); + crate::merge_strategies::list::map( + &mut self.webhooks, + other.webhooks, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_21/api/admissionregistration/v1beta1/mutating_webhook.rs b/src/v1_21/api/admissionregistration/v1beta1/mutating_webhook.rs index aeb43aa104..b1c13ffcec 100644 --- a/src/v1_21/api/admissionregistration/v1beta1/mutating_webhook.rs +++ b/src/v1_21/api/admissionregistration/v1beta1/mutating_webhook.rs @@ -81,7 +81,7 @@ pub struct MutatingWebhook { impl crate::DeepMerge for MutatingWebhook { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.admission_review_versions, other.admission_review_versions); + crate::merge_strategies::list::atomic(&mut self.admission_review_versions, other.admission_review_versions); crate::DeepMerge::merge_from(&mut self.client_config, other.client_config); crate::DeepMerge::merge_from(&mut self.failure_policy, other.failure_policy); crate::DeepMerge::merge_from(&mut self.match_policy, other.match_policy); @@ -89,7 +89,7 @@ impl crate::DeepMerge for MutatingWebhook { crate::DeepMerge::merge_from(&mut self.namespace_selector, other.namespace_selector); crate::DeepMerge::merge_from(&mut self.object_selector, other.object_selector); crate::DeepMerge::merge_from(&mut self.reinvocation_policy, other.reinvocation_policy); - crate::DeepMerge::merge_from(&mut self.rules, other.rules); + crate::merge_strategies::list::atomic(&mut self.rules, other.rules); crate::DeepMerge::merge_from(&mut self.side_effects, other.side_effects); crate::DeepMerge::merge_from(&mut self.timeout_seconds, other.timeout_seconds); } 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..52e2009675 100644 --- a/src/v1_21/api/admissionregistration/v1beta1/mutating_webhook_configuration.rs +++ b/src/v1_21/api/admissionregistration/v1beta1/mutating_webhook_configuration.rs @@ -374,7 +374,14 @@ impl crate::Metadata for MutatingWebhookConfiguration { impl crate::DeepMerge for MutatingWebhookConfiguration { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.webhooks, other.webhooks); + crate::merge_strategies::list::map( + &mut self.webhooks, + other.webhooks, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_21/api/admissionregistration/v1beta1/rule_with_operations.rs b/src/v1_21/api/admissionregistration/v1beta1/rule_with_operations.rs index 8b7e74b583..d6fa7b4157 100644 --- a/src/v1_21/api/admissionregistration/v1beta1/rule_with_operations.rs +++ b/src/v1_21/api/admissionregistration/v1beta1/rule_with_operations.rs @@ -27,10 +27,10 @@ pub struct RuleWithOperations { impl crate::DeepMerge for RuleWithOperations { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.api_groups, other.api_groups); - crate::DeepMerge::merge_from(&mut self.api_versions, other.api_versions); - crate::DeepMerge::merge_from(&mut self.operations, other.operations); - crate::DeepMerge::merge_from(&mut self.resources, other.resources); + crate::merge_strategies::list::atomic(&mut self.api_groups, other.api_groups); + crate::merge_strategies::list::atomic(&mut self.api_versions, other.api_versions); + crate::merge_strategies::list::atomic(&mut self.operations, other.operations); + crate::merge_strategies::list::atomic(&mut self.resources, other.resources); crate::DeepMerge::merge_from(&mut self.scope, other.scope); } } diff --git a/src/v1_21/api/admissionregistration/v1beta1/validating_webhook.rs b/src/v1_21/api/admissionregistration/v1beta1/validating_webhook.rs index a1d2244b41..9bcf564800 100644 --- a/src/v1_21/api/admissionregistration/v1beta1/validating_webhook.rs +++ b/src/v1_21/api/admissionregistration/v1beta1/validating_webhook.rs @@ -72,14 +72,14 @@ pub struct ValidatingWebhook { impl crate::DeepMerge for ValidatingWebhook { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.admission_review_versions, other.admission_review_versions); + crate::merge_strategies::list::atomic(&mut self.admission_review_versions, other.admission_review_versions); crate::DeepMerge::merge_from(&mut self.client_config, other.client_config); crate::DeepMerge::merge_from(&mut self.failure_policy, other.failure_policy); crate::DeepMerge::merge_from(&mut self.match_policy, other.match_policy); crate::DeepMerge::merge_from(&mut self.name, other.name); crate::DeepMerge::merge_from(&mut self.namespace_selector, other.namespace_selector); crate::DeepMerge::merge_from(&mut self.object_selector, other.object_selector); - crate::DeepMerge::merge_from(&mut self.rules, other.rules); + crate::merge_strategies::list::atomic(&mut self.rules, other.rules); crate::DeepMerge::merge_from(&mut self.side_effects, other.side_effects); crate::DeepMerge::merge_from(&mut self.timeout_seconds, other.timeout_seconds); } 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..6e7cf12141 100644 --- a/src/v1_21/api/admissionregistration/v1beta1/validating_webhook_configuration.rs +++ b/src/v1_21/api/admissionregistration/v1beta1/validating_webhook_configuration.rs @@ -374,7 +374,14 @@ impl crate::Metadata for ValidatingWebhookConfiguration { impl crate::DeepMerge for ValidatingWebhookConfiguration { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.webhooks, other.webhooks); + crate::merge_strategies::list::map( + &mut self.webhooks, + other.webhooks, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_21/api/apiserverinternal/v1alpha1/server_storage_version.rs b/src/v1_21/api/apiserverinternal/v1alpha1/server_storage_version.rs index 1040b5e6d7..5a693d9e59 100644 --- a/src/v1_21/api/apiserverinternal/v1alpha1/server_storage_version.rs +++ b/src/v1_21/api/apiserverinternal/v1alpha1/server_storage_version.rs @@ -16,7 +16,7 @@ pub struct ServerStorageVersion { impl crate::DeepMerge for ServerStorageVersion { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.api_server_id, other.api_server_id); - crate::DeepMerge::merge_from(&mut self.decodable_versions, other.decodable_versions); + crate::merge_strategies::list::set(&mut self.decodable_versions, other.decodable_versions); crate::DeepMerge::merge_from(&mut self.encoding_version, other.encoding_version); } } diff --git a/src/v1_21/api/apiserverinternal/v1alpha1/storage_version_status.rs b/src/v1_21/api/apiserverinternal/v1alpha1/storage_version_status.rs index e63b469644..0d5b9bd3a1 100644 --- a/src/v1_21/api/apiserverinternal/v1alpha1/storage_version_status.rs +++ b/src/v1_21/api/apiserverinternal/v1alpha1/storage_version_status.rs @@ -16,8 +16,22 @@ pub struct StorageVersionStatus { impl crate::DeepMerge for StorageVersionStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.common_encoding_version, other.common_encoding_version); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); - crate::DeepMerge::merge_from(&mut self.storage_versions, other.storage_versions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::list::map( + &mut self.storage_versions, + other.storage_versions, + &[|lhs, rhs| lhs.api_server_id == rhs.api_server_id], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_21/api/apps/v1/daemon_set_status.rs b/src/v1_21/api/apps/v1/daemon_set_status.rs index 42df0deaa3..9d2564a3a3 100644 --- a/src/v1_21/api/apps/v1/daemon_set_status.rs +++ b/src/v1_21/api/apps/v1/daemon_set_status.rs @@ -37,7 +37,14 @@ pub struct DaemonSetStatus { impl crate::DeepMerge for DaemonSetStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.collision_count, other.collision_count); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.current_number_scheduled, other.current_number_scheduled); crate::DeepMerge::merge_from(&mut self.desired_number_scheduled, other.desired_number_scheduled); crate::DeepMerge::merge_from(&mut self.number_available, other.number_available); diff --git a/src/v1_21/api/apps/v1/deployment_status.rs b/src/v1_21/api/apps/v1/deployment_status.rs index 0eb14f47b4..c277884099 100644 --- a/src/v1_21/api/apps/v1/deployment_status.rs +++ b/src/v1_21/api/apps/v1/deployment_status.rs @@ -32,7 +32,14 @@ impl crate::DeepMerge for DeploymentStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.available_replicas, other.available_replicas); crate::DeepMerge::merge_from(&mut self.collision_count, other.collision_count); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.observed_generation, other.observed_generation); crate::DeepMerge::merge_from(&mut self.ready_replicas, other.ready_replicas); crate::DeepMerge::merge_from(&mut self.replicas, other.replicas); diff --git a/src/v1_21/api/apps/v1/replica_set_status.rs b/src/v1_21/api/apps/v1/replica_set_status.rs index 5873b11fdc..60d7e94dce 100644 --- a/src/v1_21/api/apps/v1/replica_set_status.rs +++ b/src/v1_21/api/apps/v1/replica_set_status.rs @@ -25,7 +25,14 @@ pub struct ReplicaSetStatus { impl crate::DeepMerge for ReplicaSetStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.available_replicas, other.available_replicas); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.fully_labeled_replicas, other.fully_labeled_replicas); crate::DeepMerge::merge_from(&mut self.observed_generation, other.observed_generation); crate::DeepMerge::merge_from(&mut self.ready_replicas, other.ready_replicas); diff --git a/src/v1_21/api/apps/v1/stateful_set_spec.rs b/src/v1_21/api/apps/v1/stateful_set_spec.rs index b5fe3f7c8f..f03d03124d 100644 --- a/src/v1_21/api/apps/v1/stateful_set_spec.rs +++ b/src/v1_21/api/apps/v1/stateful_set_spec.rs @@ -37,7 +37,7 @@ impl crate::DeepMerge for StatefulSetSpec { crate::DeepMerge::merge_from(&mut self.service_name, other.service_name); crate::DeepMerge::merge_from(&mut self.template, other.template); crate::DeepMerge::merge_from(&mut self.update_strategy, other.update_strategy); - crate::DeepMerge::merge_from(&mut self.volume_claim_templates, other.volume_claim_templates); + crate::merge_strategies::list::atomic(&mut self.volume_claim_templates, other.volume_claim_templates); } } diff --git a/src/v1_21/api/apps/v1/stateful_set_status.rs b/src/v1_21/api/apps/v1/stateful_set_status.rs index 516c495837..267eeba550 100644 --- a/src/v1_21/api/apps/v1/stateful_set_status.rs +++ b/src/v1_21/api/apps/v1/stateful_set_status.rs @@ -34,7 +34,14 @@ pub struct StatefulSetStatus { impl crate::DeepMerge for StatefulSetStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.collision_count, other.collision_count); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.current_replicas, other.current_replicas); crate::DeepMerge::merge_from(&mut self.current_revision, other.current_revision); crate::DeepMerge::merge_from(&mut self.observed_generation, other.observed_generation); diff --git a/src/v1_21/api/authentication/v1/token_request_spec.rs b/src/v1_21/api/authentication/v1/token_request_spec.rs index 4ec786f381..f10197a68c 100644 --- a/src/v1_21/api/authentication/v1/token_request_spec.rs +++ b/src/v1_21/api/authentication/v1/token_request_spec.rs @@ -15,7 +15,7 @@ pub struct TokenRequestSpec { impl crate::DeepMerge for TokenRequestSpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.audiences, other.audiences); + crate::merge_strategies::list::atomic(&mut self.audiences, other.audiences); crate::DeepMerge::merge_from(&mut self.bound_object_ref, other.bound_object_ref); crate::DeepMerge::merge_from(&mut self.expiration_seconds, other.expiration_seconds); } diff --git a/src/v1_21/api/authentication/v1/token_review_spec.rs b/src/v1_21/api/authentication/v1/token_review_spec.rs index fd84653924..281127b67d 100644 --- a/src/v1_21/api/authentication/v1/token_review_spec.rs +++ b/src/v1_21/api/authentication/v1/token_review_spec.rs @@ -12,7 +12,7 @@ pub struct TokenReviewSpec { impl crate::DeepMerge for TokenReviewSpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.audiences, other.audiences); + crate::merge_strategies::list::atomic(&mut self.audiences, other.audiences); crate::DeepMerge::merge_from(&mut self.token, other.token); } } diff --git a/src/v1_21/api/authentication/v1/token_review_status.rs b/src/v1_21/api/authentication/v1/token_review_status.rs index 464164bcf9..4dd5aacc3d 100644 --- a/src/v1_21/api/authentication/v1/token_review_status.rs +++ b/src/v1_21/api/authentication/v1/token_review_status.rs @@ -18,7 +18,7 @@ pub struct TokenReviewStatus { impl crate::DeepMerge for TokenReviewStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.audiences, other.audiences); + crate::merge_strategies::list::atomic(&mut self.audiences, other.audiences); crate::DeepMerge::merge_from(&mut self.authenticated, other.authenticated); crate::DeepMerge::merge_from(&mut self.error, other.error); crate::DeepMerge::merge_from(&mut self.user, other.user); diff --git a/src/v1_21/api/authentication/v1/user_info.rs b/src/v1_21/api/authentication/v1/user_info.rs index d6890119b7..3890788cda 100644 --- a/src/v1_21/api/authentication/v1/user_info.rs +++ b/src/v1_21/api/authentication/v1/user_info.rs @@ -18,8 +18,10 @@ pub struct UserInfo { impl crate::DeepMerge for UserInfo { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.extra, other.extra); - crate::DeepMerge::merge_from(&mut self.groups, other.groups); + crate::merge_strategies::map::granular(&mut self.extra, other.extra, |current_item, other_item| { + crate::merge_strategies::list::atomic(current_item, other_item); + }); + crate::merge_strategies::list::atomic(&mut self.groups, other.groups); crate::DeepMerge::merge_from(&mut self.uid, other.uid); crate::DeepMerge::merge_from(&mut self.username, other.username); } diff --git a/src/v1_21/api/authentication/v1beta1/token_review_spec.rs b/src/v1_21/api/authentication/v1beta1/token_review_spec.rs index f593603070..29b8fcdf67 100644 --- a/src/v1_21/api/authentication/v1beta1/token_review_spec.rs +++ b/src/v1_21/api/authentication/v1beta1/token_review_spec.rs @@ -12,7 +12,7 @@ pub struct TokenReviewSpec { impl crate::DeepMerge for TokenReviewSpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.audiences, other.audiences); + crate::merge_strategies::list::atomic(&mut self.audiences, other.audiences); crate::DeepMerge::merge_from(&mut self.token, other.token); } } diff --git a/src/v1_21/api/authentication/v1beta1/token_review_status.rs b/src/v1_21/api/authentication/v1beta1/token_review_status.rs index 16a21814be..536d772e90 100644 --- a/src/v1_21/api/authentication/v1beta1/token_review_status.rs +++ b/src/v1_21/api/authentication/v1beta1/token_review_status.rs @@ -18,7 +18,7 @@ pub struct TokenReviewStatus { impl crate::DeepMerge for TokenReviewStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.audiences, other.audiences); + crate::merge_strategies::list::atomic(&mut self.audiences, other.audiences); crate::DeepMerge::merge_from(&mut self.authenticated, other.authenticated); crate::DeepMerge::merge_from(&mut self.error, other.error); crate::DeepMerge::merge_from(&mut self.user, other.user); diff --git a/src/v1_21/api/authentication/v1beta1/user_info.rs b/src/v1_21/api/authentication/v1beta1/user_info.rs index 532cfc4699..72ce2a1d57 100644 --- a/src/v1_21/api/authentication/v1beta1/user_info.rs +++ b/src/v1_21/api/authentication/v1beta1/user_info.rs @@ -18,8 +18,10 @@ pub struct UserInfo { impl crate::DeepMerge for UserInfo { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.extra, other.extra); - crate::DeepMerge::merge_from(&mut self.groups, other.groups); + crate::merge_strategies::map::granular(&mut self.extra, other.extra, |current_item, other_item| { + crate::merge_strategies::list::atomic(current_item, other_item); + }); + crate::merge_strategies::list::atomic(&mut self.groups, other.groups); crate::DeepMerge::merge_from(&mut self.uid, other.uid); crate::DeepMerge::merge_from(&mut self.username, other.username); } diff --git a/src/v1_21/api/authorization/v1/non_resource_rule.rs b/src/v1_21/api/authorization/v1/non_resource_rule.rs index 7df269ffd7..db780454b8 100644 --- a/src/v1_21/api/authorization/v1/non_resource_rule.rs +++ b/src/v1_21/api/authorization/v1/non_resource_rule.rs @@ -12,8 +12,8 @@ pub struct NonResourceRule { impl crate::DeepMerge for NonResourceRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.non_resource_urls, other.non_resource_urls); - crate::DeepMerge::merge_from(&mut self.verbs, other.verbs); + crate::merge_strategies::list::atomic(&mut self.non_resource_urls, other.non_resource_urls); + crate::merge_strategies::list::atomic(&mut self.verbs, other.verbs); } } diff --git a/src/v1_21/api/authorization/v1/resource_rule.rs b/src/v1_21/api/authorization/v1/resource_rule.rs index 58b5e020a8..1af9333654 100644 --- a/src/v1_21/api/authorization/v1/resource_rule.rs +++ b/src/v1_21/api/authorization/v1/resource_rule.rs @@ -19,10 +19,10 @@ pub struct ResourceRule { impl crate::DeepMerge for ResourceRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.api_groups, other.api_groups); - crate::DeepMerge::merge_from(&mut self.resource_names, other.resource_names); - crate::DeepMerge::merge_from(&mut self.resources, other.resources); - crate::DeepMerge::merge_from(&mut self.verbs, other.verbs); + crate::merge_strategies::list::atomic(&mut self.api_groups, other.api_groups); + crate::merge_strategies::list::atomic(&mut self.resource_names, other.resource_names); + crate::merge_strategies::list::atomic(&mut self.resources, other.resources); + crate::merge_strategies::list::atomic(&mut self.verbs, other.verbs); } } diff --git a/src/v1_21/api/authorization/v1/subject_access_review_spec.rs b/src/v1_21/api/authorization/v1/subject_access_review_spec.rs index ae8fadafd9..a4c4af18ce 100644 --- a/src/v1_21/api/authorization/v1/subject_access_review_spec.rs +++ b/src/v1_21/api/authorization/v1/subject_access_review_spec.rs @@ -24,8 +24,10 @@ pub struct SubjectAccessReviewSpec { impl crate::DeepMerge for SubjectAccessReviewSpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.extra, other.extra); - crate::DeepMerge::merge_from(&mut self.groups, other.groups); + crate::merge_strategies::map::granular(&mut self.extra, other.extra, |current_item, other_item| { + crate::merge_strategies::list::atomic(current_item, other_item); + }); + crate::merge_strategies::list::atomic(&mut self.groups, other.groups); crate::DeepMerge::merge_from(&mut self.non_resource_attributes, other.non_resource_attributes); crate::DeepMerge::merge_from(&mut self.resource_attributes, other.resource_attributes); crate::DeepMerge::merge_from(&mut self.uid, other.uid); diff --git a/src/v1_21/api/authorization/v1/subject_rules_review_status.rs b/src/v1_21/api/authorization/v1/subject_rules_review_status.rs index 9d7fb042cf..9d1682a3c8 100644 --- a/src/v1_21/api/authorization/v1/subject_rules_review_status.rs +++ b/src/v1_21/api/authorization/v1/subject_rules_review_status.rs @@ -20,8 +20,8 @@ impl crate::DeepMerge for SubjectRulesReviewStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.evaluation_error, other.evaluation_error); crate::DeepMerge::merge_from(&mut self.incomplete, other.incomplete); - crate::DeepMerge::merge_from(&mut self.non_resource_rules, other.non_resource_rules); - crate::DeepMerge::merge_from(&mut self.resource_rules, other.resource_rules); + crate::merge_strategies::list::atomic(&mut self.non_resource_rules, other.non_resource_rules); + crate::merge_strategies::list::atomic(&mut self.resource_rules, other.resource_rules); } } diff --git a/src/v1_21/api/authorization/v1beta1/non_resource_rule.rs b/src/v1_21/api/authorization/v1beta1/non_resource_rule.rs index 101a985df1..d437d92b78 100644 --- a/src/v1_21/api/authorization/v1beta1/non_resource_rule.rs +++ b/src/v1_21/api/authorization/v1beta1/non_resource_rule.rs @@ -12,8 +12,8 @@ pub struct NonResourceRule { impl crate::DeepMerge for NonResourceRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.non_resource_urls, other.non_resource_urls); - crate::DeepMerge::merge_from(&mut self.verbs, other.verbs); + crate::merge_strategies::list::atomic(&mut self.non_resource_urls, other.non_resource_urls); + crate::merge_strategies::list::atomic(&mut self.verbs, other.verbs); } } diff --git a/src/v1_21/api/authorization/v1beta1/resource_rule.rs b/src/v1_21/api/authorization/v1beta1/resource_rule.rs index cb6a8ce89d..64eb336fc1 100644 --- a/src/v1_21/api/authorization/v1beta1/resource_rule.rs +++ b/src/v1_21/api/authorization/v1beta1/resource_rule.rs @@ -19,10 +19,10 @@ pub struct ResourceRule { impl crate::DeepMerge for ResourceRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.api_groups, other.api_groups); - crate::DeepMerge::merge_from(&mut self.resource_names, other.resource_names); - crate::DeepMerge::merge_from(&mut self.resources, other.resources); - crate::DeepMerge::merge_from(&mut self.verbs, other.verbs); + crate::merge_strategies::list::atomic(&mut self.api_groups, other.api_groups); + crate::merge_strategies::list::atomic(&mut self.resource_names, other.resource_names); + crate::merge_strategies::list::atomic(&mut self.resources, other.resources); + crate::merge_strategies::list::atomic(&mut self.verbs, other.verbs); } } diff --git a/src/v1_21/api/authorization/v1beta1/subject_access_review_spec.rs b/src/v1_21/api/authorization/v1beta1/subject_access_review_spec.rs index 60ec1ae2f7..26f0124880 100644 --- a/src/v1_21/api/authorization/v1beta1/subject_access_review_spec.rs +++ b/src/v1_21/api/authorization/v1beta1/subject_access_review_spec.rs @@ -24,8 +24,10 @@ pub struct SubjectAccessReviewSpec { impl crate::DeepMerge for SubjectAccessReviewSpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.extra, other.extra); - crate::DeepMerge::merge_from(&mut self.group, other.group); + crate::merge_strategies::map::granular(&mut self.extra, other.extra, |current_item, other_item| { + crate::merge_strategies::list::atomic(current_item, other_item); + }); + crate::merge_strategies::list::atomic(&mut self.group, other.group); crate::DeepMerge::merge_from(&mut self.non_resource_attributes, other.non_resource_attributes); crate::DeepMerge::merge_from(&mut self.resource_attributes, other.resource_attributes); crate::DeepMerge::merge_from(&mut self.uid, other.uid); diff --git a/src/v1_21/api/authorization/v1beta1/subject_rules_review_status.rs b/src/v1_21/api/authorization/v1beta1/subject_rules_review_status.rs index 229f6e0f41..2174973d32 100644 --- a/src/v1_21/api/authorization/v1beta1/subject_rules_review_status.rs +++ b/src/v1_21/api/authorization/v1beta1/subject_rules_review_status.rs @@ -20,8 +20,8 @@ impl crate::DeepMerge for SubjectRulesReviewStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.evaluation_error, other.evaluation_error); crate::DeepMerge::merge_from(&mut self.incomplete, other.incomplete); - crate::DeepMerge::merge_from(&mut self.non_resource_rules, other.non_resource_rules); - crate::DeepMerge::merge_from(&mut self.resource_rules, other.resource_rules); + crate::merge_strategies::list::atomic(&mut self.non_resource_rules, other.non_resource_rules); + crate::merge_strategies::list::atomic(&mut self.resource_rules, other.resource_rules); } } diff --git a/src/v1_21/api/autoscaling/v2beta1/horizontal_pod_autoscaler_spec.rs b/src/v1_21/api/autoscaling/v2beta1/horizontal_pod_autoscaler_spec.rs index dd2649f83e..c286723a24 100644 --- a/src/v1_21/api/autoscaling/v2beta1/horizontal_pod_autoscaler_spec.rs +++ b/src/v1_21/api/autoscaling/v2beta1/horizontal_pod_autoscaler_spec.rs @@ -19,7 +19,7 @@ pub struct HorizontalPodAutoscalerSpec { impl crate::DeepMerge for HorizontalPodAutoscalerSpec { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.max_replicas, other.max_replicas); - crate::DeepMerge::merge_from(&mut self.metrics, other.metrics); + crate::merge_strategies::list::atomic(&mut self.metrics, other.metrics); crate::DeepMerge::merge_from(&mut self.min_replicas, other.min_replicas); crate::DeepMerge::merge_from(&mut self.scale_target_ref, other.scale_target_ref); } diff --git a/src/v1_21/api/autoscaling/v2beta1/horizontal_pod_autoscaler_status.rs b/src/v1_21/api/autoscaling/v2beta1/horizontal_pod_autoscaler_status.rs index f626003266..a4dc183a7f 100644 --- a/src/v1_21/api/autoscaling/v2beta1/horizontal_pod_autoscaler_status.rs +++ b/src/v1_21/api/autoscaling/v2beta1/horizontal_pod_autoscaler_status.rs @@ -24,8 +24,8 @@ pub struct HorizontalPodAutoscalerStatus { impl crate::DeepMerge for HorizontalPodAutoscalerStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); - crate::DeepMerge::merge_from(&mut self.current_metrics, other.current_metrics); + crate::merge_strategies::list::atomic(&mut self.conditions, other.conditions); + crate::merge_strategies::list::atomic(&mut self.current_metrics, other.current_metrics); crate::DeepMerge::merge_from(&mut self.current_replicas, other.current_replicas); crate::DeepMerge::merge_from(&mut self.desired_replicas, other.desired_replicas); crate::DeepMerge::merge_from(&mut self.last_scale_time, other.last_scale_time); diff --git a/src/v1_21/api/autoscaling/v2beta2/horizontal_pod_autoscaler_spec.rs b/src/v1_21/api/autoscaling/v2beta2/horizontal_pod_autoscaler_spec.rs index c529e49162..681cf9c99b 100644 --- a/src/v1_21/api/autoscaling/v2beta2/horizontal_pod_autoscaler_spec.rs +++ b/src/v1_21/api/autoscaling/v2beta2/horizontal_pod_autoscaler_spec.rs @@ -23,7 +23,7 @@ impl crate::DeepMerge for HorizontalPodAutoscalerSpec { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.behavior, other.behavior); crate::DeepMerge::merge_from(&mut self.max_replicas, other.max_replicas); - crate::DeepMerge::merge_from(&mut self.metrics, other.metrics); + crate::merge_strategies::list::atomic(&mut self.metrics, other.metrics); crate::DeepMerge::merge_from(&mut self.min_replicas, other.min_replicas); crate::DeepMerge::merge_from(&mut self.scale_target_ref, other.scale_target_ref); } diff --git a/src/v1_21/api/autoscaling/v2beta2/horizontal_pod_autoscaler_status.rs b/src/v1_21/api/autoscaling/v2beta2/horizontal_pod_autoscaler_status.rs index ee1cef4668..1c3f421d0e 100644 --- a/src/v1_21/api/autoscaling/v2beta2/horizontal_pod_autoscaler_status.rs +++ b/src/v1_21/api/autoscaling/v2beta2/horizontal_pod_autoscaler_status.rs @@ -24,8 +24,8 @@ pub struct HorizontalPodAutoscalerStatus { impl crate::DeepMerge for HorizontalPodAutoscalerStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); - crate::DeepMerge::merge_from(&mut self.current_metrics, other.current_metrics); + crate::merge_strategies::list::atomic(&mut self.conditions, other.conditions); + crate::merge_strategies::list::atomic(&mut self.current_metrics, other.current_metrics); crate::DeepMerge::merge_from(&mut self.current_replicas, other.current_replicas); crate::DeepMerge::merge_from(&mut self.desired_replicas, other.desired_replicas); crate::DeepMerge::merge_from(&mut self.last_scale_time, other.last_scale_time); diff --git a/src/v1_21/api/autoscaling/v2beta2/hpa_scaling_rules.rs b/src/v1_21/api/autoscaling/v2beta2/hpa_scaling_rules.rs index 3b62f0dd91..fde69f31c4 100644 --- a/src/v1_21/api/autoscaling/v2beta2/hpa_scaling_rules.rs +++ b/src/v1_21/api/autoscaling/v2beta2/hpa_scaling_rules.rs @@ -15,7 +15,7 @@ pub struct HPAScalingRules { impl crate::DeepMerge for HPAScalingRules { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.policies, other.policies); + crate::merge_strategies::list::atomic(&mut self.policies, other.policies); crate::DeepMerge::merge_from(&mut self.select_policy, other.select_policy); crate::DeepMerge::merge_from(&mut self.stabilization_window_seconds, other.stabilization_window_seconds); } diff --git a/src/v1_21/api/batch/v1/cron_job_status.rs b/src/v1_21/api/batch/v1/cron_job_status.rs index cbd83e8fcd..c0f24458eb 100644 --- a/src/v1_21/api/batch/v1/cron_job_status.rs +++ b/src/v1_21/api/batch/v1/cron_job_status.rs @@ -15,7 +15,7 @@ pub struct CronJobStatus { impl crate::DeepMerge for CronJobStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.active, other.active); + crate::merge_strategies::list::atomic(&mut self.active, other.active); crate::DeepMerge::merge_from(&mut self.last_schedule_time, other.last_schedule_time); crate::DeepMerge::merge_from(&mut self.last_successful_time, other.last_successful_time); } diff --git a/src/v1_21/api/batch/v1/job_status.rs b/src/v1_21/api/batch/v1/job_status.rs index 781229cc87..1a6d90e6dd 100644 --- a/src/v1_21/api/batch/v1/job_status.rs +++ b/src/v1_21/api/batch/v1/job_status.rs @@ -30,7 +30,14 @@ impl crate::DeepMerge for JobStatus { crate::DeepMerge::merge_from(&mut self.active, other.active); crate::DeepMerge::merge_from(&mut self.completed_indexes, other.completed_indexes); crate::DeepMerge::merge_from(&mut self.completion_time, other.completion_time); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.failed, other.failed); crate::DeepMerge::merge_from(&mut self.start_time, other.start_time); crate::DeepMerge::merge_from(&mut self.succeeded, other.succeeded); diff --git a/src/v1_21/api/batch/v1beta1/cron_job_status.rs b/src/v1_21/api/batch/v1beta1/cron_job_status.rs index 3e8851f77d..3498f7cd58 100644 --- a/src/v1_21/api/batch/v1beta1/cron_job_status.rs +++ b/src/v1_21/api/batch/v1beta1/cron_job_status.rs @@ -15,7 +15,7 @@ pub struct CronJobStatus { impl crate::DeepMerge for CronJobStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.active, other.active); + crate::merge_strategies::list::atomic(&mut self.active, other.active); crate::DeepMerge::merge_from(&mut self.last_schedule_time, other.last_schedule_time); crate::DeepMerge::merge_from(&mut self.last_successful_time, other.last_successful_time); } diff --git a/src/v1_21/api/certificates/v1/certificate_signing_request_spec.rs b/src/v1_21/api/certificates/v1/certificate_signing_request_spec.rs index 5dbb08bbac..567f830059 100644 --- a/src/v1_21/api/certificates/v1/certificate_signing_request_spec.rs +++ b/src/v1_21/api/certificates/v1/certificate_signing_request_spec.rs @@ -60,12 +60,14 @@ pub struct CertificateSigningRequestSpec { impl crate::DeepMerge for CertificateSigningRequestSpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.extra, other.extra); - crate::DeepMerge::merge_from(&mut self.groups, other.groups); + crate::merge_strategies::map::granular(&mut self.extra, other.extra, |current_item, other_item| { + crate::merge_strategies::list::atomic(current_item, other_item); + }); + crate::merge_strategies::list::atomic(&mut self.groups, other.groups); crate::DeepMerge::merge_from(&mut self.request, other.request); crate::DeepMerge::merge_from(&mut self.signer_name, other.signer_name); crate::DeepMerge::merge_from(&mut self.uid, other.uid); - crate::DeepMerge::merge_from(&mut self.usages, other.usages); + crate::merge_strategies::list::atomic(&mut self.usages, other.usages); crate::DeepMerge::merge_from(&mut self.username, other.username); } } diff --git a/src/v1_21/api/certificates/v1/certificate_signing_request_status.rs b/src/v1_21/api/certificates/v1/certificate_signing_request_status.rs index 81fb876580..d17c51933f 100644 --- a/src/v1_21/api/certificates/v1/certificate_signing_request_status.rs +++ b/src/v1_21/api/certificates/v1/certificate_signing_request_status.rs @@ -34,7 +34,14 @@ pub struct CertificateSigningRequestStatus { impl crate::DeepMerge for CertificateSigningRequestStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.certificate, other.certificate); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_21/api/certificates/v1beta1/certificate_signing_request_spec.rs b/src/v1_21/api/certificates/v1beta1/certificate_signing_request_spec.rs index 22f937550e..33f83c4f29 100644 --- a/src/v1_21/api/certificates/v1beta1/certificate_signing_request_spec.rs +++ b/src/v1_21/api/certificates/v1beta1/certificate_signing_request_spec.rs @@ -58,12 +58,14 @@ pub struct CertificateSigningRequestSpec { impl crate::DeepMerge for CertificateSigningRequestSpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.extra, other.extra); - crate::DeepMerge::merge_from(&mut self.groups, other.groups); + crate::merge_strategies::map::granular(&mut self.extra, other.extra, |current_item, other_item| { + crate::merge_strategies::list::atomic(current_item, other_item); + }); + crate::merge_strategies::list::atomic(&mut self.groups, other.groups); crate::DeepMerge::merge_from(&mut self.request, other.request); crate::DeepMerge::merge_from(&mut self.signer_name, other.signer_name); crate::DeepMerge::merge_from(&mut self.uid, other.uid); - crate::DeepMerge::merge_from(&mut self.usages, other.usages); + crate::merge_strategies::list::atomic(&mut self.usages, other.usages); crate::DeepMerge::merge_from(&mut self.username, other.username); } } diff --git a/src/v1_21/api/certificates/v1beta1/certificate_signing_request_status.rs b/src/v1_21/api/certificates/v1beta1/certificate_signing_request_status.rs index b7686fa483..1204917e51 100644 --- a/src/v1_21/api/certificates/v1beta1/certificate_signing_request_status.rs +++ b/src/v1_21/api/certificates/v1beta1/certificate_signing_request_status.rs @@ -12,7 +12,14 @@ pub struct CertificateSigningRequestStatus { impl crate::DeepMerge for CertificateSigningRequestStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.certificate, other.certificate); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_21/api/core/v1/capabilities.rs b/src/v1_21/api/core/v1/capabilities.rs index 6045e4f5d2..1a260b5256 100644 --- a/src/v1_21/api/core/v1/capabilities.rs +++ b/src/v1_21/api/core/v1/capabilities.rs @@ -12,8 +12,8 @@ pub struct Capabilities { impl crate::DeepMerge for Capabilities { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.add, other.add); - crate::DeepMerge::merge_from(&mut self.drop, other.drop); + crate::merge_strategies::list::atomic(&mut self.add, other.add); + crate::merge_strategies::list::atomic(&mut self.drop, other.drop); } } diff --git a/src/v1_21/api/core/v1/ceph_fs_persistent_volume_source.rs b/src/v1_21/api/core/v1/ceph_fs_persistent_volume_source.rs index 5db02966fd..708ee7615e 100644 --- a/src/v1_21/api/core/v1/ceph_fs_persistent_volume_source.rs +++ b/src/v1_21/api/core/v1/ceph_fs_persistent_volume_source.rs @@ -24,7 +24,7 @@ pub struct CephFSPersistentVolumeSource { impl crate::DeepMerge for CephFSPersistentVolumeSource { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.monitors, other.monitors); + crate::merge_strategies::list::atomic(&mut self.monitors, other.monitors); crate::DeepMerge::merge_from(&mut self.path, other.path); crate::DeepMerge::merge_from(&mut self.read_only, other.read_only); crate::DeepMerge::merge_from(&mut self.secret_file, other.secret_file); diff --git a/src/v1_21/api/core/v1/ceph_fs_volume_source.rs b/src/v1_21/api/core/v1/ceph_fs_volume_source.rs index 1be27ee35c..689608de39 100644 --- a/src/v1_21/api/core/v1/ceph_fs_volume_source.rs +++ b/src/v1_21/api/core/v1/ceph_fs_volume_source.rs @@ -24,7 +24,7 @@ pub struct CephFSVolumeSource { impl crate::DeepMerge for CephFSVolumeSource { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.monitors, other.monitors); + crate::merge_strategies::list::atomic(&mut self.monitors, other.monitors); crate::DeepMerge::merge_from(&mut self.path, other.path); crate::DeepMerge::merge_from(&mut self.read_only, other.read_only); crate::DeepMerge::merge_from(&mut self.secret_file, other.secret_file); diff --git a/src/v1_21/api/core/v1/component_status.rs b/src/v1_21/api/core/v1/component_status.rs index ecddf82170..50e55665e4 100644 --- a/src/v1_21/api/core/v1/component_status.rs +++ b/src/v1_21/api/core/v1/component_status.rs @@ -172,7 +172,14 @@ impl crate::Metadata for ComponentStatus { impl crate::DeepMerge for ComponentStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); } } diff --git a/src/v1_21/api/core/v1/config_map.rs b/src/v1_21/api/core/v1/config_map.rs index 361b45a3a1..7d07e59a99 100644 --- a/src/v1_21/api/core/v1/config_map.rs +++ b/src/v1_21/api/core/v1/config_map.rs @@ -495,8 +495,12 @@ impl crate::Metadata for ConfigMap { impl crate::DeepMerge for ConfigMap { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.binary_data, other.binary_data); - crate::DeepMerge::merge_from(&mut self.data, other.data); + crate::merge_strategies::map::granular(&mut self.binary_data, other.binary_data, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.data, other.data, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.immutable, other.immutable); crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); } diff --git a/src/v1_21/api/core/v1/config_map_projection.rs b/src/v1_21/api/core/v1/config_map_projection.rs index 458f277bb3..e2a94bc391 100644 --- a/src/v1_21/api/core/v1/config_map_projection.rs +++ b/src/v1_21/api/core/v1/config_map_projection.rs @@ -17,7 +17,7 @@ pub struct ConfigMapProjection { impl crate::DeepMerge for ConfigMapProjection { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.items, other.items); + crate::merge_strategies::list::atomic(&mut self.items, other.items); crate::DeepMerge::merge_from(&mut self.name, other.name); crate::DeepMerge::merge_from(&mut self.optional, other.optional); } diff --git a/src/v1_21/api/core/v1/config_map_volume_source.rs b/src/v1_21/api/core/v1/config_map_volume_source.rs index 915b10bdcd..b612fcb857 100644 --- a/src/v1_21/api/core/v1/config_map_volume_source.rs +++ b/src/v1_21/api/core/v1/config_map_volume_source.rs @@ -21,7 +21,7 @@ pub struct ConfigMapVolumeSource { impl crate::DeepMerge for ConfigMapVolumeSource { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.default_mode, other.default_mode); - crate::DeepMerge::merge_from(&mut self.items, other.items); + crate::merge_strategies::list::atomic(&mut self.items, other.items); crate::DeepMerge::merge_from(&mut self.name, other.name); crate::DeepMerge::merge_from(&mut self.optional, other.optional); } diff --git a/src/v1_21/api/core/v1/container.rs b/src/v1_21/api/core/v1/container.rs index c479975b78..a5c46b7eda 100644 --- a/src/v1_21/api/core/v1/container.rs +++ b/src/v1_21/api/core/v1/container.rs @@ -72,16 +72,30 @@ pub struct Container { impl crate::DeepMerge for Container { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.args, other.args); - crate::DeepMerge::merge_from(&mut self.command, other.command); - crate::DeepMerge::merge_from(&mut self.env, other.env); - crate::DeepMerge::merge_from(&mut self.env_from, other.env_from); + crate::merge_strategies::list::atomic(&mut self.args, other.args); + crate::merge_strategies::list::atomic(&mut self.command, other.command); + crate::merge_strategies::list::map( + &mut self.env, + other.env, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::list::atomic(&mut self.env_from, other.env_from); crate::DeepMerge::merge_from(&mut self.image, other.image); crate::DeepMerge::merge_from(&mut self.image_pull_policy, other.image_pull_policy); crate::DeepMerge::merge_from(&mut self.lifecycle, other.lifecycle); crate::DeepMerge::merge_from(&mut self.liveness_probe, other.liveness_probe); crate::DeepMerge::merge_from(&mut self.name, other.name); - crate::DeepMerge::merge_from(&mut self.ports, other.ports); + crate::merge_strategies::list::map( + &mut self.ports, + other.ports, + &[|lhs, rhs| lhs.container_port == rhs.container_port], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.readiness_probe, other.readiness_probe); crate::DeepMerge::merge_from(&mut self.resources, other.resources); crate::DeepMerge::merge_from(&mut self.security_context, other.security_context); @@ -91,8 +105,22 @@ impl crate::DeepMerge for Container { crate::DeepMerge::merge_from(&mut self.termination_message_path, other.termination_message_path); crate::DeepMerge::merge_from(&mut self.termination_message_policy, other.termination_message_policy); crate::DeepMerge::merge_from(&mut self.tty, other.tty); - crate::DeepMerge::merge_from(&mut self.volume_devices, other.volume_devices); - crate::DeepMerge::merge_from(&mut self.volume_mounts, other.volume_mounts); + crate::merge_strategies::list::map( + &mut self.volume_devices, + other.volume_devices, + &[|lhs, rhs| lhs.device_path == rhs.device_path], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::list::map( + &mut self.volume_mounts, + other.volume_mounts, + &[|lhs, rhs| lhs.mount_path == rhs.mount_path], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.working_dir, other.working_dir); } } diff --git a/src/v1_21/api/core/v1/container_image.rs b/src/v1_21/api/core/v1/container_image.rs index 697ef4906e..871033f834 100644 --- a/src/v1_21/api/core/v1/container_image.rs +++ b/src/v1_21/api/core/v1/container_image.rs @@ -12,7 +12,7 @@ pub struct ContainerImage { impl crate::DeepMerge for ContainerImage { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.names, other.names); + crate::merge_strategies::list::atomic(&mut self.names, other.names); crate::DeepMerge::merge_from(&mut self.size_bytes, other.size_bytes); } } diff --git a/src/v1_21/api/core/v1/csi_persistent_volume_source.rs b/src/v1_21/api/core/v1/csi_persistent_volume_source.rs index b8b244ea2b..7d04fa8349 100644 --- a/src/v1_21/api/core/v1/csi_persistent_volume_source.rs +++ b/src/v1_21/api/core/v1/csi_persistent_volume_source.rs @@ -40,7 +40,9 @@ impl crate::DeepMerge for CSIPersistentVolumeSource { crate::DeepMerge::merge_from(&mut self.node_publish_secret_ref, other.node_publish_secret_ref); crate::DeepMerge::merge_from(&mut self.node_stage_secret_ref, other.node_stage_secret_ref); crate::DeepMerge::merge_from(&mut self.read_only, other.read_only); - crate::DeepMerge::merge_from(&mut self.volume_attributes, other.volume_attributes); + crate::merge_strategies::map::granular(&mut self.volume_attributes, other.volume_attributes, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.volume_handle, other.volume_handle); } } diff --git a/src/v1_21/api/core/v1/csi_volume_source.rs b/src/v1_21/api/core/v1/csi_volume_source.rs index e5a311c536..2b2f26aa48 100644 --- a/src/v1_21/api/core/v1/csi_volume_source.rs +++ b/src/v1_21/api/core/v1/csi_volume_source.rs @@ -25,7 +25,9 @@ impl crate::DeepMerge for CSIVolumeSource { crate::DeepMerge::merge_from(&mut self.fs_type, other.fs_type); crate::DeepMerge::merge_from(&mut self.node_publish_secret_ref, other.node_publish_secret_ref); crate::DeepMerge::merge_from(&mut self.read_only, other.read_only); - crate::DeepMerge::merge_from(&mut self.volume_attributes, other.volume_attributes); + crate::merge_strategies::map::granular(&mut self.volume_attributes, other.volume_attributes, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); } } diff --git a/src/v1_21/api/core/v1/downward_api_projection.rs b/src/v1_21/api/core/v1/downward_api_projection.rs index de0fca6185..950e2e5645 100644 --- a/src/v1_21/api/core/v1/downward_api_projection.rs +++ b/src/v1_21/api/core/v1/downward_api_projection.rs @@ -9,7 +9,7 @@ pub struct DownwardAPIProjection { impl crate::DeepMerge for DownwardAPIProjection { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.items, other.items); + crate::merge_strategies::list::atomic(&mut self.items, other.items); } } diff --git a/src/v1_21/api/core/v1/downward_api_volume_source.rs b/src/v1_21/api/core/v1/downward_api_volume_source.rs index 214c15f03f..96b4ebb987 100644 --- a/src/v1_21/api/core/v1/downward_api_volume_source.rs +++ b/src/v1_21/api/core/v1/downward_api_volume_source.rs @@ -13,7 +13,7 @@ pub struct DownwardAPIVolumeSource { impl crate::DeepMerge for DownwardAPIVolumeSource { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.default_mode, other.default_mode); - crate::DeepMerge::merge_from(&mut self.items, other.items); + crate::merge_strategies::list::atomic(&mut self.items, other.items); } } diff --git a/src/v1_21/api/core/v1/endpoint_subset.rs b/src/v1_21/api/core/v1/endpoint_subset.rs index c395596b77..20ca195e97 100644 --- a/src/v1_21/api/core/v1/endpoint_subset.rs +++ b/src/v1_21/api/core/v1/endpoint_subset.rs @@ -22,9 +22,9 @@ pub struct EndpointSubset { impl crate::DeepMerge for EndpointSubset { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.addresses, other.addresses); - crate::DeepMerge::merge_from(&mut self.not_ready_addresses, other.not_ready_addresses); - crate::DeepMerge::merge_from(&mut self.ports, other.ports); + crate::merge_strategies::list::atomic(&mut self.addresses, other.addresses); + crate::merge_strategies::list::atomic(&mut self.not_ready_addresses, other.not_ready_addresses); + crate::merge_strategies::list::atomic(&mut self.ports, other.ports); } } diff --git a/src/v1_21/api/core/v1/endpoints.rs b/src/v1_21/api/core/v1/endpoints.rs index c9b545e04c..7ce1fbc5ba 100644 --- a/src/v1_21/api/core/v1/endpoints.rs +++ b/src/v1_21/api/core/v1/endpoints.rs @@ -501,7 +501,7 @@ impl crate::Metadata for Endpoints { impl crate::DeepMerge for Endpoints { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.subsets, other.subsets); + crate::merge_strategies::list::atomic(&mut self.subsets, other.subsets); } } diff --git a/src/v1_21/api/core/v1/ephemeral_container.rs b/src/v1_21/api/core/v1/ephemeral_container.rs index 0a50a54162..3946cc6727 100644 --- a/src/v1_21/api/core/v1/ephemeral_container.rs +++ b/src/v1_21/api/core/v1/ephemeral_container.rs @@ -75,16 +75,23 @@ pub struct EphemeralContainer { impl crate::DeepMerge for EphemeralContainer { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.args, other.args); - crate::DeepMerge::merge_from(&mut self.command, other.command); - crate::DeepMerge::merge_from(&mut self.env, other.env); - crate::DeepMerge::merge_from(&mut self.env_from, other.env_from); + crate::merge_strategies::list::atomic(&mut self.args, other.args); + crate::merge_strategies::list::atomic(&mut self.command, other.command); + crate::merge_strategies::list::map( + &mut self.env, + other.env, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::list::atomic(&mut self.env_from, other.env_from); crate::DeepMerge::merge_from(&mut self.image, other.image); crate::DeepMerge::merge_from(&mut self.image_pull_policy, other.image_pull_policy); crate::DeepMerge::merge_from(&mut self.lifecycle, other.lifecycle); crate::DeepMerge::merge_from(&mut self.liveness_probe, other.liveness_probe); crate::DeepMerge::merge_from(&mut self.name, other.name); - crate::DeepMerge::merge_from(&mut self.ports, other.ports); + crate::merge_strategies::list::atomic(&mut self.ports, other.ports); crate::DeepMerge::merge_from(&mut self.readiness_probe, other.readiness_probe); crate::DeepMerge::merge_from(&mut self.resources, other.resources); crate::DeepMerge::merge_from(&mut self.security_context, other.security_context); @@ -95,8 +102,22 @@ impl crate::DeepMerge for EphemeralContainer { crate::DeepMerge::merge_from(&mut self.termination_message_path, other.termination_message_path); crate::DeepMerge::merge_from(&mut self.termination_message_policy, other.termination_message_policy); crate::DeepMerge::merge_from(&mut self.tty, other.tty); - crate::DeepMerge::merge_from(&mut self.volume_devices, other.volume_devices); - crate::DeepMerge::merge_from(&mut self.volume_mounts, other.volume_mounts); + crate::merge_strategies::list::map( + &mut self.volume_devices, + other.volume_devices, + &[|lhs, rhs| lhs.device_path == rhs.device_path], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::list::map( + &mut self.volume_mounts, + other.volume_mounts, + &[|lhs, rhs| lhs.mount_path == rhs.mount_path], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.working_dir, other.working_dir); } } diff --git a/src/v1_21/api/core/v1/ephemeral_containers.rs b/src/v1_21/api/core/v1/ephemeral_containers.rs index 1eaeeda13f..1a5a080360 100644 --- a/src/v1_21/api/core/v1/ephemeral_containers.rs +++ b/src/v1_21/api/core/v1/ephemeral_containers.rs @@ -207,7 +207,14 @@ impl crate::Metadata for EphemeralContainers { impl crate::DeepMerge for EphemeralContainers { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.ephemeral_containers, other.ephemeral_containers); + crate::merge_strategies::list::map( + &mut self.ephemeral_containers, + other.ephemeral_containers, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); } } diff --git a/src/v1_21/api/core/v1/exec_action.rs b/src/v1_21/api/core/v1/exec_action.rs index fc5ddd099a..07e888786c 100644 --- a/src/v1_21/api/core/v1/exec_action.rs +++ b/src/v1_21/api/core/v1/exec_action.rs @@ -9,7 +9,7 @@ pub struct ExecAction { impl crate::DeepMerge for ExecAction { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.command, other.command); + crate::merge_strategies::list::atomic(&mut self.command, other.command); } } diff --git a/src/v1_21/api/core/v1/fc_volume_source.rs b/src/v1_21/api/core/v1/fc_volume_source.rs index 932c210a2b..6477ad5ed5 100644 --- a/src/v1_21/api/core/v1/fc_volume_source.rs +++ b/src/v1_21/api/core/v1/fc_volume_source.rs @@ -24,8 +24,8 @@ impl crate::DeepMerge for FCVolumeSource { crate::DeepMerge::merge_from(&mut self.fs_type, other.fs_type); crate::DeepMerge::merge_from(&mut self.lun, other.lun); crate::DeepMerge::merge_from(&mut self.read_only, other.read_only); - crate::DeepMerge::merge_from(&mut self.target_wwns, other.target_wwns); - crate::DeepMerge::merge_from(&mut self.wwids, other.wwids); + crate::merge_strategies::list::atomic(&mut self.target_wwns, other.target_wwns); + crate::merge_strategies::list::atomic(&mut self.wwids, other.wwids); } } diff --git a/src/v1_21/api/core/v1/flex_persistent_volume_source.rs b/src/v1_21/api/core/v1/flex_persistent_volume_source.rs index 76d27f8583..10ebd43c4a 100644 --- a/src/v1_21/api/core/v1/flex_persistent_volume_source.rs +++ b/src/v1_21/api/core/v1/flex_persistent_volume_source.rs @@ -23,7 +23,9 @@ impl crate::DeepMerge for FlexPersistentVolumeSource { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.driver, other.driver); crate::DeepMerge::merge_from(&mut self.fs_type, other.fs_type); - crate::DeepMerge::merge_from(&mut self.options, other.options); + crate::merge_strategies::map::granular(&mut self.options, other.options, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.read_only, other.read_only); crate::DeepMerge::merge_from(&mut self.secret_ref, other.secret_ref); } diff --git a/src/v1_21/api/core/v1/flex_volume_source.rs b/src/v1_21/api/core/v1/flex_volume_source.rs index f9e64fcbf4..6075eadc1f 100644 --- a/src/v1_21/api/core/v1/flex_volume_source.rs +++ b/src/v1_21/api/core/v1/flex_volume_source.rs @@ -23,7 +23,9 @@ impl crate::DeepMerge for FlexVolumeSource { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.driver, other.driver); crate::DeepMerge::merge_from(&mut self.fs_type, other.fs_type); - crate::DeepMerge::merge_from(&mut self.options, other.options); + crate::merge_strategies::map::granular(&mut self.options, other.options, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.read_only, other.read_only); crate::DeepMerge::merge_from(&mut self.secret_ref, other.secret_ref); } diff --git a/src/v1_21/api/core/v1/host_alias.rs b/src/v1_21/api/core/v1/host_alias.rs index 9320f6d9e1..8ea648c7ad 100644 --- a/src/v1_21/api/core/v1/host_alias.rs +++ b/src/v1_21/api/core/v1/host_alias.rs @@ -12,7 +12,7 @@ pub struct HostAlias { impl crate::DeepMerge for HostAlias { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.hostnames, other.hostnames); + crate::merge_strategies::list::atomic(&mut self.hostnames, other.hostnames); crate::DeepMerge::merge_from(&mut self.ip, other.ip); } } diff --git a/src/v1_21/api/core/v1/http_get_action.rs b/src/v1_21/api/core/v1/http_get_action.rs index 6af211ad2c..10257ae1a2 100644 --- a/src/v1_21/api/core/v1/http_get_action.rs +++ b/src/v1_21/api/core/v1/http_get_action.rs @@ -22,7 +22,7 @@ pub struct HTTPGetAction { impl crate::DeepMerge for HTTPGetAction { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.host, other.host); - crate::DeepMerge::merge_from(&mut self.http_headers, other.http_headers); + crate::merge_strategies::list::atomic(&mut self.http_headers, other.http_headers); crate::DeepMerge::merge_from(&mut self.path, other.path); crate::DeepMerge::merge_from(&mut self.port, other.port); crate::DeepMerge::merge_from(&mut self.scheme, other.scheme); diff --git a/src/v1_21/api/core/v1/iscsi_persistent_volume_source.rs b/src/v1_21/api/core/v1/iscsi_persistent_volume_source.rs index 939da3bc50..842c901958 100644 --- a/src/v1_21/api/core/v1/iscsi_persistent_volume_source.rs +++ b/src/v1_21/api/core/v1/iscsi_persistent_volume_source.rs @@ -46,7 +46,7 @@ impl crate::DeepMerge for ISCSIPersistentVolumeSource { crate::DeepMerge::merge_from(&mut self.iqn, other.iqn); crate::DeepMerge::merge_from(&mut self.iscsi_interface, other.iscsi_interface); crate::DeepMerge::merge_from(&mut self.lun, other.lun); - crate::DeepMerge::merge_from(&mut self.portals, other.portals); + crate::merge_strategies::list::atomic(&mut self.portals, other.portals); crate::DeepMerge::merge_from(&mut self.read_only, other.read_only); crate::DeepMerge::merge_from(&mut self.secret_ref, other.secret_ref); crate::DeepMerge::merge_from(&mut self.target_portal, other.target_portal); diff --git a/src/v1_21/api/core/v1/iscsi_volume_source.rs b/src/v1_21/api/core/v1/iscsi_volume_source.rs index 1d75bc85e0..7b8f0324f4 100644 --- a/src/v1_21/api/core/v1/iscsi_volume_source.rs +++ b/src/v1_21/api/core/v1/iscsi_volume_source.rs @@ -46,7 +46,7 @@ impl crate::DeepMerge for ISCSIVolumeSource { crate::DeepMerge::merge_from(&mut self.iqn, other.iqn); crate::DeepMerge::merge_from(&mut self.iscsi_interface, other.iscsi_interface); crate::DeepMerge::merge_from(&mut self.lun, other.lun); - crate::DeepMerge::merge_from(&mut self.portals, other.portals); + crate::merge_strategies::list::atomic(&mut self.portals, other.portals); crate::DeepMerge::merge_from(&mut self.read_only, other.read_only); crate::DeepMerge::merge_from(&mut self.secret_ref, other.secret_ref); crate::DeepMerge::merge_from(&mut self.target_portal, other.target_portal); diff --git a/src/v1_21/api/core/v1/limit_range_item.rs b/src/v1_21/api/core/v1/limit_range_item.rs index 3aada5aaaa..d8431aec87 100644 --- a/src/v1_21/api/core/v1/limit_range_item.rs +++ b/src/v1_21/api/core/v1/limit_range_item.rs @@ -24,11 +24,21 @@ pub struct LimitRangeItem { impl crate::DeepMerge for LimitRangeItem { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.default, other.default); - crate::DeepMerge::merge_from(&mut self.default_request, other.default_request); - crate::DeepMerge::merge_from(&mut self.max, other.max); - crate::DeepMerge::merge_from(&mut self.max_limit_request_ratio, other.max_limit_request_ratio); - crate::DeepMerge::merge_from(&mut self.min, other.min); + crate::merge_strategies::map::granular(&mut self.default, other.default, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.default_request, other.default_request, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.max, other.max, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.max_limit_request_ratio, other.max_limit_request_ratio, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.min, other.min, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.type_, other.type_); } } diff --git a/src/v1_21/api/core/v1/limit_range_spec.rs b/src/v1_21/api/core/v1/limit_range_spec.rs index d3db20e828..14cacbd619 100644 --- a/src/v1_21/api/core/v1/limit_range_spec.rs +++ b/src/v1_21/api/core/v1/limit_range_spec.rs @@ -9,7 +9,7 @@ pub struct LimitRangeSpec { impl crate::DeepMerge for LimitRangeSpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.limits, other.limits); + crate::merge_strategies::list::atomic(&mut self.limits, other.limits); } } diff --git a/src/v1_21/api/core/v1/load_balancer_ingress.rs b/src/v1_21/api/core/v1/load_balancer_ingress.rs index fe804334cf..ffce22ba8b 100644 --- a/src/v1_21/api/core/v1/load_balancer_ingress.rs +++ b/src/v1_21/api/core/v1/load_balancer_ingress.rs @@ -17,7 +17,7 @@ impl crate::DeepMerge for LoadBalancerIngress { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.hostname, other.hostname); crate::DeepMerge::merge_from(&mut self.ip, other.ip); - crate::DeepMerge::merge_from(&mut self.ports, other.ports); + crate::merge_strategies::list::atomic(&mut self.ports, other.ports); } } diff --git a/src/v1_21/api/core/v1/load_balancer_status.rs b/src/v1_21/api/core/v1/load_balancer_status.rs index 46d791f8e1..67379f9e4e 100644 --- a/src/v1_21/api/core/v1/load_balancer_status.rs +++ b/src/v1_21/api/core/v1/load_balancer_status.rs @@ -9,7 +9,7 @@ pub struct LoadBalancerStatus { impl crate::DeepMerge for LoadBalancerStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.ingress, other.ingress); + crate::merge_strategies::list::atomic(&mut self.ingress, other.ingress); } } diff --git a/src/v1_21/api/core/v1/namespace_spec.rs b/src/v1_21/api/core/v1/namespace_spec.rs index 5ae9e5ef2e..cbf697e1e1 100644 --- a/src/v1_21/api/core/v1/namespace_spec.rs +++ b/src/v1_21/api/core/v1/namespace_spec.rs @@ -9,7 +9,7 @@ pub struct NamespaceSpec { impl crate::DeepMerge for NamespaceSpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.finalizers, other.finalizers); + crate::merge_strategies::list::atomic(&mut self.finalizers, other.finalizers); } } diff --git a/src/v1_21/api/core/v1/namespace_status.rs b/src/v1_21/api/core/v1/namespace_status.rs index 71546d290a..cc0ad15316 100644 --- a/src/v1_21/api/core/v1/namespace_status.rs +++ b/src/v1_21/api/core/v1/namespace_status.rs @@ -12,7 +12,14 @@ pub struct NamespaceStatus { impl crate::DeepMerge for NamespaceStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.phase, other.phase); } } diff --git a/src/v1_21/api/core/v1/node_affinity.rs b/src/v1_21/api/core/v1/node_affinity.rs index 2a70de8703..dfd14357a3 100644 --- a/src/v1_21/api/core/v1/node_affinity.rs +++ b/src/v1_21/api/core/v1/node_affinity.rs @@ -12,7 +12,7 @@ pub struct NodeAffinity { impl crate::DeepMerge for NodeAffinity { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.preferred_during_scheduling_ignored_during_execution, other.preferred_during_scheduling_ignored_during_execution); + crate::merge_strategies::list::atomic(&mut self.preferred_during_scheduling_ignored_during_execution, other.preferred_during_scheduling_ignored_during_execution); crate::DeepMerge::merge_from(&mut self.required_during_scheduling_ignored_during_execution, other.required_during_scheduling_ignored_during_execution); } } diff --git a/src/v1_21/api/core/v1/node_selector.rs b/src/v1_21/api/core/v1/node_selector.rs index 5b146c615e..997fba9ef3 100644 --- a/src/v1_21/api/core/v1/node_selector.rs +++ b/src/v1_21/api/core/v1/node_selector.rs @@ -9,7 +9,7 @@ pub struct NodeSelector { impl crate::DeepMerge for NodeSelector { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.node_selector_terms, other.node_selector_terms); + crate::merge_strategies::list::atomic(&mut self.node_selector_terms, other.node_selector_terms); } } diff --git a/src/v1_21/api/core/v1/node_selector_requirement.rs b/src/v1_21/api/core/v1/node_selector_requirement.rs index 4e0a41917c..d360d05de2 100644 --- a/src/v1_21/api/core/v1/node_selector_requirement.rs +++ b/src/v1_21/api/core/v1/node_selector_requirement.rs @@ -17,7 +17,7 @@ impl crate::DeepMerge for NodeSelectorRequirement { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.key, other.key); crate::DeepMerge::merge_from(&mut self.operator, other.operator); - crate::DeepMerge::merge_from(&mut self.values, other.values); + crate::merge_strategies::list::atomic(&mut self.values, other.values); } } diff --git a/src/v1_21/api/core/v1/node_selector_term.rs b/src/v1_21/api/core/v1/node_selector_term.rs index b0d28cc176..1237883670 100644 --- a/src/v1_21/api/core/v1/node_selector_term.rs +++ b/src/v1_21/api/core/v1/node_selector_term.rs @@ -12,8 +12,8 @@ pub struct NodeSelectorTerm { impl crate::DeepMerge for NodeSelectorTerm { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.match_expressions, other.match_expressions); - crate::DeepMerge::merge_from(&mut self.match_fields, other.match_fields); + crate::merge_strategies::list::atomic(&mut self.match_expressions, other.match_expressions); + crate::merge_strategies::list::atomic(&mut self.match_fields, other.match_fields); } } diff --git a/src/v1_21/api/core/v1/node_spec.rs b/src/v1_21/api/core/v1/node_spec.rs index 30387c2eb8..f1193088a6 100644 --- a/src/v1_21/api/core/v1/node_spec.rs +++ b/src/v1_21/api/core/v1/node_spec.rs @@ -30,9 +30,9 @@ impl crate::DeepMerge for NodeSpec { crate::DeepMerge::merge_from(&mut self.config_source, other.config_source); crate::DeepMerge::merge_from(&mut self.external_id, other.external_id); crate::DeepMerge::merge_from(&mut self.pod_cidr, other.pod_cidr); - crate::DeepMerge::merge_from(&mut self.pod_cidrs, other.pod_cidrs); + crate::merge_strategies::list::set(&mut self.pod_cidrs, other.pod_cidrs); crate::DeepMerge::merge_from(&mut self.provider_id, other.provider_id); - crate::DeepMerge::merge_from(&mut self.taints, other.taints); + crate::merge_strategies::list::atomic(&mut self.taints, other.taints); crate::DeepMerge::merge_from(&mut self.unschedulable, other.unschedulable); } } diff --git a/src/v1_21/api/core/v1/node_status.rs b/src/v1_21/api/core/v1/node_status.rs index c15202e84d..7a3fc56d2a 100644 --- a/src/v1_21/api/core/v1/node_status.rs +++ b/src/v1_21/api/core/v1/node_status.rs @@ -39,17 +39,35 @@ pub struct NodeStatus { impl crate::DeepMerge for NodeStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.addresses, other.addresses); - crate::DeepMerge::merge_from(&mut self.allocatable, other.allocatable); - crate::DeepMerge::merge_from(&mut self.capacity, other.capacity); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.addresses, + other.addresses, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::map::granular(&mut self.allocatable, other.allocatable, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.capacity, other.capacity, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.config, other.config); crate::DeepMerge::merge_from(&mut self.daemon_endpoints, other.daemon_endpoints); - crate::DeepMerge::merge_from(&mut self.images, other.images); + crate::merge_strategies::list::atomic(&mut self.images, other.images); crate::DeepMerge::merge_from(&mut self.node_info, other.node_info); crate::DeepMerge::merge_from(&mut self.phase, other.phase); - crate::DeepMerge::merge_from(&mut self.volumes_attached, other.volumes_attached); - crate::DeepMerge::merge_from(&mut self.volumes_in_use, other.volumes_in_use); + crate::merge_strategies::list::atomic(&mut self.volumes_attached, other.volumes_attached); + crate::merge_strategies::list::atomic(&mut self.volumes_in_use, other.volumes_in_use); } } diff --git a/src/v1_21/api/core/v1/persistent_volume_claim_spec.rs b/src/v1_21/api/core/v1/persistent_volume_claim_spec.rs index 41c3b623cb..9d70677b5a 100644 --- a/src/v1_21/api/core/v1/persistent_volume_claim_spec.rs +++ b/src/v1_21/api/core/v1/persistent_volume_claim_spec.rs @@ -27,7 +27,7 @@ pub struct PersistentVolumeClaimSpec { impl crate::DeepMerge for PersistentVolumeClaimSpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.access_modes, other.access_modes); + crate::merge_strategies::list::atomic(&mut self.access_modes, other.access_modes); crate::DeepMerge::merge_from(&mut self.data_source, other.data_source); crate::DeepMerge::merge_from(&mut self.resources, other.resources); crate::DeepMerge::merge_from(&mut self.selector, other.selector); diff --git a/src/v1_21/api/core/v1/persistent_volume_claim_status.rs b/src/v1_21/api/core/v1/persistent_volume_claim_status.rs index 1df895286f..4b2e8adf88 100644 --- a/src/v1_21/api/core/v1/persistent_volume_claim_status.rs +++ b/src/v1_21/api/core/v1/persistent_volume_claim_status.rs @@ -18,9 +18,18 @@ pub struct PersistentVolumeClaimStatus { impl crate::DeepMerge for PersistentVolumeClaimStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.access_modes, other.access_modes); - crate::DeepMerge::merge_from(&mut self.capacity, other.capacity); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::atomic(&mut self.access_modes, other.access_modes); + crate::merge_strategies::map::granular(&mut self.capacity, other.capacity, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.phase, other.phase); } } diff --git a/src/v1_21/api/core/v1/persistent_volume_spec.rs b/src/v1_21/api/core/v1/persistent_volume_spec.rs index 9e4ada4389..63c3cdae68 100644 --- a/src/v1_21/api/core/v1/persistent_volume_spec.rs +++ b/src/v1_21/api/core/v1/persistent_volume_spec.rs @@ -96,11 +96,13 @@ pub struct PersistentVolumeSpec { impl crate::DeepMerge for PersistentVolumeSpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.access_modes, other.access_modes); + crate::merge_strategies::list::atomic(&mut self.access_modes, other.access_modes); crate::DeepMerge::merge_from(&mut self.aws_elastic_block_store, other.aws_elastic_block_store); crate::DeepMerge::merge_from(&mut self.azure_disk, other.azure_disk); crate::DeepMerge::merge_from(&mut self.azure_file, other.azure_file); - crate::DeepMerge::merge_from(&mut self.capacity, other.capacity); + crate::merge_strategies::map::granular(&mut self.capacity, other.capacity, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.cephfs, other.cephfs); crate::DeepMerge::merge_from(&mut self.cinder, other.cinder); crate::DeepMerge::merge_from(&mut self.claim_ref, other.claim_ref); @@ -113,7 +115,7 @@ impl crate::DeepMerge for PersistentVolumeSpec { crate::DeepMerge::merge_from(&mut self.host_path, other.host_path); crate::DeepMerge::merge_from(&mut self.iscsi, other.iscsi); crate::DeepMerge::merge_from(&mut self.local, other.local); - crate::DeepMerge::merge_from(&mut self.mount_options, other.mount_options); + crate::merge_strategies::list::atomic(&mut self.mount_options, other.mount_options); crate::DeepMerge::merge_from(&mut self.nfs, other.nfs); crate::DeepMerge::merge_from(&mut self.node_affinity, other.node_affinity); crate::DeepMerge::merge_from(&mut self.persistent_volume_reclaim_policy, other.persistent_volume_reclaim_policy); diff --git a/src/v1_21/api/core/v1/pod_affinity.rs b/src/v1_21/api/core/v1/pod_affinity.rs index facc781ff6..a528250bbc 100644 --- a/src/v1_21/api/core/v1/pod_affinity.rs +++ b/src/v1_21/api/core/v1/pod_affinity.rs @@ -12,8 +12,8 @@ pub struct PodAffinity { impl crate::DeepMerge for PodAffinity { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.preferred_during_scheduling_ignored_during_execution, other.preferred_during_scheduling_ignored_during_execution); - crate::DeepMerge::merge_from(&mut self.required_during_scheduling_ignored_during_execution, other.required_during_scheduling_ignored_during_execution); + crate::merge_strategies::list::atomic(&mut self.preferred_during_scheduling_ignored_during_execution, other.preferred_during_scheduling_ignored_during_execution); + crate::merge_strategies::list::atomic(&mut self.required_during_scheduling_ignored_during_execution, other.required_during_scheduling_ignored_during_execution); } } diff --git a/src/v1_21/api/core/v1/pod_affinity_term.rs b/src/v1_21/api/core/v1/pod_affinity_term.rs index 1232ed1853..c258de14a5 100644 --- a/src/v1_21/api/core/v1/pod_affinity_term.rs +++ b/src/v1_21/api/core/v1/pod_affinity_term.rs @@ -20,7 +20,7 @@ impl crate::DeepMerge for PodAffinityTerm { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.label_selector, other.label_selector); crate::DeepMerge::merge_from(&mut self.namespace_selector, other.namespace_selector); - crate::DeepMerge::merge_from(&mut self.namespaces, other.namespaces); + crate::merge_strategies::list::atomic(&mut self.namespaces, other.namespaces); crate::DeepMerge::merge_from(&mut self.topology_key, other.topology_key); } } diff --git a/src/v1_21/api/core/v1/pod_anti_affinity.rs b/src/v1_21/api/core/v1/pod_anti_affinity.rs index a6cd6aa584..86979017ac 100644 --- a/src/v1_21/api/core/v1/pod_anti_affinity.rs +++ b/src/v1_21/api/core/v1/pod_anti_affinity.rs @@ -12,8 +12,8 @@ pub struct PodAntiAffinity { impl crate::DeepMerge for PodAntiAffinity { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.preferred_during_scheduling_ignored_during_execution, other.preferred_during_scheduling_ignored_during_execution); - crate::DeepMerge::merge_from(&mut self.required_during_scheduling_ignored_during_execution, other.required_during_scheduling_ignored_during_execution); + crate::merge_strategies::list::atomic(&mut self.preferred_during_scheduling_ignored_during_execution, other.preferred_during_scheduling_ignored_during_execution); + crate::merge_strategies::list::atomic(&mut self.required_during_scheduling_ignored_during_execution, other.required_during_scheduling_ignored_during_execution); } } diff --git a/src/v1_21/api/core/v1/pod_dns_config.rs b/src/v1_21/api/core/v1/pod_dns_config.rs index b79282bb55..201eb4d69c 100644 --- a/src/v1_21/api/core/v1/pod_dns_config.rs +++ b/src/v1_21/api/core/v1/pod_dns_config.rs @@ -15,9 +15,9 @@ pub struct PodDNSConfig { impl crate::DeepMerge for PodDNSConfig { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.nameservers, other.nameservers); - crate::DeepMerge::merge_from(&mut self.options, other.options); - crate::DeepMerge::merge_from(&mut self.searches, other.searches); + crate::merge_strategies::list::atomic(&mut self.nameservers, other.nameservers); + crate::merge_strategies::list::atomic(&mut self.options, other.options); + crate::merge_strategies::list::atomic(&mut self.searches, other.searches); } } diff --git a/src/v1_21/api/core/v1/pod_security_context.rs b/src/v1_21/api/core/v1/pod_security_context.rs index 216148abb8..181672cde7 100644 --- a/src/v1_21/api/core/v1/pod_security_context.rs +++ b/src/v1_21/api/core/v1/pod_security_context.rs @@ -47,8 +47,8 @@ impl crate::DeepMerge for PodSecurityContext { crate::DeepMerge::merge_from(&mut self.run_as_user, other.run_as_user); crate::DeepMerge::merge_from(&mut self.se_linux_options, other.se_linux_options); crate::DeepMerge::merge_from(&mut self.seccomp_profile, other.seccomp_profile); - crate::DeepMerge::merge_from(&mut self.supplemental_groups, other.supplemental_groups); - crate::DeepMerge::merge_from(&mut self.sysctls, other.sysctls); + crate::merge_strategies::list::atomic(&mut self.supplemental_groups, other.supplemental_groups); + crate::merge_strategies::list::atomic(&mut self.sysctls, other.sysctls); crate::DeepMerge::merge_from(&mut self.windows_options, other.windows_options); } } diff --git a/src/v1_21/api/core/v1/pod_spec.rs b/src/v1_21/api/core/v1/pod_spec.rs index 960bfc4cb4..32d718774d 100644 --- a/src/v1_21/api/core/v1/pod_spec.rs +++ b/src/v1_21/api/core/v1/pod_spec.rs @@ -114,25 +114,64 @@ impl crate::DeepMerge for PodSpec { crate::DeepMerge::merge_from(&mut self.active_deadline_seconds, other.active_deadline_seconds); crate::DeepMerge::merge_from(&mut self.affinity, other.affinity); crate::DeepMerge::merge_from(&mut self.automount_service_account_token, other.automount_service_account_token); - crate::DeepMerge::merge_from(&mut self.containers, other.containers); + crate::merge_strategies::list::map( + &mut self.containers, + other.containers, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.dns_config, other.dns_config); crate::DeepMerge::merge_from(&mut self.dns_policy, other.dns_policy); crate::DeepMerge::merge_from(&mut self.enable_service_links, other.enable_service_links); - crate::DeepMerge::merge_from(&mut self.ephemeral_containers, other.ephemeral_containers); - crate::DeepMerge::merge_from(&mut self.host_aliases, other.host_aliases); + crate::merge_strategies::list::map( + &mut self.ephemeral_containers, + other.ephemeral_containers, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::list::map( + &mut self.host_aliases, + other.host_aliases, + &[|lhs, rhs| lhs.ip == rhs.ip], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.host_ipc, other.host_ipc); crate::DeepMerge::merge_from(&mut self.host_network, other.host_network); crate::DeepMerge::merge_from(&mut self.host_pid, other.host_pid); crate::DeepMerge::merge_from(&mut self.hostname, other.hostname); - crate::DeepMerge::merge_from(&mut self.image_pull_secrets, other.image_pull_secrets); - crate::DeepMerge::merge_from(&mut self.init_containers, other.init_containers); + crate::merge_strategies::list::map( + &mut self.image_pull_secrets, + other.image_pull_secrets, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::list::map( + &mut self.init_containers, + other.init_containers, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.node_name, other.node_name); - crate::DeepMerge::merge_from(&mut self.node_selector, other.node_selector); - crate::DeepMerge::merge_from(&mut self.overhead, other.overhead); + crate::merge_strategies::map::granular(&mut self.node_selector, other.node_selector, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.overhead, other.overhead, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.preemption_policy, other.preemption_policy); crate::DeepMerge::merge_from(&mut self.priority, other.priority); crate::DeepMerge::merge_from(&mut self.priority_class_name, other.priority_class_name); - crate::DeepMerge::merge_from(&mut self.readiness_gates, other.readiness_gates); + crate::merge_strategies::list::atomic(&mut self.readiness_gates, other.readiness_gates); crate::DeepMerge::merge_from(&mut self.restart_policy, other.restart_policy); crate::DeepMerge::merge_from(&mut self.runtime_class_name, other.runtime_class_name); crate::DeepMerge::merge_from(&mut self.scheduler_name, other.scheduler_name); @@ -143,9 +182,23 @@ impl crate::DeepMerge for PodSpec { crate::DeepMerge::merge_from(&mut self.share_process_namespace, other.share_process_namespace); crate::DeepMerge::merge_from(&mut self.subdomain, other.subdomain); crate::DeepMerge::merge_from(&mut self.termination_grace_period_seconds, other.termination_grace_period_seconds); - crate::DeepMerge::merge_from(&mut self.tolerations, other.tolerations); - crate::DeepMerge::merge_from(&mut self.topology_spread_constraints, other.topology_spread_constraints); - crate::DeepMerge::merge_from(&mut self.volumes, other.volumes); + crate::merge_strategies::list::atomic(&mut self.tolerations, other.tolerations); + crate::merge_strategies::list::map( + &mut self.topology_spread_constraints, + other.topology_spread_constraints, + &[|lhs, rhs| lhs.topology_key == rhs.topology_key], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::list::map( + &mut self.volumes, + other.volumes, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_21/api/core/v1/pod_status.rs b/src/v1_21/api/core/v1/pod_status.rs index e1bfacf3db..b93586f4d8 100644 --- a/src/v1_21/api/core/v1/pod_status.rs +++ b/src/v1_21/api/core/v1/pod_status.rs @@ -49,16 +49,30 @@ pub struct PodStatus { impl crate::DeepMerge for PodStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); - crate::DeepMerge::merge_from(&mut self.container_statuses, other.container_statuses); - crate::DeepMerge::merge_from(&mut self.ephemeral_container_statuses, other.ephemeral_container_statuses); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::list::atomic(&mut self.container_statuses, other.container_statuses); + crate::merge_strategies::list::atomic(&mut self.ephemeral_container_statuses, other.ephemeral_container_statuses); crate::DeepMerge::merge_from(&mut self.host_ip, other.host_ip); - crate::DeepMerge::merge_from(&mut self.init_container_statuses, other.init_container_statuses); + crate::merge_strategies::list::atomic(&mut self.init_container_statuses, other.init_container_statuses); crate::DeepMerge::merge_from(&mut self.message, other.message); crate::DeepMerge::merge_from(&mut self.nominated_node_name, other.nominated_node_name); crate::DeepMerge::merge_from(&mut self.phase, other.phase); crate::DeepMerge::merge_from(&mut self.pod_ip, other.pod_ip); - crate::DeepMerge::merge_from(&mut self.pod_ips, other.pod_ips); + crate::merge_strategies::list::map( + &mut self.pod_ips, + other.pod_ips, + &[|lhs, rhs| lhs.ip == rhs.ip], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.qos_class, other.qos_class); crate::DeepMerge::merge_from(&mut self.reason, other.reason); crate::DeepMerge::merge_from(&mut self.start_time, other.start_time); diff --git a/src/v1_21/api/core/v1/projected_volume_source.rs b/src/v1_21/api/core/v1/projected_volume_source.rs index 8852dae377..650c07c7dc 100644 --- a/src/v1_21/api/core/v1/projected_volume_source.rs +++ b/src/v1_21/api/core/v1/projected_volume_source.rs @@ -13,7 +13,7 @@ pub struct ProjectedVolumeSource { impl crate::DeepMerge for ProjectedVolumeSource { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.default_mode, other.default_mode); - crate::DeepMerge::merge_from(&mut self.sources, other.sources); + crate::merge_strategies::list::atomic(&mut self.sources, other.sources); } } diff --git a/src/v1_21/api/core/v1/rbd_persistent_volume_source.rs b/src/v1_21/api/core/v1/rbd_persistent_volume_source.rs index 303bf915bc..d94e189fd5 100644 --- a/src/v1_21/api/core/v1/rbd_persistent_volume_source.rs +++ b/src/v1_21/api/core/v1/rbd_persistent_volume_source.rs @@ -33,7 +33,7 @@ impl crate::DeepMerge for RBDPersistentVolumeSource { crate::DeepMerge::merge_from(&mut self.fs_type, other.fs_type); crate::DeepMerge::merge_from(&mut self.image, other.image); crate::DeepMerge::merge_from(&mut self.keyring, other.keyring); - crate::DeepMerge::merge_from(&mut self.monitors, other.monitors); + crate::merge_strategies::list::atomic(&mut self.monitors, other.monitors); crate::DeepMerge::merge_from(&mut self.pool, other.pool); crate::DeepMerge::merge_from(&mut self.read_only, other.read_only); crate::DeepMerge::merge_from(&mut self.secret_ref, other.secret_ref); diff --git a/src/v1_21/api/core/v1/rbd_volume_source.rs b/src/v1_21/api/core/v1/rbd_volume_source.rs index 28d087cae2..c5521eac18 100644 --- a/src/v1_21/api/core/v1/rbd_volume_source.rs +++ b/src/v1_21/api/core/v1/rbd_volume_source.rs @@ -33,7 +33,7 @@ impl crate::DeepMerge for RBDVolumeSource { crate::DeepMerge::merge_from(&mut self.fs_type, other.fs_type); crate::DeepMerge::merge_from(&mut self.image, other.image); crate::DeepMerge::merge_from(&mut self.keyring, other.keyring); - crate::DeepMerge::merge_from(&mut self.monitors, other.monitors); + crate::merge_strategies::list::atomic(&mut self.monitors, other.monitors); crate::DeepMerge::merge_from(&mut self.pool, other.pool); crate::DeepMerge::merge_from(&mut self.read_only, other.read_only); crate::DeepMerge::merge_from(&mut self.secret_ref, other.secret_ref); diff --git a/src/v1_21/api/core/v1/replication_controller_spec.rs b/src/v1_21/api/core/v1/replication_controller_spec.rs index 293546b183..655e1e1eed 100644 --- a/src/v1_21/api/core/v1/replication_controller_spec.rs +++ b/src/v1_21/api/core/v1/replication_controller_spec.rs @@ -20,7 +20,9 @@ impl crate::DeepMerge for ReplicationControllerSpec { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.min_ready_seconds, other.min_ready_seconds); crate::DeepMerge::merge_from(&mut self.replicas, other.replicas); - crate::DeepMerge::merge_from(&mut self.selector, other.selector); + crate::merge_strategies::map::granular(&mut self.selector, other.selector, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.template, other.template); } } diff --git a/src/v1_21/api/core/v1/replication_controller_status.rs b/src/v1_21/api/core/v1/replication_controller_status.rs index d069722747..47ccceaeba 100644 --- a/src/v1_21/api/core/v1/replication_controller_status.rs +++ b/src/v1_21/api/core/v1/replication_controller_status.rs @@ -25,7 +25,14 @@ pub struct ReplicationControllerStatus { impl crate::DeepMerge for ReplicationControllerStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.available_replicas, other.available_replicas); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.fully_labeled_replicas, other.fully_labeled_replicas); crate::DeepMerge::merge_from(&mut self.observed_generation, other.observed_generation); crate::DeepMerge::merge_from(&mut self.ready_replicas, other.ready_replicas); diff --git a/src/v1_21/api/core/v1/resource_quota_spec.rs b/src/v1_21/api/core/v1/resource_quota_spec.rs index fab2b7970d..3468d8e9e0 100644 --- a/src/v1_21/api/core/v1/resource_quota_spec.rs +++ b/src/v1_21/api/core/v1/resource_quota_spec.rs @@ -15,9 +15,11 @@ pub struct ResourceQuotaSpec { impl crate::DeepMerge for ResourceQuotaSpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.hard, other.hard); + crate::merge_strategies::map::granular(&mut self.hard, other.hard, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.scope_selector, other.scope_selector); - crate::DeepMerge::merge_from(&mut self.scopes, other.scopes); + crate::merge_strategies::list::atomic(&mut self.scopes, other.scopes); } } diff --git a/src/v1_21/api/core/v1/resource_quota_status.rs b/src/v1_21/api/core/v1/resource_quota_status.rs index 100f418a69..74ee1efe3c 100644 --- a/src/v1_21/api/core/v1/resource_quota_status.rs +++ b/src/v1_21/api/core/v1/resource_quota_status.rs @@ -12,8 +12,12 @@ pub struct ResourceQuotaStatus { impl crate::DeepMerge for ResourceQuotaStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.hard, other.hard); - crate::DeepMerge::merge_from(&mut self.used, other.used); + crate::merge_strategies::map::granular(&mut self.hard, other.hard, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.used, other.used, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); } } diff --git a/src/v1_21/api/core/v1/resource_requirements.rs b/src/v1_21/api/core/v1/resource_requirements.rs index 816608c415..c3f4b1fd86 100644 --- a/src/v1_21/api/core/v1/resource_requirements.rs +++ b/src/v1_21/api/core/v1/resource_requirements.rs @@ -12,8 +12,12 @@ pub struct ResourceRequirements { impl crate::DeepMerge for ResourceRequirements { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.limits, other.limits); - crate::DeepMerge::merge_from(&mut self.requests, other.requests); + crate::merge_strategies::map::granular(&mut self.limits, other.limits, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.requests, other.requests, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); } } diff --git a/src/v1_21/api/core/v1/scope_selector.rs b/src/v1_21/api/core/v1/scope_selector.rs index 22ef180aeb..23ebdb0612 100644 --- a/src/v1_21/api/core/v1/scope_selector.rs +++ b/src/v1_21/api/core/v1/scope_selector.rs @@ -9,7 +9,7 @@ pub struct ScopeSelector { impl crate::DeepMerge for ScopeSelector { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.match_expressions, other.match_expressions); + crate::merge_strategies::list::atomic(&mut self.match_expressions, other.match_expressions); } } diff --git a/src/v1_21/api/core/v1/scoped_resource_selector_requirement.rs b/src/v1_21/api/core/v1/scoped_resource_selector_requirement.rs index 33c57f11ea..ed818218b2 100644 --- a/src/v1_21/api/core/v1/scoped_resource_selector_requirement.rs +++ b/src/v1_21/api/core/v1/scoped_resource_selector_requirement.rs @@ -17,7 +17,7 @@ impl crate::DeepMerge for ScopedResourceSelectorRequirement { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.operator, other.operator); crate::DeepMerge::merge_from(&mut self.scope_name, other.scope_name); - crate::DeepMerge::merge_from(&mut self.values, other.values); + crate::merge_strategies::list::atomic(&mut self.values, other.values); } } diff --git a/src/v1_21/api/core/v1/secret.rs b/src/v1_21/api/core/v1/secret.rs index 17a5601b57..b94c2afa67 100644 --- a/src/v1_21/api/core/v1/secret.rs +++ b/src/v1_21/api/core/v1/secret.rs @@ -498,10 +498,14 @@ impl crate::Metadata for Secret { impl crate::DeepMerge for Secret { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.data, other.data); + crate::merge_strategies::map::granular(&mut self.data, other.data, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.immutable, other.immutable); crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.string_data, other.string_data); + crate::merge_strategies::map::granular(&mut self.string_data, other.string_data, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.type_, other.type_); } } diff --git a/src/v1_21/api/core/v1/secret_projection.rs b/src/v1_21/api/core/v1/secret_projection.rs index 41277f3645..df50709566 100644 --- a/src/v1_21/api/core/v1/secret_projection.rs +++ b/src/v1_21/api/core/v1/secret_projection.rs @@ -17,7 +17,7 @@ pub struct SecretProjection { impl crate::DeepMerge for SecretProjection { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.items, other.items); + crate::merge_strategies::list::atomic(&mut self.items, other.items); crate::DeepMerge::merge_from(&mut self.name, other.name); crate::DeepMerge::merge_from(&mut self.optional, other.optional); } diff --git a/src/v1_21/api/core/v1/secret_volume_source.rs b/src/v1_21/api/core/v1/secret_volume_source.rs index 6f0de3b8aa..7daa3928bd 100644 --- a/src/v1_21/api/core/v1/secret_volume_source.rs +++ b/src/v1_21/api/core/v1/secret_volume_source.rs @@ -21,7 +21,7 @@ pub struct SecretVolumeSource { impl crate::DeepMerge for SecretVolumeSource { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.default_mode, other.default_mode); - crate::DeepMerge::merge_from(&mut self.items, other.items); + crate::merge_strategies::list::atomic(&mut self.items, other.items); crate::DeepMerge::merge_from(&mut self.optional, other.optional); crate::DeepMerge::merge_from(&mut self.secret_name, other.secret_name); } diff --git a/src/v1_21/api/core/v1/service_account.rs b/src/v1_21/api/core/v1/service_account.rs index c1b334f710..c297d5be55 100644 --- a/src/v1_21/api/core/v1/service_account.rs +++ b/src/v1_21/api/core/v1/service_account.rs @@ -496,9 +496,16 @@ impl crate::Metadata for ServiceAccount { impl crate::DeepMerge for ServiceAccount { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.automount_service_account_token, other.automount_service_account_token); - crate::DeepMerge::merge_from(&mut self.image_pull_secrets, other.image_pull_secrets); + crate::merge_strategies::list::atomic(&mut self.image_pull_secrets, other.image_pull_secrets); crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.secrets, other.secrets); + crate::merge_strategies::list::map( + &mut self.secrets, + other.secrets, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_21/api/core/v1/service_spec.rs b/src/v1_21/api/core/v1/service_spec.rs index 49197b1488..a12a1dafaa 100644 --- a/src/v1_21/api/core/v1/service_spec.rs +++ b/src/v1_21/api/core/v1/service_spec.rs @@ -72,23 +72,32 @@ impl crate::DeepMerge for ServiceSpec { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.allocate_load_balancer_node_ports, other.allocate_load_balancer_node_ports); crate::DeepMerge::merge_from(&mut self.cluster_ip, other.cluster_ip); - crate::DeepMerge::merge_from(&mut self.cluster_ips, other.cluster_ips); - crate::DeepMerge::merge_from(&mut self.external_ips, other.external_ips); + crate::merge_strategies::list::atomic(&mut self.cluster_ips, other.cluster_ips); + crate::merge_strategies::list::atomic(&mut self.external_ips, other.external_ips); crate::DeepMerge::merge_from(&mut self.external_name, other.external_name); crate::DeepMerge::merge_from(&mut self.external_traffic_policy, other.external_traffic_policy); crate::DeepMerge::merge_from(&mut self.health_check_node_port, other.health_check_node_port); crate::DeepMerge::merge_from(&mut self.internal_traffic_policy, other.internal_traffic_policy); - crate::DeepMerge::merge_from(&mut self.ip_families, other.ip_families); + crate::merge_strategies::list::atomic(&mut self.ip_families, other.ip_families); crate::DeepMerge::merge_from(&mut self.ip_family_policy, other.ip_family_policy); crate::DeepMerge::merge_from(&mut self.load_balancer_class, other.load_balancer_class); crate::DeepMerge::merge_from(&mut self.load_balancer_ip, other.load_balancer_ip); - crate::DeepMerge::merge_from(&mut self.load_balancer_source_ranges, other.load_balancer_source_ranges); - crate::DeepMerge::merge_from(&mut self.ports, other.ports); + crate::merge_strategies::list::atomic(&mut self.load_balancer_source_ranges, other.load_balancer_source_ranges); + crate::merge_strategies::list::map( + &mut self.ports, + other.ports, + &[|lhs, rhs| lhs.port == rhs.port], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.publish_not_ready_addresses, other.publish_not_ready_addresses); - crate::DeepMerge::merge_from(&mut self.selector, other.selector); + crate::merge_strategies::map::granular(&mut self.selector, other.selector, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.session_affinity, other.session_affinity); crate::DeepMerge::merge_from(&mut self.session_affinity_config, other.session_affinity_config); - crate::DeepMerge::merge_from(&mut self.topology_keys, other.topology_keys); + crate::merge_strategies::list::atomic(&mut self.topology_keys, other.topology_keys); crate::DeepMerge::merge_from(&mut self.type_, other.type_); } } diff --git a/src/v1_21/api/core/v1/service_status.rs b/src/v1_21/api/core/v1/service_status.rs index 6c3429fd70..6dece09b96 100644 --- a/src/v1_21/api/core/v1/service_status.rs +++ b/src/v1_21/api/core/v1/service_status.rs @@ -12,7 +12,14 @@ pub struct ServiceStatus { impl crate::DeepMerge for ServiceStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.load_balancer, other.load_balancer); } } diff --git a/src/v1_21/api/core/v1/topology_selector_label_requirement.rs b/src/v1_21/api/core/v1/topology_selector_label_requirement.rs index 3efed6ba65..50764252b6 100644 --- a/src/v1_21/api/core/v1/topology_selector_label_requirement.rs +++ b/src/v1_21/api/core/v1/topology_selector_label_requirement.rs @@ -13,7 +13,7 @@ pub struct TopologySelectorLabelRequirement { impl crate::DeepMerge for TopologySelectorLabelRequirement { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.key, other.key); - crate::DeepMerge::merge_from(&mut self.values, other.values); + crate::merge_strategies::list::atomic(&mut self.values, other.values); } } diff --git a/src/v1_21/api/core/v1/topology_selector_term.rs b/src/v1_21/api/core/v1/topology_selector_term.rs index 230f7ab530..df526d6f4d 100644 --- a/src/v1_21/api/core/v1/topology_selector_term.rs +++ b/src/v1_21/api/core/v1/topology_selector_term.rs @@ -9,7 +9,7 @@ pub struct TopologySelectorTerm { impl crate::DeepMerge for TopologySelectorTerm { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.match_label_expressions, other.match_label_expressions); + crate::merge_strategies::list::atomic(&mut self.match_label_expressions, other.match_label_expressions); } } diff --git a/src/v1_21/api/discovery/v1/endpoint.rs b/src/v1_21/api/discovery/v1/endpoint.rs index 10cf5ed900..a37f940dd0 100644 --- a/src/v1_21/api/discovery/v1/endpoint.rs +++ b/src/v1_21/api/discovery/v1/endpoint.rs @@ -30,9 +30,11 @@ pub struct Endpoint { impl crate::DeepMerge for Endpoint { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.addresses, other.addresses); + crate::merge_strategies::list::set(&mut self.addresses, other.addresses); crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); - crate::DeepMerge::merge_from(&mut self.deprecated_topology, other.deprecated_topology); + crate::merge_strategies::map::granular(&mut self.deprecated_topology, other.deprecated_topology, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.hints, other.hints); crate::DeepMerge::merge_from(&mut self.hostname, other.hostname); crate::DeepMerge::merge_from(&mut self.node_name, other.node_name); diff --git a/src/v1_21/api/discovery/v1/endpoint_hints.rs b/src/v1_21/api/discovery/v1/endpoint_hints.rs index 7fe956528a..02cbd88946 100644 --- a/src/v1_21/api/discovery/v1/endpoint_hints.rs +++ b/src/v1_21/api/discovery/v1/endpoint_hints.rs @@ -9,7 +9,7 @@ pub struct EndpointHints { impl crate::DeepMerge for EndpointHints { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.for_zones, other.for_zones); + crate::merge_strategies::list::atomic(&mut self.for_zones, other.for_zones); } } diff --git a/src/v1_21/api/discovery/v1/endpoint_slice.rs b/src/v1_21/api/discovery/v1/endpoint_slice.rs index 9b2dd33f92..1b8cbdf143 100644 --- a/src/v1_21/api/discovery/v1/endpoint_slice.rs +++ b/src/v1_21/api/discovery/v1/endpoint_slice.rs @@ -496,9 +496,9 @@ impl crate::Metadata for EndpointSlice { impl crate::DeepMerge for EndpointSlice { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.address_type, other.address_type); - crate::DeepMerge::merge_from(&mut self.endpoints, other.endpoints); + crate::merge_strategies::list::atomic(&mut self.endpoints, other.endpoints); crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.ports, other.ports); + crate::merge_strategies::list::atomic(&mut self.ports, other.ports); } } diff --git a/src/v1_21/api/discovery/v1beta1/endpoint.rs b/src/v1_21/api/discovery/v1beta1/endpoint.rs index 72633f136a..cd80eaa25b 100644 --- a/src/v1_21/api/discovery/v1beta1/endpoint.rs +++ b/src/v1_21/api/discovery/v1beta1/endpoint.rs @@ -34,13 +34,15 @@ pub struct Endpoint { impl crate::DeepMerge for Endpoint { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.addresses, other.addresses); + crate::merge_strategies::list::set(&mut self.addresses, other.addresses); crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); crate::DeepMerge::merge_from(&mut self.hints, other.hints); crate::DeepMerge::merge_from(&mut self.hostname, other.hostname); crate::DeepMerge::merge_from(&mut self.node_name, other.node_name); crate::DeepMerge::merge_from(&mut self.target_ref, other.target_ref); - crate::DeepMerge::merge_from(&mut self.topology, other.topology); + crate::merge_strategies::map::granular(&mut self.topology, other.topology, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); } } diff --git a/src/v1_21/api/discovery/v1beta1/endpoint_hints.rs b/src/v1_21/api/discovery/v1beta1/endpoint_hints.rs index 3f5bf3905b..57d5cc5553 100644 --- a/src/v1_21/api/discovery/v1beta1/endpoint_hints.rs +++ b/src/v1_21/api/discovery/v1beta1/endpoint_hints.rs @@ -9,7 +9,7 @@ pub struct EndpointHints { impl crate::DeepMerge for EndpointHints { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.for_zones, other.for_zones); + crate::merge_strategies::list::atomic(&mut self.for_zones, other.for_zones); } } diff --git a/src/v1_21/api/discovery/v1beta1/endpoint_slice.rs b/src/v1_21/api/discovery/v1beta1/endpoint_slice.rs index cfe4553dc2..12d89081fa 100644 --- a/src/v1_21/api/discovery/v1beta1/endpoint_slice.rs +++ b/src/v1_21/api/discovery/v1beta1/endpoint_slice.rs @@ -496,9 +496,9 @@ impl crate::Metadata for EndpointSlice { impl crate::DeepMerge for EndpointSlice { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.address_type, other.address_type); - crate::DeepMerge::merge_from(&mut self.endpoints, other.endpoints); + crate::merge_strategies::list::atomic(&mut self.endpoints, other.endpoints); crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.ports, other.ports); + crate::merge_strategies::list::atomic(&mut self.ports, other.ports); } } diff --git a/src/v1_21/api/extensions/v1beta1/http_ingress_rule_value.rs b/src/v1_21/api/extensions/v1beta1/http_ingress_rule_value.rs index 1e7643afde..5dfc0dbb53 100644 --- a/src/v1_21/api/extensions/v1beta1/http_ingress_rule_value.rs +++ b/src/v1_21/api/extensions/v1beta1/http_ingress_rule_value.rs @@ -9,7 +9,7 @@ pub struct HTTPIngressRuleValue { impl crate::DeepMerge for HTTPIngressRuleValue { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.paths, other.paths); + crate::merge_strategies::list::atomic(&mut self.paths, other.paths); } } diff --git a/src/v1_21/api/extensions/v1beta1/ingress_spec.rs b/src/v1_21/api/extensions/v1beta1/ingress_spec.rs index 53c0e1428b..d58dfab749 100644 --- a/src/v1_21/api/extensions/v1beta1/ingress_spec.rs +++ b/src/v1_21/api/extensions/v1beta1/ingress_spec.rs @@ -20,8 +20,8 @@ impl crate::DeepMerge for IngressSpec { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.backend, other.backend); crate::DeepMerge::merge_from(&mut self.ingress_class_name, other.ingress_class_name); - crate::DeepMerge::merge_from(&mut self.rules, other.rules); - crate::DeepMerge::merge_from(&mut self.tls, other.tls); + crate::merge_strategies::list::atomic(&mut self.rules, other.rules); + crate::merge_strategies::list::atomic(&mut self.tls, other.tls); } } diff --git a/src/v1_21/api/extensions/v1beta1/ingress_tls.rs b/src/v1_21/api/extensions/v1beta1/ingress_tls.rs index 58e0fa32a6..21ad783832 100644 --- a/src/v1_21/api/extensions/v1beta1/ingress_tls.rs +++ b/src/v1_21/api/extensions/v1beta1/ingress_tls.rs @@ -12,7 +12,7 @@ pub struct IngressTLS { impl crate::DeepMerge for IngressTLS { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.hosts, other.hosts); + crate::merge_strategies::list::atomic(&mut self.hosts, other.hosts); crate::DeepMerge::merge_from(&mut self.secret_name, other.secret_name); } } diff --git a/src/v1_21/api/flowcontrol/v1beta1/flow_schema_spec.rs b/src/v1_21/api/flowcontrol/v1beta1/flow_schema_spec.rs index 40031e5acc..fb04b8c0af 100644 --- a/src/v1_21/api/flowcontrol/v1beta1/flow_schema_spec.rs +++ b/src/v1_21/api/flowcontrol/v1beta1/flow_schema_spec.rs @@ -21,7 +21,7 @@ impl crate::DeepMerge for FlowSchemaSpec { crate::DeepMerge::merge_from(&mut self.distinguisher_method, other.distinguisher_method); crate::DeepMerge::merge_from(&mut self.matching_precedence, other.matching_precedence); crate::DeepMerge::merge_from(&mut self.priority_level_configuration, other.priority_level_configuration); - crate::DeepMerge::merge_from(&mut self.rules, other.rules); + crate::merge_strategies::list::atomic(&mut self.rules, other.rules); } } diff --git a/src/v1_21/api/flowcontrol/v1beta1/flow_schema_status.rs b/src/v1_21/api/flowcontrol/v1beta1/flow_schema_status.rs index c463e68e6a..7de52a1a65 100644 --- a/src/v1_21/api/flowcontrol/v1beta1/flow_schema_status.rs +++ b/src/v1_21/api/flowcontrol/v1beta1/flow_schema_status.rs @@ -9,7 +9,14 @@ pub struct FlowSchemaStatus { impl crate::DeepMerge for FlowSchemaStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_21/api/flowcontrol/v1beta1/non_resource_policy_rule.rs b/src/v1_21/api/flowcontrol/v1beta1/non_resource_policy_rule.rs index 80b8803dc1..ac9b066b17 100644 --- a/src/v1_21/api/flowcontrol/v1beta1/non_resource_policy_rule.rs +++ b/src/v1_21/api/flowcontrol/v1beta1/non_resource_policy_rule.rs @@ -18,8 +18,8 @@ pub struct NonResourcePolicyRule { impl crate::DeepMerge for NonResourcePolicyRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.non_resource_urls, other.non_resource_urls); - crate::DeepMerge::merge_from(&mut self.verbs, other.verbs); + crate::merge_strategies::list::set(&mut self.non_resource_urls, other.non_resource_urls); + crate::merge_strategies::list::set(&mut self.verbs, other.verbs); } } diff --git a/src/v1_21/api/flowcontrol/v1beta1/policy_rules_with_subjects.rs b/src/v1_21/api/flowcontrol/v1beta1/policy_rules_with_subjects.rs index 780a347761..8a727117e0 100644 --- a/src/v1_21/api/flowcontrol/v1beta1/policy_rules_with_subjects.rs +++ b/src/v1_21/api/flowcontrol/v1beta1/policy_rules_with_subjects.rs @@ -15,9 +15,9 @@ pub struct PolicyRulesWithSubjects { impl crate::DeepMerge for PolicyRulesWithSubjects { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.non_resource_rules, other.non_resource_rules); - crate::DeepMerge::merge_from(&mut self.resource_rules, other.resource_rules); - crate::DeepMerge::merge_from(&mut self.subjects, other.subjects); + crate::merge_strategies::list::atomic(&mut self.non_resource_rules, other.non_resource_rules); + crate::merge_strategies::list::atomic(&mut self.resource_rules, other.resource_rules); + crate::merge_strategies::list::atomic(&mut self.subjects, other.subjects); } } diff --git a/src/v1_21/api/flowcontrol/v1beta1/priority_level_configuration_status.rs b/src/v1_21/api/flowcontrol/v1beta1/priority_level_configuration_status.rs index a356b4a6df..e35efdf597 100644 --- a/src/v1_21/api/flowcontrol/v1beta1/priority_level_configuration_status.rs +++ b/src/v1_21/api/flowcontrol/v1beta1/priority_level_configuration_status.rs @@ -9,7 +9,14 @@ pub struct PriorityLevelConfigurationStatus { impl crate::DeepMerge for PriorityLevelConfigurationStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_21/api/flowcontrol/v1beta1/resource_policy_rule.rs b/src/v1_21/api/flowcontrol/v1beta1/resource_policy_rule.rs index 14597a98fb..4d742498ed 100644 --- a/src/v1_21/api/flowcontrol/v1beta1/resource_policy_rule.rs +++ b/src/v1_21/api/flowcontrol/v1beta1/resource_policy_rule.rs @@ -21,11 +21,11 @@ pub struct ResourcePolicyRule { impl crate::DeepMerge for ResourcePolicyRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.api_groups, other.api_groups); + crate::merge_strategies::list::set(&mut self.api_groups, other.api_groups); crate::DeepMerge::merge_from(&mut self.cluster_scope, other.cluster_scope); - crate::DeepMerge::merge_from(&mut self.namespaces, other.namespaces); - crate::DeepMerge::merge_from(&mut self.resources, other.resources); - crate::DeepMerge::merge_from(&mut self.verbs, other.verbs); + crate::merge_strategies::list::set(&mut self.namespaces, other.namespaces); + crate::merge_strategies::list::set(&mut self.resources, other.resources); + crate::merge_strategies::list::set(&mut self.verbs, other.verbs); } } diff --git a/src/v1_21/api/networking/v1/http_ingress_rule_value.rs b/src/v1_21/api/networking/v1/http_ingress_rule_value.rs index acc836c728..3749783ee2 100644 --- a/src/v1_21/api/networking/v1/http_ingress_rule_value.rs +++ b/src/v1_21/api/networking/v1/http_ingress_rule_value.rs @@ -9,7 +9,7 @@ pub struct HTTPIngressRuleValue { impl crate::DeepMerge for HTTPIngressRuleValue { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.paths, other.paths); + crate::merge_strategies::list::atomic(&mut self.paths, other.paths); } } diff --git a/src/v1_21/api/networking/v1/ingress_spec.rs b/src/v1_21/api/networking/v1/ingress_spec.rs index 68e8606acb..2229a3c788 100644 --- a/src/v1_21/api/networking/v1/ingress_spec.rs +++ b/src/v1_21/api/networking/v1/ingress_spec.rs @@ -20,8 +20,8 @@ impl crate::DeepMerge for IngressSpec { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.default_backend, other.default_backend); crate::DeepMerge::merge_from(&mut self.ingress_class_name, other.ingress_class_name); - crate::DeepMerge::merge_from(&mut self.rules, other.rules); - crate::DeepMerge::merge_from(&mut self.tls, other.tls); + crate::merge_strategies::list::atomic(&mut self.rules, other.rules); + crate::merge_strategies::list::atomic(&mut self.tls, other.tls); } } diff --git a/src/v1_21/api/networking/v1/ingress_tls.rs b/src/v1_21/api/networking/v1/ingress_tls.rs index d48a83a0c4..92c66b754f 100644 --- a/src/v1_21/api/networking/v1/ingress_tls.rs +++ b/src/v1_21/api/networking/v1/ingress_tls.rs @@ -12,7 +12,7 @@ pub struct IngressTLS { impl crate::DeepMerge for IngressTLS { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.hosts, other.hosts); + crate::merge_strategies::list::atomic(&mut self.hosts, other.hosts); crate::DeepMerge::merge_from(&mut self.secret_name, other.secret_name); } } diff --git a/src/v1_21/api/networking/v1/ip_block.rs b/src/v1_21/api/networking/v1/ip_block.rs index 46458b01c5..08d9d2ab61 100644 --- a/src/v1_21/api/networking/v1/ip_block.rs +++ b/src/v1_21/api/networking/v1/ip_block.rs @@ -13,7 +13,7 @@ pub struct IPBlock { impl crate::DeepMerge for IPBlock { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.cidr, other.cidr); - crate::DeepMerge::merge_from(&mut self.except, other.except); + crate::merge_strategies::list::atomic(&mut self.except, other.except); } } diff --git a/src/v1_21/api/networking/v1/network_policy_egress_rule.rs b/src/v1_21/api/networking/v1/network_policy_egress_rule.rs index 33619be210..28eb6a21b6 100644 --- a/src/v1_21/api/networking/v1/network_policy_egress_rule.rs +++ b/src/v1_21/api/networking/v1/network_policy_egress_rule.rs @@ -12,8 +12,8 @@ pub struct NetworkPolicyEgressRule { impl crate::DeepMerge for NetworkPolicyEgressRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.ports, other.ports); - crate::DeepMerge::merge_from(&mut self.to, other.to); + crate::merge_strategies::list::atomic(&mut self.ports, other.ports); + crate::merge_strategies::list::atomic(&mut self.to, other.to); } } diff --git a/src/v1_21/api/networking/v1/network_policy_ingress_rule.rs b/src/v1_21/api/networking/v1/network_policy_ingress_rule.rs index 2c68ec44a7..517765f800 100644 --- a/src/v1_21/api/networking/v1/network_policy_ingress_rule.rs +++ b/src/v1_21/api/networking/v1/network_policy_ingress_rule.rs @@ -12,8 +12,8 @@ pub struct NetworkPolicyIngressRule { impl crate::DeepMerge for NetworkPolicyIngressRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.from, other.from); - crate::DeepMerge::merge_from(&mut self.ports, other.ports); + crate::merge_strategies::list::atomic(&mut self.from, other.from); + crate::merge_strategies::list::atomic(&mut self.ports, other.ports); } } diff --git a/src/v1_21/api/networking/v1/network_policy_spec.rs b/src/v1_21/api/networking/v1/network_policy_spec.rs index ed61b60968..bc980e7469 100644 --- a/src/v1_21/api/networking/v1/network_policy_spec.rs +++ b/src/v1_21/api/networking/v1/network_policy_spec.rs @@ -18,10 +18,10 @@ pub struct NetworkPolicySpec { impl crate::DeepMerge for NetworkPolicySpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.egress, other.egress); - crate::DeepMerge::merge_from(&mut self.ingress, other.ingress); + crate::merge_strategies::list::atomic(&mut self.egress, other.egress); + crate::merge_strategies::list::atomic(&mut self.ingress, other.ingress); crate::DeepMerge::merge_from(&mut self.pod_selector, other.pod_selector); - crate::DeepMerge::merge_from(&mut self.policy_types, other.policy_types); + crate::merge_strategies::list::atomic(&mut self.policy_types, other.policy_types); } } diff --git a/src/v1_21/api/networking/v1beta1/http_ingress_rule_value.rs b/src/v1_21/api/networking/v1beta1/http_ingress_rule_value.rs index b000ab1552..85ef5a30b9 100644 --- a/src/v1_21/api/networking/v1beta1/http_ingress_rule_value.rs +++ b/src/v1_21/api/networking/v1beta1/http_ingress_rule_value.rs @@ -9,7 +9,7 @@ pub struct HTTPIngressRuleValue { impl crate::DeepMerge for HTTPIngressRuleValue { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.paths, other.paths); + crate::merge_strategies::list::atomic(&mut self.paths, other.paths); } } diff --git a/src/v1_21/api/networking/v1beta1/ingress_spec.rs b/src/v1_21/api/networking/v1beta1/ingress_spec.rs index fbb0c4990b..df01685fc2 100644 --- a/src/v1_21/api/networking/v1beta1/ingress_spec.rs +++ b/src/v1_21/api/networking/v1beta1/ingress_spec.rs @@ -20,8 +20,8 @@ impl crate::DeepMerge for IngressSpec { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.backend, other.backend); crate::DeepMerge::merge_from(&mut self.ingress_class_name, other.ingress_class_name); - crate::DeepMerge::merge_from(&mut self.rules, other.rules); - crate::DeepMerge::merge_from(&mut self.tls, other.tls); + crate::merge_strategies::list::atomic(&mut self.rules, other.rules); + crate::merge_strategies::list::atomic(&mut self.tls, other.tls); } } diff --git a/src/v1_21/api/networking/v1beta1/ingress_tls.rs b/src/v1_21/api/networking/v1beta1/ingress_tls.rs index 36040b3456..2a3158ed0d 100644 --- a/src/v1_21/api/networking/v1beta1/ingress_tls.rs +++ b/src/v1_21/api/networking/v1beta1/ingress_tls.rs @@ -12,7 +12,7 @@ pub struct IngressTLS { impl crate::DeepMerge for IngressTLS { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.hosts, other.hosts); + crate::merge_strategies::list::atomic(&mut self.hosts, other.hosts); crate::DeepMerge::merge_from(&mut self.secret_name, other.secret_name); } } diff --git a/src/v1_21/api/node/v1/overhead.rs b/src/v1_21/api/node/v1/overhead.rs index ef68cae1c1..2db70b80c4 100644 --- a/src/v1_21/api/node/v1/overhead.rs +++ b/src/v1_21/api/node/v1/overhead.rs @@ -9,7 +9,9 @@ pub struct Overhead { impl crate::DeepMerge for Overhead { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.pod_fixed, other.pod_fixed); + crate::merge_strategies::map::granular(&mut self.pod_fixed, other.pod_fixed, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); } } diff --git a/src/v1_21/api/node/v1/scheduling.rs b/src/v1_21/api/node/v1/scheduling.rs index 1c2b8a05c5..61afb4567f 100644 --- a/src/v1_21/api/node/v1/scheduling.rs +++ b/src/v1_21/api/node/v1/scheduling.rs @@ -12,8 +12,10 @@ pub struct Scheduling { impl crate::DeepMerge for Scheduling { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.node_selector, other.node_selector); - crate::DeepMerge::merge_from(&mut self.tolerations, other.tolerations); + crate::merge_strategies::map::granular(&mut self.node_selector, other.node_selector, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::list::atomic(&mut self.tolerations, other.tolerations); } } diff --git a/src/v1_21/api/node/v1alpha1/overhead.rs b/src/v1_21/api/node/v1alpha1/overhead.rs index 59efa7b8e1..eb3a0a48fb 100644 --- a/src/v1_21/api/node/v1alpha1/overhead.rs +++ b/src/v1_21/api/node/v1alpha1/overhead.rs @@ -9,7 +9,9 @@ pub struct Overhead { impl crate::DeepMerge for Overhead { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.pod_fixed, other.pod_fixed); + crate::merge_strategies::map::granular(&mut self.pod_fixed, other.pod_fixed, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); } } diff --git a/src/v1_21/api/node/v1alpha1/scheduling.rs b/src/v1_21/api/node/v1alpha1/scheduling.rs index f660e0dc43..e6704fd193 100644 --- a/src/v1_21/api/node/v1alpha1/scheduling.rs +++ b/src/v1_21/api/node/v1alpha1/scheduling.rs @@ -12,8 +12,10 @@ pub struct Scheduling { impl crate::DeepMerge for Scheduling { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.node_selector, other.node_selector); - crate::DeepMerge::merge_from(&mut self.tolerations, other.tolerations); + crate::merge_strategies::map::granular(&mut self.node_selector, other.node_selector, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::list::atomic(&mut self.tolerations, other.tolerations); } } diff --git a/src/v1_21/api/node/v1beta1/overhead.rs b/src/v1_21/api/node/v1beta1/overhead.rs index 53af362cd3..821323b5c0 100644 --- a/src/v1_21/api/node/v1beta1/overhead.rs +++ b/src/v1_21/api/node/v1beta1/overhead.rs @@ -9,7 +9,9 @@ pub struct Overhead { impl crate::DeepMerge for Overhead { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.pod_fixed, other.pod_fixed); + crate::merge_strategies::map::granular(&mut self.pod_fixed, other.pod_fixed, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); } } diff --git a/src/v1_21/api/node/v1beta1/scheduling.rs b/src/v1_21/api/node/v1beta1/scheduling.rs index 9b493fe4cf..b16882c761 100644 --- a/src/v1_21/api/node/v1beta1/scheduling.rs +++ b/src/v1_21/api/node/v1beta1/scheduling.rs @@ -12,8 +12,10 @@ pub struct Scheduling { impl crate::DeepMerge for Scheduling { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.node_selector, other.node_selector); - crate::DeepMerge::merge_from(&mut self.tolerations, other.tolerations); + crate::merge_strategies::map::granular(&mut self.node_selector, other.node_selector, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::list::atomic(&mut self.tolerations, other.tolerations); } } diff --git a/src/v1_21/api/policy/v1/pod_disruption_budget_status.rs b/src/v1_21/api/policy/v1/pod_disruption_budget_status.rs index f4aa41a86e..cf8b02d00f 100644 --- a/src/v1_21/api/policy/v1/pod_disruption_budget_status.rs +++ b/src/v1_21/api/policy/v1/pod_disruption_budget_status.rs @@ -35,10 +35,19 @@ pub struct PodDisruptionBudgetStatus { impl crate::DeepMerge for PodDisruptionBudgetStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.current_healthy, other.current_healthy); crate::DeepMerge::merge_from(&mut self.desired_healthy, other.desired_healthy); - crate::DeepMerge::merge_from(&mut self.disrupted_pods, other.disrupted_pods); + crate::merge_strategies::map::granular(&mut self.disrupted_pods, other.disrupted_pods, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.disruptions_allowed, other.disruptions_allowed); crate::DeepMerge::merge_from(&mut self.expected_pods, other.expected_pods); crate::DeepMerge::merge_from(&mut self.observed_generation, other.observed_generation); diff --git a/src/v1_21/api/policy/v1beta1/fs_group_strategy_options.rs b/src/v1_21/api/policy/v1beta1/fs_group_strategy_options.rs index 80e63553ac..c52d53d54c 100644 --- a/src/v1_21/api/policy/v1beta1/fs_group_strategy_options.rs +++ b/src/v1_21/api/policy/v1beta1/fs_group_strategy_options.rs @@ -12,7 +12,7 @@ pub struct FSGroupStrategyOptions { impl crate::DeepMerge for FSGroupStrategyOptions { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.ranges, other.ranges); + crate::merge_strategies::list::atomic(&mut self.ranges, other.ranges); crate::DeepMerge::merge_from(&mut self.rule, other.rule); } } diff --git a/src/v1_21/api/policy/v1beta1/pod_disruption_budget_status.rs b/src/v1_21/api/policy/v1beta1/pod_disruption_budget_status.rs index 72a03073f6..17f1fa562a 100644 --- a/src/v1_21/api/policy/v1beta1/pod_disruption_budget_status.rs +++ b/src/v1_21/api/policy/v1beta1/pod_disruption_budget_status.rs @@ -35,10 +35,19 @@ pub struct PodDisruptionBudgetStatus { impl crate::DeepMerge for PodDisruptionBudgetStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.current_healthy, other.current_healthy); crate::DeepMerge::merge_from(&mut self.desired_healthy, other.desired_healthy); - crate::DeepMerge::merge_from(&mut self.disrupted_pods, other.disrupted_pods); + crate::merge_strategies::map::granular(&mut self.disrupted_pods, other.disrupted_pods, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.disruptions_allowed, other.disruptions_allowed); crate::DeepMerge::merge_from(&mut self.expected_pods, other.expected_pods); crate::DeepMerge::merge_from(&mut self.observed_generation, other.observed_generation); diff --git a/src/v1_21/api/policy/v1beta1/pod_security_policy_spec.rs b/src/v1_21/api/policy/v1beta1/pod_security_policy_spec.rs index b4f2ca8c67..e9a43ffbac 100644 --- a/src/v1_21/api/policy/v1beta1/pod_security_policy_spec.rs +++ b/src/v1_21/api/policy/v1beta1/pod_security_policy_spec.rs @@ -83,29 +83,29 @@ pub struct PodSecurityPolicySpec { impl crate::DeepMerge for PodSecurityPolicySpec { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.allow_privilege_escalation, other.allow_privilege_escalation); - crate::DeepMerge::merge_from(&mut self.allowed_csi_drivers, other.allowed_csi_drivers); - crate::DeepMerge::merge_from(&mut self.allowed_capabilities, other.allowed_capabilities); - crate::DeepMerge::merge_from(&mut self.allowed_flex_volumes, other.allowed_flex_volumes); - crate::DeepMerge::merge_from(&mut self.allowed_host_paths, other.allowed_host_paths); - crate::DeepMerge::merge_from(&mut self.allowed_proc_mount_types, other.allowed_proc_mount_types); - crate::DeepMerge::merge_from(&mut self.allowed_unsafe_sysctls, other.allowed_unsafe_sysctls); - crate::DeepMerge::merge_from(&mut self.default_add_capabilities, other.default_add_capabilities); + crate::merge_strategies::list::atomic(&mut self.allowed_csi_drivers, other.allowed_csi_drivers); + crate::merge_strategies::list::atomic(&mut self.allowed_capabilities, other.allowed_capabilities); + crate::merge_strategies::list::atomic(&mut self.allowed_flex_volumes, other.allowed_flex_volumes); + crate::merge_strategies::list::atomic(&mut self.allowed_host_paths, other.allowed_host_paths); + crate::merge_strategies::list::atomic(&mut self.allowed_proc_mount_types, other.allowed_proc_mount_types); + crate::merge_strategies::list::atomic(&mut self.allowed_unsafe_sysctls, other.allowed_unsafe_sysctls); + crate::merge_strategies::list::atomic(&mut self.default_add_capabilities, other.default_add_capabilities); crate::DeepMerge::merge_from(&mut self.default_allow_privilege_escalation, other.default_allow_privilege_escalation); - crate::DeepMerge::merge_from(&mut self.forbidden_sysctls, other.forbidden_sysctls); + crate::merge_strategies::list::atomic(&mut self.forbidden_sysctls, other.forbidden_sysctls); crate::DeepMerge::merge_from(&mut self.fs_group, other.fs_group); crate::DeepMerge::merge_from(&mut self.host_ipc, other.host_ipc); crate::DeepMerge::merge_from(&mut self.host_network, other.host_network); crate::DeepMerge::merge_from(&mut self.host_pid, other.host_pid); - crate::DeepMerge::merge_from(&mut self.host_ports, other.host_ports); + crate::merge_strategies::list::atomic(&mut self.host_ports, other.host_ports); crate::DeepMerge::merge_from(&mut self.privileged, other.privileged); crate::DeepMerge::merge_from(&mut self.read_only_root_filesystem, other.read_only_root_filesystem); - crate::DeepMerge::merge_from(&mut self.required_drop_capabilities, other.required_drop_capabilities); + crate::merge_strategies::list::atomic(&mut self.required_drop_capabilities, other.required_drop_capabilities); crate::DeepMerge::merge_from(&mut self.run_as_group, other.run_as_group); crate::DeepMerge::merge_from(&mut self.run_as_user, other.run_as_user); crate::DeepMerge::merge_from(&mut self.runtime_class, other.runtime_class); crate::DeepMerge::merge_from(&mut self.se_linux, other.se_linux); crate::DeepMerge::merge_from(&mut self.supplemental_groups, other.supplemental_groups); - crate::DeepMerge::merge_from(&mut self.volumes, other.volumes); + crate::merge_strategies::list::atomic(&mut self.volumes, other.volumes); } } diff --git a/src/v1_21/api/policy/v1beta1/run_as_group_strategy_options.rs b/src/v1_21/api/policy/v1beta1/run_as_group_strategy_options.rs index 89e97b5842..25aa6f1e66 100644 --- a/src/v1_21/api/policy/v1beta1/run_as_group_strategy_options.rs +++ b/src/v1_21/api/policy/v1beta1/run_as_group_strategy_options.rs @@ -12,7 +12,7 @@ pub struct RunAsGroupStrategyOptions { impl crate::DeepMerge for RunAsGroupStrategyOptions { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.ranges, other.ranges); + crate::merge_strategies::list::atomic(&mut self.ranges, other.ranges); crate::DeepMerge::merge_from(&mut self.rule, other.rule); } } diff --git a/src/v1_21/api/policy/v1beta1/run_as_user_strategy_options.rs b/src/v1_21/api/policy/v1beta1/run_as_user_strategy_options.rs index aeeda6f381..a28c259366 100644 --- a/src/v1_21/api/policy/v1beta1/run_as_user_strategy_options.rs +++ b/src/v1_21/api/policy/v1beta1/run_as_user_strategy_options.rs @@ -12,7 +12,7 @@ pub struct RunAsUserStrategyOptions { impl crate::DeepMerge for RunAsUserStrategyOptions { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.ranges, other.ranges); + crate::merge_strategies::list::atomic(&mut self.ranges, other.ranges); crate::DeepMerge::merge_from(&mut self.rule, other.rule); } } diff --git a/src/v1_21/api/policy/v1beta1/runtime_class_strategy_options.rs b/src/v1_21/api/policy/v1beta1/runtime_class_strategy_options.rs index 5f80a6b7e7..085d36d69f 100644 --- a/src/v1_21/api/policy/v1beta1/runtime_class_strategy_options.rs +++ b/src/v1_21/api/policy/v1beta1/runtime_class_strategy_options.rs @@ -12,7 +12,7 @@ pub struct RuntimeClassStrategyOptions { impl crate::DeepMerge for RuntimeClassStrategyOptions { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.allowed_runtime_class_names, other.allowed_runtime_class_names); + crate::merge_strategies::list::atomic(&mut self.allowed_runtime_class_names, other.allowed_runtime_class_names); crate::DeepMerge::merge_from(&mut self.default_runtime_class_name, other.default_runtime_class_name); } } diff --git a/src/v1_21/api/policy/v1beta1/supplemental_groups_strategy_options.rs b/src/v1_21/api/policy/v1beta1/supplemental_groups_strategy_options.rs index 7e83b2e756..4bcc23b7e2 100644 --- a/src/v1_21/api/policy/v1beta1/supplemental_groups_strategy_options.rs +++ b/src/v1_21/api/policy/v1beta1/supplemental_groups_strategy_options.rs @@ -12,7 +12,7 @@ pub struct SupplementalGroupsStrategyOptions { impl crate::DeepMerge for SupplementalGroupsStrategyOptions { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.ranges, other.ranges); + crate::merge_strategies::list::atomic(&mut self.ranges, other.ranges); crate::DeepMerge::merge_from(&mut self.rule, other.rule); } } diff --git a/src/v1_21/api/rbac/v1/aggregation_rule.rs b/src/v1_21/api/rbac/v1/aggregation_rule.rs index 5ccc4984f6..b20ce61705 100644 --- a/src/v1_21/api/rbac/v1/aggregation_rule.rs +++ b/src/v1_21/api/rbac/v1/aggregation_rule.rs @@ -9,7 +9,7 @@ pub struct AggregationRule { impl crate::DeepMerge for AggregationRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.cluster_role_selectors, other.cluster_role_selectors); + crate::merge_strategies::list::atomic(&mut self.cluster_role_selectors, other.cluster_role_selectors); } } diff --git a/src/v1_21/api/rbac/v1/cluster_role.rs b/src/v1_21/api/rbac/v1/cluster_role.rs index 8336e14c92..a6f832b593 100644 --- a/src/v1_21/api/rbac/v1/cluster_role.rs +++ b/src/v1_21/api/rbac/v1/cluster_role.rs @@ -378,7 +378,7 @@ impl crate::DeepMerge for ClusterRole { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.aggregation_rule, other.aggregation_rule); crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.rules, other.rules); + crate::merge_strategies::list::atomic(&mut self.rules, other.rules); } } 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..04fa2bd714 100644 --- a/src/v1_21/api/rbac/v1/cluster_role_binding.rs +++ b/src/v1_21/api/rbac/v1/cluster_role_binding.rs @@ -378,7 +378,7 @@ impl crate::DeepMerge for ClusterRoleBinding { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); crate::DeepMerge::merge_from(&mut self.role_ref, other.role_ref); - crate::DeepMerge::merge_from(&mut self.subjects, other.subjects); + crate::merge_strategies::list::atomic(&mut self.subjects, other.subjects); } } diff --git a/src/v1_21/api/rbac/v1/policy_rule.rs b/src/v1_21/api/rbac/v1/policy_rule.rs index f6ab14adc2..5d5c5e6d8e 100644 --- a/src/v1_21/api/rbac/v1/policy_rule.rs +++ b/src/v1_21/api/rbac/v1/policy_rule.rs @@ -21,11 +21,11 @@ pub struct PolicyRule { impl crate::DeepMerge for PolicyRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.api_groups, other.api_groups); - crate::DeepMerge::merge_from(&mut self.non_resource_urls, other.non_resource_urls); - crate::DeepMerge::merge_from(&mut self.resource_names, other.resource_names); - crate::DeepMerge::merge_from(&mut self.resources, other.resources); - crate::DeepMerge::merge_from(&mut self.verbs, other.verbs); + crate::merge_strategies::list::atomic(&mut self.api_groups, other.api_groups); + crate::merge_strategies::list::atomic(&mut self.non_resource_urls, other.non_resource_urls); + crate::merge_strategies::list::atomic(&mut self.resource_names, other.resource_names); + crate::merge_strategies::list::atomic(&mut self.resources, other.resources); + crate::merge_strategies::list::atomic(&mut self.verbs, other.verbs); } } diff --git a/src/v1_21/api/rbac/v1/role.rs b/src/v1_21/api/rbac/v1/role.rs index 9764bc7aa0..719ecb92b0 100644 --- a/src/v1_21/api/rbac/v1/role.rs +++ b/src/v1_21/api/rbac/v1/role.rs @@ -490,7 +490,7 @@ impl crate::Metadata for Role { impl crate::DeepMerge for Role { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.rules, other.rules); + crate::merge_strategies::list::atomic(&mut self.rules, other.rules); } } diff --git a/src/v1_21/api/rbac/v1/role_binding.rs b/src/v1_21/api/rbac/v1/role_binding.rs index ac11e857c2..7b9059076a 100644 --- a/src/v1_21/api/rbac/v1/role_binding.rs +++ b/src/v1_21/api/rbac/v1/role_binding.rs @@ -494,7 +494,7 @@ impl crate::DeepMerge for RoleBinding { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); crate::DeepMerge::merge_from(&mut self.role_ref, other.role_ref); - crate::DeepMerge::merge_from(&mut self.subjects, other.subjects); + crate::merge_strategies::list::atomic(&mut self.subjects, other.subjects); } } diff --git a/src/v1_21/api/rbac/v1alpha1/aggregation_rule.rs b/src/v1_21/api/rbac/v1alpha1/aggregation_rule.rs index ba1495c28c..4f4acecf3e 100644 --- a/src/v1_21/api/rbac/v1alpha1/aggregation_rule.rs +++ b/src/v1_21/api/rbac/v1alpha1/aggregation_rule.rs @@ -9,7 +9,7 @@ pub struct AggregationRule { impl crate::DeepMerge for AggregationRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.cluster_role_selectors, other.cluster_role_selectors); + crate::merge_strategies::list::atomic(&mut self.cluster_role_selectors, other.cluster_role_selectors); } } diff --git a/src/v1_21/api/rbac/v1alpha1/cluster_role.rs b/src/v1_21/api/rbac/v1alpha1/cluster_role.rs index 751ea258ce..1894462873 100644 --- a/src/v1_21/api/rbac/v1alpha1/cluster_role.rs +++ b/src/v1_21/api/rbac/v1alpha1/cluster_role.rs @@ -378,7 +378,7 @@ impl crate::DeepMerge for ClusterRole { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.aggregation_rule, other.aggregation_rule); crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.rules, other.rules); + crate::merge_strategies::list::atomic(&mut self.rules, other.rules); } } 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..9385e93337 100644 --- a/src/v1_21/api/rbac/v1alpha1/cluster_role_binding.rs +++ b/src/v1_21/api/rbac/v1alpha1/cluster_role_binding.rs @@ -378,7 +378,7 @@ impl crate::DeepMerge for ClusterRoleBinding { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); crate::DeepMerge::merge_from(&mut self.role_ref, other.role_ref); - crate::DeepMerge::merge_from(&mut self.subjects, other.subjects); + crate::merge_strategies::list::atomic(&mut self.subjects, other.subjects); } } diff --git a/src/v1_21/api/rbac/v1alpha1/policy_rule.rs b/src/v1_21/api/rbac/v1alpha1/policy_rule.rs index eee02e04ae..5d04dfadaf 100644 --- a/src/v1_21/api/rbac/v1alpha1/policy_rule.rs +++ b/src/v1_21/api/rbac/v1alpha1/policy_rule.rs @@ -21,11 +21,11 @@ pub struct PolicyRule { impl crate::DeepMerge for PolicyRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.api_groups, other.api_groups); - crate::DeepMerge::merge_from(&mut self.non_resource_urls, other.non_resource_urls); - crate::DeepMerge::merge_from(&mut self.resource_names, other.resource_names); - crate::DeepMerge::merge_from(&mut self.resources, other.resources); - crate::DeepMerge::merge_from(&mut self.verbs, other.verbs); + crate::merge_strategies::list::atomic(&mut self.api_groups, other.api_groups); + crate::merge_strategies::list::atomic(&mut self.non_resource_urls, other.non_resource_urls); + crate::merge_strategies::list::atomic(&mut self.resource_names, other.resource_names); + crate::merge_strategies::list::atomic(&mut self.resources, other.resources); + crate::merge_strategies::list::atomic(&mut self.verbs, other.verbs); } } diff --git a/src/v1_21/api/rbac/v1alpha1/role.rs b/src/v1_21/api/rbac/v1alpha1/role.rs index ed08658a2d..a21e1d75e2 100644 --- a/src/v1_21/api/rbac/v1alpha1/role.rs +++ b/src/v1_21/api/rbac/v1alpha1/role.rs @@ -490,7 +490,7 @@ impl crate::Metadata for Role { impl crate::DeepMerge for Role { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.rules, other.rules); + crate::merge_strategies::list::atomic(&mut self.rules, other.rules); } } diff --git a/src/v1_21/api/rbac/v1alpha1/role_binding.rs b/src/v1_21/api/rbac/v1alpha1/role_binding.rs index f965377b92..819c0b88f2 100644 --- a/src/v1_21/api/rbac/v1alpha1/role_binding.rs +++ b/src/v1_21/api/rbac/v1alpha1/role_binding.rs @@ -494,7 +494,7 @@ impl crate::DeepMerge for RoleBinding { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); crate::DeepMerge::merge_from(&mut self.role_ref, other.role_ref); - crate::DeepMerge::merge_from(&mut self.subjects, other.subjects); + crate::merge_strategies::list::atomic(&mut self.subjects, other.subjects); } } diff --git a/src/v1_21/api/rbac/v1beta1/aggregation_rule.rs b/src/v1_21/api/rbac/v1beta1/aggregation_rule.rs index 3ca92d3f83..c5444137be 100644 --- a/src/v1_21/api/rbac/v1beta1/aggregation_rule.rs +++ b/src/v1_21/api/rbac/v1beta1/aggregation_rule.rs @@ -9,7 +9,7 @@ pub struct AggregationRule { impl crate::DeepMerge for AggregationRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.cluster_role_selectors, other.cluster_role_selectors); + crate::merge_strategies::list::atomic(&mut self.cluster_role_selectors, other.cluster_role_selectors); } } diff --git a/src/v1_21/api/rbac/v1beta1/cluster_role.rs b/src/v1_21/api/rbac/v1beta1/cluster_role.rs index 4931e2d651..5a40b2d047 100644 --- a/src/v1_21/api/rbac/v1beta1/cluster_role.rs +++ b/src/v1_21/api/rbac/v1beta1/cluster_role.rs @@ -378,7 +378,7 @@ impl crate::DeepMerge for ClusterRole { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.aggregation_rule, other.aggregation_rule); crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.rules, other.rules); + crate::merge_strategies::list::atomic(&mut self.rules, other.rules); } } 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..bb007fa116 100644 --- a/src/v1_21/api/rbac/v1beta1/cluster_role_binding.rs +++ b/src/v1_21/api/rbac/v1beta1/cluster_role_binding.rs @@ -378,7 +378,7 @@ impl crate::DeepMerge for ClusterRoleBinding { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); crate::DeepMerge::merge_from(&mut self.role_ref, other.role_ref); - crate::DeepMerge::merge_from(&mut self.subjects, other.subjects); + crate::merge_strategies::list::atomic(&mut self.subjects, other.subjects); } } diff --git a/src/v1_21/api/rbac/v1beta1/policy_rule.rs b/src/v1_21/api/rbac/v1beta1/policy_rule.rs index 83e7907c1c..67a49c0667 100644 --- a/src/v1_21/api/rbac/v1beta1/policy_rule.rs +++ b/src/v1_21/api/rbac/v1beta1/policy_rule.rs @@ -21,11 +21,11 @@ pub struct PolicyRule { impl crate::DeepMerge for PolicyRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.api_groups, other.api_groups); - crate::DeepMerge::merge_from(&mut self.non_resource_urls, other.non_resource_urls); - crate::DeepMerge::merge_from(&mut self.resource_names, other.resource_names); - crate::DeepMerge::merge_from(&mut self.resources, other.resources); - crate::DeepMerge::merge_from(&mut self.verbs, other.verbs); + crate::merge_strategies::list::atomic(&mut self.api_groups, other.api_groups); + crate::merge_strategies::list::atomic(&mut self.non_resource_urls, other.non_resource_urls); + crate::merge_strategies::list::atomic(&mut self.resource_names, other.resource_names); + crate::merge_strategies::list::atomic(&mut self.resources, other.resources); + crate::merge_strategies::list::atomic(&mut self.verbs, other.verbs); } } diff --git a/src/v1_21/api/rbac/v1beta1/role.rs b/src/v1_21/api/rbac/v1beta1/role.rs index 44184b4f3b..2f94606aa1 100644 --- a/src/v1_21/api/rbac/v1beta1/role.rs +++ b/src/v1_21/api/rbac/v1beta1/role.rs @@ -490,7 +490,7 @@ impl crate::Metadata for Role { impl crate::DeepMerge for Role { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.rules, other.rules); + crate::merge_strategies::list::atomic(&mut self.rules, other.rules); } } diff --git a/src/v1_21/api/rbac/v1beta1/role_binding.rs b/src/v1_21/api/rbac/v1beta1/role_binding.rs index a49d33a668..a9498bfb85 100644 --- a/src/v1_21/api/rbac/v1beta1/role_binding.rs +++ b/src/v1_21/api/rbac/v1beta1/role_binding.rs @@ -494,7 +494,7 @@ impl crate::DeepMerge for RoleBinding { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); crate::DeepMerge::merge_from(&mut self.role_ref, other.role_ref); - crate::DeepMerge::merge_from(&mut self.subjects, other.subjects); + crate::merge_strategies::list::atomic(&mut self.subjects, other.subjects); } } diff --git a/src/v1_21/api/storage/v1/csi_driver_spec.rs b/src/v1_21/api/storage/v1/csi_driver_spec.rs index b342fb58e8..009b7d5b52 100644 --- a/src/v1_21/api/storage/v1/csi_driver_spec.rs +++ b/src/v1_21/api/storage/v1/csi_driver_spec.rs @@ -65,8 +65,8 @@ impl crate::DeepMerge for CSIDriverSpec { crate::DeepMerge::merge_from(&mut self.pod_info_on_mount, other.pod_info_on_mount); crate::DeepMerge::merge_from(&mut self.requires_republish, other.requires_republish); crate::DeepMerge::merge_from(&mut self.storage_capacity, other.storage_capacity); - crate::DeepMerge::merge_from(&mut self.token_requests, other.token_requests); - crate::DeepMerge::merge_from(&mut self.volume_lifecycle_modes, other.volume_lifecycle_modes); + crate::merge_strategies::list::atomic(&mut self.token_requests, other.token_requests); + crate::merge_strategies::list::set(&mut self.volume_lifecycle_modes, other.volume_lifecycle_modes); } } diff --git a/src/v1_21/api/storage/v1/csi_node_driver.rs b/src/v1_21/api/storage/v1/csi_node_driver.rs index c113299390..d8b79d89f3 100644 --- a/src/v1_21/api/storage/v1/csi_node_driver.rs +++ b/src/v1_21/api/storage/v1/csi_node_driver.rs @@ -21,7 +21,7 @@ impl crate::DeepMerge for CSINodeDriver { crate::DeepMerge::merge_from(&mut self.allocatable, other.allocatable); crate::DeepMerge::merge_from(&mut self.name, other.name); crate::DeepMerge::merge_from(&mut self.node_id, other.node_id); - crate::DeepMerge::merge_from(&mut self.topology_keys, other.topology_keys); + crate::merge_strategies::list::atomic(&mut self.topology_keys, other.topology_keys); } } diff --git a/src/v1_21/api/storage/v1/csi_node_spec.rs b/src/v1_21/api/storage/v1/csi_node_spec.rs index ea2a1ddb97..4717576df8 100644 --- a/src/v1_21/api/storage/v1/csi_node_spec.rs +++ b/src/v1_21/api/storage/v1/csi_node_spec.rs @@ -9,7 +9,14 @@ pub struct CSINodeSpec { impl crate::DeepMerge for CSINodeSpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.drivers, other.drivers); + crate::merge_strategies::list::map( + &mut self.drivers, + other.drivers, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_21/api/storage/v1/storage_class.rs b/src/v1_21/api/storage/v1/storage_class.rs index 2bf8e65456..12774ba320 100644 --- a/src/v1_21/api/storage/v1/storage_class.rs +++ b/src/v1_21/api/storage/v1/storage_class.rs @@ -394,10 +394,12 @@ impl crate::Metadata for StorageClass { impl crate::DeepMerge for StorageClass { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.allow_volume_expansion, other.allow_volume_expansion); - crate::DeepMerge::merge_from(&mut self.allowed_topologies, other.allowed_topologies); + crate::merge_strategies::list::atomic(&mut self.allowed_topologies, other.allowed_topologies); crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.mount_options, other.mount_options); - crate::DeepMerge::merge_from(&mut self.parameters, other.parameters); + crate::merge_strategies::list::atomic(&mut self.mount_options, other.mount_options); + crate::merge_strategies::map::granular(&mut self.parameters, other.parameters, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.provisioner, other.provisioner); crate::DeepMerge::merge_from(&mut self.reclaim_policy, other.reclaim_policy); crate::DeepMerge::merge_from(&mut self.volume_binding_mode, other.volume_binding_mode); diff --git a/src/v1_21/api/storage/v1/volume_attachment_status.rs b/src/v1_21/api/storage/v1/volume_attachment_status.rs index fb8e63d745..bb6ba3fe42 100644 --- a/src/v1_21/api/storage/v1/volume_attachment_status.rs +++ b/src/v1_21/api/storage/v1/volume_attachment_status.rs @@ -20,7 +20,9 @@ impl crate::DeepMerge for VolumeAttachmentStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.attach_error, other.attach_error); crate::DeepMerge::merge_from(&mut self.attached, other.attached); - crate::DeepMerge::merge_from(&mut self.attachment_metadata, other.attachment_metadata); + crate::merge_strategies::map::granular(&mut self.attachment_metadata, other.attachment_metadata, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.detach_error, other.detach_error); } } diff --git a/src/v1_21/api/storage/v1alpha1/volume_attachment_status.rs b/src/v1_21/api/storage/v1alpha1/volume_attachment_status.rs index db1529fd28..67dd47c5f6 100644 --- a/src/v1_21/api/storage/v1alpha1/volume_attachment_status.rs +++ b/src/v1_21/api/storage/v1alpha1/volume_attachment_status.rs @@ -20,7 +20,9 @@ impl crate::DeepMerge for VolumeAttachmentStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.attach_error, other.attach_error); crate::DeepMerge::merge_from(&mut self.attached, other.attached); - crate::DeepMerge::merge_from(&mut self.attachment_metadata, other.attachment_metadata); + crate::merge_strategies::map::granular(&mut self.attachment_metadata, other.attachment_metadata, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.detach_error, other.detach_error); } } diff --git a/src/v1_21/api/storage/v1beta1/csi_driver_spec.rs b/src/v1_21/api/storage/v1beta1/csi_driver_spec.rs index b2bf23d444..6ea7c07eb0 100644 --- a/src/v1_21/api/storage/v1beta1/csi_driver_spec.rs +++ b/src/v1_21/api/storage/v1beta1/csi_driver_spec.rs @@ -65,8 +65,8 @@ impl crate::DeepMerge for CSIDriverSpec { crate::DeepMerge::merge_from(&mut self.pod_info_on_mount, other.pod_info_on_mount); crate::DeepMerge::merge_from(&mut self.requires_republish, other.requires_republish); crate::DeepMerge::merge_from(&mut self.storage_capacity, other.storage_capacity); - crate::DeepMerge::merge_from(&mut self.token_requests, other.token_requests); - crate::DeepMerge::merge_from(&mut self.volume_lifecycle_modes, other.volume_lifecycle_modes); + crate::merge_strategies::list::atomic(&mut self.token_requests, other.token_requests); + crate::merge_strategies::list::atomic(&mut self.volume_lifecycle_modes, other.volume_lifecycle_modes); } } diff --git a/src/v1_21/api/storage/v1beta1/csi_node_driver.rs b/src/v1_21/api/storage/v1beta1/csi_node_driver.rs index 8b6cf9b096..4adc37626c 100644 --- a/src/v1_21/api/storage/v1beta1/csi_node_driver.rs +++ b/src/v1_21/api/storage/v1beta1/csi_node_driver.rs @@ -21,7 +21,7 @@ impl crate::DeepMerge for CSINodeDriver { crate::DeepMerge::merge_from(&mut self.allocatable, other.allocatable); crate::DeepMerge::merge_from(&mut self.name, other.name); crate::DeepMerge::merge_from(&mut self.node_id, other.node_id); - crate::DeepMerge::merge_from(&mut self.topology_keys, other.topology_keys); + crate::merge_strategies::list::atomic(&mut self.topology_keys, other.topology_keys); } } diff --git a/src/v1_21/api/storage/v1beta1/csi_node_spec.rs b/src/v1_21/api/storage/v1beta1/csi_node_spec.rs index bcc7cca7fc..26851f4028 100644 --- a/src/v1_21/api/storage/v1beta1/csi_node_spec.rs +++ b/src/v1_21/api/storage/v1beta1/csi_node_spec.rs @@ -9,7 +9,14 @@ pub struct CSINodeSpec { impl crate::DeepMerge for CSINodeSpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.drivers, other.drivers); + crate::merge_strategies::list::map( + &mut self.drivers, + other.drivers, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_21/api/storage/v1beta1/storage_class.rs b/src/v1_21/api/storage/v1beta1/storage_class.rs index d8e2c027b2..2a91d4bb61 100644 --- a/src/v1_21/api/storage/v1beta1/storage_class.rs +++ b/src/v1_21/api/storage/v1beta1/storage_class.rs @@ -394,10 +394,12 @@ impl crate::Metadata for StorageClass { impl crate::DeepMerge for StorageClass { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.allow_volume_expansion, other.allow_volume_expansion); - crate::DeepMerge::merge_from(&mut self.allowed_topologies, other.allowed_topologies); + crate::merge_strategies::list::atomic(&mut self.allowed_topologies, other.allowed_topologies); crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.mount_options, other.mount_options); - crate::DeepMerge::merge_from(&mut self.parameters, other.parameters); + crate::merge_strategies::list::atomic(&mut self.mount_options, other.mount_options); + crate::merge_strategies::map::granular(&mut self.parameters, other.parameters, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.provisioner, other.provisioner); crate::DeepMerge::merge_from(&mut self.reclaim_policy, other.reclaim_policy); crate::DeepMerge::merge_from(&mut self.volume_binding_mode, other.volume_binding_mode); diff --git a/src/v1_21/api/storage/v1beta1/volume_attachment_status.rs b/src/v1_21/api/storage/v1beta1/volume_attachment_status.rs index d28e570d75..179cf3aad9 100644 --- a/src/v1_21/api/storage/v1beta1/volume_attachment_status.rs +++ b/src/v1_21/api/storage/v1beta1/volume_attachment_status.rs @@ -20,7 +20,9 @@ impl crate::DeepMerge for VolumeAttachmentStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.attach_error, other.attach_error); crate::DeepMerge::merge_from(&mut self.attached, other.attached); - crate::DeepMerge::merge_from(&mut self.attachment_metadata, other.attachment_metadata); + crate::merge_strategies::map::granular(&mut self.attachment_metadata, other.attachment_metadata, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.detach_error, other.detach_error); } } diff --git a/src/v1_21/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_names.rs b/src/v1_21/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_names.rs index f3a8d38696..d105542807 100644 --- a/src/v1_21/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_names.rs +++ b/src/v1_21/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_names.rs @@ -24,11 +24,11 @@ pub struct CustomResourceDefinitionNames { impl crate::DeepMerge for CustomResourceDefinitionNames { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.categories, other.categories); + crate::merge_strategies::list::atomic(&mut self.categories, other.categories); crate::DeepMerge::merge_from(&mut self.kind, other.kind); crate::DeepMerge::merge_from(&mut self.list_kind, other.list_kind); crate::DeepMerge::merge_from(&mut self.plural, other.plural); - crate::DeepMerge::merge_from(&mut self.short_names, other.short_names); + crate::merge_strategies::list::atomic(&mut self.short_names, other.short_names); crate::DeepMerge::merge_from(&mut self.singular, other.singular); } } diff --git a/src/v1_21/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_spec.rs b/src/v1_21/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_spec.rs index 40ffea9ed1..e3a881e9a4 100644 --- a/src/v1_21/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_spec.rs +++ b/src/v1_21/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_spec.rs @@ -29,7 +29,7 @@ impl crate::DeepMerge for CustomResourceDefinitionSpec { crate::DeepMerge::merge_from(&mut self.names, other.names); crate::DeepMerge::merge_from(&mut self.preserve_unknown_fields, other.preserve_unknown_fields); crate::DeepMerge::merge_from(&mut self.scope, other.scope); - crate::DeepMerge::merge_from(&mut self.versions, other.versions); + crate::merge_strategies::list::atomic(&mut self.versions, other.versions); } } diff --git a/src/v1_21/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_status.rs b/src/v1_21/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_status.rs index a7427347aa..d080a301dc 100644 --- a/src/v1_21/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_status.rs +++ b/src/v1_21/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_status.rs @@ -16,8 +16,15 @@ pub struct CustomResourceDefinitionStatus { impl crate::DeepMerge for CustomResourceDefinitionStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.accepted_names, other.accepted_names); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); - crate::DeepMerge::merge_from(&mut self.stored_versions, other.stored_versions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::list::atomic(&mut self.stored_versions, other.stored_versions); } } diff --git a/src/v1_21/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_version.rs b/src/v1_21/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_version.rs index 5b4d51a697..90a9bb5e32 100644 --- a/src/v1_21/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_version.rs +++ b/src/v1_21/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_version.rs @@ -30,7 +30,7 @@ pub struct CustomResourceDefinitionVersion { impl crate::DeepMerge for CustomResourceDefinitionVersion { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.additional_printer_columns, other.additional_printer_columns); + crate::merge_strategies::list::atomic(&mut self.additional_printer_columns, other.additional_printer_columns); crate::DeepMerge::merge_from(&mut self.deprecated, other.deprecated); crate::DeepMerge::merge_from(&mut self.deprecation_warning, other.deprecation_warning); crate::DeepMerge::merge_from(&mut self.name, other.name); diff --git a/src/v1_21/apiextensions_apiserver/pkg/apis/apiextensions/v1/json_schema_props.rs b/src/v1_21/apiextensions_apiserver/pkg/apis/apiextensions/v1/json_schema_props.rs index bd87461670..35c767acb8 100644 --- a/src/v1_21/apiextensions_apiserver/pkg/apis/apiextensions/v1/json_schema_props.rs +++ b/src/v1_21/apiextensions_apiserver/pkg/apis/apiextensions/v1/json_schema_props.rs @@ -139,13 +139,17 @@ impl crate::DeepMerge for JSONSchemaProps { crate::DeepMerge::merge_from(&mut self.schema, other.schema); crate::DeepMerge::merge_from(&mut self.additional_items, other.additional_items); crate::DeepMerge::merge_from(&mut self.additional_properties, other.additional_properties); - crate::DeepMerge::merge_from(&mut self.all_of, other.all_of); - crate::DeepMerge::merge_from(&mut self.any_of, other.any_of); + crate::merge_strategies::list::atomic(&mut self.all_of, other.all_of); + crate::merge_strategies::list::atomic(&mut self.any_of, other.any_of); crate::DeepMerge::merge_from(&mut self.default, other.default); - crate::DeepMerge::merge_from(&mut self.definitions, other.definitions); - crate::DeepMerge::merge_from(&mut self.dependencies, other.dependencies); + crate::merge_strategies::map::granular(&mut self.definitions, other.definitions, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.dependencies, other.dependencies, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.description, other.description); - crate::DeepMerge::merge_from(&mut self.enum_, other.enum_); + crate::merge_strategies::list::atomic(&mut self.enum_, other.enum_); crate::DeepMerge::merge_from(&mut self.example, other.example); crate::DeepMerge::merge_from(&mut self.exclusive_maximum, other.exclusive_maximum); crate::DeepMerge::merge_from(&mut self.exclusive_minimum, other.exclusive_minimum); @@ -164,17 +168,21 @@ impl crate::DeepMerge for JSONSchemaProps { crate::DeepMerge::merge_from(&mut self.multiple_of, other.multiple_of); crate::DeepMerge::merge_from(&mut self.not, other.not); crate::DeepMerge::merge_from(&mut self.nullable, other.nullable); - crate::DeepMerge::merge_from(&mut self.one_of, other.one_of); + crate::merge_strategies::list::atomic(&mut self.one_of, other.one_of); crate::DeepMerge::merge_from(&mut self.pattern, other.pattern); - crate::DeepMerge::merge_from(&mut self.pattern_properties, other.pattern_properties); - crate::DeepMerge::merge_from(&mut self.properties, other.properties); - crate::DeepMerge::merge_from(&mut self.required, other.required); + crate::merge_strategies::map::granular(&mut self.pattern_properties, other.pattern_properties, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.properties, other.properties, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::list::atomic(&mut self.required, other.required); crate::DeepMerge::merge_from(&mut self.title, other.title); crate::DeepMerge::merge_from(&mut self.type_, other.type_); crate::DeepMerge::merge_from(&mut self.unique_items, other.unique_items); crate::DeepMerge::merge_from(&mut self.x_kubernetes_embedded_resource, other.x_kubernetes_embedded_resource); crate::DeepMerge::merge_from(&mut self.x_kubernetes_int_or_string, other.x_kubernetes_int_or_string); - crate::DeepMerge::merge_from(&mut self.x_kubernetes_list_map_keys, other.x_kubernetes_list_map_keys); + crate::merge_strategies::list::atomic(&mut self.x_kubernetes_list_map_keys, other.x_kubernetes_list_map_keys); crate::DeepMerge::merge_from(&mut self.x_kubernetes_list_type, other.x_kubernetes_list_type); crate::DeepMerge::merge_from(&mut self.x_kubernetes_map_type, other.x_kubernetes_map_type); crate::DeepMerge::merge_from(&mut self.x_kubernetes_preserve_unknown_fields, other.x_kubernetes_preserve_unknown_fields); diff --git a/src/v1_21/apiextensions_apiserver/pkg/apis/apiextensions/v1/webhook_conversion.rs b/src/v1_21/apiextensions_apiserver/pkg/apis/apiextensions/v1/webhook_conversion.rs index aec75dfd39..69008b2dca 100644 --- a/src/v1_21/apiextensions_apiserver/pkg/apis/apiextensions/v1/webhook_conversion.rs +++ b/src/v1_21/apiextensions_apiserver/pkg/apis/apiextensions/v1/webhook_conversion.rs @@ -13,7 +13,7 @@ pub struct WebhookConversion { impl crate::DeepMerge for WebhookConversion { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.client_config, other.client_config); - crate::DeepMerge::merge_from(&mut self.conversion_review_versions, other.conversion_review_versions); + crate::merge_strategies::list::atomic(&mut self.conversion_review_versions, other.conversion_review_versions); } } diff --git a/src/v1_21/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/custom_resource_conversion.rs b/src/v1_21/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/custom_resource_conversion.rs index 2173424db1..7a03743224 100644 --- a/src/v1_21/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/custom_resource_conversion.rs +++ b/src/v1_21/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/custom_resource_conversion.rs @@ -16,7 +16,7 @@ pub struct CustomResourceConversion { impl crate::DeepMerge for CustomResourceConversion { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conversion_review_versions, other.conversion_review_versions); + crate::merge_strategies::list::atomic(&mut self.conversion_review_versions, other.conversion_review_versions); crate::DeepMerge::merge_from(&mut self.strategy, other.strategy); crate::DeepMerge::merge_from(&mut self.webhook_client_config, other.webhook_client_config); } diff --git a/src/v1_21/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/custom_resource_definition_names.rs b/src/v1_21/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/custom_resource_definition_names.rs index 9d4c789f42..dea8cc4418 100644 --- a/src/v1_21/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/custom_resource_definition_names.rs +++ b/src/v1_21/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/custom_resource_definition_names.rs @@ -24,11 +24,11 @@ pub struct CustomResourceDefinitionNames { impl crate::DeepMerge for CustomResourceDefinitionNames { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.categories, other.categories); + crate::merge_strategies::list::atomic(&mut self.categories, other.categories); crate::DeepMerge::merge_from(&mut self.kind, other.kind); crate::DeepMerge::merge_from(&mut self.list_kind, other.list_kind); crate::DeepMerge::merge_from(&mut self.plural, other.plural); - crate::DeepMerge::merge_from(&mut self.short_names, other.short_names); + crate::merge_strategies::list::atomic(&mut self.short_names, other.short_names); crate::DeepMerge::merge_from(&mut self.singular, other.singular); } } diff --git a/src/v1_21/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/custom_resource_definition_spec.rs b/src/v1_21/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/custom_resource_definition_spec.rs index cce6acb1df..851fe5eb77 100644 --- a/src/v1_21/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/custom_resource_definition_spec.rs +++ b/src/v1_21/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/custom_resource_definition_spec.rs @@ -36,7 +36,7 @@ pub struct CustomResourceDefinitionSpec { impl crate::DeepMerge for CustomResourceDefinitionSpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.additional_printer_columns, other.additional_printer_columns); + crate::merge_strategies::list::atomic(&mut self.additional_printer_columns, other.additional_printer_columns); crate::DeepMerge::merge_from(&mut self.conversion, other.conversion); crate::DeepMerge::merge_from(&mut self.group, other.group); crate::DeepMerge::merge_from(&mut self.names, other.names); @@ -45,7 +45,7 @@ impl crate::DeepMerge for CustomResourceDefinitionSpec { crate::DeepMerge::merge_from(&mut self.subresources, other.subresources); crate::DeepMerge::merge_from(&mut self.validation, other.validation); crate::DeepMerge::merge_from(&mut self.version, other.version); - crate::DeepMerge::merge_from(&mut self.versions, other.versions); + crate::merge_strategies::list::atomic(&mut self.versions, other.versions); } } diff --git a/src/v1_21/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/custom_resource_definition_status.rs b/src/v1_21/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/custom_resource_definition_status.rs index e1b4a437e1..22e2a2efc7 100644 --- a/src/v1_21/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/custom_resource_definition_status.rs +++ b/src/v1_21/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/custom_resource_definition_status.rs @@ -16,8 +16,15 @@ pub struct CustomResourceDefinitionStatus { impl crate::DeepMerge for CustomResourceDefinitionStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.accepted_names, other.accepted_names); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); - crate::DeepMerge::merge_from(&mut self.stored_versions, other.stored_versions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::list::atomic(&mut self.stored_versions, other.stored_versions); } } diff --git a/src/v1_21/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/custom_resource_definition_version.rs b/src/v1_21/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/custom_resource_definition_version.rs index 77a776540d..2c2a84b5fc 100644 --- a/src/v1_21/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/custom_resource_definition_version.rs +++ b/src/v1_21/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/custom_resource_definition_version.rs @@ -30,7 +30,7 @@ pub struct CustomResourceDefinitionVersion { impl crate::DeepMerge for CustomResourceDefinitionVersion { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.additional_printer_columns, other.additional_printer_columns); + crate::merge_strategies::list::atomic(&mut self.additional_printer_columns, other.additional_printer_columns); crate::DeepMerge::merge_from(&mut self.deprecated, other.deprecated); crate::DeepMerge::merge_from(&mut self.deprecation_warning, other.deprecation_warning); crate::DeepMerge::merge_from(&mut self.name, other.name); diff --git a/src/v1_21/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/json_schema_props.rs b/src/v1_21/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/json_schema_props.rs index 15059ae615..7fee4a6b35 100644 --- a/src/v1_21/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/json_schema_props.rs +++ b/src/v1_21/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/json_schema_props.rs @@ -139,13 +139,17 @@ impl crate::DeepMerge for JSONSchemaProps { crate::DeepMerge::merge_from(&mut self.schema, other.schema); crate::DeepMerge::merge_from(&mut self.additional_items, other.additional_items); crate::DeepMerge::merge_from(&mut self.additional_properties, other.additional_properties); - crate::DeepMerge::merge_from(&mut self.all_of, other.all_of); - crate::DeepMerge::merge_from(&mut self.any_of, other.any_of); + crate::merge_strategies::list::atomic(&mut self.all_of, other.all_of); + crate::merge_strategies::list::atomic(&mut self.any_of, other.any_of); crate::DeepMerge::merge_from(&mut self.default, other.default); - crate::DeepMerge::merge_from(&mut self.definitions, other.definitions); - crate::DeepMerge::merge_from(&mut self.dependencies, other.dependencies); + crate::merge_strategies::map::granular(&mut self.definitions, other.definitions, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.dependencies, other.dependencies, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.description, other.description); - crate::DeepMerge::merge_from(&mut self.enum_, other.enum_); + crate::merge_strategies::list::atomic(&mut self.enum_, other.enum_); crate::DeepMerge::merge_from(&mut self.example, other.example); crate::DeepMerge::merge_from(&mut self.exclusive_maximum, other.exclusive_maximum); crate::DeepMerge::merge_from(&mut self.exclusive_minimum, other.exclusive_minimum); @@ -164,17 +168,21 @@ impl crate::DeepMerge for JSONSchemaProps { crate::DeepMerge::merge_from(&mut self.multiple_of, other.multiple_of); crate::DeepMerge::merge_from(&mut self.not, other.not); crate::DeepMerge::merge_from(&mut self.nullable, other.nullable); - crate::DeepMerge::merge_from(&mut self.one_of, other.one_of); + crate::merge_strategies::list::atomic(&mut self.one_of, other.one_of); crate::DeepMerge::merge_from(&mut self.pattern, other.pattern); - crate::DeepMerge::merge_from(&mut self.pattern_properties, other.pattern_properties); - crate::DeepMerge::merge_from(&mut self.properties, other.properties); - crate::DeepMerge::merge_from(&mut self.required, other.required); + crate::merge_strategies::map::granular(&mut self.pattern_properties, other.pattern_properties, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.properties, other.properties, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::list::atomic(&mut self.required, other.required); crate::DeepMerge::merge_from(&mut self.title, other.title); crate::DeepMerge::merge_from(&mut self.type_, other.type_); crate::DeepMerge::merge_from(&mut self.unique_items, other.unique_items); crate::DeepMerge::merge_from(&mut self.x_kubernetes_embedded_resource, other.x_kubernetes_embedded_resource); crate::DeepMerge::merge_from(&mut self.x_kubernetes_int_or_string, other.x_kubernetes_int_or_string); - crate::DeepMerge::merge_from(&mut self.x_kubernetes_list_map_keys, other.x_kubernetes_list_map_keys); + crate::merge_strategies::list::atomic(&mut self.x_kubernetes_list_map_keys, other.x_kubernetes_list_map_keys); crate::DeepMerge::merge_from(&mut self.x_kubernetes_list_type, other.x_kubernetes_list_type); crate::DeepMerge::merge_from(&mut self.x_kubernetes_map_type, other.x_kubernetes_map_type); crate::DeepMerge::merge_from(&mut self.x_kubernetes_preserve_unknown_fields, other.x_kubernetes_preserve_unknown_fields); diff --git a/src/v1_21/apimachinery/pkg/apis/meta/v1/api_group.rs b/src/v1_21/apimachinery/pkg/apis/meta/v1/api_group.rs index 3d36440e87..f83318ab08 100644 --- a/src/v1_21/apimachinery/pkg/apis/meta/v1/api_group.rs +++ b/src/v1_21/apimachinery/pkg/apis/meta/v1/api_group.rs @@ -29,8 +29,8 @@ impl crate::DeepMerge for APIGroup { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.name, other.name); crate::DeepMerge::merge_from(&mut self.preferred_version, other.preferred_version); - crate::DeepMerge::merge_from(&mut self.server_address_by_client_cidrs, other.server_address_by_client_cidrs); - crate::DeepMerge::merge_from(&mut self.versions, other.versions); + crate::merge_strategies::list::atomic(&mut self.server_address_by_client_cidrs, other.server_address_by_client_cidrs); + crate::merge_strategies::list::atomic(&mut self.versions, other.versions); } } diff --git a/src/v1_21/apimachinery/pkg/apis/meta/v1/api_group_list.rs b/src/v1_21/apimachinery/pkg/apis/meta/v1/api_group_list.rs index 167aeeabe0..e8a5d7e747 100644 --- a/src/v1_21/apimachinery/pkg/apis/meta/v1/api_group_list.rs +++ b/src/v1_21/apimachinery/pkg/apis/meta/v1/api_group_list.rs @@ -18,7 +18,7 @@ impl crate::Resource for APIGroupList { impl crate::DeepMerge for APIGroupList { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.groups, other.groups); + crate::merge_strategies::list::atomic(&mut self.groups, other.groups); } } diff --git a/src/v1_21/apimachinery/pkg/apis/meta/v1/api_resource.rs b/src/v1_21/apimachinery/pkg/apis/meta/v1/api_resource.rs index e679e8aa73..477c5ad98d 100644 --- a/src/v1_21/apimachinery/pkg/apis/meta/v1/api_resource.rs +++ b/src/v1_21/apimachinery/pkg/apis/meta/v1/api_resource.rs @@ -36,15 +36,15 @@ pub struct APIResource { impl crate::DeepMerge for APIResource { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.categories, other.categories); + crate::merge_strategies::list::atomic(&mut self.categories, other.categories); crate::DeepMerge::merge_from(&mut self.group, other.group); crate::DeepMerge::merge_from(&mut self.kind, other.kind); crate::DeepMerge::merge_from(&mut self.name, other.name); crate::DeepMerge::merge_from(&mut self.namespaced, other.namespaced); - crate::DeepMerge::merge_from(&mut self.short_names, other.short_names); + crate::merge_strategies::list::atomic(&mut self.short_names, other.short_names); crate::DeepMerge::merge_from(&mut self.singular_name, other.singular_name); crate::DeepMerge::merge_from(&mut self.storage_version_hash, other.storage_version_hash); - crate::DeepMerge::merge_from(&mut self.verbs, other.verbs); + crate::merge_strategies::list::atomic(&mut self.verbs, other.verbs); crate::DeepMerge::merge_from(&mut self.version, other.version); } } diff --git a/src/v1_21/apimachinery/pkg/apis/meta/v1/api_resource_list.rs b/src/v1_21/apimachinery/pkg/apis/meta/v1/api_resource_list.rs index a34ba733a3..4107b4f488 100644 --- a/src/v1_21/apimachinery/pkg/apis/meta/v1/api_resource_list.rs +++ b/src/v1_21/apimachinery/pkg/apis/meta/v1/api_resource_list.rs @@ -22,7 +22,7 @@ impl crate::Resource for APIResourceList { impl crate::DeepMerge for APIResourceList { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.group_version, other.group_version); - crate::DeepMerge::merge_from(&mut self.resources, other.resources); + crate::merge_strategies::list::atomic(&mut self.resources, other.resources); } } diff --git a/src/v1_21/apimachinery/pkg/apis/meta/v1/api_versions.rs b/src/v1_21/apimachinery/pkg/apis/meta/v1/api_versions.rs index a2d355ee8d..eda4a89785 100644 --- a/src/v1_21/apimachinery/pkg/apis/meta/v1/api_versions.rs +++ b/src/v1_21/apimachinery/pkg/apis/meta/v1/api_versions.rs @@ -21,8 +21,8 @@ impl crate::Resource for APIVersions { impl crate::DeepMerge for APIVersions { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.server_address_by_client_cidrs, other.server_address_by_client_cidrs); - crate::DeepMerge::merge_from(&mut self.versions, other.versions); + crate::merge_strategies::list::atomic(&mut self.server_address_by_client_cidrs, other.server_address_by_client_cidrs); + crate::merge_strategies::list::atomic(&mut self.versions, other.versions); } } diff --git a/src/v1_21/apimachinery/pkg/apis/meta/v1/delete_options.rs b/src/v1_21/apimachinery/pkg/apis/meta/v1/delete_options.rs index 04abc8215b..4ac6d24fb9 100644 --- a/src/v1_21/apimachinery/pkg/apis/meta/v1/delete_options.rs +++ b/src/v1_21/apimachinery/pkg/apis/meta/v1/delete_options.rs @@ -28,7 +28,7 @@ pub struct DeleteOptions { impl crate::DeepMerge for DeleteOptions { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.api_version, other.api_version); - crate::DeepMerge::merge_from(&mut self.dry_run, other.dry_run); + crate::merge_strategies::list::atomic(&mut self.dry_run, other.dry_run); crate::DeepMerge::merge_from(&mut self.grace_period_seconds, other.grace_period_seconds); crate::DeepMerge::merge_from(&mut self.kind, other.kind); crate::DeepMerge::merge_from(&mut self.orphan_dependents, other.orphan_dependents); diff --git a/src/v1_21/apimachinery/pkg/apis/meta/v1/label_selector.rs b/src/v1_21/apimachinery/pkg/apis/meta/v1/label_selector.rs index 877caad4dd..19028abb99 100644 --- a/src/v1_21/apimachinery/pkg/apis/meta/v1/label_selector.rs +++ b/src/v1_21/apimachinery/pkg/apis/meta/v1/label_selector.rs @@ -12,8 +12,10 @@ pub struct LabelSelector { impl crate::DeepMerge for LabelSelector { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.match_expressions, other.match_expressions); - crate::DeepMerge::merge_from(&mut self.match_labels, other.match_labels); + crate::merge_strategies::list::atomic(&mut self.match_expressions, other.match_expressions); + crate::merge_strategies::map::granular(&mut self.match_labels, other.match_labels, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); } } diff --git a/src/v1_21/apimachinery/pkg/apis/meta/v1/label_selector_requirement.rs b/src/v1_21/apimachinery/pkg/apis/meta/v1/label_selector_requirement.rs index 6570daea42..09c7dc7cc7 100644 --- a/src/v1_21/apimachinery/pkg/apis/meta/v1/label_selector_requirement.rs +++ b/src/v1_21/apimachinery/pkg/apis/meta/v1/label_selector_requirement.rs @@ -17,7 +17,7 @@ impl crate::DeepMerge for LabelSelectorRequirement { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.key, other.key); crate::DeepMerge::merge_from(&mut self.operator, other.operator); - crate::DeepMerge::merge_from(&mut self.values, other.values); + crate::merge_strategies::list::atomic(&mut self.values, other.values); } } 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..b1d8a3ec0d 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 @@ -70,19 +70,30 @@ pub struct ObjectMeta { impl crate::DeepMerge for ObjectMeta { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.annotations, other.annotations); + crate::merge_strategies::map::granular(&mut self.annotations, other.annotations, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); 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::merge_strategies::list::set(&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::merge_strategies::map::granular(&mut self.labels, other.labels, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::list::atomic(&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::merge_strategies::list::map( + &mut self.owner_references, + other.owner_references, + &[|lhs, rhs| lhs.uid == rhs.uid], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); 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); diff --git a/src/v1_21/apimachinery/pkg/apis/meta/v1/status_details.rs b/src/v1_21/apimachinery/pkg/apis/meta/v1/status_details.rs index 183b525d2c..28141f7f6f 100644 --- a/src/v1_21/apimachinery/pkg/apis/meta/v1/status_details.rs +++ b/src/v1_21/apimachinery/pkg/apis/meta/v1/status_details.rs @@ -24,7 +24,7 @@ pub struct StatusDetails { impl crate::DeepMerge for StatusDetails { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.causes, other.causes); + crate::merge_strategies::list::atomic(&mut self.causes, other.causes); crate::DeepMerge::merge_from(&mut self.group, other.group); crate::DeepMerge::merge_from(&mut self.kind, other.kind); crate::DeepMerge::merge_from(&mut self.name, other.name); diff --git a/src/v1_21/kube_aggregator/pkg/apis/apiregistration/v1/api_service_status.rs b/src/v1_21/kube_aggregator/pkg/apis/apiregistration/v1/api_service_status.rs index 658b6ca9ce..72a107b6ba 100644 --- a/src/v1_21/kube_aggregator/pkg/apis/apiregistration/v1/api_service_status.rs +++ b/src/v1_21/kube_aggregator/pkg/apis/apiregistration/v1/api_service_status.rs @@ -9,7 +9,14 @@ pub struct APIServiceStatus { impl crate::DeepMerge for APIServiceStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_21/kube_aggregator/pkg/apis/apiregistration/v1beta1/api_service_status.rs b/src/v1_21/kube_aggregator/pkg/apis/apiregistration/v1beta1/api_service_status.rs index df107a8667..f9830edaf5 100644 --- a/src/v1_21/kube_aggregator/pkg/apis/apiregistration/v1beta1/api_service_status.rs +++ b/src/v1_21/kube_aggregator/pkg/apis/apiregistration/v1beta1/api_service_status.rs @@ -9,7 +9,14 @@ pub struct APIServiceStatus { impl crate::DeepMerge for APIServiceStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_21/list.rs b/src/v1_21/list.rs index cc10bf672f..9863ef1855 100644 --- a/src/v1_21/list.rs +++ b/src/v1_21/list.rs @@ -31,9 +31,16 @@ impl crate::Metadata for List where T: crate::ListableResource { } } -impl crate::DeepMerge for List where T: crate::ListableResource { +impl crate::DeepMerge for List where T: crate::DeepMerge + crate::Metadata + crate::ListableResource { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.items, other.items); + crate::merge_strategies::list::map( + &mut self.items, + other.items, + &[|lhs, rhs| lhs.metadata().namespace == rhs.metadata().namespace, |lhs, rhs| lhs.metadata().name == rhs.metadata().name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); } } diff --git a/src/v1_22/api/admissionregistration/v1/mutating_webhook.rs b/src/v1_22/api/admissionregistration/v1/mutating_webhook.rs index 5b1a4d833f..783200c537 100644 --- a/src/v1_22/api/admissionregistration/v1/mutating_webhook.rs +++ b/src/v1_22/api/admissionregistration/v1/mutating_webhook.rs @@ -81,7 +81,7 @@ pub struct MutatingWebhook { impl crate::DeepMerge for MutatingWebhook { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.admission_review_versions, other.admission_review_versions); + crate::merge_strategies::list::atomic(&mut self.admission_review_versions, other.admission_review_versions); crate::DeepMerge::merge_from(&mut self.client_config, other.client_config); crate::DeepMerge::merge_from(&mut self.failure_policy, other.failure_policy); crate::DeepMerge::merge_from(&mut self.match_policy, other.match_policy); @@ -89,7 +89,7 @@ impl crate::DeepMerge for MutatingWebhook { crate::DeepMerge::merge_from(&mut self.namespace_selector, other.namespace_selector); crate::DeepMerge::merge_from(&mut self.object_selector, other.object_selector); crate::DeepMerge::merge_from(&mut self.reinvocation_policy, other.reinvocation_policy); - crate::DeepMerge::merge_from(&mut self.rules, other.rules); + crate::merge_strategies::list::atomic(&mut self.rules, other.rules); crate::DeepMerge::merge_from(&mut self.side_effects, other.side_effects); crate::DeepMerge::merge_from(&mut self.timeout_seconds, other.timeout_seconds); } 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..156c7ccfcf 100644 --- a/src/v1_22/api/admissionregistration/v1/mutating_webhook_configuration.rs +++ b/src/v1_22/api/admissionregistration/v1/mutating_webhook_configuration.rs @@ -374,7 +374,14 @@ impl crate::Metadata for MutatingWebhookConfiguration { impl crate::DeepMerge for MutatingWebhookConfiguration { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.webhooks, other.webhooks); + crate::merge_strategies::list::map( + &mut self.webhooks, + other.webhooks, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_22/api/admissionregistration/v1/rule_with_operations.rs b/src/v1_22/api/admissionregistration/v1/rule_with_operations.rs index c45c425c57..441b9ab3fd 100644 --- a/src/v1_22/api/admissionregistration/v1/rule_with_operations.rs +++ b/src/v1_22/api/admissionregistration/v1/rule_with_operations.rs @@ -27,10 +27,10 @@ pub struct RuleWithOperations { impl crate::DeepMerge for RuleWithOperations { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.api_groups, other.api_groups); - crate::DeepMerge::merge_from(&mut self.api_versions, other.api_versions); - crate::DeepMerge::merge_from(&mut self.operations, other.operations); - crate::DeepMerge::merge_from(&mut self.resources, other.resources); + crate::merge_strategies::list::atomic(&mut self.api_groups, other.api_groups); + crate::merge_strategies::list::atomic(&mut self.api_versions, other.api_versions); + crate::merge_strategies::list::atomic(&mut self.operations, other.operations); + crate::merge_strategies::list::atomic(&mut self.resources, other.resources); crate::DeepMerge::merge_from(&mut self.scope, other.scope); } } diff --git a/src/v1_22/api/admissionregistration/v1/validating_webhook.rs b/src/v1_22/api/admissionregistration/v1/validating_webhook.rs index 1a64d4e885..e594176265 100644 --- a/src/v1_22/api/admissionregistration/v1/validating_webhook.rs +++ b/src/v1_22/api/admissionregistration/v1/validating_webhook.rs @@ -72,14 +72,14 @@ pub struct ValidatingWebhook { impl crate::DeepMerge for ValidatingWebhook { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.admission_review_versions, other.admission_review_versions); + crate::merge_strategies::list::atomic(&mut self.admission_review_versions, other.admission_review_versions); crate::DeepMerge::merge_from(&mut self.client_config, other.client_config); crate::DeepMerge::merge_from(&mut self.failure_policy, other.failure_policy); crate::DeepMerge::merge_from(&mut self.match_policy, other.match_policy); crate::DeepMerge::merge_from(&mut self.name, other.name); crate::DeepMerge::merge_from(&mut self.namespace_selector, other.namespace_selector); crate::DeepMerge::merge_from(&mut self.object_selector, other.object_selector); - crate::DeepMerge::merge_from(&mut self.rules, other.rules); + crate::merge_strategies::list::atomic(&mut self.rules, other.rules); crate::DeepMerge::merge_from(&mut self.side_effects, other.side_effects); crate::DeepMerge::merge_from(&mut self.timeout_seconds, other.timeout_seconds); } 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..ff20990424 100644 --- a/src/v1_22/api/admissionregistration/v1/validating_webhook_configuration.rs +++ b/src/v1_22/api/admissionregistration/v1/validating_webhook_configuration.rs @@ -374,7 +374,14 @@ impl crate::Metadata for ValidatingWebhookConfiguration { impl crate::DeepMerge for ValidatingWebhookConfiguration { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.webhooks, other.webhooks); + crate::merge_strategies::list::map( + &mut self.webhooks, + other.webhooks, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_22/api/apiserverinternal/v1alpha1/server_storage_version.rs b/src/v1_22/api/apiserverinternal/v1alpha1/server_storage_version.rs index 1040b5e6d7..5a693d9e59 100644 --- a/src/v1_22/api/apiserverinternal/v1alpha1/server_storage_version.rs +++ b/src/v1_22/api/apiserverinternal/v1alpha1/server_storage_version.rs @@ -16,7 +16,7 @@ pub struct ServerStorageVersion { impl crate::DeepMerge for ServerStorageVersion { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.api_server_id, other.api_server_id); - crate::DeepMerge::merge_from(&mut self.decodable_versions, other.decodable_versions); + crate::merge_strategies::list::set(&mut self.decodable_versions, other.decodable_versions); crate::DeepMerge::merge_from(&mut self.encoding_version, other.encoding_version); } } diff --git a/src/v1_22/api/apiserverinternal/v1alpha1/storage_version_status.rs b/src/v1_22/api/apiserverinternal/v1alpha1/storage_version_status.rs index e63b469644..0d5b9bd3a1 100644 --- a/src/v1_22/api/apiserverinternal/v1alpha1/storage_version_status.rs +++ b/src/v1_22/api/apiserverinternal/v1alpha1/storage_version_status.rs @@ -16,8 +16,22 @@ pub struct StorageVersionStatus { impl crate::DeepMerge for StorageVersionStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.common_encoding_version, other.common_encoding_version); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); - crate::DeepMerge::merge_from(&mut self.storage_versions, other.storage_versions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::list::map( + &mut self.storage_versions, + other.storage_versions, + &[|lhs, rhs| lhs.api_server_id == rhs.api_server_id], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_22/api/apps/v1/daemon_set_status.rs b/src/v1_22/api/apps/v1/daemon_set_status.rs index 42df0deaa3..9d2564a3a3 100644 --- a/src/v1_22/api/apps/v1/daemon_set_status.rs +++ b/src/v1_22/api/apps/v1/daemon_set_status.rs @@ -37,7 +37,14 @@ pub struct DaemonSetStatus { impl crate::DeepMerge for DaemonSetStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.collision_count, other.collision_count); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.current_number_scheduled, other.current_number_scheduled); crate::DeepMerge::merge_from(&mut self.desired_number_scheduled, other.desired_number_scheduled); crate::DeepMerge::merge_from(&mut self.number_available, other.number_available); diff --git a/src/v1_22/api/apps/v1/deployment_status.rs b/src/v1_22/api/apps/v1/deployment_status.rs index 0eb14f47b4..c277884099 100644 --- a/src/v1_22/api/apps/v1/deployment_status.rs +++ b/src/v1_22/api/apps/v1/deployment_status.rs @@ -32,7 +32,14 @@ impl crate::DeepMerge for DeploymentStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.available_replicas, other.available_replicas); crate::DeepMerge::merge_from(&mut self.collision_count, other.collision_count); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.observed_generation, other.observed_generation); crate::DeepMerge::merge_from(&mut self.ready_replicas, other.ready_replicas); crate::DeepMerge::merge_from(&mut self.replicas, other.replicas); diff --git a/src/v1_22/api/apps/v1/replica_set_status.rs b/src/v1_22/api/apps/v1/replica_set_status.rs index 5873b11fdc..60d7e94dce 100644 --- a/src/v1_22/api/apps/v1/replica_set_status.rs +++ b/src/v1_22/api/apps/v1/replica_set_status.rs @@ -25,7 +25,14 @@ pub struct ReplicaSetStatus { impl crate::DeepMerge for ReplicaSetStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.available_replicas, other.available_replicas); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.fully_labeled_replicas, other.fully_labeled_replicas); crate::DeepMerge::merge_from(&mut self.observed_generation, other.observed_generation); crate::DeepMerge::merge_from(&mut self.ready_replicas, other.ready_replicas); diff --git a/src/v1_22/api/apps/v1/stateful_set_spec.rs b/src/v1_22/api/apps/v1/stateful_set_spec.rs index 1963bff399..e9ec552bba 100644 --- a/src/v1_22/api/apps/v1/stateful_set_spec.rs +++ b/src/v1_22/api/apps/v1/stateful_set_spec.rs @@ -41,7 +41,7 @@ impl crate::DeepMerge for StatefulSetSpec { crate::DeepMerge::merge_from(&mut self.service_name, other.service_name); crate::DeepMerge::merge_from(&mut self.template, other.template); crate::DeepMerge::merge_from(&mut self.update_strategy, other.update_strategy); - crate::DeepMerge::merge_from(&mut self.volume_claim_templates, other.volume_claim_templates); + crate::merge_strategies::list::atomic(&mut self.volume_claim_templates, other.volume_claim_templates); } } diff --git a/src/v1_22/api/apps/v1/stateful_set_status.rs b/src/v1_22/api/apps/v1/stateful_set_status.rs index 3e5620f3a0..13e27b6e54 100644 --- a/src/v1_22/api/apps/v1/stateful_set_status.rs +++ b/src/v1_22/api/apps/v1/stateful_set_status.rs @@ -38,7 +38,14 @@ impl crate::DeepMerge for StatefulSetStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.available_replicas, other.available_replicas); crate::DeepMerge::merge_from(&mut self.collision_count, other.collision_count); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.current_replicas, other.current_replicas); crate::DeepMerge::merge_from(&mut self.current_revision, other.current_revision); crate::DeepMerge::merge_from(&mut self.observed_generation, other.observed_generation); diff --git a/src/v1_22/api/authentication/v1/token_request_spec.rs b/src/v1_22/api/authentication/v1/token_request_spec.rs index 4ec786f381..f10197a68c 100644 --- a/src/v1_22/api/authentication/v1/token_request_spec.rs +++ b/src/v1_22/api/authentication/v1/token_request_spec.rs @@ -15,7 +15,7 @@ pub struct TokenRequestSpec { impl crate::DeepMerge for TokenRequestSpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.audiences, other.audiences); + crate::merge_strategies::list::atomic(&mut self.audiences, other.audiences); crate::DeepMerge::merge_from(&mut self.bound_object_ref, other.bound_object_ref); crate::DeepMerge::merge_from(&mut self.expiration_seconds, other.expiration_seconds); } diff --git a/src/v1_22/api/authentication/v1/token_review_spec.rs b/src/v1_22/api/authentication/v1/token_review_spec.rs index fd84653924..281127b67d 100644 --- a/src/v1_22/api/authentication/v1/token_review_spec.rs +++ b/src/v1_22/api/authentication/v1/token_review_spec.rs @@ -12,7 +12,7 @@ pub struct TokenReviewSpec { impl crate::DeepMerge for TokenReviewSpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.audiences, other.audiences); + crate::merge_strategies::list::atomic(&mut self.audiences, other.audiences); crate::DeepMerge::merge_from(&mut self.token, other.token); } } diff --git a/src/v1_22/api/authentication/v1/token_review_status.rs b/src/v1_22/api/authentication/v1/token_review_status.rs index 464164bcf9..4dd5aacc3d 100644 --- a/src/v1_22/api/authentication/v1/token_review_status.rs +++ b/src/v1_22/api/authentication/v1/token_review_status.rs @@ -18,7 +18,7 @@ pub struct TokenReviewStatus { impl crate::DeepMerge for TokenReviewStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.audiences, other.audiences); + crate::merge_strategies::list::atomic(&mut self.audiences, other.audiences); crate::DeepMerge::merge_from(&mut self.authenticated, other.authenticated); crate::DeepMerge::merge_from(&mut self.error, other.error); crate::DeepMerge::merge_from(&mut self.user, other.user); diff --git a/src/v1_22/api/authentication/v1/user_info.rs b/src/v1_22/api/authentication/v1/user_info.rs index d6890119b7..3890788cda 100644 --- a/src/v1_22/api/authentication/v1/user_info.rs +++ b/src/v1_22/api/authentication/v1/user_info.rs @@ -18,8 +18,10 @@ pub struct UserInfo { impl crate::DeepMerge for UserInfo { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.extra, other.extra); - crate::DeepMerge::merge_from(&mut self.groups, other.groups); + crate::merge_strategies::map::granular(&mut self.extra, other.extra, |current_item, other_item| { + crate::merge_strategies::list::atomic(current_item, other_item); + }); + crate::merge_strategies::list::atomic(&mut self.groups, other.groups); crate::DeepMerge::merge_from(&mut self.uid, other.uid); crate::DeepMerge::merge_from(&mut self.username, other.username); } diff --git a/src/v1_22/api/authorization/v1/non_resource_rule.rs b/src/v1_22/api/authorization/v1/non_resource_rule.rs index 7df269ffd7..db780454b8 100644 --- a/src/v1_22/api/authorization/v1/non_resource_rule.rs +++ b/src/v1_22/api/authorization/v1/non_resource_rule.rs @@ -12,8 +12,8 @@ pub struct NonResourceRule { impl crate::DeepMerge for NonResourceRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.non_resource_urls, other.non_resource_urls); - crate::DeepMerge::merge_from(&mut self.verbs, other.verbs); + crate::merge_strategies::list::atomic(&mut self.non_resource_urls, other.non_resource_urls); + crate::merge_strategies::list::atomic(&mut self.verbs, other.verbs); } } diff --git a/src/v1_22/api/authorization/v1/resource_rule.rs b/src/v1_22/api/authorization/v1/resource_rule.rs index 58b5e020a8..1af9333654 100644 --- a/src/v1_22/api/authorization/v1/resource_rule.rs +++ b/src/v1_22/api/authorization/v1/resource_rule.rs @@ -19,10 +19,10 @@ pub struct ResourceRule { impl crate::DeepMerge for ResourceRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.api_groups, other.api_groups); - crate::DeepMerge::merge_from(&mut self.resource_names, other.resource_names); - crate::DeepMerge::merge_from(&mut self.resources, other.resources); - crate::DeepMerge::merge_from(&mut self.verbs, other.verbs); + crate::merge_strategies::list::atomic(&mut self.api_groups, other.api_groups); + crate::merge_strategies::list::atomic(&mut self.resource_names, other.resource_names); + crate::merge_strategies::list::atomic(&mut self.resources, other.resources); + crate::merge_strategies::list::atomic(&mut self.verbs, other.verbs); } } diff --git a/src/v1_22/api/authorization/v1/subject_access_review_spec.rs b/src/v1_22/api/authorization/v1/subject_access_review_spec.rs index ae8fadafd9..a4c4af18ce 100644 --- a/src/v1_22/api/authorization/v1/subject_access_review_spec.rs +++ b/src/v1_22/api/authorization/v1/subject_access_review_spec.rs @@ -24,8 +24,10 @@ pub struct SubjectAccessReviewSpec { impl crate::DeepMerge for SubjectAccessReviewSpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.extra, other.extra); - crate::DeepMerge::merge_from(&mut self.groups, other.groups); + crate::merge_strategies::map::granular(&mut self.extra, other.extra, |current_item, other_item| { + crate::merge_strategies::list::atomic(current_item, other_item); + }); + crate::merge_strategies::list::atomic(&mut self.groups, other.groups); crate::DeepMerge::merge_from(&mut self.non_resource_attributes, other.non_resource_attributes); crate::DeepMerge::merge_from(&mut self.resource_attributes, other.resource_attributes); crate::DeepMerge::merge_from(&mut self.uid, other.uid); diff --git a/src/v1_22/api/authorization/v1/subject_rules_review_status.rs b/src/v1_22/api/authorization/v1/subject_rules_review_status.rs index 9d7fb042cf..9d1682a3c8 100644 --- a/src/v1_22/api/authorization/v1/subject_rules_review_status.rs +++ b/src/v1_22/api/authorization/v1/subject_rules_review_status.rs @@ -20,8 +20,8 @@ impl crate::DeepMerge for SubjectRulesReviewStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.evaluation_error, other.evaluation_error); crate::DeepMerge::merge_from(&mut self.incomplete, other.incomplete); - crate::DeepMerge::merge_from(&mut self.non_resource_rules, other.non_resource_rules); - crate::DeepMerge::merge_from(&mut self.resource_rules, other.resource_rules); + crate::merge_strategies::list::atomic(&mut self.non_resource_rules, other.non_resource_rules); + crate::merge_strategies::list::atomic(&mut self.resource_rules, other.resource_rules); } } diff --git a/src/v1_22/api/autoscaling/v2beta1/horizontal_pod_autoscaler_spec.rs b/src/v1_22/api/autoscaling/v2beta1/horizontal_pod_autoscaler_spec.rs index dd2649f83e..c286723a24 100644 --- a/src/v1_22/api/autoscaling/v2beta1/horizontal_pod_autoscaler_spec.rs +++ b/src/v1_22/api/autoscaling/v2beta1/horizontal_pod_autoscaler_spec.rs @@ -19,7 +19,7 @@ pub struct HorizontalPodAutoscalerSpec { impl crate::DeepMerge for HorizontalPodAutoscalerSpec { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.max_replicas, other.max_replicas); - crate::DeepMerge::merge_from(&mut self.metrics, other.metrics); + crate::merge_strategies::list::atomic(&mut self.metrics, other.metrics); crate::DeepMerge::merge_from(&mut self.min_replicas, other.min_replicas); crate::DeepMerge::merge_from(&mut self.scale_target_ref, other.scale_target_ref); } diff --git a/src/v1_22/api/autoscaling/v2beta1/horizontal_pod_autoscaler_status.rs b/src/v1_22/api/autoscaling/v2beta1/horizontal_pod_autoscaler_status.rs index f626003266..a4dc183a7f 100644 --- a/src/v1_22/api/autoscaling/v2beta1/horizontal_pod_autoscaler_status.rs +++ b/src/v1_22/api/autoscaling/v2beta1/horizontal_pod_autoscaler_status.rs @@ -24,8 +24,8 @@ pub struct HorizontalPodAutoscalerStatus { impl crate::DeepMerge for HorizontalPodAutoscalerStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); - crate::DeepMerge::merge_from(&mut self.current_metrics, other.current_metrics); + crate::merge_strategies::list::atomic(&mut self.conditions, other.conditions); + crate::merge_strategies::list::atomic(&mut self.current_metrics, other.current_metrics); crate::DeepMerge::merge_from(&mut self.current_replicas, other.current_replicas); crate::DeepMerge::merge_from(&mut self.desired_replicas, other.desired_replicas); crate::DeepMerge::merge_from(&mut self.last_scale_time, other.last_scale_time); diff --git a/src/v1_22/api/autoscaling/v2beta2/horizontal_pod_autoscaler_spec.rs b/src/v1_22/api/autoscaling/v2beta2/horizontal_pod_autoscaler_spec.rs index c529e49162..681cf9c99b 100644 --- a/src/v1_22/api/autoscaling/v2beta2/horizontal_pod_autoscaler_spec.rs +++ b/src/v1_22/api/autoscaling/v2beta2/horizontal_pod_autoscaler_spec.rs @@ -23,7 +23,7 @@ impl crate::DeepMerge for HorizontalPodAutoscalerSpec { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.behavior, other.behavior); crate::DeepMerge::merge_from(&mut self.max_replicas, other.max_replicas); - crate::DeepMerge::merge_from(&mut self.metrics, other.metrics); + crate::merge_strategies::list::atomic(&mut self.metrics, other.metrics); crate::DeepMerge::merge_from(&mut self.min_replicas, other.min_replicas); crate::DeepMerge::merge_from(&mut self.scale_target_ref, other.scale_target_ref); } diff --git a/src/v1_22/api/autoscaling/v2beta2/horizontal_pod_autoscaler_status.rs b/src/v1_22/api/autoscaling/v2beta2/horizontal_pod_autoscaler_status.rs index ee1cef4668..1c3f421d0e 100644 --- a/src/v1_22/api/autoscaling/v2beta2/horizontal_pod_autoscaler_status.rs +++ b/src/v1_22/api/autoscaling/v2beta2/horizontal_pod_autoscaler_status.rs @@ -24,8 +24,8 @@ pub struct HorizontalPodAutoscalerStatus { impl crate::DeepMerge for HorizontalPodAutoscalerStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); - crate::DeepMerge::merge_from(&mut self.current_metrics, other.current_metrics); + crate::merge_strategies::list::atomic(&mut self.conditions, other.conditions); + crate::merge_strategies::list::atomic(&mut self.current_metrics, other.current_metrics); crate::DeepMerge::merge_from(&mut self.current_replicas, other.current_replicas); crate::DeepMerge::merge_from(&mut self.desired_replicas, other.desired_replicas); crate::DeepMerge::merge_from(&mut self.last_scale_time, other.last_scale_time); diff --git a/src/v1_22/api/autoscaling/v2beta2/hpa_scaling_rules.rs b/src/v1_22/api/autoscaling/v2beta2/hpa_scaling_rules.rs index 3b62f0dd91..fde69f31c4 100644 --- a/src/v1_22/api/autoscaling/v2beta2/hpa_scaling_rules.rs +++ b/src/v1_22/api/autoscaling/v2beta2/hpa_scaling_rules.rs @@ -15,7 +15,7 @@ pub struct HPAScalingRules { impl crate::DeepMerge for HPAScalingRules { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.policies, other.policies); + crate::merge_strategies::list::atomic(&mut self.policies, other.policies); crate::DeepMerge::merge_from(&mut self.select_policy, other.select_policy); crate::DeepMerge::merge_from(&mut self.stabilization_window_seconds, other.stabilization_window_seconds); } diff --git a/src/v1_22/api/batch/v1/cron_job_status.rs b/src/v1_22/api/batch/v1/cron_job_status.rs index cbd83e8fcd..c0f24458eb 100644 --- a/src/v1_22/api/batch/v1/cron_job_status.rs +++ b/src/v1_22/api/batch/v1/cron_job_status.rs @@ -15,7 +15,7 @@ pub struct CronJobStatus { impl crate::DeepMerge for CronJobStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.active, other.active); + crate::merge_strategies::list::atomic(&mut self.active, other.active); crate::DeepMerge::merge_from(&mut self.last_schedule_time, other.last_schedule_time); crate::DeepMerge::merge_from(&mut self.last_successful_time, other.last_successful_time); } diff --git a/src/v1_22/api/batch/v1/job_status.rs b/src/v1_22/api/batch/v1/job_status.rs index 8f71f0ea6c..97b9762433 100644 --- a/src/v1_22/api/batch/v1/job_status.rs +++ b/src/v1_22/api/batch/v1/job_status.rs @@ -38,7 +38,14 @@ impl crate::DeepMerge for JobStatus { crate::DeepMerge::merge_from(&mut self.active, other.active); crate::DeepMerge::merge_from(&mut self.completed_indexes, other.completed_indexes); crate::DeepMerge::merge_from(&mut self.completion_time, other.completion_time); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.failed, other.failed); crate::DeepMerge::merge_from(&mut self.start_time, other.start_time); crate::DeepMerge::merge_from(&mut self.succeeded, other.succeeded); diff --git a/src/v1_22/api/batch/v1/uncounted_terminated_pods.rs b/src/v1_22/api/batch/v1/uncounted_terminated_pods.rs index 8235855121..45335381cf 100644 --- a/src/v1_22/api/batch/v1/uncounted_terminated_pods.rs +++ b/src/v1_22/api/batch/v1/uncounted_terminated_pods.rs @@ -12,8 +12,8 @@ pub struct UncountedTerminatedPods { impl crate::DeepMerge for UncountedTerminatedPods { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.failed, other.failed); - crate::DeepMerge::merge_from(&mut self.succeeded, other.succeeded); + crate::merge_strategies::list::set(&mut self.failed, other.failed); + crate::merge_strategies::list::set(&mut self.succeeded, other.succeeded); } } diff --git a/src/v1_22/api/batch/v1beta1/cron_job_status.rs b/src/v1_22/api/batch/v1beta1/cron_job_status.rs index 3e8851f77d..3498f7cd58 100644 --- a/src/v1_22/api/batch/v1beta1/cron_job_status.rs +++ b/src/v1_22/api/batch/v1beta1/cron_job_status.rs @@ -15,7 +15,7 @@ pub struct CronJobStatus { impl crate::DeepMerge for CronJobStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.active, other.active); + crate::merge_strategies::list::atomic(&mut self.active, other.active); crate::DeepMerge::merge_from(&mut self.last_schedule_time, other.last_schedule_time); crate::DeepMerge::merge_from(&mut self.last_successful_time, other.last_successful_time); } diff --git a/src/v1_22/api/certificates/v1/certificate_signing_request_spec.rs b/src/v1_22/api/certificates/v1/certificate_signing_request_spec.rs index 36fd52a817..6742ec7695 100644 --- a/src/v1_22/api/certificates/v1/certificate_signing_request_spec.rs +++ b/src/v1_22/api/certificates/v1/certificate_signing_request_spec.rs @@ -77,12 +77,14 @@ pub struct CertificateSigningRequestSpec { impl crate::DeepMerge for CertificateSigningRequestSpec { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.expiration_seconds, other.expiration_seconds); - crate::DeepMerge::merge_from(&mut self.extra, other.extra); - crate::DeepMerge::merge_from(&mut self.groups, other.groups); + crate::merge_strategies::map::granular(&mut self.extra, other.extra, |current_item, other_item| { + crate::merge_strategies::list::atomic(current_item, other_item); + }); + crate::merge_strategies::list::atomic(&mut self.groups, other.groups); crate::DeepMerge::merge_from(&mut self.request, other.request); crate::DeepMerge::merge_from(&mut self.signer_name, other.signer_name); crate::DeepMerge::merge_from(&mut self.uid, other.uid); - crate::DeepMerge::merge_from(&mut self.usages, other.usages); + crate::merge_strategies::list::atomic(&mut self.usages, other.usages); crate::DeepMerge::merge_from(&mut self.username, other.username); } } diff --git a/src/v1_22/api/certificates/v1/certificate_signing_request_status.rs b/src/v1_22/api/certificates/v1/certificate_signing_request_status.rs index 81fb876580..d17c51933f 100644 --- a/src/v1_22/api/certificates/v1/certificate_signing_request_status.rs +++ b/src/v1_22/api/certificates/v1/certificate_signing_request_status.rs @@ -34,7 +34,14 @@ pub struct CertificateSigningRequestStatus { impl crate::DeepMerge for CertificateSigningRequestStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.certificate, other.certificate); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_22/api/core/v1/capabilities.rs b/src/v1_22/api/core/v1/capabilities.rs index 6045e4f5d2..1a260b5256 100644 --- a/src/v1_22/api/core/v1/capabilities.rs +++ b/src/v1_22/api/core/v1/capabilities.rs @@ -12,8 +12,8 @@ pub struct Capabilities { impl crate::DeepMerge for Capabilities { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.add, other.add); - crate::DeepMerge::merge_from(&mut self.drop, other.drop); + crate::merge_strategies::list::atomic(&mut self.add, other.add); + crate::merge_strategies::list::atomic(&mut self.drop, other.drop); } } diff --git a/src/v1_22/api/core/v1/ceph_fs_persistent_volume_source.rs b/src/v1_22/api/core/v1/ceph_fs_persistent_volume_source.rs index 5db02966fd..708ee7615e 100644 --- a/src/v1_22/api/core/v1/ceph_fs_persistent_volume_source.rs +++ b/src/v1_22/api/core/v1/ceph_fs_persistent_volume_source.rs @@ -24,7 +24,7 @@ pub struct CephFSPersistentVolumeSource { impl crate::DeepMerge for CephFSPersistentVolumeSource { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.monitors, other.monitors); + crate::merge_strategies::list::atomic(&mut self.monitors, other.monitors); crate::DeepMerge::merge_from(&mut self.path, other.path); crate::DeepMerge::merge_from(&mut self.read_only, other.read_only); crate::DeepMerge::merge_from(&mut self.secret_file, other.secret_file); diff --git a/src/v1_22/api/core/v1/ceph_fs_volume_source.rs b/src/v1_22/api/core/v1/ceph_fs_volume_source.rs index 1be27ee35c..689608de39 100644 --- a/src/v1_22/api/core/v1/ceph_fs_volume_source.rs +++ b/src/v1_22/api/core/v1/ceph_fs_volume_source.rs @@ -24,7 +24,7 @@ pub struct CephFSVolumeSource { impl crate::DeepMerge for CephFSVolumeSource { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.monitors, other.monitors); + crate::merge_strategies::list::atomic(&mut self.monitors, other.monitors); crate::DeepMerge::merge_from(&mut self.path, other.path); crate::DeepMerge::merge_from(&mut self.read_only, other.read_only); crate::DeepMerge::merge_from(&mut self.secret_file, other.secret_file); diff --git a/src/v1_22/api/core/v1/component_status.rs b/src/v1_22/api/core/v1/component_status.rs index ecddf82170..50e55665e4 100644 --- a/src/v1_22/api/core/v1/component_status.rs +++ b/src/v1_22/api/core/v1/component_status.rs @@ -172,7 +172,14 @@ impl crate::Metadata for ComponentStatus { impl crate::DeepMerge for ComponentStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); } } diff --git a/src/v1_22/api/core/v1/config_map.rs b/src/v1_22/api/core/v1/config_map.rs index 361b45a3a1..7d07e59a99 100644 --- a/src/v1_22/api/core/v1/config_map.rs +++ b/src/v1_22/api/core/v1/config_map.rs @@ -495,8 +495,12 @@ impl crate::Metadata for ConfigMap { impl crate::DeepMerge for ConfigMap { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.binary_data, other.binary_data); - crate::DeepMerge::merge_from(&mut self.data, other.data); + crate::merge_strategies::map::granular(&mut self.binary_data, other.binary_data, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.data, other.data, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.immutable, other.immutable); crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); } diff --git a/src/v1_22/api/core/v1/config_map_projection.rs b/src/v1_22/api/core/v1/config_map_projection.rs index 458f277bb3..e2a94bc391 100644 --- a/src/v1_22/api/core/v1/config_map_projection.rs +++ b/src/v1_22/api/core/v1/config_map_projection.rs @@ -17,7 +17,7 @@ pub struct ConfigMapProjection { impl crate::DeepMerge for ConfigMapProjection { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.items, other.items); + crate::merge_strategies::list::atomic(&mut self.items, other.items); crate::DeepMerge::merge_from(&mut self.name, other.name); crate::DeepMerge::merge_from(&mut self.optional, other.optional); } diff --git a/src/v1_22/api/core/v1/config_map_volume_source.rs b/src/v1_22/api/core/v1/config_map_volume_source.rs index 915b10bdcd..b612fcb857 100644 --- a/src/v1_22/api/core/v1/config_map_volume_source.rs +++ b/src/v1_22/api/core/v1/config_map_volume_source.rs @@ -21,7 +21,7 @@ pub struct ConfigMapVolumeSource { impl crate::DeepMerge for ConfigMapVolumeSource { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.default_mode, other.default_mode); - crate::DeepMerge::merge_from(&mut self.items, other.items); + crate::merge_strategies::list::atomic(&mut self.items, other.items); crate::DeepMerge::merge_from(&mut self.name, other.name); crate::DeepMerge::merge_from(&mut self.optional, other.optional); } diff --git a/src/v1_22/api/core/v1/container.rs b/src/v1_22/api/core/v1/container.rs index b20992133e..523375271d 100644 --- a/src/v1_22/api/core/v1/container.rs +++ b/src/v1_22/api/core/v1/container.rs @@ -72,16 +72,30 @@ pub struct Container { impl crate::DeepMerge for Container { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.args, other.args); - crate::DeepMerge::merge_from(&mut self.command, other.command); - crate::DeepMerge::merge_from(&mut self.env, other.env); - crate::DeepMerge::merge_from(&mut self.env_from, other.env_from); + crate::merge_strategies::list::atomic(&mut self.args, other.args); + crate::merge_strategies::list::atomic(&mut self.command, other.command); + crate::merge_strategies::list::map( + &mut self.env, + other.env, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::list::atomic(&mut self.env_from, other.env_from); crate::DeepMerge::merge_from(&mut self.image, other.image); crate::DeepMerge::merge_from(&mut self.image_pull_policy, other.image_pull_policy); crate::DeepMerge::merge_from(&mut self.lifecycle, other.lifecycle); crate::DeepMerge::merge_from(&mut self.liveness_probe, other.liveness_probe); crate::DeepMerge::merge_from(&mut self.name, other.name); - crate::DeepMerge::merge_from(&mut self.ports, other.ports); + crate::merge_strategies::list::map( + &mut self.ports, + other.ports, + &[|lhs, rhs| lhs.container_port == rhs.container_port], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.readiness_probe, other.readiness_probe); crate::DeepMerge::merge_from(&mut self.resources, other.resources); crate::DeepMerge::merge_from(&mut self.security_context, other.security_context); @@ -91,8 +105,22 @@ impl crate::DeepMerge for Container { crate::DeepMerge::merge_from(&mut self.termination_message_path, other.termination_message_path); crate::DeepMerge::merge_from(&mut self.termination_message_policy, other.termination_message_policy); crate::DeepMerge::merge_from(&mut self.tty, other.tty); - crate::DeepMerge::merge_from(&mut self.volume_devices, other.volume_devices); - crate::DeepMerge::merge_from(&mut self.volume_mounts, other.volume_mounts); + crate::merge_strategies::list::map( + &mut self.volume_devices, + other.volume_devices, + &[|lhs, rhs| lhs.device_path == rhs.device_path], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::list::map( + &mut self.volume_mounts, + other.volume_mounts, + &[|lhs, rhs| lhs.mount_path == rhs.mount_path], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.working_dir, other.working_dir); } } diff --git a/src/v1_22/api/core/v1/container_image.rs b/src/v1_22/api/core/v1/container_image.rs index 697ef4906e..871033f834 100644 --- a/src/v1_22/api/core/v1/container_image.rs +++ b/src/v1_22/api/core/v1/container_image.rs @@ -12,7 +12,7 @@ pub struct ContainerImage { impl crate::DeepMerge for ContainerImage { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.names, other.names); + crate::merge_strategies::list::atomic(&mut self.names, other.names); crate::DeepMerge::merge_from(&mut self.size_bytes, other.size_bytes); } } diff --git a/src/v1_22/api/core/v1/csi_persistent_volume_source.rs b/src/v1_22/api/core/v1/csi_persistent_volume_source.rs index b8b244ea2b..7d04fa8349 100644 --- a/src/v1_22/api/core/v1/csi_persistent_volume_source.rs +++ b/src/v1_22/api/core/v1/csi_persistent_volume_source.rs @@ -40,7 +40,9 @@ impl crate::DeepMerge for CSIPersistentVolumeSource { crate::DeepMerge::merge_from(&mut self.node_publish_secret_ref, other.node_publish_secret_ref); crate::DeepMerge::merge_from(&mut self.node_stage_secret_ref, other.node_stage_secret_ref); crate::DeepMerge::merge_from(&mut self.read_only, other.read_only); - crate::DeepMerge::merge_from(&mut self.volume_attributes, other.volume_attributes); + crate::merge_strategies::map::granular(&mut self.volume_attributes, other.volume_attributes, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.volume_handle, other.volume_handle); } } diff --git a/src/v1_22/api/core/v1/csi_volume_source.rs b/src/v1_22/api/core/v1/csi_volume_source.rs index e5a311c536..2b2f26aa48 100644 --- a/src/v1_22/api/core/v1/csi_volume_source.rs +++ b/src/v1_22/api/core/v1/csi_volume_source.rs @@ -25,7 +25,9 @@ impl crate::DeepMerge for CSIVolumeSource { crate::DeepMerge::merge_from(&mut self.fs_type, other.fs_type); crate::DeepMerge::merge_from(&mut self.node_publish_secret_ref, other.node_publish_secret_ref); crate::DeepMerge::merge_from(&mut self.read_only, other.read_only); - crate::DeepMerge::merge_from(&mut self.volume_attributes, other.volume_attributes); + crate::merge_strategies::map::granular(&mut self.volume_attributes, other.volume_attributes, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); } } diff --git a/src/v1_22/api/core/v1/downward_api_projection.rs b/src/v1_22/api/core/v1/downward_api_projection.rs index de0fca6185..950e2e5645 100644 --- a/src/v1_22/api/core/v1/downward_api_projection.rs +++ b/src/v1_22/api/core/v1/downward_api_projection.rs @@ -9,7 +9,7 @@ pub struct DownwardAPIProjection { impl crate::DeepMerge for DownwardAPIProjection { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.items, other.items); + crate::merge_strategies::list::atomic(&mut self.items, other.items); } } diff --git a/src/v1_22/api/core/v1/downward_api_volume_source.rs b/src/v1_22/api/core/v1/downward_api_volume_source.rs index 214c15f03f..96b4ebb987 100644 --- a/src/v1_22/api/core/v1/downward_api_volume_source.rs +++ b/src/v1_22/api/core/v1/downward_api_volume_source.rs @@ -13,7 +13,7 @@ pub struct DownwardAPIVolumeSource { impl crate::DeepMerge for DownwardAPIVolumeSource { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.default_mode, other.default_mode); - crate::DeepMerge::merge_from(&mut self.items, other.items); + crate::merge_strategies::list::atomic(&mut self.items, other.items); } } diff --git a/src/v1_22/api/core/v1/endpoint_subset.rs b/src/v1_22/api/core/v1/endpoint_subset.rs index c395596b77..20ca195e97 100644 --- a/src/v1_22/api/core/v1/endpoint_subset.rs +++ b/src/v1_22/api/core/v1/endpoint_subset.rs @@ -22,9 +22,9 @@ pub struct EndpointSubset { impl crate::DeepMerge for EndpointSubset { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.addresses, other.addresses); - crate::DeepMerge::merge_from(&mut self.not_ready_addresses, other.not_ready_addresses); - crate::DeepMerge::merge_from(&mut self.ports, other.ports); + crate::merge_strategies::list::atomic(&mut self.addresses, other.addresses); + crate::merge_strategies::list::atomic(&mut self.not_ready_addresses, other.not_ready_addresses); + crate::merge_strategies::list::atomic(&mut self.ports, other.ports); } } diff --git a/src/v1_22/api/core/v1/endpoints.rs b/src/v1_22/api/core/v1/endpoints.rs index c9b545e04c..7ce1fbc5ba 100644 --- a/src/v1_22/api/core/v1/endpoints.rs +++ b/src/v1_22/api/core/v1/endpoints.rs @@ -501,7 +501,7 @@ impl crate::Metadata for Endpoints { impl crate::DeepMerge for Endpoints { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.subsets, other.subsets); + crate::merge_strategies::list::atomic(&mut self.subsets, other.subsets); } } diff --git a/src/v1_22/api/core/v1/ephemeral_container.rs b/src/v1_22/api/core/v1/ephemeral_container.rs index 8a337b1384..1646f7e0b6 100644 --- a/src/v1_22/api/core/v1/ephemeral_container.rs +++ b/src/v1_22/api/core/v1/ephemeral_container.rs @@ -75,16 +75,23 @@ pub struct EphemeralContainer { impl crate::DeepMerge for EphemeralContainer { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.args, other.args); - crate::DeepMerge::merge_from(&mut self.command, other.command); - crate::DeepMerge::merge_from(&mut self.env, other.env); - crate::DeepMerge::merge_from(&mut self.env_from, other.env_from); + crate::merge_strategies::list::atomic(&mut self.args, other.args); + crate::merge_strategies::list::atomic(&mut self.command, other.command); + crate::merge_strategies::list::map( + &mut self.env, + other.env, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::list::atomic(&mut self.env_from, other.env_from); crate::DeepMerge::merge_from(&mut self.image, other.image); crate::DeepMerge::merge_from(&mut self.image_pull_policy, other.image_pull_policy); crate::DeepMerge::merge_from(&mut self.lifecycle, other.lifecycle); crate::DeepMerge::merge_from(&mut self.liveness_probe, other.liveness_probe); crate::DeepMerge::merge_from(&mut self.name, other.name); - crate::DeepMerge::merge_from(&mut self.ports, other.ports); + crate::merge_strategies::list::atomic(&mut self.ports, other.ports); crate::DeepMerge::merge_from(&mut self.readiness_probe, other.readiness_probe); crate::DeepMerge::merge_from(&mut self.resources, other.resources); crate::DeepMerge::merge_from(&mut self.security_context, other.security_context); @@ -95,8 +102,22 @@ impl crate::DeepMerge for EphemeralContainer { crate::DeepMerge::merge_from(&mut self.termination_message_path, other.termination_message_path); crate::DeepMerge::merge_from(&mut self.termination_message_policy, other.termination_message_policy); crate::DeepMerge::merge_from(&mut self.tty, other.tty); - crate::DeepMerge::merge_from(&mut self.volume_devices, other.volume_devices); - crate::DeepMerge::merge_from(&mut self.volume_mounts, other.volume_mounts); + crate::merge_strategies::list::map( + &mut self.volume_devices, + other.volume_devices, + &[|lhs, rhs| lhs.device_path == rhs.device_path], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::list::map( + &mut self.volume_mounts, + other.volume_mounts, + &[|lhs, rhs| lhs.mount_path == rhs.mount_path], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.working_dir, other.working_dir); } } diff --git a/src/v1_22/api/core/v1/exec_action.rs b/src/v1_22/api/core/v1/exec_action.rs index fc5ddd099a..07e888786c 100644 --- a/src/v1_22/api/core/v1/exec_action.rs +++ b/src/v1_22/api/core/v1/exec_action.rs @@ -9,7 +9,7 @@ pub struct ExecAction { impl crate::DeepMerge for ExecAction { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.command, other.command); + crate::merge_strategies::list::atomic(&mut self.command, other.command); } } diff --git a/src/v1_22/api/core/v1/fc_volume_source.rs b/src/v1_22/api/core/v1/fc_volume_source.rs index 932c210a2b..6477ad5ed5 100644 --- a/src/v1_22/api/core/v1/fc_volume_source.rs +++ b/src/v1_22/api/core/v1/fc_volume_source.rs @@ -24,8 +24,8 @@ impl crate::DeepMerge for FCVolumeSource { crate::DeepMerge::merge_from(&mut self.fs_type, other.fs_type); crate::DeepMerge::merge_from(&mut self.lun, other.lun); crate::DeepMerge::merge_from(&mut self.read_only, other.read_only); - crate::DeepMerge::merge_from(&mut self.target_wwns, other.target_wwns); - crate::DeepMerge::merge_from(&mut self.wwids, other.wwids); + crate::merge_strategies::list::atomic(&mut self.target_wwns, other.target_wwns); + crate::merge_strategies::list::atomic(&mut self.wwids, other.wwids); } } diff --git a/src/v1_22/api/core/v1/flex_persistent_volume_source.rs b/src/v1_22/api/core/v1/flex_persistent_volume_source.rs index 76d27f8583..10ebd43c4a 100644 --- a/src/v1_22/api/core/v1/flex_persistent_volume_source.rs +++ b/src/v1_22/api/core/v1/flex_persistent_volume_source.rs @@ -23,7 +23,9 @@ impl crate::DeepMerge for FlexPersistentVolumeSource { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.driver, other.driver); crate::DeepMerge::merge_from(&mut self.fs_type, other.fs_type); - crate::DeepMerge::merge_from(&mut self.options, other.options); + crate::merge_strategies::map::granular(&mut self.options, other.options, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.read_only, other.read_only); crate::DeepMerge::merge_from(&mut self.secret_ref, other.secret_ref); } diff --git a/src/v1_22/api/core/v1/flex_volume_source.rs b/src/v1_22/api/core/v1/flex_volume_source.rs index f9e64fcbf4..6075eadc1f 100644 --- a/src/v1_22/api/core/v1/flex_volume_source.rs +++ b/src/v1_22/api/core/v1/flex_volume_source.rs @@ -23,7 +23,9 @@ impl crate::DeepMerge for FlexVolumeSource { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.driver, other.driver); crate::DeepMerge::merge_from(&mut self.fs_type, other.fs_type); - crate::DeepMerge::merge_from(&mut self.options, other.options); + crate::merge_strategies::map::granular(&mut self.options, other.options, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.read_only, other.read_only); crate::DeepMerge::merge_from(&mut self.secret_ref, other.secret_ref); } diff --git a/src/v1_22/api/core/v1/host_alias.rs b/src/v1_22/api/core/v1/host_alias.rs index 9320f6d9e1..8ea648c7ad 100644 --- a/src/v1_22/api/core/v1/host_alias.rs +++ b/src/v1_22/api/core/v1/host_alias.rs @@ -12,7 +12,7 @@ pub struct HostAlias { impl crate::DeepMerge for HostAlias { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.hostnames, other.hostnames); + crate::merge_strategies::list::atomic(&mut self.hostnames, other.hostnames); crate::DeepMerge::merge_from(&mut self.ip, other.ip); } } diff --git a/src/v1_22/api/core/v1/http_get_action.rs b/src/v1_22/api/core/v1/http_get_action.rs index 6af211ad2c..10257ae1a2 100644 --- a/src/v1_22/api/core/v1/http_get_action.rs +++ b/src/v1_22/api/core/v1/http_get_action.rs @@ -22,7 +22,7 @@ pub struct HTTPGetAction { impl crate::DeepMerge for HTTPGetAction { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.host, other.host); - crate::DeepMerge::merge_from(&mut self.http_headers, other.http_headers); + crate::merge_strategies::list::atomic(&mut self.http_headers, other.http_headers); crate::DeepMerge::merge_from(&mut self.path, other.path); crate::DeepMerge::merge_from(&mut self.port, other.port); crate::DeepMerge::merge_from(&mut self.scheme, other.scheme); diff --git a/src/v1_22/api/core/v1/iscsi_persistent_volume_source.rs b/src/v1_22/api/core/v1/iscsi_persistent_volume_source.rs index 939da3bc50..842c901958 100644 --- a/src/v1_22/api/core/v1/iscsi_persistent_volume_source.rs +++ b/src/v1_22/api/core/v1/iscsi_persistent_volume_source.rs @@ -46,7 +46,7 @@ impl crate::DeepMerge for ISCSIPersistentVolumeSource { crate::DeepMerge::merge_from(&mut self.iqn, other.iqn); crate::DeepMerge::merge_from(&mut self.iscsi_interface, other.iscsi_interface); crate::DeepMerge::merge_from(&mut self.lun, other.lun); - crate::DeepMerge::merge_from(&mut self.portals, other.portals); + crate::merge_strategies::list::atomic(&mut self.portals, other.portals); crate::DeepMerge::merge_from(&mut self.read_only, other.read_only); crate::DeepMerge::merge_from(&mut self.secret_ref, other.secret_ref); crate::DeepMerge::merge_from(&mut self.target_portal, other.target_portal); diff --git a/src/v1_22/api/core/v1/iscsi_volume_source.rs b/src/v1_22/api/core/v1/iscsi_volume_source.rs index 1d75bc85e0..7b8f0324f4 100644 --- a/src/v1_22/api/core/v1/iscsi_volume_source.rs +++ b/src/v1_22/api/core/v1/iscsi_volume_source.rs @@ -46,7 +46,7 @@ impl crate::DeepMerge for ISCSIVolumeSource { crate::DeepMerge::merge_from(&mut self.iqn, other.iqn); crate::DeepMerge::merge_from(&mut self.iscsi_interface, other.iscsi_interface); crate::DeepMerge::merge_from(&mut self.lun, other.lun); - crate::DeepMerge::merge_from(&mut self.portals, other.portals); + crate::merge_strategies::list::atomic(&mut self.portals, other.portals); crate::DeepMerge::merge_from(&mut self.read_only, other.read_only); crate::DeepMerge::merge_from(&mut self.secret_ref, other.secret_ref); crate::DeepMerge::merge_from(&mut self.target_portal, other.target_portal); diff --git a/src/v1_22/api/core/v1/limit_range_item.rs b/src/v1_22/api/core/v1/limit_range_item.rs index 3aada5aaaa..d8431aec87 100644 --- a/src/v1_22/api/core/v1/limit_range_item.rs +++ b/src/v1_22/api/core/v1/limit_range_item.rs @@ -24,11 +24,21 @@ pub struct LimitRangeItem { impl crate::DeepMerge for LimitRangeItem { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.default, other.default); - crate::DeepMerge::merge_from(&mut self.default_request, other.default_request); - crate::DeepMerge::merge_from(&mut self.max, other.max); - crate::DeepMerge::merge_from(&mut self.max_limit_request_ratio, other.max_limit_request_ratio); - crate::DeepMerge::merge_from(&mut self.min, other.min); + crate::merge_strategies::map::granular(&mut self.default, other.default, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.default_request, other.default_request, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.max, other.max, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.max_limit_request_ratio, other.max_limit_request_ratio, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.min, other.min, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.type_, other.type_); } } diff --git a/src/v1_22/api/core/v1/limit_range_spec.rs b/src/v1_22/api/core/v1/limit_range_spec.rs index d3db20e828..14cacbd619 100644 --- a/src/v1_22/api/core/v1/limit_range_spec.rs +++ b/src/v1_22/api/core/v1/limit_range_spec.rs @@ -9,7 +9,7 @@ pub struct LimitRangeSpec { impl crate::DeepMerge for LimitRangeSpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.limits, other.limits); + crate::merge_strategies::list::atomic(&mut self.limits, other.limits); } } diff --git a/src/v1_22/api/core/v1/load_balancer_ingress.rs b/src/v1_22/api/core/v1/load_balancer_ingress.rs index fe804334cf..ffce22ba8b 100644 --- a/src/v1_22/api/core/v1/load_balancer_ingress.rs +++ b/src/v1_22/api/core/v1/load_balancer_ingress.rs @@ -17,7 +17,7 @@ impl crate::DeepMerge for LoadBalancerIngress { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.hostname, other.hostname); crate::DeepMerge::merge_from(&mut self.ip, other.ip); - crate::DeepMerge::merge_from(&mut self.ports, other.ports); + crate::merge_strategies::list::atomic(&mut self.ports, other.ports); } } diff --git a/src/v1_22/api/core/v1/load_balancer_status.rs b/src/v1_22/api/core/v1/load_balancer_status.rs index 46d791f8e1..67379f9e4e 100644 --- a/src/v1_22/api/core/v1/load_balancer_status.rs +++ b/src/v1_22/api/core/v1/load_balancer_status.rs @@ -9,7 +9,7 @@ pub struct LoadBalancerStatus { impl crate::DeepMerge for LoadBalancerStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.ingress, other.ingress); + crate::merge_strategies::list::atomic(&mut self.ingress, other.ingress); } } diff --git a/src/v1_22/api/core/v1/namespace_spec.rs b/src/v1_22/api/core/v1/namespace_spec.rs index 5ae9e5ef2e..cbf697e1e1 100644 --- a/src/v1_22/api/core/v1/namespace_spec.rs +++ b/src/v1_22/api/core/v1/namespace_spec.rs @@ -9,7 +9,7 @@ pub struct NamespaceSpec { impl crate::DeepMerge for NamespaceSpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.finalizers, other.finalizers); + crate::merge_strategies::list::atomic(&mut self.finalizers, other.finalizers); } } diff --git a/src/v1_22/api/core/v1/namespace_status.rs b/src/v1_22/api/core/v1/namespace_status.rs index 71546d290a..cc0ad15316 100644 --- a/src/v1_22/api/core/v1/namespace_status.rs +++ b/src/v1_22/api/core/v1/namespace_status.rs @@ -12,7 +12,14 @@ pub struct NamespaceStatus { impl crate::DeepMerge for NamespaceStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.phase, other.phase); } } diff --git a/src/v1_22/api/core/v1/node_affinity.rs b/src/v1_22/api/core/v1/node_affinity.rs index 2a70de8703..dfd14357a3 100644 --- a/src/v1_22/api/core/v1/node_affinity.rs +++ b/src/v1_22/api/core/v1/node_affinity.rs @@ -12,7 +12,7 @@ pub struct NodeAffinity { impl crate::DeepMerge for NodeAffinity { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.preferred_during_scheduling_ignored_during_execution, other.preferred_during_scheduling_ignored_during_execution); + crate::merge_strategies::list::atomic(&mut self.preferred_during_scheduling_ignored_during_execution, other.preferred_during_scheduling_ignored_during_execution); crate::DeepMerge::merge_from(&mut self.required_during_scheduling_ignored_during_execution, other.required_during_scheduling_ignored_during_execution); } } diff --git a/src/v1_22/api/core/v1/node_selector.rs b/src/v1_22/api/core/v1/node_selector.rs index 5b146c615e..997fba9ef3 100644 --- a/src/v1_22/api/core/v1/node_selector.rs +++ b/src/v1_22/api/core/v1/node_selector.rs @@ -9,7 +9,7 @@ pub struct NodeSelector { impl crate::DeepMerge for NodeSelector { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.node_selector_terms, other.node_selector_terms); + crate::merge_strategies::list::atomic(&mut self.node_selector_terms, other.node_selector_terms); } } diff --git a/src/v1_22/api/core/v1/node_selector_requirement.rs b/src/v1_22/api/core/v1/node_selector_requirement.rs index 4e0a41917c..d360d05de2 100644 --- a/src/v1_22/api/core/v1/node_selector_requirement.rs +++ b/src/v1_22/api/core/v1/node_selector_requirement.rs @@ -17,7 +17,7 @@ impl crate::DeepMerge for NodeSelectorRequirement { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.key, other.key); crate::DeepMerge::merge_from(&mut self.operator, other.operator); - crate::DeepMerge::merge_from(&mut self.values, other.values); + crate::merge_strategies::list::atomic(&mut self.values, other.values); } } diff --git a/src/v1_22/api/core/v1/node_selector_term.rs b/src/v1_22/api/core/v1/node_selector_term.rs index b0d28cc176..1237883670 100644 --- a/src/v1_22/api/core/v1/node_selector_term.rs +++ b/src/v1_22/api/core/v1/node_selector_term.rs @@ -12,8 +12,8 @@ pub struct NodeSelectorTerm { impl crate::DeepMerge for NodeSelectorTerm { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.match_expressions, other.match_expressions); - crate::DeepMerge::merge_from(&mut self.match_fields, other.match_fields); + crate::merge_strategies::list::atomic(&mut self.match_expressions, other.match_expressions); + crate::merge_strategies::list::atomic(&mut self.match_fields, other.match_fields); } } diff --git a/src/v1_22/api/core/v1/node_spec.rs b/src/v1_22/api/core/v1/node_spec.rs index f21a139a6b..50f0264cf0 100644 --- a/src/v1_22/api/core/v1/node_spec.rs +++ b/src/v1_22/api/core/v1/node_spec.rs @@ -30,9 +30,9 @@ impl crate::DeepMerge for NodeSpec { crate::DeepMerge::merge_from(&mut self.config_source, other.config_source); crate::DeepMerge::merge_from(&mut self.external_id, other.external_id); crate::DeepMerge::merge_from(&mut self.pod_cidr, other.pod_cidr); - crate::DeepMerge::merge_from(&mut self.pod_cidrs, other.pod_cidrs); + crate::merge_strategies::list::set(&mut self.pod_cidrs, other.pod_cidrs); crate::DeepMerge::merge_from(&mut self.provider_id, other.provider_id); - crate::DeepMerge::merge_from(&mut self.taints, other.taints); + crate::merge_strategies::list::atomic(&mut self.taints, other.taints); crate::DeepMerge::merge_from(&mut self.unschedulable, other.unschedulable); } } diff --git a/src/v1_22/api/core/v1/node_status.rs b/src/v1_22/api/core/v1/node_status.rs index c15202e84d..7a3fc56d2a 100644 --- a/src/v1_22/api/core/v1/node_status.rs +++ b/src/v1_22/api/core/v1/node_status.rs @@ -39,17 +39,35 @@ pub struct NodeStatus { impl crate::DeepMerge for NodeStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.addresses, other.addresses); - crate::DeepMerge::merge_from(&mut self.allocatable, other.allocatable); - crate::DeepMerge::merge_from(&mut self.capacity, other.capacity); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.addresses, + other.addresses, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::map::granular(&mut self.allocatable, other.allocatable, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.capacity, other.capacity, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.config, other.config); crate::DeepMerge::merge_from(&mut self.daemon_endpoints, other.daemon_endpoints); - crate::DeepMerge::merge_from(&mut self.images, other.images); + crate::merge_strategies::list::atomic(&mut self.images, other.images); crate::DeepMerge::merge_from(&mut self.node_info, other.node_info); crate::DeepMerge::merge_from(&mut self.phase, other.phase); - crate::DeepMerge::merge_from(&mut self.volumes_attached, other.volumes_attached); - crate::DeepMerge::merge_from(&mut self.volumes_in_use, other.volumes_in_use); + crate::merge_strategies::list::atomic(&mut self.volumes_attached, other.volumes_attached); + crate::merge_strategies::list::atomic(&mut self.volumes_in_use, other.volumes_in_use); } } diff --git a/src/v1_22/api/core/v1/persistent_volume_claim_spec.rs b/src/v1_22/api/core/v1/persistent_volume_claim_spec.rs index 8c31c1131b..f6c8323784 100644 --- a/src/v1_22/api/core/v1/persistent_volume_claim_spec.rs +++ b/src/v1_22/api/core/v1/persistent_volume_claim_spec.rs @@ -35,7 +35,7 @@ pub struct PersistentVolumeClaimSpec { impl crate::DeepMerge for PersistentVolumeClaimSpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.access_modes, other.access_modes); + crate::merge_strategies::list::atomic(&mut self.access_modes, other.access_modes); crate::DeepMerge::merge_from(&mut self.data_source, other.data_source); crate::DeepMerge::merge_from(&mut self.data_source_ref, other.data_source_ref); crate::DeepMerge::merge_from(&mut self.resources, other.resources); diff --git a/src/v1_22/api/core/v1/persistent_volume_claim_status.rs b/src/v1_22/api/core/v1/persistent_volume_claim_status.rs index 1df895286f..4b2e8adf88 100644 --- a/src/v1_22/api/core/v1/persistent_volume_claim_status.rs +++ b/src/v1_22/api/core/v1/persistent_volume_claim_status.rs @@ -18,9 +18,18 @@ pub struct PersistentVolumeClaimStatus { impl crate::DeepMerge for PersistentVolumeClaimStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.access_modes, other.access_modes); - crate::DeepMerge::merge_from(&mut self.capacity, other.capacity); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::atomic(&mut self.access_modes, other.access_modes); + crate::merge_strategies::map::granular(&mut self.capacity, other.capacity, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.phase, other.phase); } } diff --git a/src/v1_22/api/core/v1/persistent_volume_spec.rs b/src/v1_22/api/core/v1/persistent_volume_spec.rs index 9e4ada4389..63c3cdae68 100644 --- a/src/v1_22/api/core/v1/persistent_volume_spec.rs +++ b/src/v1_22/api/core/v1/persistent_volume_spec.rs @@ -96,11 +96,13 @@ pub struct PersistentVolumeSpec { impl crate::DeepMerge for PersistentVolumeSpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.access_modes, other.access_modes); + crate::merge_strategies::list::atomic(&mut self.access_modes, other.access_modes); crate::DeepMerge::merge_from(&mut self.aws_elastic_block_store, other.aws_elastic_block_store); crate::DeepMerge::merge_from(&mut self.azure_disk, other.azure_disk); crate::DeepMerge::merge_from(&mut self.azure_file, other.azure_file); - crate::DeepMerge::merge_from(&mut self.capacity, other.capacity); + crate::merge_strategies::map::granular(&mut self.capacity, other.capacity, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.cephfs, other.cephfs); crate::DeepMerge::merge_from(&mut self.cinder, other.cinder); crate::DeepMerge::merge_from(&mut self.claim_ref, other.claim_ref); @@ -113,7 +115,7 @@ impl crate::DeepMerge for PersistentVolumeSpec { crate::DeepMerge::merge_from(&mut self.host_path, other.host_path); crate::DeepMerge::merge_from(&mut self.iscsi, other.iscsi); crate::DeepMerge::merge_from(&mut self.local, other.local); - crate::DeepMerge::merge_from(&mut self.mount_options, other.mount_options); + crate::merge_strategies::list::atomic(&mut self.mount_options, other.mount_options); crate::DeepMerge::merge_from(&mut self.nfs, other.nfs); crate::DeepMerge::merge_from(&mut self.node_affinity, other.node_affinity); crate::DeepMerge::merge_from(&mut self.persistent_volume_reclaim_policy, other.persistent_volume_reclaim_policy); diff --git a/src/v1_22/api/core/v1/pod_affinity.rs b/src/v1_22/api/core/v1/pod_affinity.rs index facc781ff6..a528250bbc 100644 --- a/src/v1_22/api/core/v1/pod_affinity.rs +++ b/src/v1_22/api/core/v1/pod_affinity.rs @@ -12,8 +12,8 @@ pub struct PodAffinity { impl crate::DeepMerge for PodAffinity { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.preferred_during_scheduling_ignored_during_execution, other.preferred_during_scheduling_ignored_during_execution); - crate::DeepMerge::merge_from(&mut self.required_during_scheduling_ignored_during_execution, other.required_during_scheduling_ignored_during_execution); + crate::merge_strategies::list::atomic(&mut self.preferred_during_scheduling_ignored_during_execution, other.preferred_during_scheduling_ignored_during_execution); + crate::merge_strategies::list::atomic(&mut self.required_during_scheduling_ignored_during_execution, other.required_during_scheduling_ignored_during_execution); } } diff --git a/src/v1_22/api/core/v1/pod_affinity_term.rs b/src/v1_22/api/core/v1/pod_affinity_term.rs index f514b64071..1b92b398b0 100644 --- a/src/v1_22/api/core/v1/pod_affinity_term.rs +++ b/src/v1_22/api/core/v1/pod_affinity_term.rs @@ -20,7 +20,7 @@ impl crate::DeepMerge for PodAffinityTerm { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.label_selector, other.label_selector); crate::DeepMerge::merge_from(&mut self.namespace_selector, other.namespace_selector); - crate::DeepMerge::merge_from(&mut self.namespaces, other.namespaces); + crate::merge_strategies::list::atomic(&mut self.namespaces, other.namespaces); crate::DeepMerge::merge_from(&mut self.topology_key, other.topology_key); } } diff --git a/src/v1_22/api/core/v1/pod_anti_affinity.rs b/src/v1_22/api/core/v1/pod_anti_affinity.rs index a6cd6aa584..86979017ac 100644 --- a/src/v1_22/api/core/v1/pod_anti_affinity.rs +++ b/src/v1_22/api/core/v1/pod_anti_affinity.rs @@ -12,8 +12,8 @@ pub struct PodAntiAffinity { impl crate::DeepMerge for PodAntiAffinity { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.preferred_during_scheduling_ignored_during_execution, other.preferred_during_scheduling_ignored_during_execution); - crate::DeepMerge::merge_from(&mut self.required_during_scheduling_ignored_during_execution, other.required_during_scheduling_ignored_during_execution); + crate::merge_strategies::list::atomic(&mut self.preferred_during_scheduling_ignored_during_execution, other.preferred_during_scheduling_ignored_during_execution); + crate::merge_strategies::list::atomic(&mut self.required_during_scheduling_ignored_during_execution, other.required_during_scheduling_ignored_during_execution); } } diff --git a/src/v1_22/api/core/v1/pod_dns_config.rs b/src/v1_22/api/core/v1/pod_dns_config.rs index b79282bb55..201eb4d69c 100644 --- a/src/v1_22/api/core/v1/pod_dns_config.rs +++ b/src/v1_22/api/core/v1/pod_dns_config.rs @@ -15,9 +15,9 @@ pub struct PodDNSConfig { impl crate::DeepMerge for PodDNSConfig { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.nameservers, other.nameservers); - crate::DeepMerge::merge_from(&mut self.options, other.options); - crate::DeepMerge::merge_from(&mut self.searches, other.searches); + crate::merge_strategies::list::atomic(&mut self.nameservers, other.nameservers); + crate::merge_strategies::list::atomic(&mut self.options, other.options); + crate::merge_strategies::list::atomic(&mut self.searches, other.searches); } } diff --git a/src/v1_22/api/core/v1/pod_security_context.rs b/src/v1_22/api/core/v1/pod_security_context.rs index 216148abb8..181672cde7 100644 --- a/src/v1_22/api/core/v1/pod_security_context.rs +++ b/src/v1_22/api/core/v1/pod_security_context.rs @@ -47,8 +47,8 @@ impl crate::DeepMerge for PodSecurityContext { crate::DeepMerge::merge_from(&mut self.run_as_user, other.run_as_user); crate::DeepMerge::merge_from(&mut self.se_linux_options, other.se_linux_options); crate::DeepMerge::merge_from(&mut self.seccomp_profile, other.seccomp_profile); - crate::DeepMerge::merge_from(&mut self.supplemental_groups, other.supplemental_groups); - crate::DeepMerge::merge_from(&mut self.sysctls, other.sysctls); + crate::merge_strategies::list::atomic(&mut self.supplemental_groups, other.supplemental_groups); + crate::merge_strategies::list::atomic(&mut self.sysctls, other.sysctls); crate::DeepMerge::merge_from(&mut self.windows_options, other.windows_options); } } diff --git a/src/v1_22/api/core/v1/pod_spec.rs b/src/v1_22/api/core/v1/pod_spec.rs index 09b7e92f38..275abdac27 100644 --- a/src/v1_22/api/core/v1/pod_spec.rs +++ b/src/v1_22/api/core/v1/pod_spec.rs @@ -114,25 +114,62 @@ impl crate::DeepMerge for PodSpec { crate::DeepMerge::merge_from(&mut self.active_deadline_seconds, other.active_deadline_seconds); crate::DeepMerge::merge_from(&mut self.affinity, other.affinity); crate::DeepMerge::merge_from(&mut self.automount_service_account_token, other.automount_service_account_token); - crate::DeepMerge::merge_from(&mut self.containers, other.containers); + crate::merge_strategies::list::map( + &mut self.containers, + other.containers, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.dns_config, other.dns_config); crate::DeepMerge::merge_from(&mut self.dns_policy, other.dns_policy); crate::DeepMerge::merge_from(&mut self.enable_service_links, other.enable_service_links); - crate::DeepMerge::merge_from(&mut self.ephemeral_containers, other.ephemeral_containers); - crate::DeepMerge::merge_from(&mut self.host_aliases, other.host_aliases); + crate::merge_strategies::list::map( + &mut self.ephemeral_containers, + other.ephemeral_containers, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::list::map( + &mut self.host_aliases, + other.host_aliases, + &[|lhs, rhs| lhs.ip == rhs.ip], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.host_ipc, other.host_ipc); crate::DeepMerge::merge_from(&mut self.host_network, other.host_network); crate::DeepMerge::merge_from(&mut self.host_pid, other.host_pid); crate::DeepMerge::merge_from(&mut self.hostname, other.hostname); - crate::DeepMerge::merge_from(&mut self.image_pull_secrets, other.image_pull_secrets); - crate::DeepMerge::merge_from(&mut self.init_containers, other.init_containers); + crate::merge_strategies::list::map( + &mut self.image_pull_secrets, + other.image_pull_secrets, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::list::map( + &mut self.init_containers, + other.init_containers, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.node_name, other.node_name); - crate::DeepMerge::merge_from(&mut self.node_selector, other.node_selector); - crate::DeepMerge::merge_from(&mut self.overhead, other.overhead); + crate::merge_strategies::map::atomic(&mut self.node_selector, other.node_selector); + crate::merge_strategies::map::granular(&mut self.overhead, other.overhead, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.preemption_policy, other.preemption_policy); crate::DeepMerge::merge_from(&mut self.priority, other.priority); crate::DeepMerge::merge_from(&mut self.priority_class_name, other.priority_class_name); - crate::DeepMerge::merge_from(&mut self.readiness_gates, other.readiness_gates); + crate::merge_strategies::list::atomic(&mut self.readiness_gates, other.readiness_gates); crate::DeepMerge::merge_from(&mut self.restart_policy, other.restart_policy); crate::DeepMerge::merge_from(&mut self.runtime_class_name, other.runtime_class_name); crate::DeepMerge::merge_from(&mut self.scheduler_name, other.scheduler_name); @@ -143,9 +180,23 @@ impl crate::DeepMerge for PodSpec { crate::DeepMerge::merge_from(&mut self.share_process_namespace, other.share_process_namespace); crate::DeepMerge::merge_from(&mut self.subdomain, other.subdomain); crate::DeepMerge::merge_from(&mut self.termination_grace_period_seconds, other.termination_grace_period_seconds); - crate::DeepMerge::merge_from(&mut self.tolerations, other.tolerations); - crate::DeepMerge::merge_from(&mut self.topology_spread_constraints, other.topology_spread_constraints); - crate::DeepMerge::merge_from(&mut self.volumes, other.volumes); + crate::merge_strategies::list::atomic(&mut self.tolerations, other.tolerations); + crate::merge_strategies::list::map( + &mut self.topology_spread_constraints, + other.topology_spread_constraints, + &[|lhs, rhs| lhs.topology_key == rhs.topology_key], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::list::map( + &mut self.volumes, + other.volumes, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_22/api/core/v1/pod_status.rs b/src/v1_22/api/core/v1/pod_status.rs index e1bfacf3db..b93586f4d8 100644 --- a/src/v1_22/api/core/v1/pod_status.rs +++ b/src/v1_22/api/core/v1/pod_status.rs @@ -49,16 +49,30 @@ pub struct PodStatus { impl crate::DeepMerge for PodStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); - crate::DeepMerge::merge_from(&mut self.container_statuses, other.container_statuses); - crate::DeepMerge::merge_from(&mut self.ephemeral_container_statuses, other.ephemeral_container_statuses); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::list::atomic(&mut self.container_statuses, other.container_statuses); + crate::merge_strategies::list::atomic(&mut self.ephemeral_container_statuses, other.ephemeral_container_statuses); crate::DeepMerge::merge_from(&mut self.host_ip, other.host_ip); - crate::DeepMerge::merge_from(&mut self.init_container_statuses, other.init_container_statuses); + crate::merge_strategies::list::atomic(&mut self.init_container_statuses, other.init_container_statuses); crate::DeepMerge::merge_from(&mut self.message, other.message); crate::DeepMerge::merge_from(&mut self.nominated_node_name, other.nominated_node_name); crate::DeepMerge::merge_from(&mut self.phase, other.phase); crate::DeepMerge::merge_from(&mut self.pod_ip, other.pod_ip); - crate::DeepMerge::merge_from(&mut self.pod_ips, other.pod_ips); + crate::merge_strategies::list::map( + &mut self.pod_ips, + other.pod_ips, + &[|lhs, rhs| lhs.ip == rhs.ip], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.qos_class, other.qos_class); crate::DeepMerge::merge_from(&mut self.reason, other.reason); crate::DeepMerge::merge_from(&mut self.start_time, other.start_time); diff --git a/src/v1_22/api/core/v1/projected_volume_source.rs b/src/v1_22/api/core/v1/projected_volume_source.rs index 8852dae377..650c07c7dc 100644 --- a/src/v1_22/api/core/v1/projected_volume_source.rs +++ b/src/v1_22/api/core/v1/projected_volume_source.rs @@ -13,7 +13,7 @@ pub struct ProjectedVolumeSource { impl crate::DeepMerge for ProjectedVolumeSource { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.default_mode, other.default_mode); - crate::DeepMerge::merge_from(&mut self.sources, other.sources); + crate::merge_strategies::list::atomic(&mut self.sources, other.sources); } } diff --git a/src/v1_22/api/core/v1/rbd_persistent_volume_source.rs b/src/v1_22/api/core/v1/rbd_persistent_volume_source.rs index 303bf915bc..d94e189fd5 100644 --- a/src/v1_22/api/core/v1/rbd_persistent_volume_source.rs +++ b/src/v1_22/api/core/v1/rbd_persistent_volume_source.rs @@ -33,7 +33,7 @@ impl crate::DeepMerge for RBDPersistentVolumeSource { crate::DeepMerge::merge_from(&mut self.fs_type, other.fs_type); crate::DeepMerge::merge_from(&mut self.image, other.image); crate::DeepMerge::merge_from(&mut self.keyring, other.keyring); - crate::DeepMerge::merge_from(&mut self.monitors, other.monitors); + crate::merge_strategies::list::atomic(&mut self.monitors, other.monitors); crate::DeepMerge::merge_from(&mut self.pool, other.pool); crate::DeepMerge::merge_from(&mut self.read_only, other.read_only); crate::DeepMerge::merge_from(&mut self.secret_ref, other.secret_ref); diff --git a/src/v1_22/api/core/v1/rbd_volume_source.rs b/src/v1_22/api/core/v1/rbd_volume_source.rs index 28d087cae2..c5521eac18 100644 --- a/src/v1_22/api/core/v1/rbd_volume_source.rs +++ b/src/v1_22/api/core/v1/rbd_volume_source.rs @@ -33,7 +33,7 @@ impl crate::DeepMerge for RBDVolumeSource { crate::DeepMerge::merge_from(&mut self.fs_type, other.fs_type); crate::DeepMerge::merge_from(&mut self.image, other.image); crate::DeepMerge::merge_from(&mut self.keyring, other.keyring); - crate::DeepMerge::merge_from(&mut self.monitors, other.monitors); + crate::merge_strategies::list::atomic(&mut self.monitors, other.monitors); crate::DeepMerge::merge_from(&mut self.pool, other.pool); crate::DeepMerge::merge_from(&mut self.read_only, other.read_only); crate::DeepMerge::merge_from(&mut self.secret_ref, other.secret_ref); diff --git a/src/v1_22/api/core/v1/replication_controller_spec.rs b/src/v1_22/api/core/v1/replication_controller_spec.rs index 293546b183..ed3edfa202 100644 --- a/src/v1_22/api/core/v1/replication_controller_spec.rs +++ b/src/v1_22/api/core/v1/replication_controller_spec.rs @@ -20,7 +20,7 @@ impl crate::DeepMerge for ReplicationControllerSpec { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.min_ready_seconds, other.min_ready_seconds); crate::DeepMerge::merge_from(&mut self.replicas, other.replicas); - crate::DeepMerge::merge_from(&mut self.selector, other.selector); + crate::merge_strategies::map::atomic(&mut self.selector, other.selector); crate::DeepMerge::merge_from(&mut self.template, other.template); } } diff --git a/src/v1_22/api/core/v1/replication_controller_status.rs b/src/v1_22/api/core/v1/replication_controller_status.rs index d069722747..47ccceaeba 100644 --- a/src/v1_22/api/core/v1/replication_controller_status.rs +++ b/src/v1_22/api/core/v1/replication_controller_status.rs @@ -25,7 +25,14 @@ pub struct ReplicationControllerStatus { impl crate::DeepMerge for ReplicationControllerStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.available_replicas, other.available_replicas); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.fully_labeled_replicas, other.fully_labeled_replicas); crate::DeepMerge::merge_from(&mut self.observed_generation, other.observed_generation); crate::DeepMerge::merge_from(&mut self.ready_replicas, other.ready_replicas); diff --git a/src/v1_22/api/core/v1/resource_quota_spec.rs b/src/v1_22/api/core/v1/resource_quota_spec.rs index fab2b7970d..3468d8e9e0 100644 --- a/src/v1_22/api/core/v1/resource_quota_spec.rs +++ b/src/v1_22/api/core/v1/resource_quota_spec.rs @@ -15,9 +15,11 @@ pub struct ResourceQuotaSpec { impl crate::DeepMerge for ResourceQuotaSpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.hard, other.hard); + crate::merge_strategies::map::granular(&mut self.hard, other.hard, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.scope_selector, other.scope_selector); - crate::DeepMerge::merge_from(&mut self.scopes, other.scopes); + crate::merge_strategies::list::atomic(&mut self.scopes, other.scopes); } } diff --git a/src/v1_22/api/core/v1/resource_quota_status.rs b/src/v1_22/api/core/v1/resource_quota_status.rs index 100f418a69..74ee1efe3c 100644 --- a/src/v1_22/api/core/v1/resource_quota_status.rs +++ b/src/v1_22/api/core/v1/resource_quota_status.rs @@ -12,8 +12,12 @@ pub struct ResourceQuotaStatus { impl crate::DeepMerge for ResourceQuotaStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.hard, other.hard); - crate::DeepMerge::merge_from(&mut self.used, other.used); + crate::merge_strategies::map::granular(&mut self.hard, other.hard, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.used, other.used, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); } } diff --git a/src/v1_22/api/core/v1/resource_requirements.rs b/src/v1_22/api/core/v1/resource_requirements.rs index 816608c415..c3f4b1fd86 100644 --- a/src/v1_22/api/core/v1/resource_requirements.rs +++ b/src/v1_22/api/core/v1/resource_requirements.rs @@ -12,8 +12,12 @@ pub struct ResourceRequirements { impl crate::DeepMerge for ResourceRequirements { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.limits, other.limits); - crate::DeepMerge::merge_from(&mut self.requests, other.requests); + crate::merge_strategies::map::granular(&mut self.limits, other.limits, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.requests, other.requests, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); } } diff --git a/src/v1_22/api/core/v1/scope_selector.rs b/src/v1_22/api/core/v1/scope_selector.rs index 22ef180aeb..23ebdb0612 100644 --- a/src/v1_22/api/core/v1/scope_selector.rs +++ b/src/v1_22/api/core/v1/scope_selector.rs @@ -9,7 +9,7 @@ pub struct ScopeSelector { impl crate::DeepMerge for ScopeSelector { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.match_expressions, other.match_expressions); + crate::merge_strategies::list::atomic(&mut self.match_expressions, other.match_expressions); } } diff --git a/src/v1_22/api/core/v1/scoped_resource_selector_requirement.rs b/src/v1_22/api/core/v1/scoped_resource_selector_requirement.rs index 33c57f11ea..ed818218b2 100644 --- a/src/v1_22/api/core/v1/scoped_resource_selector_requirement.rs +++ b/src/v1_22/api/core/v1/scoped_resource_selector_requirement.rs @@ -17,7 +17,7 @@ impl crate::DeepMerge for ScopedResourceSelectorRequirement { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.operator, other.operator); crate::DeepMerge::merge_from(&mut self.scope_name, other.scope_name); - crate::DeepMerge::merge_from(&mut self.values, other.values); + crate::merge_strategies::list::atomic(&mut self.values, other.values); } } diff --git a/src/v1_22/api/core/v1/secret.rs b/src/v1_22/api/core/v1/secret.rs index 17a5601b57..b94c2afa67 100644 --- a/src/v1_22/api/core/v1/secret.rs +++ b/src/v1_22/api/core/v1/secret.rs @@ -498,10 +498,14 @@ impl crate::Metadata for Secret { impl crate::DeepMerge for Secret { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.data, other.data); + crate::merge_strategies::map::granular(&mut self.data, other.data, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.immutable, other.immutable); crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.string_data, other.string_data); + crate::merge_strategies::map::granular(&mut self.string_data, other.string_data, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.type_, other.type_); } } diff --git a/src/v1_22/api/core/v1/secret_projection.rs b/src/v1_22/api/core/v1/secret_projection.rs index 41277f3645..df50709566 100644 --- a/src/v1_22/api/core/v1/secret_projection.rs +++ b/src/v1_22/api/core/v1/secret_projection.rs @@ -17,7 +17,7 @@ pub struct SecretProjection { impl crate::DeepMerge for SecretProjection { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.items, other.items); + crate::merge_strategies::list::atomic(&mut self.items, other.items); crate::DeepMerge::merge_from(&mut self.name, other.name); crate::DeepMerge::merge_from(&mut self.optional, other.optional); } diff --git a/src/v1_22/api/core/v1/secret_volume_source.rs b/src/v1_22/api/core/v1/secret_volume_source.rs index 6f0de3b8aa..7daa3928bd 100644 --- a/src/v1_22/api/core/v1/secret_volume_source.rs +++ b/src/v1_22/api/core/v1/secret_volume_source.rs @@ -21,7 +21,7 @@ pub struct SecretVolumeSource { impl crate::DeepMerge for SecretVolumeSource { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.default_mode, other.default_mode); - crate::DeepMerge::merge_from(&mut self.items, other.items); + crate::merge_strategies::list::atomic(&mut self.items, other.items); crate::DeepMerge::merge_from(&mut self.optional, other.optional); crate::DeepMerge::merge_from(&mut self.secret_name, other.secret_name); } diff --git a/src/v1_22/api/core/v1/service_account.rs b/src/v1_22/api/core/v1/service_account.rs index c1b334f710..c297d5be55 100644 --- a/src/v1_22/api/core/v1/service_account.rs +++ b/src/v1_22/api/core/v1/service_account.rs @@ -496,9 +496,16 @@ impl crate::Metadata for ServiceAccount { impl crate::DeepMerge for ServiceAccount { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.automount_service_account_token, other.automount_service_account_token); - crate::DeepMerge::merge_from(&mut self.image_pull_secrets, other.image_pull_secrets); + crate::merge_strategies::list::atomic(&mut self.image_pull_secrets, other.image_pull_secrets); crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.secrets, other.secrets); + crate::merge_strategies::list::map( + &mut self.secrets, + other.secrets, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_22/api/core/v1/service_spec.rs b/src/v1_22/api/core/v1/service_spec.rs index 9973ca8fe7..a92b576665 100644 --- a/src/v1_22/api/core/v1/service_spec.rs +++ b/src/v1_22/api/core/v1/service_spec.rs @@ -69,20 +69,27 @@ impl crate::DeepMerge for ServiceSpec { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.allocate_load_balancer_node_ports, other.allocate_load_balancer_node_ports); crate::DeepMerge::merge_from(&mut self.cluster_ip, other.cluster_ip); - crate::DeepMerge::merge_from(&mut self.cluster_ips, other.cluster_ips); - crate::DeepMerge::merge_from(&mut self.external_ips, other.external_ips); + crate::merge_strategies::list::atomic(&mut self.cluster_ips, other.cluster_ips); + crate::merge_strategies::list::atomic(&mut self.external_ips, other.external_ips); crate::DeepMerge::merge_from(&mut self.external_name, other.external_name); crate::DeepMerge::merge_from(&mut self.external_traffic_policy, other.external_traffic_policy); crate::DeepMerge::merge_from(&mut self.health_check_node_port, other.health_check_node_port); crate::DeepMerge::merge_from(&mut self.internal_traffic_policy, other.internal_traffic_policy); - crate::DeepMerge::merge_from(&mut self.ip_families, other.ip_families); + crate::merge_strategies::list::atomic(&mut self.ip_families, other.ip_families); crate::DeepMerge::merge_from(&mut self.ip_family_policy, other.ip_family_policy); crate::DeepMerge::merge_from(&mut self.load_balancer_class, other.load_balancer_class); crate::DeepMerge::merge_from(&mut self.load_balancer_ip, other.load_balancer_ip); - crate::DeepMerge::merge_from(&mut self.load_balancer_source_ranges, other.load_balancer_source_ranges); - crate::DeepMerge::merge_from(&mut self.ports, other.ports); + crate::merge_strategies::list::atomic(&mut self.load_balancer_source_ranges, other.load_balancer_source_ranges); + crate::merge_strategies::list::map( + &mut self.ports, + other.ports, + &[|lhs, rhs| lhs.port == rhs.port], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.publish_not_ready_addresses, other.publish_not_ready_addresses); - crate::DeepMerge::merge_from(&mut self.selector, other.selector); + crate::merge_strategies::map::atomic(&mut self.selector, other.selector); crate::DeepMerge::merge_from(&mut self.session_affinity, other.session_affinity); crate::DeepMerge::merge_from(&mut self.session_affinity_config, other.session_affinity_config); crate::DeepMerge::merge_from(&mut self.type_, other.type_); diff --git a/src/v1_22/api/core/v1/service_status.rs b/src/v1_22/api/core/v1/service_status.rs index 6c3429fd70..6dece09b96 100644 --- a/src/v1_22/api/core/v1/service_status.rs +++ b/src/v1_22/api/core/v1/service_status.rs @@ -12,7 +12,14 @@ pub struct ServiceStatus { impl crate::DeepMerge for ServiceStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.load_balancer, other.load_balancer); } } diff --git a/src/v1_22/api/core/v1/topology_selector_label_requirement.rs b/src/v1_22/api/core/v1/topology_selector_label_requirement.rs index 3efed6ba65..50764252b6 100644 --- a/src/v1_22/api/core/v1/topology_selector_label_requirement.rs +++ b/src/v1_22/api/core/v1/topology_selector_label_requirement.rs @@ -13,7 +13,7 @@ pub struct TopologySelectorLabelRequirement { impl crate::DeepMerge for TopologySelectorLabelRequirement { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.key, other.key); - crate::DeepMerge::merge_from(&mut self.values, other.values); + crate::merge_strategies::list::atomic(&mut self.values, other.values); } } diff --git a/src/v1_22/api/core/v1/topology_selector_term.rs b/src/v1_22/api/core/v1/topology_selector_term.rs index 230f7ab530..df526d6f4d 100644 --- a/src/v1_22/api/core/v1/topology_selector_term.rs +++ b/src/v1_22/api/core/v1/topology_selector_term.rs @@ -9,7 +9,7 @@ pub struct TopologySelectorTerm { impl crate::DeepMerge for TopologySelectorTerm { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.match_label_expressions, other.match_label_expressions); + crate::merge_strategies::list::atomic(&mut self.match_label_expressions, other.match_label_expressions); } } diff --git a/src/v1_22/api/discovery/v1/endpoint.rs b/src/v1_22/api/discovery/v1/endpoint.rs index 10cf5ed900..a37f940dd0 100644 --- a/src/v1_22/api/discovery/v1/endpoint.rs +++ b/src/v1_22/api/discovery/v1/endpoint.rs @@ -30,9 +30,11 @@ pub struct Endpoint { impl crate::DeepMerge for Endpoint { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.addresses, other.addresses); + crate::merge_strategies::list::set(&mut self.addresses, other.addresses); crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); - crate::DeepMerge::merge_from(&mut self.deprecated_topology, other.deprecated_topology); + crate::merge_strategies::map::granular(&mut self.deprecated_topology, other.deprecated_topology, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.hints, other.hints); crate::DeepMerge::merge_from(&mut self.hostname, other.hostname); crate::DeepMerge::merge_from(&mut self.node_name, other.node_name); diff --git a/src/v1_22/api/discovery/v1/endpoint_hints.rs b/src/v1_22/api/discovery/v1/endpoint_hints.rs index 7fe956528a..02cbd88946 100644 --- a/src/v1_22/api/discovery/v1/endpoint_hints.rs +++ b/src/v1_22/api/discovery/v1/endpoint_hints.rs @@ -9,7 +9,7 @@ pub struct EndpointHints { impl crate::DeepMerge for EndpointHints { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.for_zones, other.for_zones); + crate::merge_strategies::list::atomic(&mut self.for_zones, other.for_zones); } } diff --git a/src/v1_22/api/discovery/v1/endpoint_slice.rs b/src/v1_22/api/discovery/v1/endpoint_slice.rs index 9b2dd33f92..1b8cbdf143 100644 --- a/src/v1_22/api/discovery/v1/endpoint_slice.rs +++ b/src/v1_22/api/discovery/v1/endpoint_slice.rs @@ -496,9 +496,9 @@ impl crate::Metadata for EndpointSlice { impl crate::DeepMerge for EndpointSlice { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.address_type, other.address_type); - crate::DeepMerge::merge_from(&mut self.endpoints, other.endpoints); + crate::merge_strategies::list::atomic(&mut self.endpoints, other.endpoints); crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.ports, other.ports); + crate::merge_strategies::list::atomic(&mut self.ports, other.ports); } } diff --git a/src/v1_22/api/discovery/v1beta1/endpoint.rs b/src/v1_22/api/discovery/v1beta1/endpoint.rs index 72633f136a..cd80eaa25b 100644 --- a/src/v1_22/api/discovery/v1beta1/endpoint.rs +++ b/src/v1_22/api/discovery/v1beta1/endpoint.rs @@ -34,13 +34,15 @@ pub struct Endpoint { impl crate::DeepMerge for Endpoint { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.addresses, other.addresses); + crate::merge_strategies::list::set(&mut self.addresses, other.addresses); crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); crate::DeepMerge::merge_from(&mut self.hints, other.hints); crate::DeepMerge::merge_from(&mut self.hostname, other.hostname); crate::DeepMerge::merge_from(&mut self.node_name, other.node_name); crate::DeepMerge::merge_from(&mut self.target_ref, other.target_ref); - crate::DeepMerge::merge_from(&mut self.topology, other.topology); + crate::merge_strategies::map::granular(&mut self.topology, other.topology, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); } } diff --git a/src/v1_22/api/discovery/v1beta1/endpoint_hints.rs b/src/v1_22/api/discovery/v1beta1/endpoint_hints.rs index 3f5bf3905b..57d5cc5553 100644 --- a/src/v1_22/api/discovery/v1beta1/endpoint_hints.rs +++ b/src/v1_22/api/discovery/v1beta1/endpoint_hints.rs @@ -9,7 +9,7 @@ pub struct EndpointHints { impl crate::DeepMerge for EndpointHints { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.for_zones, other.for_zones); + crate::merge_strategies::list::atomic(&mut self.for_zones, other.for_zones); } } diff --git a/src/v1_22/api/discovery/v1beta1/endpoint_slice.rs b/src/v1_22/api/discovery/v1beta1/endpoint_slice.rs index cfe4553dc2..12d89081fa 100644 --- a/src/v1_22/api/discovery/v1beta1/endpoint_slice.rs +++ b/src/v1_22/api/discovery/v1beta1/endpoint_slice.rs @@ -496,9 +496,9 @@ impl crate::Metadata for EndpointSlice { impl crate::DeepMerge for EndpointSlice { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.address_type, other.address_type); - crate::DeepMerge::merge_from(&mut self.endpoints, other.endpoints); + crate::merge_strategies::list::atomic(&mut self.endpoints, other.endpoints); crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.ports, other.ports); + crate::merge_strategies::list::atomic(&mut self.ports, other.ports); } } diff --git a/src/v1_22/api/flowcontrol/v1beta1/flow_schema_spec.rs b/src/v1_22/api/flowcontrol/v1beta1/flow_schema_spec.rs index 40031e5acc..fb04b8c0af 100644 --- a/src/v1_22/api/flowcontrol/v1beta1/flow_schema_spec.rs +++ b/src/v1_22/api/flowcontrol/v1beta1/flow_schema_spec.rs @@ -21,7 +21,7 @@ impl crate::DeepMerge for FlowSchemaSpec { crate::DeepMerge::merge_from(&mut self.distinguisher_method, other.distinguisher_method); crate::DeepMerge::merge_from(&mut self.matching_precedence, other.matching_precedence); crate::DeepMerge::merge_from(&mut self.priority_level_configuration, other.priority_level_configuration); - crate::DeepMerge::merge_from(&mut self.rules, other.rules); + crate::merge_strategies::list::atomic(&mut self.rules, other.rules); } } diff --git a/src/v1_22/api/flowcontrol/v1beta1/flow_schema_status.rs b/src/v1_22/api/flowcontrol/v1beta1/flow_schema_status.rs index c463e68e6a..7de52a1a65 100644 --- a/src/v1_22/api/flowcontrol/v1beta1/flow_schema_status.rs +++ b/src/v1_22/api/flowcontrol/v1beta1/flow_schema_status.rs @@ -9,7 +9,14 @@ pub struct FlowSchemaStatus { impl crate::DeepMerge for FlowSchemaStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_22/api/flowcontrol/v1beta1/non_resource_policy_rule.rs b/src/v1_22/api/flowcontrol/v1beta1/non_resource_policy_rule.rs index 80b8803dc1..ac9b066b17 100644 --- a/src/v1_22/api/flowcontrol/v1beta1/non_resource_policy_rule.rs +++ b/src/v1_22/api/flowcontrol/v1beta1/non_resource_policy_rule.rs @@ -18,8 +18,8 @@ pub struct NonResourcePolicyRule { impl crate::DeepMerge for NonResourcePolicyRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.non_resource_urls, other.non_resource_urls); - crate::DeepMerge::merge_from(&mut self.verbs, other.verbs); + crate::merge_strategies::list::set(&mut self.non_resource_urls, other.non_resource_urls); + crate::merge_strategies::list::set(&mut self.verbs, other.verbs); } } diff --git a/src/v1_22/api/flowcontrol/v1beta1/policy_rules_with_subjects.rs b/src/v1_22/api/flowcontrol/v1beta1/policy_rules_with_subjects.rs index 780a347761..8a727117e0 100644 --- a/src/v1_22/api/flowcontrol/v1beta1/policy_rules_with_subjects.rs +++ b/src/v1_22/api/flowcontrol/v1beta1/policy_rules_with_subjects.rs @@ -15,9 +15,9 @@ pub struct PolicyRulesWithSubjects { impl crate::DeepMerge for PolicyRulesWithSubjects { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.non_resource_rules, other.non_resource_rules); - crate::DeepMerge::merge_from(&mut self.resource_rules, other.resource_rules); - crate::DeepMerge::merge_from(&mut self.subjects, other.subjects); + crate::merge_strategies::list::atomic(&mut self.non_resource_rules, other.non_resource_rules); + crate::merge_strategies::list::atomic(&mut self.resource_rules, other.resource_rules); + crate::merge_strategies::list::atomic(&mut self.subjects, other.subjects); } } diff --git a/src/v1_22/api/flowcontrol/v1beta1/priority_level_configuration_status.rs b/src/v1_22/api/flowcontrol/v1beta1/priority_level_configuration_status.rs index a356b4a6df..e35efdf597 100644 --- a/src/v1_22/api/flowcontrol/v1beta1/priority_level_configuration_status.rs +++ b/src/v1_22/api/flowcontrol/v1beta1/priority_level_configuration_status.rs @@ -9,7 +9,14 @@ pub struct PriorityLevelConfigurationStatus { impl crate::DeepMerge for PriorityLevelConfigurationStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_22/api/flowcontrol/v1beta1/resource_policy_rule.rs b/src/v1_22/api/flowcontrol/v1beta1/resource_policy_rule.rs index 14597a98fb..4d742498ed 100644 --- a/src/v1_22/api/flowcontrol/v1beta1/resource_policy_rule.rs +++ b/src/v1_22/api/flowcontrol/v1beta1/resource_policy_rule.rs @@ -21,11 +21,11 @@ pub struct ResourcePolicyRule { impl crate::DeepMerge for ResourcePolicyRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.api_groups, other.api_groups); + crate::merge_strategies::list::set(&mut self.api_groups, other.api_groups); crate::DeepMerge::merge_from(&mut self.cluster_scope, other.cluster_scope); - crate::DeepMerge::merge_from(&mut self.namespaces, other.namespaces); - crate::DeepMerge::merge_from(&mut self.resources, other.resources); - crate::DeepMerge::merge_from(&mut self.verbs, other.verbs); + crate::merge_strategies::list::set(&mut self.namespaces, other.namespaces); + crate::merge_strategies::list::set(&mut self.resources, other.resources); + crate::merge_strategies::list::set(&mut self.verbs, other.verbs); } } diff --git a/src/v1_22/api/networking/v1/http_ingress_rule_value.rs b/src/v1_22/api/networking/v1/http_ingress_rule_value.rs index acc836c728..3749783ee2 100644 --- a/src/v1_22/api/networking/v1/http_ingress_rule_value.rs +++ b/src/v1_22/api/networking/v1/http_ingress_rule_value.rs @@ -9,7 +9,7 @@ pub struct HTTPIngressRuleValue { impl crate::DeepMerge for HTTPIngressRuleValue { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.paths, other.paths); + crate::merge_strategies::list::atomic(&mut self.paths, other.paths); } } diff --git a/src/v1_22/api/networking/v1/ingress_spec.rs b/src/v1_22/api/networking/v1/ingress_spec.rs index 68e8606acb..2229a3c788 100644 --- a/src/v1_22/api/networking/v1/ingress_spec.rs +++ b/src/v1_22/api/networking/v1/ingress_spec.rs @@ -20,8 +20,8 @@ impl crate::DeepMerge for IngressSpec { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.default_backend, other.default_backend); crate::DeepMerge::merge_from(&mut self.ingress_class_name, other.ingress_class_name); - crate::DeepMerge::merge_from(&mut self.rules, other.rules); - crate::DeepMerge::merge_from(&mut self.tls, other.tls); + crate::merge_strategies::list::atomic(&mut self.rules, other.rules); + crate::merge_strategies::list::atomic(&mut self.tls, other.tls); } } diff --git a/src/v1_22/api/networking/v1/ingress_tls.rs b/src/v1_22/api/networking/v1/ingress_tls.rs index d48a83a0c4..92c66b754f 100644 --- a/src/v1_22/api/networking/v1/ingress_tls.rs +++ b/src/v1_22/api/networking/v1/ingress_tls.rs @@ -12,7 +12,7 @@ pub struct IngressTLS { impl crate::DeepMerge for IngressTLS { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.hosts, other.hosts); + crate::merge_strategies::list::atomic(&mut self.hosts, other.hosts); crate::DeepMerge::merge_from(&mut self.secret_name, other.secret_name); } } diff --git a/src/v1_22/api/networking/v1/ip_block.rs b/src/v1_22/api/networking/v1/ip_block.rs index 46458b01c5..08d9d2ab61 100644 --- a/src/v1_22/api/networking/v1/ip_block.rs +++ b/src/v1_22/api/networking/v1/ip_block.rs @@ -13,7 +13,7 @@ pub struct IPBlock { impl crate::DeepMerge for IPBlock { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.cidr, other.cidr); - crate::DeepMerge::merge_from(&mut self.except, other.except); + crate::merge_strategies::list::atomic(&mut self.except, other.except); } } diff --git a/src/v1_22/api/networking/v1/network_policy_egress_rule.rs b/src/v1_22/api/networking/v1/network_policy_egress_rule.rs index 33619be210..28eb6a21b6 100644 --- a/src/v1_22/api/networking/v1/network_policy_egress_rule.rs +++ b/src/v1_22/api/networking/v1/network_policy_egress_rule.rs @@ -12,8 +12,8 @@ pub struct NetworkPolicyEgressRule { impl crate::DeepMerge for NetworkPolicyEgressRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.ports, other.ports); - crate::DeepMerge::merge_from(&mut self.to, other.to); + crate::merge_strategies::list::atomic(&mut self.ports, other.ports); + crate::merge_strategies::list::atomic(&mut self.to, other.to); } } diff --git a/src/v1_22/api/networking/v1/network_policy_ingress_rule.rs b/src/v1_22/api/networking/v1/network_policy_ingress_rule.rs index 2c68ec44a7..517765f800 100644 --- a/src/v1_22/api/networking/v1/network_policy_ingress_rule.rs +++ b/src/v1_22/api/networking/v1/network_policy_ingress_rule.rs @@ -12,8 +12,8 @@ pub struct NetworkPolicyIngressRule { impl crate::DeepMerge for NetworkPolicyIngressRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.from, other.from); - crate::DeepMerge::merge_from(&mut self.ports, other.ports); + crate::merge_strategies::list::atomic(&mut self.from, other.from); + crate::merge_strategies::list::atomic(&mut self.ports, other.ports); } } diff --git a/src/v1_22/api/networking/v1/network_policy_spec.rs b/src/v1_22/api/networking/v1/network_policy_spec.rs index ed61b60968..bc980e7469 100644 --- a/src/v1_22/api/networking/v1/network_policy_spec.rs +++ b/src/v1_22/api/networking/v1/network_policy_spec.rs @@ -18,10 +18,10 @@ pub struct NetworkPolicySpec { impl crate::DeepMerge for NetworkPolicySpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.egress, other.egress); - crate::DeepMerge::merge_from(&mut self.ingress, other.ingress); + crate::merge_strategies::list::atomic(&mut self.egress, other.egress); + crate::merge_strategies::list::atomic(&mut self.ingress, other.ingress); crate::DeepMerge::merge_from(&mut self.pod_selector, other.pod_selector); - crate::DeepMerge::merge_from(&mut self.policy_types, other.policy_types); + crate::merge_strategies::list::atomic(&mut self.policy_types, other.policy_types); } } diff --git a/src/v1_22/api/node/v1/overhead.rs b/src/v1_22/api/node/v1/overhead.rs index ef68cae1c1..2db70b80c4 100644 --- a/src/v1_22/api/node/v1/overhead.rs +++ b/src/v1_22/api/node/v1/overhead.rs @@ -9,7 +9,9 @@ pub struct Overhead { impl crate::DeepMerge for Overhead { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.pod_fixed, other.pod_fixed); + crate::merge_strategies::map::granular(&mut self.pod_fixed, other.pod_fixed, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); } } diff --git a/src/v1_22/api/node/v1/scheduling.rs b/src/v1_22/api/node/v1/scheduling.rs index 1c2b8a05c5..79508f62c2 100644 --- a/src/v1_22/api/node/v1/scheduling.rs +++ b/src/v1_22/api/node/v1/scheduling.rs @@ -12,8 +12,8 @@ pub struct Scheduling { impl crate::DeepMerge for Scheduling { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.node_selector, other.node_selector); - crate::DeepMerge::merge_from(&mut self.tolerations, other.tolerations); + crate::merge_strategies::map::atomic(&mut self.node_selector, other.node_selector); + crate::merge_strategies::list::atomic(&mut self.tolerations, other.tolerations); } } diff --git a/src/v1_22/api/node/v1alpha1/overhead.rs b/src/v1_22/api/node/v1alpha1/overhead.rs index 59efa7b8e1..eb3a0a48fb 100644 --- a/src/v1_22/api/node/v1alpha1/overhead.rs +++ b/src/v1_22/api/node/v1alpha1/overhead.rs @@ -9,7 +9,9 @@ pub struct Overhead { impl crate::DeepMerge for Overhead { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.pod_fixed, other.pod_fixed); + crate::merge_strategies::map::granular(&mut self.pod_fixed, other.pod_fixed, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); } } diff --git a/src/v1_22/api/node/v1alpha1/scheduling.rs b/src/v1_22/api/node/v1alpha1/scheduling.rs index f660e0dc43..5b85cee4ab 100644 --- a/src/v1_22/api/node/v1alpha1/scheduling.rs +++ b/src/v1_22/api/node/v1alpha1/scheduling.rs @@ -12,8 +12,8 @@ pub struct Scheduling { impl crate::DeepMerge for Scheduling { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.node_selector, other.node_selector); - crate::DeepMerge::merge_from(&mut self.tolerations, other.tolerations); + crate::merge_strategies::map::atomic(&mut self.node_selector, other.node_selector); + crate::merge_strategies::list::atomic(&mut self.tolerations, other.tolerations); } } diff --git a/src/v1_22/api/node/v1beta1/overhead.rs b/src/v1_22/api/node/v1beta1/overhead.rs index 53af362cd3..821323b5c0 100644 --- a/src/v1_22/api/node/v1beta1/overhead.rs +++ b/src/v1_22/api/node/v1beta1/overhead.rs @@ -9,7 +9,9 @@ pub struct Overhead { impl crate::DeepMerge for Overhead { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.pod_fixed, other.pod_fixed); + crate::merge_strategies::map::granular(&mut self.pod_fixed, other.pod_fixed, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); } } diff --git a/src/v1_22/api/node/v1beta1/scheduling.rs b/src/v1_22/api/node/v1beta1/scheduling.rs index 9b493fe4cf..1b5f5f638c 100644 --- a/src/v1_22/api/node/v1beta1/scheduling.rs +++ b/src/v1_22/api/node/v1beta1/scheduling.rs @@ -12,8 +12,8 @@ pub struct Scheduling { impl crate::DeepMerge for Scheduling { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.node_selector, other.node_selector); - crate::DeepMerge::merge_from(&mut self.tolerations, other.tolerations); + crate::merge_strategies::map::atomic(&mut self.node_selector, other.node_selector); + crate::merge_strategies::list::atomic(&mut self.tolerations, other.tolerations); } } diff --git a/src/v1_22/api/policy/v1/pod_disruption_budget_status.rs b/src/v1_22/api/policy/v1/pod_disruption_budget_status.rs index f4aa41a86e..cf8b02d00f 100644 --- a/src/v1_22/api/policy/v1/pod_disruption_budget_status.rs +++ b/src/v1_22/api/policy/v1/pod_disruption_budget_status.rs @@ -35,10 +35,19 @@ pub struct PodDisruptionBudgetStatus { impl crate::DeepMerge for PodDisruptionBudgetStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.current_healthy, other.current_healthy); crate::DeepMerge::merge_from(&mut self.desired_healthy, other.desired_healthy); - crate::DeepMerge::merge_from(&mut self.disrupted_pods, other.disrupted_pods); + crate::merge_strategies::map::granular(&mut self.disrupted_pods, other.disrupted_pods, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.disruptions_allowed, other.disruptions_allowed); crate::DeepMerge::merge_from(&mut self.expected_pods, other.expected_pods); crate::DeepMerge::merge_from(&mut self.observed_generation, other.observed_generation); diff --git a/src/v1_22/api/policy/v1beta1/fs_group_strategy_options.rs b/src/v1_22/api/policy/v1beta1/fs_group_strategy_options.rs index 80e63553ac..c52d53d54c 100644 --- a/src/v1_22/api/policy/v1beta1/fs_group_strategy_options.rs +++ b/src/v1_22/api/policy/v1beta1/fs_group_strategy_options.rs @@ -12,7 +12,7 @@ pub struct FSGroupStrategyOptions { impl crate::DeepMerge for FSGroupStrategyOptions { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.ranges, other.ranges); + crate::merge_strategies::list::atomic(&mut self.ranges, other.ranges); crate::DeepMerge::merge_from(&mut self.rule, other.rule); } } diff --git a/src/v1_22/api/policy/v1beta1/pod_disruption_budget_status.rs b/src/v1_22/api/policy/v1beta1/pod_disruption_budget_status.rs index 72a03073f6..17f1fa562a 100644 --- a/src/v1_22/api/policy/v1beta1/pod_disruption_budget_status.rs +++ b/src/v1_22/api/policy/v1beta1/pod_disruption_budget_status.rs @@ -35,10 +35,19 @@ pub struct PodDisruptionBudgetStatus { impl crate::DeepMerge for PodDisruptionBudgetStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.current_healthy, other.current_healthy); crate::DeepMerge::merge_from(&mut self.desired_healthy, other.desired_healthy); - crate::DeepMerge::merge_from(&mut self.disrupted_pods, other.disrupted_pods); + crate::merge_strategies::map::granular(&mut self.disrupted_pods, other.disrupted_pods, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.disruptions_allowed, other.disruptions_allowed); crate::DeepMerge::merge_from(&mut self.expected_pods, other.expected_pods); crate::DeepMerge::merge_from(&mut self.observed_generation, other.observed_generation); diff --git a/src/v1_22/api/policy/v1beta1/pod_security_policy_spec.rs b/src/v1_22/api/policy/v1beta1/pod_security_policy_spec.rs index b4f2ca8c67..e9a43ffbac 100644 --- a/src/v1_22/api/policy/v1beta1/pod_security_policy_spec.rs +++ b/src/v1_22/api/policy/v1beta1/pod_security_policy_spec.rs @@ -83,29 +83,29 @@ pub struct PodSecurityPolicySpec { impl crate::DeepMerge for PodSecurityPolicySpec { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.allow_privilege_escalation, other.allow_privilege_escalation); - crate::DeepMerge::merge_from(&mut self.allowed_csi_drivers, other.allowed_csi_drivers); - crate::DeepMerge::merge_from(&mut self.allowed_capabilities, other.allowed_capabilities); - crate::DeepMerge::merge_from(&mut self.allowed_flex_volumes, other.allowed_flex_volumes); - crate::DeepMerge::merge_from(&mut self.allowed_host_paths, other.allowed_host_paths); - crate::DeepMerge::merge_from(&mut self.allowed_proc_mount_types, other.allowed_proc_mount_types); - crate::DeepMerge::merge_from(&mut self.allowed_unsafe_sysctls, other.allowed_unsafe_sysctls); - crate::DeepMerge::merge_from(&mut self.default_add_capabilities, other.default_add_capabilities); + crate::merge_strategies::list::atomic(&mut self.allowed_csi_drivers, other.allowed_csi_drivers); + crate::merge_strategies::list::atomic(&mut self.allowed_capabilities, other.allowed_capabilities); + crate::merge_strategies::list::atomic(&mut self.allowed_flex_volumes, other.allowed_flex_volumes); + crate::merge_strategies::list::atomic(&mut self.allowed_host_paths, other.allowed_host_paths); + crate::merge_strategies::list::atomic(&mut self.allowed_proc_mount_types, other.allowed_proc_mount_types); + crate::merge_strategies::list::atomic(&mut self.allowed_unsafe_sysctls, other.allowed_unsafe_sysctls); + crate::merge_strategies::list::atomic(&mut self.default_add_capabilities, other.default_add_capabilities); crate::DeepMerge::merge_from(&mut self.default_allow_privilege_escalation, other.default_allow_privilege_escalation); - crate::DeepMerge::merge_from(&mut self.forbidden_sysctls, other.forbidden_sysctls); + crate::merge_strategies::list::atomic(&mut self.forbidden_sysctls, other.forbidden_sysctls); crate::DeepMerge::merge_from(&mut self.fs_group, other.fs_group); crate::DeepMerge::merge_from(&mut self.host_ipc, other.host_ipc); crate::DeepMerge::merge_from(&mut self.host_network, other.host_network); crate::DeepMerge::merge_from(&mut self.host_pid, other.host_pid); - crate::DeepMerge::merge_from(&mut self.host_ports, other.host_ports); + crate::merge_strategies::list::atomic(&mut self.host_ports, other.host_ports); crate::DeepMerge::merge_from(&mut self.privileged, other.privileged); crate::DeepMerge::merge_from(&mut self.read_only_root_filesystem, other.read_only_root_filesystem); - crate::DeepMerge::merge_from(&mut self.required_drop_capabilities, other.required_drop_capabilities); + crate::merge_strategies::list::atomic(&mut self.required_drop_capabilities, other.required_drop_capabilities); crate::DeepMerge::merge_from(&mut self.run_as_group, other.run_as_group); crate::DeepMerge::merge_from(&mut self.run_as_user, other.run_as_user); crate::DeepMerge::merge_from(&mut self.runtime_class, other.runtime_class); crate::DeepMerge::merge_from(&mut self.se_linux, other.se_linux); crate::DeepMerge::merge_from(&mut self.supplemental_groups, other.supplemental_groups); - crate::DeepMerge::merge_from(&mut self.volumes, other.volumes); + crate::merge_strategies::list::atomic(&mut self.volumes, other.volumes); } } diff --git a/src/v1_22/api/policy/v1beta1/run_as_group_strategy_options.rs b/src/v1_22/api/policy/v1beta1/run_as_group_strategy_options.rs index 89e97b5842..25aa6f1e66 100644 --- a/src/v1_22/api/policy/v1beta1/run_as_group_strategy_options.rs +++ b/src/v1_22/api/policy/v1beta1/run_as_group_strategy_options.rs @@ -12,7 +12,7 @@ pub struct RunAsGroupStrategyOptions { impl crate::DeepMerge for RunAsGroupStrategyOptions { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.ranges, other.ranges); + crate::merge_strategies::list::atomic(&mut self.ranges, other.ranges); crate::DeepMerge::merge_from(&mut self.rule, other.rule); } } diff --git a/src/v1_22/api/policy/v1beta1/run_as_user_strategy_options.rs b/src/v1_22/api/policy/v1beta1/run_as_user_strategy_options.rs index aeeda6f381..a28c259366 100644 --- a/src/v1_22/api/policy/v1beta1/run_as_user_strategy_options.rs +++ b/src/v1_22/api/policy/v1beta1/run_as_user_strategy_options.rs @@ -12,7 +12,7 @@ pub struct RunAsUserStrategyOptions { impl crate::DeepMerge for RunAsUserStrategyOptions { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.ranges, other.ranges); + crate::merge_strategies::list::atomic(&mut self.ranges, other.ranges); crate::DeepMerge::merge_from(&mut self.rule, other.rule); } } diff --git a/src/v1_22/api/policy/v1beta1/runtime_class_strategy_options.rs b/src/v1_22/api/policy/v1beta1/runtime_class_strategy_options.rs index 5f80a6b7e7..085d36d69f 100644 --- a/src/v1_22/api/policy/v1beta1/runtime_class_strategy_options.rs +++ b/src/v1_22/api/policy/v1beta1/runtime_class_strategy_options.rs @@ -12,7 +12,7 @@ pub struct RuntimeClassStrategyOptions { impl crate::DeepMerge for RuntimeClassStrategyOptions { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.allowed_runtime_class_names, other.allowed_runtime_class_names); + crate::merge_strategies::list::atomic(&mut self.allowed_runtime_class_names, other.allowed_runtime_class_names); crate::DeepMerge::merge_from(&mut self.default_runtime_class_name, other.default_runtime_class_name); } } diff --git a/src/v1_22/api/policy/v1beta1/supplemental_groups_strategy_options.rs b/src/v1_22/api/policy/v1beta1/supplemental_groups_strategy_options.rs index 7e83b2e756..4bcc23b7e2 100644 --- a/src/v1_22/api/policy/v1beta1/supplemental_groups_strategy_options.rs +++ b/src/v1_22/api/policy/v1beta1/supplemental_groups_strategy_options.rs @@ -12,7 +12,7 @@ pub struct SupplementalGroupsStrategyOptions { impl crate::DeepMerge for SupplementalGroupsStrategyOptions { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.ranges, other.ranges); + crate::merge_strategies::list::atomic(&mut self.ranges, other.ranges); crate::DeepMerge::merge_from(&mut self.rule, other.rule); } } diff --git a/src/v1_22/api/rbac/v1/aggregation_rule.rs b/src/v1_22/api/rbac/v1/aggregation_rule.rs index 5ccc4984f6..b20ce61705 100644 --- a/src/v1_22/api/rbac/v1/aggregation_rule.rs +++ b/src/v1_22/api/rbac/v1/aggregation_rule.rs @@ -9,7 +9,7 @@ pub struct AggregationRule { impl crate::DeepMerge for AggregationRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.cluster_role_selectors, other.cluster_role_selectors); + crate::merge_strategies::list::atomic(&mut self.cluster_role_selectors, other.cluster_role_selectors); } } diff --git a/src/v1_22/api/rbac/v1/cluster_role.rs b/src/v1_22/api/rbac/v1/cluster_role.rs index 8336e14c92..a6f832b593 100644 --- a/src/v1_22/api/rbac/v1/cluster_role.rs +++ b/src/v1_22/api/rbac/v1/cluster_role.rs @@ -378,7 +378,7 @@ impl crate::DeepMerge for ClusterRole { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.aggregation_rule, other.aggregation_rule); crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.rules, other.rules); + crate::merge_strategies::list::atomic(&mut self.rules, other.rules); } } 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..04fa2bd714 100644 --- a/src/v1_22/api/rbac/v1/cluster_role_binding.rs +++ b/src/v1_22/api/rbac/v1/cluster_role_binding.rs @@ -378,7 +378,7 @@ impl crate::DeepMerge for ClusterRoleBinding { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); crate::DeepMerge::merge_from(&mut self.role_ref, other.role_ref); - crate::DeepMerge::merge_from(&mut self.subjects, other.subjects); + crate::merge_strategies::list::atomic(&mut self.subjects, other.subjects); } } diff --git a/src/v1_22/api/rbac/v1/policy_rule.rs b/src/v1_22/api/rbac/v1/policy_rule.rs index b067990186..31a3305fbf 100644 --- a/src/v1_22/api/rbac/v1/policy_rule.rs +++ b/src/v1_22/api/rbac/v1/policy_rule.rs @@ -21,11 +21,11 @@ pub struct PolicyRule { impl crate::DeepMerge for PolicyRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.api_groups, other.api_groups); - crate::DeepMerge::merge_from(&mut self.non_resource_urls, other.non_resource_urls); - crate::DeepMerge::merge_from(&mut self.resource_names, other.resource_names); - crate::DeepMerge::merge_from(&mut self.resources, other.resources); - crate::DeepMerge::merge_from(&mut self.verbs, other.verbs); + crate::merge_strategies::list::atomic(&mut self.api_groups, other.api_groups); + crate::merge_strategies::list::atomic(&mut self.non_resource_urls, other.non_resource_urls); + crate::merge_strategies::list::atomic(&mut self.resource_names, other.resource_names); + crate::merge_strategies::list::atomic(&mut self.resources, other.resources); + crate::merge_strategies::list::atomic(&mut self.verbs, other.verbs); } } diff --git a/src/v1_22/api/rbac/v1/role.rs b/src/v1_22/api/rbac/v1/role.rs index 9764bc7aa0..719ecb92b0 100644 --- a/src/v1_22/api/rbac/v1/role.rs +++ b/src/v1_22/api/rbac/v1/role.rs @@ -490,7 +490,7 @@ impl crate::Metadata for Role { impl crate::DeepMerge for Role { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.rules, other.rules); + crate::merge_strategies::list::atomic(&mut self.rules, other.rules); } } diff --git a/src/v1_22/api/rbac/v1/role_binding.rs b/src/v1_22/api/rbac/v1/role_binding.rs index ac11e857c2..7b9059076a 100644 --- a/src/v1_22/api/rbac/v1/role_binding.rs +++ b/src/v1_22/api/rbac/v1/role_binding.rs @@ -494,7 +494,7 @@ impl crate::DeepMerge for RoleBinding { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); crate::DeepMerge::merge_from(&mut self.role_ref, other.role_ref); - crate::DeepMerge::merge_from(&mut self.subjects, other.subjects); + crate::merge_strategies::list::atomic(&mut self.subjects, other.subjects); } } diff --git a/src/v1_22/api/rbac/v1alpha1/aggregation_rule.rs b/src/v1_22/api/rbac/v1alpha1/aggregation_rule.rs index ba1495c28c..4f4acecf3e 100644 --- a/src/v1_22/api/rbac/v1alpha1/aggregation_rule.rs +++ b/src/v1_22/api/rbac/v1alpha1/aggregation_rule.rs @@ -9,7 +9,7 @@ pub struct AggregationRule { impl crate::DeepMerge for AggregationRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.cluster_role_selectors, other.cluster_role_selectors); + crate::merge_strategies::list::atomic(&mut self.cluster_role_selectors, other.cluster_role_selectors); } } diff --git a/src/v1_22/api/rbac/v1alpha1/cluster_role.rs b/src/v1_22/api/rbac/v1alpha1/cluster_role.rs index 751ea258ce..1894462873 100644 --- a/src/v1_22/api/rbac/v1alpha1/cluster_role.rs +++ b/src/v1_22/api/rbac/v1alpha1/cluster_role.rs @@ -378,7 +378,7 @@ impl crate::DeepMerge for ClusterRole { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.aggregation_rule, other.aggregation_rule); crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.rules, other.rules); + crate::merge_strategies::list::atomic(&mut self.rules, other.rules); } } 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..9385e93337 100644 --- a/src/v1_22/api/rbac/v1alpha1/cluster_role_binding.rs +++ b/src/v1_22/api/rbac/v1alpha1/cluster_role_binding.rs @@ -378,7 +378,7 @@ impl crate::DeepMerge for ClusterRoleBinding { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); crate::DeepMerge::merge_from(&mut self.role_ref, other.role_ref); - crate::DeepMerge::merge_from(&mut self.subjects, other.subjects); + crate::merge_strategies::list::atomic(&mut self.subjects, other.subjects); } } diff --git a/src/v1_22/api/rbac/v1alpha1/policy_rule.rs b/src/v1_22/api/rbac/v1alpha1/policy_rule.rs index 9a56269c4b..e8a87019f9 100644 --- a/src/v1_22/api/rbac/v1alpha1/policy_rule.rs +++ b/src/v1_22/api/rbac/v1alpha1/policy_rule.rs @@ -21,11 +21,11 @@ pub struct PolicyRule { impl crate::DeepMerge for PolicyRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.api_groups, other.api_groups); - crate::DeepMerge::merge_from(&mut self.non_resource_urls, other.non_resource_urls); - crate::DeepMerge::merge_from(&mut self.resource_names, other.resource_names); - crate::DeepMerge::merge_from(&mut self.resources, other.resources); - crate::DeepMerge::merge_from(&mut self.verbs, other.verbs); + crate::merge_strategies::list::atomic(&mut self.api_groups, other.api_groups); + crate::merge_strategies::list::atomic(&mut self.non_resource_urls, other.non_resource_urls); + crate::merge_strategies::list::atomic(&mut self.resource_names, other.resource_names); + crate::merge_strategies::list::atomic(&mut self.resources, other.resources); + crate::merge_strategies::list::atomic(&mut self.verbs, other.verbs); } } diff --git a/src/v1_22/api/rbac/v1alpha1/role.rs b/src/v1_22/api/rbac/v1alpha1/role.rs index ed08658a2d..a21e1d75e2 100644 --- a/src/v1_22/api/rbac/v1alpha1/role.rs +++ b/src/v1_22/api/rbac/v1alpha1/role.rs @@ -490,7 +490,7 @@ impl crate::Metadata for Role { impl crate::DeepMerge for Role { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.rules, other.rules); + crate::merge_strategies::list::atomic(&mut self.rules, other.rules); } } diff --git a/src/v1_22/api/rbac/v1alpha1/role_binding.rs b/src/v1_22/api/rbac/v1alpha1/role_binding.rs index f965377b92..819c0b88f2 100644 --- a/src/v1_22/api/rbac/v1alpha1/role_binding.rs +++ b/src/v1_22/api/rbac/v1alpha1/role_binding.rs @@ -494,7 +494,7 @@ impl crate::DeepMerge for RoleBinding { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); crate::DeepMerge::merge_from(&mut self.role_ref, other.role_ref); - crate::DeepMerge::merge_from(&mut self.subjects, other.subjects); + crate::merge_strategies::list::atomic(&mut self.subjects, other.subjects); } } diff --git a/src/v1_22/api/storage/v1/csi_driver_spec.rs b/src/v1_22/api/storage/v1/csi_driver_spec.rs index e3771b1816..13f6b867d6 100644 --- a/src/v1_22/api/storage/v1/csi_driver_spec.rs +++ b/src/v1_22/api/storage/v1/csi_driver_spec.rs @@ -63,8 +63,8 @@ impl crate::DeepMerge for CSIDriverSpec { crate::DeepMerge::merge_from(&mut self.pod_info_on_mount, other.pod_info_on_mount); crate::DeepMerge::merge_from(&mut self.requires_republish, other.requires_republish); crate::DeepMerge::merge_from(&mut self.storage_capacity, other.storage_capacity); - crate::DeepMerge::merge_from(&mut self.token_requests, other.token_requests); - crate::DeepMerge::merge_from(&mut self.volume_lifecycle_modes, other.volume_lifecycle_modes); + crate::merge_strategies::list::atomic(&mut self.token_requests, other.token_requests); + crate::merge_strategies::list::set(&mut self.volume_lifecycle_modes, other.volume_lifecycle_modes); } } diff --git a/src/v1_22/api/storage/v1/csi_node_driver.rs b/src/v1_22/api/storage/v1/csi_node_driver.rs index c113299390..d8b79d89f3 100644 --- a/src/v1_22/api/storage/v1/csi_node_driver.rs +++ b/src/v1_22/api/storage/v1/csi_node_driver.rs @@ -21,7 +21,7 @@ impl crate::DeepMerge for CSINodeDriver { crate::DeepMerge::merge_from(&mut self.allocatable, other.allocatable); crate::DeepMerge::merge_from(&mut self.name, other.name); crate::DeepMerge::merge_from(&mut self.node_id, other.node_id); - crate::DeepMerge::merge_from(&mut self.topology_keys, other.topology_keys); + crate::merge_strategies::list::atomic(&mut self.topology_keys, other.topology_keys); } } diff --git a/src/v1_22/api/storage/v1/csi_node_spec.rs b/src/v1_22/api/storage/v1/csi_node_spec.rs index ea2a1ddb97..4717576df8 100644 --- a/src/v1_22/api/storage/v1/csi_node_spec.rs +++ b/src/v1_22/api/storage/v1/csi_node_spec.rs @@ -9,7 +9,14 @@ pub struct CSINodeSpec { impl crate::DeepMerge for CSINodeSpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.drivers, other.drivers); + crate::merge_strategies::list::map( + &mut self.drivers, + other.drivers, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_22/api/storage/v1/storage_class.rs b/src/v1_22/api/storage/v1/storage_class.rs index 2bf8e65456..12774ba320 100644 --- a/src/v1_22/api/storage/v1/storage_class.rs +++ b/src/v1_22/api/storage/v1/storage_class.rs @@ -394,10 +394,12 @@ impl crate::Metadata for StorageClass { impl crate::DeepMerge for StorageClass { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.allow_volume_expansion, other.allow_volume_expansion); - crate::DeepMerge::merge_from(&mut self.allowed_topologies, other.allowed_topologies); + crate::merge_strategies::list::atomic(&mut self.allowed_topologies, other.allowed_topologies); crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.mount_options, other.mount_options); - crate::DeepMerge::merge_from(&mut self.parameters, other.parameters); + crate::merge_strategies::list::atomic(&mut self.mount_options, other.mount_options); + crate::merge_strategies::map::granular(&mut self.parameters, other.parameters, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.provisioner, other.provisioner); crate::DeepMerge::merge_from(&mut self.reclaim_policy, other.reclaim_policy); crate::DeepMerge::merge_from(&mut self.volume_binding_mode, other.volume_binding_mode); diff --git a/src/v1_22/api/storage/v1/volume_attachment_status.rs b/src/v1_22/api/storage/v1/volume_attachment_status.rs index fb8e63d745..bb6ba3fe42 100644 --- a/src/v1_22/api/storage/v1/volume_attachment_status.rs +++ b/src/v1_22/api/storage/v1/volume_attachment_status.rs @@ -20,7 +20,9 @@ impl crate::DeepMerge for VolumeAttachmentStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.attach_error, other.attach_error); crate::DeepMerge::merge_from(&mut self.attached, other.attached); - crate::DeepMerge::merge_from(&mut self.attachment_metadata, other.attachment_metadata); + crate::merge_strategies::map::granular(&mut self.attachment_metadata, other.attachment_metadata, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.detach_error, other.detach_error); } } diff --git a/src/v1_22/api/storage/v1alpha1/volume_attachment_status.rs b/src/v1_22/api/storage/v1alpha1/volume_attachment_status.rs index db1529fd28..67dd47c5f6 100644 --- a/src/v1_22/api/storage/v1alpha1/volume_attachment_status.rs +++ b/src/v1_22/api/storage/v1alpha1/volume_attachment_status.rs @@ -20,7 +20,9 @@ impl crate::DeepMerge for VolumeAttachmentStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.attach_error, other.attach_error); crate::DeepMerge::merge_from(&mut self.attached, other.attached); - crate::DeepMerge::merge_from(&mut self.attachment_metadata, other.attachment_metadata); + crate::merge_strategies::map::granular(&mut self.attachment_metadata, other.attachment_metadata, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.detach_error, other.detach_error); } } diff --git a/src/v1_22/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_names.rs b/src/v1_22/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_names.rs index f3a8d38696..d105542807 100644 --- a/src/v1_22/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_names.rs +++ b/src/v1_22/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_names.rs @@ -24,11 +24,11 @@ pub struct CustomResourceDefinitionNames { impl crate::DeepMerge for CustomResourceDefinitionNames { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.categories, other.categories); + crate::merge_strategies::list::atomic(&mut self.categories, other.categories); crate::DeepMerge::merge_from(&mut self.kind, other.kind); crate::DeepMerge::merge_from(&mut self.list_kind, other.list_kind); crate::DeepMerge::merge_from(&mut self.plural, other.plural); - crate::DeepMerge::merge_from(&mut self.short_names, other.short_names); + crate::merge_strategies::list::atomic(&mut self.short_names, other.short_names); crate::DeepMerge::merge_from(&mut self.singular, other.singular); } } diff --git a/src/v1_22/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_spec.rs b/src/v1_22/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_spec.rs index 40ffea9ed1..e3a881e9a4 100644 --- a/src/v1_22/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_spec.rs +++ b/src/v1_22/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_spec.rs @@ -29,7 +29,7 @@ impl crate::DeepMerge for CustomResourceDefinitionSpec { crate::DeepMerge::merge_from(&mut self.names, other.names); crate::DeepMerge::merge_from(&mut self.preserve_unknown_fields, other.preserve_unknown_fields); crate::DeepMerge::merge_from(&mut self.scope, other.scope); - crate::DeepMerge::merge_from(&mut self.versions, other.versions); + crate::merge_strategies::list::atomic(&mut self.versions, other.versions); } } diff --git a/src/v1_22/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_status.rs b/src/v1_22/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_status.rs index a7427347aa..d080a301dc 100644 --- a/src/v1_22/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_status.rs +++ b/src/v1_22/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_status.rs @@ -16,8 +16,15 @@ pub struct CustomResourceDefinitionStatus { impl crate::DeepMerge for CustomResourceDefinitionStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.accepted_names, other.accepted_names); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); - crate::DeepMerge::merge_from(&mut self.stored_versions, other.stored_versions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::list::atomic(&mut self.stored_versions, other.stored_versions); } } diff --git a/src/v1_22/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_version.rs b/src/v1_22/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_version.rs index 5b4d51a697..90a9bb5e32 100644 --- a/src/v1_22/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_version.rs +++ b/src/v1_22/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_version.rs @@ -30,7 +30,7 @@ pub struct CustomResourceDefinitionVersion { impl crate::DeepMerge for CustomResourceDefinitionVersion { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.additional_printer_columns, other.additional_printer_columns); + crate::merge_strategies::list::atomic(&mut self.additional_printer_columns, other.additional_printer_columns); crate::DeepMerge::merge_from(&mut self.deprecated, other.deprecated); crate::DeepMerge::merge_from(&mut self.deprecation_warning, other.deprecation_warning); crate::DeepMerge::merge_from(&mut self.name, other.name); diff --git a/src/v1_22/apiextensions_apiserver/pkg/apis/apiextensions/v1/json_schema_props.rs b/src/v1_22/apiextensions_apiserver/pkg/apis/apiextensions/v1/json_schema_props.rs index bd87461670..35c767acb8 100644 --- a/src/v1_22/apiextensions_apiserver/pkg/apis/apiextensions/v1/json_schema_props.rs +++ b/src/v1_22/apiextensions_apiserver/pkg/apis/apiextensions/v1/json_schema_props.rs @@ -139,13 +139,17 @@ impl crate::DeepMerge for JSONSchemaProps { crate::DeepMerge::merge_from(&mut self.schema, other.schema); crate::DeepMerge::merge_from(&mut self.additional_items, other.additional_items); crate::DeepMerge::merge_from(&mut self.additional_properties, other.additional_properties); - crate::DeepMerge::merge_from(&mut self.all_of, other.all_of); - crate::DeepMerge::merge_from(&mut self.any_of, other.any_of); + crate::merge_strategies::list::atomic(&mut self.all_of, other.all_of); + crate::merge_strategies::list::atomic(&mut self.any_of, other.any_of); crate::DeepMerge::merge_from(&mut self.default, other.default); - crate::DeepMerge::merge_from(&mut self.definitions, other.definitions); - crate::DeepMerge::merge_from(&mut self.dependencies, other.dependencies); + crate::merge_strategies::map::granular(&mut self.definitions, other.definitions, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.dependencies, other.dependencies, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.description, other.description); - crate::DeepMerge::merge_from(&mut self.enum_, other.enum_); + crate::merge_strategies::list::atomic(&mut self.enum_, other.enum_); crate::DeepMerge::merge_from(&mut self.example, other.example); crate::DeepMerge::merge_from(&mut self.exclusive_maximum, other.exclusive_maximum); crate::DeepMerge::merge_from(&mut self.exclusive_minimum, other.exclusive_minimum); @@ -164,17 +168,21 @@ impl crate::DeepMerge for JSONSchemaProps { crate::DeepMerge::merge_from(&mut self.multiple_of, other.multiple_of); crate::DeepMerge::merge_from(&mut self.not, other.not); crate::DeepMerge::merge_from(&mut self.nullable, other.nullable); - crate::DeepMerge::merge_from(&mut self.one_of, other.one_of); + crate::merge_strategies::list::atomic(&mut self.one_of, other.one_of); crate::DeepMerge::merge_from(&mut self.pattern, other.pattern); - crate::DeepMerge::merge_from(&mut self.pattern_properties, other.pattern_properties); - crate::DeepMerge::merge_from(&mut self.properties, other.properties); - crate::DeepMerge::merge_from(&mut self.required, other.required); + crate::merge_strategies::map::granular(&mut self.pattern_properties, other.pattern_properties, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.properties, other.properties, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::list::atomic(&mut self.required, other.required); crate::DeepMerge::merge_from(&mut self.title, other.title); crate::DeepMerge::merge_from(&mut self.type_, other.type_); crate::DeepMerge::merge_from(&mut self.unique_items, other.unique_items); crate::DeepMerge::merge_from(&mut self.x_kubernetes_embedded_resource, other.x_kubernetes_embedded_resource); crate::DeepMerge::merge_from(&mut self.x_kubernetes_int_or_string, other.x_kubernetes_int_or_string); - crate::DeepMerge::merge_from(&mut self.x_kubernetes_list_map_keys, other.x_kubernetes_list_map_keys); + crate::merge_strategies::list::atomic(&mut self.x_kubernetes_list_map_keys, other.x_kubernetes_list_map_keys); crate::DeepMerge::merge_from(&mut self.x_kubernetes_list_type, other.x_kubernetes_list_type); crate::DeepMerge::merge_from(&mut self.x_kubernetes_map_type, other.x_kubernetes_map_type); crate::DeepMerge::merge_from(&mut self.x_kubernetes_preserve_unknown_fields, other.x_kubernetes_preserve_unknown_fields); diff --git a/src/v1_22/apiextensions_apiserver/pkg/apis/apiextensions/v1/webhook_conversion.rs b/src/v1_22/apiextensions_apiserver/pkg/apis/apiextensions/v1/webhook_conversion.rs index aec75dfd39..69008b2dca 100644 --- a/src/v1_22/apiextensions_apiserver/pkg/apis/apiextensions/v1/webhook_conversion.rs +++ b/src/v1_22/apiextensions_apiserver/pkg/apis/apiextensions/v1/webhook_conversion.rs @@ -13,7 +13,7 @@ pub struct WebhookConversion { impl crate::DeepMerge for WebhookConversion { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.client_config, other.client_config); - crate::DeepMerge::merge_from(&mut self.conversion_review_versions, other.conversion_review_versions); + crate::merge_strategies::list::atomic(&mut self.conversion_review_versions, other.conversion_review_versions); } } diff --git a/src/v1_22/apimachinery/pkg/apis/meta/v1/api_group.rs b/src/v1_22/apimachinery/pkg/apis/meta/v1/api_group.rs index 3d36440e87..f83318ab08 100644 --- a/src/v1_22/apimachinery/pkg/apis/meta/v1/api_group.rs +++ b/src/v1_22/apimachinery/pkg/apis/meta/v1/api_group.rs @@ -29,8 +29,8 @@ impl crate::DeepMerge for APIGroup { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.name, other.name); crate::DeepMerge::merge_from(&mut self.preferred_version, other.preferred_version); - crate::DeepMerge::merge_from(&mut self.server_address_by_client_cidrs, other.server_address_by_client_cidrs); - crate::DeepMerge::merge_from(&mut self.versions, other.versions); + crate::merge_strategies::list::atomic(&mut self.server_address_by_client_cidrs, other.server_address_by_client_cidrs); + crate::merge_strategies::list::atomic(&mut self.versions, other.versions); } } diff --git a/src/v1_22/apimachinery/pkg/apis/meta/v1/api_group_list.rs b/src/v1_22/apimachinery/pkg/apis/meta/v1/api_group_list.rs index 167aeeabe0..e8a5d7e747 100644 --- a/src/v1_22/apimachinery/pkg/apis/meta/v1/api_group_list.rs +++ b/src/v1_22/apimachinery/pkg/apis/meta/v1/api_group_list.rs @@ -18,7 +18,7 @@ impl crate::Resource for APIGroupList { impl crate::DeepMerge for APIGroupList { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.groups, other.groups); + crate::merge_strategies::list::atomic(&mut self.groups, other.groups); } } diff --git a/src/v1_22/apimachinery/pkg/apis/meta/v1/api_resource.rs b/src/v1_22/apimachinery/pkg/apis/meta/v1/api_resource.rs index e679e8aa73..477c5ad98d 100644 --- a/src/v1_22/apimachinery/pkg/apis/meta/v1/api_resource.rs +++ b/src/v1_22/apimachinery/pkg/apis/meta/v1/api_resource.rs @@ -36,15 +36,15 @@ pub struct APIResource { impl crate::DeepMerge for APIResource { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.categories, other.categories); + crate::merge_strategies::list::atomic(&mut self.categories, other.categories); crate::DeepMerge::merge_from(&mut self.group, other.group); crate::DeepMerge::merge_from(&mut self.kind, other.kind); crate::DeepMerge::merge_from(&mut self.name, other.name); crate::DeepMerge::merge_from(&mut self.namespaced, other.namespaced); - crate::DeepMerge::merge_from(&mut self.short_names, other.short_names); + crate::merge_strategies::list::atomic(&mut self.short_names, other.short_names); crate::DeepMerge::merge_from(&mut self.singular_name, other.singular_name); crate::DeepMerge::merge_from(&mut self.storage_version_hash, other.storage_version_hash); - crate::DeepMerge::merge_from(&mut self.verbs, other.verbs); + crate::merge_strategies::list::atomic(&mut self.verbs, other.verbs); crate::DeepMerge::merge_from(&mut self.version, other.version); } } diff --git a/src/v1_22/apimachinery/pkg/apis/meta/v1/api_resource_list.rs b/src/v1_22/apimachinery/pkg/apis/meta/v1/api_resource_list.rs index a34ba733a3..4107b4f488 100644 --- a/src/v1_22/apimachinery/pkg/apis/meta/v1/api_resource_list.rs +++ b/src/v1_22/apimachinery/pkg/apis/meta/v1/api_resource_list.rs @@ -22,7 +22,7 @@ impl crate::Resource for APIResourceList { impl crate::DeepMerge for APIResourceList { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.group_version, other.group_version); - crate::DeepMerge::merge_from(&mut self.resources, other.resources); + crate::merge_strategies::list::atomic(&mut self.resources, other.resources); } } diff --git a/src/v1_22/apimachinery/pkg/apis/meta/v1/api_versions.rs b/src/v1_22/apimachinery/pkg/apis/meta/v1/api_versions.rs index a2d355ee8d..eda4a89785 100644 --- a/src/v1_22/apimachinery/pkg/apis/meta/v1/api_versions.rs +++ b/src/v1_22/apimachinery/pkg/apis/meta/v1/api_versions.rs @@ -21,8 +21,8 @@ impl crate::Resource for APIVersions { impl crate::DeepMerge for APIVersions { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.server_address_by_client_cidrs, other.server_address_by_client_cidrs); - crate::DeepMerge::merge_from(&mut self.versions, other.versions); + crate::merge_strategies::list::atomic(&mut self.server_address_by_client_cidrs, other.server_address_by_client_cidrs); + crate::merge_strategies::list::atomic(&mut self.versions, other.versions); } } diff --git a/src/v1_22/apimachinery/pkg/apis/meta/v1/delete_options.rs b/src/v1_22/apimachinery/pkg/apis/meta/v1/delete_options.rs index 04abc8215b..4ac6d24fb9 100644 --- a/src/v1_22/apimachinery/pkg/apis/meta/v1/delete_options.rs +++ b/src/v1_22/apimachinery/pkg/apis/meta/v1/delete_options.rs @@ -28,7 +28,7 @@ pub struct DeleteOptions { impl crate::DeepMerge for DeleteOptions { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.api_version, other.api_version); - crate::DeepMerge::merge_from(&mut self.dry_run, other.dry_run); + crate::merge_strategies::list::atomic(&mut self.dry_run, other.dry_run); crate::DeepMerge::merge_from(&mut self.grace_period_seconds, other.grace_period_seconds); crate::DeepMerge::merge_from(&mut self.kind, other.kind); crate::DeepMerge::merge_from(&mut self.orphan_dependents, other.orphan_dependents); diff --git a/src/v1_22/apimachinery/pkg/apis/meta/v1/label_selector.rs b/src/v1_22/apimachinery/pkg/apis/meta/v1/label_selector.rs index 877caad4dd..19028abb99 100644 --- a/src/v1_22/apimachinery/pkg/apis/meta/v1/label_selector.rs +++ b/src/v1_22/apimachinery/pkg/apis/meta/v1/label_selector.rs @@ -12,8 +12,10 @@ pub struct LabelSelector { impl crate::DeepMerge for LabelSelector { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.match_expressions, other.match_expressions); - crate::DeepMerge::merge_from(&mut self.match_labels, other.match_labels); + crate::merge_strategies::list::atomic(&mut self.match_expressions, other.match_expressions); + crate::merge_strategies::map::granular(&mut self.match_labels, other.match_labels, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); } } diff --git a/src/v1_22/apimachinery/pkg/apis/meta/v1/label_selector_requirement.rs b/src/v1_22/apimachinery/pkg/apis/meta/v1/label_selector_requirement.rs index 6570daea42..09c7dc7cc7 100644 --- a/src/v1_22/apimachinery/pkg/apis/meta/v1/label_selector_requirement.rs +++ b/src/v1_22/apimachinery/pkg/apis/meta/v1/label_selector_requirement.rs @@ -17,7 +17,7 @@ impl crate::DeepMerge for LabelSelectorRequirement { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.key, other.key); crate::DeepMerge::merge_from(&mut self.operator, other.operator); - crate::DeepMerge::merge_from(&mut self.values, other.values); + crate::merge_strategies::list::atomic(&mut self.values, other.values); } } 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..b1d8a3ec0d 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 @@ -70,19 +70,30 @@ pub struct ObjectMeta { impl crate::DeepMerge for ObjectMeta { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.annotations, other.annotations); + crate::merge_strategies::map::granular(&mut self.annotations, other.annotations, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); 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::merge_strategies::list::set(&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::merge_strategies::map::granular(&mut self.labels, other.labels, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::list::atomic(&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::merge_strategies::list::map( + &mut self.owner_references, + other.owner_references, + &[|lhs, rhs| lhs.uid == rhs.uid], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); 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); diff --git a/src/v1_22/apimachinery/pkg/apis/meta/v1/status_details.rs b/src/v1_22/apimachinery/pkg/apis/meta/v1/status_details.rs index 183b525d2c..28141f7f6f 100644 --- a/src/v1_22/apimachinery/pkg/apis/meta/v1/status_details.rs +++ b/src/v1_22/apimachinery/pkg/apis/meta/v1/status_details.rs @@ -24,7 +24,7 @@ pub struct StatusDetails { impl crate::DeepMerge for StatusDetails { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.causes, other.causes); + crate::merge_strategies::list::atomic(&mut self.causes, other.causes); crate::DeepMerge::merge_from(&mut self.group, other.group); crate::DeepMerge::merge_from(&mut self.kind, other.kind); crate::DeepMerge::merge_from(&mut self.name, other.name); diff --git a/src/v1_22/kube_aggregator/pkg/apis/apiregistration/v1/api_service_status.rs b/src/v1_22/kube_aggregator/pkg/apis/apiregistration/v1/api_service_status.rs index 658b6ca9ce..72a107b6ba 100644 --- a/src/v1_22/kube_aggregator/pkg/apis/apiregistration/v1/api_service_status.rs +++ b/src/v1_22/kube_aggregator/pkg/apis/apiregistration/v1/api_service_status.rs @@ -9,7 +9,14 @@ pub struct APIServiceStatus { impl crate::DeepMerge for APIServiceStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_22/list.rs b/src/v1_22/list.rs index cc10bf672f..9863ef1855 100644 --- a/src/v1_22/list.rs +++ b/src/v1_22/list.rs @@ -31,9 +31,16 @@ impl crate::Metadata for List where T: crate::ListableResource { } } -impl crate::DeepMerge for List where T: crate::ListableResource { +impl crate::DeepMerge for List where T: crate::DeepMerge + crate::Metadata + crate::ListableResource { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.items, other.items); + crate::merge_strategies::list::map( + &mut self.items, + other.items, + &[|lhs, rhs| lhs.metadata().namespace == rhs.metadata().namespace, |lhs, rhs| lhs.metadata().name == rhs.metadata().name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); } } diff --git a/src/v1_23/api/admissionregistration/v1/mutating_webhook.rs b/src/v1_23/api/admissionregistration/v1/mutating_webhook.rs index 5b1a4d833f..783200c537 100644 --- a/src/v1_23/api/admissionregistration/v1/mutating_webhook.rs +++ b/src/v1_23/api/admissionregistration/v1/mutating_webhook.rs @@ -81,7 +81,7 @@ pub struct MutatingWebhook { impl crate::DeepMerge for MutatingWebhook { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.admission_review_versions, other.admission_review_versions); + crate::merge_strategies::list::atomic(&mut self.admission_review_versions, other.admission_review_versions); crate::DeepMerge::merge_from(&mut self.client_config, other.client_config); crate::DeepMerge::merge_from(&mut self.failure_policy, other.failure_policy); crate::DeepMerge::merge_from(&mut self.match_policy, other.match_policy); @@ -89,7 +89,7 @@ impl crate::DeepMerge for MutatingWebhook { crate::DeepMerge::merge_from(&mut self.namespace_selector, other.namespace_selector); crate::DeepMerge::merge_from(&mut self.object_selector, other.object_selector); crate::DeepMerge::merge_from(&mut self.reinvocation_policy, other.reinvocation_policy); - crate::DeepMerge::merge_from(&mut self.rules, other.rules); + crate::merge_strategies::list::atomic(&mut self.rules, other.rules); crate::DeepMerge::merge_from(&mut self.side_effects, other.side_effects); crate::DeepMerge::merge_from(&mut self.timeout_seconds, other.timeout_seconds); } 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..156c7ccfcf 100644 --- a/src/v1_23/api/admissionregistration/v1/mutating_webhook_configuration.rs +++ b/src/v1_23/api/admissionregistration/v1/mutating_webhook_configuration.rs @@ -374,7 +374,14 @@ impl crate::Metadata for MutatingWebhookConfiguration { impl crate::DeepMerge for MutatingWebhookConfiguration { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.webhooks, other.webhooks); + crate::merge_strategies::list::map( + &mut self.webhooks, + other.webhooks, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_23/api/admissionregistration/v1/rule_with_operations.rs b/src/v1_23/api/admissionregistration/v1/rule_with_operations.rs index c45c425c57..441b9ab3fd 100644 --- a/src/v1_23/api/admissionregistration/v1/rule_with_operations.rs +++ b/src/v1_23/api/admissionregistration/v1/rule_with_operations.rs @@ -27,10 +27,10 @@ pub struct RuleWithOperations { impl crate::DeepMerge for RuleWithOperations { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.api_groups, other.api_groups); - crate::DeepMerge::merge_from(&mut self.api_versions, other.api_versions); - crate::DeepMerge::merge_from(&mut self.operations, other.operations); - crate::DeepMerge::merge_from(&mut self.resources, other.resources); + crate::merge_strategies::list::atomic(&mut self.api_groups, other.api_groups); + crate::merge_strategies::list::atomic(&mut self.api_versions, other.api_versions); + crate::merge_strategies::list::atomic(&mut self.operations, other.operations); + crate::merge_strategies::list::atomic(&mut self.resources, other.resources); crate::DeepMerge::merge_from(&mut self.scope, other.scope); } } diff --git a/src/v1_23/api/admissionregistration/v1/validating_webhook.rs b/src/v1_23/api/admissionregistration/v1/validating_webhook.rs index 1a64d4e885..e594176265 100644 --- a/src/v1_23/api/admissionregistration/v1/validating_webhook.rs +++ b/src/v1_23/api/admissionregistration/v1/validating_webhook.rs @@ -72,14 +72,14 @@ pub struct ValidatingWebhook { impl crate::DeepMerge for ValidatingWebhook { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.admission_review_versions, other.admission_review_versions); + crate::merge_strategies::list::atomic(&mut self.admission_review_versions, other.admission_review_versions); crate::DeepMerge::merge_from(&mut self.client_config, other.client_config); crate::DeepMerge::merge_from(&mut self.failure_policy, other.failure_policy); crate::DeepMerge::merge_from(&mut self.match_policy, other.match_policy); crate::DeepMerge::merge_from(&mut self.name, other.name); crate::DeepMerge::merge_from(&mut self.namespace_selector, other.namespace_selector); crate::DeepMerge::merge_from(&mut self.object_selector, other.object_selector); - crate::DeepMerge::merge_from(&mut self.rules, other.rules); + crate::merge_strategies::list::atomic(&mut self.rules, other.rules); crate::DeepMerge::merge_from(&mut self.side_effects, other.side_effects); crate::DeepMerge::merge_from(&mut self.timeout_seconds, other.timeout_seconds); } 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..ff20990424 100644 --- a/src/v1_23/api/admissionregistration/v1/validating_webhook_configuration.rs +++ b/src/v1_23/api/admissionregistration/v1/validating_webhook_configuration.rs @@ -374,7 +374,14 @@ impl crate::Metadata for ValidatingWebhookConfiguration { impl crate::DeepMerge for ValidatingWebhookConfiguration { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.webhooks, other.webhooks); + crate::merge_strategies::list::map( + &mut self.webhooks, + other.webhooks, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_23/api/apiserverinternal/v1alpha1/server_storage_version.rs b/src/v1_23/api/apiserverinternal/v1alpha1/server_storage_version.rs index 1040b5e6d7..5a693d9e59 100644 --- a/src/v1_23/api/apiserverinternal/v1alpha1/server_storage_version.rs +++ b/src/v1_23/api/apiserverinternal/v1alpha1/server_storage_version.rs @@ -16,7 +16,7 @@ pub struct ServerStorageVersion { impl crate::DeepMerge for ServerStorageVersion { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.api_server_id, other.api_server_id); - crate::DeepMerge::merge_from(&mut self.decodable_versions, other.decodable_versions); + crate::merge_strategies::list::set(&mut self.decodable_versions, other.decodable_versions); crate::DeepMerge::merge_from(&mut self.encoding_version, other.encoding_version); } } diff --git a/src/v1_23/api/apiserverinternal/v1alpha1/storage_version_status.rs b/src/v1_23/api/apiserverinternal/v1alpha1/storage_version_status.rs index e63b469644..0d5b9bd3a1 100644 --- a/src/v1_23/api/apiserverinternal/v1alpha1/storage_version_status.rs +++ b/src/v1_23/api/apiserverinternal/v1alpha1/storage_version_status.rs @@ -16,8 +16,22 @@ pub struct StorageVersionStatus { impl crate::DeepMerge for StorageVersionStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.common_encoding_version, other.common_encoding_version); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); - crate::DeepMerge::merge_from(&mut self.storage_versions, other.storage_versions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::list::map( + &mut self.storage_versions, + other.storage_versions, + &[|lhs, rhs| lhs.api_server_id == rhs.api_server_id], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_23/api/apps/v1/daemon_set_status.rs b/src/v1_23/api/apps/v1/daemon_set_status.rs index 278caf879c..345f5eb651 100644 --- a/src/v1_23/api/apps/v1/daemon_set_status.rs +++ b/src/v1_23/api/apps/v1/daemon_set_status.rs @@ -37,7 +37,14 @@ pub struct DaemonSetStatus { impl crate::DeepMerge for DaemonSetStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.collision_count, other.collision_count); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.current_number_scheduled, other.current_number_scheduled); crate::DeepMerge::merge_from(&mut self.desired_number_scheduled, other.desired_number_scheduled); crate::DeepMerge::merge_from(&mut self.number_available, other.number_available); diff --git a/src/v1_23/api/apps/v1/deployment_status.rs b/src/v1_23/api/apps/v1/deployment_status.rs index 01ff5c75e4..ee140e108a 100644 --- a/src/v1_23/api/apps/v1/deployment_status.rs +++ b/src/v1_23/api/apps/v1/deployment_status.rs @@ -32,7 +32,14 @@ impl crate::DeepMerge for DeploymentStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.available_replicas, other.available_replicas); crate::DeepMerge::merge_from(&mut self.collision_count, other.collision_count); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.observed_generation, other.observed_generation); crate::DeepMerge::merge_from(&mut self.ready_replicas, other.ready_replicas); crate::DeepMerge::merge_from(&mut self.replicas, other.replicas); diff --git a/src/v1_23/api/apps/v1/replica_set_status.rs b/src/v1_23/api/apps/v1/replica_set_status.rs index 6b5b45e35f..1b47aa5a70 100644 --- a/src/v1_23/api/apps/v1/replica_set_status.rs +++ b/src/v1_23/api/apps/v1/replica_set_status.rs @@ -25,7 +25,14 @@ pub struct ReplicaSetStatus { impl crate::DeepMerge for ReplicaSetStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.available_replicas, other.available_replicas); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.fully_labeled_replicas, other.fully_labeled_replicas); crate::DeepMerge::merge_from(&mut self.observed_generation, other.observed_generation); crate::DeepMerge::merge_from(&mut self.ready_replicas, other.ready_replicas); diff --git a/src/v1_23/api/apps/v1/stateful_set_spec.rs b/src/v1_23/api/apps/v1/stateful_set_spec.rs index cc5ac5c977..4ffc843296 100644 --- a/src/v1_23/api/apps/v1/stateful_set_spec.rs +++ b/src/v1_23/api/apps/v1/stateful_set_spec.rs @@ -46,7 +46,7 @@ impl crate::DeepMerge for StatefulSetSpec { crate::DeepMerge::merge_from(&mut self.service_name, other.service_name); crate::DeepMerge::merge_from(&mut self.template, other.template); crate::DeepMerge::merge_from(&mut self.update_strategy, other.update_strategy); - crate::DeepMerge::merge_from(&mut self.volume_claim_templates, other.volume_claim_templates); + crate::merge_strategies::list::atomic(&mut self.volume_claim_templates, other.volume_claim_templates); } } diff --git a/src/v1_23/api/apps/v1/stateful_set_status.rs b/src/v1_23/api/apps/v1/stateful_set_status.rs index 62db4e3163..080282cc76 100644 --- a/src/v1_23/api/apps/v1/stateful_set_status.rs +++ b/src/v1_23/api/apps/v1/stateful_set_status.rs @@ -38,7 +38,14 @@ impl crate::DeepMerge for StatefulSetStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.available_replicas, other.available_replicas); crate::DeepMerge::merge_from(&mut self.collision_count, other.collision_count); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.current_replicas, other.current_replicas); crate::DeepMerge::merge_from(&mut self.current_revision, other.current_revision); crate::DeepMerge::merge_from(&mut self.observed_generation, other.observed_generation); diff --git a/src/v1_23/api/authentication/v1/token_request_spec.rs b/src/v1_23/api/authentication/v1/token_request_spec.rs index 4ec786f381..f10197a68c 100644 --- a/src/v1_23/api/authentication/v1/token_request_spec.rs +++ b/src/v1_23/api/authentication/v1/token_request_spec.rs @@ -15,7 +15,7 @@ pub struct TokenRequestSpec { impl crate::DeepMerge for TokenRequestSpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.audiences, other.audiences); + crate::merge_strategies::list::atomic(&mut self.audiences, other.audiences); crate::DeepMerge::merge_from(&mut self.bound_object_ref, other.bound_object_ref); crate::DeepMerge::merge_from(&mut self.expiration_seconds, other.expiration_seconds); } diff --git a/src/v1_23/api/authentication/v1/token_review_spec.rs b/src/v1_23/api/authentication/v1/token_review_spec.rs index fd84653924..281127b67d 100644 --- a/src/v1_23/api/authentication/v1/token_review_spec.rs +++ b/src/v1_23/api/authentication/v1/token_review_spec.rs @@ -12,7 +12,7 @@ pub struct TokenReviewSpec { impl crate::DeepMerge for TokenReviewSpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.audiences, other.audiences); + crate::merge_strategies::list::atomic(&mut self.audiences, other.audiences); crate::DeepMerge::merge_from(&mut self.token, other.token); } } diff --git a/src/v1_23/api/authentication/v1/token_review_status.rs b/src/v1_23/api/authentication/v1/token_review_status.rs index 464164bcf9..4dd5aacc3d 100644 --- a/src/v1_23/api/authentication/v1/token_review_status.rs +++ b/src/v1_23/api/authentication/v1/token_review_status.rs @@ -18,7 +18,7 @@ pub struct TokenReviewStatus { impl crate::DeepMerge for TokenReviewStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.audiences, other.audiences); + crate::merge_strategies::list::atomic(&mut self.audiences, other.audiences); crate::DeepMerge::merge_from(&mut self.authenticated, other.authenticated); crate::DeepMerge::merge_from(&mut self.error, other.error); crate::DeepMerge::merge_from(&mut self.user, other.user); diff --git a/src/v1_23/api/authentication/v1/user_info.rs b/src/v1_23/api/authentication/v1/user_info.rs index d6890119b7..3890788cda 100644 --- a/src/v1_23/api/authentication/v1/user_info.rs +++ b/src/v1_23/api/authentication/v1/user_info.rs @@ -18,8 +18,10 @@ pub struct UserInfo { impl crate::DeepMerge for UserInfo { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.extra, other.extra); - crate::DeepMerge::merge_from(&mut self.groups, other.groups); + crate::merge_strategies::map::granular(&mut self.extra, other.extra, |current_item, other_item| { + crate::merge_strategies::list::atomic(current_item, other_item); + }); + crate::merge_strategies::list::atomic(&mut self.groups, other.groups); crate::DeepMerge::merge_from(&mut self.uid, other.uid); crate::DeepMerge::merge_from(&mut self.username, other.username); } diff --git a/src/v1_23/api/authorization/v1/non_resource_rule.rs b/src/v1_23/api/authorization/v1/non_resource_rule.rs index 7df269ffd7..db780454b8 100644 --- a/src/v1_23/api/authorization/v1/non_resource_rule.rs +++ b/src/v1_23/api/authorization/v1/non_resource_rule.rs @@ -12,8 +12,8 @@ pub struct NonResourceRule { impl crate::DeepMerge for NonResourceRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.non_resource_urls, other.non_resource_urls); - crate::DeepMerge::merge_from(&mut self.verbs, other.verbs); + crate::merge_strategies::list::atomic(&mut self.non_resource_urls, other.non_resource_urls); + crate::merge_strategies::list::atomic(&mut self.verbs, other.verbs); } } diff --git a/src/v1_23/api/authorization/v1/resource_rule.rs b/src/v1_23/api/authorization/v1/resource_rule.rs index 58b5e020a8..1af9333654 100644 --- a/src/v1_23/api/authorization/v1/resource_rule.rs +++ b/src/v1_23/api/authorization/v1/resource_rule.rs @@ -19,10 +19,10 @@ pub struct ResourceRule { impl crate::DeepMerge for ResourceRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.api_groups, other.api_groups); - crate::DeepMerge::merge_from(&mut self.resource_names, other.resource_names); - crate::DeepMerge::merge_from(&mut self.resources, other.resources); - crate::DeepMerge::merge_from(&mut self.verbs, other.verbs); + crate::merge_strategies::list::atomic(&mut self.api_groups, other.api_groups); + crate::merge_strategies::list::atomic(&mut self.resource_names, other.resource_names); + crate::merge_strategies::list::atomic(&mut self.resources, other.resources); + crate::merge_strategies::list::atomic(&mut self.verbs, other.verbs); } } diff --git a/src/v1_23/api/authorization/v1/subject_access_review_spec.rs b/src/v1_23/api/authorization/v1/subject_access_review_spec.rs index ae8fadafd9..a4c4af18ce 100644 --- a/src/v1_23/api/authorization/v1/subject_access_review_spec.rs +++ b/src/v1_23/api/authorization/v1/subject_access_review_spec.rs @@ -24,8 +24,10 @@ pub struct SubjectAccessReviewSpec { impl crate::DeepMerge for SubjectAccessReviewSpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.extra, other.extra); - crate::DeepMerge::merge_from(&mut self.groups, other.groups); + crate::merge_strategies::map::granular(&mut self.extra, other.extra, |current_item, other_item| { + crate::merge_strategies::list::atomic(current_item, other_item); + }); + crate::merge_strategies::list::atomic(&mut self.groups, other.groups); crate::DeepMerge::merge_from(&mut self.non_resource_attributes, other.non_resource_attributes); crate::DeepMerge::merge_from(&mut self.resource_attributes, other.resource_attributes); crate::DeepMerge::merge_from(&mut self.uid, other.uid); diff --git a/src/v1_23/api/authorization/v1/subject_rules_review_status.rs b/src/v1_23/api/authorization/v1/subject_rules_review_status.rs index 9d7fb042cf..9d1682a3c8 100644 --- a/src/v1_23/api/authorization/v1/subject_rules_review_status.rs +++ b/src/v1_23/api/authorization/v1/subject_rules_review_status.rs @@ -20,8 +20,8 @@ impl crate::DeepMerge for SubjectRulesReviewStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.evaluation_error, other.evaluation_error); crate::DeepMerge::merge_from(&mut self.incomplete, other.incomplete); - crate::DeepMerge::merge_from(&mut self.non_resource_rules, other.non_resource_rules); - crate::DeepMerge::merge_from(&mut self.resource_rules, other.resource_rules); + crate::merge_strategies::list::atomic(&mut self.non_resource_rules, other.non_resource_rules); + crate::merge_strategies::list::atomic(&mut self.resource_rules, other.resource_rules); } } diff --git a/src/v1_23/api/autoscaling/v2/horizontal_pod_autoscaler_spec.rs b/src/v1_23/api/autoscaling/v2/horizontal_pod_autoscaler_spec.rs index 90ea12126f..1aaf3eb861 100644 --- a/src/v1_23/api/autoscaling/v2/horizontal_pod_autoscaler_spec.rs +++ b/src/v1_23/api/autoscaling/v2/horizontal_pod_autoscaler_spec.rs @@ -23,7 +23,7 @@ impl crate::DeepMerge for HorizontalPodAutoscalerSpec { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.behavior, other.behavior); crate::DeepMerge::merge_from(&mut self.max_replicas, other.max_replicas); - crate::DeepMerge::merge_from(&mut self.metrics, other.metrics); + crate::merge_strategies::list::atomic(&mut self.metrics, other.metrics); crate::DeepMerge::merge_from(&mut self.min_replicas, other.min_replicas); crate::DeepMerge::merge_from(&mut self.scale_target_ref, other.scale_target_ref); } diff --git a/src/v1_23/api/autoscaling/v2/horizontal_pod_autoscaler_status.rs b/src/v1_23/api/autoscaling/v2/horizontal_pod_autoscaler_status.rs index bfb877a856..c4b24efd7f 100644 --- a/src/v1_23/api/autoscaling/v2/horizontal_pod_autoscaler_status.rs +++ b/src/v1_23/api/autoscaling/v2/horizontal_pod_autoscaler_status.rs @@ -24,8 +24,15 @@ pub struct HorizontalPodAutoscalerStatus { impl crate::DeepMerge for HorizontalPodAutoscalerStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); - crate::DeepMerge::merge_from(&mut self.current_metrics, other.current_metrics); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::list::atomic(&mut self.current_metrics, other.current_metrics); crate::DeepMerge::merge_from(&mut self.current_replicas, other.current_replicas); crate::DeepMerge::merge_from(&mut self.desired_replicas, other.desired_replicas); crate::DeepMerge::merge_from(&mut self.last_scale_time, other.last_scale_time); diff --git a/src/v1_23/api/autoscaling/v2/hpa_scaling_rules.rs b/src/v1_23/api/autoscaling/v2/hpa_scaling_rules.rs index 0b0dc2c81d..195201e286 100644 --- a/src/v1_23/api/autoscaling/v2/hpa_scaling_rules.rs +++ b/src/v1_23/api/autoscaling/v2/hpa_scaling_rules.rs @@ -15,7 +15,7 @@ pub struct HPAScalingRules { impl crate::DeepMerge for HPAScalingRules { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.policies, other.policies); + crate::merge_strategies::list::atomic(&mut self.policies, other.policies); crate::DeepMerge::merge_from(&mut self.select_policy, other.select_policy); crate::DeepMerge::merge_from(&mut self.stabilization_window_seconds, other.stabilization_window_seconds); } diff --git a/src/v1_23/api/autoscaling/v2beta1/horizontal_pod_autoscaler_spec.rs b/src/v1_23/api/autoscaling/v2beta1/horizontal_pod_autoscaler_spec.rs index dd2649f83e..c286723a24 100644 --- a/src/v1_23/api/autoscaling/v2beta1/horizontal_pod_autoscaler_spec.rs +++ b/src/v1_23/api/autoscaling/v2beta1/horizontal_pod_autoscaler_spec.rs @@ -19,7 +19,7 @@ pub struct HorizontalPodAutoscalerSpec { impl crate::DeepMerge for HorizontalPodAutoscalerSpec { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.max_replicas, other.max_replicas); - crate::DeepMerge::merge_from(&mut self.metrics, other.metrics); + crate::merge_strategies::list::atomic(&mut self.metrics, other.metrics); crate::DeepMerge::merge_from(&mut self.min_replicas, other.min_replicas); crate::DeepMerge::merge_from(&mut self.scale_target_ref, other.scale_target_ref); } diff --git a/src/v1_23/api/autoscaling/v2beta1/horizontal_pod_autoscaler_status.rs b/src/v1_23/api/autoscaling/v2beta1/horizontal_pod_autoscaler_status.rs index e54b847816..1cc4f4fdfa 100644 --- a/src/v1_23/api/autoscaling/v2beta1/horizontal_pod_autoscaler_status.rs +++ b/src/v1_23/api/autoscaling/v2beta1/horizontal_pod_autoscaler_status.rs @@ -24,8 +24,8 @@ pub struct HorizontalPodAutoscalerStatus { impl crate::DeepMerge for HorizontalPodAutoscalerStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); - crate::DeepMerge::merge_from(&mut self.current_metrics, other.current_metrics); + crate::merge_strategies::list::atomic(&mut self.conditions, other.conditions); + crate::merge_strategies::list::atomic(&mut self.current_metrics, other.current_metrics); crate::DeepMerge::merge_from(&mut self.current_replicas, other.current_replicas); crate::DeepMerge::merge_from(&mut self.desired_replicas, other.desired_replicas); crate::DeepMerge::merge_from(&mut self.last_scale_time, other.last_scale_time); diff --git a/src/v1_23/api/autoscaling/v2beta2/horizontal_pod_autoscaler_spec.rs b/src/v1_23/api/autoscaling/v2beta2/horizontal_pod_autoscaler_spec.rs index c529e49162..681cf9c99b 100644 --- a/src/v1_23/api/autoscaling/v2beta2/horizontal_pod_autoscaler_spec.rs +++ b/src/v1_23/api/autoscaling/v2beta2/horizontal_pod_autoscaler_spec.rs @@ -23,7 +23,7 @@ impl crate::DeepMerge for HorizontalPodAutoscalerSpec { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.behavior, other.behavior); crate::DeepMerge::merge_from(&mut self.max_replicas, other.max_replicas); - crate::DeepMerge::merge_from(&mut self.metrics, other.metrics); + crate::merge_strategies::list::atomic(&mut self.metrics, other.metrics); crate::DeepMerge::merge_from(&mut self.min_replicas, other.min_replicas); crate::DeepMerge::merge_from(&mut self.scale_target_ref, other.scale_target_ref); } diff --git a/src/v1_23/api/autoscaling/v2beta2/horizontal_pod_autoscaler_status.rs b/src/v1_23/api/autoscaling/v2beta2/horizontal_pod_autoscaler_status.rs index 176ea55941..0f77eb1fb4 100644 --- a/src/v1_23/api/autoscaling/v2beta2/horizontal_pod_autoscaler_status.rs +++ b/src/v1_23/api/autoscaling/v2beta2/horizontal_pod_autoscaler_status.rs @@ -24,8 +24,8 @@ pub struct HorizontalPodAutoscalerStatus { impl crate::DeepMerge for HorizontalPodAutoscalerStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); - crate::DeepMerge::merge_from(&mut self.current_metrics, other.current_metrics); + crate::merge_strategies::list::atomic(&mut self.conditions, other.conditions); + crate::merge_strategies::list::atomic(&mut self.current_metrics, other.current_metrics); crate::DeepMerge::merge_from(&mut self.current_replicas, other.current_replicas); crate::DeepMerge::merge_from(&mut self.desired_replicas, other.desired_replicas); crate::DeepMerge::merge_from(&mut self.last_scale_time, other.last_scale_time); diff --git a/src/v1_23/api/autoscaling/v2beta2/hpa_scaling_rules.rs b/src/v1_23/api/autoscaling/v2beta2/hpa_scaling_rules.rs index 3b62f0dd91..fde69f31c4 100644 --- a/src/v1_23/api/autoscaling/v2beta2/hpa_scaling_rules.rs +++ b/src/v1_23/api/autoscaling/v2beta2/hpa_scaling_rules.rs @@ -15,7 +15,7 @@ pub struct HPAScalingRules { impl crate::DeepMerge for HPAScalingRules { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.policies, other.policies); + crate::merge_strategies::list::atomic(&mut self.policies, other.policies); crate::DeepMerge::merge_from(&mut self.select_policy, other.select_policy); crate::DeepMerge::merge_from(&mut self.stabilization_window_seconds, other.stabilization_window_seconds); } diff --git a/src/v1_23/api/batch/v1/cron_job_status.rs b/src/v1_23/api/batch/v1/cron_job_status.rs index cbd83e8fcd..c0f24458eb 100644 --- a/src/v1_23/api/batch/v1/cron_job_status.rs +++ b/src/v1_23/api/batch/v1/cron_job_status.rs @@ -15,7 +15,7 @@ pub struct CronJobStatus { impl crate::DeepMerge for CronJobStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.active, other.active); + crate::merge_strategies::list::atomic(&mut self.active, other.active); crate::DeepMerge::merge_from(&mut self.last_schedule_time, other.last_schedule_time); crate::DeepMerge::merge_from(&mut self.last_successful_time, other.last_successful_time); } diff --git a/src/v1_23/api/batch/v1/job_status.rs b/src/v1_23/api/batch/v1/job_status.rs index b144285715..0555036625 100644 --- a/src/v1_23/api/batch/v1/job_status.rs +++ b/src/v1_23/api/batch/v1/job_status.rs @@ -43,7 +43,14 @@ impl crate::DeepMerge for JobStatus { crate::DeepMerge::merge_from(&mut self.active, other.active); crate::DeepMerge::merge_from(&mut self.completed_indexes, other.completed_indexes); crate::DeepMerge::merge_from(&mut self.completion_time, other.completion_time); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.failed, other.failed); crate::DeepMerge::merge_from(&mut self.ready, other.ready); crate::DeepMerge::merge_from(&mut self.start_time, other.start_time); diff --git a/src/v1_23/api/batch/v1/uncounted_terminated_pods.rs b/src/v1_23/api/batch/v1/uncounted_terminated_pods.rs index 8235855121..45335381cf 100644 --- a/src/v1_23/api/batch/v1/uncounted_terminated_pods.rs +++ b/src/v1_23/api/batch/v1/uncounted_terminated_pods.rs @@ -12,8 +12,8 @@ pub struct UncountedTerminatedPods { impl crate::DeepMerge for UncountedTerminatedPods { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.failed, other.failed); - crate::DeepMerge::merge_from(&mut self.succeeded, other.succeeded); + crate::merge_strategies::list::set(&mut self.failed, other.failed); + crate::merge_strategies::list::set(&mut self.succeeded, other.succeeded); } } diff --git a/src/v1_23/api/batch/v1beta1/cron_job_status.rs b/src/v1_23/api/batch/v1beta1/cron_job_status.rs index 3e8851f77d..3498f7cd58 100644 --- a/src/v1_23/api/batch/v1beta1/cron_job_status.rs +++ b/src/v1_23/api/batch/v1beta1/cron_job_status.rs @@ -15,7 +15,7 @@ pub struct CronJobStatus { impl crate::DeepMerge for CronJobStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.active, other.active); + crate::merge_strategies::list::atomic(&mut self.active, other.active); crate::DeepMerge::merge_from(&mut self.last_schedule_time, other.last_schedule_time); crate::DeepMerge::merge_from(&mut self.last_successful_time, other.last_successful_time); } diff --git a/src/v1_23/api/certificates/v1/certificate_signing_request_spec.rs b/src/v1_23/api/certificates/v1/certificate_signing_request_spec.rs index 36fd52a817..6742ec7695 100644 --- a/src/v1_23/api/certificates/v1/certificate_signing_request_spec.rs +++ b/src/v1_23/api/certificates/v1/certificate_signing_request_spec.rs @@ -77,12 +77,14 @@ pub struct CertificateSigningRequestSpec { impl crate::DeepMerge for CertificateSigningRequestSpec { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.expiration_seconds, other.expiration_seconds); - crate::DeepMerge::merge_from(&mut self.extra, other.extra); - crate::DeepMerge::merge_from(&mut self.groups, other.groups); + crate::merge_strategies::map::granular(&mut self.extra, other.extra, |current_item, other_item| { + crate::merge_strategies::list::atomic(current_item, other_item); + }); + crate::merge_strategies::list::atomic(&mut self.groups, other.groups); crate::DeepMerge::merge_from(&mut self.request, other.request); crate::DeepMerge::merge_from(&mut self.signer_name, other.signer_name); crate::DeepMerge::merge_from(&mut self.uid, other.uid); - crate::DeepMerge::merge_from(&mut self.usages, other.usages); + crate::merge_strategies::list::atomic(&mut self.usages, other.usages); crate::DeepMerge::merge_from(&mut self.username, other.username); } } diff --git a/src/v1_23/api/certificates/v1/certificate_signing_request_status.rs b/src/v1_23/api/certificates/v1/certificate_signing_request_status.rs index 81fb876580..d17c51933f 100644 --- a/src/v1_23/api/certificates/v1/certificate_signing_request_status.rs +++ b/src/v1_23/api/certificates/v1/certificate_signing_request_status.rs @@ -34,7 +34,14 @@ pub struct CertificateSigningRequestStatus { impl crate::DeepMerge for CertificateSigningRequestStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.certificate, other.certificate); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_23/api/core/v1/capabilities.rs b/src/v1_23/api/core/v1/capabilities.rs index 6045e4f5d2..1a260b5256 100644 --- a/src/v1_23/api/core/v1/capabilities.rs +++ b/src/v1_23/api/core/v1/capabilities.rs @@ -12,8 +12,8 @@ pub struct Capabilities { impl crate::DeepMerge for Capabilities { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.add, other.add); - crate::DeepMerge::merge_from(&mut self.drop, other.drop); + crate::merge_strategies::list::atomic(&mut self.add, other.add); + crate::merge_strategies::list::atomic(&mut self.drop, other.drop); } } diff --git a/src/v1_23/api/core/v1/ceph_fs_persistent_volume_source.rs b/src/v1_23/api/core/v1/ceph_fs_persistent_volume_source.rs index 5db02966fd..708ee7615e 100644 --- a/src/v1_23/api/core/v1/ceph_fs_persistent_volume_source.rs +++ b/src/v1_23/api/core/v1/ceph_fs_persistent_volume_source.rs @@ -24,7 +24,7 @@ pub struct CephFSPersistentVolumeSource { impl crate::DeepMerge for CephFSPersistentVolumeSource { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.monitors, other.monitors); + crate::merge_strategies::list::atomic(&mut self.monitors, other.monitors); crate::DeepMerge::merge_from(&mut self.path, other.path); crate::DeepMerge::merge_from(&mut self.read_only, other.read_only); crate::DeepMerge::merge_from(&mut self.secret_file, other.secret_file); diff --git a/src/v1_23/api/core/v1/ceph_fs_volume_source.rs b/src/v1_23/api/core/v1/ceph_fs_volume_source.rs index 1be27ee35c..689608de39 100644 --- a/src/v1_23/api/core/v1/ceph_fs_volume_source.rs +++ b/src/v1_23/api/core/v1/ceph_fs_volume_source.rs @@ -24,7 +24,7 @@ pub struct CephFSVolumeSource { impl crate::DeepMerge for CephFSVolumeSource { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.monitors, other.monitors); + crate::merge_strategies::list::atomic(&mut self.monitors, other.monitors); crate::DeepMerge::merge_from(&mut self.path, other.path); crate::DeepMerge::merge_from(&mut self.read_only, other.read_only); crate::DeepMerge::merge_from(&mut self.secret_file, other.secret_file); diff --git a/src/v1_23/api/core/v1/component_status.rs b/src/v1_23/api/core/v1/component_status.rs index ecddf82170..50e55665e4 100644 --- a/src/v1_23/api/core/v1/component_status.rs +++ b/src/v1_23/api/core/v1/component_status.rs @@ -172,7 +172,14 @@ impl crate::Metadata for ComponentStatus { impl crate::DeepMerge for ComponentStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); } } diff --git a/src/v1_23/api/core/v1/config_map.rs b/src/v1_23/api/core/v1/config_map.rs index 361b45a3a1..7d07e59a99 100644 --- a/src/v1_23/api/core/v1/config_map.rs +++ b/src/v1_23/api/core/v1/config_map.rs @@ -495,8 +495,12 @@ impl crate::Metadata for ConfigMap { impl crate::DeepMerge for ConfigMap { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.binary_data, other.binary_data); - crate::DeepMerge::merge_from(&mut self.data, other.data); + crate::merge_strategies::map::granular(&mut self.binary_data, other.binary_data, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.data, other.data, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.immutable, other.immutable); crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); } diff --git a/src/v1_23/api/core/v1/config_map_projection.rs b/src/v1_23/api/core/v1/config_map_projection.rs index 458f277bb3..e2a94bc391 100644 --- a/src/v1_23/api/core/v1/config_map_projection.rs +++ b/src/v1_23/api/core/v1/config_map_projection.rs @@ -17,7 +17,7 @@ pub struct ConfigMapProjection { impl crate::DeepMerge for ConfigMapProjection { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.items, other.items); + crate::merge_strategies::list::atomic(&mut self.items, other.items); crate::DeepMerge::merge_from(&mut self.name, other.name); crate::DeepMerge::merge_from(&mut self.optional, other.optional); } diff --git a/src/v1_23/api/core/v1/config_map_volume_source.rs b/src/v1_23/api/core/v1/config_map_volume_source.rs index 915b10bdcd..b612fcb857 100644 --- a/src/v1_23/api/core/v1/config_map_volume_source.rs +++ b/src/v1_23/api/core/v1/config_map_volume_source.rs @@ -21,7 +21,7 @@ pub struct ConfigMapVolumeSource { impl crate::DeepMerge for ConfigMapVolumeSource { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.default_mode, other.default_mode); - crate::DeepMerge::merge_from(&mut self.items, other.items); + crate::merge_strategies::list::atomic(&mut self.items, other.items); crate::DeepMerge::merge_from(&mut self.name, other.name); crate::DeepMerge::merge_from(&mut self.optional, other.optional); } diff --git a/src/v1_23/api/core/v1/container.rs b/src/v1_23/api/core/v1/container.rs index b2679acdb1..b1bee010b2 100644 --- a/src/v1_23/api/core/v1/container.rs +++ b/src/v1_23/api/core/v1/container.rs @@ -74,16 +74,30 @@ pub struct Container { impl crate::DeepMerge for Container { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.args, other.args); - crate::DeepMerge::merge_from(&mut self.command, other.command); - crate::DeepMerge::merge_from(&mut self.env, other.env); - crate::DeepMerge::merge_from(&mut self.env_from, other.env_from); + crate::merge_strategies::list::atomic(&mut self.args, other.args); + crate::merge_strategies::list::atomic(&mut self.command, other.command); + crate::merge_strategies::list::map( + &mut self.env, + other.env, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::list::atomic(&mut self.env_from, other.env_from); crate::DeepMerge::merge_from(&mut self.image, other.image); crate::DeepMerge::merge_from(&mut self.image_pull_policy, other.image_pull_policy); crate::DeepMerge::merge_from(&mut self.lifecycle, other.lifecycle); crate::DeepMerge::merge_from(&mut self.liveness_probe, other.liveness_probe); crate::DeepMerge::merge_from(&mut self.name, other.name); - crate::DeepMerge::merge_from(&mut self.ports, other.ports); + crate::merge_strategies::list::map( + &mut self.ports, + other.ports, + &[|lhs, rhs| lhs.container_port == rhs.container_port], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.readiness_probe, other.readiness_probe); crate::DeepMerge::merge_from(&mut self.resources, other.resources); crate::DeepMerge::merge_from(&mut self.security_context, other.security_context); @@ -93,8 +107,22 @@ impl crate::DeepMerge for Container { crate::DeepMerge::merge_from(&mut self.termination_message_path, other.termination_message_path); crate::DeepMerge::merge_from(&mut self.termination_message_policy, other.termination_message_policy); crate::DeepMerge::merge_from(&mut self.tty, other.tty); - crate::DeepMerge::merge_from(&mut self.volume_devices, other.volume_devices); - crate::DeepMerge::merge_from(&mut self.volume_mounts, other.volume_mounts); + crate::merge_strategies::list::map( + &mut self.volume_devices, + other.volume_devices, + &[|lhs, rhs| lhs.device_path == rhs.device_path], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::list::map( + &mut self.volume_mounts, + other.volume_mounts, + &[|lhs, rhs| lhs.mount_path == rhs.mount_path], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.working_dir, other.working_dir); } } diff --git a/src/v1_23/api/core/v1/container_image.rs b/src/v1_23/api/core/v1/container_image.rs index 697ef4906e..871033f834 100644 --- a/src/v1_23/api/core/v1/container_image.rs +++ b/src/v1_23/api/core/v1/container_image.rs @@ -12,7 +12,7 @@ pub struct ContainerImage { impl crate::DeepMerge for ContainerImage { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.names, other.names); + crate::merge_strategies::list::atomic(&mut self.names, other.names); crate::DeepMerge::merge_from(&mut self.size_bytes, other.size_bytes); } } diff --git a/src/v1_23/api/core/v1/csi_persistent_volume_source.rs b/src/v1_23/api/core/v1/csi_persistent_volume_source.rs index b8b244ea2b..7d04fa8349 100644 --- a/src/v1_23/api/core/v1/csi_persistent_volume_source.rs +++ b/src/v1_23/api/core/v1/csi_persistent_volume_source.rs @@ -40,7 +40,9 @@ impl crate::DeepMerge for CSIPersistentVolumeSource { crate::DeepMerge::merge_from(&mut self.node_publish_secret_ref, other.node_publish_secret_ref); crate::DeepMerge::merge_from(&mut self.node_stage_secret_ref, other.node_stage_secret_ref); crate::DeepMerge::merge_from(&mut self.read_only, other.read_only); - crate::DeepMerge::merge_from(&mut self.volume_attributes, other.volume_attributes); + crate::merge_strategies::map::granular(&mut self.volume_attributes, other.volume_attributes, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.volume_handle, other.volume_handle); } } diff --git a/src/v1_23/api/core/v1/csi_volume_source.rs b/src/v1_23/api/core/v1/csi_volume_source.rs index e5a311c536..2b2f26aa48 100644 --- a/src/v1_23/api/core/v1/csi_volume_source.rs +++ b/src/v1_23/api/core/v1/csi_volume_source.rs @@ -25,7 +25,9 @@ impl crate::DeepMerge for CSIVolumeSource { crate::DeepMerge::merge_from(&mut self.fs_type, other.fs_type); crate::DeepMerge::merge_from(&mut self.node_publish_secret_ref, other.node_publish_secret_ref); crate::DeepMerge::merge_from(&mut self.read_only, other.read_only); - crate::DeepMerge::merge_from(&mut self.volume_attributes, other.volume_attributes); + crate::merge_strategies::map::granular(&mut self.volume_attributes, other.volume_attributes, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); } } diff --git a/src/v1_23/api/core/v1/downward_api_projection.rs b/src/v1_23/api/core/v1/downward_api_projection.rs index de0fca6185..950e2e5645 100644 --- a/src/v1_23/api/core/v1/downward_api_projection.rs +++ b/src/v1_23/api/core/v1/downward_api_projection.rs @@ -9,7 +9,7 @@ pub struct DownwardAPIProjection { impl crate::DeepMerge for DownwardAPIProjection { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.items, other.items); + crate::merge_strategies::list::atomic(&mut self.items, other.items); } } diff --git a/src/v1_23/api/core/v1/downward_api_volume_source.rs b/src/v1_23/api/core/v1/downward_api_volume_source.rs index 214c15f03f..96b4ebb987 100644 --- a/src/v1_23/api/core/v1/downward_api_volume_source.rs +++ b/src/v1_23/api/core/v1/downward_api_volume_source.rs @@ -13,7 +13,7 @@ pub struct DownwardAPIVolumeSource { impl crate::DeepMerge for DownwardAPIVolumeSource { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.default_mode, other.default_mode); - crate::DeepMerge::merge_from(&mut self.items, other.items); + crate::merge_strategies::list::atomic(&mut self.items, other.items); } } diff --git a/src/v1_23/api/core/v1/endpoint_subset.rs b/src/v1_23/api/core/v1/endpoint_subset.rs index 45a0853432..9400deda56 100644 --- a/src/v1_23/api/core/v1/endpoint_subset.rs +++ b/src/v1_23/api/core/v1/endpoint_subset.rs @@ -25,9 +25,9 @@ pub struct EndpointSubset { impl crate::DeepMerge for EndpointSubset { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.addresses, other.addresses); - crate::DeepMerge::merge_from(&mut self.not_ready_addresses, other.not_ready_addresses); - crate::DeepMerge::merge_from(&mut self.ports, other.ports); + crate::merge_strategies::list::atomic(&mut self.addresses, other.addresses); + crate::merge_strategies::list::atomic(&mut self.not_ready_addresses, other.not_ready_addresses); + crate::merge_strategies::list::atomic(&mut self.ports, other.ports); } } diff --git a/src/v1_23/api/core/v1/endpoints.rs b/src/v1_23/api/core/v1/endpoints.rs index ed9beaf356..74d95ffd83 100644 --- a/src/v1_23/api/core/v1/endpoints.rs +++ b/src/v1_23/api/core/v1/endpoints.rs @@ -502,7 +502,7 @@ impl crate::Metadata for Endpoints { impl crate::DeepMerge for Endpoints { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.subsets, other.subsets); + crate::merge_strategies::list::atomic(&mut self.subsets, other.subsets); } } diff --git a/src/v1_23/api/core/v1/ephemeral_container.rs b/src/v1_23/api/core/v1/ephemeral_container.rs index fcfdc76c6d..d1b6227134 100644 --- a/src/v1_23/api/core/v1/ephemeral_container.rs +++ b/src/v1_23/api/core/v1/ephemeral_container.rs @@ -83,16 +83,30 @@ pub struct EphemeralContainer { impl crate::DeepMerge for EphemeralContainer { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.args, other.args); - crate::DeepMerge::merge_from(&mut self.command, other.command); - crate::DeepMerge::merge_from(&mut self.env, other.env); - crate::DeepMerge::merge_from(&mut self.env_from, other.env_from); + crate::merge_strategies::list::atomic(&mut self.args, other.args); + crate::merge_strategies::list::atomic(&mut self.command, other.command); + crate::merge_strategies::list::map( + &mut self.env, + other.env, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::list::atomic(&mut self.env_from, other.env_from); crate::DeepMerge::merge_from(&mut self.image, other.image); crate::DeepMerge::merge_from(&mut self.image_pull_policy, other.image_pull_policy); crate::DeepMerge::merge_from(&mut self.lifecycle, other.lifecycle); crate::DeepMerge::merge_from(&mut self.liveness_probe, other.liveness_probe); crate::DeepMerge::merge_from(&mut self.name, other.name); - crate::DeepMerge::merge_from(&mut self.ports, other.ports); + crate::merge_strategies::list::map( + &mut self.ports, + other.ports, + &[|lhs, rhs| lhs.container_port == rhs.container_port], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.readiness_probe, other.readiness_probe); crate::DeepMerge::merge_from(&mut self.resources, other.resources); crate::DeepMerge::merge_from(&mut self.security_context, other.security_context); @@ -103,8 +117,22 @@ impl crate::DeepMerge for EphemeralContainer { crate::DeepMerge::merge_from(&mut self.termination_message_path, other.termination_message_path); crate::DeepMerge::merge_from(&mut self.termination_message_policy, other.termination_message_policy); crate::DeepMerge::merge_from(&mut self.tty, other.tty); - crate::DeepMerge::merge_from(&mut self.volume_devices, other.volume_devices); - crate::DeepMerge::merge_from(&mut self.volume_mounts, other.volume_mounts); + crate::merge_strategies::list::map( + &mut self.volume_devices, + other.volume_devices, + &[|lhs, rhs| lhs.device_path == rhs.device_path], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::list::map( + &mut self.volume_mounts, + other.volume_mounts, + &[|lhs, rhs| lhs.mount_path == rhs.mount_path], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.working_dir, other.working_dir); } } diff --git a/src/v1_23/api/core/v1/exec_action.rs b/src/v1_23/api/core/v1/exec_action.rs index fc5ddd099a..07e888786c 100644 --- a/src/v1_23/api/core/v1/exec_action.rs +++ b/src/v1_23/api/core/v1/exec_action.rs @@ -9,7 +9,7 @@ pub struct ExecAction { impl crate::DeepMerge for ExecAction { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.command, other.command); + crate::merge_strategies::list::atomic(&mut self.command, other.command); } } diff --git a/src/v1_23/api/core/v1/fc_volume_source.rs b/src/v1_23/api/core/v1/fc_volume_source.rs index 932c210a2b..6477ad5ed5 100644 --- a/src/v1_23/api/core/v1/fc_volume_source.rs +++ b/src/v1_23/api/core/v1/fc_volume_source.rs @@ -24,8 +24,8 @@ impl crate::DeepMerge for FCVolumeSource { crate::DeepMerge::merge_from(&mut self.fs_type, other.fs_type); crate::DeepMerge::merge_from(&mut self.lun, other.lun); crate::DeepMerge::merge_from(&mut self.read_only, other.read_only); - crate::DeepMerge::merge_from(&mut self.target_wwns, other.target_wwns); - crate::DeepMerge::merge_from(&mut self.wwids, other.wwids); + crate::merge_strategies::list::atomic(&mut self.target_wwns, other.target_wwns); + crate::merge_strategies::list::atomic(&mut self.wwids, other.wwids); } } diff --git a/src/v1_23/api/core/v1/flex_persistent_volume_source.rs b/src/v1_23/api/core/v1/flex_persistent_volume_source.rs index 76d27f8583..10ebd43c4a 100644 --- a/src/v1_23/api/core/v1/flex_persistent_volume_source.rs +++ b/src/v1_23/api/core/v1/flex_persistent_volume_source.rs @@ -23,7 +23,9 @@ impl crate::DeepMerge for FlexPersistentVolumeSource { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.driver, other.driver); crate::DeepMerge::merge_from(&mut self.fs_type, other.fs_type); - crate::DeepMerge::merge_from(&mut self.options, other.options); + crate::merge_strategies::map::granular(&mut self.options, other.options, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.read_only, other.read_only); crate::DeepMerge::merge_from(&mut self.secret_ref, other.secret_ref); } diff --git a/src/v1_23/api/core/v1/flex_volume_source.rs b/src/v1_23/api/core/v1/flex_volume_source.rs index f9e64fcbf4..6075eadc1f 100644 --- a/src/v1_23/api/core/v1/flex_volume_source.rs +++ b/src/v1_23/api/core/v1/flex_volume_source.rs @@ -23,7 +23,9 @@ impl crate::DeepMerge for FlexVolumeSource { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.driver, other.driver); crate::DeepMerge::merge_from(&mut self.fs_type, other.fs_type); - crate::DeepMerge::merge_from(&mut self.options, other.options); + crate::merge_strategies::map::granular(&mut self.options, other.options, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.read_only, other.read_only); crate::DeepMerge::merge_from(&mut self.secret_ref, other.secret_ref); } diff --git a/src/v1_23/api/core/v1/host_alias.rs b/src/v1_23/api/core/v1/host_alias.rs index 9320f6d9e1..8ea648c7ad 100644 --- a/src/v1_23/api/core/v1/host_alias.rs +++ b/src/v1_23/api/core/v1/host_alias.rs @@ -12,7 +12,7 @@ pub struct HostAlias { impl crate::DeepMerge for HostAlias { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.hostnames, other.hostnames); + crate::merge_strategies::list::atomic(&mut self.hostnames, other.hostnames); crate::DeepMerge::merge_from(&mut self.ip, other.ip); } } diff --git a/src/v1_23/api/core/v1/http_get_action.rs b/src/v1_23/api/core/v1/http_get_action.rs index cec454faa3..b972a6bd69 100644 --- a/src/v1_23/api/core/v1/http_get_action.rs +++ b/src/v1_23/api/core/v1/http_get_action.rs @@ -23,7 +23,7 @@ pub struct HTTPGetAction { impl crate::DeepMerge for HTTPGetAction { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.host, other.host); - crate::DeepMerge::merge_from(&mut self.http_headers, other.http_headers); + crate::merge_strategies::list::atomic(&mut self.http_headers, other.http_headers); crate::DeepMerge::merge_from(&mut self.path, other.path); crate::DeepMerge::merge_from(&mut self.port, other.port); crate::DeepMerge::merge_from(&mut self.scheme, other.scheme); diff --git a/src/v1_23/api/core/v1/iscsi_persistent_volume_source.rs b/src/v1_23/api/core/v1/iscsi_persistent_volume_source.rs index 939da3bc50..842c901958 100644 --- a/src/v1_23/api/core/v1/iscsi_persistent_volume_source.rs +++ b/src/v1_23/api/core/v1/iscsi_persistent_volume_source.rs @@ -46,7 +46,7 @@ impl crate::DeepMerge for ISCSIPersistentVolumeSource { crate::DeepMerge::merge_from(&mut self.iqn, other.iqn); crate::DeepMerge::merge_from(&mut self.iscsi_interface, other.iscsi_interface); crate::DeepMerge::merge_from(&mut self.lun, other.lun); - crate::DeepMerge::merge_from(&mut self.portals, other.portals); + crate::merge_strategies::list::atomic(&mut self.portals, other.portals); crate::DeepMerge::merge_from(&mut self.read_only, other.read_only); crate::DeepMerge::merge_from(&mut self.secret_ref, other.secret_ref); crate::DeepMerge::merge_from(&mut self.target_portal, other.target_portal); diff --git a/src/v1_23/api/core/v1/iscsi_volume_source.rs b/src/v1_23/api/core/v1/iscsi_volume_source.rs index 1d75bc85e0..7b8f0324f4 100644 --- a/src/v1_23/api/core/v1/iscsi_volume_source.rs +++ b/src/v1_23/api/core/v1/iscsi_volume_source.rs @@ -46,7 +46,7 @@ impl crate::DeepMerge for ISCSIVolumeSource { crate::DeepMerge::merge_from(&mut self.iqn, other.iqn); crate::DeepMerge::merge_from(&mut self.iscsi_interface, other.iscsi_interface); crate::DeepMerge::merge_from(&mut self.lun, other.lun); - crate::DeepMerge::merge_from(&mut self.portals, other.portals); + crate::merge_strategies::list::atomic(&mut self.portals, other.portals); crate::DeepMerge::merge_from(&mut self.read_only, other.read_only); crate::DeepMerge::merge_from(&mut self.secret_ref, other.secret_ref); crate::DeepMerge::merge_from(&mut self.target_portal, other.target_portal); diff --git a/src/v1_23/api/core/v1/limit_range_item.rs b/src/v1_23/api/core/v1/limit_range_item.rs index 3aada5aaaa..d8431aec87 100644 --- a/src/v1_23/api/core/v1/limit_range_item.rs +++ b/src/v1_23/api/core/v1/limit_range_item.rs @@ -24,11 +24,21 @@ pub struct LimitRangeItem { impl crate::DeepMerge for LimitRangeItem { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.default, other.default); - crate::DeepMerge::merge_from(&mut self.default_request, other.default_request); - crate::DeepMerge::merge_from(&mut self.max, other.max); - crate::DeepMerge::merge_from(&mut self.max_limit_request_ratio, other.max_limit_request_ratio); - crate::DeepMerge::merge_from(&mut self.min, other.min); + crate::merge_strategies::map::granular(&mut self.default, other.default, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.default_request, other.default_request, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.max, other.max, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.max_limit_request_ratio, other.max_limit_request_ratio, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.min, other.min, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.type_, other.type_); } } diff --git a/src/v1_23/api/core/v1/limit_range_spec.rs b/src/v1_23/api/core/v1/limit_range_spec.rs index d3db20e828..14cacbd619 100644 --- a/src/v1_23/api/core/v1/limit_range_spec.rs +++ b/src/v1_23/api/core/v1/limit_range_spec.rs @@ -9,7 +9,7 @@ pub struct LimitRangeSpec { impl crate::DeepMerge for LimitRangeSpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.limits, other.limits); + crate::merge_strategies::list::atomic(&mut self.limits, other.limits); } } diff --git a/src/v1_23/api/core/v1/load_balancer_ingress.rs b/src/v1_23/api/core/v1/load_balancer_ingress.rs index fe804334cf..ffce22ba8b 100644 --- a/src/v1_23/api/core/v1/load_balancer_ingress.rs +++ b/src/v1_23/api/core/v1/load_balancer_ingress.rs @@ -17,7 +17,7 @@ impl crate::DeepMerge for LoadBalancerIngress { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.hostname, other.hostname); crate::DeepMerge::merge_from(&mut self.ip, other.ip); - crate::DeepMerge::merge_from(&mut self.ports, other.ports); + crate::merge_strategies::list::atomic(&mut self.ports, other.ports); } } diff --git a/src/v1_23/api/core/v1/load_balancer_status.rs b/src/v1_23/api/core/v1/load_balancer_status.rs index 46d791f8e1..67379f9e4e 100644 --- a/src/v1_23/api/core/v1/load_balancer_status.rs +++ b/src/v1_23/api/core/v1/load_balancer_status.rs @@ -9,7 +9,7 @@ pub struct LoadBalancerStatus { impl crate::DeepMerge for LoadBalancerStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.ingress, other.ingress); + crate::merge_strategies::list::atomic(&mut self.ingress, other.ingress); } } diff --git a/src/v1_23/api/core/v1/namespace_spec.rs b/src/v1_23/api/core/v1/namespace_spec.rs index 5ae9e5ef2e..cbf697e1e1 100644 --- a/src/v1_23/api/core/v1/namespace_spec.rs +++ b/src/v1_23/api/core/v1/namespace_spec.rs @@ -9,7 +9,7 @@ pub struct NamespaceSpec { impl crate::DeepMerge for NamespaceSpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.finalizers, other.finalizers); + crate::merge_strategies::list::atomic(&mut self.finalizers, other.finalizers); } } diff --git a/src/v1_23/api/core/v1/namespace_status.rs b/src/v1_23/api/core/v1/namespace_status.rs index 7ccfbdac3e..c859779881 100644 --- a/src/v1_23/api/core/v1/namespace_status.rs +++ b/src/v1_23/api/core/v1/namespace_status.rs @@ -13,7 +13,14 @@ pub struct NamespaceStatus { impl crate::DeepMerge for NamespaceStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.phase, other.phase); } } diff --git a/src/v1_23/api/core/v1/node_affinity.rs b/src/v1_23/api/core/v1/node_affinity.rs index 2a70de8703..dfd14357a3 100644 --- a/src/v1_23/api/core/v1/node_affinity.rs +++ b/src/v1_23/api/core/v1/node_affinity.rs @@ -12,7 +12,7 @@ pub struct NodeAffinity { impl crate::DeepMerge for NodeAffinity { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.preferred_during_scheduling_ignored_during_execution, other.preferred_during_scheduling_ignored_during_execution); + crate::merge_strategies::list::atomic(&mut self.preferred_during_scheduling_ignored_during_execution, other.preferred_during_scheduling_ignored_during_execution); crate::DeepMerge::merge_from(&mut self.required_during_scheduling_ignored_during_execution, other.required_during_scheduling_ignored_during_execution); } } diff --git a/src/v1_23/api/core/v1/node_selector.rs b/src/v1_23/api/core/v1/node_selector.rs index 5b146c615e..997fba9ef3 100644 --- a/src/v1_23/api/core/v1/node_selector.rs +++ b/src/v1_23/api/core/v1/node_selector.rs @@ -9,7 +9,7 @@ pub struct NodeSelector { impl crate::DeepMerge for NodeSelector { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.node_selector_terms, other.node_selector_terms); + crate::merge_strategies::list::atomic(&mut self.node_selector_terms, other.node_selector_terms); } } diff --git a/src/v1_23/api/core/v1/node_selector_requirement.rs b/src/v1_23/api/core/v1/node_selector_requirement.rs index 57817f1fab..5a76f55c6f 100644 --- a/src/v1_23/api/core/v1/node_selector_requirement.rs +++ b/src/v1_23/api/core/v1/node_selector_requirement.rs @@ -18,7 +18,7 @@ impl crate::DeepMerge for NodeSelectorRequirement { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.key, other.key); crate::DeepMerge::merge_from(&mut self.operator, other.operator); - crate::DeepMerge::merge_from(&mut self.values, other.values); + crate::merge_strategies::list::atomic(&mut self.values, other.values); } } diff --git a/src/v1_23/api/core/v1/node_selector_term.rs b/src/v1_23/api/core/v1/node_selector_term.rs index b0d28cc176..1237883670 100644 --- a/src/v1_23/api/core/v1/node_selector_term.rs +++ b/src/v1_23/api/core/v1/node_selector_term.rs @@ -12,8 +12,8 @@ pub struct NodeSelectorTerm { impl crate::DeepMerge for NodeSelectorTerm { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.match_expressions, other.match_expressions); - crate::DeepMerge::merge_from(&mut self.match_fields, other.match_fields); + crate::merge_strategies::list::atomic(&mut self.match_expressions, other.match_expressions); + crate::merge_strategies::list::atomic(&mut self.match_fields, other.match_fields); } } diff --git a/src/v1_23/api/core/v1/node_spec.rs b/src/v1_23/api/core/v1/node_spec.rs index f21a139a6b..50f0264cf0 100644 --- a/src/v1_23/api/core/v1/node_spec.rs +++ b/src/v1_23/api/core/v1/node_spec.rs @@ -30,9 +30,9 @@ impl crate::DeepMerge for NodeSpec { crate::DeepMerge::merge_from(&mut self.config_source, other.config_source); crate::DeepMerge::merge_from(&mut self.external_id, other.external_id); crate::DeepMerge::merge_from(&mut self.pod_cidr, other.pod_cidr); - crate::DeepMerge::merge_from(&mut self.pod_cidrs, other.pod_cidrs); + crate::merge_strategies::list::set(&mut self.pod_cidrs, other.pod_cidrs); crate::DeepMerge::merge_from(&mut self.provider_id, other.provider_id); - crate::DeepMerge::merge_from(&mut self.taints, other.taints); + crate::merge_strategies::list::atomic(&mut self.taints, other.taints); crate::DeepMerge::merge_from(&mut self.unschedulable, other.unschedulable); } } diff --git a/src/v1_23/api/core/v1/node_status.rs b/src/v1_23/api/core/v1/node_status.rs index 79f0d56439..39a6eb19f2 100644 --- a/src/v1_23/api/core/v1/node_status.rs +++ b/src/v1_23/api/core/v1/node_status.rs @@ -40,17 +40,35 @@ pub struct NodeStatus { impl crate::DeepMerge for NodeStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.addresses, other.addresses); - crate::DeepMerge::merge_from(&mut self.allocatable, other.allocatable); - crate::DeepMerge::merge_from(&mut self.capacity, other.capacity); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.addresses, + other.addresses, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::map::granular(&mut self.allocatable, other.allocatable, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.capacity, other.capacity, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.config, other.config); crate::DeepMerge::merge_from(&mut self.daemon_endpoints, other.daemon_endpoints); - crate::DeepMerge::merge_from(&mut self.images, other.images); + crate::merge_strategies::list::atomic(&mut self.images, other.images); crate::DeepMerge::merge_from(&mut self.node_info, other.node_info); crate::DeepMerge::merge_from(&mut self.phase, other.phase); - crate::DeepMerge::merge_from(&mut self.volumes_attached, other.volumes_attached); - crate::DeepMerge::merge_from(&mut self.volumes_in_use, other.volumes_in_use); + crate::merge_strategies::list::atomic(&mut self.volumes_attached, other.volumes_attached); + crate::merge_strategies::list::atomic(&mut self.volumes_in_use, other.volumes_in_use); } } diff --git a/src/v1_23/api/core/v1/persistent_volume_claim_spec.rs b/src/v1_23/api/core/v1/persistent_volume_claim_spec.rs index 8d7c6fe5c2..a54aba26d8 100644 --- a/src/v1_23/api/core/v1/persistent_volume_claim_spec.rs +++ b/src/v1_23/api/core/v1/persistent_volume_claim_spec.rs @@ -35,7 +35,7 @@ pub struct PersistentVolumeClaimSpec { impl crate::DeepMerge for PersistentVolumeClaimSpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.access_modes, other.access_modes); + crate::merge_strategies::list::atomic(&mut self.access_modes, other.access_modes); crate::DeepMerge::merge_from(&mut self.data_source, other.data_source); crate::DeepMerge::merge_from(&mut self.data_source_ref, other.data_source_ref); crate::DeepMerge::merge_from(&mut self.resources, other.resources); diff --git a/src/v1_23/api/core/v1/persistent_volume_claim_status.rs b/src/v1_23/api/core/v1/persistent_volume_claim_status.rs index 23f2208356..d28a39badb 100644 --- a/src/v1_23/api/core/v1/persistent_volume_claim_status.rs +++ b/src/v1_23/api/core/v1/persistent_volume_claim_status.rs @@ -25,10 +25,21 @@ pub struct PersistentVolumeClaimStatus { impl crate::DeepMerge for PersistentVolumeClaimStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.access_modes, other.access_modes); - crate::DeepMerge::merge_from(&mut self.allocated_resources, other.allocated_resources); - crate::DeepMerge::merge_from(&mut self.capacity, other.capacity); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::atomic(&mut self.access_modes, other.access_modes); + crate::merge_strategies::map::granular(&mut self.allocated_resources, other.allocated_resources, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.capacity, other.capacity, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.phase, other.phase); crate::DeepMerge::merge_from(&mut self.resize_status, other.resize_status); } diff --git a/src/v1_23/api/core/v1/persistent_volume_spec.rs b/src/v1_23/api/core/v1/persistent_volume_spec.rs index f0ab97d58f..cb2d17a38c 100644 --- a/src/v1_23/api/core/v1/persistent_volume_spec.rs +++ b/src/v1_23/api/core/v1/persistent_volume_spec.rs @@ -97,11 +97,13 @@ pub struct PersistentVolumeSpec { impl crate::DeepMerge for PersistentVolumeSpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.access_modes, other.access_modes); + crate::merge_strategies::list::atomic(&mut self.access_modes, other.access_modes); crate::DeepMerge::merge_from(&mut self.aws_elastic_block_store, other.aws_elastic_block_store); crate::DeepMerge::merge_from(&mut self.azure_disk, other.azure_disk); crate::DeepMerge::merge_from(&mut self.azure_file, other.azure_file); - crate::DeepMerge::merge_from(&mut self.capacity, other.capacity); + crate::merge_strategies::map::granular(&mut self.capacity, other.capacity, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.cephfs, other.cephfs); crate::DeepMerge::merge_from(&mut self.cinder, other.cinder); crate::DeepMerge::merge_from(&mut self.claim_ref, other.claim_ref); @@ -114,7 +116,7 @@ impl crate::DeepMerge for PersistentVolumeSpec { crate::DeepMerge::merge_from(&mut self.host_path, other.host_path); crate::DeepMerge::merge_from(&mut self.iscsi, other.iscsi); crate::DeepMerge::merge_from(&mut self.local, other.local); - crate::DeepMerge::merge_from(&mut self.mount_options, other.mount_options); + crate::merge_strategies::list::atomic(&mut self.mount_options, other.mount_options); crate::DeepMerge::merge_from(&mut self.nfs, other.nfs); crate::DeepMerge::merge_from(&mut self.node_affinity, other.node_affinity); crate::DeepMerge::merge_from(&mut self.persistent_volume_reclaim_policy, other.persistent_volume_reclaim_policy); diff --git a/src/v1_23/api/core/v1/pod_affinity.rs b/src/v1_23/api/core/v1/pod_affinity.rs index facc781ff6..a528250bbc 100644 --- a/src/v1_23/api/core/v1/pod_affinity.rs +++ b/src/v1_23/api/core/v1/pod_affinity.rs @@ -12,8 +12,8 @@ pub struct PodAffinity { impl crate::DeepMerge for PodAffinity { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.preferred_during_scheduling_ignored_during_execution, other.preferred_during_scheduling_ignored_during_execution); - crate::DeepMerge::merge_from(&mut self.required_during_scheduling_ignored_during_execution, other.required_during_scheduling_ignored_during_execution); + crate::merge_strategies::list::atomic(&mut self.preferred_during_scheduling_ignored_during_execution, other.preferred_during_scheduling_ignored_during_execution); + crate::merge_strategies::list::atomic(&mut self.required_during_scheduling_ignored_during_execution, other.required_during_scheduling_ignored_during_execution); } } diff --git a/src/v1_23/api/core/v1/pod_affinity_term.rs b/src/v1_23/api/core/v1/pod_affinity_term.rs index f514b64071..1b92b398b0 100644 --- a/src/v1_23/api/core/v1/pod_affinity_term.rs +++ b/src/v1_23/api/core/v1/pod_affinity_term.rs @@ -20,7 +20,7 @@ impl crate::DeepMerge for PodAffinityTerm { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.label_selector, other.label_selector); crate::DeepMerge::merge_from(&mut self.namespace_selector, other.namespace_selector); - crate::DeepMerge::merge_from(&mut self.namespaces, other.namespaces); + crate::merge_strategies::list::atomic(&mut self.namespaces, other.namespaces); crate::DeepMerge::merge_from(&mut self.topology_key, other.topology_key); } } diff --git a/src/v1_23/api/core/v1/pod_anti_affinity.rs b/src/v1_23/api/core/v1/pod_anti_affinity.rs index a6cd6aa584..86979017ac 100644 --- a/src/v1_23/api/core/v1/pod_anti_affinity.rs +++ b/src/v1_23/api/core/v1/pod_anti_affinity.rs @@ -12,8 +12,8 @@ pub struct PodAntiAffinity { impl crate::DeepMerge for PodAntiAffinity { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.preferred_during_scheduling_ignored_during_execution, other.preferred_during_scheduling_ignored_during_execution); - crate::DeepMerge::merge_from(&mut self.required_during_scheduling_ignored_during_execution, other.required_during_scheduling_ignored_during_execution); + crate::merge_strategies::list::atomic(&mut self.preferred_during_scheduling_ignored_during_execution, other.preferred_during_scheduling_ignored_during_execution); + crate::merge_strategies::list::atomic(&mut self.required_during_scheduling_ignored_during_execution, other.required_during_scheduling_ignored_during_execution); } } diff --git a/src/v1_23/api/core/v1/pod_dns_config.rs b/src/v1_23/api/core/v1/pod_dns_config.rs index b79282bb55..201eb4d69c 100644 --- a/src/v1_23/api/core/v1/pod_dns_config.rs +++ b/src/v1_23/api/core/v1/pod_dns_config.rs @@ -15,9 +15,9 @@ pub struct PodDNSConfig { impl crate::DeepMerge for PodDNSConfig { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.nameservers, other.nameservers); - crate::DeepMerge::merge_from(&mut self.options, other.options); - crate::DeepMerge::merge_from(&mut self.searches, other.searches); + crate::merge_strategies::list::atomic(&mut self.nameservers, other.nameservers); + crate::merge_strategies::list::atomic(&mut self.options, other.options); + crate::merge_strategies::list::atomic(&mut self.searches, other.searches); } } diff --git a/src/v1_23/api/core/v1/pod_security_context.rs b/src/v1_23/api/core/v1/pod_security_context.rs index 9cf93e3f01..b595b94dfc 100644 --- a/src/v1_23/api/core/v1/pod_security_context.rs +++ b/src/v1_23/api/core/v1/pod_security_context.rs @@ -47,8 +47,8 @@ impl crate::DeepMerge for PodSecurityContext { crate::DeepMerge::merge_from(&mut self.run_as_user, other.run_as_user); crate::DeepMerge::merge_from(&mut self.se_linux_options, other.se_linux_options); crate::DeepMerge::merge_from(&mut self.seccomp_profile, other.seccomp_profile); - crate::DeepMerge::merge_from(&mut self.supplemental_groups, other.supplemental_groups); - crate::DeepMerge::merge_from(&mut self.sysctls, other.sysctls); + crate::merge_strategies::list::atomic(&mut self.supplemental_groups, other.supplemental_groups); + crate::merge_strategies::list::atomic(&mut self.sysctls, other.sysctls); crate::DeepMerge::merge_from(&mut self.windows_options, other.windows_options); } } diff --git a/src/v1_23/api/core/v1/pod_spec.rs b/src/v1_23/api/core/v1/pod_spec.rs index e7f7aff321..ab6022caa4 100644 --- a/src/v1_23/api/core/v1/pod_spec.rs +++ b/src/v1_23/api/core/v1/pod_spec.rs @@ -123,26 +123,63 @@ impl crate::DeepMerge for PodSpec { crate::DeepMerge::merge_from(&mut self.active_deadline_seconds, other.active_deadline_seconds); crate::DeepMerge::merge_from(&mut self.affinity, other.affinity); crate::DeepMerge::merge_from(&mut self.automount_service_account_token, other.automount_service_account_token); - crate::DeepMerge::merge_from(&mut self.containers, other.containers); + crate::merge_strategies::list::map( + &mut self.containers, + other.containers, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.dns_config, other.dns_config); crate::DeepMerge::merge_from(&mut self.dns_policy, other.dns_policy); crate::DeepMerge::merge_from(&mut self.enable_service_links, other.enable_service_links); - crate::DeepMerge::merge_from(&mut self.ephemeral_containers, other.ephemeral_containers); - crate::DeepMerge::merge_from(&mut self.host_aliases, other.host_aliases); + crate::merge_strategies::list::map( + &mut self.ephemeral_containers, + other.ephemeral_containers, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::list::map( + &mut self.host_aliases, + other.host_aliases, + &[|lhs, rhs| lhs.ip == rhs.ip], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.host_ipc, other.host_ipc); crate::DeepMerge::merge_from(&mut self.host_network, other.host_network); crate::DeepMerge::merge_from(&mut self.host_pid, other.host_pid); crate::DeepMerge::merge_from(&mut self.hostname, other.hostname); - crate::DeepMerge::merge_from(&mut self.image_pull_secrets, other.image_pull_secrets); - crate::DeepMerge::merge_from(&mut self.init_containers, other.init_containers); + crate::merge_strategies::list::map( + &mut self.image_pull_secrets, + other.image_pull_secrets, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::list::map( + &mut self.init_containers, + other.init_containers, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.node_name, other.node_name); - crate::DeepMerge::merge_from(&mut self.node_selector, other.node_selector); + crate::merge_strategies::map::atomic(&mut self.node_selector, other.node_selector); crate::DeepMerge::merge_from(&mut self.os, other.os); - crate::DeepMerge::merge_from(&mut self.overhead, other.overhead); + crate::merge_strategies::map::granular(&mut self.overhead, other.overhead, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.preemption_policy, other.preemption_policy); crate::DeepMerge::merge_from(&mut self.priority, other.priority); crate::DeepMerge::merge_from(&mut self.priority_class_name, other.priority_class_name); - crate::DeepMerge::merge_from(&mut self.readiness_gates, other.readiness_gates); + crate::merge_strategies::list::atomic(&mut self.readiness_gates, other.readiness_gates); crate::DeepMerge::merge_from(&mut self.restart_policy, other.restart_policy); crate::DeepMerge::merge_from(&mut self.runtime_class_name, other.runtime_class_name); crate::DeepMerge::merge_from(&mut self.scheduler_name, other.scheduler_name); @@ -153,9 +190,23 @@ impl crate::DeepMerge for PodSpec { crate::DeepMerge::merge_from(&mut self.share_process_namespace, other.share_process_namespace); crate::DeepMerge::merge_from(&mut self.subdomain, other.subdomain); crate::DeepMerge::merge_from(&mut self.termination_grace_period_seconds, other.termination_grace_period_seconds); - crate::DeepMerge::merge_from(&mut self.tolerations, other.tolerations); - crate::DeepMerge::merge_from(&mut self.topology_spread_constraints, other.topology_spread_constraints); - crate::DeepMerge::merge_from(&mut self.volumes, other.volumes); + crate::merge_strategies::list::atomic(&mut self.tolerations, other.tolerations); + crate::merge_strategies::list::map( + &mut self.topology_spread_constraints, + other.topology_spread_constraints, + &[|lhs, rhs| lhs.topology_key == rhs.topology_key], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::list::map( + &mut self.volumes, + other.volumes, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_23/api/core/v1/pod_status.rs b/src/v1_23/api/core/v1/pod_status.rs index b3f9b0e4cf..f345042b11 100644 --- a/src/v1_23/api/core/v1/pod_status.rs +++ b/src/v1_23/api/core/v1/pod_status.rs @@ -51,16 +51,30 @@ pub struct PodStatus { impl crate::DeepMerge for PodStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); - crate::DeepMerge::merge_from(&mut self.container_statuses, other.container_statuses); - crate::DeepMerge::merge_from(&mut self.ephemeral_container_statuses, other.ephemeral_container_statuses); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::list::atomic(&mut self.container_statuses, other.container_statuses); + crate::merge_strategies::list::atomic(&mut self.ephemeral_container_statuses, other.ephemeral_container_statuses); crate::DeepMerge::merge_from(&mut self.host_ip, other.host_ip); - crate::DeepMerge::merge_from(&mut self.init_container_statuses, other.init_container_statuses); + crate::merge_strategies::list::atomic(&mut self.init_container_statuses, other.init_container_statuses); crate::DeepMerge::merge_from(&mut self.message, other.message); crate::DeepMerge::merge_from(&mut self.nominated_node_name, other.nominated_node_name); crate::DeepMerge::merge_from(&mut self.phase, other.phase); crate::DeepMerge::merge_from(&mut self.pod_ip, other.pod_ip); - crate::DeepMerge::merge_from(&mut self.pod_ips, other.pod_ips); + crate::merge_strategies::list::map( + &mut self.pod_ips, + other.pod_ips, + &[|lhs, rhs| lhs.ip == rhs.ip], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.qos_class, other.qos_class); crate::DeepMerge::merge_from(&mut self.reason, other.reason); crate::DeepMerge::merge_from(&mut self.start_time, other.start_time); diff --git a/src/v1_23/api/core/v1/projected_volume_source.rs b/src/v1_23/api/core/v1/projected_volume_source.rs index 8852dae377..650c07c7dc 100644 --- a/src/v1_23/api/core/v1/projected_volume_source.rs +++ b/src/v1_23/api/core/v1/projected_volume_source.rs @@ -13,7 +13,7 @@ pub struct ProjectedVolumeSource { impl crate::DeepMerge for ProjectedVolumeSource { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.default_mode, other.default_mode); - crate::DeepMerge::merge_from(&mut self.sources, other.sources); + crate::merge_strategies::list::atomic(&mut self.sources, other.sources); } } diff --git a/src/v1_23/api/core/v1/rbd_persistent_volume_source.rs b/src/v1_23/api/core/v1/rbd_persistent_volume_source.rs index 303bf915bc..d94e189fd5 100644 --- a/src/v1_23/api/core/v1/rbd_persistent_volume_source.rs +++ b/src/v1_23/api/core/v1/rbd_persistent_volume_source.rs @@ -33,7 +33,7 @@ impl crate::DeepMerge for RBDPersistentVolumeSource { crate::DeepMerge::merge_from(&mut self.fs_type, other.fs_type); crate::DeepMerge::merge_from(&mut self.image, other.image); crate::DeepMerge::merge_from(&mut self.keyring, other.keyring); - crate::DeepMerge::merge_from(&mut self.monitors, other.monitors); + crate::merge_strategies::list::atomic(&mut self.monitors, other.monitors); crate::DeepMerge::merge_from(&mut self.pool, other.pool); crate::DeepMerge::merge_from(&mut self.read_only, other.read_only); crate::DeepMerge::merge_from(&mut self.secret_ref, other.secret_ref); diff --git a/src/v1_23/api/core/v1/rbd_volume_source.rs b/src/v1_23/api/core/v1/rbd_volume_source.rs index 28d087cae2..c5521eac18 100644 --- a/src/v1_23/api/core/v1/rbd_volume_source.rs +++ b/src/v1_23/api/core/v1/rbd_volume_source.rs @@ -33,7 +33,7 @@ impl crate::DeepMerge for RBDVolumeSource { crate::DeepMerge::merge_from(&mut self.fs_type, other.fs_type); crate::DeepMerge::merge_from(&mut self.image, other.image); crate::DeepMerge::merge_from(&mut self.keyring, other.keyring); - crate::DeepMerge::merge_from(&mut self.monitors, other.monitors); + crate::merge_strategies::list::atomic(&mut self.monitors, other.monitors); crate::DeepMerge::merge_from(&mut self.pool, other.pool); crate::DeepMerge::merge_from(&mut self.read_only, other.read_only); crate::DeepMerge::merge_from(&mut self.secret_ref, other.secret_ref); diff --git a/src/v1_23/api/core/v1/replication_controller_spec.rs b/src/v1_23/api/core/v1/replication_controller_spec.rs index 293546b183..ed3edfa202 100644 --- a/src/v1_23/api/core/v1/replication_controller_spec.rs +++ b/src/v1_23/api/core/v1/replication_controller_spec.rs @@ -20,7 +20,7 @@ impl crate::DeepMerge for ReplicationControllerSpec { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.min_ready_seconds, other.min_ready_seconds); crate::DeepMerge::merge_from(&mut self.replicas, other.replicas); - crate::DeepMerge::merge_from(&mut self.selector, other.selector); + crate::merge_strategies::map::atomic(&mut self.selector, other.selector); crate::DeepMerge::merge_from(&mut self.template, other.template); } } diff --git a/src/v1_23/api/core/v1/replication_controller_status.rs b/src/v1_23/api/core/v1/replication_controller_status.rs index d069722747..47ccceaeba 100644 --- a/src/v1_23/api/core/v1/replication_controller_status.rs +++ b/src/v1_23/api/core/v1/replication_controller_status.rs @@ -25,7 +25,14 @@ pub struct ReplicationControllerStatus { impl crate::DeepMerge for ReplicationControllerStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.available_replicas, other.available_replicas); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.fully_labeled_replicas, other.fully_labeled_replicas); crate::DeepMerge::merge_from(&mut self.observed_generation, other.observed_generation); crate::DeepMerge::merge_from(&mut self.ready_replicas, other.ready_replicas); diff --git a/src/v1_23/api/core/v1/resource_quota_spec.rs b/src/v1_23/api/core/v1/resource_quota_spec.rs index fab2b7970d..3468d8e9e0 100644 --- a/src/v1_23/api/core/v1/resource_quota_spec.rs +++ b/src/v1_23/api/core/v1/resource_quota_spec.rs @@ -15,9 +15,11 @@ pub struct ResourceQuotaSpec { impl crate::DeepMerge for ResourceQuotaSpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.hard, other.hard); + crate::merge_strategies::map::granular(&mut self.hard, other.hard, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.scope_selector, other.scope_selector); - crate::DeepMerge::merge_from(&mut self.scopes, other.scopes); + crate::merge_strategies::list::atomic(&mut self.scopes, other.scopes); } } diff --git a/src/v1_23/api/core/v1/resource_quota_status.rs b/src/v1_23/api/core/v1/resource_quota_status.rs index 100f418a69..74ee1efe3c 100644 --- a/src/v1_23/api/core/v1/resource_quota_status.rs +++ b/src/v1_23/api/core/v1/resource_quota_status.rs @@ -12,8 +12,12 @@ pub struct ResourceQuotaStatus { impl crate::DeepMerge for ResourceQuotaStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.hard, other.hard); - crate::DeepMerge::merge_from(&mut self.used, other.used); + crate::merge_strategies::map::granular(&mut self.hard, other.hard, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.used, other.used, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); } } diff --git a/src/v1_23/api/core/v1/resource_requirements.rs b/src/v1_23/api/core/v1/resource_requirements.rs index 816608c415..c3f4b1fd86 100644 --- a/src/v1_23/api/core/v1/resource_requirements.rs +++ b/src/v1_23/api/core/v1/resource_requirements.rs @@ -12,8 +12,12 @@ pub struct ResourceRequirements { impl crate::DeepMerge for ResourceRequirements { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.limits, other.limits); - crate::DeepMerge::merge_from(&mut self.requests, other.requests); + crate::merge_strategies::map::granular(&mut self.limits, other.limits, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.requests, other.requests, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); } } diff --git a/src/v1_23/api/core/v1/scope_selector.rs b/src/v1_23/api/core/v1/scope_selector.rs index 22ef180aeb..23ebdb0612 100644 --- a/src/v1_23/api/core/v1/scope_selector.rs +++ b/src/v1_23/api/core/v1/scope_selector.rs @@ -9,7 +9,7 @@ pub struct ScopeSelector { impl crate::DeepMerge for ScopeSelector { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.match_expressions, other.match_expressions); + crate::merge_strategies::list::atomic(&mut self.match_expressions, other.match_expressions); } } diff --git a/src/v1_23/api/core/v1/scoped_resource_selector_requirement.rs b/src/v1_23/api/core/v1/scoped_resource_selector_requirement.rs index 14449d761a..591e72bec0 100644 --- a/src/v1_23/api/core/v1/scoped_resource_selector_requirement.rs +++ b/src/v1_23/api/core/v1/scoped_resource_selector_requirement.rs @@ -19,7 +19,7 @@ impl crate::DeepMerge for ScopedResourceSelectorRequirement { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.operator, other.operator); crate::DeepMerge::merge_from(&mut self.scope_name, other.scope_name); - crate::DeepMerge::merge_from(&mut self.values, other.values); + crate::merge_strategies::list::atomic(&mut self.values, other.values); } } diff --git a/src/v1_23/api/core/v1/secret.rs b/src/v1_23/api/core/v1/secret.rs index 74a33ebe09..eb75155e0d 100644 --- a/src/v1_23/api/core/v1/secret.rs +++ b/src/v1_23/api/core/v1/secret.rs @@ -498,10 +498,14 @@ impl crate::Metadata for Secret { impl crate::DeepMerge for Secret { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.data, other.data); + crate::merge_strategies::map::granular(&mut self.data, other.data, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.immutable, other.immutable); crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.string_data, other.string_data); + crate::merge_strategies::map::granular(&mut self.string_data, other.string_data, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.type_, other.type_); } } diff --git a/src/v1_23/api/core/v1/secret_projection.rs b/src/v1_23/api/core/v1/secret_projection.rs index 41277f3645..df50709566 100644 --- a/src/v1_23/api/core/v1/secret_projection.rs +++ b/src/v1_23/api/core/v1/secret_projection.rs @@ -17,7 +17,7 @@ pub struct SecretProjection { impl crate::DeepMerge for SecretProjection { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.items, other.items); + crate::merge_strategies::list::atomic(&mut self.items, other.items); crate::DeepMerge::merge_from(&mut self.name, other.name); crate::DeepMerge::merge_from(&mut self.optional, other.optional); } diff --git a/src/v1_23/api/core/v1/secret_volume_source.rs b/src/v1_23/api/core/v1/secret_volume_source.rs index 6f0de3b8aa..7daa3928bd 100644 --- a/src/v1_23/api/core/v1/secret_volume_source.rs +++ b/src/v1_23/api/core/v1/secret_volume_source.rs @@ -21,7 +21,7 @@ pub struct SecretVolumeSource { impl crate::DeepMerge for SecretVolumeSource { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.default_mode, other.default_mode); - crate::DeepMerge::merge_from(&mut self.items, other.items); + crate::merge_strategies::list::atomic(&mut self.items, other.items); crate::DeepMerge::merge_from(&mut self.optional, other.optional); crate::DeepMerge::merge_from(&mut self.secret_name, other.secret_name); } diff --git a/src/v1_23/api/core/v1/service_account.rs b/src/v1_23/api/core/v1/service_account.rs index c1b334f710..c297d5be55 100644 --- a/src/v1_23/api/core/v1/service_account.rs +++ b/src/v1_23/api/core/v1/service_account.rs @@ -496,9 +496,16 @@ impl crate::Metadata for ServiceAccount { impl crate::DeepMerge for ServiceAccount { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.automount_service_account_token, other.automount_service_account_token); - crate::DeepMerge::merge_from(&mut self.image_pull_secrets, other.image_pull_secrets); + crate::merge_strategies::list::atomic(&mut self.image_pull_secrets, other.image_pull_secrets); crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.secrets, other.secrets); + crate::merge_strategies::list::map( + &mut self.secrets, + other.secrets, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_23/api/core/v1/service_spec.rs b/src/v1_23/api/core/v1/service_spec.rs index 278d21e017..215683b798 100644 --- a/src/v1_23/api/core/v1/service_spec.rs +++ b/src/v1_23/api/core/v1/service_spec.rs @@ -72,20 +72,27 @@ impl crate::DeepMerge for ServiceSpec { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.allocate_load_balancer_node_ports, other.allocate_load_balancer_node_ports); crate::DeepMerge::merge_from(&mut self.cluster_ip, other.cluster_ip); - crate::DeepMerge::merge_from(&mut self.cluster_ips, other.cluster_ips); - crate::DeepMerge::merge_from(&mut self.external_ips, other.external_ips); + crate::merge_strategies::list::atomic(&mut self.cluster_ips, other.cluster_ips); + crate::merge_strategies::list::atomic(&mut self.external_ips, other.external_ips); crate::DeepMerge::merge_from(&mut self.external_name, other.external_name); crate::DeepMerge::merge_from(&mut self.external_traffic_policy, other.external_traffic_policy); crate::DeepMerge::merge_from(&mut self.health_check_node_port, other.health_check_node_port); crate::DeepMerge::merge_from(&mut self.internal_traffic_policy, other.internal_traffic_policy); - crate::DeepMerge::merge_from(&mut self.ip_families, other.ip_families); + crate::merge_strategies::list::atomic(&mut self.ip_families, other.ip_families); crate::DeepMerge::merge_from(&mut self.ip_family_policy, other.ip_family_policy); crate::DeepMerge::merge_from(&mut self.load_balancer_class, other.load_balancer_class); crate::DeepMerge::merge_from(&mut self.load_balancer_ip, other.load_balancer_ip); - crate::DeepMerge::merge_from(&mut self.load_balancer_source_ranges, other.load_balancer_source_ranges); - crate::DeepMerge::merge_from(&mut self.ports, other.ports); + crate::merge_strategies::list::atomic(&mut self.load_balancer_source_ranges, other.load_balancer_source_ranges); + crate::merge_strategies::list::map( + &mut self.ports, + other.ports, + &[|lhs, rhs| lhs.port == rhs.port], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.publish_not_ready_addresses, other.publish_not_ready_addresses); - crate::DeepMerge::merge_from(&mut self.selector, other.selector); + crate::merge_strategies::map::atomic(&mut self.selector, other.selector); crate::DeepMerge::merge_from(&mut self.session_affinity, other.session_affinity); crate::DeepMerge::merge_from(&mut self.session_affinity_config, other.session_affinity_config); crate::DeepMerge::merge_from(&mut self.type_, other.type_); diff --git a/src/v1_23/api/core/v1/service_status.rs b/src/v1_23/api/core/v1/service_status.rs index 6c3429fd70..6dece09b96 100644 --- a/src/v1_23/api/core/v1/service_status.rs +++ b/src/v1_23/api/core/v1/service_status.rs @@ -12,7 +12,14 @@ pub struct ServiceStatus { impl crate::DeepMerge for ServiceStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.load_balancer, other.load_balancer); } } diff --git a/src/v1_23/api/core/v1/topology_selector_label_requirement.rs b/src/v1_23/api/core/v1/topology_selector_label_requirement.rs index 3efed6ba65..50764252b6 100644 --- a/src/v1_23/api/core/v1/topology_selector_label_requirement.rs +++ b/src/v1_23/api/core/v1/topology_selector_label_requirement.rs @@ -13,7 +13,7 @@ pub struct TopologySelectorLabelRequirement { impl crate::DeepMerge for TopologySelectorLabelRequirement { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.key, other.key); - crate::DeepMerge::merge_from(&mut self.values, other.values); + crate::merge_strategies::list::atomic(&mut self.values, other.values); } } diff --git a/src/v1_23/api/core/v1/topology_selector_term.rs b/src/v1_23/api/core/v1/topology_selector_term.rs index 230f7ab530..df526d6f4d 100644 --- a/src/v1_23/api/core/v1/topology_selector_term.rs +++ b/src/v1_23/api/core/v1/topology_selector_term.rs @@ -9,7 +9,7 @@ pub struct TopologySelectorTerm { impl crate::DeepMerge for TopologySelectorTerm { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.match_label_expressions, other.match_label_expressions); + crate::merge_strategies::list::atomic(&mut self.match_label_expressions, other.match_label_expressions); } } diff --git a/src/v1_23/api/discovery/v1/endpoint.rs b/src/v1_23/api/discovery/v1/endpoint.rs index 10cf5ed900..a37f940dd0 100644 --- a/src/v1_23/api/discovery/v1/endpoint.rs +++ b/src/v1_23/api/discovery/v1/endpoint.rs @@ -30,9 +30,11 @@ pub struct Endpoint { impl crate::DeepMerge for Endpoint { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.addresses, other.addresses); + crate::merge_strategies::list::set(&mut self.addresses, other.addresses); crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); - crate::DeepMerge::merge_from(&mut self.deprecated_topology, other.deprecated_topology); + crate::merge_strategies::map::granular(&mut self.deprecated_topology, other.deprecated_topology, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.hints, other.hints); crate::DeepMerge::merge_from(&mut self.hostname, other.hostname); crate::DeepMerge::merge_from(&mut self.node_name, other.node_name); diff --git a/src/v1_23/api/discovery/v1/endpoint_hints.rs b/src/v1_23/api/discovery/v1/endpoint_hints.rs index 7fe956528a..02cbd88946 100644 --- a/src/v1_23/api/discovery/v1/endpoint_hints.rs +++ b/src/v1_23/api/discovery/v1/endpoint_hints.rs @@ -9,7 +9,7 @@ pub struct EndpointHints { impl crate::DeepMerge for EndpointHints { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.for_zones, other.for_zones); + crate::merge_strategies::list::atomic(&mut self.for_zones, other.for_zones); } } diff --git a/src/v1_23/api/discovery/v1/endpoint_slice.rs b/src/v1_23/api/discovery/v1/endpoint_slice.rs index 5858e58711..033c1c4e60 100644 --- a/src/v1_23/api/discovery/v1/endpoint_slice.rs +++ b/src/v1_23/api/discovery/v1/endpoint_slice.rs @@ -497,9 +497,9 @@ impl crate::Metadata for EndpointSlice { impl crate::DeepMerge for EndpointSlice { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.address_type, other.address_type); - crate::DeepMerge::merge_from(&mut self.endpoints, other.endpoints); + crate::merge_strategies::list::atomic(&mut self.endpoints, other.endpoints); crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.ports, other.ports); + crate::merge_strategies::list::atomic(&mut self.ports, other.ports); } } diff --git a/src/v1_23/api/discovery/v1beta1/endpoint.rs b/src/v1_23/api/discovery/v1beta1/endpoint.rs index 72633f136a..cd80eaa25b 100644 --- a/src/v1_23/api/discovery/v1beta1/endpoint.rs +++ b/src/v1_23/api/discovery/v1beta1/endpoint.rs @@ -34,13 +34,15 @@ pub struct Endpoint { impl crate::DeepMerge for Endpoint { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.addresses, other.addresses); + crate::merge_strategies::list::set(&mut self.addresses, other.addresses); crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); crate::DeepMerge::merge_from(&mut self.hints, other.hints); crate::DeepMerge::merge_from(&mut self.hostname, other.hostname); crate::DeepMerge::merge_from(&mut self.node_name, other.node_name); crate::DeepMerge::merge_from(&mut self.target_ref, other.target_ref); - crate::DeepMerge::merge_from(&mut self.topology, other.topology); + crate::merge_strategies::map::granular(&mut self.topology, other.topology, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); } } diff --git a/src/v1_23/api/discovery/v1beta1/endpoint_hints.rs b/src/v1_23/api/discovery/v1beta1/endpoint_hints.rs index 3f5bf3905b..57d5cc5553 100644 --- a/src/v1_23/api/discovery/v1beta1/endpoint_hints.rs +++ b/src/v1_23/api/discovery/v1beta1/endpoint_hints.rs @@ -9,7 +9,7 @@ pub struct EndpointHints { impl crate::DeepMerge for EndpointHints { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.for_zones, other.for_zones); + crate::merge_strategies::list::atomic(&mut self.for_zones, other.for_zones); } } diff --git a/src/v1_23/api/discovery/v1beta1/endpoint_slice.rs b/src/v1_23/api/discovery/v1beta1/endpoint_slice.rs index cfe4553dc2..12d89081fa 100644 --- a/src/v1_23/api/discovery/v1beta1/endpoint_slice.rs +++ b/src/v1_23/api/discovery/v1beta1/endpoint_slice.rs @@ -496,9 +496,9 @@ impl crate::Metadata for EndpointSlice { impl crate::DeepMerge for EndpointSlice { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.address_type, other.address_type); - crate::DeepMerge::merge_from(&mut self.endpoints, other.endpoints); + crate::merge_strategies::list::atomic(&mut self.endpoints, other.endpoints); crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.ports, other.ports); + crate::merge_strategies::list::atomic(&mut self.ports, other.ports); } } diff --git a/src/v1_23/api/flowcontrol/v1beta1/flow_schema_spec.rs b/src/v1_23/api/flowcontrol/v1beta1/flow_schema_spec.rs index 40031e5acc..fb04b8c0af 100644 --- a/src/v1_23/api/flowcontrol/v1beta1/flow_schema_spec.rs +++ b/src/v1_23/api/flowcontrol/v1beta1/flow_schema_spec.rs @@ -21,7 +21,7 @@ impl crate::DeepMerge for FlowSchemaSpec { crate::DeepMerge::merge_from(&mut self.distinguisher_method, other.distinguisher_method); crate::DeepMerge::merge_from(&mut self.matching_precedence, other.matching_precedence); crate::DeepMerge::merge_from(&mut self.priority_level_configuration, other.priority_level_configuration); - crate::DeepMerge::merge_from(&mut self.rules, other.rules); + crate::merge_strategies::list::atomic(&mut self.rules, other.rules); } } diff --git a/src/v1_23/api/flowcontrol/v1beta1/flow_schema_status.rs b/src/v1_23/api/flowcontrol/v1beta1/flow_schema_status.rs index c463e68e6a..7de52a1a65 100644 --- a/src/v1_23/api/flowcontrol/v1beta1/flow_schema_status.rs +++ b/src/v1_23/api/flowcontrol/v1beta1/flow_schema_status.rs @@ -9,7 +9,14 @@ pub struct FlowSchemaStatus { impl crate::DeepMerge for FlowSchemaStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_23/api/flowcontrol/v1beta1/non_resource_policy_rule.rs b/src/v1_23/api/flowcontrol/v1beta1/non_resource_policy_rule.rs index 80b8803dc1..ac9b066b17 100644 --- a/src/v1_23/api/flowcontrol/v1beta1/non_resource_policy_rule.rs +++ b/src/v1_23/api/flowcontrol/v1beta1/non_resource_policy_rule.rs @@ -18,8 +18,8 @@ pub struct NonResourcePolicyRule { impl crate::DeepMerge for NonResourcePolicyRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.non_resource_urls, other.non_resource_urls); - crate::DeepMerge::merge_from(&mut self.verbs, other.verbs); + crate::merge_strategies::list::set(&mut self.non_resource_urls, other.non_resource_urls); + crate::merge_strategies::list::set(&mut self.verbs, other.verbs); } } diff --git a/src/v1_23/api/flowcontrol/v1beta1/policy_rules_with_subjects.rs b/src/v1_23/api/flowcontrol/v1beta1/policy_rules_with_subjects.rs index 780a347761..8a727117e0 100644 --- a/src/v1_23/api/flowcontrol/v1beta1/policy_rules_with_subjects.rs +++ b/src/v1_23/api/flowcontrol/v1beta1/policy_rules_with_subjects.rs @@ -15,9 +15,9 @@ pub struct PolicyRulesWithSubjects { impl crate::DeepMerge for PolicyRulesWithSubjects { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.non_resource_rules, other.non_resource_rules); - crate::DeepMerge::merge_from(&mut self.resource_rules, other.resource_rules); - crate::DeepMerge::merge_from(&mut self.subjects, other.subjects); + crate::merge_strategies::list::atomic(&mut self.non_resource_rules, other.non_resource_rules); + crate::merge_strategies::list::atomic(&mut self.resource_rules, other.resource_rules); + crate::merge_strategies::list::atomic(&mut self.subjects, other.subjects); } } diff --git a/src/v1_23/api/flowcontrol/v1beta1/priority_level_configuration_status.rs b/src/v1_23/api/flowcontrol/v1beta1/priority_level_configuration_status.rs index a356b4a6df..e35efdf597 100644 --- a/src/v1_23/api/flowcontrol/v1beta1/priority_level_configuration_status.rs +++ b/src/v1_23/api/flowcontrol/v1beta1/priority_level_configuration_status.rs @@ -9,7 +9,14 @@ pub struct PriorityLevelConfigurationStatus { impl crate::DeepMerge for PriorityLevelConfigurationStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_23/api/flowcontrol/v1beta1/resource_policy_rule.rs b/src/v1_23/api/flowcontrol/v1beta1/resource_policy_rule.rs index 93d3b933e4..895a7e8d48 100644 --- a/src/v1_23/api/flowcontrol/v1beta1/resource_policy_rule.rs +++ b/src/v1_23/api/flowcontrol/v1beta1/resource_policy_rule.rs @@ -21,11 +21,11 @@ pub struct ResourcePolicyRule { impl crate::DeepMerge for ResourcePolicyRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.api_groups, other.api_groups); + crate::merge_strategies::list::set(&mut self.api_groups, other.api_groups); crate::DeepMerge::merge_from(&mut self.cluster_scope, other.cluster_scope); - crate::DeepMerge::merge_from(&mut self.namespaces, other.namespaces); - crate::DeepMerge::merge_from(&mut self.resources, other.resources); - crate::DeepMerge::merge_from(&mut self.verbs, other.verbs); + crate::merge_strategies::list::set(&mut self.namespaces, other.namespaces); + crate::merge_strategies::list::set(&mut self.resources, other.resources); + crate::merge_strategies::list::set(&mut self.verbs, other.verbs); } } diff --git a/src/v1_23/api/flowcontrol/v1beta2/flow_schema_spec.rs b/src/v1_23/api/flowcontrol/v1beta2/flow_schema_spec.rs index e28a19711f..c8c9e2a04f 100644 --- a/src/v1_23/api/flowcontrol/v1beta2/flow_schema_spec.rs +++ b/src/v1_23/api/flowcontrol/v1beta2/flow_schema_spec.rs @@ -21,7 +21,7 @@ impl crate::DeepMerge for FlowSchemaSpec { crate::DeepMerge::merge_from(&mut self.distinguisher_method, other.distinguisher_method); crate::DeepMerge::merge_from(&mut self.matching_precedence, other.matching_precedence); crate::DeepMerge::merge_from(&mut self.priority_level_configuration, other.priority_level_configuration); - crate::DeepMerge::merge_from(&mut self.rules, other.rules); + crate::merge_strategies::list::atomic(&mut self.rules, other.rules); } } diff --git a/src/v1_23/api/flowcontrol/v1beta2/flow_schema_status.rs b/src/v1_23/api/flowcontrol/v1beta2/flow_schema_status.rs index 104835c519..f412d33945 100644 --- a/src/v1_23/api/flowcontrol/v1beta2/flow_schema_status.rs +++ b/src/v1_23/api/flowcontrol/v1beta2/flow_schema_status.rs @@ -9,7 +9,14 @@ pub struct FlowSchemaStatus { impl crate::DeepMerge for FlowSchemaStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_23/api/flowcontrol/v1beta2/non_resource_policy_rule.rs b/src/v1_23/api/flowcontrol/v1beta2/non_resource_policy_rule.rs index e9be9c98a4..f4d3bb0bfc 100644 --- a/src/v1_23/api/flowcontrol/v1beta2/non_resource_policy_rule.rs +++ b/src/v1_23/api/flowcontrol/v1beta2/non_resource_policy_rule.rs @@ -18,8 +18,8 @@ pub struct NonResourcePolicyRule { impl crate::DeepMerge for NonResourcePolicyRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.non_resource_urls, other.non_resource_urls); - crate::DeepMerge::merge_from(&mut self.verbs, other.verbs); + crate::merge_strategies::list::set(&mut self.non_resource_urls, other.non_resource_urls); + crate::merge_strategies::list::set(&mut self.verbs, other.verbs); } } diff --git a/src/v1_23/api/flowcontrol/v1beta2/policy_rules_with_subjects.rs b/src/v1_23/api/flowcontrol/v1beta2/policy_rules_with_subjects.rs index 55c59b24a2..c6b9fafade 100644 --- a/src/v1_23/api/flowcontrol/v1beta2/policy_rules_with_subjects.rs +++ b/src/v1_23/api/flowcontrol/v1beta2/policy_rules_with_subjects.rs @@ -15,9 +15,9 @@ pub struct PolicyRulesWithSubjects { impl crate::DeepMerge for PolicyRulesWithSubjects { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.non_resource_rules, other.non_resource_rules); - crate::DeepMerge::merge_from(&mut self.resource_rules, other.resource_rules); - crate::DeepMerge::merge_from(&mut self.subjects, other.subjects); + crate::merge_strategies::list::atomic(&mut self.non_resource_rules, other.non_resource_rules); + crate::merge_strategies::list::atomic(&mut self.resource_rules, other.resource_rules); + crate::merge_strategies::list::atomic(&mut self.subjects, other.subjects); } } diff --git a/src/v1_23/api/flowcontrol/v1beta2/priority_level_configuration_status.rs b/src/v1_23/api/flowcontrol/v1beta2/priority_level_configuration_status.rs index 3a1f5c9216..6b7d140c4b 100644 --- a/src/v1_23/api/flowcontrol/v1beta2/priority_level_configuration_status.rs +++ b/src/v1_23/api/flowcontrol/v1beta2/priority_level_configuration_status.rs @@ -9,7 +9,14 @@ pub struct PriorityLevelConfigurationStatus { impl crate::DeepMerge for PriorityLevelConfigurationStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_23/api/flowcontrol/v1beta2/resource_policy_rule.rs b/src/v1_23/api/flowcontrol/v1beta2/resource_policy_rule.rs index f4db7b13a2..34f9d52c52 100644 --- a/src/v1_23/api/flowcontrol/v1beta2/resource_policy_rule.rs +++ b/src/v1_23/api/flowcontrol/v1beta2/resource_policy_rule.rs @@ -21,11 +21,11 @@ pub struct ResourcePolicyRule { impl crate::DeepMerge for ResourcePolicyRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.api_groups, other.api_groups); + crate::merge_strategies::list::set(&mut self.api_groups, other.api_groups); crate::DeepMerge::merge_from(&mut self.cluster_scope, other.cluster_scope); - crate::DeepMerge::merge_from(&mut self.namespaces, other.namespaces); - crate::DeepMerge::merge_from(&mut self.resources, other.resources); - crate::DeepMerge::merge_from(&mut self.verbs, other.verbs); + crate::merge_strategies::list::set(&mut self.namespaces, other.namespaces); + crate::merge_strategies::list::set(&mut self.resources, other.resources); + crate::merge_strategies::list::set(&mut self.verbs, other.verbs); } } diff --git a/src/v1_23/api/networking/v1/http_ingress_rule_value.rs b/src/v1_23/api/networking/v1/http_ingress_rule_value.rs index acc836c728..3749783ee2 100644 --- a/src/v1_23/api/networking/v1/http_ingress_rule_value.rs +++ b/src/v1_23/api/networking/v1/http_ingress_rule_value.rs @@ -9,7 +9,7 @@ pub struct HTTPIngressRuleValue { impl crate::DeepMerge for HTTPIngressRuleValue { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.paths, other.paths); + crate::merge_strategies::list::atomic(&mut self.paths, other.paths); } } diff --git a/src/v1_23/api/networking/v1/ingress_spec.rs b/src/v1_23/api/networking/v1/ingress_spec.rs index 68e8606acb..2229a3c788 100644 --- a/src/v1_23/api/networking/v1/ingress_spec.rs +++ b/src/v1_23/api/networking/v1/ingress_spec.rs @@ -20,8 +20,8 @@ impl crate::DeepMerge for IngressSpec { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.default_backend, other.default_backend); crate::DeepMerge::merge_from(&mut self.ingress_class_name, other.ingress_class_name); - crate::DeepMerge::merge_from(&mut self.rules, other.rules); - crate::DeepMerge::merge_from(&mut self.tls, other.tls); + crate::merge_strategies::list::atomic(&mut self.rules, other.rules); + crate::merge_strategies::list::atomic(&mut self.tls, other.tls); } } diff --git a/src/v1_23/api/networking/v1/ingress_tls.rs b/src/v1_23/api/networking/v1/ingress_tls.rs index d48a83a0c4..92c66b754f 100644 --- a/src/v1_23/api/networking/v1/ingress_tls.rs +++ b/src/v1_23/api/networking/v1/ingress_tls.rs @@ -12,7 +12,7 @@ pub struct IngressTLS { impl crate::DeepMerge for IngressTLS { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.hosts, other.hosts); + crate::merge_strategies::list::atomic(&mut self.hosts, other.hosts); crate::DeepMerge::merge_from(&mut self.secret_name, other.secret_name); } } diff --git a/src/v1_23/api/networking/v1/ip_block.rs b/src/v1_23/api/networking/v1/ip_block.rs index 46458b01c5..08d9d2ab61 100644 --- a/src/v1_23/api/networking/v1/ip_block.rs +++ b/src/v1_23/api/networking/v1/ip_block.rs @@ -13,7 +13,7 @@ pub struct IPBlock { impl crate::DeepMerge for IPBlock { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.cidr, other.cidr); - crate::DeepMerge::merge_from(&mut self.except, other.except); + crate::merge_strategies::list::atomic(&mut self.except, other.except); } } diff --git a/src/v1_23/api/networking/v1/network_policy_egress_rule.rs b/src/v1_23/api/networking/v1/network_policy_egress_rule.rs index 33619be210..28eb6a21b6 100644 --- a/src/v1_23/api/networking/v1/network_policy_egress_rule.rs +++ b/src/v1_23/api/networking/v1/network_policy_egress_rule.rs @@ -12,8 +12,8 @@ pub struct NetworkPolicyEgressRule { impl crate::DeepMerge for NetworkPolicyEgressRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.ports, other.ports); - crate::DeepMerge::merge_from(&mut self.to, other.to); + crate::merge_strategies::list::atomic(&mut self.ports, other.ports); + crate::merge_strategies::list::atomic(&mut self.to, other.to); } } diff --git a/src/v1_23/api/networking/v1/network_policy_ingress_rule.rs b/src/v1_23/api/networking/v1/network_policy_ingress_rule.rs index 2c68ec44a7..517765f800 100644 --- a/src/v1_23/api/networking/v1/network_policy_ingress_rule.rs +++ b/src/v1_23/api/networking/v1/network_policy_ingress_rule.rs @@ -12,8 +12,8 @@ pub struct NetworkPolicyIngressRule { impl crate::DeepMerge for NetworkPolicyIngressRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.from, other.from); - crate::DeepMerge::merge_from(&mut self.ports, other.ports); + crate::merge_strategies::list::atomic(&mut self.from, other.from); + crate::merge_strategies::list::atomic(&mut self.ports, other.ports); } } diff --git a/src/v1_23/api/networking/v1/network_policy_spec.rs b/src/v1_23/api/networking/v1/network_policy_spec.rs index ed61b60968..bc980e7469 100644 --- a/src/v1_23/api/networking/v1/network_policy_spec.rs +++ b/src/v1_23/api/networking/v1/network_policy_spec.rs @@ -18,10 +18,10 @@ pub struct NetworkPolicySpec { impl crate::DeepMerge for NetworkPolicySpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.egress, other.egress); - crate::DeepMerge::merge_from(&mut self.ingress, other.ingress); + crate::merge_strategies::list::atomic(&mut self.egress, other.egress); + crate::merge_strategies::list::atomic(&mut self.ingress, other.ingress); crate::DeepMerge::merge_from(&mut self.pod_selector, other.pod_selector); - crate::DeepMerge::merge_from(&mut self.policy_types, other.policy_types); + crate::merge_strategies::list::atomic(&mut self.policy_types, other.policy_types); } } diff --git a/src/v1_23/api/node/v1/overhead.rs b/src/v1_23/api/node/v1/overhead.rs index ef68cae1c1..2db70b80c4 100644 --- a/src/v1_23/api/node/v1/overhead.rs +++ b/src/v1_23/api/node/v1/overhead.rs @@ -9,7 +9,9 @@ pub struct Overhead { impl crate::DeepMerge for Overhead { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.pod_fixed, other.pod_fixed); + crate::merge_strategies::map::granular(&mut self.pod_fixed, other.pod_fixed, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); } } diff --git a/src/v1_23/api/node/v1/scheduling.rs b/src/v1_23/api/node/v1/scheduling.rs index 1c2b8a05c5..79508f62c2 100644 --- a/src/v1_23/api/node/v1/scheduling.rs +++ b/src/v1_23/api/node/v1/scheduling.rs @@ -12,8 +12,8 @@ pub struct Scheduling { impl crate::DeepMerge for Scheduling { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.node_selector, other.node_selector); - crate::DeepMerge::merge_from(&mut self.tolerations, other.tolerations); + crate::merge_strategies::map::atomic(&mut self.node_selector, other.node_selector); + crate::merge_strategies::list::atomic(&mut self.tolerations, other.tolerations); } } diff --git a/src/v1_23/api/node/v1alpha1/overhead.rs b/src/v1_23/api/node/v1alpha1/overhead.rs index 59efa7b8e1..eb3a0a48fb 100644 --- a/src/v1_23/api/node/v1alpha1/overhead.rs +++ b/src/v1_23/api/node/v1alpha1/overhead.rs @@ -9,7 +9,9 @@ pub struct Overhead { impl crate::DeepMerge for Overhead { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.pod_fixed, other.pod_fixed); + crate::merge_strategies::map::granular(&mut self.pod_fixed, other.pod_fixed, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); } } diff --git a/src/v1_23/api/node/v1alpha1/scheduling.rs b/src/v1_23/api/node/v1alpha1/scheduling.rs index f660e0dc43..5b85cee4ab 100644 --- a/src/v1_23/api/node/v1alpha1/scheduling.rs +++ b/src/v1_23/api/node/v1alpha1/scheduling.rs @@ -12,8 +12,8 @@ pub struct Scheduling { impl crate::DeepMerge for Scheduling { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.node_selector, other.node_selector); - crate::DeepMerge::merge_from(&mut self.tolerations, other.tolerations); + crate::merge_strategies::map::atomic(&mut self.node_selector, other.node_selector); + crate::merge_strategies::list::atomic(&mut self.tolerations, other.tolerations); } } diff --git a/src/v1_23/api/node/v1beta1/overhead.rs b/src/v1_23/api/node/v1beta1/overhead.rs index 53af362cd3..821323b5c0 100644 --- a/src/v1_23/api/node/v1beta1/overhead.rs +++ b/src/v1_23/api/node/v1beta1/overhead.rs @@ -9,7 +9,9 @@ pub struct Overhead { impl crate::DeepMerge for Overhead { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.pod_fixed, other.pod_fixed); + crate::merge_strategies::map::granular(&mut self.pod_fixed, other.pod_fixed, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); } } diff --git a/src/v1_23/api/node/v1beta1/scheduling.rs b/src/v1_23/api/node/v1beta1/scheduling.rs index 9b493fe4cf..1b5f5f638c 100644 --- a/src/v1_23/api/node/v1beta1/scheduling.rs +++ b/src/v1_23/api/node/v1beta1/scheduling.rs @@ -12,8 +12,8 @@ pub struct Scheduling { impl crate::DeepMerge for Scheduling { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.node_selector, other.node_selector); - crate::DeepMerge::merge_from(&mut self.tolerations, other.tolerations); + crate::merge_strategies::map::atomic(&mut self.node_selector, other.node_selector); + crate::merge_strategies::list::atomic(&mut self.tolerations, other.tolerations); } } diff --git a/src/v1_23/api/policy/v1/pod_disruption_budget_status.rs b/src/v1_23/api/policy/v1/pod_disruption_budget_status.rs index f4aa41a86e..cf8b02d00f 100644 --- a/src/v1_23/api/policy/v1/pod_disruption_budget_status.rs +++ b/src/v1_23/api/policy/v1/pod_disruption_budget_status.rs @@ -35,10 +35,19 @@ pub struct PodDisruptionBudgetStatus { impl crate::DeepMerge for PodDisruptionBudgetStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.current_healthy, other.current_healthy); crate::DeepMerge::merge_from(&mut self.desired_healthy, other.desired_healthy); - crate::DeepMerge::merge_from(&mut self.disrupted_pods, other.disrupted_pods); + crate::merge_strategies::map::granular(&mut self.disrupted_pods, other.disrupted_pods, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.disruptions_allowed, other.disruptions_allowed); crate::DeepMerge::merge_from(&mut self.expected_pods, other.expected_pods); crate::DeepMerge::merge_from(&mut self.observed_generation, other.observed_generation); diff --git a/src/v1_23/api/policy/v1beta1/fs_group_strategy_options.rs b/src/v1_23/api/policy/v1beta1/fs_group_strategy_options.rs index 80e63553ac..c52d53d54c 100644 --- a/src/v1_23/api/policy/v1beta1/fs_group_strategy_options.rs +++ b/src/v1_23/api/policy/v1beta1/fs_group_strategy_options.rs @@ -12,7 +12,7 @@ pub struct FSGroupStrategyOptions { impl crate::DeepMerge for FSGroupStrategyOptions { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.ranges, other.ranges); + crate::merge_strategies::list::atomic(&mut self.ranges, other.ranges); crate::DeepMerge::merge_from(&mut self.rule, other.rule); } } diff --git a/src/v1_23/api/policy/v1beta1/pod_disruption_budget_status.rs b/src/v1_23/api/policy/v1beta1/pod_disruption_budget_status.rs index 72a03073f6..17f1fa562a 100644 --- a/src/v1_23/api/policy/v1beta1/pod_disruption_budget_status.rs +++ b/src/v1_23/api/policy/v1beta1/pod_disruption_budget_status.rs @@ -35,10 +35,19 @@ pub struct PodDisruptionBudgetStatus { impl crate::DeepMerge for PodDisruptionBudgetStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.current_healthy, other.current_healthy); crate::DeepMerge::merge_from(&mut self.desired_healthy, other.desired_healthy); - crate::DeepMerge::merge_from(&mut self.disrupted_pods, other.disrupted_pods); + crate::merge_strategies::map::granular(&mut self.disrupted_pods, other.disrupted_pods, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.disruptions_allowed, other.disruptions_allowed); crate::DeepMerge::merge_from(&mut self.expected_pods, other.expected_pods); crate::DeepMerge::merge_from(&mut self.observed_generation, other.observed_generation); diff --git a/src/v1_23/api/policy/v1beta1/pod_security_policy_spec.rs b/src/v1_23/api/policy/v1beta1/pod_security_policy_spec.rs index b4f2ca8c67..e9a43ffbac 100644 --- a/src/v1_23/api/policy/v1beta1/pod_security_policy_spec.rs +++ b/src/v1_23/api/policy/v1beta1/pod_security_policy_spec.rs @@ -83,29 +83,29 @@ pub struct PodSecurityPolicySpec { impl crate::DeepMerge for PodSecurityPolicySpec { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.allow_privilege_escalation, other.allow_privilege_escalation); - crate::DeepMerge::merge_from(&mut self.allowed_csi_drivers, other.allowed_csi_drivers); - crate::DeepMerge::merge_from(&mut self.allowed_capabilities, other.allowed_capabilities); - crate::DeepMerge::merge_from(&mut self.allowed_flex_volumes, other.allowed_flex_volumes); - crate::DeepMerge::merge_from(&mut self.allowed_host_paths, other.allowed_host_paths); - crate::DeepMerge::merge_from(&mut self.allowed_proc_mount_types, other.allowed_proc_mount_types); - crate::DeepMerge::merge_from(&mut self.allowed_unsafe_sysctls, other.allowed_unsafe_sysctls); - crate::DeepMerge::merge_from(&mut self.default_add_capabilities, other.default_add_capabilities); + crate::merge_strategies::list::atomic(&mut self.allowed_csi_drivers, other.allowed_csi_drivers); + crate::merge_strategies::list::atomic(&mut self.allowed_capabilities, other.allowed_capabilities); + crate::merge_strategies::list::atomic(&mut self.allowed_flex_volumes, other.allowed_flex_volumes); + crate::merge_strategies::list::atomic(&mut self.allowed_host_paths, other.allowed_host_paths); + crate::merge_strategies::list::atomic(&mut self.allowed_proc_mount_types, other.allowed_proc_mount_types); + crate::merge_strategies::list::atomic(&mut self.allowed_unsafe_sysctls, other.allowed_unsafe_sysctls); + crate::merge_strategies::list::atomic(&mut self.default_add_capabilities, other.default_add_capabilities); crate::DeepMerge::merge_from(&mut self.default_allow_privilege_escalation, other.default_allow_privilege_escalation); - crate::DeepMerge::merge_from(&mut self.forbidden_sysctls, other.forbidden_sysctls); + crate::merge_strategies::list::atomic(&mut self.forbidden_sysctls, other.forbidden_sysctls); crate::DeepMerge::merge_from(&mut self.fs_group, other.fs_group); crate::DeepMerge::merge_from(&mut self.host_ipc, other.host_ipc); crate::DeepMerge::merge_from(&mut self.host_network, other.host_network); crate::DeepMerge::merge_from(&mut self.host_pid, other.host_pid); - crate::DeepMerge::merge_from(&mut self.host_ports, other.host_ports); + crate::merge_strategies::list::atomic(&mut self.host_ports, other.host_ports); crate::DeepMerge::merge_from(&mut self.privileged, other.privileged); crate::DeepMerge::merge_from(&mut self.read_only_root_filesystem, other.read_only_root_filesystem); - crate::DeepMerge::merge_from(&mut self.required_drop_capabilities, other.required_drop_capabilities); + crate::merge_strategies::list::atomic(&mut self.required_drop_capabilities, other.required_drop_capabilities); crate::DeepMerge::merge_from(&mut self.run_as_group, other.run_as_group); crate::DeepMerge::merge_from(&mut self.run_as_user, other.run_as_user); crate::DeepMerge::merge_from(&mut self.runtime_class, other.runtime_class); crate::DeepMerge::merge_from(&mut self.se_linux, other.se_linux); crate::DeepMerge::merge_from(&mut self.supplemental_groups, other.supplemental_groups); - crate::DeepMerge::merge_from(&mut self.volumes, other.volumes); + crate::merge_strategies::list::atomic(&mut self.volumes, other.volumes); } } diff --git a/src/v1_23/api/policy/v1beta1/run_as_group_strategy_options.rs b/src/v1_23/api/policy/v1beta1/run_as_group_strategy_options.rs index 89e97b5842..25aa6f1e66 100644 --- a/src/v1_23/api/policy/v1beta1/run_as_group_strategy_options.rs +++ b/src/v1_23/api/policy/v1beta1/run_as_group_strategy_options.rs @@ -12,7 +12,7 @@ pub struct RunAsGroupStrategyOptions { impl crate::DeepMerge for RunAsGroupStrategyOptions { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.ranges, other.ranges); + crate::merge_strategies::list::atomic(&mut self.ranges, other.ranges); crate::DeepMerge::merge_from(&mut self.rule, other.rule); } } diff --git a/src/v1_23/api/policy/v1beta1/run_as_user_strategy_options.rs b/src/v1_23/api/policy/v1beta1/run_as_user_strategy_options.rs index aeeda6f381..a28c259366 100644 --- a/src/v1_23/api/policy/v1beta1/run_as_user_strategy_options.rs +++ b/src/v1_23/api/policy/v1beta1/run_as_user_strategy_options.rs @@ -12,7 +12,7 @@ pub struct RunAsUserStrategyOptions { impl crate::DeepMerge for RunAsUserStrategyOptions { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.ranges, other.ranges); + crate::merge_strategies::list::atomic(&mut self.ranges, other.ranges); crate::DeepMerge::merge_from(&mut self.rule, other.rule); } } diff --git a/src/v1_23/api/policy/v1beta1/runtime_class_strategy_options.rs b/src/v1_23/api/policy/v1beta1/runtime_class_strategy_options.rs index 5f80a6b7e7..085d36d69f 100644 --- a/src/v1_23/api/policy/v1beta1/runtime_class_strategy_options.rs +++ b/src/v1_23/api/policy/v1beta1/runtime_class_strategy_options.rs @@ -12,7 +12,7 @@ pub struct RuntimeClassStrategyOptions { impl crate::DeepMerge for RuntimeClassStrategyOptions { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.allowed_runtime_class_names, other.allowed_runtime_class_names); + crate::merge_strategies::list::atomic(&mut self.allowed_runtime_class_names, other.allowed_runtime_class_names); crate::DeepMerge::merge_from(&mut self.default_runtime_class_name, other.default_runtime_class_name); } } diff --git a/src/v1_23/api/policy/v1beta1/supplemental_groups_strategy_options.rs b/src/v1_23/api/policy/v1beta1/supplemental_groups_strategy_options.rs index 7e83b2e756..4bcc23b7e2 100644 --- a/src/v1_23/api/policy/v1beta1/supplemental_groups_strategy_options.rs +++ b/src/v1_23/api/policy/v1beta1/supplemental_groups_strategy_options.rs @@ -12,7 +12,7 @@ pub struct SupplementalGroupsStrategyOptions { impl crate::DeepMerge for SupplementalGroupsStrategyOptions { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.ranges, other.ranges); + crate::merge_strategies::list::atomic(&mut self.ranges, other.ranges); crate::DeepMerge::merge_from(&mut self.rule, other.rule); } } diff --git a/src/v1_23/api/rbac/v1/aggregation_rule.rs b/src/v1_23/api/rbac/v1/aggregation_rule.rs index 5ccc4984f6..b20ce61705 100644 --- a/src/v1_23/api/rbac/v1/aggregation_rule.rs +++ b/src/v1_23/api/rbac/v1/aggregation_rule.rs @@ -9,7 +9,7 @@ pub struct AggregationRule { impl crate::DeepMerge for AggregationRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.cluster_role_selectors, other.cluster_role_selectors); + crate::merge_strategies::list::atomic(&mut self.cluster_role_selectors, other.cluster_role_selectors); } } diff --git a/src/v1_23/api/rbac/v1/cluster_role.rs b/src/v1_23/api/rbac/v1/cluster_role.rs index 8336e14c92..a6f832b593 100644 --- a/src/v1_23/api/rbac/v1/cluster_role.rs +++ b/src/v1_23/api/rbac/v1/cluster_role.rs @@ -378,7 +378,7 @@ impl crate::DeepMerge for ClusterRole { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.aggregation_rule, other.aggregation_rule); crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.rules, other.rules); + crate::merge_strategies::list::atomic(&mut self.rules, other.rules); } } 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..04fa2bd714 100644 --- a/src/v1_23/api/rbac/v1/cluster_role_binding.rs +++ b/src/v1_23/api/rbac/v1/cluster_role_binding.rs @@ -378,7 +378,7 @@ impl crate::DeepMerge for ClusterRoleBinding { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); crate::DeepMerge::merge_from(&mut self.role_ref, other.role_ref); - crate::DeepMerge::merge_from(&mut self.subjects, other.subjects); + crate::merge_strategies::list::atomic(&mut self.subjects, other.subjects); } } diff --git a/src/v1_23/api/rbac/v1/policy_rule.rs b/src/v1_23/api/rbac/v1/policy_rule.rs index 21bf6df652..24416f2b0f 100644 --- a/src/v1_23/api/rbac/v1/policy_rule.rs +++ b/src/v1_23/api/rbac/v1/policy_rule.rs @@ -21,11 +21,11 @@ pub struct PolicyRule { impl crate::DeepMerge for PolicyRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.api_groups, other.api_groups); - crate::DeepMerge::merge_from(&mut self.non_resource_urls, other.non_resource_urls); - crate::DeepMerge::merge_from(&mut self.resource_names, other.resource_names); - crate::DeepMerge::merge_from(&mut self.resources, other.resources); - crate::DeepMerge::merge_from(&mut self.verbs, other.verbs); + crate::merge_strategies::list::atomic(&mut self.api_groups, other.api_groups); + crate::merge_strategies::list::atomic(&mut self.non_resource_urls, other.non_resource_urls); + crate::merge_strategies::list::atomic(&mut self.resource_names, other.resource_names); + crate::merge_strategies::list::atomic(&mut self.resources, other.resources); + crate::merge_strategies::list::atomic(&mut self.verbs, other.verbs); } } diff --git a/src/v1_23/api/rbac/v1/role.rs b/src/v1_23/api/rbac/v1/role.rs index 9764bc7aa0..719ecb92b0 100644 --- a/src/v1_23/api/rbac/v1/role.rs +++ b/src/v1_23/api/rbac/v1/role.rs @@ -490,7 +490,7 @@ impl crate::Metadata for Role { impl crate::DeepMerge for Role { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.rules, other.rules); + crate::merge_strategies::list::atomic(&mut self.rules, other.rules); } } diff --git a/src/v1_23/api/rbac/v1/role_binding.rs b/src/v1_23/api/rbac/v1/role_binding.rs index ac11e857c2..7b9059076a 100644 --- a/src/v1_23/api/rbac/v1/role_binding.rs +++ b/src/v1_23/api/rbac/v1/role_binding.rs @@ -494,7 +494,7 @@ impl crate::DeepMerge for RoleBinding { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); crate::DeepMerge::merge_from(&mut self.role_ref, other.role_ref); - crate::DeepMerge::merge_from(&mut self.subjects, other.subjects); + crate::merge_strategies::list::atomic(&mut self.subjects, other.subjects); } } diff --git a/src/v1_23/api/storage/v1/csi_driver_spec.rs b/src/v1_23/api/storage/v1/csi_driver_spec.rs index 5d2e77797c..b5fb3267d2 100644 --- a/src/v1_23/api/storage/v1/csi_driver_spec.rs +++ b/src/v1_23/api/storage/v1/csi_driver_spec.rs @@ -63,8 +63,8 @@ impl crate::DeepMerge for CSIDriverSpec { crate::DeepMerge::merge_from(&mut self.pod_info_on_mount, other.pod_info_on_mount); crate::DeepMerge::merge_from(&mut self.requires_republish, other.requires_republish); crate::DeepMerge::merge_from(&mut self.storage_capacity, other.storage_capacity); - crate::DeepMerge::merge_from(&mut self.token_requests, other.token_requests); - crate::DeepMerge::merge_from(&mut self.volume_lifecycle_modes, other.volume_lifecycle_modes); + crate::merge_strategies::list::atomic(&mut self.token_requests, other.token_requests); + crate::merge_strategies::list::set(&mut self.volume_lifecycle_modes, other.volume_lifecycle_modes); } } diff --git a/src/v1_23/api/storage/v1/csi_node_driver.rs b/src/v1_23/api/storage/v1/csi_node_driver.rs index c113299390..d8b79d89f3 100644 --- a/src/v1_23/api/storage/v1/csi_node_driver.rs +++ b/src/v1_23/api/storage/v1/csi_node_driver.rs @@ -21,7 +21,7 @@ impl crate::DeepMerge for CSINodeDriver { crate::DeepMerge::merge_from(&mut self.allocatable, other.allocatable); crate::DeepMerge::merge_from(&mut self.name, other.name); crate::DeepMerge::merge_from(&mut self.node_id, other.node_id); - crate::DeepMerge::merge_from(&mut self.topology_keys, other.topology_keys); + crate::merge_strategies::list::atomic(&mut self.topology_keys, other.topology_keys); } } diff --git a/src/v1_23/api/storage/v1/csi_node_spec.rs b/src/v1_23/api/storage/v1/csi_node_spec.rs index ea2a1ddb97..4717576df8 100644 --- a/src/v1_23/api/storage/v1/csi_node_spec.rs +++ b/src/v1_23/api/storage/v1/csi_node_spec.rs @@ -9,7 +9,14 @@ pub struct CSINodeSpec { impl crate::DeepMerge for CSINodeSpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.drivers, other.drivers); + crate::merge_strategies::list::map( + &mut self.drivers, + other.drivers, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_23/api/storage/v1/storage_class.rs b/src/v1_23/api/storage/v1/storage_class.rs index 2bf8e65456..12774ba320 100644 --- a/src/v1_23/api/storage/v1/storage_class.rs +++ b/src/v1_23/api/storage/v1/storage_class.rs @@ -394,10 +394,12 @@ impl crate::Metadata for StorageClass { impl crate::DeepMerge for StorageClass { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.allow_volume_expansion, other.allow_volume_expansion); - crate::DeepMerge::merge_from(&mut self.allowed_topologies, other.allowed_topologies); + crate::merge_strategies::list::atomic(&mut self.allowed_topologies, other.allowed_topologies); crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.mount_options, other.mount_options); - crate::DeepMerge::merge_from(&mut self.parameters, other.parameters); + crate::merge_strategies::list::atomic(&mut self.mount_options, other.mount_options); + crate::merge_strategies::map::granular(&mut self.parameters, other.parameters, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.provisioner, other.provisioner); crate::DeepMerge::merge_from(&mut self.reclaim_policy, other.reclaim_policy); crate::DeepMerge::merge_from(&mut self.volume_binding_mode, other.volume_binding_mode); diff --git a/src/v1_23/api/storage/v1/volume_attachment_status.rs b/src/v1_23/api/storage/v1/volume_attachment_status.rs index fb8e63d745..bb6ba3fe42 100644 --- a/src/v1_23/api/storage/v1/volume_attachment_status.rs +++ b/src/v1_23/api/storage/v1/volume_attachment_status.rs @@ -20,7 +20,9 @@ impl crate::DeepMerge for VolumeAttachmentStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.attach_error, other.attach_error); crate::DeepMerge::merge_from(&mut self.attached, other.attached); - crate::DeepMerge::merge_from(&mut self.attachment_metadata, other.attachment_metadata); + crate::merge_strategies::map::granular(&mut self.attachment_metadata, other.attachment_metadata, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.detach_error, other.detach_error); } } diff --git a/src/v1_23/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_names.rs b/src/v1_23/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_names.rs index f3a8d38696..d105542807 100644 --- a/src/v1_23/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_names.rs +++ b/src/v1_23/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_names.rs @@ -24,11 +24,11 @@ pub struct CustomResourceDefinitionNames { impl crate::DeepMerge for CustomResourceDefinitionNames { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.categories, other.categories); + crate::merge_strategies::list::atomic(&mut self.categories, other.categories); crate::DeepMerge::merge_from(&mut self.kind, other.kind); crate::DeepMerge::merge_from(&mut self.list_kind, other.list_kind); crate::DeepMerge::merge_from(&mut self.plural, other.plural); - crate::DeepMerge::merge_from(&mut self.short_names, other.short_names); + crate::merge_strategies::list::atomic(&mut self.short_names, other.short_names); crate::DeepMerge::merge_from(&mut self.singular, other.singular); } } diff --git a/src/v1_23/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_spec.rs b/src/v1_23/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_spec.rs index 40ffea9ed1..e3a881e9a4 100644 --- a/src/v1_23/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_spec.rs +++ b/src/v1_23/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_spec.rs @@ -29,7 +29,7 @@ impl crate::DeepMerge for CustomResourceDefinitionSpec { crate::DeepMerge::merge_from(&mut self.names, other.names); crate::DeepMerge::merge_from(&mut self.preserve_unknown_fields, other.preserve_unknown_fields); crate::DeepMerge::merge_from(&mut self.scope, other.scope); - crate::DeepMerge::merge_from(&mut self.versions, other.versions); + crate::merge_strategies::list::atomic(&mut self.versions, other.versions); } } diff --git a/src/v1_23/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_status.rs b/src/v1_23/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_status.rs index a7427347aa..d080a301dc 100644 --- a/src/v1_23/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_status.rs +++ b/src/v1_23/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_status.rs @@ -16,8 +16,15 @@ pub struct CustomResourceDefinitionStatus { impl crate::DeepMerge for CustomResourceDefinitionStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.accepted_names, other.accepted_names); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); - crate::DeepMerge::merge_from(&mut self.stored_versions, other.stored_versions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::list::atomic(&mut self.stored_versions, other.stored_versions); } } diff --git a/src/v1_23/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_version.rs b/src/v1_23/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_version.rs index 5b4d51a697..90a9bb5e32 100644 --- a/src/v1_23/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_version.rs +++ b/src/v1_23/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_version.rs @@ -30,7 +30,7 @@ pub struct CustomResourceDefinitionVersion { impl crate::DeepMerge for CustomResourceDefinitionVersion { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.additional_printer_columns, other.additional_printer_columns); + crate::merge_strategies::list::atomic(&mut self.additional_printer_columns, other.additional_printer_columns); crate::DeepMerge::merge_from(&mut self.deprecated, other.deprecated); crate::DeepMerge::merge_from(&mut self.deprecation_warning, other.deprecation_warning); crate::DeepMerge::merge_from(&mut self.name, other.name); diff --git a/src/v1_23/apiextensions_apiserver/pkg/apis/apiextensions/v1/json_schema_props.rs b/src/v1_23/apiextensions_apiserver/pkg/apis/apiextensions/v1/json_schema_props.rs index 3c8b45d0b0..a871ebe8a6 100644 --- a/src/v1_23/apiextensions_apiserver/pkg/apis/apiextensions/v1/json_schema_props.rs +++ b/src/v1_23/apiextensions_apiserver/pkg/apis/apiextensions/v1/json_schema_props.rs @@ -142,13 +142,17 @@ impl crate::DeepMerge for JSONSchemaProps { crate::DeepMerge::merge_from(&mut self.schema, other.schema); crate::DeepMerge::merge_from(&mut self.additional_items, other.additional_items); crate::DeepMerge::merge_from(&mut self.additional_properties, other.additional_properties); - crate::DeepMerge::merge_from(&mut self.all_of, other.all_of); - crate::DeepMerge::merge_from(&mut self.any_of, other.any_of); + crate::merge_strategies::list::atomic(&mut self.all_of, other.all_of); + crate::merge_strategies::list::atomic(&mut self.any_of, other.any_of); crate::DeepMerge::merge_from(&mut self.default, other.default); - crate::DeepMerge::merge_from(&mut self.definitions, other.definitions); - crate::DeepMerge::merge_from(&mut self.dependencies, other.dependencies); + crate::merge_strategies::map::granular(&mut self.definitions, other.definitions, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.dependencies, other.dependencies, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.description, other.description); - crate::DeepMerge::merge_from(&mut self.enum_, other.enum_); + crate::merge_strategies::list::atomic(&mut self.enum_, other.enum_); crate::DeepMerge::merge_from(&mut self.example, other.example); crate::DeepMerge::merge_from(&mut self.exclusive_maximum, other.exclusive_maximum); crate::DeepMerge::merge_from(&mut self.exclusive_minimum, other.exclusive_minimum); @@ -167,21 +171,32 @@ impl crate::DeepMerge for JSONSchemaProps { crate::DeepMerge::merge_from(&mut self.multiple_of, other.multiple_of); crate::DeepMerge::merge_from(&mut self.not, other.not); crate::DeepMerge::merge_from(&mut self.nullable, other.nullable); - crate::DeepMerge::merge_from(&mut self.one_of, other.one_of); + crate::merge_strategies::list::atomic(&mut self.one_of, other.one_of); crate::DeepMerge::merge_from(&mut self.pattern, other.pattern); - crate::DeepMerge::merge_from(&mut self.pattern_properties, other.pattern_properties); - crate::DeepMerge::merge_from(&mut self.properties, other.properties); - crate::DeepMerge::merge_from(&mut self.required, other.required); + crate::merge_strategies::map::granular(&mut self.pattern_properties, other.pattern_properties, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.properties, other.properties, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::list::atomic(&mut self.required, other.required); crate::DeepMerge::merge_from(&mut self.title, other.title); crate::DeepMerge::merge_from(&mut self.type_, other.type_); crate::DeepMerge::merge_from(&mut self.unique_items, other.unique_items); crate::DeepMerge::merge_from(&mut self.x_kubernetes_embedded_resource, other.x_kubernetes_embedded_resource); crate::DeepMerge::merge_from(&mut self.x_kubernetes_int_or_string, other.x_kubernetes_int_or_string); - crate::DeepMerge::merge_from(&mut self.x_kubernetes_list_map_keys, other.x_kubernetes_list_map_keys); + crate::merge_strategies::list::atomic(&mut self.x_kubernetes_list_map_keys, other.x_kubernetes_list_map_keys); crate::DeepMerge::merge_from(&mut self.x_kubernetes_list_type, other.x_kubernetes_list_type); crate::DeepMerge::merge_from(&mut self.x_kubernetes_map_type, other.x_kubernetes_map_type); crate::DeepMerge::merge_from(&mut self.x_kubernetes_preserve_unknown_fields, other.x_kubernetes_preserve_unknown_fields); - crate::DeepMerge::merge_from(&mut self.x_kubernetes_validations, other.x_kubernetes_validations); + crate::merge_strategies::list::map( + &mut self.x_kubernetes_validations, + other.x_kubernetes_validations, + &[|lhs, rhs| lhs.rule == rhs.rule], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_23/apiextensions_apiserver/pkg/apis/apiextensions/v1/webhook_conversion.rs b/src/v1_23/apiextensions_apiserver/pkg/apis/apiextensions/v1/webhook_conversion.rs index aec75dfd39..69008b2dca 100644 --- a/src/v1_23/apiextensions_apiserver/pkg/apis/apiextensions/v1/webhook_conversion.rs +++ b/src/v1_23/apiextensions_apiserver/pkg/apis/apiextensions/v1/webhook_conversion.rs @@ -13,7 +13,7 @@ pub struct WebhookConversion { impl crate::DeepMerge for WebhookConversion { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.client_config, other.client_config); - crate::DeepMerge::merge_from(&mut self.conversion_review_versions, other.conversion_review_versions); + crate::merge_strategies::list::atomic(&mut self.conversion_review_versions, other.conversion_review_versions); } } diff --git a/src/v1_23/apimachinery/pkg/apis/meta/v1/api_group.rs b/src/v1_23/apimachinery/pkg/apis/meta/v1/api_group.rs index 3d36440e87..f83318ab08 100644 --- a/src/v1_23/apimachinery/pkg/apis/meta/v1/api_group.rs +++ b/src/v1_23/apimachinery/pkg/apis/meta/v1/api_group.rs @@ -29,8 +29,8 @@ impl crate::DeepMerge for APIGroup { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.name, other.name); crate::DeepMerge::merge_from(&mut self.preferred_version, other.preferred_version); - crate::DeepMerge::merge_from(&mut self.server_address_by_client_cidrs, other.server_address_by_client_cidrs); - crate::DeepMerge::merge_from(&mut self.versions, other.versions); + crate::merge_strategies::list::atomic(&mut self.server_address_by_client_cidrs, other.server_address_by_client_cidrs); + crate::merge_strategies::list::atomic(&mut self.versions, other.versions); } } diff --git a/src/v1_23/apimachinery/pkg/apis/meta/v1/api_group_list.rs b/src/v1_23/apimachinery/pkg/apis/meta/v1/api_group_list.rs index 167aeeabe0..e8a5d7e747 100644 --- a/src/v1_23/apimachinery/pkg/apis/meta/v1/api_group_list.rs +++ b/src/v1_23/apimachinery/pkg/apis/meta/v1/api_group_list.rs @@ -18,7 +18,7 @@ impl crate::Resource for APIGroupList { impl crate::DeepMerge for APIGroupList { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.groups, other.groups); + crate::merge_strategies::list::atomic(&mut self.groups, other.groups); } } diff --git a/src/v1_23/apimachinery/pkg/apis/meta/v1/api_resource.rs b/src/v1_23/apimachinery/pkg/apis/meta/v1/api_resource.rs index e679e8aa73..477c5ad98d 100644 --- a/src/v1_23/apimachinery/pkg/apis/meta/v1/api_resource.rs +++ b/src/v1_23/apimachinery/pkg/apis/meta/v1/api_resource.rs @@ -36,15 +36,15 @@ pub struct APIResource { impl crate::DeepMerge for APIResource { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.categories, other.categories); + crate::merge_strategies::list::atomic(&mut self.categories, other.categories); crate::DeepMerge::merge_from(&mut self.group, other.group); crate::DeepMerge::merge_from(&mut self.kind, other.kind); crate::DeepMerge::merge_from(&mut self.name, other.name); crate::DeepMerge::merge_from(&mut self.namespaced, other.namespaced); - crate::DeepMerge::merge_from(&mut self.short_names, other.short_names); + crate::merge_strategies::list::atomic(&mut self.short_names, other.short_names); crate::DeepMerge::merge_from(&mut self.singular_name, other.singular_name); crate::DeepMerge::merge_from(&mut self.storage_version_hash, other.storage_version_hash); - crate::DeepMerge::merge_from(&mut self.verbs, other.verbs); + crate::merge_strategies::list::atomic(&mut self.verbs, other.verbs); crate::DeepMerge::merge_from(&mut self.version, other.version); } } diff --git a/src/v1_23/apimachinery/pkg/apis/meta/v1/api_resource_list.rs b/src/v1_23/apimachinery/pkg/apis/meta/v1/api_resource_list.rs index a34ba733a3..4107b4f488 100644 --- a/src/v1_23/apimachinery/pkg/apis/meta/v1/api_resource_list.rs +++ b/src/v1_23/apimachinery/pkg/apis/meta/v1/api_resource_list.rs @@ -22,7 +22,7 @@ impl crate::Resource for APIResourceList { impl crate::DeepMerge for APIResourceList { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.group_version, other.group_version); - crate::DeepMerge::merge_from(&mut self.resources, other.resources); + crate::merge_strategies::list::atomic(&mut self.resources, other.resources); } } diff --git a/src/v1_23/apimachinery/pkg/apis/meta/v1/api_versions.rs b/src/v1_23/apimachinery/pkg/apis/meta/v1/api_versions.rs index a2d355ee8d..eda4a89785 100644 --- a/src/v1_23/apimachinery/pkg/apis/meta/v1/api_versions.rs +++ b/src/v1_23/apimachinery/pkg/apis/meta/v1/api_versions.rs @@ -21,8 +21,8 @@ impl crate::Resource for APIVersions { impl crate::DeepMerge for APIVersions { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.server_address_by_client_cidrs, other.server_address_by_client_cidrs); - crate::DeepMerge::merge_from(&mut self.versions, other.versions); + crate::merge_strategies::list::atomic(&mut self.server_address_by_client_cidrs, other.server_address_by_client_cidrs); + crate::merge_strategies::list::atomic(&mut self.versions, other.versions); } } diff --git a/src/v1_23/apimachinery/pkg/apis/meta/v1/delete_options.rs b/src/v1_23/apimachinery/pkg/apis/meta/v1/delete_options.rs index 04abc8215b..4ac6d24fb9 100644 --- a/src/v1_23/apimachinery/pkg/apis/meta/v1/delete_options.rs +++ b/src/v1_23/apimachinery/pkg/apis/meta/v1/delete_options.rs @@ -28,7 +28,7 @@ pub struct DeleteOptions { impl crate::DeepMerge for DeleteOptions { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.api_version, other.api_version); - crate::DeepMerge::merge_from(&mut self.dry_run, other.dry_run); + crate::merge_strategies::list::atomic(&mut self.dry_run, other.dry_run); crate::DeepMerge::merge_from(&mut self.grace_period_seconds, other.grace_period_seconds); crate::DeepMerge::merge_from(&mut self.kind, other.kind); crate::DeepMerge::merge_from(&mut self.orphan_dependents, other.orphan_dependents); diff --git a/src/v1_23/apimachinery/pkg/apis/meta/v1/label_selector.rs b/src/v1_23/apimachinery/pkg/apis/meta/v1/label_selector.rs index 877caad4dd..19028abb99 100644 --- a/src/v1_23/apimachinery/pkg/apis/meta/v1/label_selector.rs +++ b/src/v1_23/apimachinery/pkg/apis/meta/v1/label_selector.rs @@ -12,8 +12,10 @@ pub struct LabelSelector { impl crate::DeepMerge for LabelSelector { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.match_expressions, other.match_expressions); - crate::DeepMerge::merge_from(&mut self.match_labels, other.match_labels); + crate::merge_strategies::list::atomic(&mut self.match_expressions, other.match_expressions); + crate::merge_strategies::map::granular(&mut self.match_labels, other.match_labels, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); } } diff --git a/src/v1_23/apimachinery/pkg/apis/meta/v1/label_selector_requirement.rs b/src/v1_23/apimachinery/pkg/apis/meta/v1/label_selector_requirement.rs index 6570daea42..09c7dc7cc7 100644 --- a/src/v1_23/apimachinery/pkg/apis/meta/v1/label_selector_requirement.rs +++ b/src/v1_23/apimachinery/pkg/apis/meta/v1/label_selector_requirement.rs @@ -17,7 +17,7 @@ impl crate::DeepMerge for LabelSelectorRequirement { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.key, other.key); crate::DeepMerge::merge_from(&mut self.operator, other.operator); - crate::DeepMerge::merge_from(&mut self.values, other.values); + crate::merge_strategies::list::atomic(&mut self.values, other.values); } } 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..b1d8a3ec0d 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 @@ -70,19 +70,30 @@ pub struct ObjectMeta { impl crate::DeepMerge for ObjectMeta { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.annotations, other.annotations); + crate::merge_strategies::map::granular(&mut self.annotations, other.annotations, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); 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::merge_strategies::list::set(&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::merge_strategies::map::granular(&mut self.labels, other.labels, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::list::atomic(&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::merge_strategies::list::map( + &mut self.owner_references, + other.owner_references, + &[|lhs, rhs| lhs.uid == rhs.uid], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); 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); diff --git a/src/v1_23/apimachinery/pkg/apis/meta/v1/status_details.rs b/src/v1_23/apimachinery/pkg/apis/meta/v1/status_details.rs index 183b525d2c..28141f7f6f 100644 --- a/src/v1_23/apimachinery/pkg/apis/meta/v1/status_details.rs +++ b/src/v1_23/apimachinery/pkg/apis/meta/v1/status_details.rs @@ -24,7 +24,7 @@ pub struct StatusDetails { impl crate::DeepMerge for StatusDetails { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.causes, other.causes); + crate::merge_strategies::list::atomic(&mut self.causes, other.causes); crate::DeepMerge::merge_from(&mut self.group, other.group); crate::DeepMerge::merge_from(&mut self.kind, other.kind); crate::DeepMerge::merge_from(&mut self.name, other.name); diff --git a/src/v1_23/kube_aggregator/pkg/apis/apiregistration/v1/api_service_status.rs b/src/v1_23/kube_aggregator/pkg/apis/apiregistration/v1/api_service_status.rs index 658b6ca9ce..72a107b6ba 100644 --- a/src/v1_23/kube_aggregator/pkg/apis/apiregistration/v1/api_service_status.rs +++ b/src/v1_23/kube_aggregator/pkg/apis/apiregistration/v1/api_service_status.rs @@ -9,7 +9,14 @@ pub struct APIServiceStatus { impl crate::DeepMerge for APIServiceStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_23/list.rs b/src/v1_23/list.rs index cc10bf672f..9863ef1855 100644 --- a/src/v1_23/list.rs +++ b/src/v1_23/list.rs @@ -31,9 +31,16 @@ impl crate::Metadata for List where T: crate::ListableResource { } } -impl crate::DeepMerge for List where T: crate::ListableResource { +impl crate::DeepMerge for List where T: crate::DeepMerge + crate::Metadata + crate::ListableResource { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.items, other.items); + crate::merge_strategies::list::map( + &mut self.items, + other.items, + &[|lhs, rhs| lhs.metadata().namespace == rhs.metadata().namespace, |lhs, rhs| lhs.metadata().name == rhs.metadata().name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); } } diff --git a/src/v1_24/api/admissionregistration/v1/mutating_webhook.rs b/src/v1_24/api/admissionregistration/v1/mutating_webhook.rs index 5b1a4d833f..783200c537 100644 --- a/src/v1_24/api/admissionregistration/v1/mutating_webhook.rs +++ b/src/v1_24/api/admissionregistration/v1/mutating_webhook.rs @@ -81,7 +81,7 @@ pub struct MutatingWebhook { impl crate::DeepMerge for MutatingWebhook { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.admission_review_versions, other.admission_review_versions); + crate::merge_strategies::list::atomic(&mut self.admission_review_versions, other.admission_review_versions); crate::DeepMerge::merge_from(&mut self.client_config, other.client_config); crate::DeepMerge::merge_from(&mut self.failure_policy, other.failure_policy); crate::DeepMerge::merge_from(&mut self.match_policy, other.match_policy); @@ -89,7 +89,7 @@ impl crate::DeepMerge for MutatingWebhook { crate::DeepMerge::merge_from(&mut self.namespace_selector, other.namespace_selector); crate::DeepMerge::merge_from(&mut self.object_selector, other.object_selector); crate::DeepMerge::merge_from(&mut self.reinvocation_policy, other.reinvocation_policy); - crate::DeepMerge::merge_from(&mut self.rules, other.rules); + crate::merge_strategies::list::atomic(&mut self.rules, other.rules); crate::DeepMerge::merge_from(&mut self.side_effects, other.side_effects); crate::DeepMerge::merge_from(&mut self.timeout_seconds, other.timeout_seconds); } 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..156c7ccfcf 100644 --- a/src/v1_24/api/admissionregistration/v1/mutating_webhook_configuration.rs +++ b/src/v1_24/api/admissionregistration/v1/mutating_webhook_configuration.rs @@ -374,7 +374,14 @@ impl crate::Metadata for MutatingWebhookConfiguration { impl crate::DeepMerge for MutatingWebhookConfiguration { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.webhooks, other.webhooks); + crate::merge_strategies::list::map( + &mut self.webhooks, + other.webhooks, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_24/api/admissionregistration/v1/rule_with_operations.rs b/src/v1_24/api/admissionregistration/v1/rule_with_operations.rs index c45c425c57..441b9ab3fd 100644 --- a/src/v1_24/api/admissionregistration/v1/rule_with_operations.rs +++ b/src/v1_24/api/admissionregistration/v1/rule_with_operations.rs @@ -27,10 +27,10 @@ pub struct RuleWithOperations { impl crate::DeepMerge for RuleWithOperations { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.api_groups, other.api_groups); - crate::DeepMerge::merge_from(&mut self.api_versions, other.api_versions); - crate::DeepMerge::merge_from(&mut self.operations, other.operations); - crate::DeepMerge::merge_from(&mut self.resources, other.resources); + crate::merge_strategies::list::atomic(&mut self.api_groups, other.api_groups); + crate::merge_strategies::list::atomic(&mut self.api_versions, other.api_versions); + crate::merge_strategies::list::atomic(&mut self.operations, other.operations); + crate::merge_strategies::list::atomic(&mut self.resources, other.resources); crate::DeepMerge::merge_from(&mut self.scope, other.scope); } } diff --git a/src/v1_24/api/admissionregistration/v1/validating_webhook.rs b/src/v1_24/api/admissionregistration/v1/validating_webhook.rs index 1a64d4e885..e594176265 100644 --- a/src/v1_24/api/admissionregistration/v1/validating_webhook.rs +++ b/src/v1_24/api/admissionregistration/v1/validating_webhook.rs @@ -72,14 +72,14 @@ pub struct ValidatingWebhook { impl crate::DeepMerge for ValidatingWebhook { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.admission_review_versions, other.admission_review_versions); + crate::merge_strategies::list::atomic(&mut self.admission_review_versions, other.admission_review_versions); crate::DeepMerge::merge_from(&mut self.client_config, other.client_config); crate::DeepMerge::merge_from(&mut self.failure_policy, other.failure_policy); crate::DeepMerge::merge_from(&mut self.match_policy, other.match_policy); crate::DeepMerge::merge_from(&mut self.name, other.name); crate::DeepMerge::merge_from(&mut self.namespace_selector, other.namespace_selector); crate::DeepMerge::merge_from(&mut self.object_selector, other.object_selector); - crate::DeepMerge::merge_from(&mut self.rules, other.rules); + crate::merge_strategies::list::atomic(&mut self.rules, other.rules); crate::DeepMerge::merge_from(&mut self.side_effects, other.side_effects); crate::DeepMerge::merge_from(&mut self.timeout_seconds, other.timeout_seconds); } 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..ff20990424 100644 --- a/src/v1_24/api/admissionregistration/v1/validating_webhook_configuration.rs +++ b/src/v1_24/api/admissionregistration/v1/validating_webhook_configuration.rs @@ -374,7 +374,14 @@ impl crate::Metadata for ValidatingWebhookConfiguration { impl crate::DeepMerge for ValidatingWebhookConfiguration { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.webhooks, other.webhooks); + crate::merge_strategies::list::map( + &mut self.webhooks, + other.webhooks, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_24/api/apiserverinternal/v1alpha1/server_storage_version.rs b/src/v1_24/api/apiserverinternal/v1alpha1/server_storage_version.rs index 1040b5e6d7..5a693d9e59 100644 --- a/src/v1_24/api/apiserverinternal/v1alpha1/server_storage_version.rs +++ b/src/v1_24/api/apiserverinternal/v1alpha1/server_storage_version.rs @@ -16,7 +16,7 @@ pub struct ServerStorageVersion { impl crate::DeepMerge for ServerStorageVersion { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.api_server_id, other.api_server_id); - crate::DeepMerge::merge_from(&mut self.decodable_versions, other.decodable_versions); + crate::merge_strategies::list::set(&mut self.decodable_versions, other.decodable_versions); crate::DeepMerge::merge_from(&mut self.encoding_version, other.encoding_version); } } diff --git a/src/v1_24/api/apiserverinternal/v1alpha1/storage_version_status.rs b/src/v1_24/api/apiserverinternal/v1alpha1/storage_version_status.rs index e63b469644..0d5b9bd3a1 100644 --- a/src/v1_24/api/apiserverinternal/v1alpha1/storage_version_status.rs +++ b/src/v1_24/api/apiserverinternal/v1alpha1/storage_version_status.rs @@ -16,8 +16,22 @@ pub struct StorageVersionStatus { impl crate::DeepMerge for StorageVersionStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.common_encoding_version, other.common_encoding_version); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); - crate::DeepMerge::merge_from(&mut self.storage_versions, other.storage_versions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::list::map( + &mut self.storage_versions, + other.storage_versions, + &[|lhs, rhs| lhs.api_server_id == rhs.api_server_id], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_24/api/apps/v1/daemon_set_status.rs b/src/v1_24/api/apps/v1/daemon_set_status.rs index 278caf879c..345f5eb651 100644 --- a/src/v1_24/api/apps/v1/daemon_set_status.rs +++ b/src/v1_24/api/apps/v1/daemon_set_status.rs @@ -37,7 +37,14 @@ pub struct DaemonSetStatus { impl crate::DeepMerge for DaemonSetStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.collision_count, other.collision_count); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.current_number_scheduled, other.current_number_scheduled); crate::DeepMerge::merge_from(&mut self.desired_number_scheduled, other.desired_number_scheduled); crate::DeepMerge::merge_from(&mut self.number_available, other.number_available); diff --git a/src/v1_24/api/apps/v1/deployment_status.rs b/src/v1_24/api/apps/v1/deployment_status.rs index 01ff5c75e4..ee140e108a 100644 --- a/src/v1_24/api/apps/v1/deployment_status.rs +++ b/src/v1_24/api/apps/v1/deployment_status.rs @@ -32,7 +32,14 @@ impl crate::DeepMerge for DeploymentStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.available_replicas, other.available_replicas); crate::DeepMerge::merge_from(&mut self.collision_count, other.collision_count); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.observed_generation, other.observed_generation); crate::DeepMerge::merge_from(&mut self.ready_replicas, other.ready_replicas); crate::DeepMerge::merge_from(&mut self.replicas, other.replicas); diff --git a/src/v1_24/api/apps/v1/replica_set_status.rs b/src/v1_24/api/apps/v1/replica_set_status.rs index 6b5b45e35f..1b47aa5a70 100644 --- a/src/v1_24/api/apps/v1/replica_set_status.rs +++ b/src/v1_24/api/apps/v1/replica_set_status.rs @@ -25,7 +25,14 @@ pub struct ReplicaSetStatus { impl crate::DeepMerge for ReplicaSetStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.available_replicas, other.available_replicas); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.fully_labeled_replicas, other.fully_labeled_replicas); crate::DeepMerge::merge_from(&mut self.observed_generation, other.observed_generation); crate::DeepMerge::merge_from(&mut self.ready_replicas, other.ready_replicas); diff --git a/src/v1_24/api/apps/v1/stateful_set_spec.rs b/src/v1_24/api/apps/v1/stateful_set_spec.rs index cc5ac5c977..4ffc843296 100644 --- a/src/v1_24/api/apps/v1/stateful_set_spec.rs +++ b/src/v1_24/api/apps/v1/stateful_set_spec.rs @@ -46,7 +46,7 @@ impl crate::DeepMerge for StatefulSetSpec { crate::DeepMerge::merge_from(&mut self.service_name, other.service_name); crate::DeepMerge::merge_from(&mut self.template, other.template); crate::DeepMerge::merge_from(&mut self.update_strategy, other.update_strategy); - crate::DeepMerge::merge_from(&mut self.volume_claim_templates, other.volume_claim_templates); + crate::merge_strategies::list::atomic(&mut self.volume_claim_templates, other.volume_claim_templates); } } diff --git a/src/v1_24/api/apps/v1/stateful_set_status.rs b/src/v1_24/api/apps/v1/stateful_set_status.rs index 62db4e3163..080282cc76 100644 --- a/src/v1_24/api/apps/v1/stateful_set_status.rs +++ b/src/v1_24/api/apps/v1/stateful_set_status.rs @@ -38,7 +38,14 @@ impl crate::DeepMerge for StatefulSetStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.available_replicas, other.available_replicas); crate::DeepMerge::merge_from(&mut self.collision_count, other.collision_count); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.current_replicas, other.current_replicas); crate::DeepMerge::merge_from(&mut self.current_revision, other.current_revision); crate::DeepMerge::merge_from(&mut self.observed_generation, other.observed_generation); diff --git a/src/v1_24/api/authentication/v1/token_request_spec.rs b/src/v1_24/api/authentication/v1/token_request_spec.rs index 4ec786f381..f10197a68c 100644 --- a/src/v1_24/api/authentication/v1/token_request_spec.rs +++ b/src/v1_24/api/authentication/v1/token_request_spec.rs @@ -15,7 +15,7 @@ pub struct TokenRequestSpec { impl crate::DeepMerge for TokenRequestSpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.audiences, other.audiences); + crate::merge_strategies::list::atomic(&mut self.audiences, other.audiences); crate::DeepMerge::merge_from(&mut self.bound_object_ref, other.bound_object_ref); crate::DeepMerge::merge_from(&mut self.expiration_seconds, other.expiration_seconds); } diff --git a/src/v1_24/api/authentication/v1/token_review_spec.rs b/src/v1_24/api/authentication/v1/token_review_spec.rs index fd84653924..281127b67d 100644 --- a/src/v1_24/api/authentication/v1/token_review_spec.rs +++ b/src/v1_24/api/authentication/v1/token_review_spec.rs @@ -12,7 +12,7 @@ pub struct TokenReviewSpec { impl crate::DeepMerge for TokenReviewSpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.audiences, other.audiences); + crate::merge_strategies::list::atomic(&mut self.audiences, other.audiences); crate::DeepMerge::merge_from(&mut self.token, other.token); } } diff --git a/src/v1_24/api/authentication/v1/token_review_status.rs b/src/v1_24/api/authentication/v1/token_review_status.rs index 464164bcf9..4dd5aacc3d 100644 --- a/src/v1_24/api/authentication/v1/token_review_status.rs +++ b/src/v1_24/api/authentication/v1/token_review_status.rs @@ -18,7 +18,7 @@ pub struct TokenReviewStatus { impl crate::DeepMerge for TokenReviewStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.audiences, other.audiences); + crate::merge_strategies::list::atomic(&mut self.audiences, other.audiences); crate::DeepMerge::merge_from(&mut self.authenticated, other.authenticated); crate::DeepMerge::merge_from(&mut self.error, other.error); crate::DeepMerge::merge_from(&mut self.user, other.user); diff --git a/src/v1_24/api/authentication/v1/user_info.rs b/src/v1_24/api/authentication/v1/user_info.rs index d6890119b7..3890788cda 100644 --- a/src/v1_24/api/authentication/v1/user_info.rs +++ b/src/v1_24/api/authentication/v1/user_info.rs @@ -18,8 +18,10 @@ pub struct UserInfo { impl crate::DeepMerge for UserInfo { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.extra, other.extra); - crate::DeepMerge::merge_from(&mut self.groups, other.groups); + crate::merge_strategies::map::granular(&mut self.extra, other.extra, |current_item, other_item| { + crate::merge_strategies::list::atomic(current_item, other_item); + }); + crate::merge_strategies::list::atomic(&mut self.groups, other.groups); crate::DeepMerge::merge_from(&mut self.uid, other.uid); crate::DeepMerge::merge_from(&mut self.username, other.username); } diff --git a/src/v1_24/api/authorization/v1/non_resource_rule.rs b/src/v1_24/api/authorization/v1/non_resource_rule.rs index 7df269ffd7..db780454b8 100644 --- a/src/v1_24/api/authorization/v1/non_resource_rule.rs +++ b/src/v1_24/api/authorization/v1/non_resource_rule.rs @@ -12,8 +12,8 @@ pub struct NonResourceRule { impl crate::DeepMerge for NonResourceRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.non_resource_urls, other.non_resource_urls); - crate::DeepMerge::merge_from(&mut self.verbs, other.verbs); + crate::merge_strategies::list::atomic(&mut self.non_resource_urls, other.non_resource_urls); + crate::merge_strategies::list::atomic(&mut self.verbs, other.verbs); } } diff --git a/src/v1_24/api/authorization/v1/resource_rule.rs b/src/v1_24/api/authorization/v1/resource_rule.rs index 58b5e020a8..1af9333654 100644 --- a/src/v1_24/api/authorization/v1/resource_rule.rs +++ b/src/v1_24/api/authorization/v1/resource_rule.rs @@ -19,10 +19,10 @@ pub struct ResourceRule { impl crate::DeepMerge for ResourceRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.api_groups, other.api_groups); - crate::DeepMerge::merge_from(&mut self.resource_names, other.resource_names); - crate::DeepMerge::merge_from(&mut self.resources, other.resources); - crate::DeepMerge::merge_from(&mut self.verbs, other.verbs); + crate::merge_strategies::list::atomic(&mut self.api_groups, other.api_groups); + crate::merge_strategies::list::atomic(&mut self.resource_names, other.resource_names); + crate::merge_strategies::list::atomic(&mut self.resources, other.resources); + crate::merge_strategies::list::atomic(&mut self.verbs, other.verbs); } } diff --git a/src/v1_24/api/authorization/v1/subject_access_review_spec.rs b/src/v1_24/api/authorization/v1/subject_access_review_spec.rs index ae8fadafd9..a4c4af18ce 100644 --- a/src/v1_24/api/authorization/v1/subject_access_review_spec.rs +++ b/src/v1_24/api/authorization/v1/subject_access_review_spec.rs @@ -24,8 +24,10 @@ pub struct SubjectAccessReviewSpec { impl crate::DeepMerge for SubjectAccessReviewSpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.extra, other.extra); - crate::DeepMerge::merge_from(&mut self.groups, other.groups); + crate::merge_strategies::map::granular(&mut self.extra, other.extra, |current_item, other_item| { + crate::merge_strategies::list::atomic(current_item, other_item); + }); + crate::merge_strategies::list::atomic(&mut self.groups, other.groups); crate::DeepMerge::merge_from(&mut self.non_resource_attributes, other.non_resource_attributes); crate::DeepMerge::merge_from(&mut self.resource_attributes, other.resource_attributes); crate::DeepMerge::merge_from(&mut self.uid, other.uid); diff --git a/src/v1_24/api/authorization/v1/subject_rules_review_status.rs b/src/v1_24/api/authorization/v1/subject_rules_review_status.rs index 9d7fb042cf..9d1682a3c8 100644 --- a/src/v1_24/api/authorization/v1/subject_rules_review_status.rs +++ b/src/v1_24/api/authorization/v1/subject_rules_review_status.rs @@ -20,8 +20,8 @@ impl crate::DeepMerge for SubjectRulesReviewStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.evaluation_error, other.evaluation_error); crate::DeepMerge::merge_from(&mut self.incomplete, other.incomplete); - crate::DeepMerge::merge_from(&mut self.non_resource_rules, other.non_resource_rules); - crate::DeepMerge::merge_from(&mut self.resource_rules, other.resource_rules); + crate::merge_strategies::list::atomic(&mut self.non_resource_rules, other.non_resource_rules); + crate::merge_strategies::list::atomic(&mut self.resource_rules, other.resource_rules); } } diff --git a/src/v1_24/api/autoscaling/v2/horizontal_pod_autoscaler_spec.rs b/src/v1_24/api/autoscaling/v2/horizontal_pod_autoscaler_spec.rs index 90ea12126f..1aaf3eb861 100644 --- a/src/v1_24/api/autoscaling/v2/horizontal_pod_autoscaler_spec.rs +++ b/src/v1_24/api/autoscaling/v2/horizontal_pod_autoscaler_spec.rs @@ -23,7 +23,7 @@ impl crate::DeepMerge for HorizontalPodAutoscalerSpec { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.behavior, other.behavior); crate::DeepMerge::merge_from(&mut self.max_replicas, other.max_replicas); - crate::DeepMerge::merge_from(&mut self.metrics, other.metrics); + crate::merge_strategies::list::atomic(&mut self.metrics, other.metrics); crate::DeepMerge::merge_from(&mut self.min_replicas, other.min_replicas); crate::DeepMerge::merge_from(&mut self.scale_target_ref, other.scale_target_ref); } diff --git a/src/v1_24/api/autoscaling/v2/horizontal_pod_autoscaler_status.rs b/src/v1_24/api/autoscaling/v2/horizontal_pod_autoscaler_status.rs index bfb877a856..c4b24efd7f 100644 --- a/src/v1_24/api/autoscaling/v2/horizontal_pod_autoscaler_status.rs +++ b/src/v1_24/api/autoscaling/v2/horizontal_pod_autoscaler_status.rs @@ -24,8 +24,15 @@ pub struct HorizontalPodAutoscalerStatus { impl crate::DeepMerge for HorizontalPodAutoscalerStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); - crate::DeepMerge::merge_from(&mut self.current_metrics, other.current_metrics); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::list::atomic(&mut self.current_metrics, other.current_metrics); crate::DeepMerge::merge_from(&mut self.current_replicas, other.current_replicas); crate::DeepMerge::merge_from(&mut self.desired_replicas, other.desired_replicas); crate::DeepMerge::merge_from(&mut self.last_scale_time, other.last_scale_time); diff --git a/src/v1_24/api/autoscaling/v2/hpa_scaling_rules.rs b/src/v1_24/api/autoscaling/v2/hpa_scaling_rules.rs index 0b0dc2c81d..195201e286 100644 --- a/src/v1_24/api/autoscaling/v2/hpa_scaling_rules.rs +++ b/src/v1_24/api/autoscaling/v2/hpa_scaling_rules.rs @@ -15,7 +15,7 @@ pub struct HPAScalingRules { impl crate::DeepMerge for HPAScalingRules { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.policies, other.policies); + crate::merge_strategies::list::atomic(&mut self.policies, other.policies); crate::DeepMerge::merge_from(&mut self.select_policy, other.select_policy); crate::DeepMerge::merge_from(&mut self.stabilization_window_seconds, other.stabilization_window_seconds); } diff --git a/src/v1_24/api/autoscaling/v2beta1/horizontal_pod_autoscaler_spec.rs b/src/v1_24/api/autoscaling/v2beta1/horizontal_pod_autoscaler_spec.rs index dd2649f83e..c286723a24 100644 --- a/src/v1_24/api/autoscaling/v2beta1/horizontal_pod_autoscaler_spec.rs +++ b/src/v1_24/api/autoscaling/v2beta1/horizontal_pod_autoscaler_spec.rs @@ -19,7 +19,7 @@ pub struct HorizontalPodAutoscalerSpec { impl crate::DeepMerge for HorizontalPodAutoscalerSpec { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.max_replicas, other.max_replicas); - crate::DeepMerge::merge_from(&mut self.metrics, other.metrics); + crate::merge_strategies::list::atomic(&mut self.metrics, other.metrics); crate::DeepMerge::merge_from(&mut self.min_replicas, other.min_replicas); crate::DeepMerge::merge_from(&mut self.scale_target_ref, other.scale_target_ref); } diff --git a/src/v1_24/api/autoscaling/v2beta1/horizontal_pod_autoscaler_status.rs b/src/v1_24/api/autoscaling/v2beta1/horizontal_pod_autoscaler_status.rs index e54b847816..1cc4f4fdfa 100644 --- a/src/v1_24/api/autoscaling/v2beta1/horizontal_pod_autoscaler_status.rs +++ b/src/v1_24/api/autoscaling/v2beta1/horizontal_pod_autoscaler_status.rs @@ -24,8 +24,8 @@ pub struct HorizontalPodAutoscalerStatus { impl crate::DeepMerge for HorizontalPodAutoscalerStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); - crate::DeepMerge::merge_from(&mut self.current_metrics, other.current_metrics); + crate::merge_strategies::list::atomic(&mut self.conditions, other.conditions); + crate::merge_strategies::list::atomic(&mut self.current_metrics, other.current_metrics); crate::DeepMerge::merge_from(&mut self.current_replicas, other.current_replicas); crate::DeepMerge::merge_from(&mut self.desired_replicas, other.desired_replicas); crate::DeepMerge::merge_from(&mut self.last_scale_time, other.last_scale_time); diff --git a/src/v1_24/api/autoscaling/v2beta2/horizontal_pod_autoscaler_spec.rs b/src/v1_24/api/autoscaling/v2beta2/horizontal_pod_autoscaler_spec.rs index c529e49162..681cf9c99b 100644 --- a/src/v1_24/api/autoscaling/v2beta2/horizontal_pod_autoscaler_spec.rs +++ b/src/v1_24/api/autoscaling/v2beta2/horizontal_pod_autoscaler_spec.rs @@ -23,7 +23,7 @@ impl crate::DeepMerge for HorizontalPodAutoscalerSpec { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.behavior, other.behavior); crate::DeepMerge::merge_from(&mut self.max_replicas, other.max_replicas); - crate::DeepMerge::merge_from(&mut self.metrics, other.metrics); + crate::merge_strategies::list::atomic(&mut self.metrics, other.metrics); crate::DeepMerge::merge_from(&mut self.min_replicas, other.min_replicas); crate::DeepMerge::merge_from(&mut self.scale_target_ref, other.scale_target_ref); } diff --git a/src/v1_24/api/autoscaling/v2beta2/horizontal_pod_autoscaler_status.rs b/src/v1_24/api/autoscaling/v2beta2/horizontal_pod_autoscaler_status.rs index 176ea55941..0f77eb1fb4 100644 --- a/src/v1_24/api/autoscaling/v2beta2/horizontal_pod_autoscaler_status.rs +++ b/src/v1_24/api/autoscaling/v2beta2/horizontal_pod_autoscaler_status.rs @@ -24,8 +24,8 @@ pub struct HorizontalPodAutoscalerStatus { impl crate::DeepMerge for HorizontalPodAutoscalerStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); - crate::DeepMerge::merge_from(&mut self.current_metrics, other.current_metrics); + crate::merge_strategies::list::atomic(&mut self.conditions, other.conditions); + crate::merge_strategies::list::atomic(&mut self.current_metrics, other.current_metrics); crate::DeepMerge::merge_from(&mut self.current_replicas, other.current_replicas); crate::DeepMerge::merge_from(&mut self.desired_replicas, other.desired_replicas); crate::DeepMerge::merge_from(&mut self.last_scale_time, other.last_scale_time); diff --git a/src/v1_24/api/autoscaling/v2beta2/hpa_scaling_rules.rs b/src/v1_24/api/autoscaling/v2beta2/hpa_scaling_rules.rs index 3b62f0dd91..fde69f31c4 100644 --- a/src/v1_24/api/autoscaling/v2beta2/hpa_scaling_rules.rs +++ b/src/v1_24/api/autoscaling/v2beta2/hpa_scaling_rules.rs @@ -15,7 +15,7 @@ pub struct HPAScalingRules { impl crate::DeepMerge for HPAScalingRules { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.policies, other.policies); + crate::merge_strategies::list::atomic(&mut self.policies, other.policies); crate::DeepMerge::merge_from(&mut self.select_policy, other.select_policy); crate::DeepMerge::merge_from(&mut self.stabilization_window_seconds, other.stabilization_window_seconds); } diff --git a/src/v1_24/api/batch/v1/cron_job_status.rs b/src/v1_24/api/batch/v1/cron_job_status.rs index cbd83e8fcd..c0f24458eb 100644 --- a/src/v1_24/api/batch/v1/cron_job_status.rs +++ b/src/v1_24/api/batch/v1/cron_job_status.rs @@ -15,7 +15,7 @@ pub struct CronJobStatus { impl crate::DeepMerge for CronJobStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.active, other.active); + crate::merge_strategies::list::atomic(&mut self.active, other.active); crate::DeepMerge::merge_from(&mut self.last_schedule_time, other.last_schedule_time); crate::DeepMerge::merge_from(&mut self.last_successful_time, other.last_successful_time); } diff --git a/src/v1_24/api/batch/v1/job_status.rs b/src/v1_24/api/batch/v1/job_status.rs index 49d53d7f71..6a3520d3ec 100644 --- a/src/v1_24/api/batch/v1/job_status.rs +++ b/src/v1_24/api/batch/v1/job_status.rs @@ -43,7 +43,14 @@ impl crate::DeepMerge for JobStatus { crate::DeepMerge::merge_from(&mut self.active, other.active); crate::DeepMerge::merge_from(&mut self.completed_indexes, other.completed_indexes); crate::DeepMerge::merge_from(&mut self.completion_time, other.completion_time); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.failed, other.failed); crate::DeepMerge::merge_from(&mut self.ready, other.ready); crate::DeepMerge::merge_from(&mut self.start_time, other.start_time); diff --git a/src/v1_24/api/batch/v1/uncounted_terminated_pods.rs b/src/v1_24/api/batch/v1/uncounted_terminated_pods.rs index 8235855121..45335381cf 100644 --- a/src/v1_24/api/batch/v1/uncounted_terminated_pods.rs +++ b/src/v1_24/api/batch/v1/uncounted_terminated_pods.rs @@ -12,8 +12,8 @@ pub struct UncountedTerminatedPods { impl crate::DeepMerge for UncountedTerminatedPods { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.failed, other.failed); - crate::DeepMerge::merge_from(&mut self.succeeded, other.succeeded); + crate::merge_strategies::list::set(&mut self.failed, other.failed); + crate::merge_strategies::list::set(&mut self.succeeded, other.succeeded); } } diff --git a/src/v1_24/api/batch/v1beta1/cron_job_status.rs b/src/v1_24/api/batch/v1beta1/cron_job_status.rs index 3e8851f77d..3498f7cd58 100644 --- a/src/v1_24/api/batch/v1beta1/cron_job_status.rs +++ b/src/v1_24/api/batch/v1beta1/cron_job_status.rs @@ -15,7 +15,7 @@ pub struct CronJobStatus { impl crate::DeepMerge for CronJobStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.active, other.active); + crate::merge_strategies::list::atomic(&mut self.active, other.active); crate::DeepMerge::merge_from(&mut self.last_schedule_time, other.last_schedule_time); crate::DeepMerge::merge_from(&mut self.last_successful_time, other.last_successful_time); } diff --git a/src/v1_24/api/certificates/v1/certificate_signing_request_spec.rs b/src/v1_24/api/certificates/v1/certificate_signing_request_spec.rs index 549452fb32..36248828fd 100644 --- a/src/v1_24/api/certificates/v1/certificate_signing_request_spec.rs +++ b/src/v1_24/api/certificates/v1/certificate_signing_request_spec.rs @@ -75,12 +75,14 @@ pub struct CertificateSigningRequestSpec { impl crate::DeepMerge for CertificateSigningRequestSpec { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.expiration_seconds, other.expiration_seconds); - crate::DeepMerge::merge_from(&mut self.extra, other.extra); - crate::DeepMerge::merge_from(&mut self.groups, other.groups); + crate::merge_strategies::map::granular(&mut self.extra, other.extra, |current_item, other_item| { + crate::merge_strategies::list::atomic(current_item, other_item); + }); + crate::merge_strategies::list::atomic(&mut self.groups, other.groups); crate::DeepMerge::merge_from(&mut self.request, other.request); crate::DeepMerge::merge_from(&mut self.signer_name, other.signer_name); crate::DeepMerge::merge_from(&mut self.uid, other.uid); - crate::DeepMerge::merge_from(&mut self.usages, other.usages); + crate::merge_strategies::list::atomic(&mut self.usages, other.usages); crate::DeepMerge::merge_from(&mut self.username, other.username); } } diff --git a/src/v1_24/api/certificates/v1/certificate_signing_request_status.rs b/src/v1_24/api/certificates/v1/certificate_signing_request_status.rs index 81fb876580..d17c51933f 100644 --- a/src/v1_24/api/certificates/v1/certificate_signing_request_status.rs +++ b/src/v1_24/api/certificates/v1/certificate_signing_request_status.rs @@ -34,7 +34,14 @@ pub struct CertificateSigningRequestStatus { impl crate::DeepMerge for CertificateSigningRequestStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.certificate, other.certificate); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_24/api/core/v1/capabilities.rs b/src/v1_24/api/core/v1/capabilities.rs index 6045e4f5d2..1a260b5256 100644 --- a/src/v1_24/api/core/v1/capabilities.rs +++ b/src/v1_24/api/core/v1/capabilities.rs @@ -12,8 +12,8 @@ pub struct Capabilities { impl crate::DeepMerge for Capabilities { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.add, other.add); - crate::DeepMerge::merge_from(&mut self.drop, other.drop); + crate::merge_strategies::list::atomic(&mut self.add, other.add); + crate::merge_strategies::list::atomic(&mut self.drop, other.drop); } } diff --git a/src/v1_24/api/core/v1/ceph_fs_persistent_volume_source.rs b/src/v1_24/api/core/v1/ceph_fs_persistent_volume_source.rs index 13104d3d90..33c556a6ce 100644 --- a/src/v1_24/api/core/v1/ceph_fs_persistent_volume_source.rs +++ b/src/v1_24/api/core/v1/ceph_fs_persistent_volume_source.rs @@ -24,7 +24,7 @@ pub struct CephFSPersistentVolumeSource { impl crate::DeepMerge for CephFSPersistentVolumeSource { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.monitors, other.monitors); + crate::merge_strategies::list::atomic(&mut self.monitors, other.monitors); crate::DeepMerge::merge_from(&mut self.path, other.path); crate::DeepMerge::merge_from(&mut self.read_only, other.read_only); crate::DeepMerge::merge_from(&mut self.secret_file, other.secret_file); diff --git a/src/v1_24/api/core/v1/ceph_fs_volume_source.rs b/src/v1_24/api/core/v1/ceph_fs_volume_source.rs index bb24b08edb..91f358e3aa 100644 --- a/src/v1_24/api/core/v1/ceph_fs_volume_source.rs +++ b/src/v1_24/api/core/v1/ceph_fs_volume_source.rs @@ -24,7 +24,7 @@ pub struct CephFSVolumeSource { impl crate::DeepMerge for CephFSVolumeSource { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.monitors, other.monitors); + crate::merge_strategies::list::atomic(&mut self.monitors, other.monitors); crate::DeepMerge::merge_from(&mut self.path, other.path); crate::DeepMerge::merge_from(&mut self.read_only, other.read_only); crate::DeepMerge::merge_from(&mut self.secret_file, other.secret_file); diff --git a/src/v1_24/api/core/v1/component_status.rs b/src/v1_24/api/core/v1/component_status.rs index ecddf82170..50e55665e4 100644 --- a/src/v1_24/api/core/v1/component_status.rs +++ b/src/v1_24/api/core/v1/component_status.rs @@ -172,7 +172,14 @@ impl crate::Metadata for ComponentStatus { impl crate::DeepMerge for ComponentStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); } } diff --git a/src/v1_24/api/core/v1/config_map.rs b/src/v1_24/api/core/v1/config_map.rs index 361b45a3a1..7d07e59a99 100644 --- a/src/v1_24/api/core/v1/config_map.rs +++ b/src/v1_24/api/core/v1/config_map.rs @@ -495,8 +495,12 @@ impl crate::Metadata for ConfigMap { impl crate::DeepMerge for ConfigMap { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.binary_data, other.binary_data); - crate::DeepMerge::merge_from(&mut self.data, other.data); + crate::merge_strategies::map::granular(&mut self.binary_data, other.binary_data, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.data, other.data, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.immutable, other.immutable); crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); } diff --git a/src/v1_24/api/core/v1/config_map_projection.rs b/src/v1_24/api/core/v1/config_map_projection.rs index 673d1527ac..ea9187a2f3 100644 --- a/src/v1_24/api/core/v1/config_map_projection.rs +++ b/src/v1_24/api/core/v1/config_map_projection.rs @@ -17,7 +17,7 @@ pub struct ConfigMapProjection { impl crate::DeepMerge for ConfigMapProjection { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.items, other.items); + crate::merge_strategies::list::atomic(&mut self.items, other.items); crate::DeepMerge::merge_from(&mut self.name, other.name); crate::DeepMerge::merge_from(&mut self.optional, other.optional); } diff --git a/src/v1_24/api/core/v1/config_map_volume_source.rs b/src/v1_24/api/core/v1/config_map_volume_source.rs index d34a1a17da..7d5b55b8ee 100644 --- a/src/v1_24/api/core/v1/config_map_volume_source.rs +++ b/src/v1_24/api/core/v1/config_map_volume_source.rs @@ -21,7 +21,7 @@ pub struct ConfigMapVolumeSource { impl crate::DeepMerge for ConfigMapVolumeSource { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.default_mode, other.default_mode); - crate::DeepMerge::merge_from(&mut self.items, other.items); + crate::merge_strategies::list::atomic(&mut self.items, other.items); crate::DeepMerge::merge_from(&mut self.name, other.name); crate::DeepMerge::merge_from(&mut self.optional, other.optional); } diff --git a/src/v1_24/api/core/v1/container.rs b/src/v1_24/api/core/v1/container.rs index 121e9b5e02..707dcb8e1e 100644 --- a/src/v1_24/api/core/v1/container.rs +++ b/src/v1_24/api/core/v1/container.rs @@ -74,16 +74,30 @@ pub struct Container { impl crate::DeepMerge for Container { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.args, other.args); - crate::DeepMerge::merge_from(&mut self.command, other.command); - crate::DeepMerge::merge_from(&mut self.env, other.env); - crate::DeepMerge::merge_from(&mut self.env_from, other.env_from); + crate::merge_strategies::list::atomic(&mut self.args, other.args); + crate::merge_strategies::list::atomic(&mut self.command, other.command); + crate::merge_strategies::list::map( + &mut self.env, + other.env, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::list::atomic(&mut self.env_from, other.env_from); crate::DeepMerge::merge_from(&mut self.image, other.image); crate::DeepMerge::merge_from(&mut self.image_pull_policy, other.image_pull_policy); crate::DeepMerge::merge_from(&mut self.lifecycle, other.lifecycle); crate::DeepMerge::merge_from(&mut self.liveness_probe, other.liveness_probe); crate::DeepMerge::merge_from(&mut self.name, other.name); - crate::DeepMerge::merge_from(&mut self.ports, other.ports); + crate::merge_strategies::list::map( + &mut self.ports, + other.ports, + &[|lhs, rhs| lhs.container_port == rhs.container_port], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.readiness_probe, other.readiness_probe); crate::DeepMerge::merge_from(&mut self.resources, other.resources); crate::DeepMerge::merge_from(&mut self.security_context, other.security_context); @@ -93,8 +107,22 @@ impl crate::DeepMerge for Container { crate::DeepMerge::merge_from(&mut self.termination_message_path, other.termination_message_path); crate::DeepMerge::merge_from(&mut self.termination_message_policy, other.termination_message_policy); crate::DeepMerge::merge_from(&mut self.tty, other.tty); - crate::DeepMerge::merge_from(&mut self.volume_devices, other.volume_devices); - crate::DeepMerge::merge_from(&mut self.volume_mounts, other.volume_mounts); + crate::merge_strategies::list::map( + &mut self.volume_devices, + other.volume_devices, + &[|lhs, rhs| lhs.device_path == rhs.device_path], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::list::map( + &mut self.volume_mounts, + other.volume_mounts, + &[|lhs, rhs| lhs.mount_path == rhs.mount_path], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.working_dir, other.working_dir); } } diff --git a/src/v1_24/api/core/v1/container_image.rs b/src/v1_24/api/core/v1/container_image.rs index 697ef4906e..871033f834 100644 --- a/src/v1_24/api/core/v1/container_image.rs +++ b/src/v1_24/api/core/v1/container_image.rs @@ -12,7 +12,7 @@ pub struct ContainerImage { impl crate::DeepMerge for ContainerImage { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.names, other.names); + crate::merge_strategies::list::atomic(&mut self.names, other.names); crate::DeepMerge::merge_from(&mut self.size_bytes, other.size_bytes); } } diff --git a/src/v1_24/api/core/v1/csi_persistent_volume_source.rs b/src/v1_24/api/core/v1/csi_persistent_volume_source.rs index 45f78aca31..0bc6e90d78 100644 --- a/src/v1_24/api/core/v1/csi_persistent_volume_source.rs +++ b/src/v1_24/api/core/v1/csi_persistent_volume_source.rs @@ -40,7 +40,9 @@ impl crate::DeepMerge for CSIPersistentVolumeSource { crate::DeepMerge::merge_from(&mut self.node_publish_secret_ref, other.node_publish_secret_ref); crate::DeepMerge::merge_from(&mut self.node_stage_secret_ref, other.node_stage_secret_ref); crate::DeepMerge::merge_from(&mut self.read_only, other.read_only); - crate::DeepMerge::merge_from(&mut self.volume_attributes, other.volume_attributes); + crate::merge_strategies::map::granular(&mut self.volume_attributes, other.volume_attributes, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.volume_handle, other.volume_handle); } } diff --git a/src/v1_24/api/core/v1/csi_volume_source.rs b/src/v1_24/api/core/v1/csi_volume_source.rs index ab72f34cdc..77f1085f6f 100644 --- a/src/v1_24/api/core/v1/csi_volume_source.rs +++ b/src/v1_24/api/core/v1/csi_volume_source.rs @@ -25,7 +25,9 @@ impl crate::DeepMerge for CSIVolumeSource { crate::DeepMerge::merge_from(&mut self.fs_type, other.fs_type); crate::DeepMerge::merge_from(&mut self.node_publish_secret_ref, other.node_publish_secret_ref); crate::DeepMerge::merge_from(&mut self.read_only, other.read_only); - crate::DeepMerge::merge_from(&mut self.volume_attributes, other.volume_attributes); + crate::merge_strategies::map::granular(&mut self.volume_attributes, other.volume_attributes, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); } } diff --git a/src/v1_24/api/core/v1/downward_api_projection.rs b/src/v1_24/api/core/v1/downward_api_projection.rs index de0fca6185..950e2e5645 100644 --- a/src/v1_24/api/core/v1/downward_api_projection.rs +++ b/src/v1_24/api/core/v1/downward_api_projection.rs @@ -9,7 +9,7 @@ pub struct DownwardAPIProjection { impl crate::DeepMerge for DownwardAPIProjection { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.items, other.items); + crate::merge_strategies::list::atomic(&mut self.items, other.items); } } diff --git a/src/v1_24/api/core/v1/downward_api_volume_source.rs b/src/v1_24/api/core/v1/downward_api_volume_source.rs index 214c15f03f..96b4ebb987 100644 --- a/src/v1_24/api/core/v1/downward_api_volume_source.rs +++ b/src/v1_24/api/core/v1/downward_api_volume_source.rs @@ -13,7 +13,7 @@ pub struct DownwardAPIVolumeSource { impl crate::DeepMerge for DownwardAPIVolumeSource { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.default_mode, other.default_mode); - crate::DeepMerge::merge_from(&mut self.items, other.items); + crate::merge_strategies::list::atomic(&mut self.items, other.items); } } diff --git a/src/v1_24/api/core/v1/endpoint_subset.rs b/src/v1_24/api/core/v1/endpoint_subset.rs index 45a0853432..9400deda56 100644 --- a/src/v1_24/api/core/v1/endpoint_subset.rs +++ b/src/v1_24/api/core/v1/endpoint_subset.rs @@ -25,9 +25,9 @@ pub struct EndpointSubset { impl crate::DeepMerge for EndpointSubset { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.addresses, other.addresses); - crate::DeepMerge::merge_from(&mut self.not_ready_addresses, other.not_ready_addresses); - crate::DeepMerge::merge_from(&mut self.ports, other.ports); + crate::merge_strategies::list::atomic(&mut self.addresses, other.addresses); + crate::merge_strategies::list::atomic(&mut self.not_ready_addresses, other.not_ready_addresses); + crate::merge_strategies::list::atomic(&mut self.ports, other.ports); } } diff --git a/src/v1_24/api/core/v1/endpoints.rs b/src/v1_24/api/core/v1/endpoints.rs index ed9beaf356..74d95ffd83 100644 --- a/src/v1_24/api/core/v1/endpoints.rs +++ b/src/v1_24/api/core/v1/endpoints.rs @@ -502,7 +502,7 @@ impl crate::Metadata for Endpoints { impl crate::DeepMerge for Endpoints { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.subsets, other.subsets); + crate::merge_strategies::list::atomic(&mut self.subsets, other.subsets); } } diff --git a/src/v1_24/api/core/v1/ephemeral_container.rs b/src/v1_24/api/core/v1/ephemeral_container.rs index 034838250f..c0d11ce929 100644 --- a/src/v1_24/api/core/v1/ephemeral_container.rs +++ b/src/v1_24/api/core/v1/ephemeral_container.rs @@ -83,16 +83,30 @@ pub struct EphemeralContainer { impl crate::DeepMerge for EphemeralContainer { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.args, other.args); - crate::DeepMerge::merge_from(&mut self.command, other.command); - crate::DeepMerge::merge_from(&mut self.env, other.env); - crate::DeepMerge::merge_from(&mut self.env_from, other.env_from); + crate::merge_strategies::list::atomic(&mut self.args, other.args); + crate::merge_strategies::list::atomic(&mut self.command, other.command); + crate::merge_strategies::list::map( + &mut self.env, + other.env, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::list::atomic(&mut self.env_from, other.env_from); crate::DeepMerge::merge_from(&mut self.image, other.image); crate::DeepMerge::merge_from(&mut self.image_pull_policy, other.image_pull_policy); crate::DeepMerge::merge_from(&mut self.lifecycle, other.lifecycle); crate::DeepMerge::merge_from(&mut self.liveness_probe, other.liveness_probe); crate::DeepMerge::merge_from(&mut self.name, other.name); - crate::DeepMerge::merge_from(&mut self.ports, other.ports); + crate::merge_strategies::list::map( + &mut self.ports, + other.ports, + &[|lhs, rhs| lhs.container_port == rhs.container_port], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.readiness_probe, other.readiness_probe); crate::DeepMerge::merge_from(&mut self.resources, other.resources); crate::DeepMerge::merge_from(&mut self.security_context, other.security_context); @@ -103,8 +117,22 @@ impl crate::DeepMerge for EphemeralContainer { crate::DeepMerge::merge_from(&mut self.termination_message_path, other.termination_message_path); crate::DeepMerge::merge_from(&mut self.termination_message_policy, other.termination_message_policy); crate::DeepMerge::merge_from(&mut self.tty, other.tty); - crate::DeepMerge::merge_from(&mut self.volume_devices, other.volume_devices); - crate::DeepMerge::merge_from(&mut self.volume_mounts, other.volume_mounts); + crate::merge_strategies::list::map( + &mut self.volume_devices, + other.volume_devices, + &[|lhs, rhs| lhs.device_path == rhs.device_path], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::list::map( + &mut self.volume_mounts, + other.volume_mounts, + &[|lhs, rhs| lhs.mount_path == rhs.mount_path], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.working_dir, other.working_dir); } } diff --git a/src/v1_24/api/core/v1/exec_action.rs b/src/v1_24/api/core/v1/exec_action.rs index fc5ddd099a..07e888786c 100644 --- a/src/v1_24/api/core/v1/exec_action.rs +++ b/src/v1_24/api/core/v1/exec_action.rs @@ -9,7 +9,7 @@ pub struct ExecAction { impl crate::DeepMerge for ExecAction { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.command, other.command); + crate::merge_strategies::list::atomic(&mut self.command, other.command); } } diff --git a/src/v1_24/api/core/v1/fc_volume_source.rs b/src/v1_24/api/core/v1/fc_volume_source.rs index 16dda61ef3..f379368e18 100644 --- a/src/v1_24/api/core/v1/fc_volume_source.rs +++ b/src/v1_24/api/core/v1/fc_volume_source.rs @@ -24,8 +24,8 @@ impl crate::DeepMerge for FCVolumeSource { crate::DeepMerge::merge_from(&mut self.fs_type, other.fs_type); crate::DeepMerge::merge_from(&mut self.lun, other.lun); crate::DeepMerge::merge_from(&mut self.read_only, other.read_only); - crate::DeepMerge::merge_from(&mut self.target_wwns, other.target_wwns); - crate::DeepMerge::merge_from(&mut self.wwids, other.wwids); + crate::merge_strategies::list::atomic(&mut self.target_wwns, other.target_wwns); + crate::merge_strategies::list::atomic(&mut self.wwids, other.wwids); } } diff --git a/src/v1_24/api/core/v1/flex_persistent_volume_source.rs b/src/v1_24/api/core/v1/flex_persistent_volume_source.rs index 1c73341c0c..a696df849c 100644 --- a/src/v1_24/api/core/v1/flex_persistent_volume_source.rs +++ b/src/v1_24/api/core/v1/flex_persistent_volume_source.rs @@ -23,7 +23,9 @@ impl crate::DeepMerge for FlexPersistentVolumeSource { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.driver, other.driver); crate::DeepMerge::merge_from(&mut self.fs_type, other.fs_type); - crate::DeepMerge::merge_from(&mut self.options, other.options); + crate::merge_strategies::map::granular(&mut self.options, other.options, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.read_only, other.read_only); crate::DeepMerge::merge_from(&mut self.secret_ref, other.secret_ref); } diff --git a/src/v1_24/api/core/v1/flex_volume_source.rs b/src/v1_24/api/core/v1/flex_volume_source.rs index caad40ad2b..8cec763784 100644 --- a/src/v1_24/api/core/v1/flex_volume_source.rs +++ b/src/v1_24/api/core/v1/flex_volume_source.rs @@ -23,7 +23,9 @@ impl crate::DeepMerge for FlexVolumeSource { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.driver, other.driver); crate::DeepMerge::merge_from(&mut self.fs_type, other.fs_type); - crate::DeepMerge::merge_from(&mut self.options, other.options); + crate::merge_strategies::map::granular(&mut self.options, other.options, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.read_only, other.read_only); crate::DeepMerge::merge_from(&mut self.secret_ref, other.secret_ref); } diff --git a/src/v1_24/api/core/v1/host_alias.rs b/src/v1_24/api/core/v1/host_alias.rs index 9320f6d9e1..8ea648c7ad 100644 --- a/src/v1_24/api/core/v1/host_alias.rs +++ b/src/v1_24/api/core/v1/host_alias.rs @@ -12,7 +12,7 @@ pub struct HostAlias { impl crate::DeepMerge for HostAlias { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.hostnames, other.hostnames); + crate::merge_strategies::list::atomic(&mut self.hostnames, other.hostnames); crate::DeepMerge::merge_from(&mut self.ip, other.ip); } } diff --git a/src/v1_24/api/core/v1/http_get_action.rs b/src/v1_24/api/core/v1/http_get_action.rs index cec454faa3..b972a6bd69 100644 --- a/src/v1_24/api/core/v1/http_get_action.rs +++ b/src/v1_24/api/core/v1/http_get_action.rs @@ -23,7 +23,7 @@ pub struct HTTPGetAction { impl crate::DeepMerge for HTTPGetAction { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.host, other.host); - crate::DeepMerge::merge_from(&mut self.http_headers, other.http_headers); + crate::merge_strategies::list::atomic(&mut self.http_headers, other.http_headers); crate::DeepMerge::merge_from(&mut self.path, other.path); crate::DeepMerge::merge_from(&mut self.port, other.port); crate::DeepMerge::merge_from(&mut self.scheme, other.scheme); diff --git a/src/v1_24/api/core/v1/iscsi_persistent_volume_source.rs b/src/v1_24/api/core/v1/iscsi_persistent_volume_source.rs index e7285139af..462487bb86 100644 --- a/src/v1_24/api/core/v1/iscsi_persistent_volume_source.rs +++ b/src/v1_24/api/core/v1/iscsi_persistent_volume_source.rs @@ -46,7 +46,7 @@ impl crate::DeepMerge for ISCSIPersistentVolumeSource { crate::DeepMerge::merge_from(&mut self.iqn, other.iqn); crate::DeepMerge::merge_from(&mut self.iscsi_interface, other.iscsi_interface); crate::DeepMerge::merge_from(&mut self.lun, other.lun); - crate::DeepMerge::merge_from(&mut self.portals, other.portals); + crate::merge_strategies::list::atomic(&mut self.portals, other.portals); crate::DeepMerge::merge_from(&mut self.read_only, other.read_only); crate::DeepMerge::merge_from(&mut self.secret_ref, other.secret_ref); crate::DeepMerge::merge_from(&mut self.target_portal, other.target_portal); diff --git a/src/v1_24/api/core/v1/iscsi_volume_source.rs b/src/v1_24/api/core/v1/iscsi_volume_source.rs index 0990284c06..d9d95c147b 100644 --- a/src/v1_24/api/core/v1/iscsi_volume_source.rs +++ b/src/v1_24/api/core/v1/iscsi_volume_source.rs @@ -46,7 +46,7 @@ impl crate::DeepMerge for ISCSIVolumeSource { crate::DeepMerge::merge_from(&mut self.iqn, other.iqn); crate::DeepMerge::merge_from(&mut self.iscsi_interface, other.iscsi_interface); crate::DeepMerge::merge_from(&mut self.lun, other.lun); - crate::DeepMerge::merge_from(&mut self.portals, other.portals); + crate::merge_strategies::list::atomic(&mut self.portals, other.portals); crate::DeepMerge::merge_from(&mut self.read_only, other.read_only); crate::DeepMerge::merge_from(&mut self.secret_ref, other.secret_ref); crate::DeepMerge::merge_from(&mut self.target_portal, other.target_portal); diff --git a/src/v1_24/api/core/v1/limit_range_item.rs b/src/v1_24/api/core/v1/limit_range_item.rs index 3aada5aaaa..d8431aec87 100644 --- a/src/v1_24/api/core/v1/limit_range_item.rs +++ b/src/v1_24/api/core/v1/limit_range_item.rs @@ -24,11 +24,21 @@ pub struct LimitRangeItem { impl crate::DeepMerge for LimitRangeItem { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.default, other.default); - crate::DeepMerge::merge_from(&mut self.default_request, other.default_request); - crate::DeepMerge::merge_from(&mut self.max, other.max); - crate::DeepMerge::merge_from(&mut self.max_limit_request_ratio, other.max_limit_request_ratio); - crate::DeepMerge::merge_from(&mut self.min, other.min); + crate::merge_strategies::map::granular(&mut self.default, other.default, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.default_request, other.default_request, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.max, other.max, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.max_limit_request_ratio, other.max_limit_request_ratio, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.min, other.min, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.type_, other.type_); } } diff --git a/src/v1_24/api/core/v1/limit_range_spec.rs b/src/v1_24/api/core/v1/limit_range_spec.rs index d3db20e828..14cacbd619 100644 --- a/src/v1_24/api/core/v1/limit_range_spec.rs +++ b/src/v1_24/api/core/v1/limit_range_spec.rs @@ -9,7 +9,7 @@ pub struct LimitRangeSpec { impl crate::DeepMerge for LimitRangeSpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.limits, other.limits); + crate::merge_strategies::list::atomic(&mut self.limits, other.limits); } } diff --git a/src/v1_24/api/core/v1/load_balancer_ingress.rs b/src/v1_24/api/core/v1/load_balancer_ingress.rs index fe804334cf..ffce22ba8b 100644 --- a/src/v1_24/api/core/v1/load_balancer_ingress.rs +++ b/src/v1_24/api/core/v1/load_balancer_ingress.rs @@ -17,7 +17,7 @@ impl crate::DeepMerge for LoadBalancerIngress { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.hostname, other.hostname); crate::DeepMerge::merge_from(&mut self.ip, other.ip); - crate::DeepMerge::merge_from(&mut self.ports, other.ports); + crate::merge_strategies::list::atomic(&mut self.ports, other.ports); } } diff --git a/src/v1_24/api/core/v1/load_balancer_status.rs b/src/v1_24/api/core/v1/load_balancer_status.rs index 46d791f8e1..67379f9e4e 100644 --- a/src/v1_24/api/core/v1/load_balancer_status.rs +++ b/src/v1_24/api/core/v1/load_balancer_status.rs @@ -9,7 +9,7 @@ pub struct LoadBalancerStatus { impl crate::DeepMerge for LoadBalancerStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.ingress, other.ingress); + crate::merge_strategies::list::atomic(&mut self.ingress, other.ingress); } } diff --git a/src/v1_24/api/core/v1/namespace_spec.rs b/src/v1_24/api/core/v1/namespace_spec.rs index 5ae9e5ef2e..cbf697e1e1 100644 --- a/src/v1_24/api/core/v1/namespace_spec.rs +++ b/src/v1_24/api/core/v1/namespace_spec.rs @@ -9,7 +9,7 @@ pub struct NamespaceSpec { impl crate::DeepMerge for NamespaceSpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.finalizers, other.finalizers); + crate::merge_strategies::list::atomic(&mut self.finalizers, other.finalizers); } } diff --git a/src/v1_24/api/core/v1/namespace_status.rs b/src/v1_24/api/core/v1/namespace_status.rs index 7ccfbdac3e..c859779881 100644 --- a/src/v1_24/api/core/v1/namespace_status.rs +++ b/src/v1_24/api/core/v1/namespace_status.rs @@ -13,7 +13,14 @@ pub struct NamespaceStatus { impl crate::DeepMerge for NamespaceStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.phase, other.phase); } } diff --git a/src/v1_24/api/core/v1/node_affinity.rs b/src/v1_24/api/core/v1/node_affinity.rs index 2a70de8703..dfd14357a3 100644 --- a/src/v1_24/api/core/v1/node_affinity.rs +++ b/src/v1_24/api/core/v1/node_affinity.rs @@ -12,7 +12,7 @@ pub struct NodeAffinity { impl crate::DeepMerge for NodeAffinity { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.preferred_during_scheduling_ignored_during_execution, other.preferred_during_scheduling_ignored_during_execution); + crate::merge_strategies::list::atomic(&mut self.preferred_during_scheduling_ignored_during_execution, other.preferred_during_scheduling_ignored_during_execution); crate::DeepMerge::merge_from(&mut self.required_during_scheduling_ignored_during_execution, other.required_during_scheduling_ignored_during_execution); } } diff --git a/src/v1_24/api/core/v1/node_selector.rs b/src/v1_24/api/core/v1/node_selector.rs index 5b146c615e..997fba9ef3 100644 --- a/src/v1_24/api/core/v1/node_selector.rs +++ b/src/v1_24/api/core/v1/node_selector.rs @@ -9,7 +9,7 @@ pub struct NodeSelector { impl crate::DeepMerge for NodeSelector { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.node_selector_terms, other.node_selector_terms); + crate::merge_strategies::list::atomic(&mut self.node_selector_terms, other.node_selector_terms); } } diff --git a/src/v1_24/api/core/v1/node_selector_requirement.rs b/src/v1_24/api/core/v1/node_selector_requirement.rs index 57817f1fab..5a76f55c6f 100644 --- a/src/v1_24/api/core/v1/node_selector_requirement.rs +++ b/src/v1_24/api/core/v1/node_selector_requirement.rs @@ -18,7 +18,7 @@ impl crate::DeepMerge for NodeSelectorRequirement { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.key, other.key); crate::DeepMerge::merge_from(&mut self.operator, other.operator); - crate::DeepMerge::merge_from(&mut self.values, other.values); + crate::merge_strategies::list::atomic(&mut self.values, other.values); } } diff --git a/src/v1_24/api/core/v1/node_selector_term.rs b/src/v1_24/api/core/v1/node_selector_term.rs index b0d28cc176..1237883670 100644 --- a/src/v1_24/api/core/v1/node_selector_term.rs +++ b/src/v1_24/api/core/v1/node_selector_term.rs @@ -12,8 +12,8 @@ pub struct NodeSelectorTerm { impl crate::DeepMerge for NodeSelectorTerm { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.match_expressions, other.match_expressions); - crate::DeepMerge::merge_from(&mut self.match_fields, other.match_fields); + crate::merge_strategies::list::atomic(&mut self.match_expressions, other.match_expressions); + crate::merge_strategies::list::atomic(&mut self.match_fields, other.match_fields); } } diff --git a/src/v1_24/api/core/v1/node_spec.rs b/src/v1_24/api/core/v1/node_spec.rs index bb4073b039..100d050910 100644 --- a/src/v1_24/api/core/v1/node_spec.rs +++ b/src/v1_24/api/core/v1/node_spec.rs @@ -30,9 +30,9 @@ impl crate::DeepMerge for NodeSpec { crate::DeepMerge::merge_from(&mut self.config_source, other.config_source); crate::DeepMerge::merge_from(&mut self.external_id, other.external_id); crate::DeepMerge::merge_from(&mut self.pod_cidr, other.pod_cidr); - crate::DeepMerge::merge_from(&mut self.pod_cidrs, other.pod_cidrs); + crate::merge_strategies::list::set(&mut self.pod_cidrs, other.pod_cidrs); crate::DeepMerge::merge_from(&mut self.provider_id, other.provider_id); - crate::DeepMerge::merge_from(&mut self.taints, other.taints); + crate::merge_strategies::list::atomic(&mut self.taints, other.taints); crate::DeepMerge::merge_from(&mut self.unschedulable, other.unschedulable); } } diff --git a/src/v1_24/api/core/v1/node_status.rs b/src/v1_24/api/core/v1/node_status.rs index 79f0d56439..39a6eb19f2 100644 --- a/src/v1_24/api/core/v1/node_status.rs +++ b/src/v1_24/api/core/v1/node_status.rs @@ -40,17 +40,35 @@ pub struct NodeStatus { impl crate::DeepMerge for NodeStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.addresses, other.addresses); - crate::DeepMerge::merge_from(&mut self.allocatable, other.allocatable); - crate::DeepMerge::merge_from(&mut self.capacity, other.capacity); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.addresses, + other.addresses, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::map::granular(&mut self.allocatable, other.allocatable, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.capacity, other.capacity, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.config, other.config); crate::DeepMerge::merge_from(&mut self.daemon_endpoints, other.daemon_endpoints); - crate::DeepMerge::merge_from(&mut self.images, other.images); + crate::merge_strategies::list::atomic(&mut self.images, other.images); crate::DeepMerge::merge_from(&mut self.node_info, other.node_info); crate::DeepMerge::merge_from(&mut self.phase, other.phase); - crate::DeepMerge::merge_from(&mut self.volumes_attached, other.volumes_attached); - crate::DeepMerge::merge_from(&mut self.volumes_in_use, other.volumes_in_use); + crate::merge_strategies::list::atomic(&mut self.volumes_attached, other.volumes_attached); + crate::merge_strategies::list::atomic(&mut self.volumes_in_use, other.volumes_in_use); } } diff --git a/src/v1_24/api/core/v1/persistent_volume_claim_spec.rs b/src/v1_24/api/core/v1/persistent_volume_claim_spec.rs index d43bb08405..fc48a46f28 100644 --- a/src/v1_24/api/core/v1/persistent_volume_claim_spec.rs +++ b/src/v1_24/api/core/v1/persistent_volume_claim_spec.rs @@ -35,7 +35,7 @@ pub struct PersistentVolumeClaimSpec { impl crate::DeepMerge for PersistentVolumeClaimSpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.access_modes, other.access_modes); + crate::merge_strategies::list::atomic(&mut self.access_modes, other.access_modes); crate::DeepMerge::merge_from(&mut self.data_source, other.data_source); crate::DeepMerge::merge_from(&mut self.data_source_ref, other.data_source_ref); crate::DeepMerge::merge_from(&mut self.resources, other.resources); diff --git a/src/v1_24/api/core/v1/persistent_volume_claim_status.rs b/src/v1_24/api/core/v1/persistent_volume_claim_status.rs index 8f5f980671..c3b27d01c5 100644 --- a/src/v1_24/api/core/v1/persistent_volume_claim_status.rs +++ b/src/v1_24/api/core/v1/persistent_volume_claim_status.rs @@ -25,10 +25,21 @@ pub struct PersistentVolumeClaimStatus { impl crate::DeepMerge for PersistentVolumeClaimStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.access_modes, other.access_modes); - crate::DeepMerge::merge_from(&mut self.allocated_resources, other.allocated_resources); - crate::DeepMerge::merge_from(&mut self.capacity, other.capacity); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::atomic(&mut self.access_modes, other.access_modes); + crate::merge_strategies::map::granular(&mut self.allocated_resources, other.allocated_resources, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.capacity, other.capacity, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.phase, other.phase); crate::DeepMerge::merge_from(&mut self.resize_status, other.resize_status); } diff --git a/src/v1_24/api/core/v1/persistent_volume_spec.rs b/src/v1_24/api/core/v1/persistent_volume_spec.rs index 42cd7fd388..39ced5b9b7 100644 --- a/src/v1_24/api/core/v1/persistent_volume_spec.rs +++ b/src/v1_24/api/core/v1/persistent_volume_spec.rs @@ -97,11 +97,13 @@ pub struct PersistentVolumeSpec { impl crate::DeepMerge for PersistentVolumeSpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.access_modes, other.access_modes); + crate::merge_strategies::list::atomic(&mut self.access_modes, other.access_modes); crate::DeepMerge::merge_from(&mut self.aws_elastic_block_store, other.aws_elastic_block_store); crate::DeepMerge::merge_from(&mut self.azure_disk, other.azure_disk); crate::DeepMerge::merge_from(&mut self.azure_file, other.azure_file); - crate::DeepMerge::merge_from(&mut self.capacity, other.capacity); + crate::merge_strategies::map::granular(&mut self.capacity, other.capacity, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.cephfs, other.cephfs); crate::DeepMerge::merge_from(&mut self.cinder, other.cinder); crate::DeepMerge::merge_from(&mut self.claim_ref, other.claim_ref); @@ -114,7 +116,7 @@ impl crate::DeepMerge for PersistentVolumeSpec { crate::DeepMerge::merge_from(&mut self.host_path, other.host_path); crate::DeepMerge::merge_from(&mut self.iscsi, other.iscsi); crate::DeepMerge::merge_from(&mut self.local, other.local); - crate::DeepMerge::merge_from(&mut self.mount_options, other.mount_options); + crate::merge_strategies::list::atomic(&mut self.mount_options, other.mount_options); crate::DeepMerge::merge_from(&mut self.nfs, other.nfs); crate::DeepMerge::merge_from(&mut self.node_affinity, other.node_affinity); crate::DeepMerge::merge_from(&mut self.persistent_volume_reclaim_policy, other.persistent_volume_reclaim_policy); diff --git a/src/v1_24/api/core/v1/pod_affinity.rs b/src/v1_24/api/core/v1/pod_affinity.rs index facc781ff6..a528250bbc 100644 --- a/src/v1_24/api/core/v1/pod_affinity.rs +++ b/src/v1_24/api/core/v1/pod_affinity.rs @@ -12,8 +12,8 @@ pub struct PodAffinity { impl crate::DeepMerge for PodAffinity { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.preferred_during_scheduling_ignored_during_execution, other.preferred_during_scheduling_ignored_during_execution); - crate::DeepMerge::merge_from(&mut self.required_during_scheduling_ignored_during_execution, other.required_during_scheduling_ignored_during_execution); + crate::merge_strategies::list::atomic(&mut self.preferred_during_scheduling_ignored_during_execution, other.preferred_during_scheduling_ignored_during_execution); + crate::merge_strategies::list::atomic(&mut self.required_during_scheduling_ignored_during_execution, other.required_during_scheduling_ignored_during_execution); } } diff --git a/src/v1_24/api/core/v1/pod_affinity_term.rs b/src/v1_24/api/core/v1/pod_affinity_term.rs index 92b8e14b28..497fd832bf 100644 --- a/src/v1_24/api/core/v1/pod_affinity_term.rs +++ b/src/v1_24/api/core/v1/pod_affinity_term.rs @@ -20,7 +20,7 @@ impl crate::DeepMerge for PodAffinityTerm { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.label_selector, other.label_selector); crate::DeepMerge::merge_from(&mut self.namespace_selector, other.namespace_selector); - crate::DeepMerge::merge_from(&mut self.namespaces, other.namespaces); + crate::merge_strategies::list::atomic(&mut self.namespaces, other.namespaces); crate::DeepMerge::merge_from(&mut self.topology_key, other.topology_key); } } diff --git a/src/v1_24/api/core/v1/pod_anti_affinity.rs b/src/v1_24/api/core/v1/pod_anti_affinity.rs index a6cd6aa584..86979017ac 100644 --- a/src/v1_24/api/core/v1/pod_anti_affinity.rs +++ b/src/v1_24/api/core/v1/pod_anti_affinity.rs @@ -12,8 +12,8 @@ pub struct PodAntiAffinity { impl crate::DeepMerge for PodAntiAffinity { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.preferred_during_scheduling_ignored_during_execution, other.preferred_during_scheduling_ignored_during_execution); - crate::DeepMerge::merge_from(&mut self.required_during_scheduling_ignored_during_execution, other.required_during_scheduling_ignored_during_execution); + crate::merge_strategies::list::atomic(&mut self.preferred_during_scheduling_ignored_during_execution, other.preferred_during_scheduling_ignored_during_execution); + crate::merge_strategies::list::atomic(&mut self.required_during_scheduling_ignored_during_execution, other.required_during_scheduling_ignored_during_execution); } } diff --git a/src/v1_24/api/core/v1/pod_dns_config.rs b/src/v1_24/api/core/v1/pod_dns_config.rs index b79282bb55..201eb4d69c 100644 --- a/src/v1_24/api/core/v1/pod_dns_config.rs +++ b/src/v1_24/api/core/v1/pod_dns_config.rs @@ -15,9 +15,9 @@ pub struct PodDNSConfig { impl crate::DeepMerge for PodDNSConfig { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.nameservers, other.nameservers); - crate::DeepMerge::merge_from(&mut self.options, other.options); - crate::DeepMerge::merge_from(&mut self.searches, other.searches); + crate::merge_strategies::list::atomic(&mut self.nameservers, other.nameservers); + crate::merge_strategies::list::atomic(&mut self.options, other.options); + crate::merge_strategies::list::atomic(&mut self.searches, other.searches); } } diff --git a/src/v1_24/api/core/v1/pod_security_context.rs b/src/v1_24/api/core/v1/pod_security_context.rs index 9cf93e3f01..b595b94dfc 100644 --- a/src/v1_24/api/core/v1/pod_security_context.rs +++ b/src/v1_24/api/core/v1/pod_security_context.rs @@ -47,8 +47,8 @@ impl crate::DeepMerge for PodSecurityContext { crate::DeepMerge::merge_from(&mut self.run_as_user, other.run_as_user); crate::DeepMerge::merge_from(&mut self.se_linux_options, other.se_linux_options); crate::DeepMerge::merge_from(&mut self.seccomp_profile, other.seccomp_profile); - crate::DeepMerge::merge_from(&mut self.supplemental_groups, other.supplemental_groups); - crate::DeepMerge::merge_from(&mut self.sysctls, other.sysctls); + crate::merge_strategies::list::atomic(&mut self.supplemental_groups, other.supplemental_groups); + crate::merge_strategies::list::atomic(&mut self.sysctls, other.sysctls); crate::DeepMerge::merge_from(&mut self.windows_options, other.windows_options); } } diff --git a/src/v1_24/api/core/v1/pod_spec.rs b/src/v1_24/api/core/v1/pod_spec.rs index 4c84fe9c48..3c0f7e1c19 100644 --- a/src/v1_24/api/core/v1/pod_spec.rs +++ b/src/v1_24/api/core/v1/pod_spec.rs @@ -123,26 +123,63 @@ impl crate::DeepMerge for PodSpec { crate::DeepMerge::merge_from(&mut self.active_deadline_seconds, other.active_deadline_seconds); crate::DeepMerge::merge_from(&mut self.affinity, other.affinity); crate::DeepMerge::merge_from(&mut self.automount_service_account_token, other.automount_service_account_token); - crate::DeepMerge::merge_from(&mut self.containers, other.containers); + crate::merge_strategies::list::map( + &mut self.containers, + other.containers, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.dns_config, other.dns_config); crate::DeepMerge::merge_from(&mut self.dns_policy, other.dns_policy); crate::DeepMerge::merge_from(&mut self.enable_service_links, other.enable_service_links); - crate::DeepMerge::merge_from(&mut self.ephemeral_containers, other.ephemeral_containers); - crate::DeepMerge::merge_from(&mut self.host_aliases, other.host_aliases); + crate::merge_strategies::list::map( + &mut self.ephemeral_containers, + other.ephemeral_containers, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::list::map( + &mut self.host_aliases, + other.host_aliases, + &[|lhs, rhs| lhs.ip == rhs.ip], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.host_ipc, other.host_ipc); crate::DeepMerge::merge_from(&mut self.host_network, other.host_network); crate::DeepMerge::merge_from(&mut self.host_pid, other.host_pid); crate::DeepMerge::merge_from(&mut self.hostname, other.hostname); - crate::DeepMerge::merge_from(&mut self.image_pull_secrets, other.image_pull_secrets); - crate::DeepMerge::merge_from(&mut self.init_containers, other.init_containers); + crate::merge_strategies::list::map( + &mut self.image_pull_secrets, + other.image_pull_secrets, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::list::map( + &mut self.init_containers, + other.init_containers, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.node_name, other.node_name); - crate::DeepMerge::merge_from(&mut self.node_selector, other.node_selector); + crate::merge_strategies::map::atomic(&mut self.node_selector, other.node_selector); crate::DeepMerge::merge_from(&mut self.os, other.os); - crate::DeepMerge::merge_from(&mut self.overhead, other.overhead); + crate::merge_strategies::map::granular(&mut self.overhead, other.overhead, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.preemption_policy, other.preemption_policy); crate::DeepMerge::merge_from(&mut self.priority, other.priority); crate::DeepMerge::merge_from(&mut self.priority_class_name, other.priority_class_name); - crate::DeepMerge::merge_from(&mut self.readiness_gates, other.readiness_gates); + crate::merge_strategies::list::atomic(&mut self.readiness_gates, other.readiness_gates); crate::DeepMerge::merge_from(&mut self.restart_policy, other.restart_policy); crate::DeepMerge::merge_from(&mut self.runtime_class_name, other.runtime_class_name); crate::DeepMerge::merge_from(&mut self.scheduler_name, other.scheduler_name); @@ -153,9 +190,23 @@ impl crate::DeepMerge for PodSpec { crate::DeepMerge::merge_from(&mut self.share_process_namespace, other.share_process_namespace); crate::DeepMerge::merge_from(&mut self.subdomain, other.subdomain); crate::DeepMerge::merge_from(&mut self.termination_grace_period_seconds, other.termination_grace_period_seconds); - crate::DeepMerge::merge_from(&mut self.tolerations, other.tolerations); - crate::DeepMerge::merge_from(&mut self.topology_spread_constraints, other.topology_spread_constraints); - crate::DeepMerge::merge_from(&mut self.volumes, other.volumes); + crate::merge_strategies::list::atomic(&mut self.tolerations, other.tolerations); + crate::merge_strategies::list::map( + &mut self.topology_spread_constraints, + other.topology_spread_constraints, + &[|lhs, rhs| lhs.topology_key == rhs.topology_key], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::list::map( + &mut self.volumes, + other.volumes, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_24/api/core/v1/pod_status.rs b/src/v1_24/api/core/v1/pod_status.rs index fe969618a6..fb7dcfa7a5 100644 --- a/src/v1_24/api/core/v1/pod_status.rs +++ b/src/v1_24/api/core/v1/pod_status.rs @@ -51,16 +51,30 @@ pub struct PodStatus { impl crate::DeepMerge for PodStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); - crate::DeepMerge::merge_from(&mut self.container_statuses, other.container_statuses); - crate::DeepMerge::merge_from(&mut self.ephemeral_container_statuses, other.ephemeral_container_statuses); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::list::atomic(&mut self.container_statuses, other.container_statuses); + crate::merge_strategies::list::atomic(&mut self.ephemeral_container_statuses, other.ephemeral_container_statuses); crate::DeepMerge::merge_from(&mut self.host_ip, other.host_ip); - crate::DeepMerge::merge_from(&mut self.init_container_statuses, other.init_container_statuses); + crate::merge_strategies::list::atomic(&mut self.init_container_statuses, other.init_container_statuses); crate::DeepMerge::merge_from(&mut self.message, other.message); crate::DeepMerge::merge_from(&mut self.nominated_node_name, other.nominated_node_name); crate::DeepMerge::merge_from(&mut self.phase, other.phase); crate::DeepMerge::merge_from(&mut self.pod_ip, other.pod_ip); - crate::DeepMerge::merge_from(&mut self.pod_ips, other.pod_ips); + crate::merge_strategies::list::map( + &mut self.pod_ips, + other.pod_ips, + &[|lhs, rhs| lhs.ip == rhs.ip], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.qos_class, other.qos_class); crate::DeepMerge::merge_from(&mut self.reason, other.reason); crate::DeepMerge::merge_from(&mut self.start_time, other.start_time); diff --git a/src/v1_24/api/core/v1/projected_volume_source.rs b/src/v1_24/api/core/v1/projected_volume_source.rs index 8cbfa14727..676638445b 100644 --- a/src/v1_24/api/core/v1/projected_volume_source.rs +++ b/src/v1_24/api/core/v1/projected_volume_source.rs @@ -13,7 +13,7 @@ pub struct ProjectedVolumeSource { impl crate::DeepMerge for ProjectedVolumeSource { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.default_mode, other.default_mode); - crate::DeepMerge::merge_from(&mut self.sources, other.sources); + crate::merge_strategies::list::atomic(&mut self.sources, other.sources); } } diff --git a/src/v1_24/api/core/v1/rbd_persistent_volume_source.rs b/src/v1_24/api/core/v1/rbd_persistent_volume_source.rs index 54b7b5e7f2..08d1308041 100644 --- a/src/v1_24/api/core/v1/rbd_persistent_volume_source.rs +++ b/src/v1_24/api/core/v1/rbd_persistent_volume_source.rs @@ -33,7 +33,7 @@ impl crate::DeepMerge for RBDPersistentVolumeSource { crate::DeepMerge::merge_from(&mut self.fs_type, other.fs_type); crate::DeepMerge::merge_from(&mut self.image, other.image); crate::DeepMerge::merge_from(&mut self.keyring, other.keyring); - crate::DeepMerge::merge_from(&mut self.monitors, other.monitors); + crate::merge_strategies::list::atomic(&mut self.monitors, other.monitors); crate::DeepMerge::merge_from(&mut self.pool, other.pool); crate::DeepMerge::merge_from(&mut self.read_only, other.read_only); crate::DeepMerge::merge_from(&mut self.secret_ref, other.secret_ref); diff --git a/src/v1_24/api/core/v1/rbd_volume_source.rs b/src/v1_24/api/core/v1/rbd_volume_source.rs index 2d39e78da8..18a2d2c010 100644 --- a/src/v1_24/api/core/v1/rbd_volume_source.rs +++ b/src/v1_24/api/core/v1/rbd_volume_source.rs @@ -33,7 +33,7 @@ impl crate::DeepMerge for RBDVolumeSource { crate::DeepMerge::merge_from(&mut self.fs_type, other.fs_type); crate::DeepMerge::merge_from(&mut self.image, other.image); crate::DeepMerge::merge_from(&mut self.keyring, other.keyring); - crate::DeepMerge::merge_from(&mut self.monitors, other.monitors); + crate::merge_strategies::list::atomic(&mut self.monitors, other.monitors); crate::DeepMerge::merge_from(&mut self.pool, other.pool); crate::DeepMerge::merge_from(&mut self.read_only, other.read_only); crate::DeepMerge::merge_from(&mut self.secret_ref, other.secret_ref); diff --git a/src/v1_24/api/core/v1/replication_controller_spec.rs b/src/v1_24/api/core/v1/replication_controller_spec.rs index 293546b183..ed3edfa202 100644 --- a/src/v1_24/api/core/v1/replication_controller_spec.rs +++ b/src/v1_24/api/core/v1/replication_controller_spec.rs @@ -20,7 +20,7 @@ impl crate::DeepMerge for ReplicationControllerSpec { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.min_ready_seconds, other.min_ready_seconds); crate::DeepMerge::merge_from(&mut self.replicas, other.replicas); - crate::DeepMerge::merge_from(&mut self.selector, other.selector); + crate::merge_strategies::map::atomic(&mut self.selector, other.selector); crate::DeepMerge::merge_from(&mut self.template, other.template); } } diff --git a/src/v1_24/api/core/v1/replication_controller_status.rs b/src/v1_24/api/core/v1/replication_controller_status.rs index d069722747..47ccceaeba 100644 --- a/src/v1_24/api/core/v1/replication_controller_status.rs +++ b/src/v1_24/api/core/v1/replication_controller_status.rs @@ -25,7 +25,14 @@ pub struct ReplicationControllerStatus { impl crate::DeepMerge for ReplicationControllerStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.available_replicas, other.available_replicas); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.fully_labeled_replicas, other.fully_labeled_replicas); crate::DeepMerge::merge_from(&mut self.observed_generation, other.observed_generation); crate::DeepMerge::merge_from(&mut self.ready_replicas, other.ready_replicas); diff --git a/src/v1_24/api/core/v1/resource_quota_spec.rs b/src/v1_24/api/core/v1/resource_quota_spec.rs index fab2b7970d..3468d8e9e0 100644 --- a/src/v1_24/api/core/v1/resource_quota_spec.rs +++ b/src/v1_24/api/core/v1/resource_quota_spec.rs @@ -15,9 +15,11 @@ pub struct ResourceQuotaSpec { impl crate::DeepMerge for ResourceQuotaSpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.hard, other.hard); + crate::merge_strategies::map::granular(&mut self.hard, other.hard, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.scope_selector, other.scope_selector); - crate::DeepMerge::merge_from(&mut self.scopes, other.scopes); + crate::merge_strategies::list::atomic(&mut self.scopes, other.scopes); } } diff --git a/src/v1_24/api/core/v1/resource_quota_status.rs b/src/v1_24/api/core/v1/resource_quota_status.rs index 100f418a69..74ee1efe3c 100644 --- a/src/v1_24/api/core/v1/resource_quota_status.rs +++ b/src/v1_24/api/core/v1/resource_quota_status.rs @@ -12,8 +12,12 @@ pub struct ResourceQuotaStatus { impl crate::DeepMerge for ResourceQuotaStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.hard, other.hard); - crate::DeepMerge::merge_from(&mut self.used, other.used); + crate::merge_strategies::map::granular(&mut self.hard, other.hard, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.used, other.used, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); } } diff --git a/src/v1_24/api/core/v1/resource_requirements.rs b/src/v1_24/api/core/v1/resource_requirements.rs index 816608c415..c3f4b1fd86 100644 --- a/src/v1_24/api/core/v1/resource_requirements.rs +++ b/src/v1_24/api/core/v1/resource_requirements.rs @@ -12,8 +12,12 @@ pub struct ResourceRequirements { impl crate::DeepMerge for ResourceRequirements { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.limits, other.limits); - crate::DeepMerge::merge_from(&mut self.requests, other.requests); + crate::merge_strategies::map::granular(&mut self.limits, other.limits, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.requests, other.requests, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); } } diff --git a/src/v1_24/api/core/v1/scope_selector.rs b/src/v1_24/api/core/v1/scope_selector.rs index 22ef180aeb..23ebdb0612 100644 --- a/src/v1_24/api/core/v1/scope_selector.rs +++ b/src/v1_24/api/core/v1/scope_selector.rs @@ -9,7 +9,7 @@ pub struct ScopeSelector { impl crate::DeepMerge for ScopeSelector { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.match_expressions, other.match_expressions); + crate::merge_strategies::list::atomic(&mut self.match_expressions, other.match_expressions); } } diff --git a/src/v1_24/api/core/v1/scoped_resource_selector_requirement.rs b/src/v1_24/api/core/v1/scoped_resource_selector_requirement.rs index 14449d761a..591e72bec0 100644 --- a/src/v1_24/api/core/v1/scoped_resource_selector_requirement.rs +++ b/src/v1_24/api/core/v1/scoped_resource_selector_requirement.rs @@ -19,7 +19,7 @@ impl crate::DeepMerge for ScopedResourceSelectorRequirement { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.operator, other.operator); crate::DeepMerge::merge_from(&mut self.scope_name, other.scope_name); - crate::DeepMerge::merge_from(&mut self.values, other.values); + crate::merge_strategies::list::atomic(&mut self.values, other.values); } } diff --git a/src/v1_24/api/core/v1/secret.rs b/src/v1_24/api/core/v1/secret.rs index 74a33ebe09..eb75155e0d 100644 --- a/src/v1_24/api/core/v1/secret.rs +++ b/src/v1_24/api/core/v1/secret.rs @@ -498,10 +498,14 @@ impl crate::Metadata for Secret { impl crate::DeepMerge for Secret { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.data, other.data); + crate::merge_strategies::map::granular(&mut self.data, other.data, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.immutable, other.immutable); crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.string_data, other.string_data); + crate::merge_strategies::map::granular(&mut self.string_data, other.string_data, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.type_, other.type_); } } diff --git a/src/v1_24/api/core/v1/secret_projection.rs b/src/v1_24/api/core/v1/secret_projection.rs index f32c8fac09..58cd75c106 100644 --- a/src/v1_24/api/core/v1/secret_projection.rs +++ b/src/v1_24/api/core/v1/secret_projection.rs @@ -17,7 +17,7 @@ pub struct SecretProjection { impl crate::DeepMerge for SecretProjection { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.items, other.items); + crate::merge_strategies::list::atomic(&mut self.items, other.items); crate::DeepMerge::merge_from(&mut self.name, other.name); crate::DeepMerge::merge_from(&mut self.optional, other.optional); } diff --git a/src/v1_24/api/core/v1/secret_volume_source.rs b/src/v1_24/api/core/v1/secret_volume_source.rs index 9be0591abd..9d45331f6d 100644 --- a/src/v1_24/api/core/v1/secret_volume_source.rs +++ b/src/v1_24/api/core/v1/secret_volume_source.rs @@ -21,7 +21,7 @@ pub struct SecretVolumeSource { impl crate::DeepMerge for SecretVolumeSource { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.default_mode, other.default_mode); - crate::DeepMerge::merge_from(&mut self.items, other.items); + crate::merge_strategies::list::atomic(&mut self.items, other.items); crate::DeepMerge::merge_from(&mut self.optional, other.optional); crate::DeepMerge::merge_from(&mut self.secret_name, other.secret_name); } diff --git a/src/v1_24/api/core/v1/service_account.rs b/src/v1_24/api/core/v1/service_account.rs index 9cc6535f2a..1f966964fe 100644 --- a/src/v1_24/api/core/v1/service_account.rs +++ b/src/v1_24/api/core/v1/service_account.rs @@ -496,9 +496,16 @@ impl crate::Metadata for ServiceAccount { impl crate::DeepMerge for ServiceAccount { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.automount_service_account_token, other.automount_service_account_token); - crate::DeepMerge::merge_from(&mut self.image_pull_secrets, other.image_pull_secrets); + crate::merge_strategies::list::atomic(&mut self.image_pull_secrets, other.image_pull_secrets); crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.secrets, other.secrets); + crate::merge_strategies::list::map( + &mut self.secrets, + other.secrets, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_24/api/core/v1/service_spec.rs b/src/v1_24/api/core/v1/service_spec.rs index 7822bede34..b4b4c3354e 100644 --- a/src/v1_24/api/core/v1/service_spec.rs +++ b/src/v1_24/api/core/v1/service_spec.rs @@ -72,20 +72,27 @@ impl crate::DeepMerge for ServiceSpec { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.allocate_load_balancer_node_ports, other.allocate_load_balancer_node_ports); crate::DeepMerge::merge_from(&mut self.cluster_ip, other.cluster_ip); - crate::DeepMerge::merge_from(&mut self.cluster_ips, other.cluster_ips); - crate::DeepMerge::merge_from(&mut self.external_ips, other.external_ips); + crate::merge_strategies::list::atomic(&mut self.cluster_ips, other.cluster_ips); + crate::merge_strategies::list::atomic(&mut self.external_ips, other.external_ips); crate::DeepMerge::merge_from(&mut self.external_name, other.external_name); crate::DeepMerge::merge_from(&mut self.external_traffic_policy, other.external_traffic_policy); crate::DeepMerge::merge_from(&mut self.health_check_node_port, other.health_check_node_port); crate::DeepMerge::merge_from(&mut self.internal_traffic_policy, other.internal_traffic_policy); - crate::DeepMerge::merge_from(&mut self.ip_families, other.ip_families); + crate::merge_strategies::list::atomic(&mut self.ip_families, other.ip_families); crate::DeepMerge::merge_from(&mut self.ip_family_policy, other.ip_family_policy); crate::DeepMerge::merge_from(&mut self.load_balancer_class, other.load_balancer_class); crate::DeepMerge::merge_from(&mut self.load_balancer_ip, other.load_balancer_ip); - crate::DeepMerge::merge_from(&mut self.load_balancer_source_ranges, other.load_balancer_source_ranges); - crate::DeepMerge::merge_from(&mut self.ports, other.ports); + crate::merge_strategies::list::atomic(&mut self.load_balancer_source_ranges, other.load_balancer_source_ranges); + crate::merge_strategies::list::map( + &mut self.ports, + other.ports, + &[|lhs, rhs| lhs.port == rhs.port], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.publish_not_ready_addresses, other.publish_not_ready_addresses); - crate::DeepMerge::merge_from(&mut self.selector, other.selector); + crate::merge_strategies::map::atomic(&mut self.selector, other.selector); crate::DeepMerge::merge_from(&mut self.session_affinity, other.session_affinity); crate::DeepMerge::merge_from(&mut self.session_affinity_config, other.session_affinity_config); crate::DeepMerge::merge_from(&mut self.type_, other.type_); diff --git a/src/v1_24/api/core/v1/service_status.rs b/src/v1_24/api/core/v1/service_status.rs index 6c3429fd70..6dece09b96 100644 --- a/src/v1_24/api/core/v1/service_status.rs +++ b/src/v1_24/api/core/v1/service_status.rs @@ -12,7 +12,14 @@ pub struct ServiceStatus { impl crate::DeepMerge for ServiceStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.load_balancer, other.load_balancer); } } diff --git a/src/v1_24/api/core/v1/topology_selector_label_requirement.rs b/src/v1_24/api/core/v1/topology_selector_label_requirement.rs index 3efed6ba65..50764252b6 100644 --- a/src/v1_24/api/core/v1/topology_selector_label_requirement.rs +++ b/src/v1_24/api/core/v1/topology_selector_label_requirement.rs @@ -13,7 +13,7 @@ pub struct TopologySelectorLabelRequirement { impl crate::DeepMerge for TopologySelectorLabelRequirement { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.key, other.key); - crate::DeepMerge::merge_from(&mut self.values, other.values); + crate::merge_strategies::list::atomic(&mut self.values, other.values); } } diff --git a/src/v1_24/api/core/v1/topology_selector_term.rs b/src/v1_24/api/core/v1/topology_selector_term.rs index 230f7ab530..df526d6f4d 100644 --- a/src/v1_24/api/core/v1/topology_selector_term.rs +++ b/src/v1_24/api/core/v1/topology_selector_term.rs @@ -9,7 +9,7 @@ pub struct TopologySelectorTerm { impl crate::DeepMerge for TopologySelectorTerm { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.match_label_expressions, other.match_label_expressions); + crate::merge_strategies::list::atomic(&mut self.match_label_expressions, other.match_label_expressions); } } diff --git a/src/v1_24/api/discovery/v1/endpoint.rs b/src/v1_24/api/discovery/v1/endpoint.rs index 75ec3efa58..bcef66fac1 100644 --- a/src/v1_24/api/discovery/v1/endpoint.rs +++ b/src/v1_24/api/discovery/v1/endpoint.rs @@ -30,9 +30,11 @@ pub struct Endpoint { impl crate::DeepMerge for Endpoint { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.addresses, other.addresses); + crate::merge_strategies::list::set(&mut self.addresses, other.addresses); crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); - crate::DeepMerge::merge_from(&mut self.deprecated_topology, other.deprecated_topology); + crate::merge_strategies::map::granular(&mut self.deprecated_topology, other.deprecated_topology, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.hints, other.hints); crate::DeepMerge::merge_from(&mut self.hostname, other.hostname); crate::DeepMerge::merge_from(&mut self.node_name, other.node_name); diff --git a/src/v1_24/api/discovery/v1/endpoint_hints.rs b/src/v1_24/api/discovery/v1/endpoint_hints.rs index 7fe956528a..02cbd88946 100644 --- a/src/v1_24/api/discovery/v1/endpoint_hints.rs +++ b/src/v1_24/api/discovery/v1/endpoint_hints.rs @@ -9,7 +9,7 @@ pub struct EndpointHints { impl crate::DeepMerge for EndpointHints { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.for_zones, other.for_zones); + crate::merge_strategies::list::atomic(&mut self.for_zones, other.for_zones); } } diff --git a/src/v1_24/api/discovery/v1/endpoint_slice.rs b/src/v1_24/api/discovery/v1/endpoint_slice.rs index 5858e58711..033c1c4e60 100644 --- a/src/v1_24/api/discovery/v1/endpoint_slice.rs +++ b/src/v1_24/api/discovery/v1/endpoint_slice.rs @@ -497,9 +497,9 @@ impl crate::Metadata for EndpointSlice { impl crate::DeepMerge for EndpointSlice { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.address_type, other.address_type); - crate::DeepMerge::merge_from(&mut self.endpoints, other.endpoints); + crate::merge_strategies::list::atomic(&mut self.endpoints, other.endpoints); crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.ports, other.ports); + crate::merge_strategies::list::atomic(&mut self.ports, other.ports); } } diff --git a/src/v1_24/api/discovery/v1beta1/endpoint.rs b/src/v1_24/api/discovery/v1beta1/endpoint.rs index a3c695b36d..93a4f099e8 100644 --- a/src/v1_24/api/discovery/v1beta1/endpoint.rs +++ b/src/v1_24/api/discovery/v1beta1/endpoint.rs @@ -34,13 +34,15 @@ pub struct Endpoint { impl crate::DeepMerge for Endpoint { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.addresses, other.addresses); + crate::merge_strategies::list::set(&mut self.addresses, other.addresses); crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); crate::DeepMerge::merge_from(&mut self.hints, other.hints); crate::DeepMerge::merge_from(&mut self.hostname, other.hostname); crate::DeepMerge::merge_from(&mut self.node_name, other.node_name); crate::DeepMerge::merge_from(&mut self.target_ref, other.target_ref); - crate::DeepMerge::merge_from(&mut self.topology, other.topology); + crate::merge_strategies::map::granular(&mut self.topology, other.topology, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); } } diff --git a/src/v1_24/api/discovery/v1beta1/endpoint_hints.rs b/src/v1_24/api/discovery/v1beta1/endpoint_hints.rs index 3f5bf3905b..57d5cc5553 100644 --- a/src/v1_24/api/discovery/v1beta1/endpoint_hints.rs +++ b/src/v1_24/api/discovery/v1beta1/endpoint_hints.rs @@ -9,7 +9,7 @@ pub struct EndpointHints { impl crate::DeepMerge for EndpointHints { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.for_zones, other.for_zones); + crate::merge_strategies::list::atomic(&mut self.for_zones, other.for_zones); } } diff --git a/src/v1_24/api/discovery/v1beta1/endpoint_slice.rs b/src/v1_24/api/discovery/v1beta1/endpoint_slice.rs index cfe4553dc2..12d89081fa 100644 --- a/src/v1_24/api/discovery/v1beta1/endpoint_slice.rs +++ b/src/v1_24/api/discovery/v1beta1/endpoint_slice.rs @@ -496,9 +496,9 @@ impl crate::Metadata for EndpointSlice { impl crate::DeepMerge for EndpointSlice { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.address_type, other.address_type); - crate::DeepMerge::merge_from(&mut self.endpoints, other.endpoints); + crate::merge_strategies::list::atomic(&mut self.endpoints, other.endpoints); crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.ports, other.ports); + crate::merge_strategies::list::atomic(&mut self.ports, other.ports); } } diff --git a/src/v1_24/api/flowcontrol/v1beta1/flow_schema_spec.rs b/src/v1_24/api/flowcontrol/v1beta1/flow_schema_spec.rs index 40031e5acc..fb04b8c0af 100644 --- a/src/v1_24/api/flowcontrol/v1beta1/flow_schema_spec.rs +++ b/src/v1_24/api/flowcontrol/v1beta1/flow_schema_spec.rs @@ -21,7 +21,7 @@ impl crate::DeepMerge for FlowSchemaSpec { crate::DeepMerge::merge_from(&mut self.distinguisher_method, other.distinguisher_method); crate::DeepMerge::merge_from(&mut self.matching_precedence, other.matching_precedence); crate::DeepMerge::merge_from(&mut self.priority_level_configuration, other.priority_level_configuration); - crate::DeepMerge::merge_from(&mut self.rules, other.rules); + crate::merge_strategies::list::atomic(&mut self.rules, other.rules); } } diff --git a/src/v1_24/api/flowcontrol/v1beta1/flow_schema_status.rs b/src/v1_24/api/flowcontrol/v1beta1/flow_schema_status.rs index c463e68e6a..7de52a1a65 100644 --- a/src/v1_24/api/flowcontrol/v1beta1/flow_schema_status.rs +++ b/src/v1_24/api/flowcontrol/v1beta1/flow_schema_status.rs @@ -9,7 +9,14 @@ pub struct FlowSchemaStatus { impl crate::DeepMerge for FlowSchemaStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_24/api/flowcontrol/v1beta1/non_resource_policy_rule.rs b/src/v1_24/api/flowcontrol/v1beta1/non_resource_policy_rule.rs index 80b8803dc1..ac9b066b17 100644 --- a/src/v1_24/api/flowcontrol/v1beta1/non_resource_policy_rule.rs +++ b/src/v1_24/api/flowcontrol/v1beta1/non_resource_policy_rule.rs @@ -18,8 +18,8 @@ pub struct NonResourcePolicyRule { impl crate::DeepMerge for NonResourcePolicyRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.non_resource_urls, other.non_resource_urls); - crate::DeepMerge::merge_from(&mut self.verbs, other.verbs); + crate::merge_strategies::list::set(&mut self.non_resource_urls, other.non_resource_urls); + crate::merge_strategies::list::set(&mut self.verbs, other.verbs); } } diff --git a/src/v1_24/api/flowcontrol/v1beta1/policy_rules_with_subjects.rs b/src/v1_24/api/flowcontrol/v1beta1/policy_rules_with_subjects.rs index 780a347761..8a727117e0 100644 --- a/src/v1_24/api/flowcontrol/v1beta1/policy_rules_with_subjects.rs +++ b/src/v1_24/api/flowcontrol/v1beta1/policy_rules_with_subjects.rs @@ -15,9 +15,9 @@ pub struct PolicyRulesWithSubjects { impl crate::DeepMerge for PolicyRulesWithSubjects { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.non_resource_rules, other.non_resource_rules); - crate::DeepMerge::merge_from(&mut self.resource_rules, other.resource_rules); - crate::DeepMerge::merge_from(&mut self.subjects, other.subjects); + crate::merge_strategies::list::atomic(&mut self.non_resource_rules, other.non_resource_rules); + crate::merge_strategies::list::atomic(&mut self.resource_rules, other.resource_rules); + crate::merge_strategies::list::atomic(&mut self.subjects, other.subjects); } } diff --git a/src/v1_24/api/flowcontrol/v1beta1/priority_level_configuration_status.rs b/src/v1_24/api/flowcontrol/v1beta1/priority_level_configuration_status.rs index a356b4a6df..e35efdf597 100644 --- a/src/v1_24/api/flowcontrol/v1beta1/priority_level_configuration_status.rs +++ b/src/v1_24/api/flowcontrol/v1beta1/priority_level_configuration_status.rs @@ -9,7 +9,14 @@ pub struct PriorityLevelConfigurationStatus { impl crate::DeepMerge for PriorityLevelConfigurationStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_24/api/flowcontrol/v1beta1/resource_policy_rule.rs b/src/v1_24/api/flowcontrol/v1beta1/resource_policy_rule.rs index 93d3b933e4..895a7e8d48 100644 --- a/src/v1_24/api/flowcontrol/v1beta1/resource_policy_rule.rs +++ b/src/v1_24/api/flowcontrol/v1beta1/resource_policy_rule.rs @@ -21,11 +21,11 @@ pub struct ResourcePolicyRule { impl crate::DeepMerge for ResourcePolicyRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.api_groups, other.api_groups); + crate::merge_strategies::list::set(&mut self.api_groups, other.api_groups); crate::DeepMerge::merge_from(&mut self.cluster_scope, other.cluster_scope); - crate::DeepMerge::merge_from(&mut self.namespaces, other.namespaces); - crate::DeepMerge::merge_from(&mut self.resources, other.resources); - crate::DeepMerge::merge_from(&mut self.verbs, other.verbs); + crate::merge_strategies::list::set(&mut self.namespaces, other.namespaces); + crate::merge_strategies::list::set(&mut self.resources, other.resources); + crate::merge_strategies::list::set(&mut self.verbs, other.verbs); } } diff --git a/src/v1_24/api/flowcontrol/v1beta2/flow_schema_spec.rs b/src/v1_24/api/flowcontrol/v1beta2/flow_schema_spec.rs index e28a19711f..c8c9e2a04f 100644 --- a/src/v1_24/api/flowcontrol/v1beta2/flow_schema_spec.rs +++ b/src/v1_24/api/flowcontrol/v1beta2/flow_schema_spec.rs @@ -21,7 +21,7 @@ impl crate::DeepMerge for FlowSchemaSpec { crate::DeepMerge::merge_from(&mut self.distinguisher_method, other.distinguisher_method); crate::DeepMerge::merge_from(&mut self.matching_precedence, other.matching_precedence); crate::DeepMerge::merge_from(&mut self.priority_level_configuration, other.priority_level_configuration); - crate::DeepMerge::merge_from(&mut self.rules, other.rules); + crate::merge_strategies::list::atomic(&mut self.rules, other.rules); } } diff --git a/src/v1_24/api/flowcontrol/v1beta2/flow_schema_status.rs b/src/v1_24/api/flowcontrol/v1beta2/flow_schema_status.rs index 104835c519..f412d33945 100644 --- a/src/v1_24/api/flowcontrol/v1beta2/flow_schema_status.rs +++ b/src/v1_24/api/flowcontrol/v1beta2/flow_schema_status.rs @@ -9,7 +9,14 @@ pub struct FlowSchemaStatus { impl crate::DeepMerge for FlowSchemaStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_24/api/flowcontrol/v1beta2/non_resource_policy_rule.rs b/src/v1_24/api/flowcontrol/v1beta2/non_resource_policy_rule.rs index e9be9c98a4..f4d3bb0bfc 100644 --- a/src/v1_24/api/flowcontrol/v1beta2/non_resource_policy_rule.rs +++ b/src/v1_24/api/flowcontrol/v1beta2/non_resource_policy_rule.rs @@ -18,8 +18,8 @@ pub struct NonResourcePolicyRule { impl crate::DeepMerge for NonResourcePolicyRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.non_resource_urls, other.non_resource_urls); - crate::DeepMerge::merge_from(&mut self.verbs, other.verbs); + crate::merge_strategies::list::set(&mut self.non_resource_urls, other.non_resource_urls); + crate::merge_strategies::list::set(&mut self.verbs, other.verbs); } } diff --git a/src/v1_24/api/flowcontrol/v1beta2/policy_rules_with_subjects.rs b/src/v1_24/api/flowcontrol/v1beta2/policy_rules_with_subjects.rs index 55c59b24a2..c6b9fafade 100644 --- a/src/v1_24/api/flowcontrol/v1beta2/policy_rules_with_subjects.rs +++ b/src/v1_24/api/flowcontrol/v1beta2/policy_rules_with_subjects.rs @@ -15,9 +15,9 @@ pub struct PolicyRulesWithSubjects { impl crate::DeepMerge for PolicyRulesWithSubjects { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.non_resource_rules, other.non_resource_rules); - crate::DeepMerge::merge_from(&mut self.resource_rules, other.resource_rules); - crate::DeepMerge::merge_from(&mut self.subjects, other.subjects); + crate::merge_strategies::list::atomic(&mut self.non_resource_rules, other.non_resource_rules); + crate::merge_strategies::list::atomic(&mut self.resource_rules, other.resource_rules); + crate::merge_strategies::list::atomic(&mut self.subjects, other.subjects); } } diff --git a/src/v1_24/api/flowcontrol/v1beta2/priority_level_configuration_status.rs b/src/v1_24/api/flowcontrol/v1beta2/priority_level_configuration_status.rs index 3a1f5c9216..6b7d140c4b 100644 --- a/src/v1_24/api/flowcontrol/v1beta2/priority_level_configuration_status.rs +++ b/src/v1_24/api/flowcontrol/v1beta2/priority_level_configuration_status.rs @@ -9,7 +9,14 @@ pub struct PriorityLevelConfigurationStatus { impl crate::DeepMerge for PriorityLevelConfigurationStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_24/api/flowcontrol/v1beta2/resource_policy_rule.rs b/src/v1_24/api/flowcontrol/v1beta2/resource_policy_rule.rs index f4db7b13a2..34f9d52c52 100644 --- a/src/v1_24/api/flowcontrol/v1beta2/resource_policy_rule.rs +++ b/src/v1_24/api/flowcontrol/v1beta2/resource_policy_rule.rs @@ -21,11 +21,11 @@ pub struct ResourcePolicyRule { impl crate::DeepMerge for ResourcePolicyRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.api_groups, other.api_groups); + crate::merge_strategies::list::set(&mut self.api_groups, other.api_groups); crate::DeepMerge::merge_from(&mut self.cluster_scope, other.cluster_scope); - crate::DeepMerge::merge_from(&mut self.namespaces, other.namespaces); - crate::DeepMerge::merge_from(&mut self.resources, other.resources); - crate::DeepMerge::merge_from(&mut self.verbs, other.verbs); + crate::merge_strategies::list::set(&mut self.namespaces, other.namespaces); + crate::merge_strategies::list::set(&mut self.resources, other.resources); + crate::merge_strategies::list::set(&mut self.verbs, other.verbs); } } diff --git a/src/v1_24/api/networking/v1/http_ingress_rule_value.rs b/src/v1_24/api/networking/v1/http_ingress_rule_value.rs index acc836c728..3749783ee2 100644 --- a/src/v1_24/api/networking/v1/http_ingress_rule_value.rs +++ b/src/v1_24/api/networking/v1/http_ingress_rule_value.rs @@ -9,7 +9,7 @@ pub struct HTTPIngressRuleValue { impl crate::DeepMerge for HTTPIngressRuleValue { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.paths, other.paths); + crate::merge_strategies::list::atomic(&mut self.paths, other.paths); } } diff --git a/src/v1_24/api/networking/v1/ingress_spec.rs b/src/v1_24/api/networking/v1/ingress_spec.rs index 68e8606acb..2229a3c788 100644 --- a/src/v1_24/api/networking/v1/ingress_spec.rs +++ b/src/v1_24/api/networking/v1/ingress_spec.rs @@ -20,8 +20,8 @@ impl crate::DeepMerge for IngressSpec { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.default_backend, other.default_backend); crate::DeepMerge::merge_from(&mut self.ingress_class_name, other.ingress_class_name); - crate::DeepMerge::merge_from(&mut self.rules, other.rules); - crate::DeepMerge::merge_from(&mut self.tls, other.tls); + crate::merge_strategies::list::atomic(&mut self.rules, other.rules); + crate::merge_strategies::list::atomic(&mut self.tls, other.tls); } } diff --git a/src/v1_24/api/networking/v1/ingress_tls.rs b/src/v1_24/api/networking/v1/ingress_tls.rs index d48a83a0c4..92c66b754f 100644 --- a/src/v1_24/api/networking/v1/ingress_tls.rs +++ b/src/v1_24/api/networking/v1/ingress_tls.rs @@ -12,7 +12,7 @@ pub struct IngressTLS { impl crate::DeepMerge for IngressTLS { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.hosts, other.hosts); + crate::merge_strategies::list::atomic(&mut self.hosts, other.hosts); crate::DeepMerge::merge_from(&mut self.secret_name, other.secret_name); } } diff --git a/src/v1_24/api/networking/v1/ip_block.rs b/src/v1_24/api/networking/v1/ip_block.rs index 46458b01c5..08d9d2ab61 100644 --- a/src/v1_24/api/networking/v1/ip_block.rs +++ b/src/v1_24/api/networking/v1/ip_block.rs @@ -13,7 +13,7 @@ pub struct IPBlock { impl crate::DeepMerge for IPBlock { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.cidr, other.cidr); - crate::DeepMerge::merge_from(&mut self.except, other.except); + crate::merge_strategies::list::atomic(&mut self.except, other.except); } } diff --git a/src/v1_24/api/networking/v1/network_policy_egress_rule.rs b/src/v1_24/api/networking/v1/network_policy_egress_rule.rs index 33619be210..28eb6a21b6 100644 --- a/src/v1_24/api/networking/v1/network_policy_egress_rule.rs +++ b/src/v1_24/api/networking/v1/network_policy_egress_rule.rs @@ -12,8 +12,8 @@ pub struct NetworkPolicyEgressRule { impl crate::DeepMerge for NetworkPolicyEgressRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.ports, other.ports); - crate::DeepMerge::merge_from(&mut self.to, other.to); + crate::merge_strategies::list::atomic(&mut self.ports, other.ports); + crate::merge_strategies::list::atomic(&mut self.to, other.to); } } diff --git a/src/v1_24/api/networking/v1/network_policy_ingress_rule.rs b/src/v1_24/api/networking/v1/network_policy_ingress_rule.rs index 2c68ec44a7..517765f800 100644 --- a/src/v1_24/api/networking/v1/network_policy_ingress_rule.rs +++ b/src/v1_24/api/networking/v1/network_policy_ingress_rule.rs @@ -12,8 +12,8 @@ pub struct NetworkPolicyIngressRule { impl crate::DeepMerge for NetworkPolicyIngressRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.from, other.from); - crate::DeepMerge::merge_from(&mut self.ports, other.ports); + crate::merge_strategies::list::atomic(&mut self.from, other.from); + crate::merge_strategies::list::atomic(&mut self.ports, other.ports); } } diff --git a/src/v1_24/api/networking/v1/network_policy_spec.rs b/src/v1_24/api/networking/v1/network_policy_spec.rs index ed61b60968..bc980e7469 100644 --- a/src/v1_24/api/networking/v1/network_policy_spec.rs +++ b/src/v1_24/api/networking/v1/network_policy_spec.rs @@ -18,10 +18,10 @@ pub struct NetworkPolicySpec { impl crate::DeepMerge for NetworkPolicySpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.egress, other.egress); - crate::DeepMerge::merge_from(&mut self.ingress, other.ingress); + crate::merge_strategies::list::atomic(&mut self.egress, other.egress); + crate::merge_strategies::list::atomic(&mut self.ingress, other.ingress); crate::DeepMerge::merge_from(&mut self.pod_selector, other.pod_selector); - crate::DeepMerge::merge_from(&mut self.policy_types, other.policy_types); + crate::merge_strategies::list::atomic(&mut self.policy_types, other.policy_types); } } diff --git a/src/v1_24/api/networking/v1/network_policy_status.rs b/src/v1_24/api/networking/v1/network_policy_status.rs index 379f560ac3..55e4312614 100644 --- a/src/v1_24/api/networking/v1/network_policy_status.rs +++ b/src/v1_24/api/networking/v1/network_policy_status.rs @@ -9,7 +9,14 @@ pub struct NetworkPolicyStatus { impl crate::DeepMerge for NetworkPolicyStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_24/api/node/v1/overhead.rs b/src/v1_24/api/node/v1/overhead.rs index ef68cae1c1..2db70b80c4 100644 --- a/src/v1_24/api/node/v1/overhead.rs +++ b/src/v1_24/api/node/v1/overhead.rs @@ -9,7 +9,9 @@ pub struct Overhead { impl crate::DeepMerge for Overhead { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.pod_fixed, other.pod_fixed); + crate::merge_strategies::map::granular(&mut self.pod_fixed, other.pod_fixed, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); } } diff --git a/src/v1_24/api/node/v1/scheduling.rs b/src/v1_24/api/node/v1/scheduling.rs index 1c2b8a05c5..79508f62c2 100644 --- a/src/v1_24/api/node/v1/scheduling.rs +++ b/src/v1_24/api/node/v1/scheduling.rs @@ -12,8 +12,8 @@ pub struct Scheduling { impl crate::DeepMerge for Scheduling { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.node_selector, other.node_selector); - crate::DeepMerge::merge_from(&mut self.tolerations, other.tolerations); + crate::merge_strategies::map::atomic(&mut self.node_selector, other.node_selector); + crate::merge_strategies::list::atomic(&mut self.tolerations, other.tolerations); } } diff --git a/src/v1_24/api/node/v1beta1/overhead.rs b/src/v1_24/api/node/v1beta1/overhead.rs index 53af362cd3..821323b5c0 100644 --- a/src/v1_24/api/node/v1beta1/overhead.rs +++ b/src/v1_24/api/node/v1beta1/overhead.rs @@ -9,7 +9,9 @@ pub struct Overhead { impl crate::DeepMerge for Overhead { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.pod_fixed, other.pod_fixed); + crate::merge_strategies::map::granular(&mut self.pod_fixed, other.pod_fixed, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); } } diff --git a/src/v1_24/api/node/v1beta1/scheduling.rs b/src/v1_24/api/node/v1beta1/scheduling.rs index 9b493fe4cf..1b5f5f638c 100644 --- a/src/v1_24/api/node/v1beta1/scheduling.rs +++ b/src/v1_24/api/node/v1beta1/scheduling.rs @@ -12,8 +12,8 @@ pub struct Scheduling { impl crate::DeepMerge for Scheduling { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.node_selector, other.node_selector); - crate::DeepMerge::merge_from(&mut self.tolerations, other.tolerations); + crate::merge_strategies::map::atomic(&mut self.node_selector, other.node_selector); + crate::merge_strategies::list::atomic(&mut self.tolerations, other.tolerations); } } diff --git a/src/v1_24/api/policy/v1/pod_disruption_budget_status.rs b/src/v1_24/api/policy/v1/pod_disruption_budget_status.rs index f4aa41a86e..cf8b02d00f 100644 --- a/src/v1_24/api/policy/v1/pod_disruption_budget_status.rs +++ b/src/v1_24/api/policy/v1/pod_disruption_budget_status.rs @@ -35,10 +35,19 @@ pub struct PodDisruptionBudgetStatus { impl crate::DeepMerge for PodDisruptionBudgetStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.current_healthy, other.current_healthy); crate::DeepMerge::merge_from(&mut self.desired_healthy, other.desired_healthy); - crate::DeepMerge::merge_from(&mut self.disrupted_pods, other.disrupted_pods); + crate::merge_strategies::map::granular(&mut self.disrupted_pods, other.disrupted_pods, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.disruptions_allowed, other.disruptions_allowed); crate::DeepMerge::merge_from(&mut self.expected_pods, other.expected_pods); crate::DeepMerge::merge_from(&mut self.observed_generation, other.observed_generation); diff --git a/src/v1_24/api/policy/v1beta1/fs_group_strategy_options.rs b/src/v1_24/api/policy/v1beta1/fs_group_strategy_options.rs index 80e63553ac..c52d53d54c 100644 --- a/src/v1_24/api/policy/v1beta1/fs_group_strategy_options.rs +++ b/src/v1_24/api/policy/v1beta1/fs_group_strategy_options.rs @@ -12,7 +12,7 @@ pub struct FSGroupStrategyOptions { impl crate::DeepMerge for FSGroupStrategyOptions { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.ranges, other.ranges); + crate::merge_strategies::list::atomic(&mut self.ranges, other.ranges); crate::DeepMerge::merge_from(&mut self.rule, other.rule); } } diff --git a/src/v1_24/api/policy/v1beta1/pod_disruption_budget_status.rs b/src/v1_24/api/policy/v1beta1/pod_disruption_budget_status.rs index 72a03073f6..17f1fa562a 100644 --- a/src/v1_24/api/policy/v1beta1/pod_disruption_budget_status.rs +++ b/src/v1_24/api/policy/v1beta1/pod_disruption_budget_status.rs @@ -35,10 +35,19 @@ pub struct PodDisruptionBudgetStatus { impl crate::DeepMerge for PodDisruptionBudgetStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.current_healthy, other.current_healthy); crate::DeepMerge::merge_from(&mut self.desired_healthy, other.desired_healthy); - crate::DeepMerge::merge_from(&mut self.disrupted_pods, other.disrupted_pods); + crate::merge_strategies::map::granular(&mut self.disrupted_pods, other.disrupted_pods, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.disruptions_allowed, other.disruptions_allowed); crate::DeepMerge::merge_from(&mut self.expected_pods, other.expected_pods); crate::DeepMerge::merge_from(&mut self.observed_generation, other.observed_generation); diff --git a/src/v1_24/api/policy/v1beta1/pod_security_policy_spec.rs b/src/v1_24/api/policy/v1beta1/pod_security_policy_spec.rs index b4f2ca8c67..e9a43ffbac 100644 --- a/src/v1_24/api/policy/v1beta1/pod_security_policy_spec.rs +++ b/src/v1_24/api/policy/v1beta1/pod_security_policy_spec.rs @@ -83,29 +83,29 @@ pub struct PodSecurityPolicySpec { impl crate::DeepMerge for PodSecurityPolicySpec { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.allow_privilege_escalation, other.allow_privilege_escalation); - crate::DeepMerge::merge_from(&mut self.allowed_csi_drivers, other.allowed_csi_drivers); - crate::DeepMerge::merge_from(&mut self.allowed_capabilities, other.allowed_capabilities); - crate::DeepMerge::merge_from(&mut self.allowed_flex_volumes, other.allowed_flex_volumes); - crate::DeepMerge::merge_from(&mut self.allowed_host_paths, other.allowed_host_paths); - crate::DeepMerge::merge_from(&mut self.allowed_proc_mount_types, other.allowed_proc_mount_types); - crate::DeepMerge::merge_from(&mut self.allowed_unsafe_sysctls, other.allowed_unsafe_sysctls); - crate::DeepMerge::merge_from(&mut self.default_add_capabilities, other.default_add_capabilities); + crate::merge_strategies::list::atomic(&mut self.allowed_csi_drivers, other.allowed_csi_drivers); + crate::merge_strategies::list::atomic(&mut self.allowed_capabilities, other.allowed_capabilities); + crate::merge_strategies::list::atomic(&mut self.allowed_flex_volumes, other.allowed_flex_volumes); + crate::merge_strategies::list::atomic(&mut self.allowed_host_paths, other.allowed_host_paths); + crate::merge_strategies::list::atomic(&mut self.allowed_proc_mount_types, other.allowed_proc_mount_types); + crate::merge_strategies::list::atomic(&mut self.allowed_unsafe_sysctls, other.allowed_unsafe_sysctls); + crate::merge_strategies::list::atomic(&mut self.default_add_capabilities, other.default_add_capabilities); crate::DeepMerge::merge_from(&mut self.default_allow_privilege_escalation, other.default_allow_privilege_escalation); - crate::DeepMerge::merge_from(&mut self.forbidden_sysctls, other.forbidden_sysctls); + crate::merge_strategies::list::atomic(&mut self.forbidden_sysctls, other.forbidden_sysctls); crate::DeepMerge::merge_from(&mut self.fs_group, other.fs_group); crate::DeepMerge::merge_from(&mut self.host_ipc, other.host_ipc); crate::DeepMerge::merge_from(&mut self.host_network, other.host_network); crate::DeepMerge::merge_from(&mut self.host_pid, other.host_pid); - crate::DeepMerge::merge_from(&mut self.host_ports, other.host_ports); + crate::merge_strategies::list::atomic(&mut self.host_ports, other.host_ports); crate::DeepMerge::merge_from(&mut self.privileged, other.privileged); crate::DeepMerge::merge_from(&mut self.read_only_root_filesystem, other.read_only_root_filesystem); - crate::DeepMerge::merge_from(&mut self.required_drop_capabilities, other.required_drop_capabilities); + crate::merge_strategies::list::atomic(&mut self.required_drop_capabilities, other.required_drop_capabilities); crate::DeepMerge::merge_from(&mut self.run_as_group, other.run_as_group); crate::DeepMerge::merge_from(&mut self.run_as_user, other.run_as_user); crate::DeepMerge::merge_from(&mut self.runtime_class, other.runtime_class); crate::DeepMerge::merge_from(&mut self.se_linux, other.se_linux); crate::DeepMerge::merge_from(&mut self.supplemental_groups, other.supplemental_groups); - crate::DeepMerge::merge_from(&mut self.volumes, other.volumes); + crate::merge_strategies::list::atomic(&mut self.volumes, other.volumes); } } diff --git a/src/v1_24/api/policy/v1beta1/run_as_group_strategy_options.rs b/src/v1_24/api/policy/v1beta1/run_as_group_strategy_options.rs index 89e97b5842..25aa6f1e66 100644 --- a/src/v1_24/api/policy/v1beta1/run_as_group_strategy_options.rs +++ b/src/v1_24/api/policy/v1beta1/run_as_group_strategy_options.rs @@ -12,7 +12,7 @@ pub struct RunAsGroupStrategyOptions { impl crate::DeepMerge for RunAsGroupStrategyOptions { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.ranges, other.ranges); + crate::merge_strategies::list::atomic(&mut self.ranges, other.ranges); crate::DeepMerge::merge_from(&mut self.rule, other.rule); } } diff --git a/src/v1_24/api/policy/v1beta1/run_as_user_strategy_options.rs b/src/v1_24/api/policy/v1beta1/run_as_user_strategy_options.rs index aeeda6f381..a28c259366 100644 --- a/src/v1_24/api/policy/v1beta1/run_as_user_strategy_options.rs +++ b/src/v1_24/api/policy/v1beta1/run_as_user_strategy_options.rs @@ -12,7 +12,7 @@ pub struct RunAsUserStrategyOptions { impl crate::DeepMerge for RunAsUserStrategyOptions { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.ranges, other.ranges); + crate::merge_strategies::list::atomic(&mut self.ranges, other.ranges); crate::DeepMerge::merge_from(&mut self.rule, other.rule); } } diff --git a/src/v1_24/api/policy/v1beta1/runtime_class_strategy_options.rs b/src/v1_24/api/policy/v1beta1/runtime_class_strategy_options.rs index 5f80a6b7e7..085d36d69f 100644 --- a/src/v1_24/api/policy/v1beta1/runtime_class_strategy_options.rs +++ b/src/v1_24/api/policy/v1beta1/runtime_class_strategy_options.rs @@ -12,7 +12,7 @@ pub struct RuntimeClassStrategyOptions { impl crate::DeepMerge for RuntimeClassStrategyOptions { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.allowed_runtime_class_names, other.allowed_runtime_class_names); + crate::merge_strategies::list::atomic(&mut self.allowed_runtime_class_names, other.allowed_runtime_class_names); crate::DeepMerge::merge_from(&mut self.default_runtime_class_name, other.default_runtime_class_name); } } diff --git a/src/v1_24/api/policy/v1beta1/supplemental_groups_strategy_options.rs b/src/v1_24/api/policy/v1beta1/supplemental_groups_strategy_options.rs index 7e83b2e756..4bcc23b7e2 100644 --- a/src/v1_24/api/policy/v1beta1/supplemental_groups_strategy_options.rs +++ b/src/v1_24/api/policy/v1beta1/supplemental_groups_strategy_options.rs @@ -12,7 +12,7 @@ pub struct SupplementalGroupsStrategyOptions { impl crate::DeepMerge for SupplementalGroupsStrategyOptions { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.ranges, other.ranges); + crate::merge_strategies::list::atomic(&mut self.ranges, other.ranges); crate::DeepMerge::merge_from(&mut self.rule, other.rule); } } diff --git a/src/v1_24/api/rbac/v1/aggregation_rule.rs b/src/v1_24/api/rbac/v1/aggregation_rule.rs index 5ccc4984f6..b20ce61705 100644 --- a/src/v1_24/api/rbac/v1/aggregation_rule.rs +++ b/src/v1_24/api/rbac/v1/aggregation_rule.rs @@ -9,7 +9,7 @@ pub struct AggregationRule { impl crate::DeepMerge for AggregationRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.cluster_role_selectors, other.cluster_role_selectors); + crate::merge_strategies::list::atomic(&mut self.cluster_role_selectors, other.cluster_role_selectors); } } diff --git a/src/v1_24/api/rbac/v1/cluster_role.rs b/src/v1_24/api/rbac/v1/cluster_role.rs index 8336e14c92..a6f832b593 100644 --- a/src/v1_24/api/rbac/v1/cluster_role.rs +++ b/src/v1_24/api/rbac/v1/cluster_role.rs @@ -378,7 +378,7 @@ impl crate::DeepMerge for ClusterRole { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.aggregation_rule, other.aggregation_rule); crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.rules, other.rules); + crate::merge_strategies::list::atomic(&mut self.rules, other.rules); } } 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..04fa2bd714 100644 --- a/src/v1_24/api/rbac/v1/cluster_role_binding.rs +++ b/src/v1_24/api/rbac/v1/cluster_role_binding.rs @@ -378,7 +378,7 @@ impl crate::DeepMerge for ClusterRoleBinding { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); crate::DeepMerge::merge_from(&mut self.role_ref, other.role_ref); - crate::DeepMerge::merge_from(&mut self.subjects, other.subjects); + crate::merge_strategies::list::atomic(&mut self.subjects, other.subjects); } } diff --git a/src/v1_24/api/rbac/v1/policy_rule.rs b/src/v1_24/api/rbac/v1/policy_rule.rs index 21bf6df652..24416f2b0f 100644 --- a/src/v1_24/api/rbac/v1/policy_rule.rs +++ b/src/v1_24/api/rbac/v1/policy_rule.rs @@ -21,11 +21,11 @@ pub struct PolicyRule { impl crate::DeepMerge for PolicyRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.api_groups, other.api_groups); - crate::DeepMerge::merge_from(&mut self.non_resource_urls, other.non_resource_urls); - crate::DeepMerge::merge_from(&mut self.resource_names, other.resource_names); - crate::DeepMerge::merge_from(&mut self.resources, other.resources); - crate::DeepMerge::merge_from(&mut self.verbs, other.verbs); + crate::merge_strategies::list::atomic(&mut self.api_groups, other.api_groups); + crate::merge_strategies::list::atomic(&mut self.non_resource_urls, other.non_resource_urls); + crate::merge_strategies::list::atomic(&mut self.resource_names, other.resource_names); + crate::merge_strategies::list::atomic(&mut self.resources, other.resources); + crate::merge_strategies::list::atomic(&mut self.verbs, other.verbs); } } diff --git a/src/v1_24/api/rbac/v1/role.rs b/src/v1_24/api/rbac/v1/role.rs index 9764bc7aa0..719ecb92b0 100644 --- a/src/v1_24/api/rbac/v1/role.rs +++ b/src/v1_24/api/rbac/v1/role.rs @@ -490,7 +490,7 @@ impl crate::Metadata for Role { impl crate::DeepMerge for Role { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.rules, other.rules); + crate::merge_strategies::list::atomic(&mut self.rules, other.rules); } } diff --git a/src/v1_24/api/rbac/v1/role_binding.rs b/src/v1_24/api/rbac/v1/role_binding.rs index ac11e857c2..7b9059076a 100644 --- a/src/v1_24/api/rbac/v1/role_binding.rs +++ b/src/v1_24/api/rbac/v1/role_binding.rs @@ -494,7 +494,7 @@ impl crate::DeepMerge for RoleBinding { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); crate::DeepMerge::merge_from(&mut self.role_ref, other.role_ref); - crate::DeepMerge::merge_from(&mut self.subjects, other.subjects); + crate::merge_strategies::list::atomic(&mut self.subjects, other.subjects); } } diff --git a/src/v1_24/api/storage/v1/csi_driver_spec.rs b/src/v1_24/api/storage/v1/csi_driver_spec.rs index 3c115cbf87..233fe763b4 100644 --- a/src/v1_24/api/storage/v1/csi_driver_spec.rs +++ b/src/v1_24/api/storage/v1/csi_driver_spec.rs @@ -61,8 +61,8 @@ impl crate::DeepMerge for CSIDriverSpec { crate::DeepMerge::merge_from(&mut self.pod_info_on_mount, other.pod_info_on_mount); crate::DeepMerge::merge_from(&mut self.requires_republish, other.requires_republish); crate::DeepMerge::merge_from(&mut self.storage_capacity, other.storage_capacity); - crate::DeepMerge::merge_from(&mut self.token_requests, other.token_requests); - crate::DeepMerge::merge_from(&mut self.volume_lifecycle_modes, other.volume_lifecycle_modes); + crate::merge_strategies::list::atomic(&mut self.token_requests, other.token_requests); + crate::merge_strategies::list::set(&mut self.volume_lifecycle_modes, other.volume_lifecycle_modes); } } diff --git a/src/v1_24/api/storage/v1/csi_node_driver.rs b/src/v1_24/api/storage/v1/csi_node_driver.rs index c113299390..d8b79d89f3 100644 --- a/src/v1_24/api/storage/v1/csi_node_driver.rs +++ b/src/v1_24/api/storage/v1/csi_node_driver.rs @@ -21,7 +21,7 @@ impl crate::DeepMerge for CSINodeDriver { crate::DeepMerge::merge_from(&mut self.allocatable, other.allocatable); crate::DeepMerge::merge_from(&mut self.name, other.name); crate::DeepMerge::merge_from(&mut self.node_id, other.node_id); - crate::DeepMerge::merge_from(&mut self.topology_keys, other.topology_keys); + crate::merge_strategies::list::atomic(&mut self.topology_keys, other.topology_keys); } } diff --git a/src/v1_24/api/storage/v1/csi_node_spec.rs b/src/v1_24/api/storage/v1/csi_node_spec.rs index ea2a1ddb97..4717576df8 100644 --- a/src/v1_24/api/storage/v1/csi_node_spec.rs +++ b/src/v1_24/api/storage/v1/csi_node_spec.rs @@ -9,7 +9,14 @@ pub struct CSINodeSpec { impl crate::DeepMerge for CSINodeSpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.drivers, other.drivers); + crate::merge_strategies::list::map( + &mut self.drivers, + other.drivers, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_24/api/storage/v1/storage_class.rs b/src/v1_24/api/storage/v1/storage_class.rs index 2bf8e65456..12774ba320 100644 --- a/src/v1_24/api/storage/v1/storage_class.rs +++ b/src/v1_24/api/storage/v1/storage_class.rs @@ -394,10 +394,12 @@ impl crate::Metadata for StorageClass { impl crate::DeepMerge for StorageClass { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.allow_volume_expansion, other.allow_volume_expansion); - crate::DeepMerge::merge_from(&mut self.allowed_topologies, other.allowed_topologies); + crate::merge_strategies::list::atomic(&mut self.allowed_topologies, other.allowed_topologies); crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.mount_options, other.mount_options); - crate::DeepMerge::merge_from(&mut self.parameters, other.parameters); + crate::merge_strategies::list::atomic(&mut self.mount_options, other.mount_options); + crate::merge_strategies::map::granular(&mut self.parameters, other.parameters, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.provisioner, other.provisioner); crate::DeepMerge::merge_from(&mut self.reclaim_policy, other.reclaim_policy); crate::DeepMerge::merge_from(&mut self.volume_binding_mode, other.volume_binding_mode); diff --git a/src/v1_24/api/storage/v1/volume_attachment_status.rs b/src/v1_24/api/storage/v1/volume_attachment_status.rs index fb8e63d745..bb6ba3fe42 100644 --- a/src/v1_24/api/storage/v1/volume_attachment_status.rs +++ b/src/v1_24/api/storage/v1/volume_attachment_status.rs @@ -20,7 +20,9 @@ impl crate::DeepMerge for VolumeAttachmentStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.attach_error, other.attach_error); crate::DeepMerge::merge_from(&mut self.attached, other.attached); - crate::DeepMerge::merge_from(&mut self.attachment_metadata, other.attachment_metadata); + crate::merge_strategies::map::granular(&mut self.attachment_metadata, other.attachment_metadata, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.detach_error, other.detach_error); } } diff --git a/src/v1_24/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_names.rs b/src/v1_24/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_names.rs index f3a8d38696..d105542807 100644 --- a/src/v1_24/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_names.rs +++ b/src/v1_24/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_names.rs @@ -24,11 +24,11 @@ pub struct CustomResourceDefinitionNames { impl crate::DeepMerge for CustomResourceDefinitionNames { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.categories, other.categories); + crate::merge_strategies::list::atomic(&mut self.categories, other.categories); crate::DeepMerge::merge_from(&mut self.kind, other.kind); crate::DeepMerge::merge_from(&mut self.list_kind, other.list_kind); crate::DeepMerge::merge_from(&mut self.plural, other.plural); - crate::DeepMerge::merge_from(&mut self.short_names, other.short_names); + crate::merge_strategies::list::atomic(&mut self.short_names, other.short_names); crate::DeepMerge::merge_from(&mut self.singular, other.singular); } } diff --git a/src/v1_24/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_spec.rs b/src/v1_24/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_spec.rs index 40ffea9ed1..e3a881e9a4 100644 --- a/src/v1_24/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_spec.rs +++ b/src/v1_24/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_spec.rs @@ -29,7 +29,7 @@ impl crate::DeepMerge for CustomResourceDefinitionSpec { crate::DeepMerge::merge_from(&mut self.names, other.names); crate::DeepMerge::merge_from(&mut self.preserve_unknown_fields, other.preserve_unknown_fields); crate::DeepMerge::merge_from(&mut self.scope, other.scope); - crate::DeepMerge::merge_from(&mut self.versions, other.versions); + crate::merge_strategies::list::atomic(&mut self.versions, other.versions); } } diff --git a/src/v1_24/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_status.rs b/src/v1_24/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_status.rs index a7427347aa..d080a301dc 100644 --- a/src/v1_24/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_status.rs +++ b/src/v1_24/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_status.rs @@ -16,8 +16,15 @@ pub struct CustomResourceDefinitionStatus { impl crate::DeepMerge for CustomResourceDefinitionStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.accepted_names, other.accepted_names); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); - crate::DeepMerge::merge_from(&mut self.stored_versions, other.stored_versions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::list::atomic(&mut self.stored_versions, other.stored_versions); } } diff --git a/src/v1_24/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_version.rs b/src/v1_24/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_version.rs index 5b4d51a697..90a9bb5e32 100644 --- a/src/v1_24/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_version.rs +++ b/src/v1_24/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_version.rs @@ -30,7 +30,7 @@ pub struct CustomResourceDefinitionVersion { impl crate::DeepMerge for CustomResourceDefinitionVersion { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.additional_printer_columns, other.additional_printer_columns); + crate::merge_strategies::list::atomic(&mut self.additional_printer_columns, other.additional_printer_columns); crate::DeepMerge::merge_from(&mut self.deprecated, other.deprecated); crate::DeepMerge::merge_from(&mut self.deprecation_warning, other.deprecation_warning); crate::DeepMerge::merge_from(&mut self.name, other.name); diff --git a/src/v1_24/apiextensions_apiserver/pkg/apis/apiextensions/v1/json_schema_props.rs b/src/v1_24/apiextensions_apiserver/pkg/apis/apiextensions/v1/json_schema_props.rs index 3c8b45d0b0..a871ebe8a6 100644 --- a/src/v1_24/apiextensions_apiserver/pkg/apis/apiextensions/v1/json_schema_props.rs +++ b/src/v1_24/apiextensions_apiserver/pkg/apis/apiextensions/v1/json_schema_props.rs @@ -142,13 +142,17 @@ impl crate::DeepMerge for JSONSchemaProps { crate::DeepMerge::merge_from(&mut self.schema, other.schema); crate::DeepMerge::merge_from(&mut self.additional_items, other.additional_items); crate::DeepMerge::merge_from(&mut self.additional_properties, other.additional_properties); - crate::DeepMerge::merge_from(&mut self.all_of, other.all_of); - crate::DeepMerge::merge_from(&mut self.any_of, other.any_of); + crate::merge_strategies::list::atomic(&mut self.all_of, other.all_of); + crate::merge_strategies::list::atomic(&mut self.any_of, other.any_of); crate::DeepMerge::merge_from(&mut self.default, other.default); - crate::DeepMerge::merge_from(&mut self.definitions, other.definitions); - crate::DeepMerge::merge_from(&mut self.dependencies, other.dependencies); + crate::merge_strategies::map::granular(&mut self.definitions, other.definitions, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.dependencies, other.dependencies, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.description, other.description); - crate::DeepMerge::merge_from(&mut self.enum_, other.enum_); + crate::merge_strategies::list::atomic(&mut self.enum_, other.enum_); crate::DeepMerge::merge_from(&mut self.example, other.example); crate::DeepMerge::merge_from(&mut self.exclusive_maximum, other.exclusive_maximum); crate::DeepMerge::merge_from(&mut self.exclusive_minimum, other.exclusive_minimum); @@ -167,21 +171,32 @@ impl crate::DeepMerge for JSONSchemaProps { crate::DeepMerge::merge_from(&mut self.multiple_of, other.multiple_of); crate::DeepMerge::merge_from(&mut self.not, other.not); crate::DeepMerge::merge_from(&mut self.nullable, other.nullable); - crate::DeepMerge::merge_from(&mut self.one_of, other.one_of); + crate::merge_strategies::list::atomic(&mut self.one_of, other.one_of); crate::DeepMerge::merge_from(&mut self.pattern, other.pattern); - crate::DeepMerge::merge_from(&mut self.pattern_properties, other.pattern_properties); - crate::DeepMerge::merge_from(&mut self.properties, other.properties); - crate::DeepMerge::merge_from(&mut self.required, other.required); + crate::merge_strategies::map::granular(&mut self.pattern_properties, other.pattern_properties, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.properties, other.properties, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::list::atomic(&mut self.required, other.required); crate::DeepMerge::merge_from(&mut self.title, other.title); crate::DeepMerge::merge_from(&mut self.type_, other.type_); crate::DeepMerge::merge_from(&mut self.unique_items, other.unique_items); crate::DeepMerge::merge_from(&mut self.x_kubernetes_embedded_resource, other.x_kubernetes_embedded_resource); crate::DeepMerge::merge_from(&mut self.x_kubernetes_int_or_string, other.x_kubernetes_int_or_string); - crate::DeepMerge::merge_from(&mut self.x_kubernetes_list_map_keys, other.x_kubernetes_list_map_keys); + crate::merge_strategies::list::atomic(&mut self.x_kubernetes_list_map_keys, other.x_kubernetes_list_map_keys); crate::DeepMerge::merge_from(&mut self.x_kubernetes_list_type, other.x_kubernetes_list_type); crate::DeepMerge::merge_from(&mut self.x_kubernetes_map_type, other.x_kubernetes_map_type); crate::DeepMerge::merge_from(&mut self.x_kubernetes_preserve_unknown_fields, other.x_kubernetes_preserve_unknown_fields); - crate::DeepMerge::merge_from(&mut self.x_kubernetes_validations, other.x_kubernetes_validations); + crate::merge_strategies::list::map( + &mut self.x_kubernetes_validations, + other.x_kubernetes_validations, + &[|lhs, rhs| lhs.rule == rhs.rule], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_24/apiextensions_apiserver/pkg/apis/apiextensions/v1/webhook_conversion.rs b/src/v1_24/apiextensions_apiserver/pkg/apis/apiextensions/v1/webhook_conversion.rs index aec75dfd39..69008b2dca 100644 --- a/src/v1_24/apiextensions_apiserver/pkg/apis/apiextensions/v1/webhook_conversion.rs +++ b/src/v1_24/apiextensions_apiserver/pkg/apis/apiextensions/v1/webhook_conversion.rs @@ -13,7 +13,7 @@ pub struct WebhookConversion { impl crate::DeepMerge for WebhookConversion { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.client_config, other.client_config); - crate::DeepMerge::merge_from(&mut self.conversion_review_versions, other.conversion_review_versions); + crate::merge_strategies::list::atomic(&mut self.conversion_review_versions, other.conversion_review_versions); } } diff --git a/src/v1_24/apimachinery/pkg/apis/meta/v1/api_group.rs b/src/v1_24/apimachinery/pkg/apis/meta/v1/api_group.rs index 3d36440e87..f83318ab08 100644 --- a/src/v1_24/apimachinery/pkg/apis/meta/v1/api_group.rs +++ b/src/v1_24/apimachinery/pkg/apis/meta/v1/api_group.rs @@ -29,8 +29,8 @@ impl crate::DeepMerge for APIGroup { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.name, other.name); crate::DeepMerge::merge_from(&mut self.preferred_version, other.preferred_version); - crate::DeepMerge::merge_from(&mut self.server_address_by_client_cidrs, other.server_address_by_client_cidrs); - crate::DeepMerge::merge_from(&mut self.versions, other.versions); + crate::merge_strategies::list::atomic(&mut self.server_address_by_client_cidrs, other.server_address_by_client_cidrs); + crate::merge_strategies::list::atomic(&mut self.versions, other.versions); } } diff --git a/src/v1_24/apimachinery/pkg/apis/meta/v1/api_group_list.rs b/src/v1_24/apimachinery/pkg/apis/meta/v1/api_group_list.rs index 167aeeabe0..e8a5d7e747 100644 --- a/src/v1_24/apimachinery/pkg/apis/meta/v1/api_group_list.rs +++ b/src/v1_24/apimachinery/pkg/apis/meta/v1/api_group_list.rs @@ -18,7 +18,7 @@ impl crate::Resource for APIGroupList { impl crate::DeepMerge for APIGroupList { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.groups, other.groups); + crate::merge_strategies::list::atomic(&mut self.groups, other.groups); } } diff --git a/src/v1_24/apimachinery/pkg/apis/meta/v1/api_resource.rs b/src/v1_24/apimachinery/pkg/apis/meta/v1/api_resource.rs index e679e8aa73..477c5ad98d 100644 --- a/src/v1_24/apimachinery/pkg/apis/meta/v1/api_resource.rs +++ b/src/v1_24/apimachinery/pkg/apis/meta/v1/api_resource.rs @@ -36,15 +36,15 @@ pub struct APIResource { impl crate::DeepMerge for APIResource { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.categories, other.categories); + crate::merge_strategies::list::atomic(&mut self.categories, other.categories); crate::DeepMerge::merge_from(&mut self.group, other.group); crate::DeepMerge::merge_from(&mut self.kind, other.kind); crate::DeepMerge::merge_from(&mut self.name, other.name); crate::DeepMerge::merge_from(&mut self.namespaced, other.namespaced); - crate::DeepMerge::merge_from(&mut self.short_names, other.short_names); + crate::merge_strategies::list::atomic(&mut self.short_names, other.short_names); crate::DeepMerge::merge_from(&mut self.singular_name, other.singular_name); crate::DeepMerge::merge_from(&mut self.storage_version_hash, other.storage_version_hash); - crate::DeepMerge::merge_from(&mut self.verbs, other.verbs); + crate::merge_strategies::list::atomic(&mut self.verbs, other.verbs); crate::DeepMerge::merge_from(&mut self.version, other.version); } } diff --git a/src/v1_24/apimachinery/pkg/apis/meta/v1/api_resource_list.rs b/src/v1_24/apimachinery/pkg/apis/meta/v1/api_resource_list.rs index a34ba733a3..4107b4f488 100644 --- a/src/v1_24/apimachinery/pkg/apis/meta/v1/api_resource_list.rs +++ b/src/v1_24/apimachinery/pkg/apis/meta/v1/api_resource_list.rs @@ -22,7 +22,7 @@ impl crate::Resource for APIResourceList { impl crate::DeepMerge for APIResourceList { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.group_version, other.group_version); - crate::DeepMerge::merge_from(&mut self.resources, other.resources); + crate::merge_strategies::list::atomic(&mut self.resources, other.resources); } } diff --git a/src/v1_24/apimachinery/pkg/apis/meta/v1/api_versions.rs b/src/v1_24/apimachinery/pkg/apis/meta/v1/api_versions.rs index a2d355ee8d..eda4a89785 100644 --- a/src/v1_24/apimachinery/pkg/apis/meta/v1/api_versions.rs +++ b/src/v1_24/apimachinery/pkg/apis/meta/v1/api_versions.rs @@ -21,8 +21,8 @@ impl crate::Resource for APIVersions { impl crate::DeepMerge for APIVersions { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.server_address_by_client_cidrs, other.server_address_by_client_cidrs); - crate::DeepMerge::merge_from(&mut self.versions, other.versions); + crate::merge_strategies::list::atomic(&mut self.server_address_by_client_cidrs, other.server_address_by_client_cidrs); + crate::merge_strategies::list::atomic(&mut self.versions, other.versions); } } diff --git a/src/v1_24/apimachinery/pkg/apis/meta/v1/delete_options.rs b/src/v1_24/apimachinery/pkg/apis/meta/v1/delete_options.rs index 04abc8215b..4ac6d24fb9 100644 --- a/src/v1_24/apimachinery/pkg/apis/meta/v1/delete_options.rs +++ b/src/v1_24/apimachinery/pkg/apis/meta/v1/delete_options.rs @@ -28,7 +28,7 @@ pub struct DeleteOptions { impl crate::DeepMerge for DeleteOptions { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.api_version, other.api_version); - crate::DeepMerge::merge_from(&mut self.dry_run, other.dry_run); + crate::merge_strategies::list::atomic(&mut self.dry_run, other.dry_run); crate::DeepMerge::merge_from(&mut self.grace_period_seconds, other.grace_period_seconds); crate::DeepMerge::merge_from(&mut self.kind, other.kind); crate::DeepMerge::merge_from(&mut self.orphan_dependents, other.orphan_dependents); diff --git a/src/v1_24/apimachinery/pkg/apis/meta/v1/label_selector.rs b/src/v1_24/apimachinery/pkg/apis/meta/v1/label_selector.rs index 877caad4dd..19028abb99 100644 --- a/src/v1_24/apimachinery/pkg/apis/meta/v1/label_selector.rs +++ b/src/v1_24/apimachinery/pkg/apis/meta/v1/label_selector.rs @@ -12,8 +12,10 @@ pub struct LabelSelector { impl crate::DeepMerge for LabelSelector { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.match_expressions, other.match_expressions); - crate::DeepMerge::merge_from(&mut self.match_labels, other.match_labels); + crate::merge_strategies::list::atomic(&mut self.match_expressions, other.match_expressions); + crate::merge_strategies::map::granular(&mut self.match_labels, other.match_labels, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); } } diff --git a/src/v1_24/apimachinery/pkg/apis/meta/v1/label_selector_requirement.rs b/src/v1_24/apimachinery/pkg/apis/meta/v1/label_selector_requirement.rs index 6570daea42..09c7dc7cc7 100644 --- a/src/v1_24/apimachinery/pkg/apis/meta/v1/label_selector_requirement.rs +++ b/src/v1_24/apimachinery/pkg/apis/meta/v1/label_selector_requirement.rs @@ -17,7 +17,7 @@ impl crate::DeepMerge for LabelSelectorRequirement { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.key, other.key); crate::DeepMerge::merge_from(&mut self.operator, other.operator); - crate::DeepMerge::merge_from(&mut self.values, other.values); + crate::merge_strategies::list::atomic(&mut self.values, other.values); } } 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..7a3f8b0e70 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 @@ -70,19 +70,30 @@ pub struct ObjectMeta { impl crate::DeepMerge for ObjectMeta { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.annotations, other.annotations); + crate::merge_strategies::map::granular(&mut self.annotations, other.annotations, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); 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::merge_strategies::list::set(&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::merge_strategies::map::granular(&mut self.labels, other.labels, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::list::atomic(&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::merge_strategies::list::map( + &mut self.owner_references, + other.owner_references, + &[|lhs, rhs| lhs.uid == rhs.uid], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); 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); diff --git a/src/v1_24/apimachinery/pkg/apis/meta/v1/status_details.rs b/src/v1_24/apimachinery/pkg/apis/meta/v1/status_details.rs index 183b525d2c..28141f7f6f 100644 --- a/src/v1_24/apimachinery/pkg/apis/meta/v1/status_details.rs +++ b/src/v1_24/apimachinery/pkg/apis/meta/v1/status_details.rs @@ -24,7 +24,7 @@ pub struct StatusDetails { impl crate::DeepMerge for StatusDetails { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.causes, other.causes); + crate::merge_strategies::list::atomic(&mut self.causes, other.causes); crate::DeepMerge::merge_from(&mut self.group, other.group); crate::DeepMerge::merge_from(&mut self.kind, other.kind); crate::DeepMerge::merge_from(&mut self.name, other.name); diff --git a/src/v1_24/kube_aggregator/pkg/apis/apiregistration/v1/api_service_status.rs b/src/v1_24/kube_aggregator/pkg/apis/apiregistration/v1/api_service_status.rs index 658b6ca9ce..72a107b6ba 100644 --- a/src/v1_24/kube_aggregator/pkg/apis/apiregistration/v1/api_service_status.rs +++ b/src/v1_24/kube_aggregator/pkg/apis/apiregistration/v1/api_service_status.rs @@ -9,7 +9,14 @@ pub struct APIServiceStatus { impl crate::DeepMerge for APIServiceStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_24/list.rs b/src/v1_24/list.rs index cc10bf672f..9863ef1855 100644 --- a/src/v1_24/list.rs +++ b/src/v1_24/list.rs @@ -31,9 +31,16 @@ impl crate::Metadata for List where T: crate::ListableResource { } } -impl crate::DeepMerge for List where T: crate::ListableResource { +impl crate::DeepMerge for List where T: crate::DeepMerge + crate::Metadata + crate::ListableResource { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.items, other.items); + crate::merge_strategies::list::map( + &mut self.items, + other.items, + &[|lhs, rhs| lhs.metadata().namespace == rhs.metadata().namespace, |lhs, rhs| lhs.metadata().name == rhs.metadata().name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); } } diff --git a/src/v1_25/api/admissionregistration/v1/mutating_webhook.rs b/src/v1_25/api/admissionregistration/v1/mutating_webhook.rs index 5b1a4d833f..783200c537 100644 --- a/src/v1_25/api/admissionregistration/v1/mutating_webhook.rs +++ b/src/v1_25/api/admissionregistration/v1/mutating_webhook.rs @@ -81,7 +81,7 @@ pub struct MutatingWebhook { impl crate::DeepMerge for MutatingWebhook { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.admission_review_versions, other.admission_review_versions); + crate::merge_strategies::list::atomic(&mut self.admission_review_versions, other.admission_review_versions); crate::DeepMerge::merge_from(&mut self.client_config, other.client_config); crate::DeepMerge::merge_from(&mut self.failure_policy, other.failure_policy); crate::DeepMerge::merge_from(&mut self.match_policy, other.match_policy); @@ -89,7 +89,7 @@ impl crate::DeepMerge for MutatingWebhook { crate::DeepMerge::merge_from(&mut self.namespace_selector, other.namespace_selector); crate::DeepMerge::merge_from(&mut self.object_selector, other.object_selector); crate::DeepMerge::merge_from(&mut self.reinvocation_policy, other.reinvocation_policy); - crate::DeepMerge::merge_from(&mut self.rules, other.rules); + crate::merge_strategies::list::atomic(&mut self.rules, other.rules); crate::DeepMerge::merge_from(&mut self.side_effects, other.side_effects); crate::DeepMerge::merge_from(&mut self.timeout_seconds, other.timeout_seconds); } 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..156c7ccfcf 100644 --- a/src/v1_25/api/admissionregistration/v1/mutating_webhook_configuration.rs +++ b/src/v1_25/api/admissionregistration/v1/mutating_webhook_configuration.rs @@ -374,7 +374,14 @@ impl crate::Metadata for MutatingWebhookConfiguration { impl crate::DeepMerge for MutatingWebhookConfiguration { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.webhooks, other.webhooks); + crate::merge_strategies::list::map( + &mut self.webhooks, + other.webhooks, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_25/api/admissionregistration/v1/rule_with_operations.rs b/src/v1_25/api/admissionregistration/v1/rule_with_operations.rs index c45c425c57..441b9ab3fd 100644 --- a/src/v1_25/api/admissionregistration/v1/rule_with_operations.rs +++ b/src/v1_25/api/admissionregistration/v1/rule_with_operations.rs @@ -27,10 +27,10 @@ pub struct RuleWithOperations { impl crate::DeepMerge for RuleWithOperations { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.api_groups, other.api_groups); - crate::DeepMerge::merge_from(&mut self.api_versions, other.api_versions); - crate::DeepMerge::merge_from(&mut self.operations, other.operations); - crate::DeepMerge::merge_from(&mut self.resources, other.resources); + crate::merge_strategies::list::atomic(&mut self.api_groups, other.api_groups); + crate::merge_strategies::list::atomic(&mut self.api_versions, other.api_versions); + crate::merge_strategies::list::atomic(&mut self.operations, other.operations); + crate::merge_strategies::list::atomic(&mut self.resources, other.resources); crate::DeepMerge::merge_from(&mut self.scope, other.scope); } } diff --git a/src/v1_25/api/admissionregistration/v1/validating_webhook.rs b/src/v1_25/api/admissionregistration/v1/validating_webhook.rs index 1a64d4e885..e594176265 100644 --- a/src/v1_25/api/admissionregistration/v1/validating_webhook.rs +++ b/src/v1_25/api/admissionregistration/v1/validating_webhook.rs @@ -72,14 +72,14 @@ pub struct ValidatingWebhook { impl crate::DeepMerge for ValidatingWebhook { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.admission_review_versions, other.admission_review_versions); + crate::merge_strategies::list::atomic(&mut self.admission_review_versions, other.admission_review_versions); crate::DeepMerge::merge_from(&mut self.client_config, other.client_config); crate::DeepMerge::merge_from(&mut self.failure_policy, other.failure_policy); crate::DeepMerge::merge_from(&mut self.match_policy, other.match_policy); crate::DeepMerge::merge_from(&mut self.name, other.name); crate::DeepMerge::merge_from(&mut self.namespace_selector, other.namespace_selector); crate::DeepMerge::merge_from(&mut self.object_selector, other.object_selector); - crate::DeepMerge::merge_from(&mut self.rules, other.rules); + crate::merge_strategies::list::atomic(&mut self.rules, other.rules); crate::DeepMerge::merge_from(&mut self.side_effects, other.side_effects); crate::DeepMerge::merge_from(&mut self.timeout_seconds, other.timeout_seconds); } 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..ff20990424 100644 --- a/src/v1_25/api/admissionregistration/v1/validating_webhook_configuration.rs +++ b/src/v1_25/api/admissionregistration/v1/validating_webhook_configuration.rs @@ -374,7 +374,14 @@ impl crate::Metadata for ValidatingWebhookConfiguration { impl crate::DeepMerge for ValidatingWebhookConfiguration { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.webhooks, other.webhooks); + crate::merge_strategies::list::map( + &mut self.webhooks, + other.webhooks, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_25/api/apiserverinternal/v1alpha1/server_storage_version.rs b/src/v1_25/api/apiserverinternal/v1alpha1/server_storage_version.rs index 1040b5e6d7..5a693d9e59 100644 --- a/src/v1_25/api/apiserverinternal/v1alpha1/server_storage_version.rs +++ b/src/v1_25/api/apiserverinternal/v1alpha1/server_storage_version.rs @@ -16,7 +16,7 @@ pub struct ServerStorageVersion { impl crate::DeepMerge for ServerStorageVersion { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.api_server_id, other.api_server_id); - crate::DeepMerge::merge_from(&mut self.decodable_versions, other.decodable_versions); + crate::merge_strategies::list::set(&mut self.decodable_versions, other.decodable_versions); crate::DeepMerge::merge_from(&mut self.encoding_version, other.encoding_version); } } diff --git a/src/v1_25/api/apiserverinternal/v1alpha1/storage_version_status.rs b/src/v1_25/api/apiserverinternal/v1alpha1/storage_version_status.rs index e63b469644..0d5b9bd3a1 100644 --- a/src/v1_25/api/apiserverinternal/v1alpha1/storage_version_status.rs +++ b/src/v1_25/api/apiserverinternal/v1alpha1/storage_version_status.rs @@ -16,8 +16,22 @@ pub struct StorageVersionStatus { impl crate::DeepMerge for StorageVersionStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.common_encoding_version, other.common_encoding_version); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); - crate::DeepMerge::merge_from(&mut self.storage_versions, other.storage_versions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::list::map( + &mut self.storage_versions, + other.storage_versions, + &[|lhs, rhs| lhs.api_server_id == rhs.api_server_id], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_25/api/apps/v1/daemon_set_status.rs b/src/v1_25/api/apps/v1/daemon_set_status.rs index 278caf879c..345f5eb651 100644 --- a/src/v1_25/api/apps/v1/daemon_set_status.rs +++ b/src/v1_25/api/apps/v1/daemon_set_status.rs @@ -37,7 +37,14 @@ pub struct DaemonSetStatus { impl crate::DeepMerge for DaemonSetStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.collision_count, other.collision_count); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.current_number_scheduled, other.current_number_scheduled); crate::DeepMerge::merge_from(&mut self.desired_number_scheduled, other.desired_number_scheduled); crate::DeepMerge::merge_from(&mut self.number_available, other.number_available); diff --git a/src/v1_25/api/apps/v1/deployment_status.rs b/src/v1_25/api/apps/v1/deployment_status.rs index 01ff5c75e4..ee140e108a 100644 --- a/src/v1_25/api/apps/v1/deployment_status.rs +++ b/src/v1_25/api/apps/v1/deployment_status.rs @@ -32,7 +32,14 @@ impl crate::DeepMerge for DeploymentStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.available_replicas, other.available_replicas); crate::DeepMerge::merge_from(&mut self.collision_count, other.collision_count); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.observed_generation, other.observed_generation); crate::DeepMerge::merge_from(&mut self.ready_replicas, other.ready_replicas); crate::DeepMerge::merge_from(&mut self.replicas, other.replicas); diff --git a/src/v1_25/api/apps/v1/replica_set_status.rs b/src/v1_25/api/apps/v1/replica_set_status.rs index 6b5b45e35f..1b47aa5a70 100644 --- a/src/v1_25/api/apps/v1/replica_set_status.rs +++ b/src/v1_25/api/apps/v1/replica_set_status.rs @@ -25,7 +25,14 @@ pub struct ReplicaSetStatus { impl crate::DeepMerge for ReplicaSetStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.available_replicas, other.available_replicas); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.fully_labeled_replicas, other.fully_labeled_replicas); crate::DeepMerge::merge_from(&mut self.observed_generation, other.observed_generation); crate::DeepMerge::merge_from(&mut self.ready_replicas, other.ready_replicas); diff --git a/src/v1_25/api/apps/v1/stateful_set_spec.rs b/src/v1_25/api/apps/v1/stateful_set_spec.rs index 001ccc054b..0dd4bb7951 100644 --- a/src/v1_25/api/apps/v1/stateful_set_spec.rs +++ b/src/v1_25/api/apps/v1/stateful_set_spec.rs @@ -46,7 +46,7 @@ impl crate::DeepMerge for StatefulSetSpec { crate::DeepMerge::merge_from(&mut self.service_name, other.service_name); crate::DeepMerge::merge_from(&mut self.template, other.template); crate::DeepMerge::merge_from(&mut self.update_strategy, other.update_strategy); - crate::DeepMerge::merge_from(&mut self.volume_claim_templates, other.volume_claim_templates); + crate::merge_strategies::list::atomic(&mut self.volume_claim_templates, other.volume_claim_templates); } } diff --git a/src/v1_25/api/apps/v1/stateful_set_status.rs b/src/v1_25/api/apps/v1/stateful_set_status.rs index 74b5517785..5791ca87a2 100644 --- a/src/v1_25/api/apps/v1/stateful_set_status.rs +++ b/src/v1_25/api/apps/v1/stateful_set_status.rs @@ -38,7 +38,14 @@ impl crate::DeepMerge for StatefulSetStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.available_replicas, other.available_replicas); crate::DeepMerge::merge_from(&mut self.collision_count, other.collision_count); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.current_replicas, other.current_replicas); crate::DeepMerge::merge_from(&mut self.current_revision, other.current_revision); crate::DeepMerge::merge_from(&mut self.observed_generation, other.observed_generation); diff --git a/src/v1_25/api/authentication/v1/token_request_spec.rs b/src/v1_25/api/authentication/v1/token_request_spec.rs index 6d4399ce6c..6f784dff5d 100644 --- a/src/v1_25/api/authentication/v1/token_request_spec.rs +++ b/src/v1_25/api/authentication/v1/token_request_spec.rs @@ -15,7 +15,7 @@ pub struct TokenRequestSpec { impl crate::DeepMerge for TokenRequestSpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.audiences, other.audiences); + crate::merge_strategies::list::atomic(&mut self.audiences, other.audiences); crate::DeepMerge::merge_from(&mut self.bound_object_ref, other.bound_object_ref); crate::DeepMerge::merge_from(&mut self.expiration_seconds, other.expiration_seconds); } diff --git a/src/v1_25/api/authentication/v1/token_review_spec.rs b/src/v1_25/api/authentication/v1/token_review_spec.rs index fd84653924..281127b67d 100644 --- a/src/v1_25/api/authentication/v1/token_review_spec.rs +++ b/src/v1_25/api/authentication/v1/token_review_spec.rs @@ -12,7 +12,7 @@ pub struct TokenReviewSpec { impl crate::DeepMerge for TokenReviewSpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.audiences, other.audiences); + crate::merge_strategies::list::atomic(&mut self.audiences, other.audiences); crate::DeepMerge::merge_from(&mut self.token, other.token); } } diff --git a/src/v1_25/api/authentication/v1/token_review_status.rs b/src/v1_25/api/authentication/v1/token_review_status.rs index 464164bcf9..4dd5aacc3d 100644 --- a/src/v1_25/api/authentication/v1/token_review_status.rs +++ b/src/v1_25/api/authentication/v1/token_review_status.rs @@ -18,7 +18,7 @@ pub struct TokenReviewStatus { impl crate::DeepMerge for TokenReviewStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.audiences, other.audiences); + crate::merge_strategies::list::atomic(&mut self.audiences, other.audiences); crate::DeepMerge::merge_from(&mut self.authenticated, other.authenticated); crate::DeepMerge::merge_from(&mut self.error, other.error); crate::DeepMerge::merge_from(&mut self.user, other.user); diff --git a/src/v1_25/api/authentication/v1/user_info.rs b/src/v1_25/api/authentication/v1/user_info.rs index d6890119b7..3890788cda 100644 --- a/src/v1_25/api/authentication/v1/user_info.rs +++ b/src/v1_25/api/authentication/v1/user_info.rs @@ -18,8 +18,10 @@ pub struct UserInfo { impl crate::DeepMerge for UserInfo { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.extra, other.extra); - crate::DeepMerge::merge_from(&mut self.groups, other.groups); + crate::merge_strategies::map::granular(&mut self.extra, other.extra, |current_item, other_item| { + crate::merge_strategies::list::atomic(current_item, other_item); + }); + crate::merge_strategies::list::atomic(&mut self.groups, other.groups); crate::DeepMerge::merge_from(&mut self.uid, other.uid); crate::DeepMerge::merge_from(&mut self.username, other.username); } diff --git a/src/v1_25/api/authorization/v1/non_resource_rule.rs b/src/v1_25/api/authorization/v1/non_resource_rule.rs index 7df269ffd7..db780454b8 100644 --- a/src/v1_25/api/authorization/v1/non_resource_rule.rs +++ b/src/v1_25/api/authorization/v1/non_resource_rule.rs @@ -12,8 +12,8 @@ pub struct NonResourceRule { impl crate::DeepMerge for NonResourceRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.non_resource_urls, other.non_resource_urls); - crate::DeepMerge::merge_from(&mut self.verbs, other.verbs); + crate::merge_strategies::list::atomic(&mut self.non_resource_urls, other.non_resource_urls); + crate::merge_strategies::list::atomic(&mut self.verbs, other.verbs); } } diff --git a/src/v1_25/api/authorization/v1/resource_rule.rs b/src/v1_25/api/authorization/v1/resource_rule.rs index 58b5e020a8..1af9333654 100644 --- a/src/v1_25/api/authorization/v1/resource_rule.rs +++ b/src/v1_25/api/authorization/v1/resource_rule.rs @@ -19,10 +19,10 @@ pub struct ResourceRule { impl crate::DeepMerge for ResourceRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.api_groups, other.api_groups); - crate::DeepMerge::merge_from(&mut self.resource_names, other.resource_names); - crate::DeepMerge::merge_from(&mut self.resources, other.resources); - crate::DeepMerge::merge_from(&mut self.verbs, other.verbs); + crate::merge_strategies::list::atomic(&mut self.api_groups, other.api_groups); + crate::merge_strategies::list::atomic(&mut self.resource_names, other.resource_names); + crate::merge_strategies::list::atomic(&mut self.resources, other.resources); + crate::merge_strategies::list::atomic(&mut self.verbs, other.verbs); } } diff --git a/src/v1_25/api/authorization/v1/subject_access_review_spec.rs b/src/v1_25/api/authorization/v1/subject_access_review_spec.rs index ae8fadafd9..a4c4af18ce 100644 --- a/src/v1_25/api/authorization/v1/subject_access_review_spec.rs +++ b/src/v1_25/api/authorization/v1/subject_access_review_spec.rs @@ -24,8 +24,10 @@ pub struct SubjectAccessReviewSpec { impl crate::DeepMerge for SubjectAccessReviewSpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.extra, other.extra); - crate::DeepMerge::merge_from(&mut self.groups, other.groups); + crate::merge_strategies::map::granular(&mut self.extra, other.extra, |current_item, other_item| { + crate::merge_strategies::list::atomic(current_item, other_item); + }); + crate::merge_strategies::list::atomic(&mut self.groups, other.groups); crate::DeepMerge::merge_from(&mut self.non_resource_attributes, other.non_resource_attributes); crate::DeepMerge::merge_from(&mut self.resource_attributes, other.resource_attributes); crate::DeepMerge::merge_from(&mut self.uid, other.uid); diff --git a/src/v1_25/api/authorization/v1/subject_rules_review_status.rs b/src/v1_25/api/authorization/v1/subject_rules_review_status.rs index 9d7fb042cf..9d1682a3c8 100644 --- a/src/v1_25/api/authorization/v1/subject_rules_review_status.rs +++ b/src/v1_25/api/authorization/v1/subject_rules_review_status.rs @@ -20,8 +20,8 @@ impl crate::DeepMerge for SubjectRulesReviewStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.evaluation_error, other.evaluation_error); crate::DeepMerge::merge_from(&mut self.incomplete, other.incomplete); - crate::DeepMerge::merge_from(&mut self.non_resource_rules, other.non_resource_rules); - crate::DeepMerge::merge_from(&mut self.resource_rules, other.resource_rules); + crate::merge_strategies::list::atomic(&mut self.non_resource_rules, other.non_resource_rules); + crate::merge_strategies::list::atomic(&mut self.resource_rules, other.resource_rules); } } diff --git a/src/v1_25/api/autoscaling/v2/horizontal_pod_autoscaler_spec.rs b/src/v1_25/api/autoscaling/v2/horizontal_pod_autoscaler_spec.rs index 90ea12126f..1aaf3eb861 100644 --- a/src/v1_25/api/autoscaling/v2/horizontal_pod_autoscaler_spec.rs +++ b/src/v1_25/api/autoscaling/v2/horizontal_pod_autoscaler_spec.rs @@ -23,7 +23,7 @@ impl crate::DeepMerge for HorizontalPodAutoscalerSpec { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.behavior, other.behavior); crate::DeepMerge::merge_from(&mut self.max_replicas, other.max_replicas); - crate::DeepMerge::merge_from(&mut self.metrics, other.metrics); + crate::merge_strategies::list::atomic(&mut self.metrics, other.metrics); crate::DeepMerge::merge_from(&mut self.min_replicas, other.min_replicas); crate::DeepMerge::merge_from(&mut self.scale_target_ref, other.scale_target_ref); } diff --git a/src/v1_25/api/autoscaling/v2/horizontal_pod_autoscaler_status.rs b/src/v1_25/api/autoscaling/v2/horizontal_pod_autoscaler_status.rs index bfb877a856..c4b24efd7f 100644 --- a/src/v1_25/api/autoscaling/v2/horizontal_pod_autoscaler_status.rs +++ b/src/v1_25/api/autoscaling/v2/horizontal_pod_autoscaler_status.rs @@ -24,8 +24,15 @@ pub struct HorizontalPodAutoscalerStatus { impl crate::DeepMerge for HorizontalPodAutoscalerStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); - crate::DeepMerge::merge_from(&mut self.current_metrics, other.current_metrics); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::list::atomic(&mut self.current_metrics, other.current_metrics); crate::DeepMerge::merge_from(&mut self.current_replicas, other.current_replicas); crate::DeepMerge::merge_from(&mut self.desired_replicas, other.desired_replicas); crate::DeepMerge::merge_from(&mut self.last_scale_time, other.last_scale_time); diff --git a/src/v1_25/api/autoscaling/v2/hpa_scaling_rules.rs b/src/v1_25/api/autoscaling/v2/hpa_scaling_rules.rs index 0b0dc2c81d..195201e286 100644 --- a/src/v1_25/api/autoscaling/v2/hpa_scaling_rules.rs +++ b/src/v1_25/api/autoscaling/v2/hpa_scaling_rules.rs @@ -15,7 +15,7 @@ pub struct HPAScalingRules { impl crate::DeepMerge for HPAScalingRules { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.policies, other.policies); + crate::merge_strategies::list::atomic(&mut self.policies, other.policies); crate::DeepMerge::merge_from(&mut self.select_policy, other.select_policy); crate::DeepMerge::merge_from(&mut self.stabilization_window_seconds, other.stabilization_window_seconds); } diff --git a/src/v1_25/api/autoscaling/v2beta2/horizontal_pod_autoscaler_spec.rs b/src/v1_25/api/autoscaling/v2beta2/horizontal_pod_autoscaler_spec.rs index c529e49162..681cf9c99b 100644 --- a/src/v1_25/api/autoscaling/v2beta2/horizontal_pod_autoscaler_spec.rs +++ b/src/v1_25/api/autoscaling/v2beta2/horizontal_pod_autoscaler_spec.rs @@ -23,7 +23,7 @@ impl crate::DeepMerge for HorizontalPodAutoscalerSpec { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.behavior, other.behavior); crate::DeepMerge::merge_from(&mut self.max_replicas, other.max_replicas); - crate::DeepMerge::merge_from(&mut self.metrics, other.metrics); + crate::merge_strategies::list::atomic(&mut self.metrics, other.metrics); crate::DeepMerge::merge_from(&mut self.min_replicas, other.min_replicas); crate::DeepMerge::merge_from(&mut self.scale_target_ref, other.scale_target_ref); } diff --git a/src/v1_25/api/autoscaling/v2beta2/horizontal_pod_autoscaler_status.rs b/src/v1_25/api/autoscaling/v2beta2/horizontal_pod_autoscaler_status.rs index 176ea55941..0f77eb1fb4 100644 --- a/src/v1_25/api/autoscaling/v2beta2/horizontal_pod_autoscaler_status.rs +++ b/src/v1_25/api/autoscaling/v2beta2/horizontal_pod_autoscaler_status.rs @@ -24,8 +24,8 @@ pub struct HorizontalPodAutoscalerStatus { impl crate::DeepMerge for HorizontalPodAutoscalerStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); - crate::DeepMerge::merge_from(&mut self.current_metrics, other.current_metrics); + crate::merge_strategies::list::atomic(&mut self.conditions, other.conditions); + crate::merge_strategies::list::atomic(&mut self.current_metrics, other.current_metrics); crate::DeepMerge::merge_from(&mut self.current_replicas, other.current_replicas); crate::DeepMerge::merge_from(&mut self.desired_replicas, other.desired_replicas); crate::DeepMerge::merge_from(&mut self.last_scale_time, other.last_scale_time); diff --git a/src/v1_25/api/autoscaling/v2beta2/hpa_scaling_rules.rs b/src/v1_25/api/autoscaling/v2beta2/hpa_scaling_rules.rs index 3b62f0dd91..fde69f31c4 100644 --- a/src/v1_25/api/autoscaling/v2beta2/hpa_scaling_rules.rs +++ b/src/v1_25/api/autoscaling/v2beta2/hpa_scaling_rules.rs @@ -15,7 +15,7 @@ pub struct HPAScalingRules { impl crate::DeepMerge for HPAScalingRules { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.policies, other.policies); + crate::merge_strategies::list::atomic(&mut self.policies, other.policies); crate::DeepMerge::merge_from(&mut self.select_policy, other.select_policy); crate::DeepMerge::merge_from(&mut self.stabilization_window_seconds, other.stabilization_window_seconds); } diff --git a/src/v1_25/api/batch/v1/cron_job_status.rs b/src/v1_25/api/batch/v1/cron_job_status.rs index cbd83e8fcd..c0f24458eb 100644 --- a/src/v1_25/api/batch/v1/cron_job_status.rs +++ b/src/v1_25/api/batch/v1/cron_job_status.rs @@ -15,7 +15,7 @@ pub struct CronJobStatus { impl crate::DeepMerge for CronJobStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.active, other.active); + crate::merge_strategies::list::atomic(&mut self.active, other.active); crate::DeepMerge::merge_from(&mut self.last_schedule_time, other.last_schedule_time); crate::DeepMerge::merge_from(&mut self.last_successful_time, other.last_successful_time); } diff --git a/src/v1_25/api/batch/v1/job_status.rs b/src/v1_25/api/batch/v1/job_status.rs index 49d53d7f71..6a3520d3ec 100644 --- a/src/v1_25/api/batch/v1/job_status.rs +++ b/src/v1_25/api/batch/v1/job_status.rs @@ -43,7 +43,14 @@ impl crate::DeepMerge for JobStatus { crate::DeepMerge::merge_from(&mut self.active, other.active); crate::DeepMerge::merge_from(&mut self.completed_indexes, other.completed_indexes); crate::DeepMerge::merge_from(&mut self.completion_time, other.completion_time); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.failed, other.failed); crate::DeepMerge::merge_from(&mut self.ready, other.ready); crate::DeepMerge::merge_from(&mut self.start_time, other.start_time); diff --git a/src/v1_25/api/batch/v1/pod_failure_policy.rs b/src/v1_25/api/batch/v1/pod_failure_policy.rs index 5edb569fbe..976e6077e1 100644 --- a/src/v1_25/api/batch/v1/pod_failure_policy.rs +++ b/src/v1_25/api/batch/v1/pod_failure_policy.rs @@ -9,7 +9,7 @@ pub struct PodFailurePolicy { impl crate::DeepMerge for PodFailurePolicy { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.rules, other.rules); + crate::merge_strategies::list::atomic(&mut self.rules, other.rules); } } diff --git a/src/v1_25/api/batch/v1/pod_failure_policy_on_exit_codes_requirement.rs b/src/v1_25/api/batch/v1/pod_failure_policy_on_exit_codes_requirement.rs index 7c66651da8..ccb4c878f9 100644 --- a/src/v1_25/api/batch/v1/pod_failure_policy_on_exit_codes_requirement.rs +++ b/src/v1_25/api/batch/v1/pod_failure_policy_on_exit_codes_requirement.rs @@ -24,7 +24,7 @@ impl crate::DeepMerge for PodFailurePolicyOnExitCodesRequirement { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.container_name, other.container_name); crate::DeepMerge::merge_from(&mut self.operator, other.operator); - crate::DeepMerge::merge_from(&mut self.values, other.values); + crate::merge_strategies::list::set(&mut self.values, other.values); } } diff --git a/src/v1_25/api/batch/v1/pod_failure_policy_rule.rs b/src/v1_25/api/batch/v1/pod_failure_policy_rule.rs index 3898f424d4..3bbcfce6be 100644 --- a/src/v1_25/api/batch/v1/pod_failure_policy_rule.rs +++ b/src/v1_25/api/batch/v1/pod_failure_policy_rule.rs @@ -24,7 +24,7 @@ impl crate::DeepMerge for PodFailurePolicyRule { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.action, other.action); crate::DeepMerge::merge_from(&mut self.on_exit_codes, other.on_exit_codes); - crate::DeepMerge::merge_from(&mut self.on_pod_conditions, other.on_pod_conditions); + crate::merge_strategies::list::atomic(&mut self.on_pod_conditions, other.on_pod_conditions); } } diff --git a/src/v1_25/api/batch/v1/uncounted_terminated_pods.rs b/src/v1_25/api/batch/v1/uncounted_terminated_pods.rs index 8235855121..45335381cf 100644 --- a/src/v1_25/api/batch/v1/uncounted_terminated_pods.rs +++ b/src/v1_25/api/batch/v1/uncounted_terminated_pods.rs @@ -12,8 +12,8 @@ pub struct UncountedTerminatedPods { impl crate::DeepMerge for UncountedTerminatedPods { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.failed, other.failed); - crate::DeepMerge::merge_from(&mut self.succeeded, other.succeeded); + crate::merge_strategies::list::set(&mut self.failed, other.failed); + crate::merge_strategies::list::set(&mut self.succeeded, other.succeeded); } } diff --git a/src/v1_25/api/certificates/v1/certificate_signing_request_spec.rs b/src/v1_25/api/certificates/v1/certificate_signing_request_spec.rs index 549452fb32..36248828fd 100644 --- a/src/v1_25/api/certificates/v1/certificate_signing_request_spec.rs +++ b/src/v1_25/api/certificates/v1/certificate_signing_request_spec.rs @@ -75,12 +75,14 @@ pub struct CertificateSigningRequestSpec { impl crate::DeepMerge for CertificateSigningRequestSpec { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.expiration_seconds, other.expiration_seconds); - crate::DeepMerge::merge_from(&mut self.extra, other.extra); - crate::DeepMerge::merge_from(&mut self.groups, other.groups); + crate::merge_strategies::map::granular(&mut self.extra, other.extra, |current_item, other_item| { + crate::merge_strategies::list::atomic(current_item, other_item); + }); + crate::merge_strategies::list::atomic(&mut self.groups, other.groups); crate::DeepMerge::merge_from(&mut self.request, other.request); crate::DeepMerge::merge_from(&mut self.signer_name, other.signer_name); crate::DeepMerge::merge_from(&mut self.uid, other.uid); - crate::DeepMerge::merge_from(&mut self.usages, other.usages); + crate::merge_strategies::list::atomic(&mut self.usages, other.usages); crate::DeepMerge::merge_from(&mut self.username, other.username); } } diff --git a/src/v1_25/api/certificates/v1/certificate_signing_request_status.rs b/src/v1_25/api/certificates/v1/certificate_signing_request_status.rs index 81fb876580..d17c51933f 100644 --- a/src/v1_25/api/certificates/v1/certificate_signing_request_status.rs +++ b/src/v1_25/api/certificates/v1/certificate_signing_request_status.rs @@ -34,7 +34,14 @@ pub struct CertificateSigningRequestStatus { impl crate::DeepMerge for CertificateSigningRequestStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.certificate, other.certificate); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_25/api/core/v1/capabilities.rs b/src/v1_25/api/core/v1/capabilities.rs index 6045e4f5d2..1a260b5256 100644 --- a/src/v1_25/api/core/v1/capabilities.rs +++ b/src/v1_25/api/core/v1/capabilities.rs @@ -12,8 +12,8 @@ pub struct Capabilities { impl crate::DeepMerge for Capabilities { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.add, other.add); - crate::DeepMerge::merge_from(&mut self.drop, other.drop); + crate::merge_strategies::list::atomic(&mut self.add, other.add); + crate::merge_strategies::list::atomic(&mut self.drop, other.drop); } } diff --git a/src/v1_25/api/core/v1/ceph_fs_persistent_volume_source.rs b/src/v1_25/api/core/v1/ceph_fs_persistent_volume_source.rs index 13104d3d90..33c556a6ce 100644 --- a/src/v1_25/api/core/v1/ceph_fs_persistent_volume_source.rs +++ b/src/v1_25/api/core/v1/ceph_fs_persistent_volume_source.rs @@ -24,7 +24,7 @@ pub struct CephFSPersistentVolumeSource { impl crate::DeepMerge for CephFSPersistentVolumeSource { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.monitors, other.monitors); + crate::merge_strategies::list::atomic(&mut self.monitors, other.monitors); crate::DeepMerge::merge_from(&mut self.path, other.path); crate::DeepMerge::merge_from(&mut self.read_only, other.read_only); crate::DeepMerge::merge_from(&mut self.secret_file, other.secret_file); diff --git a/src/v1_25/api/core/v1/ceph_fs_volume_source.rs b/src/v1_25/api/core/v1/ceph_fs_volume_source.rs index bb24b08edb..91f358e3aa 100644 --- a/src/v1_25/api/core/v1/ceph_fs_volume_source.rs +++ b/src/v1_25/api/core/v1/ceph_fs_volume_source.rs @@ -24,7 +24,7 @@ pub struct CephFSVolumeSource { impl crate::DeepMerge for CephFSVolumeSource { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.monitors, other.monitors); + crate::merge_strategies::list::atomic(&mut self.monitors, other.monitors); crate::DeepMerge::merge_from(&mut self.path, other.path); crate::DeepMerge::merge_from(&mut self.read_only, other.read_only); crate::DeepMerge::merge_from(&mut self.secret_file, other.secret_file); diff --git a/src/v1_25/api/core/v1/component_status.rs b/src/v1_25/api/core/v1/component_status.rs index ecddf82170..50e55665e4 100644 --- a/src/v1_25/api/core/v1/component_status.rs +++ b/src/v1_25/api/core/v1/component_status.rs @@ -172,7 +172,14 @@ impl crate::Metadata for ComponentStatus { impl crate::DeepMerge for ComponentStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); } } diff --git a/src/v1_25/api/core/v1/config_map.rs b/src/v1_25/api/core/v1/config_map.rs index 361b45a3a1..7d07e59a99 100644 --- a/src/v1_25/api/core/v1/config_map.rs +++ b/src/v1_25/api/core/v1/config_map.rs @@ -495,8 +495,12 @@ impl crate::Metadata for ConfigMap { impl crate::DeepMerge for ConfigMap { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.binary_data, other.binary_data); - crate::DeepMerge::merge_from(&mut self.data, other.data); + crate::merge_strategies::map::granular(&mut self.binary_data, other.binary_data, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.data, other.data, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.immutable, other.immutable); crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); } diff --git a/src/v1_25/api/core/v1/config_map_projection.rs b/src/v1_25/api/core/v1/config_map_projection.rs index 673d1527ac..ea9187a2f3 100644 --- a/src/v1_25/api/core/v1/config_map_projection.rs +++ b/src/v1_25/api/core/v1/config_map_projection.rs @@ -17,7 +17,7 @@ pub struct ConfigMapProjection { impl crate::DeepMerge for ConfigMapProjection { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.items, other.items); + crate::merge_strategies::list::atomic(&mut self.items, other.items); crate::DeepMerge::merge_from(&mut self.name, other.name); crate::DeepMerge::merge_from(&mut self.optional, other.optional); } diff --git a/src/v1_25/api/core/v1/config_map_volume_source.rs b/src/v1_25/api/core/v1/config_map_volume_source.rs index d34a1a17da..7d5b55b8ee 100644 --- a/src/v1_25/api/core/v1/config_map_volume_source.rs +++ b/src/v1_25/api/core/v1/config_map_volume_source.rs @@ -21,7 +21,7 @@ pub struct ConfigMapVolumeSource { impl crate::DeepMerge for ConfigMapVolumeSource { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.default_mode, other.default_mode); - crate::DeepMerge::merge_from(&mut self.items, other.items); + crate::merge_strategies::list::atomic(&mut self.items, other.items); crate::DeepMerge::merge_from(&mut self.name, other.name); crate::DeepMerge::merge_from(&mut self.optional, other.optional); } diff --git a/src/v1_25/api/core/v1/container.rs b/src/v1_25/api/core/v1/container.rs index e7ec05fb49..aafaa8dd46 100644 --- a/src/v1_25/api/core/v1/container.rs +++ b/src/v1_25/api/core/v1/container.rs @@ -74,16 +74,30 @@ pub struct Container { impl crate::DeepMerge for Container { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.args, other.args); - crate::DeepMerge::merge_from(&mut self.command, other.command); - crate::DeepMerge::merge_from(&mut self.env, other.env); - crate::DeepMerge::merge_from(&mut self.env_from, other.env_from); + crate::merge_strategies::list::atomic(&mut self.args, other.args); + crate::merge_strategies::list::atomic(&mut self.command, other.command); + crate::merge_strategies::list::map( + &mut self.env, + other.env, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::list::atomic(&mut self.env_from, other.env_from); crate::DeepMerge::merge_from(&mut self.image, other.image); crate::DeepMerge::merge_from(&mut self.image_pull_policy, other.image_pull_policy); crate::DeepMerge::merge_from(&mut self.lifecycle, other.lifecycle); crate::DeepMerge::merge_from(&mut self.liveness_probe, other.liveness_probe); crate::DeepMerge::merge_from(&mut self.name, other.name); - crate::DeepMerge::merge_from(&mut self.ports, other.ports); + crate::merge_strategies::list::map( + &mut self.ports, + other.ports, + &[|lhs, rhs| lhs.container_port == rhs.container_port], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.readiness_probe, other.readiness_probe); crate::DeepMerge::merge_from(&mut self.resources, other.resources); crate::DeepMerge::merge_from(&mut self.security_context, other.security_context); @@ -93,8 +107,22 @@ impl crate::DeepMerge for Container { crate::DeepMerge::merge_from(&mut self.termination_message_path, other.termination_message_path); crate::DeepMerge::merge_from(&mut self.termination_message_policy, other.termination_message_policy); crate::DeepMerge::merge_from(&mut self.tty, other.tty); - crate::DeepMerge::merge_from(&mut self.volume_devices, other.volume_devices); - crate::DeepMerge::merge_from(&mut self.volume_mounts, other.volume_mounts); + crate::merge_strategies::list::map( + &mut self.volume_devices, + other.volume_devices, + &[|lhs, rhs| lhs.device_path == rhs.device_path], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::list::map( + &mut self.volume_mounts, + other.volume_mounts, + &[|lhs, rhs| lhs.mount_path == rhs.mount_path], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.working_dir, other.working_dir); } } diff --git a/src/v1_25/api/core/v1/container_image.rs b/src/v1_25/api/core/v1/container_image.rs index a708155b7c..5c7c179ed8 100644 --- a/src/v1_25/api/core/v1/container_image.rs +++ b/src/v1_25/api/core/v1/container_image.rs @@ -12,7 +12,7 @@ pub struct ContainerImage { impl crate::DeepMerge for ContainerImage { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.names, other.names); + crate::merge_strategies::list::atomic(&mut self.names, other.names); crate::DeepMerge::merge_from(&mut self.size_bytes, other.size_bytes); } } diff --git a/src/v1_25/api/core/v1/csi_persistent_volume_source.rs b/src/v1_25/api/core/v1/csi_persistent_volume_source.rs index 27b531ff56..24ab9ebf03 100644 --- a/src/v1_25/api/core/v1/csi_persistent_volume_source.rs +++ b/src/v1_25/api/core/v1/csi_persistent_volume_source.rs @@ -44,7 +44,9 @@ impl crate::DeepMerge for CSIPersistentVolumeSource { crate::DeepMerge::merge_from(&mut self.node_publish_secret_ref, other.node_publish_secret_ref); crate::DeepMerge::merge_from(&mut self.node_stage_secret_ref, other.node_stage_secret_ref); crate::DeepMerge::merge_from(&mut self.read_only, other.read_only); - crate::DeepMerge::merge_from(&mut self.volume_attributes, other.volume_attributes); + crate::merge_strategies::map::granular(&mut self.volume_attributes, other.volume_attributes, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.volume_handle, other.volume_handle); } } diff --git a/src/v1_25/api/core/v1/csi_volume_source.rs b/src/v1_25/api/core/v1/csi_volume_source.rs index ab72f34cdc..77f1085f6f 100644 --- a/src/v1_25/api/core/v1/csi_volume_source.rs +++ b/src/v1_25/api/core/v1/csi_volume_source.rs @@ -25,7 +25,9 @@ impl crate::DeepMerge for CSIVolumeSource { crate::DeepMerge::merge_from(&mut self.fs_type, other.fs_type); crate::DeepMerge::merge_from(&mut self.node_publish_secret_ref, other.node_publish_secret_ref); crate::DeepMerge::merge_from(&mut self.read_only, other.read_only); - crate::DeepMerge::merge_from(&mut self.volume_attributes, other.volume_attributes); + crate::merge_strategies::map::granular(&mut self.volume_attributes, other.volume_attributes, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); } } diff --git a/src/v1_25/api/core/v1/downward_api_projection.rs b/src/v1_25/api/core/v1/downward_api_projection.rs index de0fca6185..950e2e5645 100644 --- a/src/v1_25/api/core/v1/downward_api_projection.rs +++ b/src/v1_25/api/core/v1/downward_api_projection.rs @@ -9,7 +9,7 @@ pub struct DownwardAPIProjection { impl crate::DeepMerge for DownwardAPIProjection { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.items, other.items); + crate::merge_strategies::list::atomic(&mut self.items, other.items); } } diff --git a/src/v1_25/api/core/v1/downward_api_volume_source.rs b/src/v1_25/api/core/v1/downward_api_volume_source.rs index 214c15f03f..96b4ebb987 100644 --- a/src/v1_25/api/core/v1/downward_api_volume_source.rs +++ b/src/v1_25/api/core/v1/downward_api_volume_source.rs @@ -13,7 +13,7 @@ pub struct DownwardAPIVolumeSource { impl crate::DeepMerge for DownwardAPIVolumeSource { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.default_mode, other.default_mode); - crate::DeepMerge::merge_from(&mut self.items, other.items); + crate::merge_strategies::list::atomic(&mut self.items, other.items); } } diff --git a/src/v1_25/api/core/v1/endpoint_subset.rs b/src/v1_25/api/core/v1/endpoint_subset.rs index 45a0853432..9400deda56 100644 --- a/src/v1_25/api/core/v1/endpoint_subset.rs +++ b/src/v1_25/api/core/v1/endpoint_subset.rs @@ -25,9 +25,9 @@ pub struct EndpointSubset { impl crate::DeepMerge for EndpointSubset { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.addresses, other.addresses); - crate::DeepMerge::merge_from(&mut self.not_ready_addresses, other.not_ready_addresses); - crate::DeepMerge::merge_from(&mut self.ports, other.ports); + crate::merge_strategies::list::atomic(&mut self.addresses, other.addresses); + crate::merge_strategies::list::atomic(&mut self.not_ready_addresses, other.not_ready_addresses); + crate::merge_strategies::list::atomic(&mut self.ports, other.ports); } } diff --git a/src/v1_25/api/core/v1/endpoints.rs b/src/v1_25/api/core/v1/endpoints.rs index ed9beaf356..74d95ffd83 100644 --- a/src/v1_25/api/core/v1/endpoints.rs +++ b/src/v1_25/api/core/v1/endpoints.rs @@ -502,7 +502,7 @@ impl crate::Metadata for Endpoints { impl crate::DeepMerge for Endpoints { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.subsets, other.subsets); + crate::merge_strategies::list::atomic(&mut self.subsets, other.subsets); } } diff --git a/src/v1_25/api/core/v1/ephemeral_container.rs b/src/v1_25/api/core/v1/ephemeral_container.rs index 985935d50f..616e1b8918 100644 --- a/src/v1_25/api/core/v1/ephemeral_container.rs +++ b/src/v1_25/api/core/v1/ephemeral_container.rs @@ -81,16 +81,30 @@ pub struct EphemeralContainer { impl crate::DeepMerge for EphemeralContainer { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.args, other.args); - crate::DeepMerge::merge_from(&mut self.command, other.command); - crate::DeepMerge::merge_from(&mut self.env, other.env); - crate::DeepMerge::merge_from(&mut self.env_from, other.env_from); + crate::merge_strategies::list::atomic(&mut self.args, other.args); + crate::merge_strategies::list::atomic(&mut self.command, other.command); + crate::merge_strategies::list::map( + &mut self.env, + other.env, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::list::atomic(&mut self.env_from, other.env_from); crate::DeepMerge::merge_from(&mut self.image, other.image); crate::DeepMerge::merge_from(&mut self.image_pull_policy, other.image_pull_policy); crate::DeepMerge::merge_from(&mut self.lifecycle, other.lifecycle); crate::DeepMerge::merge_from(&mut self.liveness_probe, other.liveness_probe); crate::DeepMerge::merge_from(&mut self.name, other.name); - crate::DeepMerge::merge_from(&mut self.ports, other.ports); + crate::merge_strategies::list::map( + &mut self.ports, + other.ports, + &[|lhs, rhs| lhs.container_port == rhs.container_port], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.readiness_probe, other.readiness_probe); crate::DeepMerge::merge_from(&mut self.resources, other.resources); crate::DeepMerge::merge_from(&mut self.security_context, other.security_context); @@ -101,8 +115,22 @@ impl crate::DeepMerge for EphemeralContainer { crate::DeepMerge::merge_from(&mut self.termination_message_path, other.termination_message_path); crate::DeepMerge::merge_from(&mut self.termination_message_policy, other.termination_message_policy); crate::DeepMerge::merge_from(&mut self.tty, other.tty); - crate::DeepMerge::merge_from(&mut self.volume_devices, other.volume_devices); - crate::DeepMerge::merge_from(&mut self.volume_mounts, other.volume_mounts); + crate::merge_strategies::list::map( + &mut self.volume_devices, + other.volume_devices, + &[|lhs, rhs| lhs.device_path == rhs.device_path], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::list::map( + &mut self.volume_mounts, + other.volume_mounts, + &[|lhs, rhs| lhs.mount_path == rhs.mount_path], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.working_dir, other.working_dir); } } diff --git a/src/v1_25/api/core/v1/exec_action.rs b/src/v1_25/api/core/v1/exec_action.rs index fc5ddd099a..07e888786c 100644 --- a/src/v1_25/api/core/v1/exec_action.rs +++ b/src/v1_25/api/core/v1/exec_action.rs @@ -9,7 +9,7 @@ pub struct ExecAction { impl crate::DeepMerge for ExecAction { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.command, other.command); + crate::merge_strategies::list::atomic(&mut self.command, other.command); } } diff --git a/src/v1_25/api/core/v1/fc_volume_source.rs b/src/v1_25/api/core/v1/fc_volume_source.rs index 16dda61ef3..f379368e18 100644 --- a/src/v1_25/api/core/v1/fc_volume_source.rs +++ b/src/v1_25/api/core/v1/fc_volume_source.rs @@ -24,8 +24,8 @@ impl crate::DeepMerge for FCVolumeSource { crate::DeepMerge::merge_from(&mut self.fs_type, other.fs_type); crate::DeepMerge::merge_from(&mut self.lun, other.lun); crate::DeepMerge::merge_from(&mut self.read_only, other.read_only); - crate::DeepMerge::merge_from(&mut self.target_wwns, other.target_wwns); - crate::DeepMerge::merge_from(&mut self.wwids, other.wwids); + crate::merge_strategies::list::atomic(&mut self.target_wwns, other.target_wwns); + crate::merge_strategies::list::atomic(&mut self.wwids, other.wwids); } } diff --git a/src/v1_25/api/core/v1/flex_persistent_volume_source.rs b/src/v1_25/api/core/v1/flex_persistent_volume_source.rs index 1c73341c0c..a696df849c 100644 --- a/src/v1_25/api/core/v1/flex_persistent_volume_source.rs +++ b/src/v1_25/api/core/v1/flex_persistent_volume_source.rs @@ -23,7 +23,9 @@ impl crate::DeepMerge for FlexPersistentVolumeSource { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.driver, other.driver); crate::DeepMerge::merge_from(&mut self.fs_type, other.fs_type); - crate::DeepMerge::merge_from(&mut self.options, other.options); + crate::merge_strategies::map::granular(&mut self.options, other.options, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.read_only, other.read_only); crate::DeepMerge::merge_from(&mut self.secret_ref, other.secret_ref); } diff --git a/src/v1_25/api/core/v1/flex_volume_source.rs b/src/v1_25/api/core/v1/flex_volume_source.rs index caad40ad2b..8cec763784 100644 --- a/src/v1_25/api/core/v1/flex_volume_source.rs +++ b/src/v1_25/api/core/v1/flex_volume_source.rs @@ -23,7 +23,9 @@ impl crate::DeepMerge for FlexVolumeSource { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.driver, other.driver); crate::DeepMerge::merge_from(&mut self.fs_type, other.fs_type); - crate::DeepMerge::merge_from(&mut self.options, other.options); + crate::merge_strategies::map::granular(&mut self.options, other.options, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.read_only, other.read_only); crate::DeepMerge::merge_from(&mut self.secret_ref, other.secret_ref); } diff --git a/src/v1_25/api/core/v1/host_alias.rs b/src/v1_25/api/core/v1/host_alias.rs index 9320f6d9e1..8ea648c7ad 100644 --- a/src/v1_25/api/core/v1/host_alias.rs +++ b/src/v1_25/api/core/v1/host_alias.rs @@ -12,7 +12,7 @@ pub struct HostAlias { impl crate::DeepMerge for HostAlias { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.hostnames, other.hostnames); + crate::merge_strategies::list::atomic(&mut self.hostnames, other.hostnames); crate::DeepMerge::merge_from(&mut self.ip, other.ip); } } diff --git a/src/v1_25/api/core/v1/http_get_action.rs b/src/v1_25/api/core/v1/http_get_action.rs index cec454faa3..b972a6bd69 100644 --- a/src/v1_25/api/core/v1/http_get_action.rs +++ b/src/v1_25/api/core/v1/http_get_action.rs @@ -23,7 +23,7 @@ pub struct HTTPGetAction { impl crate::DeepMerge for HTTPGetAction { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.host, other.host); - crate::DeepMerge::merge_from(&mut self.http_headers, other.http_headers); + crate::merge_strategies::list::atomic(&mut self.http_headers, other.http_headers); crate::DeepMerge::merge_from(&mut self.path, other.path); crate::DeepMerge::merge_from(&mut self.port, other.port); crate::DeepMerge::merge_from(&mut self.scheme, other.scheme); diff --git a/src/v1_25/api/core/v1/iscsi_persistent_volume_source.rs b/src/v1_25/api/core/v1/iscsi_persistent_volume_source.rs index e7285139af..462487bb86 100644 --- a/src/v1_25/api/core/v1/iscsi_persistent_volume_source.rs +++ b/src/v1_25/api/core/v1/iscsi_persistent_volume_source.rs @@ -46,7 +46,7 @@ impl crate::DeepMerge for ISCSIPersistentVolumeSource { crate::DeepMerge::merge_from(&mut self.iqn, other.iqn); crate::DeepMerge::merge_from(&mut self.iscsi_interface, other.iscsi_interface); crate::DeepMerge::merge_from(&mut self.lun, other.lun); - crate::DeepMerge::merge_from(&mut self.portals, other.portals); + crate::merge_strategies::list::atomic(&mut self.portals, other.portals); crate::DeepMerge::merge_from(&mut self.read_only, other.read_only); crate::DeepMerge::merge_from(&mut self.secret_ref, other.secret_ref); crate::DeepMerge::merge_from(&mut self.target_portal, other.target_portal); diff --git a/src/v1_25/api/core/v1/iscsi_volume_source.rs b/src/v1_25/api/core/v1/iscsi_volume_source.rs index 0990284c06..d9d95c147b 100644 --- a/src/v1_25/api/core/v1/iscsi_volume_source.rs +++ b/src/v1_25/api/core/v1/iscsi_volume_source.rs @@ -46,7 +46,7 @@ impl crate::DeepMerge for ISCSIVolumeSource { crate::DeepMerge::merge_from(&mut self.iqn, other.iqn); crate::DeepMerge::merge_from(&mut self.iscsi_interface, other.iscsi_interface); crate::DeepMerge::merge_from(&mut self.lun, other.lun); - crate::DeepMerge::merge_from(&mut self.portals, other.portals); + crate::merge_strategies::list::atomic(&mut self.portals, other.portals); crate::DeepMerge::merge_from(&mut self.read_only, other.read_only); crate::DeepMerge::merge_from(&mut self.secret_ref, other.secret_ref); crate::DeepMerge::merge_from(&mut self.target_portal, other.target_portal); diff --git a/src/v1_25/api/core/v1/limit_range_item.rs b/src/v1_25/api/core/v1/limit_range_item.rs index 3aada5aaaa..d8431aec87 100644 --- a/src/v1_25/api/core/v1/limit_range_item.rs +++ b/src/v1_25/api/core/v1/limit_range_item.rs @@ -24,11 +24,21 @@ pub struct LimitRangeItem { impl crate::DeepMerge for LimitRangeItem { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.default, other.default); - crate::DeepMerge::merge_from(&mut self.default_request, other.default_request); - crate::DeepMerge::merge_from(&mut self.max, other.max); - crate::DeepMerge::merge_from(&mut self.max_limit_request_ratio, other.max_limit_request_ratio); - crate::DeepMerge::merge_from(&mut self.min, other.min); + crate::merge_strategies::map::granular(&mut self.default, other.default, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.default_request, other.default_request, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.max, other.max, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.max_limit_request_ratio, other.max_limit_request_ratio, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.min, other.min, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.type_, other.type_); } } diff --git a/src/v1_25/api/core/v1/limit_range_spec.rs b/src/v1_25/api/core/v1/limit_range_spec.rs index d3db20e828..14cacbd619 100644 --- a/src/v1_25/api/core/v1/limit_range_spec.rs +++ b/src/v1_25/api/core/v1/limit_range_spec.rs @@ -9,7 +9,7 @@ pub struct LimitRangeSpec { impl crate::DeepMerge for LimitRangeSpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.limits, other.limits); + crate::merge_strategies::list::atomic(&mut self.limits, other.limits); } } diff --git a/src/v1_25/api/core/v1/load_balancer_ingress.rs b/src/v1_25/api/core/v1/load_balancer_ingress.rs index fe804334cf..ffce22ba8b 100644 --- a/src/v1_25/api/core/v1/load_balancer_ingress.rs +++ b/src/v1_25/api/core/v1/load_balancer_ingress.rs @@ -17,7 +17,7 @@ impl crate::DeepMerge for LoadBalancerIngress { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.hostname, other.hostname); crate::DeepMerge::merge_from(&mut self.ip, other.ip); - crate::DeepMerge::merge_from(&mut self.ports, other.ports); + crate::merge_strategies::list::atomic(&mut self.ports, other.ports); } } diff --git a/src/v1_25/api/core/v1/load_balancer_status.rs b/src/v1_25/api/core/v1/load_balancer_status.rs index 46d791f8e1..67379f9e4e 100644 --- a/src/v1_25/api/core/v1/load_balancer_status.rs +++ b/src/v1_25/api/core/v1/load_balancer_status.rs @@ -9,7 +9,7 @@ pub struct LoadBalancerStatus { impl crate::DeepMerge for LoadBalancerStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.ingress, other.ingress); + crate::merge_strategies::list::atomic(&mut self.ingress, other.ingress); } } diff --git a/src/v1_25/api/core/v1/namespace_spec.rs b/src/v1_25/api/core/v1/namespace_spec.rs index 5ae9e5ef2e..cbf697e1e1 100644 --- a/src/v1_25/api/core/v1/namespace_spec.rs +++ b/src/v1_25/api/core/v1/namespace_spec.rs @@ -9,7 +9,7 @@ pub struct NamespaceSpec { impl crate::DeepMerge for NamespaceSpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.finalizers, other.finalizers); + crate::merge_strategies::list::atomic(&mut self.finalizers, other.finalizers); } } diff --git a/src/v1_25/api/core/v1/namespace_status.rs b/src/v1_25/api/core/v1/namespace_status.rs index 7ccfbdac3e..c859779881 100644 --- a/src/v1_25/api/core/v1/namespace_status.rs +++ b/src/v1_25/api/core/v1/namespace_status.rs @@ -13,7 +13,14 @@ pub struct NamespaceStatus { impl crate::DeepMerge for NamespaceStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.phase, other.phase); } } diff --git a/src/v1_25/api/core/v1/node_affinity.rs b/src/v1_25/api/core/v1/node_affinity.rs index 2a70de8703..dfd14357a3 100644 --- a/src/v1_25/api/core/v1/node_affinity.rs +++ b/src/v1_25/api/core/v1/node_affinity.rs @@ -12,7 +12,7 @@ pub struct NodeAffinity { impl crate::DeepMerge for NodeAffinity { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.preferred_during_scheduling_ignored_during_execution, other.preferred_during_scheduling_ignored_during_execution); + crate::merge_strategies::list::atomic(&mut self.preferred_during_scheduling_ignored_during_execution, other.preferred_during_scheduling_ignored_during_execution); crate::DeepMerge::merge_from(&mut self.required_during_scheduling_ignored_during_execution, other.required_during_scheduling_ignored_during_execution); } } diff --git a/src/v1_25/api/core/v1/node_selector.rs b/src/v1_25/api/core/v1/node_selector.rs index 5b146c615e..997fba9ef3 100644 --- a/src/v1_25/api/core/v1/node_selector.rs +++ b/src/v1_25/api/core/v1/node_selector.rs @@ -9,7 +9,7 @@ pub struct NodeSelector { impl crate::DeepMerge for NodeSelector { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.node_selector_terms, other.node_selector_terms); + crate::merge_strategies::list::atomic(&mut self.node_selector_terms, other.node_selector_terms); } } diff --git a/src/v1_25/api/core/v1/node_selector_requirement.rs b/src/v1_25/api/core/v1/node_selector_requirement.rs index 57817f1fab..5a76f55c6f 100644 --- a/src/v1_25/api/core/v1/node_selector_requirement.rs +++ b/src/v1_25/api/core/v1/node_selector_requirement.rs @@ -18,7 +18,7 @@ impl crate::DeepMerge for NodeSelectorRequirement { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.key, other.key); crate::DeepMerge::merge_from(&mut self.operator, other.operator); - crate::DeepMerge::merge_from(&mut self.values, other.values); + crate::merge_strategies::list::atomic(&mut self.values, other.values); } } diff --git a/src/v1_25/api/core/v1/node_selector_term.rs b/src/v1_25/api/core/v1/node_selector_term.rs index b0d28cc176..1237883670 100644 --- a/src/v1_25/api/core/v1/node_selector_term.rs +++ b/src/v1_25/api/core/v1/node_selector_term.rs @@ -12,8 +12,8 @@ pub struct NodeSelectorTerm { impl crate::DeepMerge for NodeSelectorTerm { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.match_expressions, other.match_expressions); - crate::DeepMerge::merge_from(&mut self.match_fields, other.match_fields); + crate::merge_strategies::list::atomic(&mut self.match_expressions, other.match_expressions); + crate::merge_strategies::list::atomic(&mut self.match_fields, other.match_fields); } } diff --git a/src/v1_25/api/core/v1/node_spec.rs b/src/v1_25/api/core/v1/node_spec.rs index bb4073b039..100d050910 100644 --- a/src/v1_25/api/core/v1/node_spec.rs +++ b/src/v1_25/api/core/v1/node_spec.rs @@ -30,9 +30,9 @@ impl crate::DeepMerge for NodeSpec { crate::DeepMerge::merge_from(&mut self.config_source, other.config_source); crate::DeepMerge::merge_from(&mut self.external_id, other.external_id); crate::DeepMerge::merge_from(&mut self.pod_cidr, other.pod_cidr); - crate::DeepMerge::merge_from(&mut self.pod_cidrs, other.pod_cidrs); + crate::merge_strategies::list::set(&mut self.pod_cidrs, other.pod_cidrs); crate::DeepMerge::merge_from(&mut self.provider_id, other.provider_id); - crate::DeepMerge::merge_from(&mut self.taints, other.taints); + crate::merge_strategies::list::atomic(&mut self.taints, other.taints); crate::DeepMerge::merge_from(&mut self.unschedulable, other.unschedulable); } } diff --git a/src/v1_25/api/core/v1/node_status.rs b/src/v1_25/api/core/v1/node_status.rs index 79f0d56439..39a6eb19f2 100644 --- a/src/v1_25/api/core/v1/node_status.rs +++ b/src/v1_25/api/core/v1/node_status.rs @@ -40,17 +40,35 @@ pub struct NodeStatus { impl crate::DeepMerge for NodeStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.addresses, other.addresses); - crate::DeepMerge::merge_from(&mut self.allocatable, other.allocatable); - crate::DeepMerge::merge_from(&mut self.capacity, other.capacity); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.addresses, + other.addresses, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::map::granular(&mut self.allocatable, other.allocatable, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.capacity, other.capacity, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.config, other.config); crate::DeepMerge::merge_from(&mut self.daemon_endpoints, other.daemon_endpoints); - crate::DeepMerge::merge_from(&mut self.images, other.images); + crate::merge_strategies::list::atomic(&mut self.images, other.images); crate::DeepMerge::merge_from(&mut self.node_info, other.node_info); crate::DeepMerge::merge_from(&mut self.phase, other.phase); - crate::DeepMerge::merge_from(&mut self.volumes_attached, other.volumes_attached); - crate::DeepMerge::merge_from(&mut self.volumes_in_use, other.volumes_in_use); + crate::merge_strategies::list::atomic(&mut self.volumes_attached, other.volumes_attached); + crate::merge_strategies::list::atomic(&mut self.volumes_in_use, other.volumes_in_use); } } diff --git a/src/v1_25/api/core/v1/persistent_volume_claim_spec.rs b/src/v1_25/api/core/v1/persistent_volume_claim_spec.rs index d43bb08405..fc48a46f28 100644 --- a/src/v1_25/api/core/v1/persistent_volume_claim_spec.rs +++ b/src/v1_25/api/core/v1/persistent_volume_claim_spec.rs @@ -35,7 +35,7 @@ pub struct PersistentVolumeClaimSpec { impl crate::DeepMerge for PersistentVolumeClaimSpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.access_modes, other.access_modes); + crate::merge_strategies::list::atomic(&mut self.access_modes, other.access_modes); crate::DeepMerge::merge_from(&mut self.data_source, other.data_source); crate::DeepMerge::merge_from(&mut self.data_source_ref, other.data_source_ref); crate::DeepMerge::merge_from(&mut self.resources, other.resources); diff --git a/src/v1_25/api/core/v1/persistent_volume_claim_status.rs b/src/v1_25/api/core/v1/persistent_volume_claim_status.rs index 8f5f980671..c3b27d01c5 100644 --- a/src/v1_25/api/core/v1/persistent_volume_claim_status.rs +++ b/src/v1_25/api/core/v1/persistent_volume_claim_status.rs @@ -25,10 +25,21 @@ pub struct PersistentVolumeClaimStatus { impl crate::DeepMerge for PersistentVolumeClaimStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.access_modes, other.access_modes); - crate::DeepMerge::merge_from(&mut self.allocated_resources, other.allocated_resources); - crate::DeepMerge::merge_from(&mut self.capacity, other.capacity); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::atomic(&mut self.access_modes, other.access_modes); + crate::merge_strategies::map::granular(&mut self.allocated_resources, other.allocated_resources, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.capacity, other.capacity, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.phase, other.phase); crate::DeepMerge::merge_from(&mut self.resize_status, other.resize_status); } diff --git a/src/v1_25/api/core/v1/persistent_volume_spec.rs b/src/v1_25/api/core/v1/persistent_volume_spec.rs index 42cd7fd388..39ced5b9b7 100644 --- a/src/v1_25/api/core/v1/persistent_volume_spec.rs +++ b/src/v1_25/api/core/v1/persistent_volume_spec.rs @@ -97,11 +97,13 @@ pub struct PersistentVolumeSpec { impl crate::DeepMerge for PersistentVolumeSpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.access_modes, other.access_modes); + crate::merge_strategies::list::atomic(&mut self.access_modes, other.access_modes); crate::DeepMerge::merge_from(&mut self.aws_elastic_block_store, other.aws_elastic_block_store); crate::DeepMerge::merge_from(&mut self.azure_disk, other.azure_disk); crate::DeepMerge::merge_from(&mut self.azure_file, other.azure_file); - crate::DeepMerge::merge_from(&mut self.capacity, other.capacity); + crate::merge_strategies::map::granular(&mut self.capacity, other.capacity, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.cephfs, other.cephfs); crate::DeepMerge::merge_from(&mut self.cinder, other.cinder); crate::DeepMerge::merge_from(&mut self.claim_ref, other.claim_ref); @@ -114,7 +116,7 @@ impl crate::DeepMerge for PersistentVolumeSpec { crate::DeepMerge::merge_from(&mut self.host_path, other.host_path); crate::DeepMerge::merge_from(&mut self.iscsi, other.iscsi); crate::DeepMerge::merge_from(&mut self.local, other.local); - crate::DeepMerge::merge_from(&mut self.mount_options, other.mount_options); + crate::merge_strategies::list::atomic(&mut self.mount_options, other.mount_options); crate::DeepMerge::merge_from(&mut self.nfs, other.nfs); crate::DeepMerge::merge_from(&mut self.node_affinity, other.node_affinity); crate::DeepMerge::merge_from(&mut self.persistent_volume_reclaim_policy, other.persistent_volume_reclaim_policy); diff --git a/src/v1_25/api/core/v1/pod_affinity.rs b/src/v1_25/api/core/v1/pod_affinity.rs index facc781ff6..a528250bbc 100644 --- a/src/v1_25/api/core/v1/pod_affinity.rs +++ b/src/v1_25/api/core/v1/pod_affinity.rs @@ -12,8 +12,8 @@ pub struct PodAffinity { impl crate::DeepMerge for PodAffinity { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.preferred_during_scheduling_ignored_during_execution, other.preferred_during_scheduling_ignored_during_execution); - crate::DeepMerge::merge_from(&mut self.required_during_scheduling_ignored_during_execution, other.required_during_scheduling_ignored_during_execution); + crate::merge_strategies::list::atomic(&mut self.preferred_during_scheduling_ignored_during_execution, other.preferred_during_scheduling_ignored_during_execution); + crate::merge_strategies::list::atomic(&mut self.required_during_scheduling_ignored_during_execution, other.required_during_scheduling_ignored_during_execution); } } diff --git a/src/v1_25/api/core/v1/pod_affinity_term.rs b/src/v1_25/api/core/v1/pod_affinity_term.rs index 92b8e14b28..497fd832bf 100644 --- a/src/v1_25/api/core/v1/pod_affinity_term.rs +++ b/src/v1_25/api/core/v1/pod_affinity_term.rs @@ -20,7 +20,7 @@ impl crate::DeepMerge for PodAffinityTerm { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.label_selector, other.label_selector); crate::DeepMerge::merge_from(&mut self.namespace_selector, other.namespace_selector); - crate::DeepMerge::merge_from(&mut self.namespaces, other.namespaces); + crate::merge_strategies::list::atomic(&mut self.namespaces, other.namespaces); crate::DeepMerge::merge_from(&mut self.topology_key, other.topology_key); } } diff --git a/src/v1_25/api/core/v1/pod_anti_affinity.rs b/src/v1_25/api/core/v1/pod_anti_affinity.rs index a6cd6aa584..86979017ac 100644 --- a/src/v1_25/api/core/v1/pod_anti_affinity.rs +++ b/src/v1_25/api/core/v1/pod_anti_affinity.rs @@ -12,8 +12,8 @@ pub struct PodAntiAffinity { impl crate::DeepMerge for PodAntiAffinity { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.preferred_during_scheduling_ignored_during_execution, other.preferred_during_scheduling_ignored_during_execution); - crate::DeepMerge::merge_from(&mut self.required_during_scheduling_ignored_during_execution, other.required_during_scheduling_ignored_during_execution); + crate::merge_strategies::list::atomic(&mut self.preferred_during_scheduling_ignored_during_execution, other.preferred_during_scheduling_ignored_during_execution); + crate::merge_strategies::list::atomic(&mut self.required_during_scheduling_ignored_during_execution, other.required_during_scheduling_ignored_during_execution); } } diff --git a/src/v1_25/api/core/v1/pod_dns_config.rs b/src/v1_25/api/core/v1/pod_dns_config.rs index b79282bb55..201eb4d69c 100644 --- a/src/v1_25/api/core/v1/pod_dns_config.rs +++ b/src/v1_25/api/core/v1/pod_dns_config.rs @@ -15,9 +15,9 @@ pub struct PodDNSConfig { impl crate::DeepMerge for PodDNSConfig { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.nameservers, other.nameservers); - crate::DeepMerge::merge_from(&mut self.options, other.options); - crate::DeepMerge::merge_from(&mut self.searches, other.searches); + crate::merge_strategies::list::atomic(&mut self.nameservers, other.nameservers); + crate::merge_strategies::list::atomic(&mut self.options, other.options); + crate::merge_strategies::list::atomic(&mut self.searches, other.searches); } } diff --git a/src/v1_25/api/core/v1/pod_security_context.rs b/src/v1_25/api/core/v1/pod_security_context.rs index 9cf93e3f01..b595b94dfc 100644 --- a/src/v1_25/api/core/v1/pod_security_context.rs +++ b/src/v1_25/api/core/v1/pod_security_context.rs @@ -47,8 +47,8 @@ impl crate::DeepMerge for PodSecurityContext { crate::DeepMerge::merge_from(&mut self.run_as_user, other.run_as_user); crate::DeepMerge::merge_from(&mut self.se_linux_options, other.se_linux_options); crate::DeepMerge::merge_from(&mut self.seccomp_profile, other.seccomp_profile); - crate::DeepMerge::merge_from(&mut self.supplemental_groups, other.supplemental_groups); - crate::DeepMerge::merge_from(&mut self.sysctls, other.sysctls); + crate::merge_strategies::list::atomic(&mut self.supplemental_groups, other.supplemental_groups); + crate::merge_strategies::list::atomic(&mut self.sysctls, other.sysctls); crate::DeepMerge::merge_from(&mut self.windows_options, other.windows_options); } } diff --git a/src/v1_25/api/core/v1/pod_spec.rs b/src/v1_25/api/core/v1/pod_spec.rs index ef1f76e7d4..3856376b57 100644 --- a/src/v1_25/api/core/v1/pod_spec.rs +++ b/src/v1_25/api/core/v1/pod_spec.rs @@ -126,27 +126,64 @@ impl crate::DeepMerge for PodSpec { crate::DeepMerge::merge_from(&mut self.active_deadline_seconds, other.active_deadline_seconds); crate::DeepMerge::merge_from(&mut self.affinity, other.affinity); crate::DeepMerge::merge_from(&mut self.automount_service_account_token, other.automount_service_account_token); - crate::DeepMerge::merge_from(&mut self.containers, other.containers); + crate::merge_strategies::list::map( + &mut self.containers, + other.containers, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.dns_config, other.dns_config); crate::DeepMerge::merge_from(&mut self.dns_policy, other.dns_policy); crate::DeepMerge::merge_from(&mut self.enable_service_links, other.enable_service_links); - crate::DeepMerge::merge_from(&mut self.ephemeral_containers, other.ephemeral_containers); - crate::DeepMerge::merge_from(&mut self.host_aliases, other.host_aliases); + crate::merge_strategies::list::map( + &mut self.ephemeral_containers, + other.ephemeral_containers, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::list::map( + &mut self.host_aliases, + other.host_aliases, + &[|lhs, rhs| lhs.ip == rhs.ip], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.host_ipc, other.host_ipc); crate::DeepMerge::merge_from(&mut self.host_network, other.host_network); crate::DeepMerge::merge_from(&mut self.host_pid, other.host_pid); crate::DeepMerge::merge_from(&mut self.host_users, other.host_users); crate::DeepMerge::merge_from(&mut self.hostname, other.hostname); - crate::DeepMerge::merge_from(&mut self.image_pull_secrets, other.image_pull_secrets); - crate::DeepMerge::merge_from(&mut self.init_containers, other.init_containers); + crate::merge_strategies::list::map( + &mut self.image_pull_secrets, + other.image_pull_secrets, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::list::map( + &mut self.init_containers, + other.init_containers, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.node_name, other.node_name); - crate::DeepMerge::merge_from(&mut self.node_selector, other.node_selector); + crate::merge_strategies::map::atomic(&mut self.node_selector, other.node_selector); crate::DeepMerge::merge_from(&mut self.os, other.os); - crate::DeepMerge::merge_from(&mut self.overhead, other.overhead); + crate::merge_strategies::map::granular(&mut self.overhead, other.overhead, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.preemption_policy, other.preemption_policy); crate::DeepMerge::merge_from(&mut self.priority, other.priority); crate::DeepMerge::merge_from(&mut self.priority_class_name, other.priority_class_name); - crate::DeepMerge::merge_from(&mut self.readiness_gates, other.readiness_gates); + crate::merge_strategies::list::atomic(&mut self.readiness_gates, other.readiness_gates); crate::DeepMerge::merge_from(&mut self.restart_policy, other.restart_policy); crate::DeepMerge::merge_from(&mut self.runtime_class_name, other.runtime_class_name); crate::DeepMerge::merge_from(&mut self.scheduler_name, other.scheduler_name); @@ -157,9 +194,23 @@ impl crate::DeepMerge for PodSpec { crate::DeepMerge::merge_from(&mut self.share_process_namespace, other.share_process_namespace); crate::DeepMerge::merge_from(&mut self.subdomain, other.subdomain); crate::DeepMerge::merge_from(&mut self.termination_grace_period_seconds, other.termination_grace_period_seconds); - crate::DeepMerge::merge_from(&mut self.tolerations, other.tolerations); - crate::DeepMerge::merge_from(&mut self.topology_spread_constraints, other.topology_spread_constraints); - crate::DeepMerge::merge_from(&mut self.volumes, other.volumes); + crate::merge_strategies::list::atomic(&mut self.tolerations, other.tolerations); + crate::merge_strategies::list::map( + &mut self.topology_spread_constraints, + other.topology_spread_constraints, + &[|lhs, rhs| lhs.topology_key == rhs.topology_key], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::list::map( + &mut self.volumes, + other.volumes, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_25/api/core/v1/pod_status.rs b/src/v1_25/api/core/v1/pod_status.rs index 6f83dcb6f7..c0c9e62f9a 100644 --- a/src/v1_25/api/core/v1/pod_status.rs +++ b/src/v1_25/api/core/v1/pod_status.rs @@ -51,16 +51,30 @@ pub struct PodStatus { impl crate::DeepMerge for PodStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); - crate::DeepMerge::merge_from(&mut self.container_statuses, other.container_statuses); - crate::DeepMerge::merge_from(&mut self.ephemeral_container_statuses, other.ephemeral_container_statuses); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::list::atomic(&mut self.container_statuses, other.container_statuses); + crate::merge_strategies::list::atomic(&mut self.ephemeral_container_statuses, other.ephemeral_container_statuses); crate::DeepMerge::merge_from(&mut self.host_ip, other.host_ip); - crate::DeepMerge::merge_from(&mut self.init_container_statuses, other.init_container_statuses); + crate::merge_strategies::list::atomic(&mut self.init_container_statuses, other.init_container_statuses); crate::DeepMerge::merge_from(&mut self.message, other.message); crate::DeepMerge::merge_from(&mut self.nominated_node_name, other.nominated_node_name); crate::DeepMerge::merge_from(&mut self.phase, other.phase); crate::DeepMerge::merge_from(&mut self.pod_ip, other.pod_ip); - crate::DeepMerge::merge_from(&mut self.pod_ips, other.pod_ips); + crate::merge_strategies::list::map( + &mut self.pod_ips, + other.pod_ips, + &[|lhs, rhs| lhs.ip == rhs.ip], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.qos_class, other.qos_class); crate::DeepMerge::merge_from(&mut self.reason, other.reason); crate::DeepMerge::merge_from(&mut self.start_time, other.start_time); diff --git a/src/v1_25/api/core/v1/projected_volume_source.rs b/src/v1_25/api/core/v1/projected_volume_source.rs index 8cbfa14727..676638445b 100644 --- a/src/v1_25/api/core/v1/projected_volume_source.rs +++ b/src/v1_25/api/core/v1/projected_volume_source.rs @@ -13,7 +13,7 @@ pub struct ProjectedVolumeSource { impl crate::DeepMerge for ProjectedVolumeSource { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.default_mode, other.default_mode); - crate::DeepMerge::merge_from(&mut self.sources, other.sources); + crate::merge_strategies::list::atomic(&mut self.sources, other.sources); } } diff --git a/src/v1_25/api/core/v1/rbd_persistent_volume_source.rs b/src/v1_25/api/core/v1/rbd_persistent_volume_source.rs index 54b7b5e7f2..08d1308041 100644 --- a/src/v1_25/api/core/v1/rbd_persistent_volume_source.rs +++ b/src/v1_25/api/core/v1/rbd_persistent_volume_source.rs @@ -33,7 +33,7 @@ impl crate::DeepMerge for RBDPersistentVolumeSource { crate::DeepMerge::merge_from(&mut self.fs_type, other.fs_type); crate::DeepMerge::merge_from(&mut self.image, other.image); crate::DeepMerge::merge_from(&mut self.keyring, other.keyring); - crate::DeepMerge::merge_from(&mut self.monitors, other.monitors); + crate::merge_strategies::list::atomic(&mut self.monitors, other.monitors); crate::DeepMerge::merge_from(&mut self.pool, other.pool); crate::DeepMerge::merge_from(&mut self.read_only, other.read_only); crate::DeepMerge::merge_from(&mut self.secret_ref, other.secret_ref); diff --git a/src/v1_25/api/core/v1/rbd_volume_source.rs b/src/v1_25/api/core/v1/rbd_volume_source.rs index 2d39e78da8..18a2d2c010 100644 --- a/src/v1_25/api/core/v1/rbd_volume_source.rs +++ b/src/v1_25/api/core/v1/rbd_volume_source.rs @@ -33,7 +33,7 @@ impl crate::DeepMerge for RBDVolumeSource { crate::DeepMerge::merge_from(&mut self.fs_type, other.fs_type); crate::DeepMerge::merge_from(&mut self.image, other.image); crate::DeepMerge::merge_from(&mut self.keyring, other.keyring); - crate::DeepMerge::merge_from(&mut self.monitors, other.monitors); + crate::merge_strategies::list::atomic(&mut self.monitors, other.monitors); crate::DeepMerge::merge_from(&mut self.pool, other.pool); crate::DeepMerge::merge_from(&mut self.read_only, other.read_only); crate::DeepMerge::merge_from(&mut self.secret_ref, other.secret_ref); diff --git a/src/v1_25/api/core/v1/replication_controller_spec.rs b/src/v1_25/api/core/v1/replication_controller_spec.rs index 293546b183..ed3edfa202 100644 --- a/src/v1_25/api/core/v1/replication_controller_spec.rs +++ b/src/v1_25/api/core/v1/replication_controller_spec.rs @@ -20,7 +20,7 @@ impl crate::DeepMerge for ReplicationControllerSpec { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.min_ready_seconds, other.min_ready_seconds); crate::DeepMerge::merge_from(&mut self.replicas, other.replicas); - crate::DeepMerge::merge_from(&mut self.selector, other.selector); + crate::merge_strategies::map::atomic(&mut self.selector, other.selector); crate::DeepMerge::merge_from(&mut self.template, other.template); } } diff --git a/src/v1_25/api/core/v1/replication_controller_status.rs b/src/v1_25/api/core/v1/replication_controller_status.rs index d069722747..47ccceaeba 100644 --- a/src/v1_25/api/core/v1/replication_controller_status.rs +++ b/src/v1_25/api/core/v1/replication_controller_status.rs @@ -25,7 +25,14 @@ pub struct ReplicationControllerStatus { impl crate::DeepMerge for ReplicationControllerStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.available_replicas, other.available_replicas); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.fully_labeled_replicas, other.fully_labeled_replicas); crate::DeepMerge::merge_from(&mut self.observed_generation, other.observed_generation); crate::DeepMerge::merge_from(&mut self.ready_replicas, other.ready_replicas); diff --git a/src/v1_25/api/core/v1/resource_quota_spec.rs b/src/v1_25/api/core/v1/resource_quota_spec.rs index fab2b7970d..3468d8e9e0 100644 --- a/src/v1_25/api/core/v1/resource_quota_spec.rs +++ b/src/v1_25/api/core/v1/resource_quota_spec.rs @@ -15,9 +15,11 @@ pub struct ResourceQuotaSpec { impl crate::DeepMerge for ResourceQuotaSpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.hard, other.hard); + crate::merge_strategies::map::granular(&mut self.hard, other.hard, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.scope_selector, other.scope_selector); - crate::DeepMerge::merge_from(&mut self.scopes, other.scopes); + crate::merge_strategies::list::atomic(&mut self.scopes, other.scopes); } } diff --git a/src/v1_25/api/core/v1/resource_quota_status.rs b/src/v1_25/api/core/v1/resource_quota_status.rs index 100f418a69..74ee1efe3c 100644 --- a/src/v1_25/api/core/v1/resource_quota_status.rs +++ b/src/v1_25/api/core/v1/resource_quota_status.rs @@ -12,8 +12,12 @@ pub struct ResourceQuotaStatus { impl crate::DeepMerge for ResourceQuotaStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.hard, other.hard); - crate::DeepMerge::merge_from(&mut self.used, other.used); + crate::merge_strategies::map::granular(&mut self.hard, other.hard, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.used, other.used, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); } } diff --git a/src/v1_25/api/core/v1/resource_requirements.rs b/src/v1_25/api/core/v1/resource_requirements.rs index 816608c415..c3f4b1fd86 100644 --- a/src/v1_25/api/core/v1/resource_requirements.rs +++ b/src/v1_25/api/core/v1/resource_requirements.rs @@ -12,8 +12,12 @@ pub struct ResourceRequirements { impl crate::DeepMerge for ResourceRequirements { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.limits, other.limits); - crate::DeepMerge::merge_from(&mut self.requests, other.requests); + crate::merge_strategies::map::granular(&mut self.limits, other.limits, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.requests, other.requests, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); } } diff --git a/src/v1_25/api/core/v1/scope_selector.rs b/src/v1_25/api/core/v1/scope_selector.rs index 22ef180aeb..23ebdb0612 100644 --- a/src/v1_25/api/core/v1/scope_selector.rs +++ b/src/v1_25/api/core/v1/scope_selector.rs @@ -9,7 +9,7 @@ pub struct ScopeSelector { impl crate::DeepMerge for ScopeSelector { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.match_expressions, other.match_expressions); + crate::merge_strategies::list::atomic(&mut self.match_expressions, other.match_expressions); } } diff --git a/src/v1_25/api/core/v1/scoped_resource_selector_requirement.rs b/src/v1_25/api/core/v1/scoped_resource_selector_requirement.rs index 14449d761a..591e72bec0 100644 --- a/src/v1_25/api/core/v1/scoped_resource_selector_requirement.rs +++ b/src/v1_25/api/core/v1/scoped_resource_selector_requirement.rs @@ -19,7 +19,7 @@ impl crate::DeepMerge for ScopedResourceSelectorRequirement { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.operator, other.operator); crate::DeepMerge::merge_from(&mut self.scope_name, other.scope_name); - crate::DeepMerge::merge_from(&mut self.values, other.values); + crate::merge_strategies::list::atomic(&mut self.values, other.values); } } diff --git a/src/v1_25/api/core/v1/secret.rs b/src/v1_25/api/core/v1/secret.rs index 74a33ebe09..eb75155e0d 100644 --- a/src/v1_25/api/core/v1/secret.rs +++ b/src/v1_25/api/core/v1/secret.rs @@ -498,10 +498,14 @@ impl crate::Metadata for Secret { impl crate::DeepMerge for Secret { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.data, other.data); + crate::merge_strategies::map::granular(&mut self.data, other.data, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.immutable, other.immutable); crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.string_data, other.string_data); + crate::merge_strategies::map::granular(&mut self.string_data, other.string_data, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.type_, other.type_); } } diff --git a/src/v1_25/api/core/v1/secret_projection.rs b/src/v1_25/api/core/v1/secret_projection.rs index f32c8fac09..58cd75c106 100644 --- a/src/v1_25/api/core/v1/secret_projection.rs +++ b/src/v1_25/api/core/v1/secret_projection.rs @@ -17,7 +17,7 @@ pub struct SecretProjection { impl crate::DeepMerge for SecretProjection { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.items, other.items); + crate::merge_strategies::list::atomic(&mut self.items, other.items); crate::DeepMerge::merge_from(&mut self.name, other.name); crate::DeepMerge::merge_from(&mut self.optional, other.optional); } diff --git a/src/v1_25/api/core/v1/secret_volume_source.rs b/src/v1_25/api/core/v1/secret_volume_source.rs index 9be0591abd..9d45331f6d 100644 --- a/src/v1_25/api/core/v1/secret_volume_source.rs +++ b/src/v1_25/api/core/v1/secret_volume_source.rs @@ -21,7 +21,7 @@ pub struct SecretVolumeSource { impl crate::DeepMerge for SecretVolumeSource { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.default_mode, other.default_mode); - crate::DeepMerge::merge_from(&mut self.items, other.items); + crate::merge_strategies::list::atomic(&mut self.items, other.items); crate::DeepMerge::merge_from(&mut self.optional, other.optional); crate::DeepMerge::merge_from(&mut self.secret_name, other.secret_name); } diff --git a/src/v1_25/api/core/v1/service_account.rs b/src/v1_25/api/core/v1/service_account.rs index 9cc6535f2a..1f966964fe 100644 --- a/src/v1_25/api/core/v1/service_account.rs +++ b/src/v1_25/api/core/v1/service_account.rs @@ -496,9 +496,16 @@ impl crate::Metadata for ServiceAccount { impl crate::DeepMerge for ServiceAccount { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.automount_service_account_token, other.automount_service_account_token); - crate::DeepMerge::merge_from(&mut self.image_pull_secrets, other.image_pull_secrets); + crate::merge_strategies::list::atomic(&mut self.image_pull_secrets, other.image_pull_secrets); crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.secrets, other.secrets); + crate::merge_strategies::list::map( + &mut self.secrets, + other.secrets, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_25/api/core/v1/service_spec.rs b/src/v1_25/api/core/v1/service_spec.rs index 528752c409..77d5ead5d3 100644 --- a/src/v1_25/api/core/v1/service_spec.rs +++ b/src/v1_25/api/core/v1/service_spec.rs @@ -72,20 +72,27 @@ impl crate::DeepMerge for ServiceSpec { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.allocate_load_balancer_node_ports, other.allocate_load_balancer_node_ports); crate::DeepMerge::merge_from(&mut self.cluster_ip, other.cluster_ip); - crate::DeepMerge::merge_from(&mut self.cluster_ips, other.cluster_ips); - crate::DeepMerge::merge_from(&mut self.external_ips, other.external_ips); + crate::merge_strategies::list::atomic(&mut self.cluster_ips, other.cluster_ips); + crate::merge_strategies::list::atomic(&mut self.external_ips, other.external_ips); crate::DeepMerge::merge_from(&mut self.external_name, other.external_name); crate::DeepMerge::merge_from(&mut self.external_traffic_policy, other.external_traffic_policy); crate::DeepMerge::merge_from(&mut self.health_check_node_port, other.health_check_node_port); crate::DeepMerge::merge_from(&mut self.internal_traffic_policy, other.internal_traffic_policy); - crate::DeepMerge::merge_from(&mut self.ip_families, other.ip_families); + crate::merge_strategies::list::atomic(&mut self.ip_families, other.ip_families); crate::DeepMerge::merge_from(&mut self.ip_family_policy, other.ip_family_policy); crate::DeepMerge::merge_from(&mut self.load_balancer_class, other.load_balancer_class); crate::DeepMerge::merge_from(&mut self.load_balancer_ip, other.load_balancer_ip); - crate::DeepMerge::merge_from(&mut self.load_balancer_source_ranges, other.load_balancer_source_ranges); - crate::DeepMerge::merge_from(&mut self.ports, other.ports); + crate::merge_strategies::list::atomic(&mut self.load_balancer_source_ranges, other.load_balancer_source_ranges); + crate::merge_strategies::list::map( + &mut self.ports, + other.ports, + &[|lhs, rhs| lhs.port == rhs.port], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.publish_not_ready_addresses, other.publish_not_ready_addresses); - crate::DeepMerge::merge_from(&mut self.selector, other.selector); + crate::merge_strategies::map::atomic(&mut self.selector, other.selector); crate::DeepMerge::merge_from(&mut self.session_affinity, other.session_affinity); crate::DeepMerge::merge_from(&mut self.session_affinity_config, other.session_affinity_config); crate::DeepMerge::merge_from(&mut self.type_, other.type_); diff --git a/src/v1_25/api/core/v1/service_status.rs b/src/v1_25/api/core/v1/service_status.rs index 6c3429fd70..6dece09b96 100644 --- a/src/v1_25/api/core/v1/service_status.rs +++ b/src/v1_25/api/core/v1/service_status.rs @@ -12,7 +12,14 @@ pub struct ServiceStatus { impl crate::DeepMerge for ServiceStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.load_balancer, other.load_balancer); } } diff --git a/src/v1_25/api/core/v1/topology_selector_label_requirement.rs b/src/v1_25/api/core/v1/topology_selector_label_requirement.rs index 3efed6ba65..50764252b6 100644 --- a/src/v1_25/api/core/v1/topology_selector_label_requirement.rs +++ b/src/v1_25/api/core/v1/topology_selector_label_requirement.rs @@ -13,7 +13,7 @@ pub struct TopologySelectorLabelRequirement { impl crate::DeepMerge for TopologySelectorLabelRequirement { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.key, other.key); - crate::DeepMerge::merge_from(&mut self.values, other.values); + crate::merge_strategies::list::atomic(&mut self.values, other.values); } } diff --git a/src/v1_25/api/core/v1/topology_selector_term.rs b/src/v1_25/api/core/v1/topology_selector_term.rs index 230f7ab530..df526d6f4d 100644 --- a/src/v1_25/api/core/v1/topology_selector_term.rs +++ b/src/v1_25/api/core/v1/topology_selector_term.rs @@ -9,7 +9,7 @@ pub struct TopologySelectorTerm { impl crate::DeepMerge for TopologySelectorTerm { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.match_label_expressions, other.match_label_expressions); + crate::merge_strategies::list::atomic(&mut self.match_label_expressions, other.match_label_expressions); } } diff --git a/src/v1_25/api/core/v1/topology_spread_constraint.rs b/src/v1_25/api/core/v1/topology_spread_constraint.rs index 25d8f2d95b..4a32927094 100644 --- a/src/v1_25/api/core/v1/topology_spread_constraint.rs +++ b/src/v1_25/api/core/v1/topology_spread_constraint.rs @@ -43,7 +43,7 @@ pub struct TopologySpreadConstraint { impl crate::DeepMerge for TopologySpreadConstraint { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.label_selector, other.label_selector); - crate::DeepMerge::merge_from(&mut self.match_label_keys, other.match_label_keys); + crate::merge_strategies::list::atomic(&mut self.match_label_keys, other.match_label_keys); crate::DeepMerge::merge_from(&mut self.max_skew, other.max_skew); crate::DeepMerge::merge_from(&mut self.min_domains, other.min_domains); crate::DeepMerge::merge_from(&mut self.node_affinity_policy, other.node_affinity_policy); diff --git a/src/v1_25/api/discovery/v1/endpoint.rs b/src/v1_25/api/discovery/v1/endpoint.rs index 9878d80d05..14b9a4c308 100644 --- a/src/v1_25/api/discovery/v1/endpoint.rs +++ b/src/v1_25/api/discovery/v1/endpoint.rs @@ -30,9 +30,11 @@ pub struct Endpoint { impl crate::DeepMerge for Endpoint { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.addresses, other.addresses); + crate::merge_strategies::list::set(&mut self.addresses, other.addresses); crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); - crate::DeepMerge::merge_from(&mut self.deprecated_topology, other.deprecated_topology); + crate::merge_strategies::map::granular(&mut self.deprecated_topology, other.deprecated_topology, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.hints, other.hints); crate::DeepMerge::merge_from(&mut self.hostname, other.hostname); crate::DeepMerge::merge_from(&mut self.node_name, other.node_name); diff --git a/src/v1_25/api/discovery/v1/endpoint_hints.rs b/src/v1_25/api/discovery/v1/endpoint_hints.rs index 7fe956528a..02cbd88946 100644 --- a/src/v1_25/api/discovery/v1/endpoint_hints.rs +++ b/src/v1_25/api/discovery/v1/endpoint_hints.rs @@ -9,7 +9,7 @@ pub struct EndpointHints { impl crate::DeepMerge for EndpointHints { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.for_zones, other.for_zones); + crate::merge_strategies::list::atomic(&mut self.for_zones, other.for_zones); } } diff --git a/src/v1_25/api/discovery/v1/endpoint_slice.rs b/src/v1_25/api/discovery/v1/endpoint_slice.rs index 5858e58711..033c1c4e60 100644 --- a/src/v1_25/api/discovery/v1/endpoint_slice.rs +++ b/src/v1_25/api/discovery/v1/endpoint_slice.rs @@ -497,9 +497,9 @@ impl crate::Metadata for EndpointSlice { impl crate::DeepMerge for EndpointSlice { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.address_type, other.address_type); - crate::DeepMerge::merge_from(&mut self.endpoints, other.endpoints); + crate::merge_strategies::list::atomic(&mut self.endpoints, other.endpoints); crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.ports, other.ports); + crate::merge_strategies::list::atomic(&mut self.ports, other.ports); } } diff --git a/src/v1_25/api/flowcontrol/v1beta1/flow_schema_spec.rs b/src/v1_25/api/flowcontrol/v1beta1/flow_schema_spec.rs index 40031e5acc..fb04b8c0af 100644 --- a/src/v1_25/api/flowcontrol/v1beta1/flow_schema_spec.rs +++ b/src/v1_25/api/flowcontrol/v1beta1/flow_schema_spec.rs @@ -21,7 +21,7 @@ impl crate::DeepMerge for FlowSchemaSpec { crate::DeepMerge::merge_from(&mut self.distinguisher_method, other.distinguisher_method); crate::DeepMerge::merge_from(&mut self.matching_precedence, other.matching_precedence); crate::DeepMerge::merge_from(&mut self.priority_level_configuration, other.priority_level_configuration); - crate::DeepMerge::merge_from(&mut self.rules, other.rules); + crate::merge_strategies::list::atomic(&mut self.rules, other.rules); } } diff --git a/src/v1_25/api/flowcontrol/v1beta1/flow_schema_status.rs b/src/v1_25/api/flowcontrol/v1beta1/flow_schema_status.rs index c463e68e6a..7de52a1a65 100644 --- a/src/v1_25/api/flowcontrol/v1beta1/flow_schema_status.rs +++ b/src/v1_25/api/flowcontrol/v1beta1/flow_schema_status.rs @@ -9,7 +9,14 @@ pub struct FlowSchemaStatus { impl crate::DeepMerge for FlowSchemaStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_25/api/flowcontrol/v1beta1/non_resource_policy_rule.rs b/src/v1_25/api/flowcontrol/v1beta1/non_resource_policy_rule.rs index 80b8803dc1..ac9b066b17 100644 --- a/src/v1_25/api/flowcontrol/v1beta1/non_resource_policy_rule.rs +++ b/src/v1_25/api/flowcontrol/v1beta1/non_resource_policy_rule.rs @@ -18,8 +18,8 @@ pub struct NonResourcePolicyRule { impl crate::DeepMerge for NonResourcePolicyRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.non_resource_urls, other.non_resource_urls); - crate::DeepMerge::merge_from(&mut self.verbs, other.verbs); + crate::merge_strategies::list::set(&mut self.non_resource_urls, other.non_resource_urls); + crate::merge_strategies::list::set(&mut self.verbs, other.verbs); } } diff --git a/src/v1_25/api/flowcontrol/v1beta1/policy_rules_with_subjects.rs b/src/v1_25/api/flowcontrol/v1beta1/policy_rules_with_subjects.rs index 780a347761..8a727117e0 100644 --- a/src/v1_25/api/flowcontrol/v1beta1/policy_rules_with_subjects.rs +++ b/src/v1_25/api/flowcontrol/v1beta1/policy_rules_with_subjects.rs @@ -15,9 +15,9 @@ pub struct PolicyRulesWithSubjects { impl crate::DeepMerge for PolicyRulesWithSubjects { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.non_resource_rules, other.non_resource_rules); - crate::DeepMerge::merge_from(&mut self.resource_rules, other.resource_rules); - crate::DeepMerge::merge_from(&mut self.subjects, other.subjects); + crate::merge_strategies::list::atomic(&mut self.non_resource_rules, other.non_resource_rules); + crate::merge_strategies::list::atomic(&mut self.resource_rules, other.resource_rules); + crate::merge_strategies::list::atomic(&mut self.subjects, other.subjects); } } diff --git a/src/v1_25/api/flowcontrol/v1beta1/priority_level_configuration_status.rs b/src/v1_25/api/flowcontrol/v1beta1/priority_level_configuration_status.rs index a356b4a6df..e35efdf597 100644 --- a/src/v1_25/api/flowcontrol/v1beta1/priority_level_configuration_status.rs +++ b/src/v1_25/api/flowcontrol/v1beta1/priority_level_configuration_status.rs @@ -9,7 +9,14 @@ pub struct PriorityLevelConfigurationStatus { impl crate::DeepMerge for PriorityLevelConfigurationStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_25/api/flowcontrol/v1beta1/resource_policy_rule.rs b/src/v1_25/api/flowcontrol/v1beta1/resource_policy_rule.rs index 93d3b933e4..895a7e8d48 100644 --- a/src/v1_25/api/flowcontrol/v1beta1/resource_policy_rule.rs +++ b/src/v1_25/api/flowcontrol/v1beta1/resource_policy_rule.rs @@ -21,11 +21,11 @@ pub struct ResourcePolicyRule { impl crate::DeepMerge for ResourcePolicyRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.api_groups, other.api_groups); + crate::merge_strategies::list::set(&mut self.api_groups, other.api_groups); crate::DeepMerge::merge_from(&mut self.cluster_scope, other.cluster_scope); - crate::DeepMerge::merge_from(&mut self.namespaces, other.namespaces); - crate::DeepMerge::merge_from(&mut self.resources, other.resources); - crate::DeepMerge::merge_from(&mut self.verbs, other.verbs); + crate::merge_strategies::list::set(&mut self.namespaces, other.namespaces); + crate::merge_strategies::list::set(&mut self.resources, other.resources); + crate::merge_strategies::list::set(&mut self.verbs, other.verbs); } } diff --git a/src/v1_25/api/flowcontrol/v1beta2/flow_schema_spec.rs b/src/v1_25/api/flowcontrol/v1beta2/flow_schema_spec.rs index e28a19711f..c8c9e2a04f 100644 --- a/src/v1_25/api/flowcontrol/v1beta2/flow_schema_spec.rs +++ b/src/v1_25/api/flowcontrol/v1beta2/flow_schema_spec.rs @@ -21,7 +21,7 @@ impl crate::DeepMerge for FlowSchemaSpec { crate::DeepMerge::merge_from(&mut self.distinguisher_method, other.distinguisher_method); crate::DeepMerge::merge_from(&mut self.matching_precedence, other.matching_precedence); crate::DeepMerge::merge_from(&mut self.priority_level_configuration, other.priority_level_configuration); - crate::DeepMerge::merge_from(&mut self.rules, other.rules); + crate::merge_strategies::list::atomic(&mut self.rules, other.rules); } } diff --git a/src/v1_25/api/flowcontrol/v1beta2/flow_schema_status.rs b/src/v1_25/api/flowcontrol/v1beta2/flow_schema_status.rs index 104835c519..f412d33945 100644 --- a/src/v1_25/api/flowcontrol/v1beta2/flow_schema_status.rs +++ b/src/v1_25/api/flowcontrol/v1beta2/flow_schema_status.rs @@ -9,7 +9,14 @@ pub struct FlowSchemaStatus { impl crate::DeepMerge for FlowSchemaStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_25/api/flowcontrol/v1beta2/non_resource_policy_rule.rs b/src/v1_25/api/flowcontrol/v1beta2/non_resource_policy_rule.rs index e9be9c98a4..f4d3bb0bfc 100644 --- a/src/v1_25/api/flowcontrol/v1beta2/non_resource_policy_rule.rs +++ b/src/v1_25/api/flowcontrol/v1beta2/non_resource_policy_rule.rs @@ -18,8 +18,8 @@ pub struct NonResourcePolicyRule { impl crate::DeepMerge for NonResourcePolicyRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.non_resource_urls, other.non_resource_urls); - crate::DeepMerge::merge_from(&mut self.verbs, other.verbs); + crate::merge_strategies::list::set(&mut self.non_resource_urls, other.non_resource_urls); + crate::merge_strategies::list::set(&mut self.verbs, other.verbs); } } diff --git a/src/v1_25/api/flowcontrol/v1beta2/policy_rules_with_subjects.rs b/src/v1_25/api/flowcontrol/v1beta2/policy_rules_with_subjects.rs index 55c59b24a2..c6b9fafade 100644 --- a/src/v1_25/api/flowcontrol/v1beta2/policy_rules_with_subjects.rs +++ b/src/v1_25/api/flowcontrol/v1beta2/policy_rules_with_subjects.rs @@ -15,9 +15,9 @@ pub struct PolicyRulesWithSubjects { impl crate::DeepMerge for PolicyRulesWithSubjects { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.non_resource_rules, other.non_resource_rules); - crate::DeepMerge::merge_from(&mut self.resource_rules, other.resource_rules); - crate::DeepMerge::merge_from(&mut self.subjects, other.subjects); + crate::merge_strategies::list::atomic(&mut self.non_resource_rules, other.non_resource_rules); + crate::merge_strategies::list::atomic(&mut self.resource_rules, other.resource_rules); + crate::merge_strategies::list::atomic(&mut self.subjects, other.subjects); } } diff --git a/src/v1_25/api/flowcontrol/v1beta2/priority_level_configuration_status.rs b/src/v1_25/api/flowcontrol/v1beta2/priority_level_configuration_status.rs index 3a1f5c9216..6b7d140c4b 100644 --- a/src/v1_25/api/flowcontrol/v1beta2/priority_level_configuration_status.rs +++ b/src/v1_25/api/flowcontrol/v1beta2/priority_level_configuration_status.rs @@ -9,7 +9,14 @@ pub struct PriorityLevelConfigurationStatus { impl crate::DeepMerge for PriorityLevelConfigurationStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_25/api/flowcontrol/v1beta2/resource_policy_rule.rs b/src/v1_25/api/flowcontrol/v1beta2/resource_policy_rule.rs index f4db7b13a2..34f9d52c52 100644 --- a/src/v1_25/api/flowcontrol/v1beta2/resource_policy_rule.rs +++ b/src/v1_25/api/flowcontrol/v1beta2/resource_policy_rule.rs @@ -21,11 +21,11 @@ pub struct ResourcePolicyRule { impl crate::DeepMerge for ResourcePolicyRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.api_groups, other.api_groups); + crate::merge_strategies::list::set(&mut self.api_groups, other.api_groups); crate::DeepMerge::merge_from(&mut self.cluster_scope, other.cluster_scope); - crate::DeepMerge::merge_from(&mut self.namespaces, other.namespaces); - crate::DeepMerge::merge_from(&mut self.resources, other.resources); - crate::DeepMerge::merge_from(&mut self.verbs, other.verbs); + crate::merge_strategies::list::set(&mut self.namespaces, other.namespaces); + crate::merge_strategies::list::set(&mut self.resources, other.resources); + crate::merge_strategies::list::set(&mut self.verbs, other.verbs); } } diff --git a/src/v1_25/api/networking/v1/http_ingress_rule_value.rs b/src/v1_25/api/networking/v1/http_ingress_rule_value.rs index acc836c728..3749783ee2 100644 --- a/src/v1_25/api/networking/v1/http_ingress_rule_value.rs +++ b/src/v1_25/api/networking/v1/http_ingress_rule_value.rs @@ -9,7 +9,7 @@ pub struct HTTPIngressRuleValue { impl crate::DeepMerge for HTTPIngressRuleValue { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.paths, other.paths); + crate::merge_strategies::list::atomic(&mut self.paths, other.paths); } } diff --git a/src/v1_25/api/networking/v1/ingress_spec.rs b/src/v1_25/api/networking/v1/ingress_spec.rs index a4020c43b9..454a1a8bc8 100644 --- a/src/v1_25/api/networking/v1/ingress_spec.rs +++ b/src/v1_25/api/networking/v1/ingress_spec.rs @@ -20,8 +20,8 @@ impl crate::DeepMerge for IngressSpec { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.default_backend, other.default_backend); crate::DeepMerge::merge_from(&mut self.ingress_class_name, other.ingress_class_name); - crate::DeepMerge::merge_from(&mut self.rules, other.rules); - crate::DeepMerge::merge_from(&mut self.tls, other.tls); + crate::merge_strategies::list::atomic(&mut self.rules, other.rules); + crate::merge_strategies::list::atomic(&mut self.tls, other.tls); } } diff --git a/src/v1_25/api/networking/v1/ingress_tls.rs b/src/v1_25/api/networking/v1/ingress_tls.rs index d48a83a0c4..92c66b754f 100644 --- a/src/v1_25/api/networking/v1/ingress_tls.rs +++ b/src/v1_25/api/networking/v1/ingress_tls.rs @@ -12,7 +12,7 @@ pub struct IngressTLS { impl crate::DeepMerge for IngressTLS { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.hosts, other.hosts); + crate::merge_strategies::list::atomic(&mut self.hosts, other.hosts); crate::DeepMerge::merge_from(&mut self.secret_name, other.secret_name); } } diff --git a/src/v1_25/api/networking/v1/ip_block.rs b/src/v1_25/api/networking/v1/ip_block.rs index 46458b01c5..08d9d2ab61 100644 --- a/src/v1_25/api/networking/v1/ip_block.rs +++ b/src/v1_25/api/networking/v1/ip_block.rs @@ -13,7 +13,7 @@ pub struct IPBlock { impl crate::DeepMerge for IPBlock { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.cidr, other.cidr); - crate::DeepMerge::merge_from(&mut self.except, other.except); + crate::merge_strategies::list::atomic(&mut self.except, other.except); } } diff --git a/src/v1_25/api/networking/v1/network_policy_egress_rule.rs b/src/v1_25/api/networking/v1/network_policy_egress_rule.rs index 33619be210..28eb6a21b6 100644 --- a/src/v1_25/api/networking/v1/network_policy_egress_rule.rs +++ b/src/v1_25/api/networking/v1/network_policy_egress_rule.rs @@ -12,8 +12,8 @@ pub struct NetworkPolicyEgressRule { impl crate::DeepMerge for NetworkPolicyEgressRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.ports, other.ports); - crate::DeepMerge::merge_from(&mut self.to, other.to); + crate::merge_strategies::list::atomic(&mut self.ports, other.ports); + crate::merge_strategies::list::atomic(&mut self.to, other.to); } } diff --git a/src/v1_25/api/networking/v1/network_policy_ingress_rule.rs b/src/v1_25/api/networking/v1/network_policy_ingress_rule.rs index 2c68ec44a7..517765f800 100644 --- a/src/v1_25/api/networking/v1/network_policy_ingress_rule.rs +++ b/src/v1_25/api/networking/v1/network_policy_ingress_rule.rs @@ -12,8 +12,8 @@ pub struct NetworkPolicyIngressRule { impl crate::DeepMerge for NetworkPolicyIngressRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.from, other.from); - crate::DeepMerge::merge_from(&mut self.ports, other.ports); + crate::merge_strategies::list::atomic(&mut self.from, other.from); + crate::merge_strategies::list::atomic(&mut self.ports, other.ports); } } diff --git a/src/v1_25/api/networking/v1/network_policy_spec.rs b/src/v1_25/api/networking/v1/network_policy_spec.rs index ed61b60968..bc980e7469 100644 --- a/src/v1_25/api/networking/v1/network_policy_spec.rs +++ b/src/v1_25/api/networking/v1/network_policy_spec.rs @@ -18,10 +18,10 @@ pub struct NetworkPolicySpec { impl crate::DeepMerge for NetworkPolicySpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.egress, other.egress); - crate::DeepMerge::merge_from(&mut self.ingress, other.ingress); + crate::merge_strategies::list::atomic(&mut self.egress, other.egress); + crate::merge_strategies::list::atomic(&mut self.ingress, other.ingress); crate::DeepMerge::merge_from(&mut self.pod_selector, other.pod_selector); - crate::DeepMerge::merge_from(&mut self.policy_types, other.policy_types); + crate::merge_strategies::list::atomic(&mut self.policy_types, other.policy_types); } } diff --git a/src/v1_25/api/networking/v1/network_policy_status.rs b/src/v1_25/api/networking/v1/network_policy_status.rs index 379f560ac3..55e4312614 100644 --- a/src/v1_25/api/networking/v1/network_policy_status.rs +++ b/src/v1_25/api/networking/v1/network_policy_status.rs @@ -9,7 +9,14 @@ pub struct NetworkPolicyStatus { impl crate::DeepMerge for NetworkPolicyStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_25/api/node/v1/overhead.rs b/src/v1_25/api/node/v1/overhead.rs index ef68cae1c1..2db70b80c4 100644 --- a/src/v1_25/api/node/v1/overhead.rs +++ b/src/v1_25/api/node/v1/overhead.rs @@ -9,7 +9,9 @@ pub struct Overhead { impl crate::DeepMerge for Overhead { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.pod_fixed, other.pod_fixed); + crate::merge_strategies::map::granular(&mut self.pod_fixed, other.pod_fixed, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); } } diff --git a/src/v1_25/api/node/v1/scheduling.rs b/src/v1_25/api/node/v1/scheduling.rs index 1c2b8a05c5..79508f62c2 100644 --- a/src/v1_25/api/node/v1/scheduling.rs +++ b/src/v1_25/api/node/v1/scheduling.rs @@ -12,8 +12,8 @@ pub struct Scheduling { impl crate::DeepMerge for Scheduling { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.node_selector, other.node_selector); - crate::DeepMerge::merge_from(&mut self.tolerations, other.tolerations); + crate::merge_strategies::map::atomic(&mut self.node_selector, other.node_selector); + crate::merge_strategies::list::atomic(&mut self.tolerations, other.tolerations); } } diff --git a/src/v1_25/api/policy/v1/pod_disruption_budget_status.rs b/src/v1_25/api/policy/v1/pod_disruption_budget_status.rs index f4aa41a86e..cf8b02d00f 100644 --- a/src/v1_25/api/policy/v1/pod_disruption_budget_status.rs +++ b/src/v1_25/api/policy/v1/pod_disruption_budget_status.rs @@ -35,10 +35,19 @@ pub struct PodDisruptionBudgetStatus { impl crate::DeepMerge for PodDisruptionBudgetStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.current_healthy, other.current_healthy); crate::DeepMerge::merge_from(&mut self.desired_healthy, other.desired_healthy); - crate::DeepMerge::merge_from(&mut self.disrupted_pods, other.disrupted_pods); + crate::merge_strategies::map::granular(&mut self.disrupted_pods, other.disrupted_pods, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.disruptions_allowed, other.disruptions_allowed); crate::DeepMerge::merge_from(&mut self.expected_pods, other.expected_pods); crate::DeepMerge::merge_from(&mut self.observed_generation, other.observed_generation); diff --git a/src/v1_25/api/rbac/v1/aggregation_rule.rs b/src/v1_25/api/rbac/v1/aggregation_rule.rs index 5ccc4984f6..b20ce61705 100644 --- a/src/v1_25/api/rbac/v1/aggregation_rule.rs +++ b/src/v1_25/api/rbac/v1/aggregation_rule.rs @@ -9,7 +9,7 @@ pub struct AggregationRule { impl crate::DeepMerge for AggregationRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.cluster_role_selectors, other.cluster_role_selectors); + crate::merge_strategies::list::atomic(&mut self.cluster_role_selectors, other.cluster_role_selectors); } } diff --git a/src/v1_25/api/rbac/v1/cluster_role.rs b/src/v1_25/api/rbac/v1/cluster_role.rs index 8336e14c92..a6f832b593 100644 --- a/src/v1_25/api/rbac/v1/cluster_role.rs +++ b/src/v1_25/api/rbac/v1/cluster_role.rs @@ -378,7 +378,7 @@ impl crate::DeepMerge for ClusterRole { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.aggregation_rule, other.aggregation_rule); crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.rules, other.rules); + crate::merge_strategies::list::atomic(&mut self.rules, other.rules); } } 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..04fa2bd714 100644 --- a/src/v1_25/api/rbac/v1/cluster_role_binding.rs +++ b/src/v1_25/api/rbac/v1/cluster_role_binding.rs @@ -378,7 +378,7 @@ impl crate::DeepMerge for ClusterRoleBinding { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); crate::DeepMerge::merge_from(&mut self.role_ref, other.role_ref); - crate::DeepMerge::merge_from(&mut self.subjects, other.subjects); + crate::merge_strategies::list::atomic(&mut self.subjects, other.subjects); } } diff --git a/src/v1_25/api/rbac/v1/policy_rule.rs b/src/v1_25/api/rbac/v1/policy_rule.rs index 486e987c66..3102e5bc6b 100644 --- a/src/v1_25/api/rbac/v1/policy_rule.rs +++ b/src/v1_25/api/rbac/v1/policy_rule.rs @@ -21,11 +21,11 @@ pub struct PolicyRule { impl crate::DeepMerge for PolicyRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.api_groups, other.api_groups); - crate::DeepMerge::merge_from(&mut self.non_resource_urls, other.non_resource_urls); - crate::DeepMerge::merge_from(&mut self.resource_names, other.resource_names); - crate::DeepMerge::merge_from(&mut self.resources, other.resources); - crate::DeepMerge::merge_from(&mut self.verbs, other.verbs); + crate::merge_strategies::list::atomic(&mut self.api_groups, other.api_groups); + crate::merge_strategies::list::atomic(&mut self.non_resource_urls, other.non_resource_urls); + crate::merge_strategies::list::atomic(&mut self.resource_names, other.resource_names); + crate::merge_strategies::list::atomic(&mut self.resources, other.resources); + crate::merge_strategies::list::atomic(&mut self.verbs, other.verbs); } } diff --git a/src/v1_25/api/rbac/v1/role.rs b/src/v1_25/api/rbac/v1/role.rs index 9764bc7aa0..719ecb92b0 100644 --- a/src/v1_25/api/rbac/v1/role.rs +++ b/src/v1_25/api/rbac/v1/role.rs @@ -490,7 +490,7 @@ impl crate::Metadata for Role { impl crate::DeepMerge for Role { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.rules, other.rules); + crate::merge_strategies::list::atomic(&mut self.rules, other.rules); } } diff --git a/src/v1_25/api/rbac/v1/role_binding.rs b/src/v1_25/api/rbac/v1/role_binding.rs index ac11e857c2..7b9059076a 100644 --- a/src/v1_25/api/rbac/v1/role_binding.rs +++ b/src/v1_25/api/rbac/v1/role_binding.rs @@ -494,7 +494,7 @@ impl crate::DeepMerge for RoleBinding { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); crate::DeepMerge::merge_from(&mut self.role_ref, other.role_ref); - crate::DeepMerge::merge_from(&mut self.subjects, other.subjects); + crate::merge_strategies::list::atomic(&mut self.subjects, other.subjects); } } diff --git a/src/v1_25/api/storage/v1/csi_driver_spec.rs b/src/v1_25/api/storage/v1/csi_driver_spec.rs index e3b4955632..43d03e43de 100644 --- a/src/v1_25/api/storage/v1/csi_driver_spec.rs +++ b/src/v1_25/api/storage/v1/csi_driver_spec.rs @@ -71,8 +71,8 @@ impl crate::DeepMerge for CSIDriverSpec { crate::DeepMerge::merge_from(&mut self.requires_republish, other.requires_republish); crate::DeepMerge::merge_from(&mut self.se_linux_mount, other.se_linux_mount); crate::DeepMerge::merge_from(&mut self.storage_capacity, other.storage_capacity); - crate::DeepMerge::merge_from(&mut self.token_requests, other.token_requests); - crate::DeepMerge::merge_from(&mut self.volume_lifecycle_modes, other.volume_lifecycle_modes); + crate::merge_strategies::list::atomic(&mut self.token_requests, other.token_requests); + crate::merge_strategies::list::set(&mut self.volume_lifecycle_modes, other.volume_lifecycle_modes); } } diff --git a/src/v1_25/api/storage/v1/csi_node_driver.rs b/src/v1_25/api/storage/v1/csi_node_driver.rs index c113299390..d8b79d89f3 100644 --- a/src/v1_25/api/storage/v1/csi_node_driver.rs +++ b/src/v1_25/api/storage/v1/csi_node_driver.rs @@ -21,7 +21,7 @@ impl crate::DeepMerge for CSINodeDriver { crate::DeepMerge::merge_from(&mut self.allocatable, other.allocatable); crate::DeepMerge::merge_from(&mut self.name, other.name); crate::DeepMerge::merge_from(&mut self.node_id, other.node_id); - crate::DeepMerge::merge_from(&mut self.topology_keys, other.topology_keys); + crate::merge_strategies::list::atomic(&mut self.topology_keys, other.topology_keys); } } diff --git a/src/v1_25/api/storage/v1/csi_node_spec.rs b/src/v1_25/api/storage/v1/csi_node_spec.rs index ea2a1ddb97..4717576df8 100644 --- a/src/v1_25/api/storage/v1/csi_node_spec.rs +++ b/src/v1_25/api/storage/v1/csi_node_spec.rs @@ -9,7 +9,14 @@ pub struct CSINodeSpec { impl crate::DeepMerge for CSINodeSpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.drivers, other.drivers); + crate::merge_strategies::list::map( + &mut self.drivers, + other.drivers, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_25/api/storage/v1/storage_class.rs b/src/v1_25/api/storage/v1/storage_class.rs index 2bf8e65456..12774ba320 100644 --- a/src/v1_25/api/storage/v1/storage_class.rs +++ b/src/v1_25/api/storage/v1/storage_class.rs @@ -394,10 +394,12 @@ impl crate::Metadata for StorageClass { impl crate::DeepMerge for StorageClass { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.allow_volume_expansion, other.allow_volume_expansion); - crate::DeepMerge::merge_from(&mut self.allowed_topologies, other.allowed_topologies); + crate::merge_strategies::list::atomic(&mut self.allowed_topologies, other.allowed_topologies); crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.mount_options, other.mount_options); - crate::DeepMerge::merge_from(&mut self.parameters, other.parameters); + crate::merge_strategies::list::atomic(&mut self.mount_options, other.mount_options); + crate::merge_strategies::map::granular(&mut self.parameters, other.parameters, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.provisioner, other.provisioner); crate::DeepMerge::merge_from(&mut self.reclaim_policy, other.reclaim_policy); crate::DeepMerge::merge_from(&mut self.volume_binding_mode, other.volume_binding_mode); diff --git a/src/v1_25/api/storage/v1/volume_attachment_status.rs b/src/v1_25/api/storage/v1/volume_attachment_status.rs index fb8e63d745..bb6ba3fe42 100644 --- a/src/v1_25/api/storage/v1/volume_attachment_status.rs +++ b/src/v1_25/api/storage/v1/volume_attachment_status.rs @@ -20,7 +20,9 @@ impl crate::DeepMerge for VolumeAttachmentStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.attach_error, other.attach_error); crate::DeepMerge::merge_from(&mut self.attached, other.attached); - crate::DeepMerge::merge_from(&mut self.attachment_metadata, other.attachment_metadata); + crate::merge_strategies::map::granular(&mut self.attachment_metadata, other.attachment_metadata, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.detach_error, other.detach_error); } } diff --git a/src/v1_25/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_names.rs b/src/v1_25/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_names.rs index f3a8d38696..d105542807 100644 --- a/src/v1_25/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_names.rs +++ b/src/v1_25/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_names.rs @@ -24,11 +24,11 @@ pub struct CustomResourceDefinitionNames { impl crate::DeepMerge for CustomResourceDefinitionNames { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.categories, other.categories); + crate::merge_strategies::list::atomic(&mut self.categories, other.categories); crate::DeepMerge::merge_from(&mut self.kind, other.kind); crate::DeepMerge::merge_from(&mut self.list_kind, other.list_kind); crate::DeepMerge::merge_from(&mut self.plural, other.plural); - crate::DeepMerge::merge_from(&mut self.short_names, other.short_names); + crate::merge_strategies::list::atomic(&mut self.short_names, other.short_names); crate::DeepMerge::merge_from(&mut self.singular, other.singular); } } diff --git a/src/v1_25/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_spec.rs b/src/v1_25/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_spec.rs index 40ffea9ed1..e3a881e9a4 100644 --- a/src/v1_25/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_spec.rs +++ b/src/v1_25/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_spec.rs @@ -29,7 +29,7 @@ impl crate::DeepMerge for CustomResourceDefinitionSpec { crate::DeepMerge::merge_from(&mut self.names, other.names); crate::DeepMerge::merge_from(&mut self.preserve_unknown_fields, other.preserve_unknown_fields); crate::DeepMerge::merge_from(&mut self.scope, other.scope); - crate::DeepMerge::merge_from(&mut self.versions, other.versions); + crate::merge_strategies::list::atomic(&mut self.versions, other.versions); } } diff --git a/src/v1_25/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_status.rs b/src/v1_25/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_status.rs index a7427347aa..d080a301dc 100644 --- a/src/v1_25/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_status.rs +++ b/src/v1_25/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_status.rs @@ -16,8 +16,15 @@ pub struct CustomResourceDefinitionStatus { impl crate::DeepMerge for CustomResourceDefinitionStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.accepted_names, other.accepted_names); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); - crate::DeepMerge::merge_from(&mut self.stored_versions, other.stored_versions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::list::atomic(&mut self.stored_versions, other.stored_versions); } } diff --git a/src/v1_25/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_version.rs b/src/v1_25/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_version.rs index 5b4d51a697..90a9bb5e32 100644 --- a/src/v1_25/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_version.rs +++ b/src/v1_25/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_version.rs @@ -30,7 +30,7 @@ pub struct CustomResourceDefinitionVersion { impl crate::DeepMerge for CustomResourceDefinitionVersion { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.additional_printer_columns, other.additional_printer_columns); + crate::merge_strategies::list::atomic(&mut self.additional_printer_columns, other.additional_printer_columns); crate::DeepMerge::merge_from(&mut self.deprecated, other.deprecated); crate::DeepMerge::merge_from(&mut self.deprecation_warning, other.deprecation_warning); crate::DeepMerge::merge_from(&mut self.name, other.name); diff --git a/src/v1_25/apiextensions_apiserver/pkg/apis/apiextensions/v1/json_schema_props.rs b/src/v1_25/apiextensions_apiserver/pkg/apis/apiextensions/v1/json_schema_props.rs index 3c8b45d0b0..a871ebe8a6 100644 --- a/src/v1_25/apiextensions_apiserver/pkg/apis/apiextensions/v1/json_schema_props.rs +++ b/src/v1_25/apiextensions_apiserver/pkg/apis/apiextensions/v1/json_schema_props.rs @@ -142,13 +142,17 @@ impl crate::DeepMerge for JSONSchemaProps { crate::DeepMerge::merge_from(&mut self.schema, other.schema); crate::DeepMerge::merge_from(&mut self.additional_items, other.additional_items); crate::DeepMerge::merge_from(&mut self.additional_properties, other.additional_properties); - crate::DeepMerge::merge_from(&mut self.all_of, other.all_of); - crate::DeepMerge::merge_from(&mut self.any_of, other.any_of); + crate::merge_strategies::list::atomic(&mut self.all_of, other.all_of); + crate::merge_strategies::list::atomic(&mut self.any_of, other.any_of); crate::DeepMerge::merge_from(&mut self.default, other.default); - crate::DeepMerge::merge_from(&mut self.definitions, other.definitions); - crate::DeepMerge::merge_from(&mut self.dependencies, other.dependencies); + crate::merge_strategies::map::granular(&mut self.definitions, other.definitions, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.dependencies, other.dependencies, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.description, other.description); - crate::DeepMerge::merge_from(&mut self.enum_, other.enum_); + crate::merge_strategies::list::atomic(&mut self.enum_, other.enum_); crate::DeepMerge::merge_from(&mut self.example, other.example); crate::DeepMerge::merge_from(&mut self.exclusive_maximum, other.exclusive_maximum); crate::DeepMerge::merge_from(&mut self.exclusive_minimum, other.exclusive_minimum); @@ -167,21 +171,32 @@ impl crate::DeepMerge for JSONSchemaProps { crate::DeepMerge::merge_from(&mut self.multiple_of, other.multiple_of); crate::DeepMerge::merge_from(&mut self.not, other.not); crate::DeepMerge::merge_from(&mut self.nullable, other.nullable); - crate::DeepMerge::merge_from(&mut self.one_of, other.one_of); + crate::merge_strategies::list::atomic(&mut self.one_of, other.one_of); crate::DeepMerge::merge_from(&mut self.pattern, other.pattern); - crate::DeepMerge::merge_from(&mut self.pattern_properties, other.pattern_properties); - crate::DeepMerge::merge_from(&mut self.properties, other.properties); - crate::DeepMerge::merge_from(&mut self.required, other.required); + crate::merge_strategies::map::granular(&mut self.pattern_properties, other.pattern_properties, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.properties, other.properties, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::list::atomic(&mut self.required, other.required); crate::DeepMerge::merge_from(&mut self.title, other.title); crate::DeepMerge::merge_from(&mut self.type_, other.type_); crate::DeepMerge::merge_from(&mut self.unique_items, other.unique_items); crate::DeepMerge::merge_from(&mut self.x_kubernetes_embedded_resource, other.x_kubernetes_embedded_resource); crate::DeepMerge::merge_from(&mut self.x_kubernetes_int_or_string, other.x_kubernetes_int_or_string); - crate::DeepMerge::merge_from(&mut self.x_kubernetes_list_map_keys, other.x_kubernetes_list_map_keys); + crate::merge_strategies::list::atomic(&mut self.x_kubernetes_list_map_keys, other.x_kubernetes_list_map_keys); crate::DeepMerge::merge_from(&mut self.x_kubernetes_list_type, other.x_kubernetes_list_type); crate::DeepMerge::merge_from(&mut self.x_kubernetes_map_type, other.x_kubernetes_map_type); crate::DeepMerge::merge_from(&mut self.x_kubernetes_preserve_unknown_fields, other.x_kubernetes_preserve_unknown_fields); - crate::DeepMerge::merge_from(&mut self.x_kubernetes_validations, other.x_kubernetes_validations); + crate::merge_strategies::list::map( + &mut self.x_kubernetes_validations, + other.x_kubernetes_validations, + &[|lhs, rhs| lhs.rule == rhs.rule], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_25/apiextensions_apiserver/pkg/apis/apiextensions/v1/webhook_conversion.rs b/src/v1_25/apiextensions_apiserver/pkg/apis/apiextensions/v1/webhook_conversion.rs index aec75dfd39..69008b2dca 100644 --- a/src/v1_25/apiextensions_apiserver/pkg/apis/apiextensions/v1/webhook_conversion.rs +++ b/src/v1_25/apiextensions_apiserver/pkg/apis/apiextensions/v1/webhook_conversion.rs @@ -13,7 +13,7 @@ pub struct WebhookConversion { impl crate::DeepMerge for WebhookConversion { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.client_config, other.client_config); - crate::DeepMerge::merge_from(&mut self.conversion_review_versions, other.conversion_review_versions); + crate::merge_strategies::list::atomic(&mut self.conversion_review_versions, other.conversion_review_versions); } } diff --git a/src/v1_25/apimachinery/pkg/apis/meta/v1/api_group.rs b/src/v1_25/apimachinery/pkg/apis/meta/v1/api_group.rs index 3d36440e87..f83318ab08 100644 --- a/src/v1_25/apimachinery/pkg/apis/meta/v1/api_group.rs +++ b/src/v1_25/apimachinery/pkg/apis/meta/v1/api_group.rs @@ -29,8 +29,8 @@ impl crate::DeepMerge for APIGroup { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.name, other.name); crate::DeepMerge::merge_from(&mut self.preferred_version, other.preferred_version); - crate::DeepMerge::merge_from(&mut self.server_address_by_client_cidrs, other.server_address_by_client_cidrs); - crate::DeepMerge::merge_from(&mut self.versions, other.versions); + crate::merge_strategies::list::atomic(&mut self.server_address_by_client_cidrs, other.server_address_by_client_cidrs); + crate::merge_strategies::list::atomic(&mut self.versions, other.versions); } } diff --git a/src/v1_25/apimachinery/pkg/apis/meta/v1/api_group_list.rs b/src/v1_25/apimachinery/pkg/apis/meta/v1/api_group_list.rs index 167aeeabe0..e8a5d7e747 100644 --- a/src/v1_25/apimachinery/pkg/apis/meta/v1/api_group_list.rs +++ b/src/v1_25/apimachinery/pkg/apis/meta/v1/api_group_list.rs @@ -18,7 +18,7 @@ impl crate::Resource for APIGroupList { impl crate::DeepMerge for APIGroupList { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.groups, other.groups); + crate::merge_strategies::list::atomic(&mut self.groups, other.groups); } } diff --git a/src/v1_25/apimachinery/pkg/apis/meta/v1/api_resource.rs b/src/v1_25/apimachinery/pkg/apis/meta/v1/api_resource.rs index e679e8aa73..477c5ad98d 100644 --- a/src/v1_25/apimachinery/pkg/apis/meta/v1/api_resource.rs +++ b/src/v1_25/apimachinery/pkg/apis/meta/v1/api_resource.rs @@ -36,15 +36,15 @@ pub struct APIResource { impl crate::DeepMerge for APIResource { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.categories, other.categories); + crate::merge_strategies::list::atomic(&mut self.categories, other.categories); crate::DeepMerge::merge_from(&mut self.group, other.group); crate::DeepMerge::merge_from(&mut self.kind, other.kind); crate::DeepMerge::merge_from(&mut self.name, other.name); crate::DeepMerge::merge_from(&mut self.namespaced, other.namespaced); - crate::DeepMerge::merge_from(&mut self.short_names, other.short_names); + crate::merge_strategies::list::atomic(&mut self.short_names, other.short_names); crate::DeepMerge::merge_from(&mut self.singular_name, other.singular_name); crate::DeepMerge::merge_from(&mut self.storage_version_hash, other.storage_version_hash); - crate::DeepMerge::merge_from(&mut self.verbs, other.verbs); + crate::merge_strategies::list::atomic(&mut self.verbs, other.verbs); crate::DeepMerge::merge_from(&mut self.version, other.version); } } diff --git a/src/v1_25/apimachinery/pkg/apis/meta/v1/api_resource_list.rs b/src/v1_25/apimachinery/pkg/apis/meta/v1/api_resource_list.rs index a34ba733a3..4107b4f488 100644 --- a/src/v1_25/apimachinery/pkg/apis/meta/v1/api_resource_list.rs +++ b/src/v1_25/apimachinery/pkg/apis/meta/v1/api_resource_list.rs @@ -22,7 +22,7 @@ impl crate::Resource for APIResourceList { impl crate::DeepMerge for APIResourceList { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.group_version, other.group_version); - crate::DeepMerge::merge_from(&mut self.resources, other.resources); + crate::merge_strategies::list::atomic(&mut self.resources, other.resources); } } diff --git a/src/v1_25/apimachinery/pkg/apis/meta/v1/api_versions.rs b/src/v1_25/apimachinery/pkg/apis/meta/v1/api_versions.rs index a2d355ee8d..eda4a89785 100644 --- a/src/v1_25/apimachinery/pkg/apis/meta/v1/api_versions.rs +++ b/src/v1_25/apimachinery/pkg/apis/meta/v1/api_versions.rs @@ -21,8 +21,8 @@ impl crate::Resource for APIVersions { impl crate::DeepMerge for APIVersions { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.server_address_by_client_cidrs, other.server_address_by_client_cidrs); - crate::DeepMerge::merge_from(&mut self.versions, other.versions); + crate::merge_strategies::list::atomic(&mut self.server_address_by_client_cidrs, other.server_address_by_client_cidrs); + crate::merge_strategies::list::atomic(&mut self.versions, other.versions); } } diff --git a/src/v1_25/apimachinery/pkg/apis/meta/v1/delete_options.rs b/src/v1_25/apimachinery/pkg/apis/meta/v1/delete_options.rs index 04abc8215b..4ac6d24fb9 100644 --- a/src/v1_25/apimachinery/pkg/apis/meta/v1/delete_options.rs +++ b/src/v1_25/apimachinery/pkg/apis/meta/v1/delete_options.rs @@ -28,7 +28,7 @@ pub struct DeleteOptions { impl crate::DeepMerge for DeleteOptions { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.api_version, other.api_version); - crate::DeepMerge::merge_from(&mut self.dry_run, other.dry_run); + crate::merge_strategies::list::atomic(&mut self.dry_run, other.dry_run); crate::DeepMerge::merge_from(&mut self.grace_period_seconds, other.grace_period_seconds); crate::DeepMerge::merge_from(&mut self.kind, other.kind); crate::DeepMerge::merge_from(&mut self.orphan_dependents, other.orphan_dependents); diff --git a/src/v1_25/apimachinery/pkg/apis/meta/v1/label_selector.rs b/src/v1_25/apimachinery/pkg/apis/meta/v1/label_selector.rs index 877caad4dd..19028abb99 100644 --- a/src/v1_25/apimachinery/pkg/apis/meta/v1/label_selector.rs +++ b/src/v1_25/apimachinery/pkg/apis/meta/v1/label_selector.rs @@ -12,8 +12,10 @@ pub struct LabelSelector { impl crate::DeepMerge for LabelSelector { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.match_expressions, other.match_expressions); - crate::DeepMerge::merge_from(&mut self.match_labels, other.match_labels); + crate::merge_strategies::list::atomic(&mut self.match_expressions, other.match_expressions); + crate::merge_strategies::map::granular(&mut self.match_labels, other.match_labels, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); } } diff --git a/src/v1_25/apimachinery/pkg/apis/meta/v1/label_selector_requirement.rs b/src/v1_25/apimachinery/pkg/apis/meta/v1/label_selector_requirement.rs index 6570daea42..09c7dc7cc7 100644 --- a/src/v1_25/apimachinery/pkg/apis/meta/v1/label_selector_requirement.rs +++ b/src/v1_25/apimachinery/pkg/apis/meta/v1/label_selector_requirement.rs @@ -17,7 +17,7 @@ impl crate::DeepMerge for LabelSelectorRequirement { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.key, other.key); crate::DeepMerge::merge_from(&mut self.operator, other.operator); - crate::DeepMerge::merge_from(&mut self.values, other.values); + crate::merge_strategies::list::atomic(&mut self.values, other.values); } } 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..9f7788cb2e 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 @@ -65,18 +65,29 @@ pub struct ObjectMeta { impl crate::DeepMerge for ObjectMeta { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.annotations, other.annotations); + crate::merge_strategies::map::granular(&mut self.annotations, other.annotations, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); 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::merge_strategies::list::set(&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::merge_strategies::map::granular(&mut self.labels, other.labels, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::list::atomic(&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::merge_strategies::list::map( + &mut self.owner_references, + other.owner_references, + &[|lhs, rhs| lhs.uid == rhs.uid], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); 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); diff --git a/src/v1_25/apimachinery/pkg/apis/meta/v1/status_details.rs b/src/v1_25/apimachinery/pkg/apis/meta/v1/status_details.rs index 183b525d2c..28141f7f6f 100644 --- a/src/v1_25/apimachinery/pkg/apis/meta/v1/status_details.rs +++ b/src/v1_25/apimachinery/pkg/apis/meta/v1/status_details.rs @@ -24,7 +24,7 @@ pub struct StatusDetails { impl crate::DeepMerge for StatusDetails { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.causes, other.causes); + crate::merge_strategies::list::atomic(&mut self.causes, other.causes); crate::DeepMerge::merge_from(&mut self.group, other.group); crate::DeepMerge::merge_from(&mut self.kind, other.kind); crate::DeepMerge::merge_from(&mut self.name, other.name); diff --git a/src/v1_25/kube_aggregator/pkg/apis/apiregistration/v1/api_service_status.rs b/src/v1_25/kube_aggregator/pkg/apis/apiregistration/v1/api_service_status.rs index 658b6ca9ce..72a107b6ba 100644 --- a/src/v1_25/kube_aggregator/pkg/apis/apiregistration/v1/api_service_status.rs +++ b/src/v1_25/kube_aggregator/pkg/apis/apiregistration/v1/api_service_status.rs @@ -9,7 +9,14 @@ pub struct APIServiceStatus { impl crate::DeepMerge for APIServiceStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_25/list.rs b/src/v1_25/list.rs index cc10bf672f..9863ef1855 100644 --- a/src/v1_25/list.rs +++ b/src/v1_25/list.rs @@ -31,9 +31,16 @@ impl crate::Metadata for List where T: crate::ListableResource { } } -impl crate::DeepMerge for List where T: crate::ListableResource { +impl crate::DeepMerge for List where T: crate::DeepMerge + crate::Metadata + crate::ListableResource { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.items, other.items); + crate::merge_strategies::list::map( + &mut self.items, + other.items, + &[|lhs, rhs| lhs.metadata().namespace == rhs.metadata().namespace, |lhs, rhs| lhs.metadata().name == rhs.metadata().name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); } } diff --git a/src/v1_26/api/admissionregistration/v1/mutating_webhook.rs b/src/v1_26/api/admissionregistration/v1/mutating_webhook.rs index 5b1a4d833f..783200c537 100644 --- a/src/v1_26/api/admissionregistration/v1/mutating_webhook.rs +++ b/src/v1_26/api/admissionregistration/v1/mutating_webhook.rs @@ -81,7 +81,7 @@ pub struct MutatingWebhook { impl crate::DeepMerge for MutatingWebhook { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.admission_review_versions, other.admission_review_versions); + crate::merge_strategies::list::atomic(&mut self.admission_review_versions, other.admission_review_versions); crate::DeepMerge::merge_from(&mut self.client_config, other.client_config); crate::DeepMerge::merge_from(&mut self.failure_policy, other.failure_policy); crate::DeepMerge::merge_from(&mut self.match_policy, other.match_policy); @@ -89,7 +89,7 @@ impl crate::DeepMerge for MutatingWebhook { crate::DeepMerge::merge_from(&mut self.namespace_selector, other.namespace_selector); crate::DeepMerge::merge_from(&mut self.object_selector, other.object_selector); crate::DeepMerge::merge_from(&mut self.reinvocation_policy, other.reinvocation_policy); - crate::DeepMerge::merge_from(&mut self.rules, other.rules); + crate::merge_strategies::list::atomic(&mut self.rules, other.rules); crate::DeepMerge::merge_from(&mut self.side_effects, other.side_effects); crate::DeepMerge::merge_from(&mut self.timeout_seconds, other.timeout_seconds); } 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..156c7ccfcf 100644 --- a/src/v1_26/api/admissionregistration/v1/mutating_webhook_configuration.rs +++ b/src/v1_26/api/admissionregistration/v1/mutating_webhook_configuration.rs @@ -374,7 +374,14 @@ impl crate::Metadata for MutatingWebhookConfiguration { impl crate::DeepMerge for MutatingWebhookConfiguration { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.webhooks, other.webhooks); + crate::merge_strategies::list::map( + &mut self.webhooks, + other.webhooks, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_26/api/admissionregistration/v1/rule_with_operations.rs b/src/v1_26/api/admissionregistration/v1/rule_with_operations.rs index c45c425c57..441b9ab3fd 100644 --- a/src/v1_26/api/admissionregistration/v1/rule_with_operations.rs +++ b/src/v1_26/api/admissionregistration/v1/rule_with_operations.rs @@ -27,10 +27,10 @@ pub struct RuleWithOperations { impl crate::DeepMerge for RuleWithOperations { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.api_groups, other.api_groups); - crate::DeepMerge::merge_from(&mut self.api_versions, other.api_versions); - crate::DeepMerge::merge_from(&mut self.operations, other.operations); - crate::DeepMerge::merge_from(&mut self.resources, other.resources); + crate::merge_strategies::list::atomic(&mut self.api_groups, other.api_groups); + crate::merge_strategies::list::atomic(&mut self.api_versions, other.api_versions); + crate::merge_strategies::list::atomic(&mut self.operations, other.operations); + crate::merge_strategies::list::atomic(&mut self.resources, other.resources); crate::DeepMerge::merge_from(&mut self.scope, other.scope); } } diff --git a/src/v1_26/api/admissionregistration/v1/validating_webhook.rs b/src/v1_26/api/admissionregistration/v1/validating_webhook.rs index 1a64d4e885..e594176265 100644 --- a/src/v1_26/api/admissionregistration/v1/validating_webhook.rs +++ b/src/v1_26/api/admissionregistration/v1/validating_webhook.rs @@ -72,14 +72,14 @@ pub struct ValidatingWebhook { impl crate::DeepMerge for ValidatingWebhook { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.admission_review_versions, other.admission_review_versions); + crate::merge_strategies::list::atomic(&mut self.admission_review_versions, other.admission_review_versions); crate::DeepMerge::merge_from(&mut self.client_config, other.client_config); crate::DeepMerge::merge_from(&mut self.failure_policy, other.failure_policy); crate::DeepMerge::merge_from(&mut self.match_policy, other.match_policy); crate::DeepMerge::merge_from(&mut self.name, other.name); crate::DeepMerge::merge_from(&mut self.namespace_selector, other.namespace_selector); crate::DeepMerge::merge_from(&mut self.object_selector, other.object_selector); - crate::DeepMerge::merge_from(&mut self.rules, other.rules); + crate::merge_strategies::list::atomic(&mut self.rules, other.rules); crate::DeepMerge::merge_from(&mut self.side_effects, other.side_effects); crate::DeepMerge::merge_from(&mut self.timeout_seconds, other.timeout_seconds); } 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..ff20990424 100644 --- a/src/v1_26/api/admissionregistration/v1/validating_webhook_configuration.rs +++ b/src/v1_26/api/admissionregistration/v1/validating_webhook_configuration.rs @@ -374,7 +374,14 @@ impl crate::Metadata for ValidatingWebhookConfiguration { impl crate::DeepMerge for ValidatingWebhookConfiguration { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.webhooks, other.webhooks); + crate::merge_strategies::list::map( + &mut self.webhooks, + other.webhooks, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_26/api/admissionregistration/v1alpha1/match_resources.rs b/src/v1_26/api/admissionregistration/v1alpha1/match_resources.rs index 59971bf7a2..7080d3ca48 100644 --- a/src/v1_26/api/admissionregistration/v1alpha1/match_resources.rs +++ b/src/v1_26/api/admissionregistration/v1alpha1/match_resources.rs @@ -57,11 +57,11 @@ pub struct MatchResources { impl crate::DeepMerge for MatchResources { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.exclude_resource_rules, other.exclude_resource_rules); + crate::merge_strategies::list::atomic(&mut self.exclude_resource_rules, other.exclude_resource_rules); crate::DeepMerge::merge_from(&mut self.match_policy, other.match_policy); crate::DeepMerge::merge_from(&mut self.namespace_selector, other.namespace_selector); crate::DeepMerge::merge_from(&mut self.object_selector, other.object_selector); - crate::DeepMerge::merge_from(&mut self.resource_rules, other.resource_rules); + crate::merge_strategies::list::atomic(&mut self.resource_rules, other.resource_rules); } } diff --git a/src/v1_26/api/admissionregistration/v1alpha1/named_rule_with_operations.rs b/src/v1_26/api/admissionregistration/v1alpha1/named_rule_with_operations.rs index 3d59cbf4c7..9c1ff2b2ad 100644 --- a/src/v1_26/api/admissionregistration/v1alpha1/named_rule_with_operations.rs +++ b/src/v1_26/api/admissionregistration/v1alpha1/named_rule_with_operations.rs @@ -30,11 +30,11 @@ pub struct NamedRuleWithOperations { impl crate::DeepMerge for NamedRuleWithOperations { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.api_groups, other.api_groups); - crate::DeepMerge::merge_from(&mut self.api_versions, other.api_versions); - crate::DeepMerge::merge_from(&mut self.operations, other.operations); - crate::DeepMerge::merge_from(&mut self.resource_names, other.resource_names); - crate::DeepMerge::merge_from(&mut self.resources, other.resources); + crate::merge_strategies::list::atomic(&mut self.api_groups, other.api_groups); + crate::merge_strategies::list::atomic(&mut self.api_versions, other.api_versions); + crate::merge_strategies::list::atomic(&mut self.operations, other.operations); + crate::merge_strategies::list::atomic(&mut self.resource_names, other.resource_names); + crate::merge_strategies::list::atomic(&mut self.resources, other.resources); crate::DeepMerge::merge_from(&mut self.scope, other.scope); } } diff --git a/src/v1_26/api/admissionregistration/v1alpha1/validating_admission_policy_spec.rs b/src/v1_26/api/admissionregistration/v1alpha1/validating_admission_policy_spec.rs index a1ef016fe6..874b059bc3 100644 --- a/src/v1_26/api/admissionregistration/v1alpha1/validating_admission_policy_spec.rs +++ b/src/v1_26/api/admissionregistration/v1alpha1/validating_admission_policy_spec.rs @@ -21,7 +21,7 @@ impl crate::DeepMerge for ValidatingAdmissionPolicySpec { crate::DeepMerge::merge_from(&mut self.failure_policy, other.failure_policy); crate::DeepMerge::merge_from(&mut self.match_constraints, other.match_constraints); crate::DeepMerge::merge_from(&mut self.param_kind, other.param_kind); - crate::DeepMerge::merge_from(&mut self.validations, other.validations); + crate::merge_strategies::list::atomic(&mut self.validations, other.validations); } } diff --git a/src/v1_26/api/apiserverinternal/v1alpha1/server_storage_version.rs b/src/v1_26/api/apiserverinternal/v1alpha1/server_storage_version.rs index 1040b5e6d7..5a693d9e59 100644 --- a/src/v1_26/api/apiserverinternal/v1alpha1/server_storage_version.rs +++ b/src/v1_26/api/apiserverinternal/v1alpha1/server_storage_version.rs @@ -16,7 +16,7 @@ pub struct ServerStorageVersion { impl crate::DeepMerge for ServerStorageVersion { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.api_server_id, other.api_server_id); - crate::DeepMerge::merge_from(&mut self.decodable_versions, other.decodable_versions); + crate::merge_strategies::list::set(&mut self.decodable_versions, other.decodable_versions); crate::DeepMerge::merge_from(&mut self.encoding_version, other.encoding_version); } } diff --git a/src/v1_26/api/apiserverinternal/v1alpha1/storage_version_status.rs b/src/v1_26/api/apiserverinternal/v1alpha1/storage_version_status.rs index e63b469644..0d5b9bd3a1 100644 --- a/src/v1_26/api/apiserverinternal/v1alpha1/storage_version_status.rs +++ b/src/v1_26/api/apiserverinternal/v1alpha1/storage_version_status.rs @@ -16,8 +16,22 @@ pub struct StorageVersionStatus { impl crate::DeepMerge for StorageVersionStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.common_encoding_version, other.common_encoding_version); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); - crate::DeepMerge::merge_from(&mut self.storage_versions, other.storage_versions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::list::map( + &mut self.storage_versions, + other.storage_versions, + &[|lhs, rhs| lhs.api_server_id == rhs.api_server_id], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_26/api/apps/v1/daemon_set_status.rs b/src/v1_26/api/apps/v1/daemon_set_status.rs index 278caf879c..345f5eb651 100644 --- a/src/v1_26/api/apps/v1/daemon_set_status.rs +++ b/src/v1_26/api/apps/v1/daemon_set_status.rs @@ -37,7 +37,14 @@ pub struct DaemonSetStatus { impl crate::DeepMerge for DaemonSetStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.collision_count, other.collision_count); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.current_number_scheduled, other.current_number_scheduled); crate::DeepMerge::merge_from(&mut self.desired_number_scheduled, other.desired_number_scheduled); crate::DeepMerge::merge_from(&mut self.number_available, other.number_available); diff --git a/src/v1_26/api/apps/v1/deployment_status.rs b/src/v1_26/api/apps/v1/deployment_status.rs index 01ff5c75e4..ee140e108a 100644 --- a/src/v1_26/api/apps/v1/deployment_status.rs +++ b/src/v1_26/api/apps/v1/deployment_status.rs @@ -32,7 +32,14 @@ impl crate::DeepMerge for DeploymentStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.available_replicas, other.available_replicas); crate::DeepMerge::merge_from(&mut self.collision_count, other.collision_count); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.observed_generation, other.observed_generation); crate::DeepMerge::merge_from(&mut self.ready_replicas, other.ready_replicas); crate::DeepMerge::merge_from(&mut self.replicas, other.replicas); diff --git a/src/v1_26/api/apps/v1/replica_set_status.rs b/src/v1_26/api/apps/v1/replica_set_status.rs index 39b735fe4d..f247536f7b 100644 --- a/src/v1_26/api/apps/v1/replica_set_status.rs +++ b/src/v1_26/api/apps/v1/replica_set_status.rs @@ -25,7 +25,14 @@ pub struct ReplicaSetStatus { impl crate::DeepMerge for ReplicaSetStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.available_replicas, other.available_replicas); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.fully_labeled_replicas, other.fully_labeled_replicas); crate::DeepMerge::merge_from(&mut self.observed_generation, other.observed_generation); crate::DeepMerge::merge_from(&mut self.ready_replicas, other.ready_replicas); diff --git a/src/v1_26/api/apps/v1/stateful_set_spec.rs b/src/v1_26/api/apps/v1/stateful_set_spec.rs index 37d13970c5..3ccdc3d709 100644 --- a/src/v1_26/api/apps/v1/stateful_set_spec.rs +++ b/src/v1_26/api/apps/v1/stateful_set_spec.rs @@ -50,7 +50,7 @@ impl crate::DeepMerge for StatefulSetSpec { crate::DeepMerge::merge_from(&mut self.service_name, other.service_name); crate::DeepMerge::merge_from(&mut self.template, other.template); crate::DeepMerge::merge_from(&mut self.update_strategy, other.update_strategy); - crate::DeepMerge::merge_from(&mut self.volume_claim_templates, other.volume_claim_templates); + crate::merge_strategies::list::atomic(&mut self.volume_claim_templates, other.volume_claim_templates); } } diff --git a/src/v1_26/api/apps/v1/stateful_set_status.rs b/src/v1_26/api/apps/v1/stateful_set_status.rs index 74b5517785..5791ca87a2 100644 --- a/src/v1_26/api/apps/v1/stateful_set_status.rs +++ b/src/v1_26/api/apps/v1/stateful_set_status.rs @@ -38,7 +38,14 @@ impl crate::DeepMerge for StatefulSetStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.available_replicas, other.available_replicas); crate::DeepMerge::merge_from(&mut self.collision_count, other.collision_count); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.current_replicas, other.current_replicas); crate::DeepMerge::merge_from(&mut self.current_revision, other.current_revision); crate::DeepMerge::merge_from(&mut self.observed_generation, other.observed_generation); diff --git a/src/v1_26/api/authentication/v1/token_request_spec.rs b/src/v1_26/api/authentication/v1/token_request_spec.rs index 6d4399ce6c..6f784dff5d 100644 --- a/src/v1_26/api/authentication/v1/token_request_spec.rs +++ b/src/v1_26/api/authentication/v1/token_request_spec.rs @@ -15,7 +15,7 @@ pub struct TokenRequestSpec { impl crate::DeepMerge for TokenRequestSpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.audiences, other.audiences); + crate::merge_strategies::list::atomic(&mut self.audiences, other.audiences); crate::DeepMerge::merge_from(&mut self.bound_object_ref, other.bound_object_ref); crate::DeepMerge::merge_from(&mut self.expiration_seconds, other.expiration_seconds); } diff --git a/src/v1_26/api/authentication/v1/token_review_spec.rs b/src/v1_26/api/authentication/v1/token_review_spec.rs index fd84653924..281127b67d 100644 --- a/src/v1_26/api/authentication/v1/token_review_spec.rs +++ b/src/v1_26/api/authentication/v1/token_review_spec.rs @@ -12,7 +12,7 @@ pub struct TokenReviewSpec { impl crate::DeepMerge for TokenReviewSpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.audiences, other.audiences); + crate::merge_strategies::list::atomic(&mut self.audiences, other.audiences); crate::DeepMerge::merge_from(&mut self.token, other.token); } } diff --git a/src/v1_26/api/authentication/v1/token_review_status.rs b/src/v1_26/api/authentication/v1/token_review_status.rs index 464164bcf9..4dd5aacc3d 100644 --- a/src/v1_26/api/authentication/v1/token_review_status.rs +++ b/src/v1_26/api/authentication/v1/token_review_status.rs @@ -18,7 +18,7 @@ pub struct TokenReviewStatus { impl crate::DeepMerge for TokenReviewStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.audiences, other.audiences); + crate::merge_strategies::list::atomic(&mut self.audiences, other.audiences); crate::DeepMerge::merge_from(&mut self.authenticated, other.authenticated); crate::DeepMerge::merge_from(&mut self.error, other.error); crate::DeepMerge::merge_from(&mut self.user, other.user); diff --git a/src/v1_26/api/authentication/v1/user_info.rs b/src/v1_26/api/authentication/v1/user_info.rs index d6890119b7..3890788cda 100644 --- a/src/v1_26/api/authentication/v1/user_info.rs +++ b/src/v1_26/api/authentication/v1/user_info.rs @@ -18,8 +18,10 @@ pub struct UserInfo { impl crate::DeepMerge for UserInfo { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.extra, other.extra); - crate::DeepMerge::merge_from(&mut self.groups, other.groups); + crate::merge_strategies::map::granular(&mut self.extra, other.extra, |current_item, other_item| { + crate::merge_strategies::list::atomic(current_item, other_item); + }); + crate::merge_strategies::list::atomic(&mut self.groups, other.groups); crate::DeepMerge::merge_from(&mut self.uid, other.uid); crate::DeepMerge::merge_from(&mut self.username, other.username); } diff --git a/src/v1_26/api/authorization/v1/non_resource_rule.rs b/src/v1_26/api/authorization/v1/non_resource_rule.rs index 7df269ffd7..db780454b8 100644 --- a/src/v1_26/api/authorization/v1/non_resource_rule.rs +++ b/src/v1_26/api/authorization/v1/non_resource_rule.rs @@ -12,8 +12,8 @@ pub struct NonResourceRule { impl crate::DeepMerge for NonResourceRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.non_resource_urls, other.non_resource_urls); - crate::DeepMerge::merge_from(&mut self.verbs, other.verbs); + crate::merge_strategies::list::atomic(&mut self.non_resource_urls, other.non_resource_urls); + crate::merge_strategies::list::atomic(&mut self.verbs, other.verbs); } } diff --git a/src/v1_26/api/authorization/v1/resource_rule.rs b/src/v1_26/api/authorization/v1/resource_rule.rs index 58b5e020a8..1af9333654 100644 --- a/src/v1_26/api/authorization/v1/resource_rule.rs +++ b/src/v1_26/api/authorization/v1/resource_rule.rs @@ -19,10 +19,10 @@ pub struct ResourceRule { impl crate::DeepMerge for ResourceRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.api_groups, other.api_groups); - crate::DeepMerge::merge_from(&mut self.resource_names, other.resource_names); - crate::DeepMerge::merge_from(&mut self.resources, other.resources); - crate::DeepMerge::merge_from(&mut self.verbs, other.verbs); + crate::merge_strategies::list::atomic(&mut self.api_groups, other.api_groups); + crate::merge_strategies::list::atomic(&mut self.resource_names, other.resource_names); + crate::merge_strategies::list::atomic(&mut self.resources, other.resources); + crate::merge_strategies::list::atomic(&mut self.verbs, other.verbs); } } diff --git a/src/v1_26/api/authorization/v1/subject_access_review_spec.rs b/src/v1_26/api/authorization/v1/subject_access_review_spec.rs index ae8fadafd9..a4c4af18ce 100644 --- a/src/v1_26/api/authorization/v1/subject_access_review_spec.rs +++ b/src/v1_26/api/authorization/v1/subject_access_review_spec.rs @@ -24,8 +24,10 @@ pub struct SubjectAccessReviewSpec { impl crate::DeepMerge for SubjectAccessReviewSpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.extra, other.extra); - crate::DeepMerge::merge_from(&mut self.groups, other.groups); + crate::merge_strategies::map::granular(&mut self.extra, other.extra, |current_item, other_item| { + crate::merge_strategies::list::atomic(current_item, other_item); + }); + crate::merge_strategies::list::atomic(&mut self.groups, other.groups); crate::DeepMerge::merge_from(&mut self.non_resource_attributes, other.non_resource_attributes); crate::DeepMerge::merge_from(&mut self.resource_attributes, other.resource_attributes); crate::DeepMerge::merge_from(&mut self.uid, other.uid); diff --git a/src/v1_26/api/authorization/v1/subject_rules_review_status.rs b/src/v1_26/api/authorization/v1/subject_rules_review_status.rs index 9d7fb042cf..9d1682a3c8 100644 --- a/src/v1_26/api/authorization/v1/subject_rules_review_status.rs +++ b/src/v1_26/api/authorization/v1/subject_rules_review_status.rs @@ -20,8 +20,8 @@ impl crate::DeepMerge for SubjectRulesReviewStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.evaluation_error, other.evaluation_error); crate::DeepMerge::merge_from(&mut self.incomplete, other.incomplete); - crate::DeepMerge::merge_from(&mut self.non_resource_rules, other.non_resource_rules); - crate::DeepMerge::merge_from(&mut self.resource_rules, other.resource_rules); + crate::merge_strategies::list::atomic(&mut self.non_resource_rules, other.non_resource_rules); + crate::merge_strategies::list::atomic(&mut self.resource_rules, other.resource_rules); } } diff --git a/src/v1_26/api/autoscaling/v2/horizontal_pod_autoscaler_spec.rs b/src/v1_26/api/autoscaling/v2/horizontal_pod_autoscaler_spec.rs index 90ea12126f..1aaf3eb861 100644 --- a/src/v1_26/api/autoscaling/v2/horizontal_pod_autoscaler_spec.rs +++ b/src/v1_26/api/autoscaling/v2/horizontal_pod_autoscaler_spec.rs @@ -23,7 +23,7 @@ impl crate::DeepMerge for HorizontalPodAutoscalerSpec { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.behavior, other.behavior); crate::DeepMerge::merge_from(&mut self.max_replicas, other.max_replicas); - crate::DeepMerge::merge_from(&mut self.metrics, other.metrics); + crate::merge_strategies::list::atomic(&mut self.metrics, other.metrics); crate::DeepMerge::merge_from(&mut self.min_replicas, other.min_replicas); crate::DeepMerge::merge_from(&mut self.scale_target_ref, other.scale_target_ref); } diff --git a/src/v1_26/api/autoscaling/v2/horizontal_pod_autoscaler_status.rs b/src/v1_26/api/autoscaling/v2/horizontal_pod_autoscaler_status.rs index bfb877a856..c4b24efd7f 100644 --- a/src/v1_26/api/autoscaling/v2/horizontal_pod_autoscaler_status.rs +++ b/src/v1_26/api/autoscaling/v2/horizontal_pod_autoscaler_status.rs @@ -24,8 +24,15 @@ pub struct HorizontalPodAutoscalerStatus { impl crate::DeepMerge for HorizontalPodAutoscalerStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); - crate::DeepMerge::merge_from(&mut self.current_metrics, other.current_metrics); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::list::atomic(&mut self.current_metrics, other.current_metrics); crate::DeepMerge::merge_from(&mut self.current_replicas, other.current_replicas); crate::DeepMerge::merge_from(&mut self.desired_replicas, other.desired_replicas); crate::DeepMerge::merge_from(&mut self.last_scale_time, other.last_scale_time); diff --git a/src/v1_26/api/autoscaling/v2/hpa_scaling_rules.rs b/src/v1_26/api/autoscaling/v2/hpa_scaling_rules.rs index 0b0dc2c81d..195201e286 100644 --- a/src/v1_26/api/autoscaling/v2/hpa_scaling_rules.rs +++ b/src/v1_26/api/autoscaling/v2/hpa_scaling_rules.rs @@ -15,7 +15,7 @@ pub struct HPAScalingRules { impl crate::DeepMerge for HPAScalingRules { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.policies, other.policies); + crate::merge_strategies::list::atomic(&mut self.policies, other.policies); crate::DeepMerge::merge_from(&mut self.select_policy, other.select_policy); crate::DeepMerge::merge_from(&mut self.stabilization_window_seconds, other.stabilization_window_seconds); } diff --git a/src/v1_26/api/batch/v1/cron_job_status.rs b/src/v1_26/api/batch/v1/cron_job_status.rs index cbd83e8fcd..c0f24458eb 100644 --- a/src/v1_26/api/batch/v1/cron_job_status.rs +++ b/src/v1_26/api/batch/v1/cron_job_status.rs @@ -15,7 +15,7 @@ pub struct CronJobStatus { impl crate::DeepMerge for CronJobStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.active, other.active); + crate::merge_strategies::list::atomic(&mut self.active, other.active); crate::DeepMerge::merge_from(&mut self.last_schedule_time, other.last_schedule_time); crate::DeepMerge::merge_from(&mut self.last_successful_time, other.last_successful_time); } diff --git a/src/v1_26/api/batch/v1/job_status.rs b/src/v1_26/api/batch/v1/job_status.rs index bf039e882a..80a4cdf7e8 100644 --- a/src/v1_26/api/batch/v1/job_status.rs +++ b/src/v1_26/api/batch/v1/job_status.rs @@ -43,7 +43,14 @@ impl crate::DeepMerge for JobStatus { crate::DeepMerge::merge_from(&mut self.active, other.active); crate::DeepMerge::merge_from(&mut self.completed_indexes, other.completed_indexes); crate::DeepMerge::merge_from(&mut self.completion_time, other.completion_time); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.failed, other.failed); crate::DeepMerge::merge_from(&mut self.ready, other.ready); crate::DeepMerge::merge_from(&mut self.start_time, other.start_time); diff --git a/src/v1_26/api/batch/v1/pod_failure_policy.rs b/src/v1_26/api/batch/v1/pod_failure_policy.rs index 5edb569fbe..976e6077e1 100644 --- a/src/v1_26/api/batch/v1/pod_failure_policy.rs +++ b/src/v1_26/api/batch/v1/pod_failure_policy.rs @@ -9,7 +9,7 @@ pub struct PodFailurePolicy { impl crate::DeepMerge for PodFailurePolicy { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.rules, other.rules); + crate::merge_strategies::list::atomic(&mut self.rules, other.rules); } } diff --git a/src/v1_26/api/batch/v1/pod_failure_policy_on_exit_codes_requirement.rs b/src/v1_26/api/batch/v1/pod_failure_policy_on_exit_codes_requirement.rs index 7c66651da8..ccb4c878f9 100644 --- a/src/v1_26/api/batch/v1/pod_failure_policy_on_exit_codes_requirement.rs +++ b/src/v1_26/api/batch/v1/pod_failure_policy_on_exit_codes_requirement.rs @@ -24,7 +24,7 @@ impl crate::DeepMerge for PodFailurePolicyOnExitCodesRequirement { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.container_name, other.container_name); crate::DeepMerge::merge_from(&mut self.operator, other.operator); - crate::DeepMerge::merge_from(&mut self.values, other.values); + crate::merge_strategies::list::set(&mut self.values, other.values); } } diff --git a/src/v1_26/api/batch/v1/pod_failure_policy_rule.rs b/src/v1_26/api/batch/v1/pod_failure_policy_rule.rs index 3898f424d4..3bbcfce6be 100644 --- a/src/v1_26/api/batch/v1/pod_failure_policy_rule.rs +++ b/src/v1_26/api/batch/v1/pod_failure_policy_rule.rs @@ -24,7 +24,7 @@ impl crate::DeepMerge for PodFailurePolicyRule { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.action, other.action); crate::DeepMerge::merge_from(&mut self.on_exit_codes, other.on_exit_codes); - crate::DeepMerge::merge_from(&mut self.on_pod_conditions, other.on_pod_conditions); + crate::merge_strategies::list::atomic(&mut self.on_pod_conditions, other.on_pod_conditions); } } diff --git a/src/v1_26/api/batch/v1/uncounted_terminated_pods.rs b/src/v1_26/api/batch/v1/uncounted_terminated_pods.rs index 8235855121..45335381cf 100644 --- a/src/v1_26/api/batch/v1/uncounted_terminated_pods.rs +++ b/src/v1_26/api/batch/v1/uncounted_terminated_pods.rs @@ -12,8 +12,8 @@ pub struct UncountedTerminatedPods { impl crate::DeepMerge for UncountedTerminatedPods { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.failed, other.failed); - crate::DeepMerge::merge_from(&mut self.succeeded, other.succeeded); + crate::merge_strategies::list::set(&mut self.failed, other.failed); + crate::merge_strategies::list::set(&mut self.succeeded, other.succeeded); } } diff --git a/src/v1_26/api/certificates/v1/certificate_signing_request_spec.rs b/src/v1_26/api/certificates/v1/certificate_signing_request_spec.rs index 549452fb32..36248828fd 100644 --- a/src/v1_26/api/certificates/v1/certificate_signing_request_spec.rs +++ b/src/v1_26/api/certificates/v1/certificate_signing_request_spec.rs @@ -75,12 +75,14 @@ pub struct CertificateSigningRequestSpec { impl crate::DeepMerge for CertificateSigningRequestSpec { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.expiration_seconds, other.expiration_seconds); - crate::DeepMerge::merge_from(&mut self.extra, other.extra); - crate::DeepMerge::merge_from(&mut self.groups, other.groups); + crate::merge_strategies::map::granular(&mut self.extra, other.extra, |current_item, other_item| { + crate::merge_strategies::list::atomic(current_item, other_item); + }); + crate::merge_strategies::list::atomic(&mut self.groups, other.groups); crate::DeepMerge::merge_from(&mut self.request, other.request); crate::DeepMerge::merge_from(&mut self.signer_name, other.signer_name); crate::DeepMerge::merge_from(&mut self.uid, other.uid); - crate::DeepMerge::merge_from(&mut self.usages, other.usages); + crate::merge_strategies::list::atomic(&mut self.usages, other.usages); crate::DeepMerge::merge_from(&mut self.username, other.username); } } diff --git a/src/v1_26/api/certificates/v1/certificate_signing_request_status.rs b/src/v1_26/api/certificates/v1/certificate_signing_request_status.rs index 81fb876580..d17c51933f 100644 --- a/src/v1_26/api/certificates/v1/certificate_signing_request_status.rs +++ b/src/v1_26/api/certificates/v1/certificate_signing_request_status.rs @@ -34,7 +34,14 @@ pub struct CertificateSigningRequestStatus { impl crate::DeepMerge for CertificateSigningRequestStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.certificate, other.certificate); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_26/api/core/v1/capabilities.rs b/src/v1_26/api/core/v1/capabilities.rs index 6045e4f5d2..1a260b5256 100644 --- a/src/v1_26/api/core/v1/capabilities.rs +++ b/src/v1_26/api/core/v1/capabilities.rs @@ -12,8 +12,8 @@ pub struct Capabilities { impl crate::DeepMerge for Capabilities { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.add, other.add); - crate::DeepMerge::merge_from(&mut self.drop, other.drop); + crate::merge_strategies::list::atomic(&mut self.add, other.add); + crate::merge_strategies::list::atomic(&mut self.drop, other.drop); } } diff --git a/src/v1_26/api/core/v1/ceph_fs_persistent_volume_source.rs b/src/v1_26/api/core/v1/ceph_fs_persistent_volume_source.rs index 13104d3d90..33c556a6ce 100644 --- a/src/v1_26/api/core/v1/ceph_fs_persistent_volume_source.rs +++ b/src/v1_26/api/core/v1/ceph_fs_persistent_volume_source.rs @@ -24,7 +24,7 @@ pub struct CephFSPersistentVolumeSource { impl crate::DeepMerge for CephFSPersistentVolumeSource { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.monitors, other.monitors); + crate::merge_strategies::list::atomic(&mut self.monitors, other.monitors); crate::DeepMerge::merge_from(&mut self.path, other.path); crate::DeepMerge::merge_from(&mut self.read_only, other.read_only); crate::DeepMerge::merge_from(&mut self.secret_file, other.secret_file); diff --git a/src/v1_26/api/core/v1/ceph_fs_volume_source.rs b/src/v1_26/api/core/v1/ceph_fs_volume_source.rs index bb24b08edb..91f358e3aa 100644 --- a/src/v1_26/api/core/v1/ceph_fs_volume_source.rs +++ b/src/v1_26/api/core/v1/ceph_fs_volume_source.rs @@ -24,7 +24,7 @@ pub struct CephFSVolumeSource { impl crate::DeepMerge for CephFSVolumeSource { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.monitors, other.monitors); + crate::merge_strategies::list::atomic(&mut self.monitors, other.monitors); crate::DeepMerge::merge_from(&mut self.path, other.path); crate::DeepMerge::merge_from(&mut self.read_only, other.read_only); crate::DeepMerge::merge_from(&mut self.secret_file, other.secret_file); diff --git a/src/v1_26/api/core/v1/component_status.rs b/src/v1_26/api/core/v1/component_status.rs index ecddf82170..50e55665e4 100644 --- a/src/v1_26/api/core/v1/component_status.rs +++ b/src/v1_26/api/core/v1/component_status.rs @@ -172,7 +172,14 @@ impl crate::Metadata for ComponentStatus { impl crate::DeepMerge for ComponentStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); } } diff --git a/src/v1_26/api/core/v1/config_map.rs b/src/v1_26/api/core/v1/config_map.rs index 361b45a3a1..7d07e59a99 100644 --- a/src/v1_26/api/core/v1/config_map.rs +++ b/src/v1_26/api/core/v1/config_map.rs @@ -495,8 +495,12 @@ impl crate::Metadata for ConfigMap { impl crate::DeepMerge for ConfigMap { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.binary_data, other.binary_data); - crate::DeepMerge::merge_from(&mut self.data, other.data); + crate::merge_strategies::map::granular(&mut self.binary_data, other.binary_data, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.data, other.data, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.immutable, other.immutable); crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); } diff --git a/src/v1_26/api/core/v1/config_map_projection.rs b/src/v1_26/api/core/v1/config_map_projection.rs index 673d1527ac..ea9187a2f3 100644 --- a/src/v1_26/api/core/v1/config_map_projection.rs +++ b/src/v1_26/api/core/v1/config_map_projection.rs @@ -17,7 +17,7 @@ pub struct ConfigMapProjection { impl crate::DeepMerge for ConfigMapProjection { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.items, other.items); + crate::merge_strategies::list::atomic(&mut self.items, other.items); crate::DeepMerge::merge_from(&mut self.name, other.name); crate::DeepMerge::merge_from(&mut self.optional, other.optional); } diff --git a/src/v1_26/api/core/v1/config_map_volume_source.rs b/src/v1_26/api/core/v1/config_map_volume_source.rs index d34a1a17da..7d5b55b8ee 100644 --- a/src/v1_26/api/core/v1/config_map_volume_source.rs +++ b/src/v1_26/api/core/v1/config_map_volume_source.rs @@ -21,7 +21,7 @@ pub struct ConfigMapVolumeSource { impl crate::DeepMerge for ConfigMapVolumeSource { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.default_mode, other.default_mode); - crate::DeepMerge::merge_from(&mut self.items, other.items); + crate::merge_strategies::list::atomic(&mut self.items, other.items); crate::DeepMerge::merge_from(&mut self.name, other.name); crate::DeepMerge::merge_from(&mut self.optional, other.optional); } diff --git a/src/v1_26/api/core/v1/container.rs b/src/v1_26/api/core/v1/container.rs index e7ec05fb49..aafaa8dd46 100644 --- a/src/v1_26/api/core/v1/container.rs +++ b/src/v1_26/api/core/v1/container.rs @@ -74,16 +74,30 @@ pub struct Container { impl crate::DeepMerge for Container { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.args, other.args); - crate::DeepMerge::merge_from(&mut self.command, other.command); - crate::DeepMerge::merge_from(&mut self.env, other.env); - crate::DeepMerge::merge_from(&mut self.env_from, other.env_from); + crate::merge_strategies::list::atomic(&mut self.args, other.args); + crate::merge_strategies::list::atomic(&mut self.command, other.command); + crate::merge_strategies::list::map( + &mut self.env, + other.env, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::list::atomic(&mut self.env_from, other.env_from); crate::DeepMerge::merge_from(&mut self.image, other.image); crate::DeepMerge::merge_from(&mut self.image_pull_policy, other.image_pull_policy); crate::DeepMerge::merge_from(&mut self.lifecycle, other.lifecycle); crate::DeepMerge::merge_from(&mut self.liveness_probe, other.liveness_probe); crate::DeepMerge::merge_from(&mut self.name, other.name); - crate::DeepMerge::merge_from(&mut self.ports, other.ports); + crate::merge_strategies::list::map( + &mut self.ports, + other.ports, + &[|lhs, rhs| lhs.container_port == rhs.container_port], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.readiness_probe, other.readiness_probe); crate::DeepMerge::merge_from(&mut self.resources, other.resources); crate::DeepMerge::merge_from(&mut self.security_context, other.security_context); @@ -93,8 +107,22 @@ impl crate::DeepMerge for Container { crate::DeepMerge::merge_from(&mut self.termination_message_path, other.termination_message_path); crate::DeepMerge::merge_from(&mut self.termination_message_policy, other.termination_message_policy); crate::DeepMerge::merge_from(&mut self.tty, other.tty); - crate::DeepMerge::merge_from(&mut self.volume_devices, other.volume_devices); - crate::DeepMerge::merge_from(&mut self.volume_mounts, other.volume_mounts); + crate::merge_strategies::list::map( + &mut self.volume_devices, + other.volume_devices, + &[|lhs, rhs| lhs.device_path == rhs.device_path], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::list::map( + &mut self.volume_mounts, + other.volume_mounts, + &[|lhs, rhs| lhs.mount_path == rhs.mount_path], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.working_dir, other.working_dir); } } diff --git a/src/v1_26/api/core/v1/container_image.rs b/src/v1_26/api/core/v1/container_image.rs index a708155b7c..5c7c179ed8 100644 --- a/src/v1_26/api/core/v1/container_image.rs +++ b/src/v1_26/api/core/v1/container_image.rs @@ -12,7 +12,7 @@ pub struct ContainerImage { impl crate::DeepMerge for ContainerImage { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.names, other.names); + crate::merge_strategies::list::atomic(&mut self.names, other.names); crate::DeepMerge::merge_from(&mut self.size_bytes, other.size_bytes); } } diff --git a/src/v1_26/api/core/v1/csi_persistent_volume_source.rs b/src/v1_26/api/core/v1/csi_persistent_volume_source.rs index 27b531ff56..24ab9ebf03 100644 --- a/src/v1_26/api/core/v1/csi_persistent_volume_source.rs +++ b/src/v1_26/api/core/v1/csi_persistent_volume_source.rs @@ -44,7 +44,9 @@ impl crate::DeepMerge for CSIPersistentVolumeSource { crate::DeepMerge::merge_from(&mut self.node_publish_secret_ref, other.node_publish_secret_ref); crate::DeepMerge::merge_from(&mut self.node_stage_secret_ref, other.node_stage_secret_ref); crate::DeepMerge::merge_from(&mut self.read_only, other.read_only); - crate::DeepMerge::merge_from(&mut self.volume_attributes, other.volume_attributes); + crate::merge_strategies::map::granular(&mut self.volume_attributes, other.volume_attributes, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.volume_handle, other.volume_handle); } } diff --git a/src/v1_26/api/core/v1/csi_volume_source.rs b/src/v1_26/api/core/v1/csi_volume_source.rs index ab72f34cdc..77f1085f6f 100644 --- a/src/v1_26/api/core/v1/csi_volume_source.rs +++ b/src/v1_26/api/core/v1/csi_volume_source.rs @@ -25,7 +25,9 @@ impl crate::DeepMerge for CSIVolumeSource { crate::DeepMerge::merge_from(&mut self.fs_type, other.fs_type); crate::DeepMerge::merge_from(&mut self.node_publish_secret_ref, other.node_publish_secret_ref); crate::DeepMerge::merge_from(&mut self.read_only, other.read_only); - crate::DeepMerge::merge_from(&mut self.volume_attributes, other.volume_attributes); + crate::merge_strategies::map::granular(&mut self.volume_attributes, other.volume_attributes, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); } } diff --git a/src/v1_26/api/core/v1/downward_api_projection.rs b/src/v1_26/api/core/v1/downward_api_projection.rs index de0fca6185..950e2e5645 100644 --- a/src/v1_26/api/core/v1/downward_api_projection.rs +++ b/src/v1_26/api/core/v1/downward_api_projection.rs @@ -9,7 +9,7 @@ pub struct DownwardAPIProjection { impl crate::DeepMerge for DownwardAPIProjection { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.items, other.items); + crate::merge_strategies::list::atomic(&mut self.items, other.items); } } diff --git a/src/v1_26/api/core/v1/downward_api_volume_source.rs b/src/v1_26/api/core/v1/downward_api_volume_source.rs index 214c15f03f..96b4ebb987 100644 --- a/src/v1_26/api/core/v1/downward_api_volume_source.rs +++ b/src/v1_26/api/core/v1/downward_api_volume_source.rs @@ -13,7 +13,7 @@ pub struct DownwardAPIVolumeSource { impl crate::DeepMerge for DownwardAPIVolumeSource { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.default_mode, other.default_mode); - crate::DeepMerge::merge_from(&mut self.items, other.items); + crate::merge_strategies::list::atomic(&mut self.items, other.items); } } diff --git a/src/v1_26/api/core/v1/endpoint_subset.rs b/src/v1_26/api/core/v1/endpoint_subset.rs index 45a0853432..9400deda56 100644 --- a/src/v1_26/api/core/v1/endpoint_subset.rs +++ b/src/v1_26/api/core/v1/endpoint_subset.rs @@ -25,9 +25,9 @@ pub struct EndpointSubset { impl crate::DeepMerge for EndpointSubset { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.addresses, other.addresses); - crate::DeepMerge::merge_from(&mut self.not_ready_addresses, other.not_ready_addresses); - crate::DeepMerge::merge_from(&mut self.ports, other.ports); + crate::merge_strategies::list::atomic(&mut self.addresses, other.addresses); + crate::merge_strategies::list::atomic(&mut self.not_ready_addresses, other.not_ready_addresses); + crate::merge_strategies::list::atomic(&mut self.ports, other.ports); } } diff --git a/src/v1_26/api/core/v1/endpoints.rs b/src/v1_26/api/core/v1/endpoints.rs index ed9beaf356..74d95ffd83 100644 --- a/src/v1_26/api/core/v1/endpoints.rs +++ b/src/v1_26/api/core/v1/endpoints.rs @@ -502,7 +502,7 @@ impl crate::Metadata for Endpoints { impl crate::DeepMerge for Endpoints { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.subsets, other.subsets); + crate::merge_strategies::list::atomic(&mut self.subsets, other.subsets); } } diff --git a/src/v1_26/api/core/v1/ephemeral_container.rs b/src/v1_26/api/core/v1/ephemeral_container.rs index 985935d50f..616e1b8918 100644 --- a/src/v1_26/api/core/v1/ephemeral_container.rs +++ b/src/v1_26/api/core/v1/ephemeral_container.rs @@ -81,16 +81,30 @@ pub struct EphemeralContainer { impl crate::DeepMerge for EphemeralContainer { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.args, other.args); - crate::DeepMerge::merge_from(&mut self.command, other.command); - crate::DeepMerge::merge_from(&mut self.env, other.env); - crate::DeepMerge::merge_from(&mut self.env_from, other.env_from); + crate::merge_strategies::list::atomic(&mut self.args, other.args); + crate::merge_strategies::list::atomic(&mut self.command, other.command); + crate::merge_strategies::list::map( + &mut self.env, + other.env, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::list::atomic(&mut self.env_from, other.env_from); crate::DeepMerge::merge_from(&mut self.image, other.image); crate::DeepMerge::merge_from(&mut self.image_pull_policy, other.image_pull_policy); crate::DeepMerge::merge_from(&mut self.lifecycle, other.lifecycle); crate::DeepMerge::merge_from(&mut self.liveness_probe, other.liveness_probe); crate::DeepMerge::merge_from(&mut self.name, other.name); - crate::DeepMerge::merge_from(&mut self.ports, other.ports); + crate::merge_strategies::list::map( + &mut self.ports, + other.ports, + &[|lhs, rhs| lhs.container_port == rhs.container_port], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.readiness_probe, other.readiness_probe); crate::DeepMerge::merge_from(&mut self.resources, other.resources); crate::DeepMerge::merge_from(&mut self.security_context, other.security_context); @@ -101,8 +115,22 @@ impl crate::DeepMerge for EphemeralContainer { crate::DeepMerge::merge_from(&mut self.termination_message_path, other.termination_message_path); crate::DeepMerge::merge_from(&mut self.termination_message_policy, other.termination_message_policy); crate::DeepMerge::merge_from(&mut self.tty, other.tty); - crate::DeepMerge::merge_from(&mut self.volume_devices, other.volume_devices); - crate::DeepMerge::merge_from(&mut self.volume_mounts, other.volume_mounts); + crate::merge_strategies::list::map( + &mut self.volume_devices, + other.volume_devices, + &[|lhs, rhs| lhs.device_path == rhs.device_path], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::list::map( + &mut self.volume_mounts, + other.volume_mounts, + &[|lhs, rhs| lhs.mount_path == rhs.mount_path], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.working_dir, other.working_dir); } } diff --git a/src/v1_26/api/core/v1/exec_action.rs b/src/v1_26/api/core/v1/exec_action.rs index fc5ddd099a..07e888786c 100644 --- a/src/v1_26/api/core/v1/exec_action.rs +++ b/src/v1_26/api/core/v1/exec_action.rs @@ -9,7 +9,7 @@ pub struct ExecAction { impl crate::DeepMerge for ExecAction { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.command, other.command); + crate::merge_strategies::list::atomic(&mut self.command, other.command); } } diff --git a/src/v1_26/api/core/v1/fc_volume_source.rs b/src/v1_26/api/core/v1/fc_volume_source.rs index 16dda61ef3..f379368e18 100644 --- a/src/v1_26/api/core/v1/fc_volume_source.rs +++ b/src/v1_26/api/core/v1/fc_volume_source.rs @@ -24,8 +24,8 @@ impl crate::DeepMerge for FCVolumeSource { crate::DeepMerge::merge_from(&mut self.fs_type, other.fs_type); crate::DeepMerge::merge_from(&mut self.lun, other.lun); crate::DeepMerge::merge_from(&mut self.read_only, other.read_only); - crate::DeepMerge::merge_from(&mut self.target_wwns, other.target_wwns); - crate::DeepMerge::merge_from(&mut self.wwids, other.wwids); + crate::merge_strategies::list::atomic(&mut self.target_wwns, other.target_wwns); + crate::merge_strategies::list::atomic(&mut self.wwids, other.wwids); } } diff --git a/src/v1_26/api/core/v1/flex_persistent_volume_source.rs b/src/v1_26/api/core/v1/flex_persistent_volume_source.rs index 1c73341c0c..a696df849c 100644 --- a/src/v1_26/api/core/v1/flex_persistent_volume_source.rs +++ b/src/v1_26/api/core/v1/flex_persistent_volume_source.rs @@ -23,7 +23,9 @@ impl crate::DeepMerge for FlexPersistentVolumeSource { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.driver, other.driver); crate::DeepMerge::merge_from(&mut self.fs_type, other.fs_type); - crate::DeepMerge::merge_from(&mut self.options, other.options); + crate::merge_strategies::map::granular(&mut self.options, other.options, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.read_only, other.read_only); crate::DeepMerge::merge_from(&mut self.secret_ref, other.secret_ref); } diff --git a/src/v1_26/api/core/v1/flex_volume_source.rs b/src/v1_26/api/core/v1/flex_volume_source.rs index caad40ad2b..8cec763784 100644 --- a/src/v1_26/api/core/v1/flex_volume_source.rs +++ b/src/v1_26/api/core/v1/flex_volume_source.rs @@ -23,7 +23,9 @@ impl crate::DeepMerge for FlexVolumeSource { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.driver, other.driver); crate::DeepMerge::merge_from(&mut self.fs_type, other.fs_type); - crate::DeepMerge::merge_from(&mut self.options, other.options); + crate::merge_strategies::map::granular(&mut self.options, other.options, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.read_only, other.read_only); crate::DeepMerge::merge_from(&mut self.secret_ref, other.secret_ref); } diff --git a/src/v1_26/api/core/v1/host_alias.rs b/src/v1_26/api/core/v1/host_alias.rs index 9320f6d9e1..8ea648c7ad 100644 --- a/src/v1_26/api/core/v1/host_alias.rs +++ b/src/v1_26/api/core/v1/host_alias.rs @@ -12,7 +12,7 @@ pub struct HostAlias { impl crate::DeepMerge for HostAlias { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.hostnames, other.hostnames); + crate::merge_strategies::list::atomic(&mut self.hostnames, other.hostnames); crate::DeepMerge::merge_from(&mut self.ip, other.ip); } } diff --git a/src/v1_26/api/core/v1/http_get_action.rs b/src/v1_26/api/core/v1/http_get_action.rs index cec454faa3..b972a6bd69 100644 --- a/src/v1_26/api/core/v1/http_get_action.rs +++ b/src/v1_26/api/core/v1/http_get_action.rs @@ -23,7 +23,7 @@ pub struct HTTPGetAction { impl crate::DeepMerge for HTTPGetAction { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.host, other.host); - crate::DeepMerge::merge_from(&mut self.http_headers, other.http_headers); + crate::merge_strategies::list::atomic(&mut self.http_headers, other.http_headers); crate::DeepMerge::merge_from(&mut self.path, other.path); crate::DeepMerge::merge_from(&mut self.port, other.port); crate::DeepMerge::merge_from(&mut self.scheme, other.scheme); diff --git a/src/v1_26/api/core/v1/iscsi_persistent_volume_source.rs b/src/v1_26/api/core/v1/iscsi_persistent_volume_source.rs index e7285139af..462487bb86 100644 --- a/src/v1_26/api/core/v1/iscsi_persistent_volume_source.rs +++ b/src/v1_26/api/core/v1/iscsi_persistent_volume_source.rs @@ -46,7 +46,7 @@ impl crate::DeepMerge for ISCSIPersistentVolumeSource { crate::DeepMerge::merge_from(&mut self.iqn, other.iqn); crate::DeepMerge::merge_from(&mut self.iscsi_interface, other.iscsi_interface); crate::DeepMerge::merge_from(&mut self.lun, other.lun); - crate::DeepMerge::merge_from(&mut self.portals, other.portals); + crate::merge_strategies::list::atomic(&mut self.portals, other.portals); crate::DeepMerge::merge_from(&mut self.read_only, other.read_only); crate::DeepMerge::merge_from(&mut self.secret_ref, other.secret_ref); crate::DeepMerge::merge_from(&mut self.target_portal, other.target_portal); diff --git a/src/v1_26/api/core/v1/iscsi_volume_source.rs b/src/v1_26/api/core/v1/iscsi_volume_source.rs index 0990284c06..d9d95c147b 100644 --- a/src/v1_26/api/core/v1/iscsi_volume_source.rs +++ b/src/v1_26/api/core/v1/iscsi_volume_source.rs @@ -46,7 +46,7 @@ impl crate::DeepMerge for ISCSIVolumeSource { crate::DeepMerge::merge_from(&mut self.iqn, other.iqn); crate::DeepMerge::merge_from(&mut self.iscsi_interface, other.iscsi_interface); crate::DeepMerge::merge_from(&mut self.lun, other.lun); - crate::DeepMerge::merge_from(&mut self.portals, other.portals); + crate::merge_strategies::list::atomic(&mut self.portals, other.portals); crate::DeepMerge::merge_from(&mut self.read_only, other.read_only); crate::DeepMerge::merge_from(&mut self.secret_ref, other.secret_ref); crate::DeepMerge::merge_from(&mut self.target_portal, other.target_portal); diff --git a/src/v1_26/api/core/v1/limit_range_item.rs b/src/v1_26/api/core/v1/limit_range_item.rs index 3aada5aaaa..d8431aec87 100644 --- a/src/v1_26/api/core/v1/limit_range_item.rs +++ b/src/v1_26/api/core/v1/limit_range_item.rs @@ -24,11 +24,21 @@ pub struct LimitRangeItem { impl crate::DeepMerge for LimitRangeItem { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.default, other.default); - crate::DeepMerge::merge_from(&mut self.default_request, other.default_request); - crate::DeepMerge::merge_from(&mut self.max, other.max); - crate::DeepMerge::merge_from(&mut self.max_limit_request_ratio, other.max_limit_request_ratio); - crate::DeepMerge::merge_from(&mut self.min, other.min); + crate::merge_strategies::map::granular(&mut self.default, other.default, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.default_request, other.default_request, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.max, other.max, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.max_limit_request_ratio, other.max_limit_request_ratio, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.min, other.min, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.type_, other.type_); } } diff --git a/src/v1_26/api/core/v1/limit_range_spec.rs b/src/v1_26/api/core/v1/limit_range_spec.rs index d3db20e828..14cacbd619 100644 --- a/src/v1_26/api/core/v1/limit_range_spec.rs +++ b/src/v1_26/api/core/v1/limit_range_spec.rs @@ -9,7 +9,7 @@ pub struct LimitRangeSpec { impl crate::DeepMerge for LimitRangeSpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.limits, other.limits); + crate::merge_strategies::list::atomic(&mut self.limits, other.limits); } } diff --git a/src/v1_26/api/core/v1/load_balancer_ingress.rs b/src/v1_26/api/core/v1/load_balancer_ingress.rs index fe804334cf..ffce22ba8b 100644 --- a/src/v1_26/api/core/v1/load_balancer_ingress.rs +++ b/src/v1_26/api/core/v1/load_balancer_ingress.rs @@ -17,7 +17,7 @@ impl crate::DeepMerge for LoadBalancerIngress { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.hostname, other.hostname); crate::DeepMerge::merge_from(&mut self.ip, other.ip); - crate::DeepMerge::merge_from(&mut self.ports, other.ports); + crate::merge_strategies::list::atomic(&mut self.ports, other.ports); } } diff --git a/src/v1_26/api/core/v1/load_balancer_status.rs b/src/v1_26/api/core/v1/load_balancer_status.rs index 46d791f8e1..67379f9e4e 100644 --- a/src/v1_26/api/core/v1/load_balancer_status.rs +++ b/src/v1_26/api/core/v1/load_balancer_status.rs @@ -9,7 +9,7 @@ pub struct LoadBalancerStatus { impl crate::DeepMerge for LoadBalancerStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.ingress, other.ingress); + crate::merge_strategies::list::atomic(&mut self.ingress, other.ingress); } } diff --git a/src/v1_26/api/core/v1/namespace_spec.rs b/src/v1_26/api/core/v1/namespace_spec.rs index 5ae9e5ef2e..cbf697e1e1 100644 --- a/src/v1_26/api/core/v1/namespace_spec.rs +++ b/src/v1_26/api/core/v1/namespace_spec.rs @@ -9,7 +9,7 @@ pub struct NamespaceSpec { impl crate::DeepMerge for NamespaceSpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.finalizers, other.finalizers); + crate::merge_strategies::list::atomic(&mut self.finalizers, other.finalizers); } } diff --git a/src/v1_26/api/core/v1/namespace_status.rs b/src/v1_26/api/core/v1/namespace_status.rs index 7ccfbdac3e..c859779881 100644 --- a/src/v1_26/api/core/v1/namespace_status.rs +++ b/src/v1_26/api/core/v1/namespace_status.rs @@ -13,7 +13,14 @@ pub struct NamespaceStatus { impl crate::DeepMerge for NamespaceStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.phase, other.phase); } } diff --git a/src/v1_26/api/core/v1/node_affinity.rs b/src/v1_26/api/core/v1/node_affinity.rs index 2a70de8703..dfd14357a3 100644 --- a/src/v1_26/api/core/v1/node_affinity.rs +++ b/src/v1_26/api/core/v1/node_affinity.rs @@ -12,7 +12,7 @@ pub struct NodeAffinity { impl crate::DeepMerge for NodeAffinity { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.preferred_during_scheduling_ignored_during_execution, other.preferred_during_scheduling_ignored_during_execution); + crate::merge_strategies::list::atomic(&mut self.preferred_during_scheduling_ignored_during_execution, other.preferred_during_scheduling_ignored_during_execution); crate::DeepMerge::merge_from(&mut self.required_during_scheduling_ignored_during_execution, other.required_during_scheduling_ignored_during_execution); } } diff --git a/src/v1_26/api/core/v1/node_selector.rs b/src/v1_26/api/core/v1/node_selector.rs index 5b146c615e..997fba9ef3 100644 --- a/src/v1_26/api/core/v1/node_selector.rs +++ b/src/v1_26/api/core/v1/node_selector.rs @@ -9,7 +9,7 @@ pub struct NodeSelector { impl crate::DeepMerge for NodeSelector { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.node_selector_terms, other.node_selector_terms); + crate::merge_strategies::list::atomic(&mut self.node_selector_terms, other.node_selector_terms); } } diff --git a/src/v1_26/api/core/v1/node_selector_requirement.rs b/src/v1_26/api/core/v1/node_selector_requirement.rs index 57817f1fab..5a76f55c6f 100644 --- a/src/v1_26/api/core/v1/node_selector_requirement.rs +++ b/src/v1_26/api/core/v1/node_selector_requirement.rs @@ -18,7 +18,7 @@ impl crate::DeepMerge for NodeSelectorRequirement { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.key, other.key); crate::DeepMerge::merge_from(&mut self.operator, other.operator); - crate::DeepMerge::merge_from(&mut self.values, other.values); + crate::merge_strategies::list::atomic(&mut self.values, other.values); } } diff --git a/src/v1_26/api/core/v1/node_selector_term.rs b/src/v1_26/api/core/v1/node_selector_term.rs index b0d28cc176..1237883670 100644 --- a/src/v1_26/api/core/v1/node_selector_term.rs +++ b/src/v1_26/api/core/v1/node_selector_term.rs @@ -12,8 +12,8 @@ pub struct NodeSelectorTerm { impl crate::DeepMerge for NodeSelectorTerm { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.match_expressions, other.match_expressions); - crate::DeepMerge::merge_from(&mut self.match_fields, other.match_fields); + crate::merge_strategies::list::atomic(&mut self.match_expressions, other.match_expressions); + crate::merge_strategies::list::atomic(&mut self.match_fields, other.match_fields); } } diff --git a/src/v1_26/api/core/v1/node_spec.rs b/src/v1_26/api/core/v1/node_spec.rs index c6cb174cc5..5bcb728b2b 100644 --- a/src/v1_26/api/core/v1/node_spec.rs +++ b/src/v1_26/api/core/v1/node_spec.rs @@ -30,9 +30,9 @@ impl crate::DeepMerge for NodeSpec { crate::DeepMerge::merge_from(&mut self.config_source, other.config_source); crate::DeepMerge::merge_from(&mut self.external_id, other.external_id); crate::DeepMerge::merge_from(&mut self.pod_cidr, other.pod_cidr); - crate::DeepMerge::merge_from(&mut self.pod_cidrs, other.pod_cidrs); + crate::merge_strategies::list::set(&mut self.pod_cidrs, other.pod_cidrs); crate::DeepMerge::merge_from(&mut self.provider_id, other.provider_id); - crate::DeepMerge::merge_from(&mut self.taints, other.taints); + crate::merge_strategies::list::atomic(&mut self.taints, other.taints); crate::DeepMerge::merge_from(&mut self.unschedulable, other.unschedulable); } } diff --git a/src/v1_26/api/core/v1/node_status.rs b/src/v1_26/api/core/v1/node_status.rs index ceed904246..8c076f6ea9 100644 --- a/src/v1_26/api/core/v1/node_status.rs +++ b/src/v1_26/api/core/v1/node_status.rs @@ -40,17 +40,35 @@ pub struct NodeStatus { impl crate::DeepMerge for NodeStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.addresses, other.addresses); - crate::DeepMerge::merge_from(&mut self.allocatable, other.allocatable); - crate::DeepMerge::merge_from(&mut self.capacity, other.capacity); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.addresses, + other.addresses, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::map::granular(&mut self.allocatable, other.allocatable, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.capacity, other.capacity, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.config, other.config); crate::DeepMerge::merge_from(&mut self.daemon_endpoints, other.daemon_endpoints); - crate::DeepMerge::merge_from(&mut self.images, other.images); + crate::merge_strategies::list::atomic(&mut self.images, other.images); crate::DeepMerge::merge_from(&mut self.node_info, other.node_info); crate::DeepMerge::merge_from(&mut self.phase, other.phase); - crate::DeepMerge::merge_from(&mut self.volumes_attached, other.volumes_attached); - crate::DeepMerge::merge_from(&mut self.volumes_in_use, other.volumes_in_use); + crate::merge_strategies::list::atomic(&mut self.volumes_attached, other.volumes_attached); + crate::merge_strategies::list::atomic(&mut self.volumes_in_use, other.volumes_in_use); } } diff --git a/src/v1_26/api/core/v1/persistent_volume_claim_spec.rs b/src/v1_26/api/core/v1/persistent_volume_claim_spec.rs index e8981032c4..d3a0db3394 100644 --- a/src/v1_26/api/core/v1/persistent_volume_claim_spec.rs +++ b/src/v1_26/api/core/v1/persistent_volume_claim_spec.rs @@ -37,7 +37,7 @@ pub struct PersistentVolumeClaimSpec { impl crate::DeepMerge for PersistentVolumeClaimSpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.access_modes, other.access_modes); + crate::merge_strategies::list::atomic(&mut self.access_modes, other.access_modes); crate::DeepMerge::merge_from(&mut self.data_source, other.data_source); crate::DeepMerge::merge_from(&mut self.data_source_ref, other.data_source_ref); crate::DeepMerge::merge_from(&mut self.resources, other.resources); diff --git a/src/v1_26/api/core/v1/persistent_volume_claim_status.rs b/src/v1_26/api/core/v1/persistent_volume_claim_status.rs index 8f5f980671..c3b27d01c5 100644 --- a/src/v1_26/api/core/v1/persistent_volume_claim_status.rs +++ b/src/v1_26/api/core/v1/persistent_volume_claim_status.rs @@ -25,10 +25,21 @@ pub struct PersistentVolumeClaimStatus { impl crate::DeepMerge for PersistentVolumeClaimStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.access_modes, other.access_modes); - crate::DeepMerge::merge_from(&mut self.allocated_resources, other.allocated_resources); - crate::DeepMerge::merge_from(&mut self.capacity, other.capacity); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::atomic(&mut self.access_modes, other.access_modes); + crate::merge_strategies::map::granular(&mut self.allocated_resources, other.allocated_resources, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.capacity, other.capacity, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.phase, other.phase); crate::DeepMerge::merge_from(&mut self.resize_status, other.resize_status); } diff --git a/src/v1_26/api/core/v1/persistent_volume_spec.rs b/src/v1_26/api/core/v1/persistent_volume_spec.rs index 42cd7fd388..39ced5b9b7 100644 --- a/src/v1_26/api/core/v1/persistent_volume_spec.rs +++ b/src/v1_26/api/core/v1/persistent_volume_spec.rs @@ -97,11 +97,13 @@ pub struct PersistentVolumeSpec { impl crate::DeepMerge for PersistentVolumeSpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.access_modes, other.access_modes); + crate::merge_strategies::list::atomic(&mut self.access_modes, other.access_modes); crate::DeepMerge::merge_from(&mut self.aws_elastic_block_store, other.aws_elastic_block_store); crate::DeepMerge::merge_from(&mut self.azure_disk, other.azure_disk); crate::DeepMerge::merge_from(&mut self.azure_file, other.azure_file); - crate::DeepMerge::merge_from(&mut self.capacity, other.capacity); + crate::merge_strategies::map::granular(&mut self.capacity, other.capacity, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.cephfs, other.cephfs); crate::DeepMerge::merge_from(&mut self.cinder, other.cinder); crate::DeepMerge::merge_from(&mut self.claim_ref, other.claim_ref); @@ -114,7 +116,7 @@ impl crate::DeepMerge for PersistentVolumeSpec { crate::DeepMerge::merge_from(&mut self.host_path, other.host_path); crate::DeepMerge::merge_from(&mut self.iscsi, other.iscsi); crate::DeepMerge::merge_from(&mut self.local, other.local); - crate::DeepMerge::merge_from(&mut self.mount_options, other.mount_options); + crate::merge_strategies::list::atomic(&mut self.mount_options, other.mount_options); crate::DeepMerge::merge_from(&mut self.nfs, other.nfs); crate::DeepMerge::merge_from(&mut self.node_affinity, other.node_affinity); crate::DeepMerge::merge_from(&mut self.persistent_volume_reclaim_policy, other.persistent_volume_reclaim_policy); diff --git a/src/v1_26/api/core/v1/pod_affinity.rs b/src/v1_26/api/core/v1/pod_affinity.rs index facc781ff6..a528250bbc 100644 --- a/src/v1_26/api/core/v1/pod_affinity.rs +++ b/src/v1_26/api/core/v1/pod_affinity.rs @@ -12,8 +12,8 @@ pub struct PodAffinity { impl crate::DeepMerge for PodAffinity { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.preferred_during_scheduling_ignored_during_execution, other.preferred_during_scheduling_ignored_during_execution); - crate::DeepMerge::merge_from(&mut self.required_during_scheduling_ignored_during_execution, other.required_during_scheduling_ignored_during_execution); + crate::merge_strategies::list::atomic(&mut self.preferred_during_scheduling_ignored_during_execution, other.preferred_during_scheduling_ignored_during_execution); + crate::merge_strategies::list::atomic(&mut self.required_during_scheduling_ignored_during_execution, other.required_during_scheduling_ignored_during_execution); } } diff --git a/src/v1_26/api/core/v1/pod_affinity_term.rs b/src/v1_26/api/core/v1/pod_affinity_term.rs index 92b8e14b28..497fd832bf 100644 --- a/src/v1_26/api/core/v1/pod_affinity_term.rs +++ b/src/v1_26/api/core/v1/pod_affinity_term.rs @@ -20,7 +20,7 @@ impl crate::DeepMerge for PodAffinityTerm { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.label_selector, other.label_selector); crate::DeepMerge::merge_from(&mut self.namespace_selector, other.namespace_selector); - crate::DeepMerge::merge_from(&mut self.namespaces, other.namespaces); + crate::merge_strategies::list::atomic(&mut self.namespaces, other.namespaces); crate::DeepMerge::merge_from(&mut self.topology_key, other.topology_key); } } diff --git a/src/v1_26/api/core/v1/pod_anti_affinity.rs b/src/v1_26/api/core/v1/pod_anti_affinity.rs index a6cd6aa584..86979017ac 100644 --- a/src/v1_26/api/core/v1/pod_anti_affinity.rs +++ b/src/v1_26/api/core/v1/pod_anti_affinity.rs @@ -12,8 +12,8 @@ pub struct PodAntiAffinity { impl crate::DeepMerge for PodAntiAffinity { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.preferred_during_scheduling_ignored_during_execution, other.preferred_during_scheduling_ignored_during_execution); - crate::DeepMerge::merge_from(&mut self.required_during_scheduling_ignored_during_execution, other.required_during_scheduling_ignored_during_execution); + crate::merge_strategies::list::atomic(&mut self.preferred_during_scheduling_ignored_during_execution, other.preferred_during_scheduling_ignored_during_execution); + crate::merge_strategies::list::atomic(&mut self.required_during_scheduling_ignored_during_execution, other.required_during_scheduling_ignored_during_execution); } } diff --git a/src/v1_26/api/core/v1/pod_dns_config.rs b/src/v1_26/api/core/v1/pod_dns_config.rs index b79282bb55..201eb4d69c 100644 --- a/src/v1_26/api/core/v1/pod_dns_config.rs +++ b/src/v1_26/api/core/v1/pod_dns_config.rs @@ -15,9 +15,9 @@ pub struct PodDNSConfig { impl crate::DeepMerge for PodDNSConfig { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.nameservers, other.nameservers); - crate::DeepMerge::merge_from(&mut self.options, other.options); - crate::DeepMerge::merge_from(&mut self.searches, other.searches); + crate::merge_strategies::list::atomic(&mut self.nameservers, other.nameservers); + crate::merge_strategies::list::atomic(&mut self.options, other.options); + crate::merge_strategies::list::atomic(&mut self.searches, other.searches); } } diff --git a/src/v1_26/api/core/v1/pod_security_context.rs b/src/v1_26/api/core/v1/pod_security_context.rs index edf18e0e34..1734353335 100644 --- a/src/v1_26/api/core/v1/pod_security_context.rs +++ b/src/v1_26/api/core/v1/pod_security_context.rs @@ -47,8 +47,8 @@ impl crate::DeepMerge for PodSecurityContext { crate::DeepMerge::merge_from(&mut self.run_as_user, other.run_as_user); crate::DeepMerge::merge_from(&mut self.se_linux_options, other.se_linux_options); crate::DeepMerge::merge_from(&mut self.seccomp_profile, other.seccomp_profile); - crate::DeepMerge::merge_from(&mut self.supplemental_groups, other.supplemental_groups); - crate::DeepMerge::merge_from(&mut self.sysctls, other.sysctls); + crate::merge_strategies::list::atomic(&mut self.supplemental_groups, other.supplemental_groups); + crate::merge_strategies::list::atomic(&mut self.sysctls, other.sysctls); crate::DeepMerge::merge_from(&mut self.windows_options, other.windows_options); } } diff --git a/src/v1_26/api/core/v1/pod_spec.rs b/src/v1_26/api/core/v1/pod_spec.rs index 46da7fbee2..3723fbe9db 100644 --- a/src/v1_26/api/core/v1/pod_spec.rs +++ b/src/v1_26/api/core/v1/pod_spec.rs @@ -138,32 +138,83 @@ impl crate::DeepMerge for PodSpec { crate::DeepMerge::merge_from(&mut self.active_deadline_seconds, other.active_deadline_seconds); crate::DeepMerge::merge_from(&mut self.affinity, other.affinity); crate::DeepMerge::merge_from(&mut self.automount_service_account_token, other.automount_service_account_token); - crate::DeepMerge::merge_from(&mut self.containers, other.containers); + crate::merge_strategies::list::map( + &mut self.containers, + other.containers, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.dns_config, other.dns_config); crate::DeepMerge::merge_from(&mut self.dns_policy, other.dns_policy); crate::DeepMerge::merge_from(&mut self.enable_service_links, other.enable_service_links); - crate::DeepMerge::merge_from(&mut self.ephemeral_containers, other.ephemeral_containers); - crate::DeepMerge::merge_from(&mut self.host_aliases, other.host_aliases); + crate::merge_strategies::list::map( + &mut self.ephemeral_containers, + other.ephemeral_containers, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::list::map( + &mut self.host_aliases, + other.host_aliases, + &[|lhs, rhs| lhs.ip == rhs.ip], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.host_ipc, other.host_ipc); crate::DeepMerge::merge_from(&mut self.host_network, other.host_network); crate::DeepMerge::merge_from(&mut self.host_pid, other.host_pid); crate::DeepMerge::merge_from(&mut self.host_users, other.host_users); crate::DeepMerge::merge_from(&mut self.hostname, other.hostname); - crate::DeepMerge::merge_from(&mut self.image_pull_secrets, other.image_pull_secrets); - crate::DeepMerge::merge_from(&mut self.init_containers, other.init_containers); + crate::merge_strategies::list::map( + &mut self.image_pull_secrets, + other.image_pull_secrets, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::list::map( + &mut self.init_containers, + other.init_containers, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.node_name, other.node_name); - crate::DeepMerge::merge_from(&mut self.node_selector, other.node_selector); + crate::merge_strategies::map::atomic(&mut self.node_selector, other.node_selector); crate::DeepMerge::merge_from(&mut self.os, other.os); - crate::DeepMerge::merge_from(&mut self.overhead, other.overhead); + crate::merge_strategies::map::granular(&mut self.overhead, other.overhead, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.preemption_policy, other.preemption_policy); crate::DeepMerge::merge_from(&mut self.priority, other.priority); crate::DeepMerge::merge_from(&mut self.priority_class_name, other.priority_class_name); - crate::DeepMerge::merge_from(&mut self.readiness_gates, other.readiness_gates); - crate::DeepMerge::merge_from(&mut self.resource_claims, other.resource_claims); + crate::merge_strategies::list::atomic(&mut self.readiness_gates, other.readiness_gates); + crate::merge_strategies::list::map( + &mut self.resource_claims, + other.resource_claims, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.restart_policy, other.restart_policy); crate::DeepMerge::merge_from(&mut self.runtime_class_name, other.runtime_class_name); crate::DeepMerge::merge_from(&mut self.scheduler_name, other.scheduler_name); - crate::DeepMerge::merge_from(&mut self.scheduling_gates, other.scheduling_gates); + crate::merge_strategies::list::map( + &mut self.scheduling_gates, + other.scheduling_gates, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.security_context, other.security_context); crate::DeepMerge::merge_from(&mut self.service_account, other.service_account); crate::DeepMerge::merge_from(&mut self.service_account_name, other.service_account_name); @@ -171,9 +222,23 @@ impl crate::DeepMerge for PodSpec { crate::DeepMerge::merge_from(&mut self.share_process_namespace, other.share_process_namespace); crate::DeepMerge::merge_from(&mut self.subdomain, other.subdomain); crate::DeepMerge::merge_from(&mut self.termination_grace_period_seconds, other.termination_grace_period_seconds); - crate::DeepMerge::merge_from(&mut self.tolerations, other.tolerations); - crate::DeepMerge::merge_from(&mut self.topology_spread_constraints, other.topology_spread_constraints); - crate::DeepMerge::merge_from(&mut self.volumes, other.volumes); + crate::merge_strategies::list::atomic(&mut self.tolerations, other.tolerations); + crate::merge_strategies::list::map( + &mut self.topology_spread_constraints, + other.topology_spread_constraints, + &[|lhs, rhs| lhs.topology_key == rhs.topology_key], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::list::map( + &mut self.volumes, + other.volumes, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_26/api/core/v1/pod_status.rs b/src/v1_26/api/core/v1/pod_status.rs index 6f83dcb6f7..c0c9e62f9a 100644 --- a/src/v1_26/api/core/v1/pod_status.rs +++ b/src/v1_26/api/core/v1/pod_status.rs @@ -51,16 +51,30 @@ pub struct PodStatus { impl crate::DeepMerge for PodStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); - crate::DeepMerge::merge_from(&mut self.container_statuses, other.container_statuses); - crate::DeepMerge::merge_from(&mut self.ephemeral_container_statuses, other.ephemeral_container_statuses); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::list::atomic(&mut self.container_statuses, other.container_statuses); + crate::merge_strategies::list::atomic(&mut self.ephemeral_container_statuses, other.ephemeral_container_statuses); crate::DeepMerge::merge_from(&mut self.host_ip, other.host_ip); - crate::DeepMerge::merge_from(&mut self.init_container_statuses, other.init_container_statuses); + crate::merge_strategies::list::atomic(&mut self.init_container_statuses, other.init_container_statuses); crate::DeepMerge::merge_from(&mut self.message, other.message); crate::DeepMerge::merge_from(&mut self.nominated_node_name, other.nominated_node_name); crate::DeepMerge::merge_from(&mut self.phase, other.phase); crate::DeepMerge::merge_from(&mut self.pod_ip, other.pod_ip); - crate::DeepMerge::merge_from(&mut self.pod_ips, other.pod_ips); + crate::merge_strategies::list::map( + &mut self.pod_ips, + other.pod_ips, + &[|lhs, rhs| lhs.ip == rhs.ip], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.qos_class, other.qos_class); crate::DeepMerge::merge_from(&mut self.reason, other.reason); crate::DeepMerge::merge_from(&mut self.start_time, other.start_time); diff --git a/src/v1_26/api/core/v1/projected_volume_source.rs b/src/v1_26/api/core/v1/projected_volume_source.rs index 8cbfa14727..676638445b 100644 --- a/src/v1_26/api/core/v1/projected_volume_source.rs +++ b/src/v1_26/api/core/v1/projected_volume_source.rs @@ -13,7 +13,7 @@ pub struct ProjectedVolumeSource { impl crate::DeepMerge for ProjectedVolumeSource { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.default_mode, other.default_mode); - crate::DeepMerge::merge_from(&mut self.sources, other.sources); + crate::merge_strategies::list::atomic(&mut self.sources, other.sources); } } diff --git a/src/v1_26/api/core/v1/rbd_persistent_volume_source.rs b/src/v1_26/api/core/v1/rbd_persistent_volume_source.rs index 54b7b5e7f2..08d1308041 100644 --- a/src/v1_26/api/core/v1/rbd_persistent_volume_source.rs +++ b/src/v1_26/api/core/v1/rbd_persistent_volume_source.rs @@ -33,7 +33,7 @@ impl crate::DeepMerge for RBDPersistentVolumeSource { crate::DeepMerge::merge_from(&mut self.fs_type, other.fs_type); crate::DeepMerge::merge_from(&mut self.image, other.image); crate::DeepMerge::merge_from(&mut self.keyring, other.keyring); - crate::DeepMerge::merge_from(&mut self.monitors, other.monitors); + crate::merge_strategies::list::atomic(&mut self.monitors, other.monitors); crate::DeepMerge::merge_from(&mut self.pool, other.pool); crate::DeepMerge::merge_from(&mut self.read_only, other.read_only); crate::DeepMerge::merge_from(&mut self.secret_ref, other.secret_ref); diff --git a/src/v1_26/api/core/v1/rbd_volume_source.rs b/src/v1_26/api/core/v1/rbd_volume_source.rs index 2d39e78da8..18a2d2c010 100644 --- a/src/v1_26/api/core/v1/rbd_volume_source.rs +++ b/src/v1_26/api/core/v1/rbd_volume_source.rs @@ -33,7 +33,7 @@ impl crate::DeepMerge for RBDVolumeSource { crate::DeepMerge::merge_from(&mut self.fs_type, other.fs_type); crate::DeepMerge::merge_from(&mut self.image, other.image); crate::DeepMerge::merge_from(&mut self.keyring, other.keyring); - crate::DeepMerge::merge_from(&mut self.monitors, other.monitors); + crate::merge_strategies::list::atomic(&mut self.monitors, other.monitors); crate::DeepMerge::merge_from(&mut self.pool, other.pool); crate::DeepMerge::merge_from(&mut self.read_only, other.read_only); crate::DeepMerge::merge_from(&mut self.secret_ref, other.secret_ref); diff --git a/src/v1_26/api/core/v1/replication_controller_spec.rs b/src/v1_26/api/core/v1/replication_controller_spec.rs index 293546b183..ed3edfa202 100644 --- a/src/v1_26/api/core/v1/replication_controller_spec.rs +++ b/src/v1_26/api/core/v1/replication_controller_spec.rs @@ -20,7 +20,7 @@ impl crate::DeepMerge for ReplicationControllerSpec { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.min_ready_seconds, other.min_ready_seconds); crate::DeepMerge::merge_from(&mut self.replicas, other.replicas); - crate::DeepMerge::merge_from(&mut self.selector, other.selector); + crate::merge_strategies::map::atomic(&mut self.selector, other.selector); crate::DeepMerge::merge_from(&mut self.template, other.template); } } diff --git a/src/v1_26/api/core/v1/replication_controller_status.rs b/src/v1_26/api/core/v1/replication_controller_status.rs index 46de48d4a4..38dba200ad 100644 --- a/src/v1_26/api/core/v1/replication_controller_status.rs +++ b/src/v1_26/api/core/v1/replication_controller_status.rs @@ -25,7 +25,14 @@ pub struct ReplicationControllerStatus { impl crate::DeepMerge for ReplicationControllerStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.available_replicas, other.available_replicas); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.fully_labeled_replicas, other.fully_labeled_replicas); crate::DeepMerge::merge_from(&mut self.observed_generation, other.observed_generation); crate::DeepMerge::merge_from(&mut self.ready_replicas, other.ready_replicas); diff --git a/src/v1_26/api/core/v1/resource_quota_spec.rs b/src/v1_26/api/core/v1/resource_quota_spec.rs index fab2b7970d..3468d8e9e0 100644 --- a/src/v1_26/api/core/v1/resource_quota_spec.rs +++ b/src/v1_26/api/core/v1/resource_quota_spec.rs @@ -15,9 +15,11 @@ pub struct ResourceQuotaSpec { impl crate::DeepMerge for ResourceQuotaSpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.hard, other.hard); + crate::merge_strategies::map::granular(&mut self.hard, other.hard, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.scope_selector, other.scope_selector); - crate::DeepMerge::merge_from(&mut self.scopes, other.scopes); + crate::merge_strategies::list::atomic(&mut self.scopes, other.scopes); } } diff --git a/src/v1_26/api/core/v1/resource_quota_status.rs b/src/v1_26/api/core/v1/resource_quota_status.rs index 100f418a69..74ee1efe3c 100644 --- a/src/v1_26/api/core/v1/resource_quota_status.rs +++ b/src/v1_26/api/core/v1/resource_quota_status.rs @@ -12,8 +12,12 @@ pub struct ResourceQuotaStatus { impl crate::DeepMerge for ResourceQuotaStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.hard, other.hard); - crate::DeepMerge::merge_from(&mut self.used, other.used); + crate::merge_strategies::map::granular(&mut self.hard, other.hard, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.used, other.used, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); } } diff --git a/src/v1_26/api/core/v1/resource_requirements.rs b/src/v1_26/api/core/v1/resource_requirements.rs index 1412e93a6f..d96b22d19c 100644 --- a/src/v1_26/api/core/v1/resource_requirements.rs +++ b/src/v1_26/api/core/v1/resource_requirements.rs @@ -19,9 +19,20 @@ pub struct ResourceRequirements { impl crate::DeepMerge for ResourceRequirements { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.claims, other.claims); - crate::DeepMerge::merge_from(&mut self.limits, other.limits); - crate::DeepMerge::merge_from(&mut self.requests, other.requests); + crate::merge_strategies::list::map( + &mut self.claims, + other.claims, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::map::granular(&mut self.limits, other.limits, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.requests, other.requests, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); } } diff --git a/src/v1_26/api/core/v1/scope_selector.rs b/src/v1_26/api/core/v1/scope_selector.rs index 22ef180aeb..23ebdb0612 100644 --- a/src/v1_26/api/core/v1/scope_selector.rs +++ b/src/v1_26/api/core/v1/scope_selector.rs @@ -9,7 +9,7 @@ pub struct ScopeSelector { impl crate::DeepMerge for ScopeSelector { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.match_expressions, other.match_expressions); + crate::merge_strategies::list::atomic(&mut self.match_expressions, other.match_expressions); } } diff --git a/src/v1_26/api/core/v1/scoped_resource_selector_requirement.rs b/src/v1_26/api/core/v1/scoped_resource_selector_requirement.rs index 14449d761a..591e72bec0 100644 --- a/src/v1_26/api/core/v1/scoped_resource_selector_requirement.rs +++ b/src/v1_26/api/core/v1/scoped_resource_selector_requirement.rs @@ -19,7 +19,7 @@ impl crate::DeepMerge for ScopedResourceSelectorRequirement { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.operator, other.operator); crate::DeepMerge::merge_from(&mut self.scope_name, other.scope_name); - crate::DeepMerge::merge_from(&mut self.values, other.values); + crate::merge_strategies::list::atomic(&mut self.values, other.values); } } diff --git a/src/v1_26/api/core/v1/secret.rs b/src/v1_26/api/core/v1/secret.rs index 74a33ebe09..eb75155e0d 100644 --- a/src/v1_26/api/core/v1/secret.rs +++ b/src/v1_26/api/core/v1/secret.rs @@ -498,10 +498,14 @@ impl crate::Metadata for Secret { impl crate::DeepMerge for Secret { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.data, other.data); + crate::merge_strategies::map::granular(&mut self.data, other.data, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.immutable, other.immutable); crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.string_data, other.string_data); + crate::merge_strategies::map::granular(&mut self.string_data, other.string_data, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.type_, other.type_); } } diff --git a/src/v1_26/api/core/v1/secret_projection.rs b/src/v1_26/api/core/v1/secret_projection.rs index f32c8fac09..58cd75c106 100644 --- a/src/v1_26/api/core/v1/secret_projection.rs +++ b/src/v1_26/api/core/v1/secret_projection.rs @@ -17,7 +17,7 @@ pub struct SecretProjection { impl crate::DeepMerge for SecretProjection { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.items, other.items); + crate::merge_strategies::list::atomic(&mut self.items, other.items); crate::DeepMerge::merge_from(&mut self.name, other.name); crate::DeepMerge::merge_from(&mut self.optional, other.optional); } diff --git a/src/v1_26/api/core/v1/secret_volume_source.rs b/src/v1_26/api/core/v1/secret_volume_source.rs index 9be0591abd..9d45331f6d 100644 --- a/src/v1_26/api/core/v1/secret_volume_source.rs +++ b/src/v1_26/api/core/v1/secret_volume_source.rs @@ -21,7 +21,7 @@ pub struct SecretVolumeSource { impl crate::DeepMerge for SecretVolumeSource { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.default_mode, other.default_mode); - crate::DeepMerge::merge_from(&mut self.items, other.items); + crate::merge_strategies::list::atomic(&mut self.items, other.items); crate::DeepMerge::merge_from(&mut self.optional, other.optional); crate::DeepMerge::merge_from(&mut self.secret_name, other.secret_name); } diff --git a/src/v1_26/api/core/v1/service_account.rs b/src/v1_26/api/core/v1/service_account.rs index 9cc6535f2a..1f966964fe 100644 --- a/src/v1_26/api/core/v1/service_account.rs +++ b/src/v1_26/api/core/v1/service_account.rs @@ -496,9 +496,16 @@ impl crate::Metadata for ServiceAccount { impl crate::DeepMerge for ServiceAccount { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.automount_service_account_token, other.automount_service_account_token); - crate::DeepMerge::merge_from(&mut self.image_pull_secrets, other.image_pull_secrets); + crate::merge_strategies::list::atomic(&mut self.image_pull_secrets, other.image_pull_secrets); crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.secrets, other.secrets); + crate::merge_strategies::list::map( + &mut self.secrets, + other.secrets, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_26/api/core/v1/service_spec.rs b/src/v1_26/api/core/v1/service_spec.rs index 528752c409..77d5ead5d3 100644 --- a/src/v1_26/api/core/v1/service_spec.rs +++ b/src/v1_26/api/core/v1/service_spec.rs @@ -72,20 +72,27 @@ impl crate::DeepMerge for ServiceSpec { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.allocate_load_balancer_node_ports, other.allocate_load_balancer_node_ports); crate::DeepMerge::merge_from(&mut self.cluster_ip, other.cluster_ip); - crate::DeepMerge::merge_from(&mut self.cluster_ips, other.cluster_ips); - crate::DeepMerge::merge_from(&mut self.external_ips, other.external_ips); + crate::merge_strategies::list::atomic(&mut self.cluster_ips, other.cluster_ips); + crate::merge_strategies::list::atomic(&mut self.external_ips, other.external_ips); crate::DeepMerge::merge_from(&mut self.external_name, other.external_name); crate::DeepMerge::merge_from(&mut self.external_traffic_policy, other.external_traffic_policy); crate::DeepMerge::merge_from(&mut self.health_check_node_port, other.health_check_node_port); crate::DeepMerge::merge_from(&mut self.internal_traffic_policy, other.internal_traffic_policy); - crate::DeepMerge::merge_from(&mut self.ip_families, other.ip_families); + crate::merge_strategies::list::atomic(&mut self.ip_families, other.ip_families); crate::DeepMerge::merge_from(&mut self.ip_family_policy, other.ip_family_policy); crate::DeepMerge::merge_from(&mut self.load_balancer_class, other.load_balancer_class); crate::DeepMerge::merge_from(&mut self.load_balancer_ip, other.load_balancer_ip); - crate::DeepMerge::merge_from(&mut self.load_balancer_source_ranges, other.load_balancer_source_ranges); - crate::DeepMerge::merge_from(&mut self.ports, other.ports); + crate::merge_strategies::list::atomic(&mut self.load_balancer_source_ranges, other.load_balancer_source_ranges); + crate::merge_strategies::list::map( + &mut self.ports, + other.ports, + &[|lhs, rhs| lhs.port == rhs.port], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.publish_not_ready_addresses, other.publish_not_ready_addresses); - crate::DeepMerge::merge_from(&mut self.selector, other.selector); + crate::merge_strategies::map::atomic(&mut self.selector, other.selector); crate::DeepMerge::merge_from(&mut self.session_affinity, other.session_affinity); crate::DeepMerge::merge_from(&mut self.session_affinity_config, other.session_affinity_config); crate::DeepMerge::merge_from(&mut self.type_, other.type_); diff --git a/src/v1_26/api/core/v1/service_status.rs b/src/v1_26/api/core/v1/service_status.rs index 6c3429fd70..6dece09b96 100644 --- a/src/v1_26/api/core/v1/service_status.rs +++ b/src/v1_26/api/core/v1/service_status.rs @@ -12,7 +12,14 @@ pub struct ServiceStatus { impl crate::DeepMerge for ServiceStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.load_balancer, other.load_balancer); } } diff --git a/src/v1_26/api/core/v1/topology_selector_label_requirement.rs b/src/v1_26/api/core/v1/topology_selector_label_requirement.rs index 3efed6ba65..50764252b6 100644 --- a/src/v1_26/api/core/v1/topology_selector_label_requirement.rs +++ b/src/v1_26/api/core/v1/topology_selector_label_requirement.rs @@ -13,7 +13,7 @@ pub struct TopologySelectorLabelRequirement { impl crate::DeepMerge for TopologySelectorLabelRequirement { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.key, other.key); - crate::DeepMerge::merge_from(&mut self.values, other.values); + crate::merge_strategies::list::atomic(&mut self.values, other.values); } } diff --git a/src/v1_26/api/core/v1/topology_selector_term.rs b/src/v1_26/api/core/v1/topology_selector_term.rs index 230f7ab530..df526d6f4d 100644 --- a/src/v1_26/api/core/v1/topology_selector_term.rs +++ b/src/v1_26/api/core/v1/topology_selector_term.rs @@ -9,7 +9,7 @@ pub struct TopologySelectorTerm { impl crate::DeepMerge for TopologySelectorTerm { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.match_label_expressions, other.match_label_expressions); + crate::merge_strategies::list::atomic(&mut self.match_label_expressions, other.match_label_expressions); } } diff --git a/src/v1_26/api/core/v1/topology_spread_constraint.rs b/src/v1_26/api/core/v1/topology_spread_constraint.rs index 7aa1c2d02f..9beda5aa6d 100644 --- a/src/v1_26/api/core/v1/topology_spread_constraint.rs +++ b/src/v1_26/api/core/v1/topology_spread_constraint.rs @@ -43,7 +43,7 @@ pub struct TopologySpreadConstraint { impl crate::DeepMerge for TopologySpreadConstraint { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.label_selector, other.label_selector); - crate::DeepMerge::merge_from(&mut self.match_label_keys, other.match_label_keys); + crate::merge_strategies::list::atomic(&mut self.match_label_keys, other.match_label_keys); crate::DeepMerge::merge_from(&mut self.max_skew, other.max_skew); crate::DeepMerge::merge_from(&mut self.min_domains, other.min_domains); crate::DeepMerge::merge_from(&mut self.node_affinity_policy, other.node_affinity_policy); diff --git a/src/v1_26/api/discovery/v1/endpoint.rs b/src/v1_26/api/discovery/v1/endpoint.rs index 9878d80d05..14b9a4c308 100644 --- a/src/v1_26/api/discovery/v1/endpoint.rs +++ b/src/v1_26/api/discovery/v1/endpoint.rs @@ -30,9 +30,11 @@ pub struct Endpoint { impl crate::DeepMerge for Endpoint { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.addresses, other.addresses); + crate::merge_strategies::list::set(&mut self.addresses, other.addresses); crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); - crate::DeepMerge::merge_from(&mut self.deprecated_topology, other.deprecated_topology); + crate::merge_strategies::map::granular(&mut self.deprecated_topology, other.deprecated_topology, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.hints, other.hints); crate::DeepMerge::merge_from(&mut self.hostname, other.hostname); crate::DeepMerge::merge_from(&mut self.node_name, other.node_name); diff --git a/src/v1_26/api/discovery/v1/endpoint_hints.rs b/src/v1_26/api/discovery/v1/endpoint_hints.rs index 7fe956528a..02cbd88946 100644 --- a/src/v1_26/api/discovery/v1/endpoint_hints.rs +++ b/src/v1_26/api/discovery/v1/endpoint_hints.rs @@ -9,7 +9,7 @@ pub struct EndpointHints { impl crate::DeepMerge for EndpointHints { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.for_zones, other.for_zones); + crate::merge_strategies::list::atomic(&mut self.for_zones, other.for_zones); } } diff --git a/src/v1_26/api/discovery/v1/endpoint_slice.rs b/src/v1_26/api/discovery/v1/endpoint_slice.rs index 5858e58711..033c1c4e60 100644 --- a/src/v1_26/api/discovery/v1/endpoint_slice.rs +++ b/src/v1_26/api/discovery/v1/endpoint_slice.rs @@ -497,9 +497,9 @@ impl crate::Metadata for EndpointSlice { impl crate::DeepMerge for EndpointSlice { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.address_type, other.address_type); - crate::DeepMerge::merge_from(&mut self.endpoints, other.endpoints); + crate::merge_strategies::list::atomic(&mut self.endpoints, other.endpoints); crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.ports, other.ports); + crate::merge_strategies::list::atomic(&mut self.ports, other.ports); } } diff --git a/src/v1_26/api/flowcontrol/v1beta2/flow_schema_spec.rs b/src/v1_26/api/flowcontrol/v1beta2/flow_schema_spec.rs index e28a19711f..c8c9e2a04f 100644 --- a/src/v1_26/api/flowcontrol/v1beta2/flow_schema_spec.rs +++ b/src/v1_26/api/flowcontrol/v1beta2/flow_schema_spec.rs @@ -21,7 +21,7 @@ impl crate::DeepMerge for FlowSchemaSpec { crate::DeepMerge::merge_from(&mut self.distinguisher_method, other.distinguisher_method); crate::DeepMerge::merge_from(&mut self.matching_precedence, other.matching_precedence); crate::DeepMerge::merge_from(&mut self.priority_level_configuration, other.priority_level_configuration); - crate::DeepMerge::merge_from(&mut self.rules, other.rules); + crate::merge_strategies::list::atomic(&mut self.rules, other.rules); } } diff --git a/src/v1_26/api/flowcontrol/v1beta2/flow_schema_status.rs b/src/v1_26/api/flowcontrol/v1beta2/flow_schema_status.rs index 104835c519..f412d33945 100644 --- a/src/v1_26/api/flowcontrol/v1beta2/flow_schema_status.rs +++ b/src/v1_26/api/flowcontrol/v1beta2/flow_schema_status.rs @@ -9,7 +9,14 @@ pub struct FlowSchemaStatus { impl crate::DeepMerge for FlowSchemaStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_26/api/flowcontrol/v1beta2/non_resource_policy_rule.rs b/src/v1_26/api/flowcontrol/v1beta2/non_resource_policy_rule.rs index e9be9c98a4..f4d3bb0bfc 100644 --- a/src/v1_26/api/flowcontrol/v1beta2/non_resource_policy_rule.rs +++ b/src/v1_26/api/flowcontrol/v1beta2/non_resource_policy_rule.rs @@ -18,8 +18,8 @@ pub struct NonResourcePolicyRule { impl crate::DeepMerge for NonResourcePolicyRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.non_resource_urls, other.non_resource_urls); - crate::DeepMerge::merge_from(&mut self.verbs, other.verbs); + crate::merge_strategies::list::set(&mut self.non_resource_urls, other.non_resource_urls); + crate::merge_strategies::list::set(&mut self.verbs, other.verbs); } } diff --git a/src/v1_26/api/flowcontrol/v1beta2/policy_rules_with_subjects.rs b/src/v1_26/api/flowcontrol/v1beta2/policy_rules_with_subjects.rs index 55c59b24a2..c6b9fafade 100644 --- a/src/v1_26/api/flowcontrol/v1beta2/policy_rules_with_subjects.rs +++ b/src/v1_26/api/flowcontrol/v1beta2/policy_rules_with_subjects.rs @@ -15,9 +15,9 @@ pub struct PolicyRulesWithSubjects { impl crate::DeepMerge for PolicyRulesWithSubjects { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.non_resource_rules, other.non_resource_rules); - crate::DeepMerge::merge_from(&mut self.resource_rules, other.resource_rules); - crate::DeepMerge::merge_from(&mut self.subjects, other.subjects); + crate::merge_strategies::list::atomic(&mut self.non_resource_rules, other.non_resource_rules); + crate::merge_strategies::list::atomic(&mut self.resource_rules, other.resource_rules); + crate::merge_strategies::list::atomic(&mut self.subjects, other.subjects); } } diff --git a/src/v1_26/api/flowcontrol/v1beta2/priority_level_configuration_status.rs b/src/v1_26/api/flowcontrol/v1beta2/priority_level_configuration_status.rs index 3a1f5c9216..6b7d140c4b 100644 --- a/src/v1_26/api/flowcontrol/v1beta2/priority_level_configuration_status.rs +++ b/src/v1_26/api/flowcontrol/v1beta2/priority_level_configuration_status.rs @@ -9,7 +9,14 @@ pub struct PriorityLevelConfigurationStatus { impl crate::DeepMerge for PriorityLevelConfigurationStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_26/api/flowcontrol/v1beta2/resource_policy_rule.rs b/src/v1_26/api/flowcontrol/v1beta2/resource_policy_rule.rs index f4db7b13a2..34f9d52c52 100644 --- a/src/v1_26/api/flowcontrol/v1beta2/resource_policy_rule.rs +++ b/src/v1_26/api/flowcontrol/v1beta2/resource_policy_rule.rs @@ -21,11 +21,11 @@ pub struct ResourcePolicyRule { impl crate::DeepMerge for ResourcePolicyRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.api_groups, other.api_groups); + crate::merge_strategies::list::set(&mut self.api_groups, other.api_groups); crate::DeepMerge::merge_from(&mut self.cluster_scope, other.cluster_scope); - crate::DeepMerge::merge_from(&mut self.namespaces, other.namespaces); - crate::DeepMerge::merge_from(&mut self.resources, other.resources); - crate::DeepMerge::merge_from(&mut self.verbs, other.verbs); + crate::merge_strategies::list::set(&mut self.namespaces, other.namespaces); + crate::merge_strategies::list::set(&mut self.resources, other.resources); + crate::merge_strategies::list::set(&mut self.verbs, other.verbs); } } diff --git a/src/v1_26/api/flowcontrol/v1beta3/flow_schema_spec.rs b/src/v1_26/api/flowcontrol/v1beta3/flow_schema_spec.rs index 12d807e285..e03e77fc58 100644 --- a/src/v1_26/api/flowcontrol/v1beta3/flow_schema_spec.rs +++ b/src/v1_26/api/flowcontrol/v1beta3/flow_schema_spec.rs @@ -21,7 +21,7 @@ impl crate::DeepMerge for FlowSchemaSpec { crate::DeepMerge::merge_from(&mut self.distinguisher_method, other.distinguisher_method); crate::DeepMerge::merge_from(&mut self.matching_precedence, other.matching_precedence); crate::DeepMerge::merge_from(&mut self.priority_level_configuration, other.priority_level_configuration); - crate::DeepMerge::merge_from(&mut self.rules, other.rules); + crate::merge_strategies::list::atomic(&mut self.rules, other.rules); } } diff --git a/src/v1_26/api/flowcontrol/v1beta3/flow_schema_status.rs b/src/v1_26/api/flowcontrol/v1beta3/flow_schema_status.rs index 46f46aafdc..5ca9e73ef3 100644 --- a/src/v1_26/api/flowcontrol/v1beta3/flow_schema_status.rs +++ b/src/v1_26/api/flowcontrol/v1beta3/flow_schema_status.rs @@ -9,7 +9,14 @@ pub struct FlowSchemaStatus { impl crate::DeepMerge for FlowSchemaStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_26/api/flowcontrol/v1beta3/non_resource_policy_rule.rs b/src/v1_26/api/flowcontrol/v1beta3/non_resource_policy_rule.rs index b955aa58a1..11fff891ce 100644 --- a/src/v1_26/api/flowcontrol/v1beta3/non_resource_policy_rule.rs +++ b/src/v1_26/api/flowcontrol/v1beta3/non_resource_policy_rule.rs @@ -18,8 +18,8 @@ pub struct NonResourcePolicyRule { impl crate::DeepMerge for NonResourcePolicyRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.non_resource_urls, other.non_resource_urls); - crate::DeepMerge::merge_from(&mut self.verbs, other.verbs); + crate::merge_strategies::list::set(&mut self.non_resource_urls, other.non_resource_urls); + crate::merge_strategies::list::set(&mut self.verbs, other.verbs); } } diff --git a/src/v1_26/api/flowcontrol/v1beta3/policy_rules_with_subjects.rs b/src/v1_26/api/flowcontrol/v1beta3/policy_rules_with_subjects.rs index 38ca58e5b2..ead5d05c8b 100644 --- a/src/v1_26/api/flowcontrol/v1beta3/policy_rules_with_subjects.rs +++ b/src/v1_26/api/flowcontrol/v1beta3/policy_rules_with_subjects.rs @@ -15,9 +15,9 @@ pub struct PolicyRulesWithSubjects { impl crate::DeepMerge for PolicyRulesWithSubjects { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.non_resource_rules, other.non_resource_rules); - crate::DeepMerge::merge_from(&mut self.resource_rules, other.resource_rules); - crate::DeepMerge::merge_from(&mut self.subjects, other.subjects); + crate::merge_strategies::list::atomic(&mut self.non_resource_rules, other.non_resource_rules); + crate::merge_strategies::list::atomic(&mut self.resource_rules, other.resource_rules); + crate::merge_strategies::list::atomic(&mut self.subjects, other.subjects); } } diff --git a/src/v1_26/api/flowcontrol/v1beta3/priority_level_configuration_status.rs b/src/v1_26/api/flowcontrol/v1beta3/priority_level_configuration_status.rs index 51d0fb9302..ca66232ba2 100644 --- a/src/v1_26/api/flowcontrol/v1beta3/priority_level_configuration_status.rs +++ b/src/v1_26/api/flowcontrol/v1beta3/priority_level_configuration_status.rs @@ -9,7 +9,14 @@ pub struct PriorityLevelConfigurationStatus { impl crate::DeepMerge for PriorityLevelConfigurationStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_26/api/flowcontrol/v1beta3/resource_policy_rule.rs b/src/v1_26/api/flowcontrol/v1beta3/resource_policy_rule.rs index 5e8e151a68..31f0ec8bcd 100644 --- a/src/v1_26/api/flowcontrol/v1beta3/resource_policy_rule.rs +++ b/src/v1_26/api/flowcontrol/v1beta3/resource_policy_rule.rs @@ -21,11 +21,11 @@ pub struct ResourcePolicyRule { impl crate::DeepMerge for ResourcePolicyRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.api_groups, other.api_groups); + crate::merge_strategies::list::set(&mut self.api_groups, other.api_groups); crate::DeepMerge::merge_from(&mut self.cluster_scope, other.cluster_scope); - crate::DeepMerge::merge_from(&mut self.namespaces, other.namespaces); - crate::DeepMerge::merge_from(&mut self.resources, other.resources); - crate::DeepMerge::merge_from(&mut self.verbs, other.verbs); + crate::merge_strategies::list::set(&mut self.namespaces, other.namespaces); + crate::merge_strategies::list::set(&mut self.resources, other.resources); + crate::merge_strategies::list::set(&mut self.verbs, other.verbs); } } diff --git a/src/v1_26/api/networking/v1/http_ingress_rule_value.rs b/src/v1_26/api/networking/v1/http_ingress_rule_value.rs index acc836c728..3749783ee2 100644 --- a/src/v1_26/api/networking/v1/http_ingress_rule_value.rs +++ b/src/v1_26/api/networking/v1/http_ingress_rule_value.rs @@ -9,7 +9,7 @@ pub struct HTTPIngressRuleValue { impl crate::DeepMerge for HTTPIngressRuleValue { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.paths, other.paths); + crate::merge_strategies::list::atomic(&mut self.paths, other.paths); } } diff --git a/src/v1_26/api/networking/v1/ingress_load_balancer_ingress.rs b/src/v1_26/api/networking/v1/ingress_load_balancer_ingress.rs index 708b193bbb..465c9c7d44 100644 --- a/src/v1_26/api/networking/v1/ingress_load_balancer_ingress.rs +++ b/src/v1_26/api/networking/v1/ingress_load_balancer_ingress.rs @@ -17,7 +17,7 @@ impl crate::DeepMerge for IngressLoadBalancerIngress { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.hostname, other.hostname); crate::DeepMerge::merge_from(&mut self.ip, other.ip); - crate::DeepMerge::merge_from(&mut self.ports, other.ports); + crate::merge_strategies::list::atomic(&mut self.ports, other.ports); } } diff --git a/src/v1_26/api/networking/v1/ingress_load_balancer_status.rs b/src/v1_26/api/networking/v1/ingress_load_balancer_status.rs index d4e77ca7de..e914c7b178 100644 --- a/src/v1_26/api/networking/v1/ingress_load_balancer_status.rs +++ b/src/v1_26/api/networking/v1/ingress_load_balancer_status.rs @@ -9,7 +9,7 @@ pub struct IngressLoadBalancerStatus { impl crate::DeepMerge for IngressLoadBalancerStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.ingress, other.ingress); + crate::merge_strategies::list::atomic(&mut self.ingress, other.ingress); } } diff --git a/src/v1_26/api/networking/v1/ingress_spec.rs b/src/v1_26/api/networking/v1/ingress_spec.rs index a4020c43b9..454a1a8bc8 100644 --- a/src/v1_26/api/networking/v1/ingress_spec.rs +++ b/src/v1_26/api/networking/v1/ingress_spec.rs @@ -20,8 +20,8 @@ impl crate::DeepMerge for IngressSpec { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.default_backend, other.default_backend); crate::DeepMerge::merge_from(&mut self.ingress_class_name, other.ingress_class_name); - crate::DeepMerge::merge_from(&mut self.rules, other.rules); - crate::DeepMerge::merge_from(&mut self.tls, other.tls); + crate::merge_strategies::list::atomic(&mut self.rules, other.rules); + crate::merge_strategies::list::atomic(&mut self.tls, other.tls); } } diff --git a/src/v1_26/api/networking/v1/ingress_tls.rs b/src/v1_26/api/networking/v1/ingress_tls.rs index d48a83a0c4..92c66b754f 100644 --- a/src/v1_26/api/networking/v1/ingress_tls.rs +++ b/src/v1_26/api/networking/v1/ingress_tls.rs @@ -12,7 +12,7 @@ pub struct IngressTLS { impl crate::DeepMerge for IngressTLS { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.hosts, other.hosts); + crate::merge_strategies::list::atomic(&mut self.hosts, other.hosts); crate::DeepMerge::merge_from(&mut self.secret_name, other.secret_name); } } diff --git a/src/v1_26/api/networking/v1/ip_block.rs b/src/v1_26/api/networking/v1/ip_block.rs index 8138a3055a..6acc8d1b62 100644 --- a/src/v1_26/api/networking/v1/ip_block.rs +++ b/src/v1_26/api/networking/v1/ip_block.rs @@ -13,7 +13,7 @@ pub struct IPBlock { impl crate::DeepMerge for IPBlock { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.cidr, other.cidr); - crate::DeepMerge::merge_from(&mut self.except, other.except); + crate::merge_strategies::list::atomic(&mut self.except, other.except); } } diff --git a/src/v1_26/api/networking/v1/network_policy_egress_rule.rs b/src/v1_26/api/networking/v1/network_policy_egress_rule.rs index 33619be210..28eb6a21b6 100644 --- a/src/v1_26/api/networking/v1/network_policy_egress_rule.rs +++ b/src/v1_26/api/networking/v1/network_policy_egress_rule.rs @@ -12,8 +12,8 @@ pub struct NetworkPolicyEgressRule { impl crate::DeepMerge for NetworkPolicyEgressRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.ports, other.ports); - crate::DeepMerge::merge_from(&mut self.to, other.to); + crate::merge_strategies::list::atomic(&mut self.ports, other.ports); + crate::merge_strategies::list::atomic(&mut self.to, other.to); } } diff --git a/src/v1_26/api/networking/v1/network_policy_ingress_rule.rs b/src/v1_26/api/networking/v1/network_policy_ingress_rule.rs index 2c68ec44a7..517765f800 100644 --- a/src/v1_26/api/networking/v1/network_policy_ingress_rule.rs +++ b/src/v1_26/api/networking/v1/network_policy_ingress_rule.rs @@ -12,8 +12,8 @@ pub struct NetworkPolicyIngressRule { impl crate::DeepMerge for NetworkPolicyIngressRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.from, other.from); - crate::DeepMerge::merge_from(&mut self.ports, other.ports); + crate::merge_strategies::list::atomic(&mut self.from, other.from); + crate::merge_strategies::list::atomic(&mut self.ports, other.ports); } } diff --git a/src/v1_26/api/networking/v1/network_policy_spec.rs b/src/v1_26/api/networking/v1/network_policy_spec.rs index ed61b60968..bc980e7469 100644 --- a/src/v1_26/api/networking/v1/network_policy_spec.rs +++ b/src/v1_26/api/networking/v1/network_policy_spec.rs @@ -18,10 +18,10 @@ pub struct NetworkPolicySpec { impl crate::DeepMerge for NetworkPolicySpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.egress, other.egress); - crate::DeepMerge::merge_from(&mut self.ingress, other.ingress); + crate::merge_strategies::list::atomic(&mut self.egress, other.egress); + crate::merge_strategies::list::atomic(&mut self.ingress, other.ingress); crate::DeepMerge::merge_from(&mut self.pod_selector, other.pod_selector); - crate::DeepMerge::merge_from(&mut self.policy_types, other.policy_types); + crate::merge_strategies::list::atomic(&mut self.policy_types, other.policy_types); } } diff --git a/src/v1_26/api/networking/v1/network_policy_status.rs b/src/v1_26/api/networking/v1/network_policy_status.rs index 379f560ac3..55e4312614 100644 --- a/src/v1_26/api/networking/v1/network_policy_status.rs +++ b/src/v1_26/api/networking/v1/network_policy_status.rs @@ -9,7 +9,14 @@ pub struct NetworkPolicyStatus { impl crate::DeepMerge for NetworkPolicyStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_26/api/node/v1/overhead.rs b/src/v1_26/api/node/v1/overhead.rs index ef68cae1c1..2db70b80c4 100644 --- a/src/v1_26/api/node/v1/overhead.rs +++ b/src/v1_26/api/node/v1/overhead.rs @@ -9,7 +9,9 @@ pub struct Overhead { impl crate::DeepMerge for Overhead { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.pod_fixed, other.pod_fixed); + crate::merge_strategies::map::granular(&mut self.pod_fixed, other.pod_fixed, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); } } diff --git a/src/v1_26/api/node/v1/scheduling.rs b/src/v1_26/api/node/v1/scheduling.rs index 1c2b8a05c5..79508f62c2 100644 --- a/src/v1_26/api/node/v1/scheduling.rs +++ b/src/v1_26/api/node/v1/scheduling.rs @@ -12,8 +12,8 @@ pub struct Scheduling { impl crate::DeepMerge for Scheduling { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.node_selector, other.node_selector); - crate::DeepMerge::merge_from(&mut self.tolerations, other.tolerations); + crate::merge_strategies::map::atomic(&mut self.node_selector, other.node_selector); + crate::merge_strategies::list::atomic(&mut self.tolerations, other.tolerations); } } diff --git a/src/v1_26/api/policy/v1/pod_disruption_budget_status.rs b/src/v1_26/api/policy/v1/pod_disruption_budget_status.rs index f4aa41a86e..cf8b02d00f 100644 --- a/src/v1_26/api/policy/v1/pod_disruption_budget_status.rs +++ b/src/v1_26/api/policy/v1/pod_disruption_budget_status.rs @@ -35,10 +35,19 @@ pub struct PodDisruptionBudgetStatus { impl crate::DeepMerge for PodDisruptionBudgetStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.current_healthy, other.current_healthy); crate::DeepMerge::merge_from(&mut self.desired_healthy, other.desired_healthy); - crate::DeepMerge::merge_from(&mut self.disrupted_pods, other.disrupted_pods); + crate::merge_strategies::map::granular(&mut self.disrupted_pods, other.disrupted_pods, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.disruptions_allowed, other.disruptions_allowed); crate::DeepMerge::merge_from(&mut self.expected_pods, other.expected_pods); crate::DeepMerge::merge_from(&mut self.observed_generation, other.observed_generation); diff --git a/src/v1_26/api/rbac/v1/aggregation_rule.rs b/src/v1_26/api/rbac/v1/aggregation_rule.rs index 5ccc4984f6..b20ce61705 100644 --- a/src/v1_26/api/rbac/v1/aggregation_rule.rs +++ b/src/v1_26/api/rbac/v1/aggregation_rule.rs @@ -9,7 +9,7 @@ pub struct AggregationRule { impl crate::DeepMerge for AggregationRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.cluster_role_selectors, other.cluster_role_selectors); + crate::merge_strategies::list::atomic(&mut self.cluster_role_selectors, other.cluster_role_selectors); } } diff --git a/src/v1_26/api/rbac/v1/cluster_role.rs b/src/v1_26/api/rbac/v1/cluster_role.rs index 8336e14c92..a6f832b593 100644 --- a/src/v1_26/api/rbac/v1/cluster_role.rs +++ b/src/v1_26/api/rbac/v1/cluster_role.rs @@ -378,7 +378,7 @@ impl crate::DeepMerge for ClusterRole { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.aggregation_rule, other.aggregation_rule); crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.rules, other.rules); + crate::merge_strategies::list::atomic(&mut self.rules, other.rules); } } 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..04fa2bd714 100644 --- a/src/v1_26/api/rbac/v1/cluster_role_binding.rs +++ b/src/v1_26/api/rbac/v1/cluster_role_binding.rs @@ -378,7 +378,7 @@ impl crate::DeepMerge for ClusterRoleBinding { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); crate::DeepMerge::merge_from(&mut self.role_ref, other.role_ref); - crate::DeepMerge::merge_from(&mut self.subjects, other.subjects); + crate::merge_strategies::list::atomic(&mut self.subjects, other.subjects); } } diff --git a/src/v1_26/api/rbac/v1/policy_rule.rs b/src/v1_26/api/rbac/v1/policy_rule.rs index 486e987c66..3102e5bc6b 100644 --- a/src/v1_26/api/rbac/v1/policy_rule.rs +++ b/src/v1_26/api/rbac/v1/policy_rule.rs @@ -21,11 +21,11 @@ pub struct PolicyRule { impl crate::DeepMerge for PolicyRule { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.api_groups, other.api_groups); - crate::DeepMerge::merge_from(&mut self.non_resource_urls, other.non_resource_urls); - crate::DeepMerge::merge_from(&mut self.resource_names, other.resource_names); - crate::DeepMerge::merge_from(&mut self.resources, other.resources); - crate::DeepMerge::merge_from(&mut self.verbs, other.verbs); + crate::merge_strategies::list::atomic(&mut self.api_groups, other.api_groups); + crate::merge_strategies::list::atomic(&mut self.non_resource_urls, other.non_resource_urls); + crate::merge_strategies::list::atomic(&mut self.resource_names, other.resource_names); + crate::merge_strategies::list::atomic(&mut self.resources, other.resources); + crate::merge_strategies::list::atomic(&mut self.verbs, other.verbs); } } diff --git a/src/v1_26/api/rbac/v1/role.rs b/src/v1_26/api/rbac/v1/role.rs index 9764bc7aa0..719ecb92b0 100644 --- a/src/v1_26/api/rbac/v1/role.rs +++ b/src/v1_26/api/rbac/v1/role.rs @@ -490,7 +490,7 @@ impl crate::Metadata for Role { impl crate::DeepMerge for Role { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.rules, other.rules); + crate::merge_strategies::list::atomic(&mut self.rules, other.rules); } } diff --git a/src/v1_26/api/rbac/v1/role_binding.rs b/src/v1_26/api/rbac/v1/role_binding.rs index ac11e857c2..7b9059076a 100644 --- a/src/v1_26/api/rbac/v1/role_binding.rs +++ b/src/v1_26/api/rbac/v1/role_binding.rs @@ -494,7 +494,7 @@ impl crate::DeepMerge for RoleBinding { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); crate::DeepMerge::merge_from(&mut self.role_ref, other.role_ref); - crate::DeepMerge::merge_from(&mut self.subjects, other.subjects); + crate::merge_strategies::list::atomic(&mut self.subjects, other.subjects); } } diff --git a/src/v1_26/api/resource/v1alpha1/pod_scheduling_spec.rs b/src/v1_26/api/resource/v1alpha1/pod_scheduling_spec.rs index 1ee210b325..739116fa54 100644 --- a/src/v1_26/api/resource/v1alpha1/pod_scheduling_spec.rs +++ b/src/v1_26/api/resource/v1alpha1/pod_scheduling_spec.rs @@ -14,7 +14,7 @@ pub struct PodSchedulingSpec { impl crate::DeepMerge for PodSchedulingSpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.potential_nodes, other.potential_nodes); + crate::merge_strategies::list::set(&mut self.potential_nodes, other.potential_nodes); crate::DeepMerge::merge_from(&mut self.selected_node, other.selected_node); } } diff --git a/src/v1_26/api/resource/v1alpha1/pod_scheduling_status.rs b/src/v1_26/api/resource/v1alpha1/pod_scheduling_status.rs index ae7a6f927d..fb558d639f 100644 --- a/src/v1_26/api/resource/v1alpha1/pod_scheduling_status.rs +++ b/src/v1_26/api/resource/v1alpha1/pod_scheduling_status.rs @@ -9,7 +9,14 @@ pub struct PodSchedulingStatus { impl crate::DeepMerge for PodSchedulingStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.resource_claims, other.resource_claims); + crate::merge_strategies::list::map( + &mut self.resource_claims, + other.resource_claims, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_26/api/resource/v1alpha1/resource_claim_scheduling_status.rs b/src/v1_26/api/resource/v1alpha1/resource_claim_scheduling_status.rs index c6b7016861..034a60e1e7 100644 --- a/src/v1_26/api/resource/v1alpha1/resource_claim_scheduling_status.rs +++ b/src/v1_26/api/resource/v1alpha1/resource_claim_scheduling_status.rs @@ -15,7 +15,7 @@ pub struct ResourceClaimSchedulingStatus { impl crate::DeepMerge for ResourceClaimSchedulingStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.name, other.name); - crate::DeepMerge::merge_from(&mut self.unsuitable_nodes, other.unsuitable_nodes); + crate::merge_strategies::list::set(&mut self.unsuitable_nodes, other.unsuitable_nodes); } } diff --git a/src/v1_26/api/resource/v1alpha1/resource_claim_status.rs b/src/v1_26/api/resource/v1alpha1/resource_claim_status.rs index 684aff1862..1d0cb41bcf 100644 --- a/src/v1_26/api/resource/v1alpha1/resource_claim_status.rs +++ b/src/v1_26/api/resource/v1alpha1/resource_claim_status.rs @@ -27,7 +27,14 @@ impl crate::DeepMerge for ResourceClaimStatus { crate::DeepMerge::merge_from(&mut self.allocation, other.allocation); crate::DeepMerge::merge_from(&mut self.deallocation_requested, other.deallocation_requested); crate::DeepMerge::merge_from(&mut self.driver_name, other.driver_name); - crate::DeepMerge::merge_from(&mut self.reserved_for, other.reserved_for); + crate::merge_strategies::list::map( + &mut self.reserved_for, + other.reserved_for, + &[|lhs, rhs| lhs.uid == rhs.uid], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_26/api/storage/v1/csi_driver_spec.rs b/src/v1_26/api/storage/v1/csi_driver_spec.rs index e3b4955632..43d03e43de 100644 --- a/src/v1_26/api/storage/v1/csi_driver_spec.rs +++ b/src/v1_26/api/storage/v1/csi_driver_spec.rs @@ -71,8 +71,8 @@ impl crate::DeepMerge for CSIDriverSpec { crate::DeepMerge::merge_from(&mut self.requires_republish, other.requires_republish); crate::DeepMerge::merge_from(&mut self.se_linux_mount, other.se_linux_mount); crate::DeepMerge::merge_from(&mut self.storage_capacity, other.storage_capacity); - crate::DeepMerge::merge_from(&mut self.token_requests, other.token_requests); - crate::DeepMerge::merge_from(&mut self.volume_lifecycle_modes, other.volume_lifecycle_modes); + crate::merge_strategies::list::atomic(&mut self.token_requests, other.token_requests); + crate::merge_strategies::list::set(&mut self.volume_lifecycle_modes, other.volume_lifecycle_modes); } } diff --git a/src/v1_26/api/storage/v1/csi_node_driver.rs b/src/v1_26/api/storage/v1/csi_node_driver.rs index c113299390..d8b79d89f3 100644 --- a/src/v1_26/api/storage/v1/csi_node_driver.rs +++ b/src/v1_26/api/storage/v1/csi_node_driver.rs @@ -21,7 +21,7 @@ impl crate::DeepMerge for CSINodeDriver { crate::DeepMerge::merge_from(&mut self.allocatable, other.allocatable); crate::DeepMerge::merge_from(&mut self.name, other.name); crate::DeepMerge::merge_from(&mut self.node_id, other.node_id); - crate::DeepMerge::merge_from(&mut self.topology_keys, other.topology_keys); + crate::merge_strategies::list::atomic(&mut self.topology_keys, other.topology_keys); } } diff --git a/src/v1_26/api/storage/v1/csi_node_spec.rs b/src/v1_26/api/storage/v1/csi_node_spec.rs index ea2a1ddb97..4717576df8 100644 --- a/src/v1_26/api/storage/v1/csi_node_spec.rs +++ b/src/v1_26/api/storage/v1/csi_node_spec.rs @@ -9,7 +9,14 @@ pub struct CSINodeSpec { impl crate::DeepMerge for CSINodeSpec { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.drivers, other.drivers); + crate::merge_strategies::list::map( + &mut self.drivers, + other.drivers, + &[|lhs, rhs| lhs.name == rhs.name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_26/api/storage/v1/storage_class.rs b/src/v1_26/api/storage/v1/storage_class.rs index 2bf8e65456..12774ba320 100644 --- a/src/v1_26/api/storage/v1/storage_class.rs +++ b/src/v1_26/api/storage/v1/storage_class.rs @@ -394,10 +394,12 @@ impl crate::Metadata for StorageClass { impl crate::DeepMerge for StorageClass { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.allow_volume_expansion, other.allow_volume_expansion); - crate::DeepMerge::merge_from(&mut self.allowed_topologies, other.allowed_topologies); + crate::merge_strategies::list::atomic(&mut self.allowed_topologies, other.allowed_topologies); crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); - crate::DeepMerge::merge_from(&mut self.mount_options, other.mount_options); - crate::DeepMerge::merge_from(&mut self.parameters, other.parameters); + crate::merge_strategies::list::atomic(&mut self.mount_options, other.mount_options); + crate::merge_strategies::map::granular(&mut self.parameters, other.parameters, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.provisioner, other.provisioner); crate::DeepMerge::merge_from(&mut self.reclaim_policy, other.reclaim_policy); crate::DeepMerge::merge_from(&mut self.volume_binding_mode, other.volume_binding_mode); diff --git a/src/v1_26/api/storage/v1/volume_attachment_status.rs b/src/v1_26/api/storage/v1/volume_attachment_status.rs index fb8e63d745..bb6ba3fe42 100644 --- a/src/v1_26/api/storage/v1/volume_attachment_status.rs +++ b/src/v1_26/api/storage/v1/volume_attachment_status.rs @@ -20,7 +20,9 @@ impl crate::DeepMerge for VolumeAttachmentStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.attach_error, other.attach_error); crate::DeepMerge::merge_from(&mut self.attached, other.attached); - crate::DeepMerge::merge_from(&mut self.attachment_metadata, other.attachment_metadata); + crate::merge_strategies::map::granular(&mut self.attachment_metadata, other.attachment_metadata, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.detach_error, other.detach_error); } } diff --git a/src/v1_26/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_names.rs b/src/v1_26/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_names.rs index f3a8d38696..d105542807 100644 --- a/src/v1_26/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_names.rs +++ b/src/v1_26/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_names.rs @@ -24,11 +24,11 @@ pub struct CustomResourceDefinitionNames { impl crate::DeepMerge for CustomResourceDefinitionNames { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.categories, other.categories); + crate::merge_strategies::list::atomic(&mut self.categories, other.categories); crate::DeepMerge::merge_from(&mut self.kind, other.kind); crate::DeepMerge::merge_from(&mut self.list_kind, other.list_kind); crate::DeepMerge::merge_from(&mut self.plural, other.plural); - crate::DeepMerge::merge_from(&mut self.short_names, other.short_names); + crate::merge_strategies::list::atomic(&mut self.short_names, other.short_names); crate::DeepMerge::merge_from(&mut self.singular, other.singular); } } diff --git a/src/v1_26/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_spec.rs b/src/v1_26/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_spec.rs index 09d74d527e..f5a925cd0b 100644 --- a/src/v1_26/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_spec.rs +++ b/src/v1_26/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_spec.rs @@ -29,7 +29,7 @@ impl crate::DeepMerge for CustomResourceDefinitionSpec { crate::DeepMerge::merge_from(&mut self.names, other.names); crate::DeepMerge::merge_from(&mut self.preserve_unknown_fields, other.preserve_unknown_fields); crate::DeepMerge::merge_from(&mut self.scope, other.scope); - crate::DeepMerge::merge_from(&mut self.versions, other.versions); + crate::merge_strategies::list::atomic(&mut self.versions, other.versions); } } diff --git a/src/v1_26/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_status.rs b/src/v1_26/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_status.rs index a7427347aa..d080a301dc 100644 --- a/src/v1_26/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_status.rs +++ b/src/v1_26/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_status.rs @@ -16,8 +16,15 @@ pub struct CustomResourceDefinitionStatus { impl crate::DeepMerge for CustomResourceDefinitionStatus { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.accepted_names, other.accepted_names); - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); - crate::DeepMerge::merge_from(&mut self.stored_versions, other.stored_versions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); + crate::merge_strategies::list::atomic(&mut self.stored_versions, other.stored_versions); } } diff --git a/src/v1_26/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_version.rs b/src/v1_26/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_version.rs index 5b4d51a697..90a9bb5e32 100644 --- a/src/v1_26/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_version.rs +++ b/src/v1_26/apiextensions_apiserver/pkg/apis/apiextensions/v1/custom_resource_definition_version.rs @@ -30,7 +30,7 @@ pub struct CustomResourceDefinitionVersion { impl crate::DeepMerge for CustomResourceDefinitionVersion { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.additional_printer_columns, other.additional_printer_columns); + crate::merge_strategies::list::atomic(&mut self.additional_printer_columns, other.additional_printer_columns); crate::DeepMerge::merge_from(&mut self.deprecated, other.deprecated); crate::DeepMerge::merge_from(&mut self.deprecation_warning, other.deprecation_warning); crate::DeepMerge::merge_from(&mut self.name, other.name); diff --git a/src/v1_26/apiextensions_apiserver/pkg/apis/apiextensions/v1/json_schema_props.rs b/src/v1_26/apiextensions_apiserver/pkg/apis/apiextensions/v1/json_schema_props.rs index 3c8b45d0b0..a871ebe8a6 100644 --- a/src/v1_26/apiextensions_apiserver/pkg/apis/apiextensions/v1/json_schema_props.rs +++ b/src/v1_26/apiextensions_apiserver/pkg/apis/apiextensions/v1/json_schema_props.rs @@ -142,13 +142,17 @@ impl crate::DeepMerge for JSONSchemaProps { crate::DeepMerge::merge_from(&mut self.schema, other.schema); crate::DeepMerge::merge_from(&mut self.additional_items, other.additional_items); crate::DeepMerge::merge_from(&mut self.additional_properties, other.additional_properties); - crate::DeepMerge::merge_from(&mut self.all_of, other.all_of); - crate::DeepMerge::merge_from(&mut self.any_of, other.any_of); + crate::merge_strategies::list::atomic(&mut self.all_of, other.all_of); + crate::merge_strategies::list::atomic(&mut self.any_of, other.any_of); crate::DeepMerge::merge_from(&mut self.default, other.default); - crate::DeepMerge::merge_from(&mut self.definitions, other.definitions); - crate::DeepMerge::merge_from(&mut self.dependencies, other.dependencies); + crate::merge_strategies::map::granular(&mut self.definitions, other.definitions, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.dependencies, other.dependencies, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); crate::DeepMerge::merge_from(&mut self.description, other.description); - crate::DeepMerge::merge_from(&mut self.enum_, other.enum_); + crate::merge_strategies::list::atomic(&mut self.enum_, other.enum_); crate::DeepMerge::merge_from(&mut self.example, other.example); crate::DeepMerge::merge_from(&mut self.exclusive_maximum, other.exclusive_maximum); crate::DeepMerge::merge_from(&mut self.exclusive_minimum, other.exclusive_minimum); @@ -167,21 +171,32 @@ impl crate::DeepMerge for JSONSchemaProps { crate::DeepMerge::merge_from(&mut self.multiple_of, other.multiple_of); crate::DeepMerge::merge_from(&mut self.not, other.not); crate::DeepMerge::merge_from(&mut self.nullable, other.nullable); - crate::DeepMerge::merge_from(&mut self.one_of, other.one_of); + crate::merge_strategies::list::atomic(&mut self.one_of, other.one_of); crate::DeepMerge::merge_from(&mut self.pattern, other.pattern); - crate::DeepMerge::merge_from(&mut self.pattern_properties, other.pattern_properties); - crate::DeepMerge::merge_from(&mut self.properties, other.properties); - crate::DeepMerge::merge_from(&mut self.required, other.required); + crate::merge_strategies::map::granular(&mut self.pattern_properties, other.pattern_properties, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::map::granular(&mut self.properties, other.properties, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::list::atomic(&mut self.required, other.required); crate::DeepMerge::merge_from(&mut self.title, other.title); crate::DeepMerge::merge_from(&mut self.type_, other.type_); crate::DeepMerge::merge_from(&mut self.unique_items, other.unique_items); crate::DeepMerge::merge_from(&mut self.x_kubernetes_embedded_resource, other.x_kubernetes_embedded_resource); crate::DeepMerge::merge_from(&mut self.x_kubernetes_int_or_string, other.x_kubernetes_int_or_string); - crate::DeepMerge::merge_from(&mut self.x_kubernetes_list_map_keys, other.x_kubernetes_list_map_keys); + crate::merge_strategies::list::atomic(&mut self.x_kubernetes_list_map_keys, other.x_kubernetes_list_map_keys); crate::DeepMerge::merge_from(&mut self.x_kubernetes_list_type, other.x_kubernetes_list_type); crate::DeepMerge::merge_from(&mut self.x_kubernetes_map_type, other.x_kubernetes_map_type); crate::DeepMerge::merge_from(&mut self.x_kubernetes_preserve_unknown_fields, other.x_kubernetes_preserve_unknown_fields); - crate::DeepMerge::merge_from(&mut self.x_kubernetes_validations, other.x_kubernetes_validations); + crate::merge_strategies::list::map( + &mut self.x_kubernetes_validations, + other.x_kubernetes_validations, + &[|lhs, rhs| lhs.rule == rhs.rule], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_26/apiextensions_apiserver/pkg/apis/apiextensions/v1/webhook_conversion.rs b/src/v1_26/apiextensions_apiserver/pkg/apis/apiextensions/v1/webhook_conversion.rs index aec75dfd39..69008b2dca 100644 --- a/src/v1_26/apiextensions_apiserver/pkg/apis/apiextensions/v1/webhook_conversion.rs +++ b/src/v1_26/apiextensions_apiserver/pkg/apis/apiextensions/v1/webhook_conversion.rs @@ -13,7 +13,7 @@ pub struct WebhookConversion { impl crate::DeepMerge for WebhookConversion { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.client_config, other.client_config); - crate::DeepMerge::merge_from(&mut self.conversion_review_versions, other.conversion_review_versions); + crate::merge_strategies::list::atomic(&mut self.conversion_review_versions, other.conversion_review_versions); } } diff --git a/src/v1_26/apimachinery/pkg/apis/meta/v1/api_group.rs b/src/v1_26/apimachinery/pkg/apis/meta/v1/api_group.rs index 3d36440e87..f83318ab08 100644 --- a/src/v1_26/apimachinery/pkg/apis/meta/v1/api_group.rs +++ b/src/v1_26/apimachinery/pkg/apis/meta/v1/api_group.rs @@ -29,8 +29,8 @@ impl crate::DeepMerge for APIGroup { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.name, other.name); crate::DeepMerge::merge_from(&mut self.preferred_version, other.preferred_version); - crate::DeepMerge::merge_from(&mut self.server_address_by_client_cidrs, other.server_address_by_client_cidrs); - crate::DeepMerge::merge_from(&mut self.versions, other.versions); + crate::merge_strategies::list::atomic(&mut self.server_address_by_client_cidrs, other.server_address_by_client_cidrs); + crate::merge_strategies::list::atomic(&mut self.versions, other.versions); } } diff --git a/src/v1_26/apimachinery/pkg/apis/meta/v1/api_group_list.rs b/src/v1_26/apimachinery/pkg/apis/meta/v1/api_group_list.rs index 167aeeabe0..e8a5d7e747 100644 --- a/src/v1_26/apimachinery/pkg/apis/meta/v1/api_group_list.rs +++ b/src/v1_26/apimachinery/pkg/apis/meta/v1/api_group_list.rs @@ -18,7 +18,7 @@ impl crate::Resource for APIGroupList { impl crate::DeepMerge for APIGroupList { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.groups, other.groups); + crate::merge_strategies::list::atomic(&mut self.groups, other.groups); } } diff --git a/src/v1_26/apimachinery/pkg/apis/meta/v1/api_resource.rs b/src/v1_26/apimachinery/pkg/apis/meta/v1/api_resource.rs index e679e8aa73..477c5ad98d 100644 --- a/src/v1_26/apimachinery/pkg/apis/meta/v1/api_resource.rs +++ b/src/v1_26/apimachinery/pkg/apis/meta/v1/api_resource.rs @@ -36,15 +36,15 @@ pub struct APIResource { impl crate::DeepMerge for APIResource { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.categories, other.categories); + crate::merge_strategies::list::atomic(&mut self.categories, other.categories); crate::DeepMerge::merge_from(&mut self.group, other.group); crate::DeepMerge::merge_from(&mut self.kind, other.kind); crate::DeepMerge::merge_from(&mut self.name, other.name); crate::DeepMerge::merge_from(&mut self.namespaced, other.namespaced); - crate::DeepMerge::merge_from(&mut self.short_names, other.short_names); + crate::merge_strategies::list::atomic(&mut self.short_names, other.short_names); crate::DeepMerge::merge_from(&mut self.singular_name, other.singular_name); crate::DeepMerge::merge_from(&mut self.storage_version_hash, other.storage_version_hash); - crate::DeepMerge::merge_from(&mut self.verbs, other.verbs); + crate::merge_strategies::list::atomic(&mut self.verbs, other.verbs); crate::DeepMerge::merge_from(&mut self.version, other.version); } } diff --git a/src/v1_26/apimachinery/pkg/apis/meta/v1/api_resource_list.rs b/src/v1_26/apimachinery/pkg/apis/meta/v1/api_resource_list.rs index a34ba733a3..4107b4f488 100644 --- a/src/v1_26/apimachinery/pkg/apis/meta/v1/api_resource_list.rs +++ b/src/v1_26/apimachinery/pkg/apis/meta/v1/api_resource_list.rs @@ -22,7 +22,7 @@ impl crate::Resource for APIResourceList { impl crate::DeepMerge for APIResourceList { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.group_version, other.group_version); - crate::DeepMerge::merge_from(&mut self.resources, other.resources); + crate::merge_strategies::list::atomic(&mut self.resources, other.resources); } } diff --git a/src/v1_26/apimachinery/pkg/apis/meta/v1/api_versions.rs b/src/v1_26/apimachinery/pkg/apis/meta/v1/api_versions.rs index a2d355ee8d..eda4a89785 100644 --- a/src/v1_26/apimachinery/pkg/apis/meta/v1/api_versions.rs +++ b/src/v1_26/apimachinery/pkg/apis/meta/v1/api_versions.rs @@ -21,8 +21,8 @@ impl crate::Resource for APIVersions { impl crate::DeepMerge for APIVersions { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.server_address_by_client_cidrs, other.server_address_by_client_cidrs); - crate::DeepMerge::merge_from(&mut self.versions, other.versions); + crate::merge_strategies::list::atomic(&mut self.server_address_by_client_cidrs, other.server_address_by_client_cidrs); + crate::merge_strategies::list::atomic(&mut self.versions, other.versions); } } diff --git a/src/v1_26/apimachinery/pkg/apis/meta/v1/delete_options.rs b/src/v1_26/apimachinery/pkg/apis/meta/v1/delete_options.rs index 04abc8215b..4ac6d24fb9 100644 --- a/src/v1_26/apimachinery/pkg/apis/meta/v1/delete_options.rs +++ b/src/v1_26/apimachinery/pkg/apis/meta/v1/delete_options.rs @@ -28,7 +28,7 @@ pub struct DeleteOptions { impl crate::DeepMerge for DeleteOptions { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.api_version, other.api_version); - crate::DeepMerge::merge_from(&mut self.dry_run, other.dry_run); + crate::merge_strategies::list::atomic(&mut self.dry_run, other.dry_run); crate::DeepMerge::merge_from(&mut self.grace_period_seconds, other.grace_period_seconds); crate::DeepMerge::merge_from(&mut self.kind, other.kind); crate::DeepMerge::merge_from(&mut self.orphan_dependents, other.orphan_dependents); diff --git a/src/v1_26/apimachinery/pkg/apis/meta/v1/label_selector.rs b/src/v1_26/apimachinery/pkg/apis/meta/v1/label_selector.rs index 877caad4dd..19028abb99 100644 --- a/src/v1_26/apimachinery/pkg/apis/meta/v1/label_selector.rs +++ b/src/v1_26/apimachinery/pkg/apis/meta/v1/label_selector.rs @@ -12,8 +12,10 @@ pub struct LabelSelector { impl crate::DeepMerge for LabelSelector { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.match_expressions, other.match_expressions); - crate::DeepMerge::merge_from(&mut self.match_labels, other.match_labels); + crate::merge_strategies::list::atomic(&mut self.match_expressions, other.match_expressions); + crate::merge_strategies::map::granular(&mut self.match_labels, other.match_labels, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); } } diff --git a/src/v1_26/apimachinery/pkg/apis/meta/v1/label_selector_requirement.rs b/src/v1_26/apimachinery/pkg/apis/meta/v1/label_selector_requirement.rs index 6570daea42..09c7dc7cc7 100644 --- a/src/v1_26/apimachinery/pkg/apis/meta/v1/label_selector_requirement.rs +++ b/src/v1_26/apimachinery/pkg/apis/meta/v1/label_selector_requirement.rs @@ -17,7 +17,7 @@ impl crate::DeepMerge for LabelSelectorRequirement { fn merge_from(&mut self, other: Self) { crate::DeepMerge::merge_from(&mut self.key, other.key); crate::DeepMerge::merge_from(&mut self.operator, other.operator); - crate::DeepMerge::merge_from(&mut self.values, other.values); + crate::merge_strategies::list::atomic(&mut self.values, other.values); } } 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..9f7788cb2e 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 @@ -65,18 +65,29 @@ pub struct ObjectMeta { impl crate::DeepMerge for ObjectMeta { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.annotations, other.annotations); + crate::merge_strategies::map::granular(&mut self.annotations, other.annotations, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); 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::merge_strategies::list::set(&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::merge_strategies::map::granular(&mut self.labels, other.labels, |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }); + crate::merge_strategies::list::atomic(&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::merge_strategies::list::map( + &mut self.owner_references, + other.owner_references, + &[|lhs, rhs| lhs.uid == rhs.uid], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); 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); diff --git a/src/v1_26/apimachinery/pkg/apis/meta/v1/status_details.rs b/src/v1_26/apimachinery/pkg/apis/meta/v1/status_details.rs index 183b525d2c..28141f7f6f 100644 --- a/src/v1_26/apimachinery/pkg/apis/meta/v1/status_details.rs +++ b/src/v1_26/apimachinery/pkg/apis/meta/v1/status_details.rs @@ -24,7 +24,7 @@ pub struct StatusDetails { impl crate::DeepMerge for StatusDetails { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.causes, other.causes); + crate::merge_strategies::list::atomic(&mut self.causes, other.causes); crate::DeepMerge::merge_from(&mut self.group, other.group); crate::DeepMerge::merge_from(&mut self.kind, other.kind); crate::DeepMerge::merge_from(&mut self.name, other.name); diff --git a/src/v1_26/kube_aggregator/pkg/apis/apiregistration/v1/api_service_status.rs b/src/v1_26/kube_aggregator/pkg/apis/apiregistration/v1/api_service_status.rs index 658b6ca9ce..72a107b6ba 100644 --- a/src/v1_26/kube_aggregator/pkg/apis/apiregistration/v1/api_service_status.rs +++ b/src/v1_26/kube_aggregator/pkg/apis/apiregistration/v1/api_service_status.rs @@ -9,7 +9,14 @@ pub struct APIServiceStatus { impl crate::DeepMerge for APIServiceStatus { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.conditions, other.conditions); + crate::merge_strategies::list::map( + &mut self.conditions, + other.conditions, + &[|lhs, rhs| lhs.type_ == rhs.type_], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); } } diff --git a/src/v1_26/list.rs b/src/v1_26/list.rs index cc10bf672f..9863ef1855 100644 --- a/src/v1_26/list.rs +++ b/src/v1_26/list.rs @@ -31,9 +31,16 @@ impl crate::Metadata for List where T: crate::ListableResource { } } -impl crate::DeepMerge for List where T: crate::ListableResource { +impl crate::DeepMerge for List where T: crate::DeepMerge + crate::Metadata + crate::ListableResource { fn merge_from(&mut self, other: Self) { - crate::DeepMerge::merge_from(&mut self.items, other.items); + crate::merge_strategies::list::map( + &mut self.items, + other.items, + &[|lhs, rhs| lhs.metadata().namespace == rhs.metadata().namespace, |lhs, rhs| lhs.metadata().name == rhs.metadata().name], + |current_item, other_item| { + crate::DeepMerge::merge_from(current_item, other_item); + }, + ); crate::DeepMerge::merge_from(&mut self.metadata, other.metadata); } }