kubernetes-fluent-client 3.5.0 → 3.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/fluent/utils.d.ts.map +1 -1
- package/dist/fluent/utils.js +8 -7
- package/dist/upstream.d.ts +1 -1
- package/dist/upstream.d.ts.map +1 -1
- package/dist/upstream.js +1 -2
- package/package.json +1 -1
- package/src/fluent/utils.ts +11 -9
- package/src/upstream.ts +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/fluent/utils.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,OAAO,EAAS,UAAU,EAAE,MAAM,QAAQ,CAAC;AAI3C,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/fluent/utils.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,OAAO,EAAS,UAAU,EAAE,MAAM,QAAQ,CAAC;AAI3C,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAM5E;;;;;GAKG;AACH,wBAAsB,UAAU,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAkBvF;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,WAAW,GAAG,UAAU,GAAG,SAAS,CAqBvE;AACD;;;;GAIG;AACH,wBAAsB,QAAQ,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAMvD;AACD;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,YAAY,EAChD,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,CAAC,EACR,OAAO,EAAE,OAAO,EAChB,WAAW,UAAQ,OAwDpB;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,MAAM,CAAC,MAAM,EAAE,YAAY,GAAG,gBAAgB,CA+BnE;AASD;;;;;;;;;;GAUG;AACH,wBAAsB,OAAO,CAAC,CAAC,SAAS,YAAY,EAAE,CAAC,EACrD,KAAK,EAAE,CAAC,EACR,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,YAAY,EACpB,OAAO,CAAC,EAAE,CAAC,GAAG,OAAO,EACrB,QAAQ,GAAE,QAA2B,cA+DtC"}
|
package/dist/fluent/utils.js
CHANGED
|
@@ -189,14 +189,15 @@ async function k8sExec(model, filters, method, payload, applyCfg = { force: fals
|
|
|
189
189
|
const reconstruct = async (method) => {
|
|
190
190
|
const configMethod = method === "LOG" ? "GET" : method;
|
|
191
191
|
const { opts, serverUrl } = await k8sCfg(configMethod);
|
|
192
|
-
|
|
193
|
-
const
|
|
194
|
-
|
|
195
|
-
|
|
192
|
+
// Build the base path once, using excludeName only for standard POST requests
|
|
193
|
+
const shouldExcludeName = method === "POST" && !(payload && isEvictionPayload(payload));
|
|
194
|
+
const baseUrl = pathBuilder(serverUrl.toString(), model, filters, shouldExcludeName);
|
|
195
|
+
// Append appropriate subresource paths
|
|
196
|
+
if (payload && isEvictionPayload(payload)) {
|
|
197
|
+
baseUrl.pathname = `${baseUrl.pathname}/eviction`;
|
|
196
198
|
}
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
baseUrl.pathname = `${baseUrl.pathname}/${payload.metadata.name}/eviction`;
|
|
199
|
+
else if (method === "LOG") {
|
|
200
|
+
baseUrl.pathname = `${baseUrl.pathname}/log`;
|
|
200
201
|
}
|
|
201
202
|
return {
|
|
202
203
|
serverUrl: baseUrl,
|
package/dist/upstream.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/** a is a collection of K8s types to be used within an action: `When(a.Configmap)` */
|
|
2
|
-
export { CoreV1Event as CoreEvent, EventsV1Event as Event, V1APIService as APIService, V1CSIDriver as CSIDriver, V1CertificateSigningRequest as CertificateSigningRequest, V1ClusterRole as ClusterRole, V1ClusterRoleBinding as ClusterRoleBinding, V1ConfigMap as ConfigMap, V1ControllerRevision as ControllerRevision, V1CronJob as CronJob, V1CustomResourceDefinition as CustomResourceDefinition, V1DaemonSet as DaemonSet, V1Deployment as Deployment, V1EndpointSlice as EndpointSlice, V1Endpoints as Endpoints,
|
|
2
|
+
export { CoreV1Event as CoreEvent, EventsV1Event as Event, V1APIService as APIService, V1CSIDriver as CSIDriver, V1CertificateSigningRequest as CertificateSigningRequest, V1ClusterRole as ClusterRole, V1ClusterRoleBinding as ClusterRoleBinding, V1ConfigMap as ConfigMap, V1ControllerRevision as ControllerRevision, V1CronJob as CronJob, V1CustomResourceDefinition as CustomResourceDefinition, V1DaemonSet as DaemonSet, V1Deployment as Deployment, V1EndpointSlice as EndpointSlice, V1Endpoints as Endpoints, V1HorizontalPodAutoscaler as HorizontalPodAutoscaler, V1Ingress as Ingress, V1IngressClass as IngressClass, V1Job as Job, V1LimitRange as LimitRange, V1LocalSubjectAccessReview as LocalSubjectAccessReview, V1MutatingWebhookConfiguration as MutatingWebhookConfiguration, V1Namespace as Namespace, V1NetworkPolicy as NetworkPolicy, V1Node as Node, V1PersistentVolume as PersistentVolume, V1PersistentVolumeClaim as PersistentVolumeClaim, V1Pod as Pod, V1PodDisruptionBudget as PodDisruptionBudget, V1PodTemplate as PodTemplate, V1ReplicaSet as ReplicaSet, V1ReplicationController as ReplicationController, V1ResourceQuota as ResourceQuota, V1Role as Role, V1RoleBinding as RoleBinding, V1RuntimeClass as RuntimeClass, V1Secret as Secret, V1SelfSubjectAccessReview as SelfSubjectAccessReview, V1SelfSubjectRulesReview as SelfSubjectRulesReview, V1Service as Service, V1ServiceAccount as ServiceAccount, V1StatefulSet as StatefulSet, V1StorageClass as StorageClass, V1SubjectAccessReview as SubjectAccessReview, V1TokenReview as TokenReview, V1ValidatingWebhookConfiguration as ValidatingWebhookConfiguration, V1VolumeAttachment as VolumeAttachment, } from "@kubernetes/client-node";
|
|
3
3
|
export { GenericKind } from "./types";
|
|
4
4
|
//# sourceMappingURL=upstream.d.ts.map
|
package/dist/upstream.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upstream.d.ts","sourceRoot":"","sources":["../src/upstream.ts"],"names":[],"mappings":"AAGA,sFAAsF;AACtF,OAAO,EACL,WAAW,IAAI,SAAS,EACxB,aAAa,IAAI,KAAK,EACtB,YAAY,IAAI,UAAU,EAC1B,WAAW,IAAI,SAAS,EACxB,2BAA2B,IAAI,yBAAyB,EACxD,aAAa,IAAI,WAAW,EAC5B,oBAAoB,IAAI,kBAAkB,EAC1C,WAAW,IAAI,SAAS,EACxB,oBAAoB,IAAI,kBAAkB,EAC1C,SAAS,IAAI,OAAO,EACpB,0BAA0B,IAAI,wBAAwB,EACtD,WAAW,IAAI,SAAS,EACxB,YAAY,IAAI,UAAU,EAC1B,eAAe,IAAI,aAAa,EAChC,WAAW,IAAI,SAAS,EACxB,
|
|
1
|
+
{"version":3,"file":"upstream.d.ts","sourceRoot":"","sources":["../src/upstream.ts"],"names":[],"mappings":"AAGA,sFAAsF;AACtF,OAAO,EACL,WAAW,IAAI,SAAS,EACxB,aAAa,IAAI,KAAK,EACtB,YAAY,IAAI,UAAU,EAC1B,WAAW,IAAI,SAAS,EACxB,2BAA2B,IAAI,yBAAyB,EACxD,aAAa,IAAI,WAAW,EAC5B,oBAAoB,IAAI,kBAAkB,EAC1C,WAAW,IA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The Kubernetes Fluent Client Authors
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.GenericKind = exports.VolumeAttachment = exports.ValidatingWebhookConfiguration = exports.TokenReview = exports.SubjectAccessReview = exports.StorageClass = exports.StatefulSet = exports.ServiceAccount = exports.Service = exports.SelfSubjectRulesReview = exports.SelfSubjectAccessReview = exports.Secret = exports.RuntimeClass = exports.RoleBinding = exports.Role = exports.ResourceQuota = exports.ReplicationController = exports.ReplicaSet = exports.PodTemplate = exports.PodDisruptionBudget = exports.Pod = exports.PersistentVolumeClaim = exports.PersistentVolume = exports.Node = exports.NetworkPolicy = exports.Namespace = exports.MutatingWebhookConfiguration = exports.LocalSubjectAccessReview = exports.LimitRange = exports.Job = exports.IngressClass = exports.Ingress = exports.HorizontalPodAutoscaler = exports.
|
|
5
|
+
exports.GenericKind = exports.VolumeAttachment = exports.ValidatingWebhookConfiguration = exports.TokenReview = exports.SubjectAccessReview = exports.StorageClass = exports.StatefulSet = exports.ServiceAccount = exports.Service = exports.SelfSubjectRulesReview = exports.SelfSubjectAccessReview = exports.Secret = exports.RuntimeClass = exports.RoleBinding = exports.Role = exports.ResourceQuota = exports.ReplicationController = exports.ReplicaSet = exports.PodTemplate = exports.PodDisruptionBudget = exports.Pod = exports.PersistentVolumeClaim = exports.PersistentVolume = exports.Node = exports.NetworkPolicy = exports.Namespace = exports.MutatingWebhookConfiguration = exports.LocalSubjectAccessReview = exports.LimitRange = exports.Job = exports.IngressClass = exports.Ingress = exports.HorizontalPodAutoscaler = exports.Endpoints = exports.EndpointSlice = exports.Deployment = exports.DaemonSet = exports.CustomResourceDefinition = exports.CronJob = exports.ControllerRevision = exports.ConfigMap = exports.ClusterRoleBinding = exports.ClusterRole = exports.CertificateSigningRequest = exports.CSIDriver = exports.APIService = exports.Event = exports.CoreEvent = void 0;
|
|
6
6
|
/** a is a collection of K8s types to be used within an action: `When(a.Configmap)` */
|
|
7
7
|
var client_node_1 = require("@kubernetes/client-node");
|
|
8
8
|
Object.defineProperty(exports, "CoreEvent", { enumerable: true, get: function () { return client_node_1.CoreV1Event; } });
|
|
@@ -20,7 +20,6 @@ Object.defineProperty(exports, "DaemonSet", { enumerable: true, get: function ()
|
|
|
20
20
|
Object.defineProperty(exports, "Deployment", { enumerable: true, get: function () { return client_node_1.V1Deployment; } });
|
|
21
21
|
Object.defineProperty(exports, "EndpointSlice", { enumerable: true, get: function () { return client_node_1.V1EndpointSlice; } });
|
|
22
22
|
Object.defineProperty(exports, "Endpoints", { enumerable: true, get: function () { return client_node_1.V1Endpoints; } });
|
|
23
|
-
Object.defineProperty(exports, "Eviction", { enumerable: true, get: function () { return client_node_1.V1Eviction; } });
|
|
24
23
|
Object.defineProperty(exports, "HorizontalPodAutoscaler", { enumerable: true, get: function () { return client_node_1.V1HorizontalPodAutoscaler; } });
|
|
25
24
|
Object.defineProperty(exports, "Ingress", { enumerable: true, get: function () { return client_node_1.V1Ingress; } });
|
|
26
25
|
Object.defineProperty(exports, "IngressClass", { enumerable: true, get: function () { return client_node_1.V1IngressClass; } });
|
package/package.json
CHANGED
package/src/fluent/utils.ts
CHANGED
|
@@ -11,8 +11,7 @@ import { modelToGroupVersionKind } from "../kinds";
|
|
|
11
11
|
import { GenericClass } from "../types";
|
|
12
12
|
import { ApplyCfg, FetchMethods, Filters, K8sConfigPromise } from "./types";
|
|
13
13
|
import fs from "fs";
|
|
14
|
-
import { Eviction } from "
|
|
15
|
-
|
|
14
|
+
import { V1Eviction as Eviction } from "@kubernetes/client-node";
|
|
16
15
|
const SSA_CONTENT_TYPE = "application/apply-patch+yaml";
|
|
17
16
|
const K8S_SA_TOKEN_PATH = "/var/run/secrets/kubernetes.io/serviceaccount/token";
|
|
18
17
|
|
|
@@ -225,15 +224,18 @@ export async function k8sExec<T extends GenericClass, K>(
|
|
|
225
224
|
const reconstruct = async (method: FetchMethods): K8sConfigPromise => {
|
|
226
225
|
const configMethod = method === "LOG" ? "GET" : method;
|
|
227
226
|
const { opts, serverUrl } = await k8sCfg(configMethod);
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
227
|
+
|
|
228
|
+
// Build the base path once, using excludeName only for standard POST requests
|
|
229
|
+
const shouldExcludeName = method === "POST" && !(payload && isEvictionPayload(payload));
|
|
230
|
+
const baseUrl = pathBuilder(serverUrl.toString(), model, filters, shouldExcludeName);
|
|
231
|
+
|
|
232
|
+
// Append appropriate subresource paths
|
|
233
|
+
if (payload && isEvictionPayload(payload)) {
|
|
234
|
+
baseUrl.pathname = `${baseUrl.pathname}/eviction`;
|
|
235
|
+
} else if (method === "LOG") {
|
|
231
236
|
baseUrl.pathname = `${baseUrl.pathname}/log`;
|
|
232
237
|
}
|
|
233
|
-
|
|
234
|
-
if (payload && isEvictionPayload(payload) && payload.metadata?.name) {
|
|
235
|
-
baseUrl.pathname = `${baseUrl.pathname}/${payload.metadata.name}/eviction`;
|
|
236
|
-
}
|
|
238
|
+
|
|
237
239
|
return {
|
|
238
240
|
serverUrl: baseUrl,
|
|
239
241
|
opts,
|
package/src/upstream.ts
CHANGED