private static ManifestSnippet buildContainerPortsSnippet(Set<V1ContainerPort> containerPorts, String podSpecOwner, int containerIndex)
            throws JsonProcessingException {
        ManifestSnippet manifestSnippet = new ManifestSnippet();
        manifestSnippet.setKind(podSpecOwner);
        manifestSnippet.setPath("spec.template.spec.containers[" + containerIndex + "].ports");
        manifestSnippet.setSnippet(GsonSnippetConvertor.serialize(containerPorts));
        return manifestSnippet;
    }
This class is to generate the default ports taken from the
service spec for the manifest snippet.
Handles Ports for Services as well as Agents.
manifest-generator/generator-services/src/main/java/io/hyscale/generator/services/builder/DefaultPortsBuilder.java