public Map<String, Object> getContext(List<NetworkTrafficRule> networkTrafficRules, ServiceSpec serviceSpec) throws HyscaleException {
        Map<String, Object> context = new HashMap<>();
        String serviceName = serviceSpec.get(HyscaleSpecFields.name, String.class);
        context.put(SERVICE_NAME, serviceName);
        if (!networkTrafficRules.isEmpty()) {
            networkTrafficRules.removeIf(rule -> rule.getFrom() == null);
        }
        context.put(ENABLE_TRAFFIC, networkTrafficRules.isEmpty());
        context.put(NETWORK_TRAFFIC_RULES, networkTrafficRules);
        return context;
    }
This class generates manifests to apply
the network policy rules
provided in the service spec.
manifest-generator/generator-services/src/main/java/io/hyscale/generator/services/plugins/NetworkPoliciesHandler.java