@Test public void testAddAzureIdbrokerMsiToTelemetryWithoutCloudStorage() { Map<String, Object> attributes = new HashMap<>(); underTest.addAzureIdbrokerMsiToTelemetry(attributes, stackV4Request); assertThat(clusterV4Request.getCloudStorage()).isNull(); assertThat(attributes.size()).isEqualTo(0); }
void addAzureIdbrokerMsiToTelemetry(Map<String, Object> fluentAttributes, StackV4Request stackRequest) { if (stackRequest.getCluster() != null && stackRequest.getCluster().getCloudStorage() != null && stackRequest.getCluster().getCloudStorage().getIdentities() != null) { List<StorageIdentityBase> identities = stackRequest.getCluster().getCloudStorage().getIdentities(); for (StorageIdentityBase identity : identities) { if (CloudIdentityType.ID_BROKER.equals(identity.getType()) && identity.getAdlsGen2() != null) { if (!fluentAttributes.containsKey(FluentConfigView.AZURE_IDBROKER_INSTANCE_MSI)) { String idBrokerInstanceMsi = identity.getAdlsGen2().getManagedIdentity(); LOGGER.info("Setting idbroker instance msi for telemetry: {}", idBrokerInstanceMsi); fluentAttributes.put(FluentConfigView.AZURE_IDBROKER_INSTANCE_MSI, idBrokerInstanceMsi); } } } } }
StackRequestManifester { void addAzureIdbrokerMsiToTelemetry(Map<String, Object> fluentAttributes, StackV4Request stackRequest) { if (stackRequest.getCluster() != null && stackRequest.getCluster().getCloudStorage() != null && stackRequest.getCluster().getCloudStorage().getIdentities() != null) { List<StorageIdentityBase> identities = stackRequest.getCluster().getCloudStorage().getIdentities(); for (StorageIdentityBase identity : identities) { if (CloudIdentityType.ID_BROKER.equals(identity.getType()) && identity.getAdlsGen2() != null) { if (!fluentAttributes.containsKey(FluentConfigView.AZURE_IDBROKER_INSTANCE_MSI)) { String idBrokerInstanceMsi = identity.getAdlsGen2().getManagedIdentity(); LOGGER.info("Setting idbroker instance msi for telemetry: {}", idBrokerInstanceMsi); fluentAttributes.put(FluentConfigView.AZURE_IDBROKER_INSTANCE_MSI, idBrokerInstanceMsi); } } } } } }
StackRequestManifester { void addAzureIdbrokerMsiToTelemetry(Map<String, Object> fluentAttributes, StackV4Request stackRequest) { if (stackRequest.getCluster() != null && stackRequest.getCluster().getCloudStorage() != null && stackRequest.getCluster().getCloudStorage().getIdentities() != null) { List<StorageIdentityBase> identities = stackRequest.getCluster().getCloudStorage().getIdentities(); for (StorageIdentityBase identity : identities) { if (CloudIdentityType.ID_BROKER.equals(identity.getType()) && identity.getAdlsGen2() != null) { if (!fluentAttributes.containsKey(FluentConfigView.AZURE_IDBROKER_INSTANCE_MSI)) { String idBrokerInstanceMsi = identity.getAdlsGen2().getManagedIdentity(); LOGGER.info("Setting idbroker instance msi for telemetry: {}", idBrokerInstanceMsi); fluentAttributes.put(FluentConfigView.AZURE_IDBROKER_INSTANCE_MSI, idBrokerInstanceMsi); } } } } }  }
StackRequestManifester { void addAzureIdbrokerMsiToTelemetry(Map<String, Object> fluentAttributes, StackV4Request stackRequest) { if (stackRequest.getCluster() != null && stackRequest.getCluster().getCloudStorage() != null && stackRequest.getCluster().getCloudStorage().getIdentities() != null) { List<StorageIdentityBase> identities = stackRequest.getCluster().getCloudStorage().getIdentities(); for (StorageIdentityBase identity : identities) { if (CloudIdentityType.ID_BROKER.equals(identity.getType()) && identity.getAdlsGen2() != null) { if (!fluentAttributes.containsKey(FluentConfigView.AZURE_IDBROKER_INSTANCE_MSI)) { String idBrokerInstanceMsi = identity.getAdlsGen2().getManagedIdentity(); LOGGER.info("Setting idbroker instance msi for telemetry: {}", idBrokerInstanceMsi); fluentAttributes.put(FluentConfigView.AZURE_IDBROKER_INSTANCE_MSI, idBrokerInstanceMsi); } } } } }  void configureStackForSdxCluster(SdxCluster sdxCluster, DetailedEnvironmentResponse environment); }
StackRequestManifester { void addAzureIdbrokerMsiToTelemetry(Map<String, Object> fluentAttributes, StackV4Request stackRequest) { if (stackRequest.getCluster() != null && stackRequest.getCluster().getCloudStorage() != null && stackRequest.getCluster().getCloudStorage().getIdentities() != null) { List<StorageIdentityBase> identities = stackRequest.getCluster().getCloudStorage().getIdentities(); for (StorageIdentityBase identity : identities) { if (CloudIdentityType.ID_BROKER.equals(identity.getType()) && identity.getAdlsGen2() != null) { if (!fluentAttributes.containsKey(FluentConfigView.AZURE_IDBROKER_INSTANCE_MSI)) { String idBrokerInstanceMsi = identity.getAdlsGen2().getManagedIdentity(); LOGGER.info("Setting idbroker instance msi for telemetry: {}", idBrokerInstanceMsi); fluentAttributes.put(FluentConfigView.AZURE_IDBROKER_INSTANCE_MSI, idBrokerInstanceMsi); } } } } }  void configureStackForSdxCluster(SdxCluster sdxCluster, DetailedEnvironmentResponse environment);  }