Validation error appears twice on Cluster page
### Summary We're using two forms for the same object (`@cluster`) on the cluster show page: 1. The [`integration_form`](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/app/views/clusters/clusters/_integration_form.html.haml#L1) for "Integration status", "environment scope" and "domain" (to be added soon) fields 2. And another one the Kubernetes fields: "name", "CA certificate", "api url", "token" and "namespace". In this case, we render different forms depending if the cluster is [GCP](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/app/views/clusters/clusters/gcp/_form.html.haml) or [user](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/app/views/clusters/clusters/user/_form.html.haml)) Because of this, the errors in one form appear also in the other one, generating duplicated messages. Some examples: | When validation in the integration form fails | When validation on the kubernetes form fails | | ------ | ------ | | ![Screen_Shot_2019-01-22_at_3.47.47_PM](/uploads/28eb835c18acf85047a4484b10363a9c/Screen_Shot_2019-01-22_at_3.47.47_PM.png) | ![Screen_Shot_2019-01-22_at_3.35.57_PM](/uploads/d5cc7d4719023d5fd4e6e3a96fe662c5/Screen_Shot_2019-01-22_at_3.35.57_PM.png) | ### Steps to reproduce 1. Add a cluster to your project 2. Edit the cluster with invalid data 3. You'll see the error appears twice on the page ### Example Project This is going to happen on gitlab.com after https://gitlab.com/gitlab-org/gitlab-ce/issues/56715 / https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/24583 has being deployed to prod. ### What is the current *bug* behavior? Error appears twice on the same page ### What is the expected *correct* behavior? Error should only appear one and in the corresponding form. ### Possible fixes From https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/24643: > Maybe it's time to split this form to a different controller (`Clusters::Platforms::KubernetesController`) that uses a different (`Clusters::Platforms::Kubernetes::UpdateService`), that returns an independent object (`@platform_kubernetes`). But of course that will involve a lot of work (I've try to do it here https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/24633) and it'll need to be scheduled by PM.
issue