From 6a331833cd2a3bdb5bbda07a8aae75ba63acfaaf Mon Sep 17 00:00:00 2001 From: galiacheng Date: Wed, 15 Sep 2021 14:25:35 +0800 Subject: [PATCH 01/20] On branch e2etest: OSSO account password should not include semicolon. Signed-off-by: galiacheng Changes to be committed: modified: src/main/arm/createUiDefinition.json --- weblogic-azure-aks/src/main/arm/createUiDefinition.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/weblogic-azure-aks/src/main/arm/createUiDefinition.json b/weblogic-azure-aks/src/main/arm/createUiDefinition.json index f0155ca8d..5f820c640 100644 --- a/weblogic-azure-aks/src/main/arm/createUiDefinition.json +++ b/weblogic-azure-aks/src/main/arm/createUiDefinition.json @@ -99,7 +99,7 @@ "toolTip": "Password for Oracle Single Sign-On authentication to login the Oracle Container Registry.", "constraints": { "required": true, - "regex": "^(?=.*[A-Z])(?=.*[a-z])(?=.*\\d)[A-Za-z\\d\\$\\&\\+\\,:;\\=\\?@#|'.\\^\\*!\\-_~/'\\[\\]\\{\\}\"]{8,}$", + "regex": "^(?=.*[A-Z])(?=.*[a-z])(?=.*\\d)[A-Za-z\\d\\$\\&\\+\\,:\\=\\?@#|'.\\^\\*!\\-_~/'\\[\\]\\{\\}\"]{8,}$", "validationMessage": "The password must contain at least 8 characters, with at least 1 uppercase letter, 1 lowercase letter and 1 number, and special characters, but should not contain > < ( ) % ; \\." }, "options": { From 7a5ba781b9cdad3f6ecdd4075ae89859a90c7e3e Mon Sep 17 00:00:00 2001 From: galiacheng Date: Fri, 17 Sep 2021 13:07:30 +0800 Subject: [PATCH 02/20] On branch e2etest: remove '/console/' from the remote console url. Signed-off-by: galiacheng Changes to be committed: modified: weblogic-azure-aks/src/main/bicep/modules/networking.bicep --- weblogic-azure-aks/src/main/bicep/modules/networking.bicep | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/weblogic-azure-aks/src/main/bicep/modules/networking.bicep b/weblogic-azure-aks/src/main/bicep/modules/networking.bicep index a0d7438b4..2f4b6231d 100644 --- a/weblogic-azure-aks/src/main/bicep/modules/networking.bicep +++ b/weblogic-azure-aks/src/main/bicep/modules/networking.bicep @@ -271,7 +271,7 @@ module pidNetworkingEnd './_pids/_pid.bicep' = { output adminConsoleExternalUrl string = enableAppGWIngress ? (enableDNSConfiguration ? format('http://{0}console', const_appgwAdminCustomDNSAlias) : format('http://{0}/console', appgwDeployment.outputs.appGatewayAlias)) : networkingDeployment3.outputs.adminConsoleLBUrl output adminConsoleExternalSecuredUrl string = enableAppGWIngress && enableCustomSSL && enableDNSConfiguration ? format('https://{0}console', const_appgwAdminCustomDNSAlias) : '' -output adminRemoteConsoleUrl string = enableAppGWIngress ? (enableDNSConfiguration ? format('http://{0}remoteconsole', const_appgwAdminCustomDNSAlias) : format('http://{0}/remoteconsole', appgwDeployment.outputs.appGatewayAlias)) : networkingDeployment3.outputs.adminConsoleLBUrl +output adminRemoteConsoleUrl string = enableAppGWIngress ? (enableDNSConfiguration ? format('http://{0}remoteconsole', const_appgwAdminCustomDNSAlias) : format('http://{0}/remoteconsole', appgwDeployment.outputs.appGatewayAlias)) : replace(networkingDeployment3.outputs.adminConsoleLBUrl, '/console/', '') output adminRemoteConsoleSecuredUrl string = enableAppGWIngress && enableCustomSSL && enableDNSConfiguration ? format('https://{0}remoteconsole', const_appgwAdminCustomDNSAlias) : '' output adminServerT3ChannelUrl string = ref_networkDeployment.outputs.adminServerT3LBUrl.value output clusterExternalUrl string = enableAppGWIngress ? (enableDNSConfiguration ? format('http://{0}', const_appgwCustomDNSAlias) : appgwDeployment.outputs.appGatewayURL) : networkingDeployment3.outputs.clusterLBUrl From 11b4b5b1c16c95c05de9985d59df555a30b32a1e Mon Sep 17 00:00:00 2001 From: galiacheng Date: Fri, 17 Sep 2021 13:28:52 +0800 Subject: [PATCH 03/20] On branch e2etest: remove slash from cluster endpoint. Signed-off-by: galiacheng Changes to be committed: modified: weblogic-azure-aks/src/main/arm/scripts/createLbSvc.sh --- weblogic-azure-aks/src/main/arm/scripts/createLbSvc.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/weblogic-azure-aks/src/main/arm/scripts/createLbSvc.sh b/weblogic-azure-aks/src/main/arm/scripts/createLbSvc.sh index b47ebd266..06ca88816 100644 --- a/weblogic-azure-aks/src/main/arm/scripts/createLbSvc.sh +++ b/weblogic-azure-aks/src/main/arm/scripts/createLbSvc.sh @@ -234,7 +234,7 @@ function create_lb_svc_for_cluster_default_channel() { if [ "${enableCustomDNSAlias,,}" == "true" ]; then create_dns_A_record "${clusterEndpoint%%:*}" ${dnsClusterLabel} ${dnsRGName} ${dnsZoneName} - clusterEndpoint="${dnsClusterLabel}.${dnsZoneName}:${clusterEndpoint#*:}/" + clusterEndpoint="${dnsClusterLabel}.${dnsZoneName}:${clusterEndpoint#*:}" fi } From f73c5a27c9de08d86e63c703e06d9e814e843f60 Mon Sep 17 00:00:00 2001 From: galiacheng Date: Sat, 18 Sep 2021 09:57:28 +0800 Subject: [PATCH 04/20] On branch e2etest: fix regression issue in post deployment introduced by t3 tunneling Signed-off-by: galiacheng Changes to be committed: modified: weblogic-azure-aks/src/main/arm/scripts/updateApplications.sh --- .../main/arm/scripts/updateApplications.sh | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/weblogic-azure-aks/src/main/arm/scripts/updateApplications.sh b/weblogic-azure-aks/src/main/arm/scripts/updateApplications.sh index c1a5fa945..288148971 100644 --- a/weblogic-azure-aks/src/main/arm/scripts/updateApplications.sh +++ b/weblogic-azure-aks/src/main/arm/scripts/updateApplications.sh @@ -184,6 +184,21 @@ function query_app_urls() { } function build_docker_image() { + local enableAdminT3=${constFalse} + local enableClusterT3=${constFalse} + + local adminT3AddressEnv=$(kubectl -n ${wlsDomainNS} get domain ${wlsDomainUID} -o json \ + | jq '. | .spec.serverPod.env[] | select(.name=="'${constAdminT3AddressEnvName}'")') + if [ -n "${adminT3AddressEnv}" ]; then + enableAdminT3=${constTrue} + fi + + local clusterT3AddressEnv=$(kubectl -n ${wlsDomainNS} get domain ${wlsDomainUID} -o json \ + | jq '. | .spec.serverPod.env[] | select(.name=="'${constClusterT3AddressEnvName}'")') + if [ -n "${clusterT3AddressEnv}" ]; then + enableClusterT3=${constTrue} + fi + echo "build a new image including the new applications" chmod ugo+x $scriptDir/createVMAndBuildImage.sh echo $azureACRPassword $ocrSSOPSW | \ @@ -197,7 +212,9 @@ function build_docker_image() { $ocrSSOUser \ $wlsClusterSize \ $enableCustomSSL \ - "$scriptURL" + "$scriptURL" \ + ${enableAdminT3} \ + ${enableClusterT3} az acr repository show -n ${acrName} --image aks-wls-images:${newImageTag} if [ $? -ne 0 ]; then From 8a0231209beba9d7a317247d921e346ae563db9d Mon Sep 17 00:00:00 2001 From: galiacheng Date: Sat, 18 Sep 2021 13:58:02 +0800 Subject: [PATCH 05/20] On branch e2etest: fix issue - fail to create multiple domains in the sample cluster with SSL enabled. Query storage account name from one of existing pv label Signed-off-by: galiacheng Changes to be committed: modified: weblogic-azure-aks/src/main/arm/scripts/queryStorageAccount.sh modified: weblogic-azure-aks/src/main/bicep/mainTemplate.bicep modified: weblogic-azure-aks/src/main/bicep/modules/_deployment-scripts/_ds-query-storage-account.bicep --- .../main/arm/scripts/queryStorageAccount.sh | 41 ++++++++----------- .../src/main/bicep/mainTemplate.bicep | 1 - .../_ds-query-storage-account.bicep | 3 +- 3 files changed, 19 insertions(+), 26 deletions(-) diff --git a/weblogic-azure-aks/src/main/arm/scripts/queryStorageAccount.sh b/weblogic-azure-aks/src/main/arm/scripts/queryStorageAccount.sh index 58c033a74..a9241912e 100644 --- a/weblogic-azure-aks/src/main/arm/scripts/queryStorageAccount.sh +++ b/weblogic-azure-aks/src/main/arm/scripts/queryStorageAccount.sh @@ -1,35 +1,30 @@ export aksClusterRGName=$1 export aksClusterName=$2 -export wlsDomainUID=$3 -export wlsDomainNS="${wlsDomainUID}-ns" export currentStorageAccount="null" # Connect to AKS cluster function connect_aks_cluster() { - az aks get-credentials \ - --resource-group ${aksClusterRGName} \ - --name ${aksClusterName} \ - --overwrite-existing + az aks get-credentials \ + --resource-group ${aksClusterRGName} \ + --name ${aksClusterName} \ + --overwrite-existing } function query_storage_account() { - echo "install kubectl" - az aks install-cli - - echo "get pv, pvc" - pvcName=${wlsDomainUID}-pvc-azurefile - pvName=${wlsDomainUID}-pv-azurefile - - ret=$(kubectl -n ${wlsDomainNS} get pvc ${pvcName} | grep "Bound") - - if [ -n "$ret" ]; then - echo "pvc is bound to namespace ${wlsDomainNS}." - # this is a workaround for update domain using marketplace offer. - # the offer will create a new storage account in a new resource group. - # remove the new storage account. - currentStorageAccount=$(kubectl get pv ${pvName} -o json | jq '. | .metadata.labels.storageAccount' | tr -d "\"") - fi + echo "install kubectl" + az aks install-cli + + echo "get pv name" + pvName=$(kubectl get pv -o json | + jq '.items[] | select(.status.phase=="Bound") | [.metadata.name] | .[0]' | + tr -d "\"") + + if [[ "${pvName}" != "null" ]] && [[ "${pvName}" != "" ]]; then + # this is a workaround for update domain using marketplace offer. + # the offer will create a new storage account in a new resource group if there is no storage attached. + currentStorageAccount=$(kubectl get pv ${pvName} -o json | jq '. | .metadata.labels.storageAccount' | tr -d "\"") + fi } function output_result() { @@ -46,4 +41,4 @@ connect_aks_cluster query_storage_account -output_result \ No newline at end of file +output_result diff --git a/weblogic-azure-aks/src/main/bicep/mainTemplate.bicep b/weblogic-azure-aks/src/main/bicep/mainTemplate.bicep index 497302265..0fe1aa543 100644 --- a/weblogic-azure-aks/src/main/bicep/mainTemplate.bicep +++ b/weblogic-azure-aks/src/main/bicep/mainTemplate.bicep @@ -323,7 +323,6 @@ module queryStorageAccount 'modules/_deployment-scripts/_ds-query-storage-accoun aksClusterName: aksClusterName aksClusterRGName: aksClusterRGName identity: identity - wlsDomainUID: wlsDomainUID } } diff --git a/weblogic-azure-aks/src/main/bicep/modules/_deployment-scripts/_ds-query-storage-account.bicep b/weblogic-azure-aks/src/main/bicep/modules/_deployment-scripts/_ds-query-storage-account.bicep index 92d096b28..e973be8ae 100644 --- a/weblogic-azure-aks/src/main/bicep/modules/_deployment-scripts/_ds-query-storage-account.bicep +++ b/weblogic-azure-aks/src/main/bicep/modules/_deployment-scripts/_ds-query-storage-account.bicep @@ -6,9 +6,8 @@ param aksClusterRGName string = '' param identity object param utcValue string = utcNow() -param wlsDomainUID string = 'sample-domain1' -var const_arguments = '${aksClusterRGName} ${aksClusterName} ${wlsDomainUID}' +var const_arguments = '${aksClusterRGName} ${aksClusterName}' var const_azcliVersion='2.15.0' var const_deploymentName='ds-query-storage-account' From 6cd35f728d6223a282900d90f0b437f251b9d14c Mon Sep 17 00:00:00 2001 From: galiacheng Date: Sat, 18 Sep 2021 14:31:50 +0800 Subject: [PATCH 06/20] On branch e2etest: wait for ingress completed. Signed-off-by: galiacheng Changes to be committed: modified: weblogic-azure-aks/src/main/arm/scripts/createAppGatewayIngress.sh modified: weblogic-azure-aks/src/main/arm/scripts/utility.sh --- .../arm/scripts/createAppGatewayIngress.sh | 4 +-- .../src/main/arm/scripts/utility.sh | 29 +++++++++++++++++++ 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/weblogic-azure-aks/src/main/arm/scripts/createAppGatewayIngress.sh b/weblogic-azure-aks/src/main/arm/scripts/createAppGatewayIngress.sh index ba1ec299e..a4d41688d 100644 --- a/weblogic-azure-aks/src/main/arm/scripts/createAppGatewayIngress.sh +++ b/weblogic-azure-aks/src/main/arm/scripts/createAppGatewayIngress.sh @@ -492,7 +492,7 @@ function appgw_ingress_svc_for_cluster() { generate_appgw_cluster_config_file kubectl apply -f ${clusterAppgwIngressYamlPath} utility_validate_status "Create appgw ingress svc." - utility_waitfor_lb_svc_completed \ + utility_waitfor_ingress_completed \ ${clusterIngressName} \ ${wlsDomainNS} \ ${checkSVCStateMaxAttempt} \ @@ -502,7 +502,7 @@ function appgw_ingress_svc_for_cluster() { if [[ "${enableCustomSSL,,}" != "true" ]]; then kubectl apply -f ${clusterAppgwIngressHttpsYamlPath} utility_validate_status "Create appgw ingress https svc." - utility_waitfor_lb_svc_completed \ + utility_waitfor_ingress_completed \ ${clusterIngressHttpsName} \ ${wlsDomainNS} \ ${checkSVCStateMaxAttempt} \ diff --git a/weblogic-azure-aks/src/main/arm/scripts/utility.sh b/weblogic-azure-aks/src/main/arm/scripts/utility.sh index f2eb83bef..42b0cf113 100644 --- a/weblogic-azure-aks/src/main/arm/scripts/utility.sh +++ b/weblogic-azure-aks/src/main/arm/scripts/utility.sh @@ -306,3 +306,32 @@ function utility_waitfor_lb_svc_completed() { exit 1 fi } + +# Call this function to make sure the ingress is avaliable. +function utility_waitfor_ingress_completed() { + svcName=$1 + wlsDomainNS=$2 + perfSVCAttemps=$3 + perfRetryInterval=$4 + + attempts=0 + svcState="running" + while [ "$svcState" == "running" ] && [ $attempts -lt ${perfSVCAttemps} ]; do + svcState="completed" + attempts=$((attempts + 1)) + echo Waiting for job completed...${attempts} + sleep ${perfRetryInterval} + + ip=$(kubectl get ingress ${svcName} -n ${wlsDomainNS} -o json | + jq '.status.loadBalancer.ingress[0].ip') + echo "ip: ${ip}" + if [[ "${ip}" == "null" ]]; then + svcState="running" + fi + done + + if [ "$svcState" == "running" ] && [ $attempts -ge ${perfSVCAttemps} ]; then + echo_stderr "Failed to create service: ${svcName}" + exit 1 + fi +} From 8869d6b0ffa24119d49f87faddfb30b4262ff1ef Mon Sep 17 00:00:00 2001 From: galiacheng Date: Wed, 22 Sep 2021 09:47:14 +0800 Subject: [PATCH 07/20] On branch e2etest: UI fix: make nodeVM size number is the same with node count. Changes to be committed: modified: ../../src/main/arm/createUiDefinition.json --- weblogic-azure-aks/src/main/arm/createUiDefinition.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/weblogic-azure-aks/src/main/arm/createUiDefinition.json b/weblogic-azure-aks/src/main/arm/createUiDefinition.json index 5f820c640..16adbf584 100644 --- a/weblogic-azure-aks/src/main/arm/createUiDefinition.json +++ b/weblogic-azure-aks/src/main/arm/createUiDefinition.json @@ -351,7 +351,7 @@ "label": "Node count", "defaultValue": 2, "showStepMarkers": false, - "toolTip": "The number of nodes that should be created along with the cluster. You will be able to resize the cluster later", + "toolTip": "The number of nodes that should be created along with the cluster. You will be able to resize the cluster later.", "constraints": { "required": true }, @@ -375,7 +375,7 @@ "hideDiskTypeFilter": false }, "osPlatform": "Linux", - "count": 2, + "count": "[steps('section_aks').clusterInfo.aksNodeCount]", "visible": "[bool(steps('section_aks').clusterInfo.createAKSCluster)]" }, { From 519ce5deacff9c198197af16ada1f4bad965e40a Mon Sep 17 00:00:00 2001 From: galiacheng Date: Wed, 22 Sep 2021 10:43:02 +0800 Subject: [PATCH 08/20] On branch e2etest: fix regex of managed server prefix. The prefix must be between 3 and 20 characters long and contain letters, numbers and hyphens(-). The name must begin with a letter, end with a letter or digit, and not contain consecutive hyphens. Changes to be committed: modified: weblogic-azure-aks/src/main/arm/createUiDefinition.json Signed-off-by: galiacheng --- weblogic-azure-aks/src/main/arm/createUiDefinition.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/weblogic-azure-aks/src/main/arm/createUiDefinition.json b/weblogic-azure-aks/src/main/arm/createUiDefinition.json index 16adbf584..fec0e3984 100644 --- a/weblogic-azure-aks/src/main/arm/createUiDefinition.json +++ b/weblogic-azure-aks/src/main/arm/createUiDefinition.json @@ -168,8 +168,8 @@ "defaultValue": "managed-server", "constraints": { "required": true, - "regex": "^[a-z0-9A-Z\\-]{3,20}$", - "validationMessage": "The prefix must be between 3 and 20 characters long and contain letters, numbers and -." + "regex": "^(?=.{3,20}$)[a-zA-Z](([a-z0-9A-Z]*|(?:\\-[^\\-][a-z0-9A-Z]*))*)", + "validationMessage": "The prefix must be between 3 and 20 characters long and contain letters, numbers and hyphens(-). The name must begin with a letter, end with a letter or digit, and not contain consecutive hyphens." }, "visible": "[bool(basics('basicsOptional').basicsOptionalAcceptDefaults)]" }, From 70d4168e54885f8883843d96be157e85f45beaf5 Mon Sep 17 00:00:00 2001 From: galiacheng Date: Wed, 22 Sep 2021 13:23:25 +0800 Subject: [PATCH 09/20] On branch e2etest: enhance Lb editable grid with regex on service name prefix and port, no support on duplicated service prefix and duplicated targets. Signed-off-by: galiacheng Changes to be committed: modified: weblogic-azure-aks/src/main/arm/createUiDefinition.json --- .../src/main/arm/createUiDefinition.json | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/weblogic-azure-aks/src/main/arm/createUiDefinition.json b/weblogic-azure-aks/src/main/arm/createUiDefinition.json index fec0e3984..cd48a5ffe 100644 --- a/weblogic-azure-aks/src/main/arm/createUiDefinition.json +++ b/weblogic-azure-aks/src/main/arm/createUiDefinition.json @@ -996,7 +996,7 @@ "rows": { "count": { "min": 0, - "max": 10 + "max": 4 } }, "columns": [ @@ -1011,8 +1011,12 @@ "required": true, "validations": [ { - "regex": "^[a-z0-9A-Z-]{1,30}$", - "message": "Only alphanumeric characters are allowed, and the value must be 1-30 characters long." + "isValid": "[lessOrEquals(length(filter(steps('section_appGateway').lbSVCInfo.lbSVC, (item) => equals(item.colName, last(take(steps('section_appGateway').lbSVCInfo.lbSVC, $rowIndex)).colName))),1)]", + "message": "You can not input the same service prefix repeadly, please change any of the value." + }, + { + "regex": "^(?=.{3,20}$)[a-zA-Z](([a-z0-9A-Z]*|(?:\\-[^\\-][a-z0-9A-Z]*))*)", + "message": "The prefix must be between 3 and 20 characters long and contain letters, numbers and hyphens(-). The name must begin with a letter, end with a letter or digit, and not contain consecutive hyphens." } ] } @@ -1060,7 +1064,11 @@ "required": true, "validations": [ { - "regex": "^[0-9]{1,5}$", + "isValid": "[lessOrEquals(length(filter(steps('section_appGateway').lbSVCInfo.lbSVC, (item) => equals(item.colTarget, last(take(steps('section_appGateway').lbSVCInfo.lbSVC, $rowIndex)).colTarget))),1)]", + "message": "You can not select the same target repeadly." + }, + { + "regex": "^()([1-9]|[1-5]?[0-9]{2,4}|6[1-4][0-9]{3}|65[1-4][0-9]{2}|655[1-2][0-9]|6553[1-5])$", "message": "Only numbers are allowed, and the value must be 1-65535." } ] From d90f8412a1a8244001df9b476389a4faf8cc0684 Mon Sep 17 00:00:00 2001 From: galiacheng Date: Wed, 22 Sep 2021 13:37:38 +0800 Subject: [PATCH 10/20] On branch e2etest: fix regex of app gateway frontend password. The password must contain at least 6 characters, with at least 1 uppercase letter, 1 lowercase letter and 1 number. Signed-off-by: galiacheng Changes to be committed: modified: weblogic-azure-aks/src/main/arm/createUiDefinition.json --- weblogic-azure-aks/src/main/arm/createUiDefinition.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/weblogic-azure-aks/src/main/arm/createUiDefinition.json b/weblogic-azure-aks/src/main/arm/createUiDefinition.json index cd48a5ffe..6429179ea 100644 --- a/weblogic-azure-aks/src/main/arm/createUiDefinition.json +++ b/weblogic-azure-aks/src/main/arm/createUiDefinition.json @@ -1193,7 +1193,7 @@ "toolTip": "Frontend TLS/SSL certificate password", "constraints": { "required": "[equals(steps('section_appGateway').appgwIngress.certificateOption, 'haveCert')]", - "regex": "^((?=.*[0-9])(?=.*[a-z])|(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z])|(?=.*[0-9])(?=.*[a-z])(?=.*[!@#$%^&*])|(?=.*[0-9])(?=.*[A-Z])(?=.*[!@#$%^&*])|(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&*])).{6,128}$", + "regex": "^((?=.*[0-9])(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&*])).{6,128}$", "validationMessage": "The password must contain at least 6 characters, with at least 1 uppercase letter, 1 lowercase letter and 1 number." }, "options": { From 89550ab21e7b8d62a3f1f2a72099adbfb78164a0 Mon Sep 17 00:00:00 2001 From: galiacheng Date: Wed, 22 Sep 2021 14:57:34 +0800 Subject: [PATCH 11/20] On branch e2etest: fix regex for "contains letters, numbers and hyphens (-), must begin with a letter, end with a letter or digit, and not contain consecutive hyphens." Regex: ^(?=.{3,24}$)[a-zA-Z](?!.*--)[a-zA-Z0-9-]*[a-zA-Z0-9]$ Test case: Pass: he-g-hg-f hl-h12 AIRV123 g90-ouio-hfujhh-AjhAhj Failed: l7-$u-#5l-^-^k h-j--y 1sdfdaf hohjjghj- -gfffgrgfdsf g90-ouio-hfujhh-AjhAhjffgadfg hi-^ hi- hji--o Signed-off-by: galiacheng Changes to be committed: modified: src/main/arm/createUiDefinition.json --- .../src/main/arm/createUiDefinition.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/weblogic-azure-aks/src/main/arm/createUiDefinition.json b/weblogic-azure-aks/src/main/arm/createUiDefinition.json index 6429179ea..cb9a5a0dd 100644 --- a/weblogic-azure-aks/src/main/arm/createUiDefinition.json +++ b/weblogic-azure-aks/src/main/arm/createUiDefinition.json @@ -168,7 +168,7 @@ "defaultValue": "managed-server", "constraints": { "required": true, - "regex": "^(?=.{3,20}$)[a-zA-Z](([a-z0-9A-Z]*|(?:\\-[^\\-][a-z0-9A-Z]*))*)", + "regex": "^(?=.{3,20}$)[a-zA-Z](?!.*--)[a-zA-Z0-9-]*[a-zA-Z0-9]$", "validationMessage": "The prefix must be between 3 and 20 characters long and contain letters, numbers and hyphens(-). The name must begin with a letter, end with a letter or digit, and not contain consecutive hyphens." }, "visible": "[bool(basics('basicsOptional').basicsOptionalAcceptDefaults)]" @@ -194,8 +194,8 @@ "defaultValue": "sample-domain1", "constraints": { "required": true, - "regex": "^[a-z0-9A-Z\\-]{3,20}$", - "validationMessage": "The Domain UID must be between 3 and 20 characters long and contain letters, numbers and -." + "regex": "^(?=.{3,20}$)[a-zA-Z](?!.*--)[a-zA-Z0-9-]*[a-zA-Z0-9]$", + "validationMessage": "The prefix must be between 3 and 20 characters long and contain letters, numbers and hyphens(-). The name must begin with a letter, end with a letter or digit, and not contain consecutive hyphens." }, "visible": "[bool(basics('basicsOptional').basicsOptionalAcceptDefaults)]" }, @@ -804,7 +804,7 @@ "toolTip": "Use only letters and numbers", "constraints": { "required": true, - "regex": "^(?=.{3,24}$)[a-zA-Z](([a-z0-9A-Z]*|(?:\\-[^\\-][a-z0-9A-Z]*))*)$", + "regex": "^(?=.{3,24}$)[a-zA-Z](?!.*--)[a-zA-Z0-9-]*[a-zA-Z0-9]$", "validationMessage": "[if(or(greater(length(steps('section_sslConfiguration').keyVaultStoredCustomSSLSettings.keyVaultName), 24), less(length(steps('section_sslConfiguration').keyVaultStoredCustomSSLSettings.keyVaultName), 3)),'Vault name must be between 3-24 alphanumeric characters. The name must begin with a letter, end with a letter or digit, and not contain consecutive hyphens.','Vault name must only contain alphanumeric characters and dashes and cannot start with a number')]" } }, @@ -1015,7 +1015,7 @@ "message": "You can not input the same service prefix repeadly, please change any of the value." }, { - "regex": "^(?=.{3,20}$)[a-zA-Z](([a-z0-9A-Z]*|(?:\\-[^\\-][a-z0-9A-Z]*))*)", + "regex": "^(?=.{3,20}$)[a-zA-Z](?!.*--)[a-zA-Z0-9-]*[a-zA-Z0-9]$", "message": "The prefix must be between 3 and 20 characters long and contain letters, numbers and hyphens(-). The name must begin with a letter, end with a letter or digit, and not contain consecutive hyphens." } ] @@ -1238,7 +1238,7 @@ "toolTip": "Use only letters and numbers", "constraints": { "required": true, - "regex": "^(?=.{3,24}$)[a-zA-Z](([a-z0-9A-Z]*|(?:\\-[^\\-][a-z0-9A-Z]*))*)$", + "regex": "^(?=.{3,24}$)[a-zA-Z](?!.*--)[a-zA-Z0-9-]*[a-zA-Z0-9]$", "validationMessage": "[if(or(greater(length(steps('section_appGateway').appgwIngress.keyVaultName), 24), less(length(steps('section_appGateway').appgwIngress.keyVaultName), 3)),'Vault name must be between 3-24 alphanumeric characters. The name must begin with a letter, end with a letter or digit, and not contain consecutive hyphens.','Vault name must only contain alphanumeric characters and dashes and cannot start with a number')]" }, "visible": "[equals(steps('section_appGateway').appgwIngress.certificateOption, 'haveKeyVault')]" From 96ec326b1b189be7105fdf3e6fc27f288868e552 Mon Sep 17 00:00:00 2001 From: galiacheng Date: Wed, 22 Sep 2021 15:26:52 +0800 Subject: [PATCH 12/20] On branch e2etest: do not download unsupport files (files should end with .war, .jar, .ear) Signed-off-by: galiacheng Changes to be committed: modified: src/main/arm/createUiDefinition.json modified: src/main/arm/scripts/genImageModel.sh --- weblogic-azure-aks/src/main/arm/createUiDefinition.json | 9 +++++---- weblogic-azure-aks/src/main/arm/scripts/genImageModel.sh | 8 ++++++++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/weblogic-azure-aks/src/main/arm/createUiDefinition.json b/weblogic-azure-aks/src/main/arm/createUiDefinition.json index cb9a5a0dd..70a7c7bc9 100644 --- a/weblogic-azure-aks/src/main/arm/createUiDefinition.json +++ b/weblogic-azure-aks/src/main/arm/createUiDefinition.json @@ -453,7 +453,7 @@ "type": "Microsoft.Common.TextBlock", "visible": true, "options": { - "text": "This value is appended to 'container-registry.oracle.com/middleware/weblogic:' and used in the Dockerfile FROM statement. \nOracle Standard Terms and Restrictions terms must be agreed. \nClick the following link to make sure you have agree the terms and check the valid tags.", + "text": "This value is appended to 'container-registry.oracle.com/middleware/weblogic:' and used in the Dockerfile from statement. \nOracle Standard Terms and Restrictions terms must be agreed. \nClick the following link to make sure you have agree the terms and check the valid tags.", "link": { "label": "Must be a valid tag value from Oracle Container Registry", "uri": "https://aka.ms/wls-aks-fromImage-tag?${project.version}-${maven.build.timestamp}" @@ -508,10 +508,11 @@ { "name": "appPackageUrl", "type": "Microsoft.Common.FileUpload", - "label": "Application package (.war,.ear)", - "toolTip": "The application war package to deploy.", + "label": "Application package (.war,.ear,.jar)", + "toolTip": "The application package to deploy.", "constraints": { - "required": true + "required": true, + "accept": ".war,.ear,.jar" }, "options": { "multiple": true, diff --git a/weblogic-azure-aks/src/main/arm/scripts/genImageModel.sh b/weblogic-azure-aks/src/main/arm/scripts/genImageModel.sh index 8b5c3d818..5daf9dad9 100644 --- a/weblogic-azure-aks/src/main/arm/scripts/genImageModel.sh +++ b/weblogic-azure-aks/src/main/arm/scripts/genImageModel.sh @@ -175,6 +175,14 @@ EOF fileName="${urlWithoutQueryString##*/}" echo $fileName fileExtension="${fileName##*.}" + echo ${fileExtension} + # support .ear, .war, .jar files. + if [[ "${fileExtension,,}" != "ear" ]] && + [[ "${fileExtension,,}" != "war" ]] && + [[ "${fileExtension,,}" != "jar" ]]; then + continue + fi + curl -m ${curlMaxTime} -fL "$item" -o ${scriptDir}/model-images/wlsdeploy/applications/${fileName} if [ $? -ne 0 ];then echo "Failed to download $item" From e118289f70390a61d39b0abd48d54a2eaf05f95b Mon Sep 17 00:00:00 2001 From: galiacheng Date: Wed, 22 Sep 2021 15:51:42 +0800 Subject: [PATCH 13/20] On branch e2etest: fix regex for db user name. Regex: ^(?=.{1,128}$)[a-zA-Z](?!.*--)(?!.*@@)(?!.*-@)(?!.*@-)[a-zA-Z0-9-@]*[a-zA-Z0-9]$ Test cases: Pass: weblogic weblogic@azurepostgresql weblogic-qa weblo12 Aweblogic13 w-e-b-l-o-g-i-c@azurepostgresql Failed: @weblogic @-@ w--b w@@b w-@b w@-b Signed-off-by: galiacheng Changes to be committed: modified: src/main/arm/createUiDefinition.json --- weblogic-azure-aks/src/main/arm/createUiDefinition.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/weblogic-azure-aks/src/main/arm/createUiDefinition.json b/weblogic-azure-aks/src/main/arm/createUiDefinition.json index 70a7c7bc9..9e07179f4 100644 --- a/weblogic-azure-aks/src/main/arm/createUiDefinition.json +++ b/weblogic-azure-aks/src/main/arm/createUiDefinition.json @@ -1621,7 +1621,7 @@ "defaultValue": "", "constraints": { "required": "[bool(steps('section_database').enableDB)]", - "regex": "^(?!\\-)([a-z0-9A-Z@\\-]{1,128})([^\\-])$", + "regex": "^(?=.{1,128}$)[a-zA-Z](?!.*--)(?!.*@@)(?!.*-@)(?!.*@-)[a-zA-Z0-9-@]*[a-zA-Z0-9]$", "validationMessage": "The value must be 1-128 characters long and must only contain letters, numbers, hyphen(-) and the at sign, no hyphen allowed at the beginning and the end of database username." }, "visible": true @@ -1637,7 +1637,7 @@ "constraints": { "required": "[bool(steps('section_database').enableDB)]", "regex": "^((?=.*[0-9])(?=.*[a-zA-Z!@#$%^&*])).{5,128}$", - "validationMessage": "The password must be between five and 128 characters long and have at least one number." + "validationMessage": "The password must be between 5 and 128 characters long and have at least one number." }, "options": { "hideConfirmation": false From 5bfa86371ec71484dff7142f7c92b24e2017ea3e Mon Sep 17 00:00:00 2001 From: galiacheng Date: Wed, 22 Sep 2021 16:15:28 +0800 Subject: [PATCH 14/20] On branch e2etest: enhance tooltip of DNS Zone name control. Signed-off-by: galiacheng Changes to be committed: modified: src/main/arm/createUiDefinition.json --- weblogic-azure-aks/src/main/arm/createUiDefinition.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/weblogic-azure-aks/src/main/arm/createUiDefinition.json b/weblogic-azure-aks/src/main/arm/createUiDefinition.json index 9e07179f4..02a753635 100644 --- a/weblogic-azure-aks/src/main/arm/createUiDefinition.json +++ b/weblogic-azure-aks/src/main/arm/createUiDefinition.json @@ -1412,7 +1412,7 @@ "type": "Microsoft.Common.TextBox", "label": "DNS Zone Name", "defaultValue": "", - "toolTip": "Use only letters and numbers and periods to separate Domains", + "toolTip": "Each label must only contain letters, numbers, underscores, and dashes. Use periods to separate Domains", "constraints": { "required": true, "regex": "^([0-9a-zA-Z_-]{1,63}\\.){1,33}[0-9a-zA-Z_-]{1,63}$", From eaef43f620ca8e98f402cf0b6f39f7fad515afa3 Mon Sep 17 00:00:00 2001 From: galiacheng Date: Wed, 22 Sep 2021 16:41:04 +0800 Subject: [PATCH 15/20] On branch e2etest: increase pom version Signed-off-by: galiacheng Changes not staged for commit: modified: src/main/bicep/mainTemplate.bicep --- weblogic-azure-aks/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/weblogic-azure-aks/pom.xml b/weblogic-azure-aks/pom.xml index e594b6be1..fa63fa571 100644 --- a/weblogic-azure-aks/pom.xml +++ b/weblogic-azure-aks/pom.xml @@ -11,7 +11,7 @@ com.oracle.weblogic.azure wls-on-aks-azure-marketplace - 1.0.17 + 1.0.18 com.microsoft.azure.iaas From d21ac962a6479b6544dae98659a14e486cf15ab2 Mon Sep 17 00:00:00 2001 From: galiacheng Date: Wed, 22 Sep 2021 17:33:54 +0800 Subject: [PATCH 16/20] On branch e2etest: allow underscores (_), periods (.) and hyphens in jndi name. Signed-off-by: galiacheng Changes to be committed: modified: src/main/arm/createUiDefinition.json --- weblogic-azure-aks/src/main/arm/createUiDefinition.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/weblogic-azure-aks/src/main/arm/createUiDefinition.json b/weblogic-azure-aks/src/main/arm/createUiDefinition.json index 02a753635..812fac057 100644 --- a/weblogic-azure-aks/src/main/arm/createUiDefinition.json +++ b/weblogic-azure-aks/src/main/arm/createUiDefinition.json @@ -1595,8 +1595,8 @@ "defaultValue": "", "constraints": { "required": "[bool(steps('section_database').enableDB)]", - "regex": "^[a-z0-9A-Z/]{1,30}$", - "validationMessage": "The value must be 1-30 characters long and must only contain letters, numbers, and slashes (/)." + "regex": "^[a-zA-Z0-9./_-]{1,30}$", + "validationMessage": "The value must be 1-30 characters long and must only contain letters, numbers, hyphens (-), underscores (_), periods (.) and slashes (/)." }, "visible": true }, From cbf3458ed204710e976edf479c745f90fa85fdfe Mon Sep 17 00:00:00 2001 From: galiacheng Date: Thu, 23 Sep 2021 15:02:22 +0800 Subject: [PATCH 17/20] On branchc e2etest: take "." "_" "(" ")" from gateway dns name that introduced by resource group name. Signed-off-by: galiacheng Changes to be committed: modified: weblogic-azure-aks/src/main/bicep/mainTemplate.bicep modified: weblogic-azure-aks/src/main/bicep/modules/_azure-resoruces/_appgateway.bicep --- weblogic-azure-aks/src/main/bicep/mainTemplate.bicep | 3 ++- .../src/main/bicep/modules/_azure-resoruces/_appgateway.bicep | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/weblogic-azure-aks/src/main/bicep/mainTemplate.bicep b/weblogic-azure-aks/src/main/bicep/mainTemplate.bicep index 0fe1aa543..b1e2608c0 100644 --- a/weblogic-azure-aks/src/main/bicep/mainTemplate.bicep +++ b/weblogic-azure-aks/src/main/bicep/mainTemplate.bicep @@ -260,12 +260,13 @@ var const_wlsJavaOptions = wlsJavaOption == '' ? 'null' : wlsJavaOption var const_wlsSSLCertOptionKeyVault = 'keyVaultStoredConfig' var name_defaultPidDeployment = 'pid' var name_dnsNameforApplicationGateway = '${concat(dnsNameforApplicationGateway, take(utcValue, 6))}' -var name_domainLabelforApplicationGateway = '${take(concat(name_dnsNameforApplicationGateway, '-', toLower(resourceGroup().name), '-', toLower(wlsDomainName)), 63)}' +var name_domainLabelforApplicationGateway = '${take(concat(name_dnsNameforApplicationGateway, '-', toLower(name_rgNameWithoutSpecialCharacter), '-', toLower(wlsDomainName)), 63)}' var name_identityKeyStoreDataSecret = (sslConfigurationAccessOption == const_wlsSSLCertOptionKeyVault) ? sslKeyVaultCustomIdentityKeyStoreDataSecretName : 'myIdentityKeyStoreData' var name_identityKeyStorePswSecret = (sslConfigurationAccessOption == const_wlsSSLCertOptionKeyVault) ? sslKeyVaultCustomIdentityKeyStorePassPhraseSecretName : 'myIdentityKeyStorePsw' var name_keyVaultName = empty(const_keyvaultNameFromTag) ? '${take(concat('wls-kv', uniqueString(utcValue)), 24)}' : resourceGroup().tags.wlsKeyVault var name_privateKeyAliasSecret = (sslConfigurationAccessOption == const_wlsSSLCertOptionKeyVault) ? sslKeyVaultPrivateKeyAliasSecretName : 'privateKeyAlias' var name_privateKeyPswSecret = (sslConfigurationAccessOption == const_wlsSSLCertOptionKeyVault) ? sslKeyVaultPrivateKeyPassPhraseSecretName : 'privateKeyPsw' +var name_rgNameWithoutSpecialCharacter= replace(replace(replace(replace(resourceGroup().name, '.', ''), '(', ''), ')', ''), '_', '') // remove . () _ from resource group name var name_rgKeyvaultForWLSSSL = (sslConfigurationAccessOption == const_wlsSSLCertOptionKeyVault) ? sslKeyVaultResourceGroup : resourceGroup().name var name_storageAccountName = const_hasStorageAccount ? reference('query-existing-storage-account').outputs.storageAccount.value : 'wls${uniqueString(utcValue)}' var name_tagNameForKeyVault = 'wlsKeyVault' diff --git a/weblogic-azure-aks/src/main/bicep/modules/_azure-resoruces/_appgateway.bicep b/weblogic-azure-aks/src/main/bicep/modules/_azure-resoruces/_appgateway.bicep index f0d9f0d94..ac81e0c38 100644 --- a/weblogic-azure-aks/src/main/bicep/modules/_azure-resoruces/_appgateway.bicep +++ b/weblogic-azure-aks/src/main/bicep/modules/_azure-resoruces/_appgateway.bicep @@ -2,7 +2,7 @@ // Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. @description('DNS for ApplicationGateway') -param dnsNameforApplicationGateway string = take('wlsgw${uniqueString(utcValue)}-${toLower(resourceGroup().name)}', 63) +param dnsNameforApplicationGateway string = take('wlsgw${uniqueString(utcValue)}', 63) @description('Public IP Name for the Application Gateway') param gatewayPublicIPAddressName string = 'gwip' param utcValue string = utcNow() From 2ee42f046760d50fc61290da99856cc790950867 Mon Sep 17 00:00:00 2001 From: galiacheng Date: Fri, 24 Sep 2021 09:15:07 +0800 Subject: [PATCH 18/20] On branch e2etest: output secured urls exposed by Lb service. Signed-off-by: galiacheng Changes to be committed: modified: weblogic-azure-aks/src/main/arm/scripts/createLbSvc.sh modified: weblogic-azure-aks/src/main/bicep/modules/_deployment-scripts/_ds-create-networking.bicep modified: weblogic-azure-aks/src/main/bicep/modules/networking.bicep --- .../src/main/arm/scripts/createLbSvc.sh | 38 +++++++++++++++++-- .../_ds-create-networking.bicep | 13 +++++-- .../src/main/bicep/modules/networking.bicep | 12 +++--- 3 files changed, 50 insertions(+), 13 deletions(-) diff --git a/weblogic-azure-aks/src/main/arm/scripts/createLbSvc.sh b/weblogic-azure-aks/src/main/arm/scripts/createLbSvc.sh index 06ca88816..7f22943c4 100644 --- a/weblogic-azure-aks/src/main/arm/scripts/createLbSvc.sh +++ b/weblogic-azure-aks/src/main/arm/scripts/createLbSvc.sh @@ -180,12 +180,14 @@ function create_lb_svc_for_admin_server_default_channel() { adminServerEndpoint=$(kubectl get svc ${adminServerLBSVCName} -n ${wlsDomainNS} \ -o=jsonpath='{.status.loadBalancer.ingress[0].ip}:{.spec.ports[0].port}') - adminConsoleEndpoint="${adminServerEndpoint}/console" if [ "${enableCustomDNSAlias,,}" == "true" ]; then create_dns_A_record "${adminServerEndpoint%%:*}" ${dnsAdminLabel} ${dnsRGName} ${dnsZoneName} - adminConsoleEndpoint="${dnsAdminLabel}.${dnsZoneName}:${adminServerEndpoint#*:}/console" + adminServerEndpoint="${dnsAdminLabel}.${dnsZoneName}:${adminServerEndpoint#*:}" fi + + adminConsoleEndpoint="${adminServerEndpoint}/console" + adminRemoteEndpoint=${adminServerEndpoint} } function create_lb_svc_for_admin_t3_channel() { @@ -360,19 +362,48 @@ EOF fi } +function validate_admin_console_url() { + local podName=$(kubectl -n ${wlsDomainNS} get pod -l weblogic.serverName=${constAdminServerName} -o json | + jq '.items[0] | .metadata.name' | + tr -d "\"") + + if [[ "${podName}" == "null" ]]; then + echo "Ensure your domain has at least one admin server." + exit 1 + fi + + adminTargetPort=$(kubectl get svc ${svcAdminServer} -n ${wlsDomainNS} -o json | + jq '.spec.ports[] | select(.name=="default") | .port') + local adminConsoleUrl="http://${svcAdminServer}.${wlsDomainNS}:${adminTargetPort}/console/" + + kubectl exec -it ${podName} -n ${wlsDomainNS} -c ${wlsContainerName} \ + -- bash -c 'curl --write-out "%{http_code}\n" --silent --output /dev/null "'${adminConsoleUrl}'" | grep "302"' + + if [ $? == 1 ]; then + echo "admin console is not accessible." + # reset admin console endpoint + adminConsoleEndpoint="null" + fi +} + #Output value to deployment scripts function output_result() { echo ${adminConsoleEndpoint} echo ${clusterEndpoint} echo ${adminServerT3Endpoint} echo ${clusterT3Endpoint} + echo ${adminRemoteEndpoint} + + # check if the admin console is accessible, do not output it + validate_admin_console_url result=$(jq -n -c \ --arg adminEndpoint $adminConsoleEndpoint \ --arg clusterEndpoint $clusterEndpoint \ --arg adminT3Endpoint $adminServerT3Endpoint \ --arg clusterT3Endpoint $clusterT3Endpoint \ - '{adminConsoleEndpoint: $adminEndpoint, clusterEndpoint: $clusterEndpoint, adminServerT3Endpoint: $adminT3Endpoint, clusterT3Endpoint: $clusterT3Endpoint}') + --arg adminRemoteEndpoint ${adminRemoteEndpoint} \ + '{adminConsoleEndpoint: $adminEndpoint, clusterEndpoint: $clusterEndpoint, adminServerT3Endpoint: $adminT3Endpoint, clusterT3Endpoint: $clusterT3Endpoint, adminRemoteEndpoint: $adminRemoteEndpoint}') echo "result is: $result" echo $result >$AZ_SCRIPTS_OUTPUT_PATH } @@ -461,6 +492,7 @@ wlsDomainUID=${11} adminConsoleEndpoint="null" adminServerName=${constAdminServerName} # define in common.sh adminServerT3Endpoint="null" +adminRemoteEndpoint="null" clusterEndpoint="null" clusterName=${constClusterName} clusterT3Endpoint="null" diff --git a/weblogic-azure-aks/src/main/bicep/modules/_deployment-scripts/_ds-create-networking.bicep b/weblogic-azure-aks/src/main/bicep/modules/_deployment-scripts/_ds-create-networking.bicep index ffed6373a..179faac22 100644 --- a/weblogic-azure-aks/src/main/bicep/modules/_deployment-scripts/_ds-create-networking.bicep +++ b/weblogic-azure-aks/src/main/bicep/modules/_deployment-scripts/_ds-create-networking.bicep @@ -54,6 +54,7 @@ var const_scriptLocation = uri(_artifactsLocation, 'scripts/') var const_setupNetworkingScript= 'setupNetworking.sh' var const_primaryScript = 'invokeSetupNetworking.sh' var const_utilityScript= 'utility.sh' +var name_deploymentName='ds-networking-deployment' resource deploymentScript 'Microsoft.Resources/deploymentScripts@2020-10-01' = { name: 'ds-networking-deployment' @@ -80,8 +81,12 @@ resource deploymentScript 'Microsoft.Resources/deploymentScripts@2020-10-01' = { } } -output adminConsoleLBUrl string = length(lbSvcValues) > 0 && (reference('ds-networking-deployment').outputs.adminConsoleEndpoint != 'null') ? format('http://{0}/',reference('ds-networking-deployment').outputs.adminConsoleEndpoint): '' -output adminServerT3LBUrl string = length(lbSvcValues) > 0 && (reference('ds-networking-deployment').outputs.adminServerT3Endpoint != 'null') ? reference('ds-networking-deployment').outputs.adminServerT3Endpoint: '' -output clusterLBUrl string = length(lbSvcValues) > 0 && (reference('ds-networking-deployment').outputs.clusterEndpoint != 'null') ? format('http://{0}/',reference('ds-networking-deployment').outputs.clusterEndpoint): '' -output clusterT3LBUrl string = length(lbSvcValues) > 0 && (reference('ds-networking-deployment').outputs.clusterT3Endpoint != 'null') ? reference('ds-networking-deployment').outputs.clusterT3Endpoint: '' +output adminConsoleLBUrl string = (!enableCustomSSL) && length(lbSvcValues) > 0 && (reference(name_deploymentName).outputs.adminConsoleEndpoint != 'null') ? format('http://{0}/',reference(name_deploymentName).outputs.adminConsoleEndpoint): '' +output adminConsoleLBSecuredUrl string = enableCustomSSL && length(lbSvcValues) > 0 && (reference(name_deploymentName).outputs.adminConsoleEndpoint != 'null') ? format('https://{0}/',reference(name_deploymentName).outputs.adminConsoleEndpoint): '' +output adminServerT3LBUrl string = length(lbSvcValues) > 0 && (reference(name_deploymentName).outputs.adminServerT3Endpoint != 'null') ? reference(name_deploymentName).outputs.adminServerT3Endpoint: '' +output adminRemoteUrl string = (!enableCustomSSL) && length(lbSvcValues) > 0 && (reference(name_deploymentName).outputs.adminRemoteEndpoint != 'null') ? format('http://{0}',reference(name_deploymentName).outputs.adminRemoteEndpoint): '' +output adminRemoteSecuredUrl string = enableCustomSSL && length(lbSvcValues) > 0 && (reference(name_deploymentName).outputs.adminRemoteEndpoint != 'null') ? format('https://{0}',reference(name_deploymentName).outputs.adminRemoteEndpoint): '' +output clusterLBUrl string = (!enableCustomSSL) && length(lbSvcValues) > 0 && (reference(name_deploymentName).outputs.clusterEndpoint != 'null') ? format('https://{0}/',reference(name_deploymentName).outputs.clusterEndpoint): '' +output clusterLBSecuredUrl string = enableCustomSSL && length(lbSvcValues) > 0 && (reference(name_deploymentName).outputs.clusterEndpoint != 'null') ? format('http://{0}/',reference(name_deploymentName).outputs.clusterEndpoint): '' +output clusterT3LBUrl string = length(lbSvcValues) > 0 && (reference(name_deploymentName).outputs.clusterT3Endpoint != 'null') ? reference(name_deploymentName).outputs.clusterT3Endpoint: '' diff --git a/weblogic-azure-aks/src/main/bicep/modules/networking.bicep b/weblogic-azure-aks/src/main/bicep/modules/networking.bicep index 2f4b6231d..ea4425056 100644 --- a/weblogic-azure-aks/src/main/bicep/modules/networking.bicep +++ b/weblogic-azure-aks/src/main/bicep/modules/networking.bicep @@ -269,11 +269,11 @@ module pidNetworkingEnd './_pids/_pid.bicep' = { ] } -output adminConsoleExternalUrl string = enableAppGWIngress ? (enableDNSConfiguration ? format('http://{0}console', const_appgwAdminCustomDNSAlias) : format('http://{0}/console', appgwDeployment.outputs.appGatewayAlias)) : networkingDeployment3.outputs.adminConsoleLBUrl -output adminConsoleExternalSecuredUrl string = enableAppGWIngress && enableCustomSSL && enableDNSConfiguration ? format('https://{0}console', const_appgwAdminCustomDNSAlias) : '' -output adminRemoteConsoleUrl string = enableAppGWIngress ? (enableDNSConfiguration ? format('http://{0}remoteconsole', const_appgwAdminCustomDNSAlias) : format('http://{0}/remoteconsole', appgwDeployment.outputs.appGatewayAlias)) : replace(networkingDeployment3.outputs.adminConsoleLBUrl, '/console/', '') -output adminRemoteConsoleSecuredUrl string = enableAppGWIngress && enableCustomSSL && enableDNSConfiguration ? format('https://{0}remoteconsole', const_appgwAdminCustomDNSAlias) : '' +output adminConsoleExternalUrl string = enableAppGWIngress ? (enableDNSConfiguration ? format('http://{0}console', const_appgwAdminCustomDNSAlias) : format('http://{0}/console', appgwDeployment.outputs.appGatewayAlias)) : ref_networkDeployment.outputs.adminConsoleLBUrl +output adminConsoleExternalSecuredUrl string = enableAppGWIngress && enableCustomSSL && enableDNSConfiguration ? format('https://{0}console', const_appgwAdminCustomDNSAlias) : ref_networkDeployment.outputs.adminConsoleLBSecuredUrl +output adminRemoteConsoleUrl string = enableAppGWIngress ? (enableDNSConfiguration ? format('http://{0}remoteconsole', const_appgwAdminCustomDNSAlias) : format('http://{0}/remoteconsole', appgwDeployment.outputs.appGatewayAlias)) : ref_networkDeployment.outputs.adminRemoteUrl +output adminRemoteConsoleSecuredUrl string = enableAppGWIngress && enableCustomSSL && enableDNSConfiguration ? format('https://{0}remoteconsole', const_appgwAdminCustomDNSAlias) : ref_networkDeployment.outputs.adminRemoteSecuredUrl output adminServerT3ChannelUrl string = ref_networkDeployment.outputs.adminServerT3LBUrl.value -output clusterExternalUrl string = enableAppGWIngress ? (enableDNSConfiguration ? format('http://{0}', const_appgwCustomDNSAlias) : appgwDeployment.outputs.appGatewayURL) : networkingDeployment3.outputs.clusterLBUrl -output clusterExternalSecuredUrl string = enableAppGWIngress ? (enableDNSConfiguration ? format('https://{0}', const_appgwCustomDNSAlias) : appgwDeployment.outputs.appGatewaySecuredURL) : '' +output clusterExternalUrl string = enableAppGWIngress ? (enableDNSConfiguration ? format('http://{0}', const_appgwCustomDNSAlias) : appgwDeployment.outputs.appGatewayURL) : ref_networkDeployment.outputs.clusterLBUrl +output clusterExternalSecuredUrl string = enableAppGWIngress ? (enableDNSConfiguration ? format('https://{0}', const_appgwCustomDNSAlias) : appgwDeployment.outputs.appGatewaySecuredURL) : ref_networkDeployment.outputs.clusterLBSecuredUrl output clusterT3ChannelUrl string = ref_networkDeployment.outputs.clusterT3LBUrl.value From 4583958ab3ab1b88d14912bbcaba20b67945b746 Mon Sep 17 00:00:00 2001 From: galiacheng Date: Fri, 24 Sep 2021 15:59:56 +0800 Subject: [PATCH 19/20] On branch e2etest: support updating with .jar application in post deployment. Signed-off-by: galiacheng Changes to be committed: modified: weblogic-azure-aks/src/main/arm/scripts/updateApplications.sh modified: weblogic-azure-aks/src/main/bicep/modules/updateWebLogicApplications.bicep --- weblogic-azure-aks/src/main/arm/scripts/updateApplications.sh | 2 +- .../src/main/bicep/modules/updateWebLogicApplications.bicep | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/weblogic-azure-aks/src/main/arm/scripts/updateApplications.sh b/weblogic-azure-aks/src/main/arm/scripts/updateApplications.sh index 288148971..4db5be666 100644 --- a/weblogic-azure-aks/src/main/arm/scripts/updateApplications.sh +++ b/weblogic-azure-aks/src/main/arm/scripts/updateApplications.sh @@ -129,7 +129,7 @@ function get_app_sas_url() { while [ $index -lt $appNumber ]; do appName=${args[${index}]} echo "app package file name: ${appName}" - if [[ "$appName" == *".war" || "$appName" == *".ear" ]]; then + if [[ "$appName" == *".war" || "$appName" == *".ear" || "$appName" == *".jar" ]]; then appSaSUrl=$(az storage blob url --container-name ${appContainerName} \ --name ${appName} \ --account-name ${appStorageAccountName} \ diff --git a/weblogic-azure-aks/src/main/bicep/modules/updateWebLogicApplications.bicep b/weblogic-azure-aks/src/main/bicep/modules/updateWebLogicApplications.bicep index da0400401..8468ff787 100644 --- a/weblogic-azure-aks/src/main/bicep/modules/updateWebLogicApplications.bicep +++ b/weblogic-azure-aks/src/main/bicep/modules/updateWebLogicApplications.bicep @@ -16,7 +16,7 @@ Parameters - aksClusterRGName: Name of resource group that contains the (AKS) instance, probably the resource group you are working on. It's recommended to run this sript with the same resource group that runs AKS. - aksClusterName: Name of the AKS instance that runs the WebLogic cluster. - appPackageUrls: String array of Java EE applciation location, which can be downloaded using "curl". Currently, only support urls of Azure Storage Account blob. - - appPackageFromStorageBlob: Storage blob that contains Java EE applciations, the script will download all the .war and .ear file from that blob. Do not include white space in the file name. + - appPackageFromStorageBlob: Storage blob that contains Java EE applciations, the script will download all the .war, .jar and .ear file from that blob. Do not include white space in the file name. - storageAccountName: Storage account name. - containerName: container name. - identity: Azure user managed identity used, make sure the identity has permission to create/update/delete Azure resources. It's recommended to assign "Contributor" role. @@ -42,7 +42,7 @@ param aksClusterRGName string = '' @description('Name of an existing AKS cluster.') param aksClusterName string = '' -@description('Download all the .war and .ear packages from the specified storage blob. You can specify the applciation using "appPackageUrls" and "appPackageFromStorageBlob", please do not specify the same applciation in both parameters.') +@description('Download all the .war .jar and .ear packages from the specified storage blob. You can specify the applciation using "appPackageUrls" and "appPackageFromStorageBlob", please do not specify the same applciation in both parameters.') param appPackageFromStorageBlob object = { storageAccountName: 'stg-contoso' containerName: 'container-contoso' From b6a1d8afe7d753e4cdc932c78d965093e856579d Mon Sep 17 00:00:00 2001 From: galiacheng Date: Fri, 24 Sep 2021 17:33:13 +0800 Subject: [PATCH 20/20] On branch e2etest: fix lb url outputs Signed-off-by: galiacheng Changes to be committed: modified: weblogic-azure-aks/src/main/bicep/modules/networking.bicep --- .../src/main/bicep/modules/networking.bicep | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/weblogic-azure-aks/src/main/bicep/modules/networking.bicep b/weblogic-azure-aks/src/main/bicep/modules/networking.bicep index ea4425056..6586cb833 100644 --- a/weblogic-azure-aks/src/main/bicep/modules/networking.bicep +++ b/weblogic-azure-aks/src/main/bicep/modules/networking.bicep @@ -269,11 +269,11 @@ module pidNetworkingEnd './_pids/_pid.bicep' = { ] } -output adminConsoleExternalUrl string = enableAppGWIngress ? (enableDNSConfiguration ? format('http://{0}console', const_appgwAdminCustomDNSAlias) : format('http://{0}/console', appgwDeployment.outputs.appGatewayAlias)) : ref_networkDeployment.outputs.adminConsoleLBUrl -output adminConsoleExternalSecuredUrl string = enableAppGWIngress && enableCustomSSL && enableDNSConfiguration ? format('https://{0}console', const_appgwAdminCustomDNSAlias) : ref_networkDeployment.outputs.adminConsoleLBSecuredUrl -output adminRemoteConsoleUrl string = enableAppGWIngress ? (enableDNSConfiguration ? format('http://{0}remoteconsole', const_appgwAdminCustomDNSAlias) : format('http://{0}/remoteconsole', appgwDeployment.outputs.appGatewayAlias)) : ref_networkDeployment.outputs.adminRemoteUrl -output adminRemoteConsoleSecuredUrl string = enableAppGWIngress && enableCustomSSL && enableDNSConfiguration ? format('https://{0}remoteconsole', const_appgwAdminCustomDNSAlias) : ref_networkDeployment.outputs.adminRemoteSecuredUrl +output adminConsoleExternalUrl string = enableAppGWIngress ? (enableDNSConfiguration ? format('http://{0}console', const_appgwAdminCustomDNSAlias) : format('http://{0}/console', appgwDeployment.outputs.appGatewayAlias)) : ref_networkDeployment.outputs.adminConsoleLBUrl.value +output adminConsoleExternalSecuredUrl string = enableAppGWIngress && enableCustomSSL && enableDNSConfiguration ? format('https://{0}console', const_appgwAdminCustomDNSAlias) : ref_networkDeployment.outputs.adminConsoleLBSecuredUrl.value +output adminRemoteConsoleUrl string = enableAppGWIngress ? (enableDNSConfiguration ? format('http://{0}remoteconsole', const_appgwAdminCustomDNSAlias) : format('http://{0}/remoteconsole', appgwDeployment.outputs.appGatewayAlias)) : ref_networkDeployment.outputs.adminRemoteUrl.value +output adminRemoteConsoleSecuredUrl string = enableAppGWIngress && enableCustomSSL && enableDNSConfiguration ? format('https://{0}remoteconsole', const_appgwAdminCustomDNSAlias) : ref_networkDeployment.outputs.adminRemoteSecuredUrl.value output adminServerT3ChannelUrl string = ref_networkDeployment.outputs.adminServerT3LBUrl.value -output clusterExternalUrl string = enableAppGWIngress ? (enableDNSConfiguration ? format('http://{0}', const_appgwCustomDNSAlias) : appgwDeployment.outputs.appGatewayURL) : ref_networkDeployment.outputs.clusterLBUrl -output clusterExternalSecuredUrl string = enableAppGWIngress ? (enableDNSConfiguration ? format('https://{0}', const_appgwCustomDNSAlias) : appgwDeployment.outputs.appGatewaySecuredURL) : ref_networkDeployment.outputs.clusterLBSecuredUrl +output clusterExternalUrl string = enableAppGWIngress ? (enableDNSConfiguration ? format('http://{0}', const_appgwCustomDNSAlias) : appgwDeployment.outputs.appGatewayURL) : ref_networkDeployment.outputs.clusterLBUrl.value +output clusterExternalSecuredUrl string = enableAppGWIngress ? (enableDNSConfiguration ? format('https://{0}', const_appgwCustomDNSAlias) : appgwDeployment.outputs.appGatewaySecuredURL) : ref_networkDeployment.outputs.clusterLBSecuredUrl.value output clusterT3ChannelUrl string = ref_networkDeployment.outputs.clusterT3LBUrl.value