Coverage for ocp_resources/project_project_openshift_io.py: 0%

14 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, List, Optional 

4from ocp_resources.resource import Resource 

5 

6 

7class Project(Resource): 

8 """ 

9 Projects are the unit of isolation and collaboration in OpenShift. A project has one or more members, a quota on the resources that the project may consume, and the security controls on the resources in the project. Within a project, members may have different roles - project administrators can set membership, editors can create and manage the resources, and viewers can see but not access running containers. In a normal cluster project administrators are not able to alter their quotas - that is restricted to cluster administrators. 

10 

11 Listing or watching projects will return only projects the user has the reader role on. 

12 

13 An OpenShift project is an alternative representation of a Kubernetes namespace. Projects are exposed as editable to end users while namespaces are not. Direct creation of a project is typically restricted to administrators, while end users should use the requestproject resource. 

14 

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

16 """ 

17 

18 api_group: str = Resource.ApiGroup.PROJECT_OPENSHIFT_IO 

19 

20 def __init__( 

21 self, 

22 finalizers: Optional[List[Any]] = None, 

23 **kwargs: Any, 

24 ) -> None: 

25 """ 

26 Args: 

27 finalizers (List[Any]): Finalizers is an opaque list of values that must be empty to 

28 permanently remove object from storage 

29 

30 """ 

31 super().__init__(**kwargs) 

32 

33 self.finalizers = finalizers 

34 

35 def to_dict(self) -> None: 

36 super().to_dict() 

37 

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

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

40 _spec = self.res["spec"] 

41 

42 if self.finalizers: 

43 _spec["finalizers"] = self.finalizers 

44 

45 # End of generated code