openshift-python-wrapper 4.15.19__tar.gz → 10.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/PKG-INFO +2 -2
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/catalog_source.py +13 -17
- openshift_python_wrapper-10.0.0/ocp_resources/controller_revision.py +39 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/cron_job.py +5 -7
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/csi_storage_capacity.py +4 -31
- openshift_python_wrapper-10.0.0/ocp_resources/data_import_cron.py +95 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/data_source.py +5 -7
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/datavolume.py +19 -21
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/endpoint_slice.py +4 -6
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/endpoints.py +5 -7
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/hook.py +6 -8
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/host.py +13 -15
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/image_stream.py +5 -7
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/kube_descheduler.py +9 -11
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/machine_set.py +1 -1
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/migration.py +6 -8
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/mtv.py +1 -1
- openshift_python_wrapper-10.0.0/ocp_resources/node_health_check.py +75 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/node_network_configuration_policy.py +3 -3
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/node_network_state.py +6 -8
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/ocs_initialization.py +4 -6
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/operator_source.py +9 -11
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/persistent_volume_claim.py +6 -8
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/plan.py +24 -26
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/pod.py +1 -1
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/provider.py +10 -12
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/resource.py +9 -11
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/restore.py +4 -6
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/secret.py +5 -7
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/sriov_network_node_state.py +1 -1
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/subscription.py +9 -11
- openshift_python_wrapper-10.0.0/ocp_resources/utils.py +55 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/virtual_machine_export.py +9 -11
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/virtual_machine_import.py +1 -1
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/virtual_machine_instance.py +1 -1
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/virtual_machine_snapshot.py +1 -1
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/pyproject.toml +2 -3
- openshift_python_wrapper-4.15.19/ocp_resources/controller_revision.py +0 -43
- openshift_python_wrapper-4.15.19/ocp_resources/data_import_cron.py +0 -94
- openshift_python_wrapper-4.15.19/ocp_resources/node_health_check.py +0 -10
- openshift_python_wrapper-4.15.19/ocp_resources/utils.py +0 -277
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/LICENSE +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/README.md +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/__init__.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/api_server.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/api_service.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/backup.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/benchmark.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/cdi.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/cdi_config.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/chaos_engine.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/chaos_result.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/cluster_operator.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/cluster_role.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/cluster_role_binding.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/cluster_service_version.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/cluster_version.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/configmap.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/console_cli_download.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/console_plugin.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/console_quick_start.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/constants.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/csidriver.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/custom_resource_definition.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/daemonset.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/deployment.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/destination_rule.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/dns.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/event.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/forklift_controller.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/gateway.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/hostpath_provisioner.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/hyperconverged.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/image.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/image_content_source_policy.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/image_digest_mirror_set.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/imagestreamtag.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/infrastructure.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/installplan.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/ip_address_pool.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/job.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/kubevirt.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/kubevirt_common_templates_bundle.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/kubevirt_metrics_aggregation.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/kubevirt_node_labeller_bundle.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/kubevirt_template_validaotr.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/l2_advertisement.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/lease.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/limit_range.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/machine.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/machine_config.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/machine_config_pool.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/machine_health_check.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/managed_cluster.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/metallb.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/migration_policy.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/mtq.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/multi_cluster_hub.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/multi_cluster_observability.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/mutating_webhook_config.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/namespace.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/network.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/network_addons_config.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/network_attachment_definition.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/network_map.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/network_policy.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/nmstate.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/node.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/node_maintenance.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/node_network_configuration_enactment.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/oauth.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/operator.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/operator_condition.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/operator_group.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/operator_hub.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/package_manifest.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/peer_authentication.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/persistent_volume.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/pipeline.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/pipelineruns.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/pod_disruption_budget.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/pod_metrics.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/priority_class.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/project.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/prometheus.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/prometheus_rule.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/replicaset.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/resource_quota.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/rhmi.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/role.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/role_binding.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/route.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/scheduler.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/security_context_constraints.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/service.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/service_account.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/service_mesh_control_plane.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/service_mesh_member_roll.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/service_monitor.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/sriov_network.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/sriov_network_node_policy.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/ssp.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/storage_class.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/storage_map.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/storage_profile.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/task_run.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/tekton_tasks.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/template.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/upload_token_request.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/validating_webhook_config.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/virtual_machine.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/virtual_machine_Instance_replica_set.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/virtual_machine_clone.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/virtual_machine_cluster_instance_types.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/virtual_machine_cluster_preferences.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/virtual_machine_instance_migration.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/virtual_machine_instance_preset.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/virtual_machine_instance_types.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/virtual_machine_migration_resource_quota.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/virtual_machine_preferences.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/virtual_machine_restore.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/virtual_service.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/vm_import_config.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/volume_snapshot.py +0 -0
- {openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/volume_snapshot_class.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: openshift-python-wrapper
|
|
3
|
-
Version:
|
|
3
|
+
Version: 10.0.0
|
|
4
4
|
Summary: Wrapper around https://github.com/kubernetes-client/python
|
|
5
5
|
Home-page: https://github.com/RedHatQE/openshift-python-wrapper
|
|
6
6
|
License: Apache-2.0
|
|
@@ -18,7 +18,7 @@ Classifier: Programming Language :: Python :: 3.11
|
|
|
18
18
|
Classifier: Programming Language :: Python :: 3.12
|
|
19
19
|
Requires-Dist: colorlog (>=6.7.0,<7.0.0)
|
|
20
20
|
Requires-Dist: jinja2 (>=3.1.2,<4.0.0)
|
|
21
|
-
Requires-Dist: kubernetes (>=
|
|
21
|
+
Requires-Dist: kubernetes (>=29.0.0,<30.0.0)
|
|
22
22
|
Requires-Dist: packaging (>=23.1,<24.0)
|
|
23
23
|
Requires-Dist: python-benedict (>=0.33.0,<0.34.0)
|
|
24
24
|
Requires-Dist: python-simple-logger (>=1.0.6,<2.0.0)
|
{openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/catalog_source.py
RENAMED
|
@@ -41,23 +41,19 @@ class CatalogSource(NamespacedResource):
|
|
|
41
41
|
"Passing yaml_file or all parameters 'source_type', 'image',"
|
|
42
42
|
" 'display_name' and 'publisher' is required."
|
|
43
43
|
)
|
|
44
|
-
self.res.update(
|
|
45
|
-
{
|
|
46
|
-
"
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
"publisher": self.publisher,
|
|
51
|
-
}
|
|
44
|
+
self.res.update({
|
|
45
|
+
"spec": {
|
|
46
|
+
"sourceType": self.source_type,
|
|
47
|
+
"image": self.image,
|
|
48
|
+
"displayName": self.display_name,
|
|
49
|
+
"publisher": self.publisher,
|
|
52
50
|
}
|
|
53
|
-
)
|
|
51
|
+
})
|
|
54
52
|
if self.update_strategy_registry_poll_interval:
|
|
55
|
-
self.res["spec"].update(
|
|
56
|
-
{
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"interval": self.update_strategy_registry_poll_interval,
|
|
60
|
-
},
|
|
53
|
+
self.res["spec"].update({
|
|
54
|
+
"updateStrategy": {
|
|
55
|
+
"registryPoll": {
|
|
56
|
+
"interval": self.update_strategy_registry_poll_interval,
|
|
61
57
|
},
|
|
62
|
-
}
|
|
63
|
-
)
|
|
58
|
+
},
|
|
59
|
+
})
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
from ocp_resources.resource import NamespacedResource
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class ControllerRevision(NamespacedResource):
|
|
5
|
+
"""
|
|
6
|
+
https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/controller-revision-v1/
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
api_group = NamespacedResource.ApiGroup.APPS
|
|
10
|
+
|
|
11
|
+
def __init__(
|
|
12
|
+
self,
|
|
13
|
+
owner_references=None,
|
|
14
|
+
revision_object=None,
|
|
15
|
+
revision=None,
|
|
16
|
+
**kwargs,
|
|
17
|
+
):
|
|
18
|
+
"""
|
|
19
|
+
Args:
|
|
20
|
+
owner_references (list, optional): List of objects depended on this object.
|
|
21
|
+
revision_object (object, optional): the Data Object representing the state.
|
|
22
|
+
revision (int64): indicates the revision of the state represented by Data.
|
|
23
|
+
"""
|
|
24
|
+
super().__init__(**kwargs)
|
|
25
|
+
self.owner_references = owner_references
|
|
26
|
+
self.revision_object = revision_object
|
|
27
|
+
self.revision = revision
|
|
28
|
+
|
|
29
|
+
def to_dict(self):
|
|
30
|
+
super().to_dict()
|
|
31
|
+
if not self.yaml_file:
|
|
32
|
+
if not self.revision:
|
|
33
|
+
raise ValueError("Passing yaml_file or parameter 'revision' is required.")
|
|
34
|
+
self.res.update({"revision": self.revision})
|
|
35
|
+
|
|
36
|
+
if self.owner_references:
|
|
37
|
+
self.res.setdefault("metadata", {}).update({"ownerReference": self.owner_references})
|
|
38
|
+
if self.revision_object:
|
|
39
|
+
self.res.update({"data": self.revision_object.res})
|
{openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/cron_job.py
RENAMED
|
@@ -49,14 +49,12 @@ class CronJob(NamespacedResource):
|
|
|
49
49
|
if not self.yaml_file:
|
|
50
50
|
if not (self.job_template and self.schedule):
|
|
51
51
|
raise ValueError("yaml_file or parameters 'job_template' and 'schedule' are" " required.")
|
|
52
|
-
self.res.update(
|
|
53
|
-
{
|
|
54
|
-
"
|
|
55
|
-
|
|
56
|
-
"schedule": self.schedule,
|
|
57
|
-
}
|
|
52
|
+
self.res.update({
|
|
53
|
+
"spec": {
|
|
54
|
+
"jobTemplate": self.job_template,
|
|
55
|
+
"schedule": self.schedule,
|
|
58
56
|
}
|
|
59
|
-
)
|
|
57
|
+
})
|
|
60
58
|
if self.timezone:
|
|
61
59
|
self.res["spec"]["timezone"] = self.timezone
|
|
62
60
|
if self.suspend:
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
from ocp_resources.constants import TIMEOUT_4MINUTES
|
|
2
1
|
from ocp_resources.resource import NamespacedResource
|
|
3
2
|
|
|
4
3
|
|
|
5
4
|
class CSIStorageCapacity(NamespacedResource):
|
|
6
5
|
"""
|
|
7
|
-
CSIStorageCapacity object. API reference:
|
|
8
6
|
https://kubernetes.io/docs/reference/kubernetes-api/config-and-storage-resources/csi-storage-capacity-v1/#CSIStorageCapacity
|
|
9
7
|
"""
|
|
10
8
|
|
|
@@ -12,24 +10,14 @@ class CSIStorageCapacity(NamespacedResource):
|
|
|
12
10
|
|
|
13
11
|
def __init__(
|
|
14
12
|
self,
|
|
15
|
-
name=None,
|
|
16
|
-
namespace=None,
|
|
17
|
-
client=None,
|
|
18
13
|
capacity=None,
|
|
19
14
|
maximum_volume_size=None,
|
|
20
15
|
node_topology=None,
|
|
21
16
|
storage_class_name=None,
|
|
22
|
-
teardown=True,
|
|
23
|
-
privileged_client=None,
|
|
24
|
-
yaml_file=None,
|
|
25
|
-
delete_timeout=TIMEOUT_4MINUTES,
|
|
26
17
|
**kwargs,
|
|
27
18
|
):
|
|
28
19
|
"""
|
|
29
20
|
Args:
|
|
30
|
-
name (str): Name of the CSIStorageCapacity resource
|
|
31
|
-
namespace (str): Namespace of CSIStorageCapacity resource
|
|
32
|
-
client: (DynamicClient): DynamicClient for api calls
|
|
33
21
|
capacity (str, optional): value reported by the csi driver
|
|
34
22
|
maximum_volume_size (str, optional): maximum volume size reported by csi driver
|
|
35
23
|
storage_class_name (str): storage class name
|
|
@@ -37,21 +25,8 @@ class CSIStorageCapacity(NamespacedResource):
|
|
|
37
25
|
was reported
|
|
38
26
|
Example:
|
|
39
27
|
node_topology: {'matchLabels': {'topology.hostpath.csi/node': 'c01-dbn-413-4c48b-worker-0-pmtv8'}}
|
|
40
|
-
teardown (bool): Indicates if the resource should be torn down at the end
|
|
41
|
-
privileged_client (DynamicClient): Privileged client for api calls
|
|
42
|
-
yaml_file (str): yaml file for the resource.
|
|
43
|
-
delete_timeout (int): timeout associated with delete action
|
|
44
28
|
"""
|
|
45
|
-
super().__init__(
|
|
46
|
-
name=name,
|
|
47
|
-
namespace=namespace,
|
|
48
|
-
client=client,
|
|
49
|
-
teardown=teardown,
|
|
50
|
-
privileged_client=privileged_client,
|
|
51
|
-
yaml_file=yaml_file,
|
|
52
|
-
delete_timeout=delete_timeout,
|
|
53
|
-
**kwargs,
|
|
54
|
-
)
|
|
29
|
+
super().__init__(**kwargs)
|
|
55
30
|
self.capacity = capacity
|
|
56
31
|
self.node_topology = node_topology
|
|
57
32
|
self.storage_class_name = storage_class_name
|
|
@@ -62,11 +37,9 @@ class CSIStorageCapacity(NamespacedResource):
|
|
|
62
37
|
if not self.yaml_file:
|
|
63
38
|
if not self.storage_class_name:
|
|
64
39
|
raise ValueError("yaml_file or parameter 'storage_class_name' is required.")
|
|
65
|
-
self.res.update(
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
69
|
-
)
|
|
40
|
+
self.res.update({
|
|
41
|
+
"storageClassName": self.storage_class_name,
|
|
42
|
+
})
|
|
70
43
|
if self.maximum_volume_size:
|
|
71
44
|
self.res["maximumVolumeSize"] = self.maximum_volume_size
|
|
72
45
|
if self.node_topology:
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
from ocp_resources.resource import NamespacedResource
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class DataImportCron(NamespacedResource):
|
|
5
|
+
"""
|
|
6
|
+
https://kubevirt.io/cdi-api-reference/main/definitions.html#_v1beta1_dataimportcron
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
api_group = NamespacedResource.ApiGroup.CDI_KUBEVIRT_IO
|
|
10
|
+
|
|
11
|
+
def __init__(
|
|
12
|
+
self,
|
|
13
|
+
image_stream=None,
|
|
14
|
+
url=None,
|
|
15
|
+
cert_configmap=None,
|
|
16
|
+
pull_method=None,
|
|
17
|
+
storage_class=None,
|
|
18
|
+
size=None,
|
|
19
|
+
schedule=None,
|
|
20
|
+
garbage_collect=None,
|
|
21
|
+
managed_data_source=None,
|
|
22
|
+
imports_to_keep=None,
|
|
23
|
+
bind_immediate_annotation=None,
|
|
24
|
+
**kwargs,
|
|
25
|
+
):
|
|
26
|
+
"""
|
|
27
|
+
Args:
|
|
28
|
+
garbage_collect (str, optional): whether old PVCs should be cleaned up after a new PVC is imported.
|
|
29
|
+
Options are "Outdated"/"Never".
|
|
30
|
+
imports_to_keep (int, optional): number of import PVCs to keep when garbage collecting.
|
|
31
|
+
managed_data_source(str, optional): specifies the name of the corresponding DataSource to manage.
|
|
32
|
+
DataSource has to be in the same namespace.
|
|
33
|
+
schedule (str, optional): specifies in cron format when and how often to look for new imports.
|
|
34
|
+
storage_class (str, optional): Name of the StorageClass required by the claim.
|
|
35
|
+
size (str): Size of the resources claim quantity. Format is size+size unit, for example: "5Gi".
|
|
36
|
+
url (str, optional): URL is the url of the registry source (starting with the scheme: docker, oci-archive).
|
|
37
|
+
cert_configmap (str, optional): CertConfigMap provides a reference to the Registry certs
|
|
38
|
+
image_stream (str, optional): ImageStream is the name of image stream for import
|
|
39
|
+
bind_immediate_annotation (bool, optional): when WaitForFirstConsumer is set in StorageClass and the
|
|
40
|
+
DataSource should be bound immediately.
|
|
41
|
+
pull_method (str): can be either "pod" or "node" (node docker cache based import)
|
|
42
|
+
"""
|
|
43
|
+
super().__init__(**kwargs)
|
|
44
|
+
self.image_stream = image_stream
|
|
45
|
+
self.url = url
|
|
46
|
+
self.cert_configmap = cert_configmap
|
|
47
|
+
self.pull_method = pull_method
|
|
48
|
+
self.storage_class = storage_class
|
|
49
|
+
self.size = size
|
|
50
|
+
self.schedule = schedule
|
|
51
|
+
self.garbage_collect = garbage_collect
|
|
52
|
+
self.managed_data_source = managed_data_source
|
|
53
|
+
self.imports_to_keep = imports_to_keep
|
|
54
|
+
self.bind_immediate_annotation = bind_immediate_annotation
|
|
55
|
+
|
|
56
|
+
def to_dict(self):
|
|
57
|
+
super().to_dict()
|
|
58
|
+
if not self.yaml_file:
|
|
59
|
+
if self.image_stream and self.url:
|
|
60
|
+
raise ValueError("imageStream and url cannot coexist")
|
|
61
|
+
if not self.pull_method:
|
|
62
|
+
raise ValueError("Passing yaml_file or parameter 'pull_method' is required")
|
|
63
|
+
self.res.update({
|
|
64
|
+
"spec": {
|
|
65
|
+
"template": {"spec": {"source": {"registry": {"pullMethod": self.pull_method}}}},
|
|
66
|
+
}
|
|
67
|
+
})
|
|
68
|
+
spec = self.res["spec"]["template"]["spec"]
|
|
69
|
+
|
|
70
|
+
if self.bind_immediate_annotation:
|
|
71
|
+
self.res["metadata"].setdefault("annotations", {}).update({
|
|
72
|
+
f"{NamespacedResource.ApiGroup.CDI_KUBEVIRT_IO}/storage.bind.immediate.requested": ("true")
|
|
73
|
+
})
|
|
74
|
+
if self.image_stream:
|
|
75
|
+
spec["source"]["registry"]["imageStream"] = self.image_stream
|
|
76
|
+
if self.url:
|
|
77
|
+
spec["source"]["registry"]["url"] = self.url
|
|
78
|
+
if self.cert_configmap:
|
|
79
|
+
spec["source"]["registry"]["certConfigMap"] = self.cert_configmap
|
|
80
|
+
if self.schedule:
|
|
81
|
+
self.res["spec"]["schedule"] = self.schedule
|
|
82
|
+
if self.garbage_collect:
|
|
83
|
+
self.res["spec"]["garbageCollect"] = self.garbage_collect
|
|
84
|
+
if self.managed_data_source:
|
|
85
|
+
self.res["spec"]["managedDataSource"] = self.managed_data_source
|
|
86
|
+
if self.imports_to_keep:
|
|
87
|
+
self.res["spec"]["importsToKeep"] = self.imports_to_keep
|
|
88
|
+
|
|
89
|
+
storage = {}
|
|
90
|
+
if self.size:
|
|
91
|
+
storage["resources"] = {"requests": {"storage": self.size}}
|
|
92
|
+
if self.storage_class:
|
|
93
|
+
storage["storageClassName"] = self.storage_class
|
|
94
|
+
if storage:
|
|
95
|
+
spec["storage"] = storage
|
{openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/data_source.py
RENAMED
|
@@ -33,13 +33,11 @@ class DataSource(NamespacedResource):
|
|
|
33
33
|
def to_dict(self):
|
|
34
34
|
super().to_dict()
|
|
35
35
|
if not self.yaml_file:
|
|
36
|
-
self.res.update(
|
|
37
|
-
{
|
|
38
|
-
"
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
)
|
|
36
|
+
self.res.update({
|
|
37
|
+
"spec": {
|
|
38
|
+
"source": self.source,
|
|
39
|
+
},
|
|
40
|
+
})
|
|
43
41
|
|
|
44
42
|
@property
|
|
45
43
|
def pvc(self):
|
{openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/datavolume.py
RENAMED
|
@@ -156,16 +156,14 @@ class DataVolume(NamespacedResource):
|
|
|
156
156
|
def to_dict(self):
|
|
157
157
|
super().to_dict()
|
|
158
158
|
if not self.yaml_file:
|
|
159
|
-
self.res.update(
|
|
160
|
-
{
|
|
161
|
-
"
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
},
|
|
166
|
-
}
|
|
159
|
+
self.res.update({
|
|
160
|
+
"spec": {
|
|
161
|
+
"source": {self.source: {"url": self.url}},
|
|
162
|
+
self.api_name: {
|
|
163
|
+
"resources": {"requests": {"storage": self.size}},
|
|
164
|
+
},
|
|
167
165
|
}
|
|
168
|
-
)
|
|
166
|
+
})
|
|
169
167
|
if self.access_modes:
|
|
170
168
|
self.res["spec"][self.api_name]["accessModes"] = [self.access_modes]
|
|
171
169
|
if self.content_type:
|
|
@@ -183,17 +181,17 @@ class DataVolume(NamespacedResource):
|
|
|
183
181
|
if self.source == "upload" or self.source == "blank":
|
|
184
182
|
self.res["spec"]["source"][self.source] = {}
|
|
185
183
|
if self.hostpath_node:
|
|
186
|
-
self.res["metadata"].setdefault("annotations", {}).update(
|
|
187
|
-
|
|
188
|
-
)
|
|
184
|
+
self.res["metadata"].setdefault("annotations", {}).update({
|
|
185
|
+
f"{NamespacedResource.ApiGroup.KUBEVIRT_IO}/provisionOnNode": (self.hostpath_node)
|
|
186
|
+
})
|
|
189
187
|
if self.multus_annotation:
|
|
190
|
-
self.res["metadata"].setdefault("annotations", {}).update(
|
|
191
|
-
|
|
192
|
-
)
|
|
188
|
+
self.res["metadata"].setdefault("annotations", {}).update({
|
|
189
|
+
f"{NamespacedResource.ApiGroup.K8S_V1_CNI_CNCF_IO}/networks": (self.multus_annotation)
|
|
190
|
+
})
|
|
193
191
|
if self.bind_immediate_annotation:
|
|
194
|
-
self.res["metadata"].setdefault("annotations", {}).update(
|
|
195
|
-
|
|
196
|
-
)
|
|
192
|
+
self.res["metadata"].setdefault("annotations", {}).update({
|
|
193
|
+
f"{self.api_group}/storage.bind.immediate.requested": "true"
|
|
194
|
+
})
|
|
197
195
|
if self.source == "pvc":
|
|
198
196
|
self.res["spec"]["source"]["pvc"] = {
|
|
199
197
|
"name": self.source_pvc or "dv-source",
|
|
@@ -202,9 +200,9 @@ class DataVolume(NamespacedResource):
|
|
|
202
200
|
if self.preallocation is not None:
|
|
203
201
|
self.res["spec"]["preallocation"] = self.preallocation
|
|
204
202
|
if self.delete_after_completion:
|
|
205
|
-
self.res["metadata"].setdefault("annotations", {}).update(
|
|
206
|
-
|
|
207
|
-
)
|
|
203
|
+
self.res["metadata"].setdefault("annotations", {}).update({
|
|
204
|
+
f"{self.api_group}/storage.deleteAfterCompletion": (self.delete_after_completion)
|
|
205
|
+
})
|
|
208
206
|
|
|
209
207
|
def wait_deleted(self, timeout=TIMEOUT_4MINUTES):
|
|
210
208
|
"""
|
{openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/endpoint_slice.py
RENAMED
|
@@ -56,11 +56,9 @@ class EndpointSlice(NamespacedResource):
|
|
|
56
56
|
if not self.yaml_file:
|
|
57
57
|
if not (self.address_type and self.endpoints):
|
|
58
58
|
raise ValueError("yaml_file or parameters 'address_type' and 'endpoints' are" " required.")
|
|
59
|
-
self.res.update(
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}
|
|
64
|
-
)
|
|
59
|
+
self.res.update({
|
|
60
|
+
"addressTypes": self.address_type,
|
|
61
|
+
"endpoints": self.endpoints,
|
|
62
|
+
})
|
|
65
63
|
if self.ports:
|
|
66
64
|
self.res["ports"] = self.ports
|
{openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/endpoints.py
RENAMED
|
@@ -53,11 +53,9 @@ class Endpoints(NamespacedResource):
|
|
|
53
53
|
if not self.yaml_file:
|
|
54
54
|
if not (self.addresses and self.ports):
|
|
55
55
|
raise ValueError("yaml_file or parameters 'addresses' and 'ports' are required.")
|
|
56
|
-
self.res.update(
|
|
57
|
-
{
|
|
58
|
-
"
|
|
59
|
-
|
|
60
|
-
"ports": self.ports,
|
|
61
|
-
}
|
|
56
|
+
self.res.update({
|
|
57
|
+
"subsets": {
|
|
58
|
+
"addresses": self.addresses,
|
|
59
|
+
"ports": self.ports,
|
|
62
60
|
}
|
|
63
|
-
)
|
|
61
|
+
})
|
|
@@ -42,11 +42,9 @@ class Hook(NamespacedResource, MTV):
|
|
|
42
42
|
def to_dict(self):
|
|
43
43
|
super().to_dict()
|
|
44
44
|
if not self.yaml_file:
|
|
45
|
-
self.res.update(
|
|
46
|
-
{
|
|
47
|
-
"
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
)
|
|
45
|
+
self.res.update({
|
|
46
|
+
"spec": {
|
|
47
|
+
"image": self.image,
|
|
48
|
+
"playbook": self.playbook,
|
|
49
|
+
},
|
|
50
|
+
})
|
|
@@ -46,19 +46,17 @@ class Host(NamespacedResource, MTV):
|
|
|
46
46
|
def to_dict(self):
|
|
47
47
|
super().to_dict()
|
|
48
48
|
if not self.yaml_file:
|
|
49
|
-
self.res.update(
|
|
50
|
-
{
|
|
51
|
-
"
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
"
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
"
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
},
|
|
62
|
-
}
|
|
49
|
+
self.res.update({
|
|
50
|
+
"spec": {
|
|
51
|
+
"id": self.host_id,
|
|
52
|
+
"ipAddress": self.ip_address,
|
|
53
|
+
"secret": {
|
|
54
|
+
"name": self.secret_name,
|
|
55
|
+
"namespace": self.secret_namespace,
|
|
56
|
+
},
|
|
57
|
+
"provider": {
|
|
58
|
+
"name": self.provider_name,
|
|
59
|
+
"namespace": self.provider_namespace,
|
|
60
|
+
},
|
|
63
61
|
}
|
|
64
|
-
)
|
|
62
|
+
})
|
{openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/image_stream.py
RENAMED
|
@@ -39,11 +39,9 @@ class ImageStream(NamespacedResource):
|
|
|
39
39
|
def to_dict(self):
|
|
40
40
|
super().to_dict()
|
|
41
41
|
if not self.yaml_file:
|
|
42
|
-
self.res.update(
|
|
43
|
-
{
|
|
44
|
-
"
|
|
45
|
-
|
|
46
|
-
"tags": self.tags,
|
|
47
|
-
}
|
|
42
|
+
self.res.update({
|
|
43
|
+
"spec": {
|
|
44
|
+
"lookupPolicy": {"local": self.lookup_policy},
|
|
45
|
+
"tags": self.tags,
|
|
48
46
|
}
|
|
49
|
-
)
|
|
47
|
+
})
|
|
@@ -51,15 +51,13 @@ class KubeDescheduler(NamespacedResource):
|
|
|
51
51
|
def to_dict(self):
|
|
52
52
|
super().to_dict()
|
|
53
53
|
if not self.yaml_file:
|
|
54
|
-
self.res.update(
|
|
55
|
-
{
|
|
56
|
-
"
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
"profiles": self.profiles,
|
|
63
|
-
}
|
|
54
|
+
self.res.update({
|
|
55
|
+
"spec": {
|
|
56
|
+
"deschedulingIntervalSeconds": self.descheduling_interval,
|
|
57
|
+
"logLevel": self.log_level,
|
|
58
|
+
"managementState": self.management_state,
|
|
59
|
+
"mode": self.mode,
|
|
60
|
+
"operatorLogLevel": self.operator_log_level,
|
|
61
|
+
"profiles": self.profiles,
|
|
64
62
|
}
|
|
65
|
-
)
|
|
63
|
+
})
|
{openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/machine_set.py
RENAMED
|
@@ -178,7 +178,7 @@ class MachineSet(NamespacedResource):
|
|
|
178
178
|
super().to_dict()
|
|
179
179
|
self.res.update({"spec": {"replicas": replicas}})
|
|
180
180
|
|
|
181
|
-
self.logger.info(f"Scale machine-set from {self.desired_replicas} replicas to {replicas} replicas")
|
|
181
|
+
self.logger.info(f"Scale machine-set from {self.desired_replicas} replicas to" f" {replicas} replicas")
|
|
182
182
|
self.update(resource_dict=self.res)
|
|
183
183
|
if wait:
|
|
184
184
|
return self.wait_for_replicas(timeout=wait_timeout, sleep=sleep)
|
{openshift_python_wrapper-4.15.19 → openshift_python_wrapper-10.0.0}/ocp_resources/migration.py
RENAMED
|
@@ -46,16 +46,14 @@ class Migration(NamespacedResource, MTV):
|
|
|
46
46
|
def to_dict(self):
|
|
47
47
|
super().to_dict()
|
|
48
48
|
if not self.yaml_file:
|
|
49
|
-
self.res.update(
|
|
50
|
-
{
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
|
|
54
|
-
"namespace": self.plan_namespace,
|
|
55
|
-
}
|
|
49
|
+
self.res.update({
|
|
50
|
+
"spec": {
|
|
51
|
+
"plan": {
|
|
52
|
+
"name": self.plan_name,
|
|
53
|
+
"namespace": self.plan_namespace,
|
|
56
54
|
}
|
|
57
55
|
}
|
|
58
|
-
)
|
|
56
|
+
})
|
|
59
57
|
|
|
60
58
|
if self.cut_over:
|
|
61
59
|
self.res["spec"]["cutover"] = self.cut_over.strftime(format="%Y-%m-%dT%H:%M:%SZ")
|
|
@@ -112,7 +112,7 @@ class MTV:
|
|
|
112
112
|
return
|
|
113
113
|
|
|
114
114
|
except TimeoutExpiredError:
|
|
115
|
-
self.logger.error(msg=(f"Last Status Condition of {self.kind} {self.name} was: {last_condition}"))
|
|
115
|
+
self.logger.error(msg=(f"Last Status Condition of {self.kind} {self.name} was:" f" {last_condition}"))
|
|
116
116
|
raise
|
|
117
117
|
|
|
118
118
|
def wait_for_condition_ready(self, wait_timeout=360):
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
from ocp_resources.resource import Resource
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class NodeHealthCheck(Resource):
|
|
5
|
+
"""
|
|
6
|
+
NodeHealthCheck object.
|
|
7
|
+
Reference : https://github.com/medik8s/node-healthcheck-operator
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
api_group = Resource.ApiGroup.REMEDIATION_MEDIK8S_IO
|
|
11
|
+
|
|
12
|
+
def __init__(
|
|
13
|
+
self,
|
|
14
|
+
selector_match_expressions=None,
|
|
15
|
+
selector_match_labels=None,
|
|
16
|
+
min_unhealthy=None,
|
|
17
|
+
unhealthy_conditions=None,
|
|
18
|
+
escalating_remediation=None,
|
|
19
|
+
remediation_template=None,
|
|
20
|
+
**kwargs,
|
|
21
|
+
):
|
|
22
|
+
"""
|
|
23
|
+
Create NodeHealthCheck object.
|
|
24
|
+
|
|
25
|
+
Args:
|
|
26
|
+
selector_match_expressions (dict, Optional if `selector_match_labels` exist): Belongs to selector object.
|
|
27
|
+
This helps in matching nodes.
|
|
28
|
+
selector_match_labels (dict, Optional if `selector_match_expressions` exist): Belongs to selector object.
|
|
29
|
+
This is a map of {key,value} pairs.
|
|
30
|
+
min_unhealthy (int, Optional): Remediation is allowed if at least "MinHealthy" nodes selected by "selector"
|
|
31
|
+
unhealthy_conditions (list, Optional): UnhealthyConditions contains a list of the conditions that determine
|
|
32
|
+
whether a node is considered unhealthy.
|
|
33
|
+
remediation_template (dict, mandatory if `escalating_remediation` is not provided) : remediation template
|
|
34
|
+
provided by an infrastructure provider.
|
|
35
|
+
escalating_remediation (list, mandatory if `remediation_template` is not provided): EscalatingRemediations
|
|
36
|
+
contain a list of ordered remediation templates with a timeout.
|
|
37
|
+
example: [{'remediationTemplate': {'apiVersion': 'self-node-remediation.medik8s.io/v1alpha1', 'kind':
|
|
38
|
+
'SelfNodeRemediationTemplate', 'namespace': 'openshift-operators',
|
|
39
|
+
'name': 'self-node-remediation-resource-deletion-template'}, 'order': 1, 'timeout': '70s'}]
|
|
40
|
+
"""
|
|
41
|
+
super().__init__(
|
|
42
|
+
**kwargs,
|
|
43
|
+
)
|
|
44
|
+
self.selector_match_expressions = selector_match_expressions
|
|
45
|
+
self.selector_match_labels = selector_match_labels
|
|
46
|
+
self.min_unhealthy = min_unhealthy
|
|
47
|
+
self.unhealthy_conditions = unhealthy_conditions
|
|
48
|
+
self.escalating_remediation = escalating_remediation
|
|
49
|
+
self.remediation_template = remediation_template
|
|
50
|
+
|
|
51
|
+
def to_dict(self):
|
|
52
|
+
super().to_dict()
|
|
53
|
+
if not self.yaml_file:
|
|
54
|
+
if not (self.selector_match_expressions or self.selector_match_labels):
|
|
55
|
+
raise ValueError(
|
|
56
|
+
"Mandatory to have Selector either selector_match_expressions or selector_match_labels"
|
|
57
|
+
)
|
|
58
|
+
if not (self.escalating_remediation or self.remediation_template):
|
|
59
|
+
raise ValueError("Mandatory to have either remediation_template or escalating_remediation")
|
|
60
|
+
if self.escalating_remediation and self.remediation_template:
|
|
61
|
+
raise ValueError("remediation_template and escalating_remediation usage is mutual exclusive")
|
|
62
|
+
spec = self.res.setdefault("spec", {})
|
|
63
|
+
if self.escalating_remediation:
|
|
64
|
+
spec["escalatingRemediations"] = self.escalating_remediation
|
|
65
|
+
if self.remediation_template:
|
|
66
|
+
spec["remediationTemplate"] = self.remediation_template
|
|
67
|
+
if self.min_unhealthy:
|
|
68
|
+
spec["minHealthy"] = self.min_unhealthy
|
|
69
|
+
if self.unhealthy_conditions:
|
|
70
|
+
spec["unhealthyConditions"] = self.unhealthy_conditions
|
|
71
|
+
spec.setdefault("selector", {})
|
|
72
|
+
if self.selector_match_expressions:
|
|
73
|
+
spec["selector"]["matchExpressions"] = self.selector_match_expressions
|
|
74
|
+
if self.selector_match_labels:
|
|
75
|
+
spec["selector"]["matchLabels"] = self.selector_match_labels
|
|
@@ -114,9 +114,9 @@ class NodeNetworkConfigurationPolicy(Resource):
|
|
|
114
114
|
if self.node_selector:
|
|
115
115
|
return list(Node.get(dyn_client=self.client, name=self.node_selector))
|
|
116
116
|
if self.node_selector_labels:
|
|
117
|
-
node_labels = ",".join(
|
|
118
|
-
|
|
119
|
-
)
|
|
117
|
+
node_labels = ",".join([
|
|
118
|
+
f"{label_key}={label_value}" for label_key, label_value in self.node_selector_labels.items()
|
|
119
|
+
])
|
|
120
120
|
return list(Node.get(dyn_client=self.client, label_selector=node_labels))
|
|
121
121
|
|
|
122
122
|
def set_interface(self, interface):
|