mcp-server-kubernetes 3.0.2 → 3.0.3
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.
|
@@ -22,12 +22,8 @@ export class KubernetesManager {
|
|
|
22
22
|
throw new Error(`Failed to parse KUBECONFIG_YAML: ${error instanceof Error ? error.message : "Unknown error"}`);
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
-
else if (this.isRunningInCluster()) {
|
|
26
|
-
// Priority 2: Check if running in cluster
|
|
27
|
-
this.kc.loadFromCluster();
|
|
28
|
-
}
|
|
29
25
|
else if (this.hasEnvKubeconfigJson()) {
|
|
30
|
-
// Priority
|
|
26
|
+
// Priority 2: Full kubeconfig as JSON string
|
|
31
27
|
try {
|
|
32
28
|
this.loadEnvKubeconfigJson();
|
|
33
29
|
// Create temp kubeconfig file for kubectl commands from JSON
|
|
@@ -39,7 +35,7 @@ export class KubernetesManager {
|
|
|
39
35
|
}
|
|
40
36
|
}
|
|
41
37
|
else if (this.hasEnvMinimalKubeconfig()) {
|
|
42
|
-
// Priority
|
|
38
|
+
// Priority 3: Minimal config with K8S_SERVER and K8S_TOKEN
|
|
43
39
|
try {
|
|
44
40
|
this.loadEnvMinimalKubeconfig();
|
|
45
41
|
// Create temp kubeconfig file for kubectl commands from minimal config
|
|
@@ -50,6 +46,10 @@ export class KubernetesManager {
|
|
|
50
46
|
throw new Error(`Failed to create kubeconfig from K8S_SERVER and K8S_TOKEN: ${error instanceof Error ? error.message : "Unknown error"}`);
|
|
51
47
|
}
|
|
52
48
|
}
|
|
49
|
+
else if (this.isRunningInCluster()) {
|
|
50
|
+
// Priority 4: Check if running in cluster
|
|
51
|
+
this.kc.loadFromCluster();
|
|
52
|
+
}
|
|
53
53
|
else if (this.hasEnvKubeconfigPath()) {
|
|
54
54
|
// Priority 5: Custom kubeconfig file path using KUBECONFIG_PATH
|
|
55
55
|
try {
|
|
@@ -150,6 +150,7 @@ export class KubernetesManager {
|
|
|
150
150
|
name: "env-cluster",
|
|
151
151
|
server: process.env.K8S_SERVER,
|
|
152
152
|
skipTLSVerify: process.env.K8S_SKIP_TLS_VERIFY === "true",
|
|
153
|
+
caData: process.env.K8S_CA_DATA || undefined,
|
|
153
154
|
};
|
|
154
155
|
const user = {
|
|
155
156
|
name: "env-user",
|