- .github
- devel
- doc
-
examples
-
dynamic-client
-
notebooks
-
watch
-
yaml_dir
- README.md
- __init__.py
- annotate_deployment.py
- api_discovery.py
- apply_from_dict.py
- apply_from_directory.py
- apply_from_single_file.py
- cluster_scoped_custom_object.py
- cronjob_crud.py
- deployment_create.py
- deployment_crud.py
- duration-gep2257.py
- in_cluster_config.py
- ingress_create.py
- job_crud.py
- multiple_clusters.py
- namespaced_custom_object.py
- node_labels.py
- out_of_cluster_config.py
- pick_kube_config_context.py
- pod_config_list.py
- pod_exec.py
- pod_portforward.py
- remote_cluster.py
- rollout-daemonset.py
- rollout-statefulset.py
-
dynamic-client
- kubernetes
- scripts
- .gitignore
- CHANGELOG.md
- CONTRIBUTING.md
- LICENSE
- MANIFEST.in
- OWNERS
- README.md
- SECURITY_CONTACTS
- code-of-conduct.md
- codecov.yml
- requirements.txt
- setup.cfg
- setup.py
- test-requirements.txt
- tox.ini
Explanation
This Python code defines a class V1NonResourceRule
that represents a Kubernetes non-resource rule. Non-resource rules are used to define access permissions for objects that are not resources, such as API endpoints like /healthz
or /version
.
The class has two key attributes:
non_resource_ur_ls
: A list of partial URLs that a user should have access to. The ‘*’ character is a wildcard, meaning access is granted to all URLs that match the partial URL.verbs
: A list of HTTP verbs that are allowed for the specified URLs. Examples include ‘get’, ‘post’, ‘put’, ‘delete’, ‘patch’, ‘head’, and ‘options’. The ‘*’ character can be used to grant access to all verbs.
The code provides methods for getting and setting these attributes, as well as methods to convert the object to a dictionary (to_dict
), string (to_str
), and to compare it with another object (__eq__
, __ne__
).
The code also contains several comments that explain the purpose of the class and its attributes. These comments are helpful for understanding how the class is used in a Kubernetes context.
Overall, this code provides a convenient way to represent and manipulate Kubernetes non-resource rules in Python applications. This class allows for defining and managing access control for non-resource objects in a Kubernetes cluster.
Graph
The graph shows the usage of functions within the codebase.
Select a code symbol to view it's graph