Coverage for ocp_resources/dns_config_openshift_io.py: 0%

23 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 DNS(Resource): 

8 """ 

9 DNS holds cluster-wide information about DNS. The canonical name is `cluster` 

10 Compatibility level 1: Stable within a major release for a minimum of 12 months or 3 minor releases (whichever is longer). 

11 """ 

12 

13 api_group: str = Resource.ApiGroup.CONFIG_OPENSHIFT_IO 

14 

15 def __init__( 

16 self, 

17 base_domain: Optional[str] = "", 

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

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

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

21 **kwargs: Any, 

22 ) -> None: 

23 """ 

24 Args: 

25 base_domain (str): baseDomain is the base domain of the cluster. All managed DNS records 

26 will be sub-domains of this base. For example, given the base 

27 domain `openshift.example.com`, an API server DNS record may be 

28 created for `cluster-api.openshift.example.com`. Once set, this 

29 field cannot be changed. 

30 

31 platform (Dict[str, Any]): platform holds configuration specific to the underlying infrastructure 

32 provider for DNS. When omitted, this means the user has no opinion 

33 and the platform is left to choose reasonable defaults. These 

34 defaults are subject to change over time. 

35 

36 private_zone (Dict[str, Any]): privateZone is the location where all the DNS records that are only 

37 available internally to the cluster exist. If this field is nil, 

38 no private records should be created. Once set, this field 

39 cannot be changed. 

40 

41 public_zone (Dict[str, Any]): publicZone is the location where all the DNS records that are publicly 

42 accessible to the internet exist. If this field is nil, no 

43 public records should be created. Once set, this field cannot be 

44 changed. 

45 

46 """ 

47 super().__init__(**kwargs) 

48 

49 self.base_domain = base_domain 

50 self.platform = platform 

51 self.private_zone = private_zone 

52 self.public_zone = public_zone 

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.base_domain: 

62 _spec["baseDomain"] = self.base_domain 

63 

64 if self.platform: 

65 _spec["platform"] = self.platform 

66 

67 if self.private_zone: 

68 _spec["privateZone"] = self.private_zone 

69 

70 if self.public_zone: 

71 _spec["publicZone"] = self.public_zone 

72 

73 # End of generated code