Merge pull request #1225 from pikasTech/fix/2243-kafka-apply-namespace

fix: render kafka namespace before apply
This commit is contained in:
Lyon
2026-06-28 17:31:39 +08:00
committed by GitHub
+1 -2
View File
@@ -638,7 +638,6 @@ function applyScript(kafka: PlatformKafkaConfig, target: KafkaTarget, manifest:
const dryRun = options.dryRun;
const mode = dryRun ? "dry-run" : "confirmed";
const dryServer = dryRun ? "--dry-run=server " : "";
const dryClient = dryRun ? "--dry-run=client " : "";
const stepTimeoutSeconds = Math.max(5, Math.min(kafka.validation.timeoutSeconds, 20));
const checkTimeoutSeconds = Math.max(5, Math.min(kafka.validation.pollSeconds, 10));
const operatorManifest = operator.manifest ?? "";
@@ -655,7 +654,7 @@ cat >"$manifest" <<'UNIDESK_KAFKA_RUNTIME_YAML'
${manifest}
UNIDESK_KAFKA_RUNTIME_YAML
kubectl create namespace ${target.namespace} ${dryClient}-o yaml >"$tmp/ns.yaml" 2>"$tmp/ns-create.err"
kubectl create namespace ${target.namespace} --dry-run=client -o yaml >"$tmp/ns.yaml" 2>"$tmp/ns-create.err"
ns_create_rc=$?
if [ "$ns_create_rc" -eq 0 ]; then
timeout ${stepTimeoutSeconds} kubectl apply --server-side ${dryServer}--force-conflicts --field-manager=${fieldManager} -f "$tmp/ns.yaml" >"$tmp/ns.out" 2>"$tmp/ns.err"