Commit 22289352 authored by Thong Kuah's avatar Thong Kuah

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.
parent 6cbc982c
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment