MCPcopy Create free account
hub / github.com/calfonso/rusternetes / k8sUpdate

Function k8sUpdate

console/src/engine/query.ts:90–100  ·  view source on GitHub ↗
(
  apiPath: string,
  resource: T,
)

Source from the content-addressed store, hash-verified

88
89/** Update (PUT) a resource. */
90export async function k8sUpdate<T extends K8sResource>(
91 apiPath: string,
92 resource: T,
93): Promise<T> {
94 const res = await fetch(`${apiBase()}${apiPath}`, {
95 method: "PUT",
96 headers: { ...headers(), "Content-Type": "application/json" },
97 body: JSON.stringify(resource),
98 });
99 return handleResponse(res);
100}
101
102/** Patch a resource (strategic merge patch by default). */
103export async function k8sPatch<T extends K8sResource>(

Callers 1

handleSaveFunction · 0.90

Calls 3

apiBaseFunction · 0.85
headersFunction · 0.85
handleResponseFunction · 0.85

Tested by

no test coverage detected