Skip to content

Commit

Permalink
Replication Yaml creation enhancements (#804)
Browse files Browse the repository at this point in the history
  • Loading branch information
shanmydell authored Aug 31, 2023
1 parent 8e4b178 commit decb7de
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function setValues(csmMapValues, CONSTANTS_PARAM) {
DriverValues.snapNamePrefix = document.getElementById("snapshot-prefix").value;
DriverValues.targetClusterId = document.getElementById("replication-operator-clusterid").value;
DriverValues.targetArrayID = document.getElementById("replication-helm-arrayid").value;
DriverValues.targetUnisphere = document.getElementById("replication-helm-unisphere").value;
DriverValues.targetUnisphere = document.getElementById("replication-helm-unisphere").value || '""';
DriverValues.fsGroupPolicy = document.getElementById("fsGroup-Policy").value;
DriverValues.driverNamespace = document.getElementById("driver-namespace").value;
DriverValues.labelValue = document.getElementById("label-value").value;
Expand Down Expand Up @@ -229,7 +229,9 @@ function createYamlString(yamlTpl, yamlTplValues, driverParam, CONSTANTS_PARAM)

yamlTpl = yamlTpl.replaceAll("$CERT_MANAGER_ENABLED", yamlTplValues.certManagerEnabled);
yamlTpl = yamlTpl.replaceAll("$OBSERVABILITY_CERT_MANAGER_ENABLED", !yamlTplValues.certManagerEnabled);

yamlTpl = yamlTpl.replaceAll(' - storageArrayId: ""', '# - storageArrayId: ""');
yamlTpl = yamlTpl.replaceAll(' endpoint: ""', '# endpoint: ""');
yamlTpl = yamlTpl.replaceAll(' - endpoint: ""', '# - endpoint: ""');
const regex = /\$[a-zA-Z0-9_-]*/g;
yamlTpl = yamlTpl.replaceAll(regex, '""');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ describe("GIVEN setValues function", () => {
vSphereVCenterCredSecret: undefined,
targetClusterId: "",
targetArrayID: "",
targetUnisphere: "",
targetUnisphere: '""',
iscsichap: false,
manageArrayId: '""',
manageArrayEndpointUrl: '""',
Expand Down Expand Up @@ -286,7 +286,7 @@ describe("GIVEN setValues function", () => {
portGroups: undefined,
targetClusterId: "",
targetArrayID: "",
targetUnisphere: "",
targetUnisphere: '""',
vSphereEnabled: false,
vSphereFCPortGroup: undefined,
vSphereFCHostName: undefined,
Expand Down Expand Up @@ -441,14 +441,14 @@ describe("GIVEN createYamlString function", () => {
enabled: $POWERMAX_ENABLED
global:
storageArrays:
- storageArrayId: ""
endpoint: ""
- storageArrayId: ""
endpoint: ""
backupEndpoint: ""
- storageArrayId: ""
endpoint: ""
- storageArrayId: ""
endpoint: ""
managementServers:
- endpoint: ""
- endpoint: ""
- endpoint: ""
- endpoint: ""
version: v2.6.0
images:
driverRepository: $IMAGE_REPOSITORY
Expand Down Expand Up @@ -749,14 +749,14 @@ describe("GIVEN createYamlString function", () => {
enabled: false
global:
storageArrays:
- storageArrayId: ""
endpoint: ""
# - storageArrayId: ""
# endpoint: ""
backupEndpoint: ""
- storageArrayId: ""
endpoint: ""
# - storageArrayId: ""
# endpoint: ""
managementServers:
- endpoint: ""
- endpoint: ""
# - endpoint: ""
# - endpoint: ""
version: v2.6.0
images:
driverRepository: dellemc
Expand Down Expand Up @@ -1018,14 +1018,14 @@ describe("GIVEN createYamlString function", () => {
enabled: false
global:
storageArrays:
- storageArrayId: ""
endpoint: ""
# - storageArrayId: ""
# endpoint: ""
backupEndpoint: ""
- storageArrayId: ""
endpoint: ""
# - storageArrayId: ""
# endpoint: ""
managementServers:
- endpoint: ""
- endpoint: ""
# - endpoint: ""
# - endpoint: ""
version: v2.6.0
images:
driverRepository: dellemc
Expand Down Expand Up @@ -1288,14 +1288,14 @@ describe("GIVEN createYamlString function", () => {
enabled: true
global:
storageArrays:
- storageArrayId: ""
endpoint: ""
# - storageArrayId: ""
# endpoint: ""
backupEndpoint: ""
- storageArrayId: ""
endpoint: ""
# - storageArrayId: ""
# endpoint: ""
managementServers:
- endpoint: ""
- endpoint: ""
# - endpoint: ""
# - endpoint: ""
version: v2.6.0
images:
driverRepository: dellemc
Expand Down Expand Up @@ -1560,14 +1560,14 @@ describe("GIVEN createYamlString function", () => {
enabled: false
global:
storageArrays:
- storageArrayId: ""
endpoint: ""
# - storageArrayId: ""
# endpoint: ""
backupEndpoint: ""
- storageArrayId: ""
endpoint: ""
# - storageArrayId: ""
# endpoint: ""
managementServers:
- endpoint: ""
- endpoint: ""
# - endpoint: ""
# - endpoint: ""
version: v2.6.0
images:
driverRepository: dellemc
Expand Down Expand Up @@ -1831,14 +1831,14 @@ describe("GIVEN createYamlString function", () => {
enabled: false
global:
storageArrays:
- storageArrayId: ""
endpoint: ""
# - storageArrayId: ""
# endpoint: ""
backupEndpoint: ""
- storageArrayId: ""
endpoint: ""
# - storageArrayId: ""
# endpoint: ""
managementServers:
- endpoint: ""
- endpoint: ""
# - endpoint: ""
# - endpoint: ""
version: v2.6.0
images:
driverRepository: dellemc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ csi-powermax:
- storageArrayId: "$POWERMAX_STORAGE_ARRAY_ID"
endpoint: $POWERMAX_STORAGE_ARRAY_ENDPOINT_URL
backupEndpoint: $POWERMAX_STORAGE_ARRAY_BACKUP_ENDPOINT_URL
- storageArrayId: $TARGET_ARRAY_ID
- storageArrayId: "$TARGET_ARRAY_ID"
endpoint: $TARGET_UNISPHERE
managementServers:
- endpoint: $POWERMAX_MANAGEMENT_SERVERS_ENDPOINT_URL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ csi-powermax:
- storageArrayId: "$POWERMAX_STORAGE_ARRAY_ID"
endpoint: $POWERMAX_STORAGE_ARRAY_ENDPOINT_URL
backupEndpoint: $POWERMAX_STORAGE_ARRAY_BACKUP_ENDPOINT_URL
- storageArrayId: $TARGET_ARRAY_ID
- storageArrayId: "$TARGET_ARRAY_ID"
endpoint: $TARGET_UNISPHERE
managementServers:
- endpoint: $POWERMAX_MANAGEMENT_SERVERS_ENDPOINT_URL
Expand Down

0 comments on commit decb7de

Please sign in to comment.