瀏覽代碼

add capi gate

Stefan McShane 3 年之前
父節點
當前提交
59fe3ba2f0
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      api/server/handlers/project/create_cluster.go

+ 6 - 0
api/server/handlers/project/create_cluster.go

@@ -30,6 +30,12 @@ func NewProvisionClusterHandler(
 
 // ServeHTTP creates a CAPI cluster by adding the configuration to a NATS stream
 func (c *CreateClusterHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
+	if !c.Config().DisableCAPIProvisioner {
+		// TODO: delete this block after April 2023. It is only required whilst people are not easily able to get NATS and Cluster Control Plane running on their local environment
+		w.WriteHeader(http.StatusCreated)
+		return
+	}
+
 	var capiClusterReq types.CAPIClusterRequest
 	ctx := r.Context()