Coverage for ocp_resources/aaq.py: 0%

32 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 AAQ(Resource): 

8 """ 

9 AAQ is the AAQ Operator CRD 

10 """ 

11 

12 api_group: str = Resource.ApiGroup.AAQ_KUBEVIRT_IO 

13 

14 def __init__( 

15 self, 

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

17 configuration: Optional[Dict[str, Any]] = None, 

18 image_pull_policy: Optional[str] = "", 

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

20 namespace_selector: Optional[Dict[str, Any]] = None, 

21 priority_class: Optional[str] = "", 

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

23 **kwargs: Any, 

24 ) -> None: 

25 """ 

26 Args: 

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

28 

29 configuration (Dict[str, Any]): holds aaq configurations. 

30 

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

32 

33 infra (Dict[str, Any]): Rules on which nodes AAQ infrastructure pods will be scheduled 

34 

35 namespace_selector (Dict[str, Any]): namespaces where pods should be gated before scheduling Defaults to 

36 targeting namespaces with an "application-aware-quota/enable- 

37 gating" label key. 

38 

39 priority_class (str): PriorityClass of the AAQ control plane 

40 

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

42 

43 """ 

44 super().__init__(**kwargs) 

45 

46 self.cert_config = cert_config 

47 self.configuration = configuration 

48 self.image_pull_policy = image_pull_policy 

49 self.infra = infra 

50 self.namespace_selector = namespace_selector 

51 self.priority_class = priority_class 

52 self.workload = workload 

53 

54 def to_dict(self) -> None: 

55 super().to_dict() 

56 

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

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

59 _spec = self.res["spec"] 

60 

61 if self.cert_config: 

62 _spec["certConfig"] = self.cert_config 

63 

64 if self.configuration: 

65 _spec["configuration"] = self.configuration 

66 

67 if self.image_pull_policy: 

68 _spec["imagePullPolicy"] = self.image_pull_policy 

69 

70 if self.infra: 

71 _spec["infra"] = self.infra 

72 

73 if self.namespace_selector: 

74 _spec["namespaceSelector"] = self.namespace_selector 

75 

76 if self.priority_class: 

77 _spec["priorityClass"] = self.priority_class 

78 

79 if self.workload: 

80 _spec["workload"] = self.workload 

81 

82 # End of generated code