Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions ocp_resources/persistent_volume_claim.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ def __init__(
teardown=True,
yaml_file=None,
delete_timeout=TIMEOUT_4MINUTES,
pvlabel=None,
**kwargs,
):
super().__init__(
Expand All @@ -60,6 +61,7 @@ def __init__(
self.size = size
self.hostpath_node = hostpath_node
self.storage_class = storage_class
self.pvlabel = pvlabel

def to_dict(self):
super().to_dict()
Expand All @@ -86,6 +88,11 @@ def to_dict(self):
if self.storage_class:
self.res["spec"]["storageClassName"] = self.storage_class

if self.pvlabel:
self.res["spec"]["selector"] = {
"matchLabels": {"pvLabel": self.pvlabel}
}

def bound(self):
"""
Check if PVC is bound
Expand Down