From 3f6d0752b640b56e31f30eb3fb73d8678447a221 Mon Sep 17 00:00:00 2001 From: Mohammad Gufran Date: Tue, 6 Jan 2026 16:34:09 +0100 Subject: [PATCH 1/3] Set @cluster_name in init job closes #478 --- pkg/components/master.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/components/master.go b/pkg/components/master.go index ee587d763..147d34e7a 100644 --- a/pkg/components/master.go +++ b/pkg/components/master.go @@ -351,7 +351,8 @@ func (m *Master) initSchemaACLs() (string, error) { } func (m *Master) createInitScript() (string, error) { - clusterConnection, err := m.cfgen.GetClusterConnectionConfig() + clusterConn := m.cfgen.GetClusterConnection() + connConfig, err := yson.MarshalFormat(clusterConn, yson.FormatPretty) if err != nil { panic(err) } @@ -374,7 +375,8 @@ func (m *Master) createInitScript() (string, error) { RunIfNonexistent("//sys/pools", "/usr/bin/yt link //sys/pool_trees/default //sys/pools"), "/usr/bin/yt create scheduler_pool --attributes '{name=research; pool_tree=default}' --ignore-existing", "/usr/bin/yt create map_node //home --ignore-existing", - RunIfExists("//sys/@provision_lock", fmt.Sprintf("/usr/bin/yt set //sys/@cluster_connection '%s'", string(clusterConnection))), + RunIfExists("//sys/@provision_lock", fmt.Sprintf("/usr/bin/yt set //sys/@cluster_connection '%s'", string(connConfig))), + RunIfExists("//sys/@provision_lock", fmt.Sprintf("/usr/bin/yt set //sys/@cluster_name '%s'", clusterConn.ClusterName)), m.initAdminUser(), m.initMedia(), } From c20eddd1d1c8e0f25c6171211479f9c7cb5f0cbd Mon Sep 17 00:00:00 2001 From: Mohammad Gufran Date: Tue, 6 Jan 2026 16:49:41 +0100 Subject: [PATCH 2/3] Update master init job config test --- .../ConfigMap default-yt-master-init-job-config.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/r8r/canondata/Components reconciler Minimal Test/ConfigMap default-yt-master-init-job-config.yaml b/test/r8r/canondata/Components reconciler Minimal Test/ConfigMap default-yt-master-init-job-config.yaml index 5ae60f6fc..1d8c798eb 100644 --- a/test/r8r/canondata/Components reconciler Minimal Test/ConfigMap default-yt-master-init-job-config.yaml +++ b/test/r8r/canondata/Components reconciler Minimal Test/ConfigMap default-yt-master-init-job-config.yaml @@ -108,6 +108,9 @@ data: }; }' fi + if [ $(/usr/bin/yt exists //sys/@provision_lock) = 'true' ]; then + /usr/bin/yt set //sys/@cluster_name 'test-ytsaurus' + fi if [ $(/usr/bin/yt exists //sys/users/admin) = 'false' ]; then /usr/bin/yt create user --attributes '{name="admin"}' --ignore-existing /usr/bin/yt execute set_user_password '{user=admin;new_password_sha256="5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8"}' From 06c9b37a55b115dec9fc6f2441e3b64a81988b77 Mon Sep 17 00:00:00 2001 From: Mohammad Gufran Date: Tue, 6 Jan 2026 17:03:23 +0100 Subject: [PATCH 3/3] Update master init job config test --- .../ConfigMap default-yt-master-init-job-config.yaml | 3 +++ .../ConfigMap default-yt-master-init-job-config.yaml | 3 +++ .../ConfigMap default-yt-master-init-job-config.yaml | 3 +++ .../ConfigMap default-yt-master-init-job-config.yaml | 3 +++ .../ConfigMap default-yt-master-init-job-config.yaml | 3 +++ 5 files changed, 15 insertions(+) diff --git a/test/r8r/canondata/Components reconciler With CRI and NVIDIA container runtime - CRI-O Test/ConfigMap default-yt-master-init-job-config.yaml b/test/r8r/canondata/Components reconciler With CRI and NVIDIA container runtime - CRI-O Test/ConfigMap default-yt-master-init-job-config.yaml index 5ae60f6fc..1d8c798eb 100644 --- a/test/r8r/canondata/Components reconciler With CRI and NVIDIA container runtime - CRI-O Test/ConfigMap default-yt-master-init-job-config.yaml +++ b/test/r8r/canondata/Components reconciler With CRI and NVIDIA container runtime - CRI-O Test/ConfigMap default-yt-master-init-job-config.yaml @@ -108,6 +108,9 @@ data: }; }' fi + if [ $(/usr/bin/yt exists //sys/@provision_lock) = 'true' ]; then + /usr/bin/yt set //sys/@cluster_name 'test-ytsaurus' + fi if [ $(/usr/bin/yt exists //sys/users/admin) = 'false' ]; then /usr/bin/yt create user --attributes '{name="admin"}' --ignore-existing /usr/bin/yt execute set_user_password '{user=admin;new_password_sha256="5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8"}' diff --git a/test/r8r/canondata/Components reconciler With CRI and NVIDIA container runtime Test/ConfigMap default-yt-master-init-job-config.yaml b/test/r8r/canondata/Components reconciler With CRI and NVIDIA container runtime Test/ConfigMap default-yt-master-init-job-config.yaml index 5ae60f6fc..1d8c798eb 100644 --- a/test/r8r/canondata/Components reconciler With CRI and NVIDIA container runtime Test/ConfigMap default-yt-master-init-job-config.yaml +++ b/test/r8r/canondata/Components reconciler With CRI and NVIDIA container runtime Test/ConfigMap default-yt-master-init-job-config.yaml @@ -108,6 +108,9 @@ data: }; }' fi + if [ $(/usr/bin/yt exists //sys/@provision_lock) = 'true' ]; then + /usr/bin/yt set //sys/@cluster_name 'test-ytsaurus' + fi if [ $(/usr/bin/yt exists //sys/users/admin) = 'false' ]; then /usr/bin/yt create user --attributes '{name="admin"}' --ignore-existing /usr/bin/yt execute set_user_password '{user=admin;new_password_sha256="5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8"}' diff --git a/test/r8r/canondata/Components reconciler With CRI job environment - CRI-O Test/ConfigMap default-yt-master-init-job-config.yaml b/test/r8r/canondata/Components reconciler With CRI job environment - CRI-O Test/ConfigMap default-yt-master-init-job-config.yaml index 5ae60f6fc..1d8c798eb 100644 --- a/test/r8r/canondata/Components reconciler With CRI job environment - CRI-O Test/ConfigMap default-yt-master-init-job-config.yaml +++ b/test/r8r/canondata/Components reconciler With CRI job environment - CRI-O Test/ConfigMap default-yt-master-init-job-config.yaml @@ -108,6 +108,9 @@ data: }; }' fi + if [ $(/usr/bin/yt exists //sys/@provision_lock) = 'true' ]; then + /usr/bin/yt set //sys/@cluster_name 'test-ytsaurus' + fi if [ $(/usr/bin/yt exists //sys/users/admin) = 'false' ]; then /usr/bin/yt create user --attributes '{name="admin"}' --ignore-existing /usr/bin/yt execute set_user_password '{user=admin;new_password_sha256="5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8"}' diff --git a/test/r8r/canondata/Components reconciler With CRI job environment Test/ConfigMap default-yt-master-init-job-config.yaml b/test/r8r/canondata/Components reconciler With CRI job environment Test/ConfigMap default-yt-master-init-job-config.yaml index 5ae60f6fc..1d8c798eb 100644 --- a/test/r8r/canondata/Components reconciler With CRI job environment Test/ConfigMap default-yt-master-init-job-config.yaml +++ b/test/r8r/canondata/Components reconciler With CRI job environment Test/ConfigMap default-yt-master-init-job-config.yaml @@ -108,6 +108,9 @@ data: }; }' fi + if [ $(/usr/bin/yt exists //sys/@provision_lock) = 'true' ]; then + /usr/bin/yt set //sys/@cluster_name 'test-ytsaurus' + fi if [ $(/usr/bin/yt exists //sys/users/admin) = 'false' ]; then /usr/bin/yt create user --attributes '{name="admin"}' --ignore-existing /usr/bin/yt execute set_user_password '{user=admin;new_password_sha256="5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8"}' diff --git a/test/r8r/canondata/Components reconciler With all components Test/ConfigMap default-yt-master-init-job-config.yaml b/test/r8r/canondata/Components reconciler With all components Test/ConfigMap default-yt-master-init-job-config.yaml index b747e5902..e6de217ad 100644 --- a/test/r8r/canondata/Components reconciler With all components Test/ConfigMap default-yt-master-init-job-config.yaml +++ b/test/r8r/canondata/Components reconciler With all components Test/ConfigMap default-yt-master-init-job-config.yaml @@ -140,6 +140,9 @@ data: }; }' fi + if [ $(/usr/bin/yt exists //sys/@provision_lock) = 'true' ]; then + /usr/bin/yt set //sys/@cluster_name 'test-ytsaurus' + fi if [ $(/usr/bin/yt exists //sys/users/admin) = 'false' ]; then /usr/bin/yt create user --attributes '{name="admin"}' --ignore-existing /usr/bin/yt execute set_user_password '{user=admin;new_password_sha256="5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8"}'