Fix typo KubeObject.nonEditiablePathPrefixes > KubeObject.nonEditablePathPrefixes (#4351)

This commit is contained in:
chh authored and GitHub committed 2021-11-16 14:04:12 +02:00
1 parent 385de469ad
commit 2d5b39e0e6
1 file changed
+3 -3
+3 -3
View File
@@ -200,7 +200,7 @@ export class KubeObject<Metadata extends KubeObjectMetadata = KubeObjectMetadata
/** /**
* These must be RFC6902 compliant paths * These must be RFC6902 compliant paths
*/ */
private static readonly nonEditiablePathPrefixes = [ private static readonly nonEditablePathPrefixes = [
"/metadata/managedFields", "/metadata/managedFields",
"/status", "/status",
]; ];
@@ -211,7 +211,7 @@ export class KubeObject<Metadata extends KubeObjectMetadata = KubeObjectMetadata
"/metadata/selfLink", "/metadata/selfLink",
"/metadata/resourceVersion", "/metadata/resourceVersion",
"/metadata/uid", "/metadata/uid",
...KubeObject.nonEditiablePathPrefixes, ...KubeObject.nonEditablePathPrefixes,
]); ]);
constructor(data: KubeJsonApiData) { constructor(data: KubeJsonApiData) {
@@ -315,7 +315,7 @@ export class KubeObject<Metadata extends KubeObjectMetadata = KubeObjectMetadata
throw new Error(`Failed to update ${this.kind}: JSON pointer ${op.path} has been modified`); throw new Error(`Failed to update ${this.kind}: JSON pointer ${op.path} has been modified`);
} }
for (const pathPrefix of KubeObject.nonEditiablePathPrefixes) { for (const pathPrefix of KubeObject.nonEditablePathPrefixes) {
if (op.path.startsWith(`${pathPrefix}/`)) { if (op.path.startsWith(`${pathPrefix}/`)) {
throw new Error(`Failed to update ${this.kind}: Child JSON pointer of ${op.path} has been modified`); throw new Error(`Failed to update ${this.kind}: Child JSON pointer of ${op.path} has been modified`);
} }