From 6fb4bbb4178e9b856e877dcdcc5d4eb066f4fe36 Mon Sep 17 00:00:00 2001 From: Zipofar Date: Wed, 16 Aug 2023 12:32:28 +0300 Subject: [PATCH] [470] Change the clusters namespace format --- core/app/lib/uffizzi_core/concerns/models/cluster.rb | 4 ++-- .../api/cli/v1/projects/clusters_controller_test.rb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/app/lib/uffizzi_core/concerns/models/cluster.rb b/core/app/lib/uffizzi_core/concerns/models/cluster.rb index 6618b706..76622371 100644 --- a/core/app/lib/uffizzi_core/concerns/models/cluster.rb +++ b/core/app/lib/uffizzi_core/concerns/models/cluster.rb @@ -4,7 +4,7 @@ module UffizziCore::Concerns::Models::Cluster extend ActiveSupport::Concern include UffizziCore::ClusterRepo - NAMESPACE_PREFIX = 'cluster' + NAMESPACE_PREFIX = 'c' included do include AASM @@ -50,7 +50,7 @@ def after_disable end def namespace - [NAMESPACE_PREFIX, id].join('-') + [NAMESPACE_PREFIX, id].join end end end diff --git a/core/test/controllers/uffizzi_core/api/cli/v1/projects/clusters_controller_test.rb b/core/test/controllers/uffizzi_core/api/cli/v1/projects/clusters_controller_test.rb index dce221fb..54c37e19 100644 --- a/core/test/controllers/uffizzi_core/api/cli/v1/projects/clusters_controller_test.rb +++ b/core/test/controllers/uffizzi_core/api/cli/v1/projects/clusters_controller_test.rb @@ -61,7 +61,7 @@ class UffizziCore::Api::Cli::V1::Projects::ClustersControllerTest < ActionContro expected_request = { name: cluster_creation_data[:name], manifest: nil, - base_ingress_host: /#{UffizziCore::Cluster::NAMESPACE_PREFIX}-\d/, + base_ingress_host: /#{UffizziCore::Cluster::NAMESPACE_PREFIX}\d/, } stubbed_create_cluster_request = stub_create_cluster_request_with_expected(cluster_creation_data, expected_request) stubbed_create_namespace_request = stub_create_namespace_request @@ -123,7 +123,7 @@ class UffizziCore::Api::Cli::V1::Projects::ClustersControllerTest < ActionContro expected_request = { name: cluster_creation_data[:name], manifest: manifest, - base_ingress_host: /#{UffizziCore::Cluster::NAMESPACE_PREFIX}-\d/, + base_ingress_host: /#{UffizziCore::Cluster::NAMESPACE_PREFIX}\d/, } stubbed_create_cluster_request = stub_create_cluster_request_with_expected(cluster_creation_data, expected_request) stubbed_get_cluster_request = stub_get_cluster_request(cluster_show_data)