openshift-python-wrapper 4.11.60__tar.gz → 4.11.61__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.11.60/openshift_python_wrapper.egg-info → openshift_python_wrapper-4.11.61}/PKG-INFO +24 -10
- openshift_python_wrapper-4.11.61/pyproject.toml +61 -0
- openshift-python-wrapper-4.11.60/PKG-INFO +0 -174
- openshift-python-wrapper-4.11.60/VERSION +0 -1
- openshift-python-wrapper-4.11.60/openshift_python_wrapper.egg-info/SOURCES.txt +0 -139
- openshift-python-wrapper-4.11.60/openshift_python_wrapper.egg-info/dependency_links.txt +0 -1
- openshift-python-wrapper-4.11.60/openshift_python_wrapper.egg-info/requires.txt +0 -5
- openshift-python-wrapper-4.11.60/openshift_python_wrapper.egg-info/top_level.txt +0 -1
- openshift-python-wrapper-4.11.60/pyproject.toml +0 -47
- openshift-python-wrapper-4.11.60/setup.cfg +0 -4
- openshift-python-wrapper-4.11.60/tests/test_resources.py +0 -36
- openshift-python-wrapper-4.11.60/tests/test_validate_resources.py +0 -159
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/LICENSE +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/README.md +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/__init__.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/api_service.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/backup.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/benchmark.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/catalog_source.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/catalog_source_config.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/cdi.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/cdi_config.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/chaos_engine.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/chaos_result.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/cluster_operator.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/cluster_role.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/cluster_role_binding.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/cluster_service_version.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/cluster_version.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/configmap.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/console_cli_download.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/console_plugin.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/console_quick_start.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/constants.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/csidriver.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/custom_resource_definition.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/daemonset.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/data_import_cron.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/data_source.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/datavolume.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/deployment.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/destination_rule.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/event.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/forklift_controller.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/gateway.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/hook.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/host.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/hostpath_provisioner.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/hyperconverged.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/image.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/image_content_source_policy.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/image_stream.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/imagestreamtag.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/infrastructure.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/installplan.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/job.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/kube_descheduler.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/kubevirt.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/kubevirt_common_templates_bundle.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/kubevirt_metrics_aggregation.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/kubevirt_node_labeller_bundle.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/kubevirt_template_validaotr.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/logger.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/machine.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/machine_config.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/machine_config_pool.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/machine_health_check.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/machine_set.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/migration.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/migration_policy.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/mtv.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/mutating_webhook_config.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/namespace.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/network.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/network_addons_config.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/network_attachment_definition.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/network_map.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/network_policy.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/nmstate.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/node.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/node_health_check.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/node_maintenance.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/node_network_configuration_enactment.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/node_network_configuration_policy.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/node_network_state.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/oauth.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/operator_condition.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/operator_group.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/operator_hub.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/operator_source.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/package_manifest.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/peer_authentication.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/persistent_volume.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/persistent_volume_claim.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/plan.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/pod.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/pod_disruption_budget.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/priority_class.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/project.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/prometheus.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/prometheus_rule.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/provider.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/replicaset.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/resource.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/restore.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/role.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/role_binding.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/route.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/secret.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/security_context_constraints.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/service.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/service_account.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/service_mesh_control_plane.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/service_mesh_member_roll.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/service_monitor.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/sriov_network.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/sriov_network_node_policy.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/sriov_network_node_state.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/ssp.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/storage_class.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/storage_map.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/storage_profile.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/subscription.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/tekton_tasks.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/template.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/upload_token_request.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/utils.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/validating_webhook_config.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/virtual_machine.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/virtual_machine_Instance_replica_set.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/virtual_machine_cluster_flavor.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/virtual_machine_flavor.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/virtual_machine_import.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/virtual_machine_instance.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/virtual_machine_instance_migration.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/virtual_machine_instance_preset.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/virtual_machine_restore.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/virtual_machine_snapshot.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/virtual_service.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/vm_import_config.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/volume_snapshot.py +0 -0
- {openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/volume_snapshot_class.py +0 -0
|
@@ -1,18 +1,31 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: openshift-python-wrapper
|
|
3
|
-
Version: 4.11.
|
|
4
|
-
Summary: Wrapper around https://github.com/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Project-URL: Download, https://pypi.org/project/openshift-python-wrapper/
|
|
8
|
-
Project-URL: Bug Tracker, https://github.com/RedHatQE/openshift-python-wrapper/issues
|
|
9
|
-
Project-URL: Documentation, https://openshift-python-wrapper.readthedocs.io/en/latest/
|
|
3
|
+
Version: 4.11.61
|
|
4
|
+
Summary: Wrapper around https://github.com/kubernetes-client/python
|
|
5
|
+
Home-page: https://github.com/RedHatQE/openshift-python-wrapper
|
|
6
|
+
License: Apache-2.0
|
|
10
7
|
Keywords: Openshift,Kubevirt,CNV
|
|
11
|
-
|
|
8
|
+
Author: Meni Yakove
|
|
9
|
+
Author-email: myakove@gmail.com
|
|
10
|
+
Requires-Python: >=3.8,<4.0
|
|
11
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
12
12
|
Classifier: Operating System :: OS Independent
|
|
13
|
-
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Requires-Dist: colorlog (>=6.7.0,<7.0.0)
|
|
19
|
+
Requires-Dist: kubernetes (>=27.2.0,<28.0.0)
|
|
20
|
+
Requires-Dist: openshift (>=0.13.2,<0.14.0)
|
|
21
|
+
Requires-Dist: packaging (>=23.1,<24.0)
|
|
22
|
+
Requires-Dist: python-benedict (>=0.32.0,<0.33.0)
|
|
23
|
+
Requires-Dist: python-simple-logger (>=1.0.5,<2.0.0)
|
|
24
|
+
Requires-Dist: xmltodict (>=0.13.0,<0.14.0)
|
|
25
|
+
Project-URL: Bug Tracker, https://github.com/RedHatQE/openshift-python-wrapper/issues
|
|
26
|
+
Project-URL: Documentation, https://openshift-python-wrapper.readthedocs.io/en/latest/
|
|
27
|
+
Project-URL: Download, https://pypi.org/project/openshift-python-wrapper/
|
|
14
28
|
Description-Content-Type: text/markdown
|
|
15
|
-
License-File: LICENSE
|
|
16
29
|
|
|
17
30
|
# openshift-python-wrapper
|
|
18
31
|
Pypi: [openshift-python-wrapper](https://pypi.org/project/openshift-python-wrapper)
|
|
@@ -172,3 +185,4 @@ We use pre-commit for code check.
|
|
|
172
185
|
```bash
|
|
173
186
|
pre-commit install
|
|
174
187
|
```
|
|
188
|
+
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
[tool.black]
|
|
2
|
+
line-length = 88
|
|
3
|
+
target_version = ['py37', 'py38', 'py39', 'py310', "py311"]
|
|
4
|
+
exclude = '''
|
|
5
|
+
(
|
|
6
|
+
/(
|
|
7
|
+
| \.git
|
|
8
|
+
| \.venv
|
|
9
|
+
| \.mypy_cache
|
|
10
|
+
| \.tox
|
|
11
|
+
)/
|
|
12
|
+
)
|
|
13
|
+
'''
|
|
14
|
+
|
|
15
|
+
[tool.isort]
|
|
16
|
+
line_length = 88
|
|
17
|
+
profile = "black"
|
|
18
|
+
|
|
19
|
+
[tool.poetry]
|
|
20
|
+
name = "openshift-python-wrapper"
|
|
21
|
+
version = "4.11.61"
|
|
22
|
+
description = "Wrapper around https://github.com/kubernetes-client/python"
|
|
23
|
+
authors = ["Meni Yakove <myakove@gmail.com>", "Ruth Netser <rnetser@gmail.com>"]
|
|
24
|
+
readme = "README.md"
|
|
25
|
+
license = "Apache-2.0"
|
|
26
|
+
packages = [{include = "ocp_resources"}]
|
|
27
|
+
homepage = "https://github.com/RedHatQE/openshift-python-wrapper"
|
|
28
|
+
documentation = "https://openshift-python-wrapper.readthedocs.io/en/latest/"
|
|
29
|
+
keywords = ["Openshift", "Kubevirt", "CNV"]
|
|
30
|
+
classifiers = [
|
|
31
|
+
"Programming Language :: Python :: 3",
|
|
32
|
+
"Operating System :: OS Independent",
|
|
33
|
+
]
|
|
34
|
+
|
|
35
|
+
[tool.poetry.urls]
|
|
36
|
+
Download = "https://pypi.org/project/openshift-python-wrapper/"
|
|
37
|
+
"Bug Tracker" = "https://github.com/RedHatQE/openshift-python-wrapper/issues"
|
|
38
|
+
|
|
39
|
+
[tool.poetry.group.dev.dependencies]
|
|
40
|
+
ipdb = "^0.13.13"
|
|
41
|
+
|
|
42
|
+
[tool.poetry-dynamic-versioning.substitution]
|
|
43
|
+
files = ["VERSION"]
|
|
44
|
+
|
|
45
|
+
[tool.poetry-dynamic-versioning]
|
|
46
|
+
enable = false
|
|
47
|
+
pattern = "((?P<epoch>\\d+)!)?(?P<base>\\d+(\\.\\d+)*)"
|
|
48
|
+
|
|
49
|
+
[build-system]
|
|
50
|
+
requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning"]
|
|
51
|
+
build-backend = "poetry_dynamic_versioning.backend"
|
|
52
|
+
|
|
53
|
+
[tool.poetry.dependencies]
|
|
54
|
+
python = "^3.8"
|
|
55
|
+
openshift = "^0.13.2"
|
|
56
|
+
xmltodict = "^0.13.0"
|
|
57
|
+
colorlog = "^6.7.0"
|
|
58
|
+
kubernetes = "^27.2.0"
|
|
59
|
+
python-benedict = "^0.32.0"
|
|
60
|
+
packaging = "^23.1"
|
|
61
|
+
python-simple-logger = "^1.0.5"
|
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: openshift-python-wrapper
|
|
3
|
-
Version: 4.11.60
|
|
4
|
-
Summary: Wrapper around https://github.com/openshift/openshift-restclient-python
|
|
5
|
-
Author-email: Meni Yakove <myakove@gmail.com>, Ruth Netser <rnetser@gmail.com>
|
|
6
|
-
Project-URL: Homepage, https://github.com/RedHatQE/openshift-python-wrapper
|
|
7
|
-
Project-URL: Download, https://pypi.org/project/openshift-python-wrapper/
|
|
8
|
-
Project-URL: Bug Tracker, https://github.com/RedHatQE/openshift-python-wrapper/issues
|
|
9
|
-
Project-URL: Documentation, https://openshift-python-wrapper.readthedocs.io/en/latest/
|
|
10
|
-
Keywords: Openshift,Kubevirt,CNV
|
|
11
|
-
Classifier: Programming Language :: Python :: 3
|
|
12
|
-
Classifier: Operating System :: OS Independent
|
|
13
|
-
Requires-Python: >=3.7
|
|
14
|
-
Description-Content-Type: text/markdown
|
|
15
|
-
License-File: LICENSE
|
|
16
|
-
|
|
17
|
-
# openshift-python-wrapper
|
|
18
|
-
Pypi: [openshift-python-wrapper](https://pypi.org/project/openshift-python-wrapper)
|
|
19
|
-
A python wrapper for [openshift-restclient-python](https://github.com/openshift/openshift-restclient-python) with support for RedHat Container Virtualization. ([Openshift Virtualization](https://www.openshift.com/learn/topics/virtualization))
|
|
20
|
-
Docs: [openshift-python-wrapper docs](https://openshift-python-wrapper.readthedocs.io/en/latest/)
|
|
21
|
-
|
|
22
|
-
## Installation
|
|
23
|
-
From source:
|
|
24
|
-
```bash
|
|
25
|
-
git clone https://github.com/RedHatQE/openshift-python-wrapper.git
|
|
26
|
-
cd openshift-python-wrapper
|
|
27
|
-
python setup.py install --user
|
|
28
|
-
```
|
|
29
|
-
From pypi:
|
|
30
|
-
```bash
|
|
31
|
-
pip install openshift-python-wrapper --user
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
## Release new version
|
|
35
|
-
### requirements:
|
|
36
|
-
* Export GitHub token
|
|
37
|
-
```bash
|
|
38
|
-
export GITHUB_TOKEN=<your_github_token>
|
|
39
|
-
```
|
|
40
|
-
* [release-it](https://github.com/release-it/release-it)
|
|
41
|
-
```bash
|
|
42
|
-
sudo npm install --global release-it
|
|
43
|
-
npm install --save-dev @release-it/bumper
|
|
44
|
-
```
|
|
45
|
-
### usage:
|
|
46
|
-
* Create a release, run from the relevant branch.
|
|
47
|
-
To create a 4.11 release, run:
|
|
48
|
-
```bash
|
|
49
|
-
git checkout v4.11
|
|
50
|
-
git pull
|
|
51
|
-
release-it # Follow the instructions
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
## docs
|
|
55
|
-
Hosted on readthedocs.io [openshift-python-wrapper](https://openshift-python-wrapper.readthedocs.io/en/latest/)
|
|
56
|
-
|
|
57
|
-
## PR dependency
|
|
58
|
-
For PR dependency we use [dpulls](https://www.dpulls.com/)
|
|
59
|
-
To make PR depends on other PR add `depends on #<PR NUMBER>` in the PR description.
|
|
60
|
-
|
|
61
|
-
## Logging configuration
|
|
62
|
-
To change log level export OPENSHIFT_PYTHON_WRAPPER_LOG_LEVEL:
|
|
63
|
-
|
|
64
|
-
```bash
|
|
65
|
-
export OPENSHIFT_PYTHON_WRAPPER_LOG_LEVEL=<LOG_LEVEL> # can be: "DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
## Examples
|
|
69
|
-
### Client
|
|
70
|
-
```python
|
|
71
|
-
client = DynamicClient(client=kubernetes.config.new_client_from_config())
|
|
72
|
-
```
|
|
73
|
-
The examples given below are relevant to all resources. For simplicity we will use the resource - Namespace.
|
|
74
|
-
### Import
|
|
75
|
-
Import Namespace:
|
|
76
|
-
```python
|
|
77
|
-
from resources.namespace import Namespace
|
|
78
|
-
```
|
|
79
|
-
### Create
|
|
80
|
-
Create a Namespace:
|
|
81
|
-
```python
|
|
82
|
-
ns = Namespace(name="namespace-example-1")
|
|
83
|
-
ns.create()
|
|
84
|
-
```
|
|
85
|
-
Will return ``True`` if creation succeeded.
|
|
86
|
-
|
|
87
|
-
We can also use the ``with`` statement which ensures automatic clean-up of the code executed:
|
|
88
|
-
```python
|
|
89
|
-
with Namespace(name="namespace-example-2") as ns:
|
|
90
|
-
yield ns
|
|
91
|
-
```
|
|
92
|
-
``teardown=False`` - Disables clean-up after execution.
|
|
93
|
-
### Wait
|
|
94
|
-
Wait for Namespace to be in status ``Active``:
|
|
95
|
-
```python
|
|
96
|
-
ns.wait_for_status(status=Namespace.Status.ACTIVE, timeout=120)
|
|
97
|
-
```
|
|
98
|
-
Will raise a ``TimeoutExpiredError`` if Namespace is not in the desired status.
|
|
99
|
-
### Delete
|
|
100
|
-
Delete the Namespace
|
|
101
|
-
```python
|
|
102
|
-
ns.delete()
|
|
103
|
-
```
|
|
104
|
-
Will return ``False`` if not found.
|
|
105
|
-
### Exists
|
|
106
|
-
Checks if Namespace exists on the server:
|
|
107
|
-
```python
|
|
108
|
-
ns.exists
|
|
109
|
-
```
|
|
110
|
-
Will return ``None`` if not found.
|
|
111
|
-
### Get
|
|
112
|
-
Query to get Pods (resource) in the connected cluster with label of ``label_example=example``. Returns a ``generator`` of the resource - ``pod``
|
|
113
|
-
```python
|
|
114
|
-
for pod in Pod.get(dyn_client=client, label_selector="label_example=example")):
|
|
115
|
-
pod.log()
|
|
116
|
-
```
|
|
117
|
-
We can also get the name of the Node that the ``pod`` is running on:
|
|
118
|
-
```python
|
|
119
|
-
pod.node.name
|
|
120
|
-
```
|
|
121
|
-
### VM
|
|
122
|
-
Start:
|
|
123
|
-
```python
|
|
124
|
-
with VirtualMachine(
|
|
125
|
-
name="vm-example",
|
|
126
|
-
namespace="namespace-example",
|
|
127
|
-
node_selector="worker-node-example",
|
|
128
|
-
) as vm:
|
|
129
|
-
vm.start()
|
|
130
|
-
```
|
|
131
|
-
Stop:
|
|
132
|
-
```python
|
|
133
|
-
vm.stop()
|
|
134
|
-
```
|
|
135
|
-
Restart:
|
|
136
|
-
```python
|
|
137
|
-
vm.restart()
|
|
138
|
-
```
|
|
139
|
-
Get VMI:
|
|
140
|
-
```python
|
|
141
|
-
test_vmi = vm.vmi
|
|
142
|
-
```
|
|
143
|
-
After having a VMI, we can wait until VMI is in running state:
|
|
144
|
-
```python
|
|
145
|
-
test_vmi.wait_until_running()
|
|
146
|
-
```
|
|
147
|
-
Will raise ``TimeoutExpiredError`` if VMI failed to run.
|
|
148
|
-
|
|
149
|
-
Then, we can get the Pod that is in Running state and execute a command on it:
|
|
150
|
-
```python
|
|
151
|
-
command_output = test_vmi.virt_launcher_pod.execute(command="command-example")
|
|
152
|
-
```
|
|
153
|
-
If no Pod was found, will raise ``ResourceNotFoundError``.
|
|
154
|
-
|
|
155
|
-
### NNCP Capture Syntax
|
|
156
|
-
Using capture syntax to switch ipv4 config between interfaces
|
|
157
|
-
```python
|
|
158
|
-
with NodeNetworkConfigurationPolicy(
|
|
159
|
-
name="capture_nncp",
|
|
160
|
-
capture={'first-nic': 'interfaces.name=="ens8"',
|
|
161
|
-
'second-nic': 'interfaces.name=="ens9"'},
|
|
162
|
-
teardown=False, # Capture doesn't support reverting config on teardown
|
|
163
|
-
...
|
|
164
|
-
) as nncp:
|
|
165
|
-
nncp.add_interface(name="{{ capture.first-nic.interfaces.0.name }}", set_ipv4="{{ capture.second-nic.interfaces.0.ipv4 }}")
|
|
166
|
-
nncp.add_interface(name="{{ capture.second-nic.interfaces.0.name }}", set_ipv4="{{ capture.first-nic.interfaces.0.ipv4 }}")
|
|
167
|
-
yield nncp
|
|
168
|
-
```
|
|
169
|
-
|
|
170
|
-
## Code check
|
|
171
|
-
We use pre-commit for code check.
|
|
172
|
-
```bash
|
|
173
|
-
pre-commit install
|
|
174
|
-
```
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
4.11.60
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
LICENSE
|
|
2
|
-
README.md
|
|
3
|
-
VERSION
|
|
4
|
-
pyproject.toml
|
|
5
|
-
ocp_resources/__init__.py
|
|
6
|
-
ocp_resources/api_service.py
|
|
7
|
-
ocp_resources/backup.py
|
|
8
|
-
ocp_resources/benchmark.py
|
|
9
|
-
ocp_resources/catalog_source.py
|
|
10
|
-
ocp_resources/catalog_source_config.py
|
|
11
|
-
ocp_resources/cdi.py
|
|
12
|
-
ocp_resources/cdi_config.py
|
|
13
|
-
ocp_resources/chaos_engine.py
|
|
14
|
-
ocp_resources/chaos_result.py
|
|
15
|
-
ocp_resources/cluster_operator.py
|
|
16
|
-
ocp_resources/cluster_role.py
|
|
17
|
-
ocp_resources/cluster_role_binding.py
|
|
18
|
-
ocp_resources/cluster_service_version.py
|
|
19
|
-
ocp_resources/cluster_version.py
|
|
20
|
-
ocp_resources/configmap.py
|
|
21
|
-
ocp_resources/console_cli_download.py
|
|
22
|
-
ocp_resources/console_plugin.py
|
|
23
|
-
ocp_resources/console_quick_start.py
|
|
24
|
-
ocp_resources/constants.py
|
|
25
|
-
ocp_resources/csidriver.py
|
|
26
|
-
ocp_resources/custom_resource_definition.py
|
|
27
|
-
ocp_resources/daemonset.py
|
|
28
|
-
ocp_resources/data_import_cron.py
|
|
29
|
-
ocp_resources/data_source.py
|
|
30
|
-
ocp_resources/datavolume.py
|
|
31
|
-
ocp_resources/deployment.py
|
|
32
|
-
ocp_resources/destination_rule.py
|
|
33
|
-
ocp_resources/event.py
|
|
34
|
-
ocp_resources/forklift_controller.py
|
|
35
|
-
ocp_resources/gateway.py
|
|
36
|
-
ocp_resources/hook.py
|
|
37
|
-
ocp_resources/host.py
|
|
38
|
-
ocp_resources/hostpath_provisioner.py
|
|
39
|
-
ocp_resources/hyperconverged.py
|
|
40
|
-
ocp_resources/image.py
|
|
41
|
-
ocp_resources/image_content_source_policy.py
|
|
42
|
-
ocp_resources/image_stream.py
|
|
43
|
-
ocp_resources/imagestreamtag.py
|
|
44
|
-
ocp_resources/infrastructure.py
|
|
45
|
-
ocp_resources/installplan.py
|
|
46
|
-
ocp_resources/job.py
|
|
47
|
-
ocp_resources/kube_descheduler.py
|
|
48
|
-
ocp_resources/kubevirt.py
|
|
49
|
-
ocp_resources/kubevirt_common_templates_bundle.py
|
|
50
|
-
ocp_resources/kubevirt_metrics_aggregation.py
|
|
51
|
-
ocp_resources/kubevirt_node_labeller_bundle.py
|
|
52
|
-
ocp_resources/kubevirt_template_validaotr.py
|
|
53
|
-
ocp_resources/logger.py
|
|
54
|
-
ocp_resources/machine.py
|
|
55
|
-
ocp_resources/machine_config.py
|
|
56
|
-
ocp_resources/machine_config_pool.py
|
|
57
|
-
ocp_resources/machine_health_check.py
|
|
58
|
-
ocp_resources/machine_set.py
|
|
59
|
-
ocp_resources/migration.py
|
|
60
|
-
ocp_resources/migration_policy.py
|
|
61
|
-
ocp_resources/mtv.py
|
|
62
|
-
ocp_resources/mutating_webhook_config.py
|
|
63
|
-
ocp_resources/namespace.py
|
|
64
|
-
ocp_resources/network.py
|
|
65
|
-
ocp_resources/network_addons_config.py
|
|
66
|
-
ocp_resources/network_attachment_definition.py
|
|
67
|
-
ocp_resources/network_map.py
|
|
68
|
-
ocp_resources/network_policy.py
|
|
69
|
-
ocp_resources/nmstate.py
|
|
70
|
-
ocp_resources/node.py
|
|
71
|
-
ocp_resources/node_health_check.py
|
|
72
|
-
ocp_resources/node_maintenance.py
|
|
73
|
-
ocp_resources/node_network_configuration_enactment.py
|
|
74
|
-
ocp_resources/node_network_configuration_policy.py
|
|
75
|
-
ocp_resources/node_network_state.py
|
|
76
|
-
ocp_resources/oauth.py
|
|
77
|
-
ocp_resources/operator_condition.py
|
|
78
|
-
ocp_resources/operator_group.py
|
|
79
|
-
ocp_resources/operator_hub.py
|
|
80
|
-
ocp_resources/operator_source.py
|
|
81
|
-
ocp_resources/package_manifest.py
|
|
82
|
-
ocp_resources/peer_authentication.py
|
|
83
|
-
ocp_resources/persistent_volume.py
|
|
84
|
-
ocp_resources/persistent_volume_claim.py
|
|
85
|
-
ocp_resources/plan.py
|
|
86
|
-
ocp_resources/pod.py
|
|
87
|
-
ocp_resources/pod_disruption_budget.py
|
|
88
|
-
ocp_resources/priority_class.py
|
|
89
|
-
ocp_resources/project.py
|
|
90
|
-
ocp_resources/prometheus.py
|
|
91
|
-
ocp_resources/prometheus_rule.py
|
|
92
|
-
ocp_resources/provider.py
|
|
93
|
-
ocp_resources/replicaset.py
|
|
94
|
-
ocp_resources/resource.py
|
|
95
|
-
ocp_resources/restore.py
|
|
96
|
-
ocp_resources/role.py
|
|
97
|
-
ocp_resources/role_binding.py
|
|
98
|
-
ocp_resources/route.py
|
|
99
|
-
ocp_resources/secret.py
|
|
100
|
-
ocp_resources/security_context_constraints.py
|
|
101
|
-
ocp_resources/service.py
|
|
102
|
-
ocp_resources/service_account.py
|
|
103
|
-
ocp_resources/service_mesh_control_plane.py
|
|
104
|
-
ocp_resources/service_mesh_member_roll.py
|
|
105
|
-
ocp_resources/service_monitor.py
|
|
106
|
-
ocp_resources/sriov_network.py
|
|
107
|
-
ocp_resources/sriov_network_node_policy.py
|
|
108
|
-
ocp_resources/sriov_network_node_state.py
|
|
109
|
-
ocp_resources/ssp.py
|
|
110
|
-
ocp_resources/storage_class.py
|
|
111
|
-
ocp_resources/storage_map.py
|
|
112
|
-
ocp_resources/storage_profile.py
|
|
113
|
-
ocp_resources/subscription.py
|
|
114
|
-
ocp_resources/tekton_tasks.py
|
|
115
|
-
ocp_resources/template.py
|
|
116
|
-
ocp_resources/upload_token_request.py
|
|
117
|
-
ocp_resources/utils.py
|
|
118
|
-
ocp_resources/validating_webhook_config.py
|
|
119
|
-
ocp_resources/virtual_machine.py
|
|
120
|
-
ocp_resources/virtual_machine_Instance_replica_set.py
|
|
121
|
-
ocp_resources/virtual_machine_cluster_flavor.py
|
|
122
|
-
ocp_resources/virtual_machine_flavor.py
|
|
123
|
-
ocp_resources/virtual_machine_import.py
|
|
124
|
-
ocp_resources/virtual_machine_instance.py
|
|
125
|
-
ocp_resources/virtual_machine_instance_migration.py
|
|
126
|
-
ocp_resources/virtual_machine_instance_preset.py
|
|
127
|
-
ocp_resources/virtual_machine_restore.py
|
|
128
|
-
ocp_resources/virtual_machine_snapshot.py
|
|
129
|
-
ocp_resources/virtual_service.py
|
|
130
|
-
ocp_resources/vm_import_config.py
|
|
131
|
-
ocp_resources/volume_snapshot.py
|
|
132
|
-
ocp_resources/volume_snapshot_class.py
|
|
133
|
-
openshift_python_wrapper.egg-info/PKG-INFO
|
|
134
|
-
openshift_python_wrapper.egg-info/SOURCES.txt
|
|
135
|
-
openshift_python_wrapper.egg-info/dependency_links.txt
|
|
136
|
-
openshift_python_wrapper.egg-info/requires.txt
|
|
137
|
-
openshift_python_wrapper.egg-info/top_level.txt
|
|
138
|
-
tests/test_resources.py
|
|
139
|
-
tests/test_validate_resources.py
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
ocp_resources
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
[tool.black]
|
|
2
|
-
line-length = 88
|
|
3
|
-
|
|
4
|
-
[build-system]
|
|
5
|
-
requires = ["setuptools>=61.2"]
|
|
6
|
-
build-backend = "setuptools.build_meta"
|
|
7
|
-
|
|
8
|
-
[project]
|
|
9
|
-
name = "openshift-python-wrapper"
|
|
10
|
-
authors = [
|
|
11
|
-
{name = "Meni Yakove", email = "myakove@gmail.com"},
|
|
12
|
-
{name = "Ruth Netser", email = "rnetser@gmail.com"}
|
|
13
|
-
]
|
|
14
|
-
description = "Wrapper around https://github.com/openshift/openshift-restclient-python"
|
|
15
|
-
classifiers = [
|
|
16
|
-
"Programming Language :: Python :: 3",
|
|
17
|
-
"Operating System :: OS Independent",
|
|
18
|
-
]
|
|
19
|
-
requires-python = ">=3.7"
|
|
20
|
-
keywords = ["Openshift", "Kubevirt", "CNV"]
|
|
21
|
-
dependencies = [
|
|
22
|
-
"openshift",
|
|
23
|
-
"xmltodict",
|
|
24
|
-
"urllib3",
|
|
25
|
-
"colorlog",
|
|
26
|
-
"packaging",
|
|
27
|
-
]
|
|
28
|
-
dynamic = ["version"]
|
|
29
|
-
# ...
|
|
30
|
-
[tool.setuptools.dynamic]
|
|
31
|
-
version = {file = "VERSION"}
|
|
32
|
-
|
|
33
|
-
[project.readme]
|
|
34
|
-
file = "README.md"
|
|
35
|
-
content-type = "text/markdown"
|
|
36
|
-
|
|
37
|
-
[project.urls]
|
|
38
|
-
Homepage = "https://github.com/RedHatQE/openshift-python-wrapper"
|
|
39
|
-
Download = "https://pypi.org/project/openshift-python-wrapper/"
|
|
40
|
-
"Bug Tracker" = "https://github.com/RedHatQE/openshift-python-wrapper/issues"
|
|
41
|
-
Documentation = "https://openshift-python-wrapper.readthedocs.io/en/latest/"
|
|
42
|
-
|
|
43
|
-
[tool.setuptools]
|
|
44
|
-
include-package-data = true
|
|
45
|
-
|
|
46
|
-
[tool.setuptools.packages.find]
|
|
47
|
-
include = ["ocp_resources"]
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import kubernetes
|
|
2
|
-
import pytest
|
|
3
|
-
from openshift.dynamic import DynamicClient
|
|
4
|
-
|
|
5
|
-
from ocp_resources.namespace import Namespace
|
|
6
|
-
from ocp_resources.pod import Pod
|
|
7
|
-
from ocp_resources.virtual_machine import VirtualMachine
|
|
8
|
-
from tests.utils import generate_yaml_from_template
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
@pytest.fixture(scope="session")
|
|
12
|
-
def client():
|
|
13
|
-
return DynamicClient(client=kubernetes.config.new_client_from_config())
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
@pytest.fixture(scope="session")
|
|
17
|
-
def namespace():
|
|
18
|
-
with Namespace(name="namespace-for-tests") as ns:
|
|
19
|
-
yield ns
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
def test_get(client):
|
|
23
|
-
Pod.get(dyn_client=client)
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
def test_create():
|
|
27
|
-
with Namespace(name="test-namespace"):
|
|
28
|
-
pass
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
def test_vm(namespace):
|
|
32
|
-
name = "test-vm"
|
|
33
|
-
with VirtualMachine(
|
|
34
|
-
name=name, namespace=namespace.name, body=generate_yaml_from_template(name=name)
|
|
35
|
-
):
|
|
36
|
-
pass
|
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
# This test uses https://github.com/RedHatQE/openshift-resources-definitions to get resource definitions json file
|
|
2
|
-
# File: resources_definitions.json
|
|
3
|
-
|
|
4
|
-
import ast
|
|
5
|
-
import json
|
|
6
|
-
import os
|
|
7
|
-
|
|
8
|
-
import pytest
|
|
9
|
-
import requests
|
|
10
|
-
|
|
11
|
-
from ocp_resources.resource import Resource # noqa
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
def _api_group_name(api_value):
|
|
15
|
-
try:
|
|
16
|
-
return eval(f"Resource.ApiGroup.{api_value}")
|
|
17
|
-
except AttributeError:
|
|
18
|
-
return api_value
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
def _api_group_dict(resource_dict, api_group_name):
|
|
22
|
-
resource_dict_api_group = resource_dict["api_group"]
|
|
23
|
-
api_group = resource_dict_api_group.get(api_group_name)
|
|
24
|
-
if not api_group:
|
|
25
|
-
try:
|
|
26
|
-
api_group = resource_dict_api_group["null"]
|
|
27
|
-
except KeyError:
|
|
28
|
-
api_group = resource_dict_api_group[[*resource_dict_api_group][0]]
|
|
29
|
-
|
|
30
|
-
return api_group
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
def _process_api_type(api_type, api_value, resource_dict, cls):
|
|
34
|
-
if api_type == "api_group":
|
|
35
|
-
return _get_api_group(
|
|
36
|
-
api_value=api_value,
|
|
37
|
-
cls=cls,
|
|
38
|
-
resource_dict=resource_dict,
|
|
39
|
-
)
|
|
40
|
-
|
|
41
|
-
if api_type == "api_version":
|
|
42
|
-
return _get_api_version(
|
|
43
|
-
api_value=api_value,
|
|
44
|
-
cls=cls,
|
|
45
|
-
resource_dict=resource_dict,
|
|
46
|
-
)
|
|
47
|
-
|
|
48
|
-
return [f"Resource {cls.name} must have api_group or api_version"]
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
def _get_api_group_and_version(bodies):
|
|
52
|
-
for targets in bodies:
|
|
53
|
-
api_type = targets.targets[0].id
|
|
54
|
-
return api_type, getattr(
|
|
55
|
-
targets.value, "attr", getattr(targets.value, "s", None)
|
|
56
|
-
)
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
def _get_namespaced(cls, resource_dict, api_value):
|
|
60
|
-
errors = []
|
|
61
|
-
for base in getattr(cls, "bases", []):
|
|
62
|
-
api_group_name = _api_group_name(api_value=api_value)
|
|
63
|
-
namespaced = base.id == "NamespacedResource"
|
|
64
|
-
api_group = _api_group_dict(
|
|
65
|
-
resource_dict=resource_dict, api_group_name=api_group_name
|
|
66
|
-
)
|
|
67
|
-
should_be_namespaced = api_group["namespaced"] == "true"
|
|
68
|
-
|
|
69
|
-
if namespaced != should_be_namespaced:
|
|
70
|
-
errors.append(
|
|
71
|
-
f"Resource {cls.name} should be "
|
|
72
|
-
f"{'namespaced' if should_be_namespaced else 'in cluster scope (not namespaced)'}"
|
|
73
|
-
)
|
|
74
|
-
return errors
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
def _get_api_group(api_value, cls, resource_dict):
|
|
78
|
-
errors = []
|
|
79
|
-
api_group_name = _api_group_name(api_value=api_value)
|
|
80
|
-
|
|
81
|
-
if api_group_name not in resource_dict["api_group"]:
|
|
82
|
-
errors.append(
|
|
83
|
-
f"Resource {cls.name} api_group should be "
|
|
84
|
-
f"{resource_dict['api_group']}. got {api_group_name}"
|
|
85
|
-
)
|
|
86
|
-
return errors
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
def _get_api_version(api_value, cls, resource_dict):
|
|
90
|
-
errors = []
|
|
91
|
-
api_group_name = _api_group_name(api_value=api_value)
|
|
92
|
-
api_group = _api_group_dict(
|
|
93
|
-
resource_dict=resource_dict, api_group_name=api_group_name
|
|
94
|
-
)
|
|
95
|
-
if api_value.lower() != api_group["api_version"]:
|
|
96
|
-
desire_api_group = resource_dict["api_version"].split("/")[0]
|
|
97
|
-
errors.append(
|
|
98
|
-
f"Resource {cls.name} have api_version {api_value} "
|
|
99
|
-
f"but should have api_group = {desire_api_group}"
|
|
100
|
-
)
|
|
101
|
-
|
|
102
|
-
return errors
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
def _resource_file():
|
|
106
|
-
ocp_resources_exclude_files = ["resource.py", "utils.py", "__init__.py"]
|
|
107
|
-
for root, dirs, files in os.walk("ocp_resources"):
|
|
108
|
-
for _file in files:
|
|
109
|
-
if _file in ocp_resources_exclude_files or not _file.endswith(".py"):
|
|
110
|
-
continue
|
|
111
|
-
yield os.path.join(root, _file)
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
@pytest.fixture()
|
|
115
|
-
def resources_definitions():
|
|
116
|
-
file_ = (
|
|
117
|
-
"https://raw.githubusercontent.com/RedHatQE/"
|
|
118
|
-
"openshift-resources-definitions/main/resources_definitions.json"
|
|
119
|
-
)
|
|
120
|
-
content = requests.get(file_).content
|
|
121
|
-
return json.loads(content)
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
@pytest.fixture()
|
|
125
|
-
def resources_definitions_errors(resources_definitions):
|
|
126
|
-
errors = []
|
|
127
|
-
for _file in _resource_file():
|
|
128
|
-
with open(_file, "r") as fd:
|
|
129
|
-
tree = ast.parse(source=fd.read())
|
|
130
|
-
classes = [cls for cls in tree.body if isinstance(cls, ast.ClassDef)]
|
|
131
|
-
for cls in classes:
|
|
132
|
-
resource_dict = resources_definitions.get(cls.name)
|
|
133
|
-
if not resource_dict:
|
|
134
|
-
continue
|
|
135
|
-
|
|
136
|
-
bodies = [
|
|
137
|
-
body_
|
|
138
|
-
for body_ in getattr(cls, "body")
|
|
139
|
-
if isinstance(body_, ast.Assign)
|
|
140
|
-
]
|
|
141
|
-
api_type, api_value = _get_api_group_and_version(bodies=bodies)
|
|
142
|
-
errors.extend(
|
|
143
|
-
_get_namespaced(
|
|
144
|
-
cls=cls, resource_dict=resource_dict, api_value=api_value
|
|
145
|
-
)
|
|
146
|
-
)
|
|
147
|
-
errors.extend(
|
|
148
|
-
_process_api_type(
|
|
149
|
-
api_type=api_type,
|
|
150
|
-
api_value=api_value,
|
|
151
|
-
resource_dict=resource_dict,
|
|
152
|
-
cls=cls,
|
|
153
|
-
)
|
|
154
|
-
)
|
|
155
|
-
return errors
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
def test_resources_definitions(resources_definitions_errors):
|
|
159
|
-
assert not resources_definitions_errors, "\n".join(resources_definitions_errors)
|
|
File without changes
|
|
File without changes
|
{openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/__init__.py
RENAMED
|
File without changes
|
{openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/api_service.py
RENAMED
|
File without changes
|
{openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/backup.py
RENAMED
|
File without changes
|
{openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/benchmark.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/cdi_config.py
RENAMED
|
File without changes
|
{openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/chaos_engine.py
RENAMED
|
File without changes
|
{openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/chaos_result.py
RENAMED
|
File without changes
|
|
File without changes
|
{openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/cluster_role.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/configmap.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/constants.py
RENAMED
|
File without changes
|
{openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/csidriver.py
RENAMED
|
File without changes
|
|
File without changes
|
{openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/daemonset.py
RENAMED
|
File without changes
|
|
File without changes
|
{openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/data_source.py
RENAMED
|
File without changes
|
{openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/datavolume.py
RENAMED
|
File without changes
|
{openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/deployment.py
RENAMED
|
File without changes
|
|
File without changes
|
{openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/event.py
RENAMED
|
File without changes
|
|
File without changes
|
{openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/gateway.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/image.py
RENAMED
|
File without changes
|
|
File without changes
|
{openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/image_stream.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/installplan.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/kubevirt.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/logger.py
RENAMED
|
File without changes
|
{openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/machine.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/machine_set.py
RENAMED
|
File without changes
|
{openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/migration.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/namespace.py
RENAMED
|
File without changes
|
{openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/network.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/network_map.py
RENAMED
|
File without changes
|
|
File without changes
|
{openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/nmstate.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/oauth.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/operator_hub.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/project.py
RENAMED
|
File without changes
|
{openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/prometheus.py
RENAMED
|
File without changes
|
|
File without changes
|
{openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/provider.py
RENAMED
|
File without changes
|
{openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/replicaset.py
RENAMED
|
File without changes
|
{openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/resource.py
RENAMED
|
File without changes
|
{openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/restore.py
RENAMED
|
File without changes
|
|
File without changes
|
{openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/role_binding.py
RENAMED
|
File without changes
|
{openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/route.py
RENAMED
|
File without changes
|
{openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/secret.py
RENAMED
|
File without changes
|
|
File without changes
|
{openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/service.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/sriov_network.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/storage_class.py
RENAMED
|
File without changes
|
{openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/storage_map.py
RENAMED
|
File without changes
|
|
File without changes
|
{openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/subscription.py
RENAMED
|
File without changes
|
{openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/tekton_tasks.py
RENAMED
|
File without changes
|
{openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/template.py
RENAMED
|
File without changes
|
|
File without changes
|
{openshift-python-wrapper-4.11.60 → openshift_python_wrapper-4.11.61}/ocp_resources/utils.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|