Skip to content

Commit

Permalink
Maybe fix registry alternate
Browse files Browse the repository at this point in the history
  • Loading branch information
grafnu committed Oct 21, 2023
1 parent f5ee2a9 commit 3661d09
Showing 1 changed file with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -332,9 +332,7 @@ private static void setupSequencer() {

cloudRegion = validatorConfig.cloud_region;
registryId = SiteModel.getRegistryActual(validatorConfig);
String altRegistryId = validatorConfig.alt_registry;
String registrySuffix = validatorConfig.registry_suffix;
altRegistry = SiteModel.getRegistryActual(null, altRegistryId, registrySuffix);


deviceMetadata = readDeviceMetadata();

Expand All @@ -349,7 +347,13 @@ private static void setupSequencer() {
System.err.printf("Loading reflector key file from %s%n", new File(key_file).getAbsolutePath());
System.err.printf("Validating against device %s serial %s%n", getDeviceId(), serialNo);
client = getPublisherClient();

String udmiNamespace = validatorConfig.udmi_namespace;
String altRegistryId = validatorConfig.alt_registry;
String registrySuffix = validatorConfig.registry_suffix;
altRegistry = SiteModel.getRegistryActual(udmiNamespace, altRegistryId, registrySuffix);
altClient = getAlternateClient();

initializeValidationState();
}

Expand Down Expand Up @@ -384,10 +388,13 @@ private static IotReflectorClient getAlternateClient() {
System.err.println("No alternate registry configured, disabling");
return null;
}

ExecutionConfiguration altConfiguration = GeneralUtils.deepCopy(validatorConfig);
altConfiguration.registry_id = altRegistry;
altConfiguration.registry_suffix = null; // Don't double-dip adding suffix to the registry.
altConfiguration.registry_id = validatorConfig.alt_registry;
altConfiguration.registry_suffix = validatorConfig.registry_suffix;
altConfiguration.udmi_namespace = validatorConfig.udmi_namespace;
altConfiguration.alt_registry = null;

try {
return new IotReflectorClient(altConfiguration, getRequiredFunctionsVersion());
} catch (Exception e) {
Expand Down

0 comments on commit 3661d09

Please sign in to comment.