Set cluster_type for a new cluster
This enables #allow_user_defined_namespace? to work so that the form for a group cluster will now longer show the "Project namespace" field.
This commit is contained in:
parent
6cbc982cee
commit
22289352be
|
@ -189,6 +189,15 @@ class Clusters::ClustersController < Clusters::BaseController
|
|||
def user_cluster
|
||||
@user_cluster = ::Clusters::Cluster.new.tap do |cluster|
|
||||
cluster.build_platform_kubernetes
|
||||
|
||||
case clusterable.subject
|
||||
when ::Project
|
||||
cluster.cluster_type = :project_type
|
||||
when ::Group
|
||||
cluster.cluster_type = :group_type
|
||||
else
|
||||
raise NotImplementedError
|
||||
end
|
||||
end.present(current_user: current_user)
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue