Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: change clusterId in Cmek test #716

Merged
merged 2 commits into from Apr 9, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -70,6 +70,7 @@ public class BigtableCmekIT {
private static String instanceId;
private static String clusterId1;
private static String clusterId2;
private static String clusterId3;
private static String kmsKeyName;
private static List<String> zones;
private static String otherZone;
Expand All @@ -91,6 +92,7 @@ public static void validatePlatform() throws IOException {
instanceId = AbstractTestEnv.TEST_INSTANCE_PREFIX + Instant.now().getEpochSecond();
clusterId1 = instanceId + "-c1";
clusterId2 = instanceId + "-c2";
clusterId3 = instanceId + "-c3";
zones = testEnvRule.env().getMultipleZonesInSameRegion();
otherZone =
Sets.difference(
Expand All @@ -110,6 +112,7 @@ public static void validatePlatform() throws IOException {
.setInstanceId(instanceId)
.build());

LOGGER.info("Creating cluster in zone: " + zones.get(0));
instanceAdmin.createInstance(
CreateInstanceRequest.of(instanceId)
.addCmekCluster(clusterId1, zones.get(0), 1, StorageType.SSD, kmsKeyName));
Expand Down Expand Up @@ -137,6 +140,7 @@ public void instanceAndClusterTest() {
Cluster cluster = instanceAdmin.getCluster(instanceId, clusterId1);
assertThat(cluster.getKmsKeyName()).isEqualTo(kmsKeyName);

LOGGER.info("Creating cluster in zone: " + zones.get(1));
instanceAdmin.createCluster(
CreateClusterRequest.of(instanceId, clusterId2)
.setZone(zones.get(1))
Expand All @@ -147,9 +151,10 @@ public void instanceAndClusterTest() {
Cluster secondCluster = instanceAdmin.getCluster(instanceId, clusterId2);
assertThat(secondCluster.getKmsKeyName()).isEqualTo(kmsKeyName);

LOGGER.info("Trying to create cluster in zone: " + otherZone);
try {
instanceAdmin.createCluster(
CreateClusterRequest.of(instanceId, clusterId2)
CreateClusterRequest.of(instanceId, clusterId3)
.setZone(otherZone)
.setServeNodes(1)
.setStorageType(StorageType.SSD)
Expand Down