MCPcopy Index your code
hub / github.com/kubernetes-client/python / ensure_namespace

Method ensure_namespace

kubernetes/base/dynamic/client.py:89–93  ·  view source on GitHub ↗
(self, resource, namespace, body)

Source from the content-addressed store, hash-verified

87 return self.__discoverer.version
88
89 def ensure_namespace(self, resource, namespace, body):
90 namespace = namespace or body.get('metadata', {}).get('namespace')
91 if not namespace:
92 raise ValueError("Namespace is required for {}.{}".format(resource.group_version, resource.kind))
93 return namespace
94
95 def serialize_body(self, body):
96 """Serialize body to raw dict so apiserver can handle it

Callers 5

createMethod · 0.95
replaceMethod · 0.95
patchMethod · 0.95
server_side_applyMethod · 0.95
createMethod · 0.80

Calls 2

getMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected