Skip to content

Commit

Permalink
karmor systemd
Browse files Browse the repository at this point in the history
Signed-off-by: Aryan-sharma11 <[email protected]>
  • Loading branch information
Aryan-sharma11 committed Aug 28, 2023
1 parent 55d8580 commit 2b6c067
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ replace (
k8s.io/component-base => k8s.io/component-base v0.26.4
sigs.k8s.io/kustomize/api => sigs.k8s.io/kustomize/api v0.12.1
sigs.k8s.io/kustomize/kyaml => sigs.k8s.io/kustomize/kyaml v0.13.9
github.com/kubearmor/KubeArmor/protobuf => /home/vagrant/xyz3/KubeArmor/protobuf/
)

require (
Expand Down
23 changes: 23 additions & 0 deletions probe/probe.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ import (
tp "github.com/kubearmor/KubeArmor/KubeArmor/types"
"github.com/kubearmor/kubearmor-client/deployment"
"github.com/kubearmor/kubearmor-client/k8s"
"google.golang.org/grpc"
"google.golang.org/protobuf/types/known/emptypb"

"golang.org/x/exp/slices"
"golang.org/x/mod/semver"
Expand All @@ -35,6 +37,7 @@ import (

"errors"

pb "github.com/kubearmor/KubeArmor/protobuf"
"golang.org/x/sys/unix"
)

Expand Down Expand Up @@ -565,9 +568,29 @@ func probeSystemdMode() error {
return err
}
printKubeArmorProbeOutput(kd)

err = printContainers()

return nil
}

func printContainers() error {
gRPC := ""
conn, err := grpc.Dial(gRPC, grpc.WithInsecure())
if err != nil {
return err
}

client := pb.NewKarmorClient(conn)

resp, err := client.GetKarmorData(context.Background(), *emptypb.Empty)

fmt.Println(resp.Containers)

return err

}

func getAnnotatedPodLabels(m map[string]string) mapset.Set[string] {
var a []string
for key, value := range m {
Expand Down

0 comments on commit 2b6c067

Please sign in to comment.