Skip to content
This repository has been archived by the owner on Jan 4, 2022. It is now read-only.

Commit

Permalink
store metadata info only for ipsec service
Browse files Browse the repository at this point in the history
  • Loading branch information
kinarashah authored and Alena Prokharchyk committed Jul 17, 2018
1 parent a99ae6f commit 4242923
Showing 1 changed file with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,7 @@ public ServiceMetaData(Service service, String serviceName, String stackName, St
this.health_check = new HealthCheck(healthCheck);
}
this.system = service.getSystem();
Map<String, Object> service_metadata = DataAccessor.fieldMap(service, ServiceConstants.FIELD_METADATA);
service_metadata.put("ipsec.service.enable.healthcheck", ENABLE_HEALTHCHECK.get());
this.metadata = service_metadata;
setServiceMetadata(service, serviceName);
this.lb_config = lbConfig;
this.primary_service_name = service.getName();
this.environment_uuid = account.getUuid();
Expand Down Expand Up @@ -183,6 +181,16 @@ void populatePortsInfo(Service service, String serviceName) {
this.expose.addAll((List<String>) exposeObj);
}
}

void setServiceMetadata(Service service, String serviceName) {
if (serviceName.equals("ipsec")) {
Map<String, Object> service_metadata = DataAccessor.fieldMap(service, ServiceConstants.FIELD_METADATA);
service_metadata.put("ipsec.service.enable.healthcheck", ENABLE_HEALTHCHECK.get());
this.metadata = service_metadata;
} else {
this.metadata = DataAccessor.fieldMap(service, ServiceConstants.FIELD_METADATA);
}
}

@SuppressWarnings("unchecked")
void populateExternalServiceInfo(Service service) {
Expand Down

0 comments on commit 4242923

Please sign in to comment.