openshift-python-wrapper 4.14.50__tar.gz → 4.14.51__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.14.50 → openshift_python_wrapper-4.14.51}/PKG-INFO +1 -1
- openshift_python_wrapper-4.14.51/ocp_resources/data_source.py +68 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/pyproject.toml +1 -1
- openshift_python_wrapper-4.14.50/ocp_resources/data_source.py +0 -59
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/LICENSE +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/README.md +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/__init__.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/api_server.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/api_service.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/backup.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/benchmark.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/catalog_source.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/catalog_source_config.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/cdi.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/cdi_config.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/chaos_engine.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/chaos_result.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/cluster_operator.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/cluster_role.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/cluster_role_binding.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/cluster_service_version.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/cluster_version.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/configmap.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/console_cli_download.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/console_plugin.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/console_quick_start.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/constants.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/controller_revision.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/cron_job.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/csi_storage_capacity.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/csidriver.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/custom_resource_definition.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/daemonset.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/data_import_cron.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/datavolume.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/deployment.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/destination_rule.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/dns.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/endpoint_slice.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/endpoints.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/event.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/forklift_controller.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/gateway.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/hook.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/host.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/hostpath_provisioner.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/hyperconverged.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/image.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/image_content_source_policy.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/image_digest_mirror_set.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/image_stream.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/imagestreamtag.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/infrastructure.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/installplan.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/ip_address_pool.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/job.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/kube_descheduler.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/kubevirt.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/kubevirt_common_templates_bundle.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/kubevirt_metrics_aggregation.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/kubevirt_node_labeller_bundle.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/kubevirt_template_validaotr.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/l2_advertisement.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/lease.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/machine.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/machine_config.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/machine_config_pool.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/machine_health_check.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/machine_set.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/managed_cluster.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/metallb.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/migration.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/migration_policy.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/mtv.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/multi_cluster_hub.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/multi_cluster_observability.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/mutating_webhook_config.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/namespace.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/network.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/network_addons_config.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/network_attachment_definition.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/network_map.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/network_policy.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/nmstate.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/node.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/node_health_check.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/node_maintenance.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/node_network_configuration_enactment.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/node_network_configuration_policy.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/node_network_state.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/oauth.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/ocs_initialization.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/operator.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/operator_condition.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/operator_group.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/operator_hub.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/operator_source.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/package_manifest.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/peer_authentication.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/persistent_volume.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/persistent_volume_claim.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/pipeline.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/pipelineruns.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/plan.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/pod.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/pod_disruption_budget.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/pod_metrics.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/priority_class.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/project.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/prometheus.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/prometheus_rule.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/provider.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/replicaset.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/resource.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/restore.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/rhmi.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/role.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/role_binding.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/route.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/scheduler.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/secret.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/security_context_constraints.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/service.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/service_account.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/service_mesh_control_plane.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/service_mesh_member_roll.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/service_monitor.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/sriov_network.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/sriov_network_node_policy.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/sriov_network_node_state.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/ssp.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/storage_class.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/storage_map.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/storage_profile.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/subscription.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/task_run.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/tekton_tasks.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/template.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/upload_token_request.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/utils.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/validating_webhook_config.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/virtual_machine.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/virtual_machine_Instance_replica_set.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/virtual_machine_clone.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/virtual_machine_cluster_instance_types.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/virtual_machine_cluster_preferences.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/virtual_machine_export.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/virtual_machine_import.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/virtual_machine_instance.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/virtual_machine_instance_migration.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/virtual_machine_instance_preset.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/virtual_machine_instance_types.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/virtual_machine_preferences.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/virtual_machine_restore.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/virtual_machine_snapshot.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/virtual_service.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/vm_import_config.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/volume_snapshot.py +0 -0
- {openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/volume_snapshot_class.py +0 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
from warnings import warn
|
|
2
|
+
from kubernetes.dynamic.exceptions import ResourceNotFoundError
|
|
3
|
+
from ocp_resources.persistent_volume_claim import PersistentVolumeClaim
|
|
4
|
+
from ocp_resources.resource import NamespacedResource
|
|
5
|
+
from ocp_resources.volume_snapshot import VolumeSnapshot
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class DataSource(NamespacedResource):
|
|
9
|
+
"""
|
|
10
|
+
DataSource object.
|
|
11
|
+
|
|
12
|
+
https://kubevirt.io/cdi-api-reference/main/definitions.html#_v1beta1_datasource
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
api_group = NamespacedResource.ApiGroup.CDI_KUBEVIRT_IO
|
|
16
|
+
|
|
17
|
+
def __init__(self, source=None, **kwargs):
|
|
18
|
+
"""
|
|
19
|
+
Args:
|
|
20
|
+
source (dict): The source of the data.
|
|
21
|
+
"""
|
|
22
|
+
super().__init__(**kwargs)
|
|
23
|
+
self._source = source
|
|
24
|
+
|
|
25
|
+
def to_dict(self):
|
|
26
|
+
super().to_dict()
|
|
27
|
+
if not self.yaml_file:
|
|
28
|
+
self.res.update(
|
|
29
|
+
{
|
|
30
|
+
"spec": {
|
|
31
|
+
"source": self.source,
|
|
32
|
+
},
|
|
33
|
+
}
|
|
34
|
+
)
|
|
35
|
+
if not self._source:
|
|
36
|
+
raise ValueError("Passing yaml_file or parameter 'source' is required")
|
|
37
|
+
|
|
38
|
+
self.res.update({"spec": {"source": self._source}})
|
|
39
|
+
|
|
40
|
+
@property
|
|
41
|
+
def pvc(self):
|
|
42
|
+
warn("pvc will be deprecated in v4.16, Use source instead", DeprecationWarning, stacklevel=2)
|
|
43
|
+
data_source_pvc = self.instance.spec.source.pvc
|
|
44
|
+
pvc_name = data_source_pvc.name
|
|
45
|
+
pvc_namespace = data_source_pvc.namespace
|
|
46
|
+
try:
|
|
47
|
+
return PersistentVolumeClaim(
|
|
48
|
+
client=self.client,
|
|
49
|
+
name=pvc_name,
|
|
50
|
+
namespace=pvc_namespace,
|
|
51
|
+
)
|
|
52
|
+
except ResourceNotFoundError:
|
|
53
|
+
self.logger.warning(
|
|
54
|
+
f"dataSource {self.name} is pointing to a non-existing PVC, name:"
|
|
55
|
+
f" {pvc_name}, namespace: {pvc_namespace}"
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
@property
|
|
59
|
+
def source(self):
|
|
60
|
+
_instance_source = self.instance.spec.source
|
|
61
|
+
_source = [*_instance_source][0][0]
|
|
62
|
+
_source_mapping = {"pvc": PersistentVolumeClaim, "snapshot": VolumeSnapshot}
|
|
63
|
+
|
|
64
|
+
return _source_mapping[_source](
|
|
65
|
+
client=self.client,
|
|
66
|
+
name=_instance_source[_source].name,
|
|
67
|
+
namespace=_instance_source[_source].namespace,
|
|
68
|
+
)
|
|
@@ -9,7 +9,7 @@ exclude = [".git", ".venv", ".mypy_cache", ".tox", "__pycache__"]
|
|
|
9
9
|
|
|
10
10
|
[tool.poetry]
|
|
11
11
|
name = "openshift-python-wrapper"
|
|
12
|
-
version = "4.14.
|
|
12
|
+
version = "4.14.51"
|
|
13
13
|
description = "Wrapper around https://github.com/openshift/openshift-restclient-python"
|
|
14
14
|
authors = ["Meni Yakove <myakove@gmail.com>", "Ruth Netser <rnetser@gmail.com>"]
|
|
15
15
|
readme = "README.md"
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
from openshift.dynamic.exceptions import ResourceNotFoundError
|
|
2
|
-
|
|
3
|
-
from ocp_resources.constants import TIMEOUT_4MINUTES
|
|
4
|
-
from ocp_resources.persistent_volume_claim import PersistentVolumeClaim
|
|
5
|
-
from ocp_resources.resource import NamespacedResource
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
class DataSource(NamespacedResource):
|
|
9
|
-
api_group = NamespacedResource.ApiGroup.CDI_KUBEVIRT_IO
|
|
10
|
-
|
|
11
|
-
def __init__(
|
|
12
|
-
self,
|
|
13
|
-
name=None,
|
|
14
|
-
namespace=None,
|
|
15
|
-
client=None,
|
|
16
|
-
source=None,
|
|
17
|
-
teardown=True,
|
|
18
|
-
yaml_file=None,
|
|
19
|
-
delete_timeout=TIMEOUT_4MINUTES,
|
|
20
|
-
**kwargs,
|
|
21
|
-
):
|
|
22
|
-
super().__init__(
|
|
23
|
-
name=name,
|
|
24
|
-
namespace=namespace,
|
|
25
|
-
client=client,
|
|
26
|
-
teardown=teardown,
|
|
27
|
-
yaml_file=yaml_file,
|
|
28
|
-
delete_timeout=delete_timeout,
|
|
29
|
-
**kwargs,
|
|
30
|
-
)
|
|
31
|
-
self.source = source
|
|
32
|
-
|
|
33
|
-
def to_dict(self):
|
|
34
|
-
super().to_dict()
|
|
35
|
-
if not self.yaml_file:
|
|
36
|
-
self.res.update(
|
|
37
|
-
{
|
|
38
|
-
"spec": {
|
|
39
|
-
"source": self.source,
|
|
40
|
-
},
|
|
41
|
-
}
|
|
42
|
-
)
|
|
43
|
-
|
|
44
|
-
@property
|
|
45
|
-
def pvc(self):
|
|
46
|
-
data_source_pvc = self.instance.spec.source.pvc
|
|
47
|
-
pvc_name = data_source_pvc.name
|
|
48
|
-
pvc_namespace = data_source_pvc.namespace
|
|
49
|
-
try:
|
|
50
|
-
return PersistentVolumeClaim(
|
|
51
|
-
client=self.client,
|
|
52
|
-
name=pvc_name,
|
|
53
|
-
namespace=pvc_namespace,
|
|
54
|
-
)
|
|
55
|
-
except ResourceNotFoundError:
|
|
56
|
-
self.logger.warning(
|
|
57
|
-
f"dataSource {self.name} is pointing to a non-existing PVC, name:"
|
|
58
|
-
f" {pvc_name}, namespace: {pvc_namespace}"
|
|
59
|
-
)
|
|
File without changes
|
|
File without changes
|
{openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/__init__.py
RENAMED
|
File without changes
|
{openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/api_server.py
RENAMED
|
File without changes
|
{openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/api_service.py
RENAMED
|
File without changes
|
{openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/backup.py
RENAMED
|
File without changes
|
{openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/benchmark.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/cdi_config.py
RENAMED
|
File without changes
|
{openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/chaos_engine.py
RENAMED
|
File without changes
|
{openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/chaos_result.py
RENAMED
|
File without changes
|
|
File without changes
|
{openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/cluster_role.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/configmap.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/constants.py
RENAMED
|
File without changes
|
|
File without changes
|
{openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/cron_job.py
RENAMED
|
File without changes
|
|
File without changes
|
{openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/csidriver.py
RENAMED
|
File without changes
|
|
File without changes
|
{openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/daemonset.py
RENAMED
|
File without changes
|
|
File without changes
|
{openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/datavolume.py
RENAMED
|
File without changes
|
{openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/deployment.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/endpoints.py
RENAMED
|
File without changes
|
{openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/event.py
RENAMED
|
File without changes
|
|
File without changes
|
{openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/gateway.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/image.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/image_stream.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/installplan.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/kubevirt.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/lease.py
RENAMED
|
File without changes
|
{openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/machine.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/machine_set.py
RENAMED
|
File without changes
|
|
File without changes
|
{openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/metallb.py
RENAMED
|
File without changes
|
{openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/migration.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/namespace.py
RENAMED
|
File without changes
|
{openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/network.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/network_map.py
RENAMED
|
File without changes
|
|
File without changes
|
{openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/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.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/oauth.py
RENAMED
|
File without changes
|
|
File without changes
|
{openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/operator.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/operator_hub.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/pipeline.py
RENAMED
|
File without changes
|
{openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/pipelineruns.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/pod_metrics.py
RENAMED
|
File without changes
|
|
File without changes
|
{openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/project.py
RENAMED
|
File without changes
|
{openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/prometheus.py
RENAMED
|
File without changes
|
|
File without changes
|
{openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/provider.py
RENAMED
|
File without changes
|
{openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/replicaset.py
RENAMED
|
File without changes
|
{openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/resource.py
RENAMED
|
File without changes
|
{openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/restore.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/role_binding.py
RENAMED
|
File without changes
|
{openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/route.py
RENAMED
|
File without changes
|
{openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/scheduler.py
RENAMED
|
File without changes
|
{openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/secret.py
RENAMED
|
File without changes
|
|
File without changes
|
{openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/service.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/sriov_network.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/storage_class.py
RENAMED
|
File without changes
|
{openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/storage_map.py
RENAMED
|
File without changes
|
|
File without changes
|
{openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/subscription.py
RENAMED
|
File without changes
|
{openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/task_run.py
RENAMED
|
File without changes
|
{openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/tekton_tasks.py
RENAMED
|
File without changes
|
{openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/ocp_resources/template.py
RENAMED
|
File without changes
|
|
File without changes
|
{openshift_python_wrapper-4.14.50 → openshift_python_wrapper-4.14.51}/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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|