feat(cluster): add default container registry field to advanced config
Surface the top-level system_default_container_registry as a dedicated input (both Docker and K8s), coerce blank to null, and drop its redundant worker_config YAML hint.
This commit is contained in:
@@ -64,8 +64,18 @@ const ClusterForm: React.FC<AddModalProps> = forwardRef(
|
||||
// "no auth". Coerce empty form values to null before sending so a blank
|
||||
// input is unambiguous rather than an empty string that defeats fallbacks.
|
||||
const normalizeOutgoing = (values: any): any => {
|
||||
const opts = values?.k8s_options;
|
||||
if (!opts) return values;
|
||||
const base: any = { ...values };
|
||||
// Top-level cluster field shared by Docker and K8s. Trim then coerce a
|
||||
// blank input to null so clearing it on edit (or a whitespace-only
|
||||
// value) falls back to the server default rather than persisting an
|
||||
// empty string.
|
||||
if (base.system_default_container_registry !== undefined) {
|
||||
base.system_default_container_registry =
|
||||
base.system_default_container_registry?.trim() || null;
|
||||
}
|
||||
|
||||
const opts = base.k8s_options;
|
||||
if (!opts) return base;
|
||||
|
||||
const next: any = { ...opts };
|
||||
|
||||
@@ -90,7 +100,7 @@ const ClusterForm: React.FC<AddModalProps> = forwardRef(
|
||||
};
|
||||
}
|
||||
|
||||
return { ...values, k8s_options: next };
|
||||
return { ...base, k8s_options: next };
|
||||
};
|
||||
|
||||
const handleOnFinish = (_values: FormData) => {
|
||||
|
||||
Reference in New Issue
Block a user