np-guard / netpol-analyzer

A Golang library for analyzing k8s connectivity-configuration resources (a.k.a. network policies)
Apache License 2.0
9 stars 2 forks source link

Update dot output visuality #362

Closed shireenf-ibm closed 2 months ago

shireenf-ibm commented 2 months ago

example test: (check it on branch new_exposure_analysis_first_branch)

$ ./bin/k8snetpolicy list --dirpath tests/test_egress_exposure_with_named_port -o dot
digraph {
}

Instead, output should include:

digraph {
        subgraph "cluster_hello_world" {
                color="black"
                fontcolor="black"
                "hello-world/workload-a[Deployment]" [label="workload-a[Deployment]" color="blue" fontcolor="blue"]
                label="hello-world"
        }
}