Branch: refs/heads/master
Home:
https://github.com/Checkmk/checkmk
Commit: 4397aa54403fc3e442e53eb1da18326b70e66f8d
https://github.com/Checkmk/checkmk/commit/4397aa54403fc3e442e53eb1da18326b7…
Author: Christoph Rauch <christoph.rauch(a)checkmk.com>
Date: 2023-09-21 (Thu, 21 Sep 2023)
Changed paths:
M Pipfile
M Pipfile.lock
M agent-receiver/agent_receiver/models.py
M agent-receiver/setup.py
M cmk/base/plugins/agent_based/aws_status.py
M cmk/base/plugins/agent_based/gcp_cost.py
M cmk/base/plugins/agent_based/graylog_failures.py
M cmk/base/plugins/agent_based/kube_node_conditions.py
M cmk/base/plugins/agent_based/utils/azure.py
M cmk/base/plugins/agent_based/utils/azure_app_gateway.py
M cmk/base/plugins/agent_based/utils/checkmk.py
M cmk/base/plugins/agent_based/utils/esx_vsphere.py
M cmk/base/plugins/agent_based/utils/kube.py
M cmk/base/plugins/agent_based/utils/robotmk_api.py
M cmk/gui/key_mgmt.py
M cmk/gui/plugins/wato/special_agents/kube.py
M cmk/special_agents/agent_aws.py
M cmk/special_agents/agent_datadog.py
M cmk/special_agents/agent_kube.py
M cmk/special_agents/utils_kubernetes/agent_handlers/cluster_handler.py
M cmk/special_agents/utils_kubernetes/agent_handlers/common.py
M cmk/special_agents/utils_kubernetes/agent_handlers/namespace_handler.py
M cmk/special_agents/utils_kubernetes/agent_handlers/node_handler.py
M
cmk/special_agents/utils_kubernetes/agent_handlers/persistent_volume_claim_handler.py
M cmk/special_agents/utils_kubernetes/performance.py
M cmk/special_agents/utils_kubernetes/prometheus_api.py
M cmk/special_agents/utils_kubernetes/query.py
M cmk/special_agents/utils_kubernetes/schemata/api.py
M cmk/special_agents/utils_kubernetes/schemata/section.py
M cmk/special_agents/utils_kubernetes/transform.py
M cmk/special_agents/utils_kubernetes/transform_any.py
M cmk/utils/backup/job.py
M cmk/utils/packaging/_mkp.py
M cmk/utils/packaging/_type_defs.py
M cmk/utils/prediction/_prediction.py
M cmk/utils/store/_file.py
M cmk/utils/user.py
M cmk/utils/werks/__init__.py
M cmk/utils/werks/werk.py
M cmk/utils/werks/werkv1.py
M cmk/utils/werks/werkv2.py
M tests/integration/cmk/base/test_services_prediction.py
M tests/unit/agent_receiver/conftest.py
M tests/unit/cmk/base/plugins/agent_based/esx_vsphere_vm_util.py
M tests/unit/cmk/base/plugins/agent_based/test_aws_status.py
M tests/unit/cmk/base/plugins/agent_based/test_esx_vsphere_vm_cpu.py
M tests/unit/cmk/base/plugins/agent_based/test_esx_vsphere_vm_datastores.py
M tests/unit/cmk/base/plugins/agent_based/test_esx_vsphere_vm_heartbeat.py
M tests/unit/cmk/base/plugins/agent_based/test_gcp_status.py
M tests/unit/cmk/base/plugins/agent_based/test_inventory_kube_cronjob.py
M tests/unit/cmk/base/plugins/agent_based/test_inventory_kube_daemonset.py
M tests/unit/cmk/base/plugins/agent_based/test_inventory_kube_deployment.py
M tests/unit/cmk/base/plugins/agent_based/test_inventory_kube_node.py
M tests/unit/cmk/base/plugins/agent_based/test_inventory_kube_pod.py
M tests/unit/cmk/base/plugins/agent_based/test_inventory_kube_statefulset.py
M tests/unit/cmk/base/plugins/agent_based/test_kube_collector_info.py
M tests/unit/cmk/base/plugins/agent_based/test_kube_cpu.py
M tests/unit/cmk/base/plugins/agent_based/test_kube_cronjob_status.py
M tests/unit/cmk/base/plugins/agent_based/test_kube_node_conditions.py
M tests/unit/cmk/base/plugins/agent_based/test_kube_node_count.py
M tests/unit/cmk/base/plugins/agent_based/test_kube_persistent_volume_claim.py
M tests/unit/cmk/base/plugins/agent_based/test_kube_pod_conditions.py
M tests/unit/cmk/base/plugins/agent_based/test_kube_pod_containers.py
M tests/unit/cmk/base/plugins/agent_based/test_kube_pod_resources.py
M tests/unit/cmk/base/plugins/agent_based/test_kube_resource_quota_cpu.py
M tests/unit/cmk/base/plugins/agent_based/test_kube_resource_quota_memory.py
M tests/unit/cmk/base/plugins/agent_based/test_openshift_queries.py
M tests/unit/cmk/base/plugins/agent_based/utils/test_kube_resources.py
M tests/unit/cmk/base/test_prediction.py
M tests/unit/cmk/special_agents/agent_kube/factory.py
M tests/unit/cmk/special_agents/agent_kube/test_agent_kube_api.py
M tests/unit/cmk/special_agents/agent_kube/test_agent_kube_api_server.py
M tests/unit/cmk/special_agents/agent_kube/test_agent_kube_metadata.py
M tests/unit/cmk/special_agents/agent_kube/test_deployment.py
M tests/unit/cmk/special_agents/agent_kube/test_node.py
M tests/unit/cmk/special_agents/agent_kube/test_pvc.py
M tests/unit/cmk/special_agents/agent_kubernetes/test_agent_kubernetes_api_nodes.py
M
tests/unit/cmk/special_agents/agent_kubernetes/test_agent_kubernetes_section_schemas.py
M tests/unit/cmk/special_agents/utils_kubernetes/test_api_server.py
M tests/unit/cmk/update_config/plugins/actions/test_update_backup.py
M tests/unit/cmk/utils/packaging/test_manifest.py
M tests/unit/cmk/utils/test_store.py
M tests/unit/cmk/utils/werks/test_werks.py
Log Message:
-----------
pydantic 2: upgrade pydantic v1 package to pydantic v2
NOTE: This is the third attempt to merge this change.
* replace pydantic<2 with pydantic>=2
* install pydantic_core
* install typed-annotations
* upgrade fastapi
* replace pydantic-factories with polyfactory
Agent Receiver:
* bump fastapi to 0.103.1
* convert custom types into pydantic-core aware ones
* migrate @validator methods
Kubernetes:
* add Url validator which got more relaxed in v2
* use polyfactory instead of pydantic_factories
* use DataclassFactory for dataclasses
* remove unsupported FutureRef
* syntax for __root_model__ changed to RootModel[...]
* __root_model__ is deprecated and already removed
* replace parse_obj_as with TypeAdapter.validate_python
* replace parse_raw_as with TypeAdapter.validate_json
* remove FalsyNodeCondition, TruthyNodeCondition
* remove is_ok method, shift checking algorithm to runtime
* adjust both schemas such that test_schema_did_not_diverge passes
* remove no longer supported "const=True" calls
* fix Exception handling in None case
Models:
* change root model syntax
* rename __fields__ to model_fields
* rename deprecated method names
* Fix werks models
* fix saml2 models
* Extra should now be a literal
* make UserId type pydantic 2 aware
* replace class Config with model_config and fix renamed config keys
* use @field_validator, @model_validator decorators instead of deprecated @validator
* remove from_orm and port to model_validate(using from_attributes=True)
* UUID4 can not be instantiated. Replace with UUID.
* replace use of deprecated model-methods
* use __get_pydantic_core_schema__ for custom data types, as pydantic 2 doesn't
allow
"arbitrary types" by default. These are classes which are not derived from
BaseModel
or have __get_pydantic_core_schema__ implemented on the type, or have
a annotation via typing.Annotate.
General:
* make validators accessible on custom types
* remove const=True
* make default None values explicit for optional types.
This was implicit in pydantic 1, but needs to be explicit in pydantic 2
* sort_keys was removed form model_dump_json
* adjust to more compact JSON representation
* JobState should not be frozen, as code depends on changeability.
Was not visible before. See cmk/gui/backup/handler.py:275+
Tests:
* fix tests, dump model to dict for comparison
* integration tests: fix PredictionData.points model
* integration tests, mypy
* fix changed validation error messages
Change-Id: I5913a3d722845f1dbce5fe7b8acbca0327bc6455