From 4242923d939e9693b05e54461627acccae785fda Mon Sep 17 00:00:00 2001 From: kinarashah Date: Tue, 17 Jul 2018 11:43:40 -0700 Subject: [PATCH] store metadata info only for ipsec service --- .../data/metadata/common/ServiceMetaData.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/code/iaas/config-item/server/src/main/java/io/cattle/platform/configitem/context/data/metadata/common/ServiceMetaData.java b/code/iaas/config-item/server/src/main/java/io/cattle/platform/configitem/context/data/metadata/common/ServiceMetaData.java index 562d7129df..ad260d9093 100644 --- a/code/iaas/config-item/server/src/main/java/io/cattle/platform/configitem/context/data/metadata/common/ServiceMetaData.java +++ b/code/iaas/config-item/server/src/main/java/io/cattle/platform/configitem/context/data/metadata/common/ServiceMetaData.java @@ -142,9 +142,7 @@ public ServiceMetaData(Service service, String serviceName, String stackName, St this.health_check = new HealthCheck(healthCheck); } this.system = service.getSystem(); - Map 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(); @@ -183,6 +181,16 @@ void populatePortsInfo(Service service, String serviceName) { this.expose.addAll((List) exposeObj); } } + + void setServiceMetadata(Service service, String serviceName) { + if (serviceName.equals("ipsec")) { + Map 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) {