Improves restriction of multiple Kubernetes clusters via API
What does this MR do?
Improves restriction of adding multiple Kubernetes clusters through API.
EE Port https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/9088
Before
Adding a cluster to a project with existing cluster
❯ curl --header 'Private-Token: '$CE_MAINTAINER_PAT'' http://localhost:3000/api/v4/projects/26/clusters/user \
-H "Accept: application/json" \
-H "Content-Type:application/json" \
-X POST --data '{"name":"cluster-2", "platform_kubernetes_attributes":{"api_url":"https://cluster-2-api-url.com","token":"12345","namespace":"cluster-2-namespace"}}'
{"message":"500 Internal Server Error"}
After
❯ curl --header 'Private-Token: '$CE_MAINTAINER_PAT'' http://localhost:3000/api/v4/projects/26/clusters/user \
-H "Accept: application/json" \
-H "Content-Type:application/json" \
-X POST --data '{"name":"cluster-2", "platform_kubernetes_attributes":{"api_url":"https://cluster-2-api-url.com","token":"12345","namespace":"cluster-2-namespace"}}'
{"message":"403 Forbidden - Instance does not support multiple Kubernetes clusters"}
What are the relevant issue numbers?
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary - [-] Documentation created/updated
-
Tests added for this feature/bug - [-] Tested in all supported browsers
-
Conforms to the code review guidelines -
Conforms to the merge request performance guidelines -
Conforms to the style guides - [-] Conforms to the database guides
- [-] Link to e2e tests MR added if this MR has Requires e2e tests label. See the Test Planning Process.
- [-] Security reports checked/validated by reviewer
Closes #56110 (closed)
Edited by 🤖 GitLab Bot 🤖