From 7d2e98ec01802b742254627188c5fc18472afcc7 Mon Sep 17 00:00:00 2001 From: Yury Kovalev Date: Thu, 15 Feb 2024 10:25:46 +0100 Subject: [PATCH] Add quota-management-list-configuration --- Makefile | 2 ++ .../quota-management-list-configuration.yaml | 35 +++++++++++++++++++ e2e/e2e_canary_upgrade_test.go | 2 +- 3 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 dev/config/quota-management-list-configuration.yaml diff --git a/Makefile b/Makefile index a96226e1ca..6284101715 100644 --- a/Makefile +++ b/Makefile @@ -54,6 +54,7 @@ SSO_REALM ?="rhoas" # update your realm here GITOPS_CONFIG_FILE ?= ${PROJECT_PATH}/dev/config/gitops-config.yaml DATAPLANE_CLUSTER_CONFIG_FILE ?= ${PROJECT_PATH}/dev/config/dataplane-cluster-configuration.yaml PROVIDERS_CONFIG_FILE ?= ${PROJECT_PATH}/dev/config/provider-configuration.yaml +QUOTA_MANAGEMENT_LIST_CONFIG_FILE ?= ${PROJECT_PATH}/dev/config/quota-management-list-configuration.yaml GO := go GOFMT := gofmt @@ -827,6 +828,7 @@ endif -p MEMORY_LIMIT="$(MEMORY_LIMIT)" \ -p CENTRAL_DOMAIN_NAME="$(CENTRAL_DOMAIN_NAME)" \ -p SUPPORTED_CLOUD_PROVIDERS='$(shell yq .supported_providers $(PROVIDERS_CONFIG_FILE) -r -o=j -I=0)' \ + -p REGISTERED_USERS_PER_ORGANISATION='$(shell yq .registered_users_per_organisation $(QUOTA_MANAGEMENT_LIST_CONFIG_FILE) -r -o=j -I=0)' \ | oc apply -f - -n $(NAMESPACE) .PHONY: deploy/service diff --git a/dev/config/quota-management-list-configuration.yaml b/dev/config/quota-management-list-configuration.yaml new file mode 100644 index 0000000000..a62ee35b22 --- /dev/null +++ b/dev/config/quota-management-list-configuration.yaml @@ -0,0 +1,35 @@ +--- +# A list of registered users given by their usernames irrespective whether they are under an organisation or not. +# If a user is not in this or in the `registered_users_per_organisation` list, only EVAL dinosaur instances will be allowed. +# For now, this only supports RH service account. +# In the future it may support service accounts outside RH. +# The structure of registered service accounts is: +# - username: is the account of the user. The username must be unique +# - max_allowed_instances: is the maximum number of instances this user can create. +# Defaults to the global value of `max-allowed-instances` which has different values for distinct environments. +registered_service_accounts: + - username: testuser1@example.com + max_allowed_instances: 1 + - username: testuser2@example.com + max_allowed_instances: 1 + - username: testuser3@example.com + max_allowed_instances: 1 + +# A list of registered users per organisation (see structure below). The list current contains known organisations - add yours if it is missing. +# If a user is not in this or in the `registered_service_accounts` list, only EVAL dinosaur instances will be allowed. +# - "id": is the organisation id +# - "any_user": "any_user": Controls whether to allow all users to create standard dinosaur instances with this organisation if "registered_users" list is empty. +# - max_allowed_instances: is the maximum number of instances this orgnisation. Defaults to the global value of `max-allowed-instances` which has different values for distinct environments. +# - "registered_users": A list of registered users for this organisation. If empty, no one is registered unless "any_user" is set to true. +# - username: is the account of the user. The username must be unique within the organisation and across organisations. +registered_users_per_organisation: + # The Red Hat employee org + - id: 11009103 + any_user: true + max_allowed_instances: 50 + registered_users: [] + # Static token's org_id, see config/static-token-payload.json. Used in E2E tests. + - id: 16155304 + any_user: true + max_allowed_instances: 100 + registered_users: [ ] diff --git a/e2e/e2e_canary_upgrade_test.go b/e2e/e2e_canary_upgrade_test.go index 43c1166534..7868a1e52c 100644 --- a/e2e/e2e_canary_upgrade_test.go +++ b/e2e/e2e_canary_upgrade_test.go @@ -216,7 +216,7 @@ var _ = Describe("Fleetshard-sync Targeted Upgrade", Ordered, func() { It("delete central", func() { Expect(deleteCentralByID(ctx, client, createdCentral.Id)). To(Succeed()) - Eventually(assertCentralRequestDeleting(ctx, client, createdCentral.Id)). + Eventually(assertCentralRequestDeprovisioning(ctx, client, createdCentral.Id)). WithTimeout(waitTimeout). WithPolling(defaultPolling). Should(Succeed())