Skip to content

Commit c63a87f

Browse files
Topic ocir user edit (#350)
When the OCIR user is specified for a BOAT user (e.g. bmc_operator_access/myuser) for autoscaling the tenancy namespace for the tenancy on which a WLS for OCI stack is applied is added to the user name (e.g. paasprodjcs/bmc_operator_access/myuser). Since the bmc_operator_access is the tenancy namespace the addition of the additional tenancy namespace causes OCIR requests to fail. With agreement from the proposal suggested by Adrian, we are going with the following change - If the ocir_username entered contains '/', then we assume that the customer has entered the complete info including the tenancy_namespace, identity domain and the username. If the ocir_username doesn't have a '/', then we append the namespace to it. Testing - a.) Created a stack with the tenancy namespace added. - Podman login was successful and the namespace was not appended again. b.) Created a stack without the namespace in the ocir_user variable - Stack provisioning did append the namespace and in our case it was the tenancy namespace where the stack is created
1 parent ea9db9c commit c63a87f

File tree

5 files changed

+7
-6
lines changed

5 files changed

+7
-6
lines changed

terraform/locals.tf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,9 @@ locals {
160160
ocir_namespace = data.oci_objectstorage_namespace.object_namespace.namespace
161161

162162
ocir_namespace_with_slash = format("%s/", local.ocir_namespace)
163-
ocir_user_starts_with = substr(var.ocir_user, 0, length(local.ocir_namespace_with_slash))
164-
ocir_user = local.ocir_user_starts_with == local.ocir_namespace_with_slash ? var.ocir_user : "${format("%s%s", local.ocir_namespace_with_slash, var.ocir_user)}"
163+
ocir_user_starts_with = substr(var.ocir_user, 0, length(local.ocir_namespace_with_slash)) == local.ocir_namespace_with_slash
164+
ocir_user_boat_access = strcontains(var.ocir_user, "bmc_operator_access")
165+
ocir_user = (local.ocir_user_boat_access || local.ocir_user_starts_with) ? var.ocir_user : "${format("%s%s", local.ocir_namespace_with_slash, var.ocir_user)}"
165166

166167
region_keys = data.oci_identity_regions.all_regions.regions.*.key
167168
region_names = data.oci_identity_regions.all_regions.regions.*.name

terraform/schema.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2601,7 +2601,7 @@ variables:
26012601
- ${use_autoscaling}
26022602
type: string
26032603
title: "Registry User Name"
2604-
description: "The user name to access the Oracle Cloud Infrastructure Registry (OCIR) for deploying autoscaling OCI functions, which has the format {identity domain name}/{username}. If your tenancy is using Oracle Identity Cloud Service, use the format oracleidentitycloudservice/{username}."
2604+
description: "The user name to access the Oracle Cloud Infrastructure Registry (OCIR) for deploying autoscaling OCI functions has the format {tenancy namespace}/{identity domain name}/{user name}. If the user is in the Default identity domain, do not include {identity domain name}. If you do not know the tenancy namespace do not add {tenancy_namespace} and let the stack set this for you. For example, if you don't know your tenancy namespace and your tenancy is federated with Oracle Identity Cloud Service with an identity domain of oracleidentitycloudservice you would set oracleidentitycloudservice/{username}."
26052605
required: true
26062606

26072607
ocir_auth_token_compartment_id:

terraform/schema_14110.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2138,7 +2138,7 @@ variables:
21382138
- ${use_autoscaling}
21392139
type: string
21402140
title: "Registry User Name"
2141-
description: "The user name to access the Oracle Cloud Infrastructure Registry (OCIR) for deploying autoscaling OCI functions, which has the format {identity domain name}/{username}. If your tenancy is using Oracle Identity Cloud Service, use the format oracleidentitycloudservice/{username}."
2141+
description: "The user name to access the Oracle Cloud Infrastructure Registry (OCIR) for deploying autoscaling OCI functions has the format {tenancy namespace}/{identity domain name}/{user name}. If the user is in the Default identity domain, do not include {identity domain name}. If you do not know the tenancy namespace do not add {tenancy_namespace} and let the stack set this for you. For example, if you don't know your tenancy namespace and your tenancy is federated with Oracle Identity Cloud Service with an identity domain of oracleidentitycloudservice you would set oracleidentitycloudservice/{username}."
21422142
required: true
21432143

21442144
ocir_auth_token_compartment_id:

terraform/schema_14120.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2610,7 +2610,7 @@ variables:
26102610
- ${use_autoscaling}
26112611
type: string
26122612
title: "Registry User Name"
2613-
description: "The user name to access the Oracle Cloud Infrastructure Registry (OCIR) for deploying autoscaling OCI functions, which has the format {identity domain name}/{username}. If your tenancy is using Oracle Identity Cloud Service, use the format oracleidentitycloudservice/{username}."
2613+
description: "The user name to access the Oracle Cloud Infrastructure Registry (OCIR) for deploying autoscaling OCI functions has the format {tenancy namespace}/{identity domain name}/{user name}. If the user is in the Default identity domain, do not include {identity domain name}. If you do not know the tenancy namespace do not add {tenancy_namespace} and let the stack set this for you. For example, if you don't know your tenancy namespace and your tenancy is federated with Oracle Identity Cloud Service with an identity domain of oracleidentitycloudservice you would set oracleidentitycloudservice/{username}."
26142614
required: true
26152615

26162616
ocir_auth_token_compartment_id:

terraform/schema_15110.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2138,7 +2138,7 @@ variables:
21382138
- ${use_autoscaling}
21392139
type: string
21402140
title: "Registry User Name"
2141-
description: "The user name to access the Oracle Cloud Infrastructure Registry (OCIR) for deploying autoscaling OCI functions, which has the format {identity domain name}/{username}. If your tenancy is using Oracle Identity Cloud Service, use the format oracleidentitycloudservice/{username}."
2141+
description: "The user name to access the Oracle Cloud Infrastructure Registry (OCIR) for deploying autoscaling OCI functions has the format {tenancy namespace}/{identity domain name}/{user name}. If the user is in the Default identity domain, do not include {identity domain name}. If you do not know the tenancy namespace do not add {tenancy_namespace} and let the stack set this for you. For example, if you don't know your tenancy namespace and your tenancy is federated with Oracle Identity Cloud Service with an identity domain of oracleidentitycloudservice you would set oracleidentitycloudservice/{username}."
21422142
required: true
21432143

21442144
ocir_auth_token_compartment_id:

0 commit comments

Comments
 (0)