Patch a Secret
const url = 'https://example.com/apis/nodus.dev/v1/namespaces/example/secrets/example';const options = { method: 'PATCH', headers: {'Content-Type': 'application/merge-patch+json'}, body: '{}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://example.com/apis/nodus.dev/v1/namespaces/example/secrets/example \ --header 'Content-Type: application/merge-patch+json' \ --data '{}'Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ”The project.
The object’s name.
Query Parameters
Section titled “ Query Parameters ”Header Parameters
Section titled “ Header Parameters ”Request Bodyrequired
Section titled “ Request Bodyrequired ”object
Example generated
{}Responses
Section titled “ Responses ”OK
Secret is versioned, envelope-encrypted key/value data. Values are write-only: no API returns them, and they reach containers only as env vars and 0400 tmpfs files of an attempt that pinned the version at admission.
object
object
object
object
object
object
object
SecretSpec is a Secret’s type and its write-only values.
object
Data maps keys to base64 values. Write-only: a write that carries it creates a new version and the stored object keeps only the key names.
object
StringData is Data as plain strings, merged over Data on write. Write-only.
object
Type is Opaque or Registry; immutable.
SecretStatus reports versions and key names.
object
Keys are the current version’s key names.
LastUsedTime is the last delivery to an attempt.
Phase is Ready, or Failed when the values could not be encrypted.
Reason says why the Secret failed.
Version is the current version; new attempts pin it.
Versions are the most recent versions, newest first (at most 10).
SecretVersionInfo describes one version without its values.
object
CreateTime is when the version was written.
CreatedBy is the principal that wrote it.
Keys are its key names.
Version is the version number, from 1.
Example generated
{ "apiVersion": "example", "kind": "example", "metadata": { "annotations": { "additionalProperty": "example" }, "creationTimestamp": "example", "deletionGracePeriodSeconds": 1, "deletionTimestamp": "example", "finalizers": [ "example" ], "generateName": "example", "generation": 1, "labels": { "additionalProperty": "example" }, "managedFields": [ { "apiVersion": "example", "fieldsType": "example", "fieldsV1": { "additionalProperty": "example" }, "manager": "example", "operation": "example", "subresource": "example", "time": "example" } ], "name": "example", "namespace": "example", "ownerReferences": [ { "apiVersion": "example", "blockOwnerDeletion": true, "controller": true, "kind": "example", "name": "example", "uid": "example" } ], "resourceVersion": "example", "selfLink": "example", "uid": "example" }, "spec": { "data": { "additionalProperty": "example" }, "stringData": { "additionalProperty": "example" }, "type": "example" }, "status": { "keys": [ "example" ], "lastUsedTime": "example", "phase": "example", "reason": "example", "version": 1, "versions": [ { "createTime": "example", "createdBy": "example", "keys": [ "example" ], "version": 1 } ] }}default
Section titled “ default ”An error: a metav1.Status whose reason is a registered code.
Status is the error body of every API response: a Kubernetes metav1.Status (so kubectl and client-go understand it) plus three top-level extensions that those clients ignore (ADR-028).
object
object
object
Docs is the URL of the code’s docs page.
Fix says what to do next, for example a CLI command or the field to change.
object
object
RequestID identifies the request in logs and support tickets.
Example generated
{ "apiVersion": "example", "code": 1, "details": { "causes": [ { "field": "example", "message": "example", "reason": "example" } ], "group": "example", "kind": "example", "name": "example", "retryAfterSeconds": 1, "uid": "example" }, "docs": "example", "fix": "example", "kind": "example", "message": "example", "metadata": { "continue": "example", "remainingItemCount": 1, "resourceVersion": "example", "selfLink": "example", "shardInfo": { "selector": "example" } }, "reason": "example", "requestId": "example", "status": "example"}