Skip to content

Commit b78fd86

Browse files
committed
Update golden images to use dataSources
Auto-update boot sources introduce a new CRD - dataSources. Common templates reference dataSources as pointers to actual golden images PVCs which will be cloned for the VM. Require: #230
1 parent bd4d029 commit b78fd86

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

ocp_resources/data_source.py

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
from ocp_resources.resource import NamespacedResource
2+
3+
4+
class DataSource(NamespacedResource):
5+
"""
6+
DataSource object
7+
"""
8+
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+
):
20+
super().__init__(
21+
name=name,
22+
namespace=namespace,
23+
client=client,
24+
teardown=teardown,
25+
yaml_file=yaml_file,
26+
)
27+
self.source = source
28+
29+
def to_dict(self):
30+
res = super().to_dict()
31+
if self.yaml_file:
32+
return res
33+
34+
res.update(
35+
{
36+
"spec": {
37+
"source": self.source,
38+
},
39+
}
40+
)
41+
42+
return res

0 commit comments

Comments
 (0)