Skip to content

EE Port: Improves restriction of multiple Kubernetes clusters via API

What does this MR do?

EE Port of https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/24251. Adds EE specific spec scenarios to ensure multiple_clusters feature is being respected on EE.

> curl --header 'Private-Token: '$MAINTAINER_PAT'' http://localhost:3001/api/v4/projects/26/clusters/user \
-H "Accept: application/json" \
-H "Content-Type:application/json" \
-X POST --data '{"name":"cluster-10", "environment_scope":"cluster-10-environment/*", "platform_kubernetes_attributes":>{"api_url":"https://cluster-10-api.com","token":"12345","namespace":"cluster-10-namespace"}}'
> {"id":30,"name":"cluster-10","created_at":"2019-01-09T00:13:35.208Z","provider_type":"user","platform_type":"kubernetes","environment_scope":"cluster-10-environment/*","cluster_type":"project_type",...}


❯ curl --header 'Private-Token: '$MAINTAINER_PAT'' http://localhost:3001/api/v4/projects/26/clusters/user \
-H "Accept: application/json" \
-H "Content-Type:application/json" \
-X POST --data '{"name":"cluster-11", "environment_scope":"cluster-11-environment/*", "platform_kubernetes_attributes":{"api_url":"https://cluster-11-api.com","token":"12345","namespace":"cluster-11-namespace"}}'
> {"id":31,"name":"cluster-11","created_at":"2019-01-09T00:13:56.505Z","provider_type":"user","platform_type":"kubernetes","environment_scope":"cluster-11-environment/*","cluster_type":"project_type",...}

What are the relevant issue numbers?

https://gitlab.com/gitlab-org/gitlab-ce/issues/56110

Does this MR meet the acceptance criteria?

Edited by 🤖 GitLab Bot 🤖

Merge request reports