Coverage for ocp_resources/cdi.py: 0%

38 statements  

« prev     ^ index     » next       coverage.py v7.6.10, created at 2025-01-30 10:48 +0200

1# Generated using https://github.com/RedHatQE/openshift-python-wrapper/blob/main/scripts/resource/README.md 

2 

3from typing import Any, Dict, Optional 

4from ocp_resources.resource import Resource 

5 

6 

7class CDI(Resource): 

8 """ 

9 CDI is the CDI Operator CRD 

10 """ 

11 

12 api_group: str = Resource.ApiGroup.CDI_KUBEVIRT_IO 

13 

14 def __init__( 

15 self, 

16 cert_config: Optional[Dict[str, Any]] = None, 

17 clone_strategy_override: Optional[str] = "", 

18 config: Optional[Dict[str, Any]] = None, 

19 customize_components: Optional[Dict[str, Any]] = None, 

20 image_pull_policy: Optional[str] = "", 

21 infra: Optional[Dict[str, Any]] = None, 

22 priority_class: Optional[str] = "", 

23 uninstall_strategy: Optional[str] = "", 

24 workload: Optional[Dict[str, Any]] = None, 

25 **kwargs: Any, 

26 ) -> None: 

27 """ 

28 Args: 

29 cert_config (Dict[str, Any]): certificate configuration 

30 

31 clone_strategy_override (str): Clone strategy override: should we use a host-assisted copy even if 

32 snapshots are available? 

33 

34 config (Dict[str, Any]): CDIConfig at CDI level 

35 

36 customize_components (Dict[str, Any]): CustomizeComponents defines patches for components deployed by the CDI 

37 operator. 

38 

39 image_pull_policy (str): PullPolicy describes a policy for if/when to pull a container image 

40 

41 infra (Dict[str, Any]): Selectors and tolerations that should apply to cdi infrastructure 

42 components 

43 

44 priority_class (str): PriorityClass of the CDI control plane 

45 

46 uninstall_strategy (str): CDIUninstallStrategy defines the state to leave CDI on uninstall 

47 

48 workload (Dict[str, Any]): Restrict on which nodes CDI workload pods will be scheduled 

49 

50 """ 

51 super().__init__(**kwargs) 

52 

53 self.cert_config = cert_config 

54 self.clone_strategy_override = clone_strategy_override 

55 self.config = config 

56 self.customize_components = customize_components 

57 self.image_pull_policy = image_pull_policy 

58 self.infra = infra 

59 self.priority_class = priority_class 

60 self.uninstall_strategy = uninstall_strategy 

61 self.workload = workload 

62 

63 def to_dict(self) -> None: 

64 super().to_dict() 

65 

66 if not self.kind_dict and not self.yaml_file: 

67 self.res["spec"] = {} 

68 _spec = self.res["spec"] 

69 

70 if self.cert_config: 

71 _spec["certConfig"] = self.cert_config 

72 

73 if self.clone_strategy_override: 

74 _spec["cloneStrategyOverride"] = self.clone_strategy_override 

75 

76 if self.config: 

77 _spec["config"] = self.config 

78 

79 if self.customize_components: 

80 _spec["customizeComponents"] = self.customize_components 

81 

82 if self.image_pull_policy: 

83 _spec["imagePullPolicy"] = self.image_pull_policy 

84 

85 if self.infra: 

86 _spec["infra"] = self.infra 

87 

88 if self.priority_class: 

89 _spec["priorityClass"] = self.priority_class 

90 

91 if self.uninstall_strategy: 

92 _spec["uninstallStrategy"] = self.uninstall_strategy 

93 

94 if self.workload: 

95 _spec["workload"] = self.workload 

96 

97 # End of generated code