Skip to content

Commit

Permalink
Merge pull request #43 from kubescape/update-pkg
Browse files Browse the repository at this point in the history
update k8s-interface pkg
  • Loading branch information
Daniel-GrunbergerCA committed Mar 28, 2023
2 parents 37bb5e3 + afdcc96 commit 098f43f
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.19
require (
github.com/armosec/utils-k8s-go v0.0.13
github.com/kubescape/go-logger v0.0.11
github.com/kubescape/k8s-interface v0.0.114
github.com/kubescape/k8s-interface v0.0.115
github.com/kubescape/storage v0.2.0
k8s.io/api v0.26.2
k8s.io/apimachinery v0.26.2
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/kubescape/go-logger v0.0.11 h1:oucpq2S7+DT7O+UclG5IrmHado/tj6+IkYf9czVk/aY=
github.com/kubescape/go-logger v0.0.11/go.mod h1:yGiKBJ2lhq/kxzY/MVYDREL9fLV3RGD6gv+UFjslaew=
github.com/kubescape/k8s-interface v0.0.114 h1:l7dmNP5uoDhbqkgNSMXugHULEb56yD25+QDQzj/syww=
github.com/kubescape/k8s-interface v0.0.114/go.mod h1:/7Y8kdqcL5wLIHsPTuMg+EMV9D2iT/m4n57M/3uPnD4=
github.com/kubescape/k8s-interface v0.0.115 h1:6VOZ1pX5pK1iInWVRlc/kV+N9JXzMZapa0GioD2IaPo=
github.com/kubescape/k8s-interface v0.0.115/go.mod h1:/7Y8kdqcL5wLIHsPTuMg+EMV9D2iT/m4n57M/3uPnD4=
github.com/kubescape/storage v0.2.0 h1:WZXy4Dyjf5ltEMtk0SOD9RFL1haS9ffFPGfs1gUV1aM=
github.com/kubescape/storage v0.2.0/go.mod h1:sPE749pFNoxoskBn6JTpNQyguF2rv/u2kYqzRd3MvXw=
github.com/lunixbochs/vtclean v1.0.0/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI=
Expand Down
2 changes: 1 addition & 1 deletion pkg/conthandler/container_aggregator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func TestContAggregator(t *testing.T) {
}

RedisInstanceID := instanceidhandler.InstanceID{}
RedisInstanceID.SetAPIVersion("v1")
RedisInstanceID.SetAPIVersion("apps/v1")
RedisInstanceID.SetNamespace("any")
RedisInstanceID.SetKind("deployment")
RedisInstanceID.SetName("redis")
Expand Down
2 changes: 1 addition & 1 deletion pkg/conthandler/container_main_handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func TestContMainHandler(t *testing.T) {
go contHandler.afterTimerActions()
go func() {
RedisInstanceID := instanceidhandler.InstanceID{}
RedisInstanceID.SetAPIVersion("v1")
RedisInstanceID.SetAPIVersion("apps/v1")
RedisInstanceID.SetNamespace("any")
RedisInstanceID.SetKind("deployment")
RedisInstanceID.SetName("redis")
Expand Down
8 changes: 4 additions & 4 deletions pkg/conthandler/v1/container_handler_data_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ const (
TestContainerID = "e1da74f71370d61564cbc746996e3f534d4c61ce3e7e7627b1f2543999e3cf7a"
TestContainerName = "blabla"
TestWLID = "wlid://cluster-name/namespace-any/deployment-aaa"
TestInstanceID = "apiVersion-v1/namespace-any/kind-deployment/name-aaa/containerName-contName"
TestInstanceIDHash = "caab386cd1230809464f0b67ddd09cb5132053bec358a4e99b35b5d695ac0026"
TestInstanceID = "apiVersion-apps/v1/namespace-any/kind-deployment/name-aaa/containerName-contName"
TestInstanceIDHash = "fb7c6f65d5ede71f7dd6dc43b63261295ce26a2898d8517c23c6f171cc3865ce"
)

func TestContainerEvent(t *testing.T) {
instanceid := instanceidhandler.InstanceID{}
instanceid.SetAPIVersion("v1")
instanceid.SetAPIVersion("apps/v1")
instanceid.SetNamespace("any")
instanceid.SetKind("deployment")
instanceid.SetName("aaa")
Expand All @@ -36,7 +36,7 @@ func TestContainerEvent(t *testing.T) {
t.Fatalf("fail to get container event image ID")
}
if instanceid.GetStringFormatted() != TestInstanceID {
t.Fatalf("fail to get container event instance ID")
t.Fatalf("fail to get container event instance ID, get %s expected %s", instanceid.GetStringFormatted(), TestInstanceID)
}
if contEv.GetInstanceIDHash() != TestInstanceIDHash {
t.Fatalf("fail to get container event instance ID hash, get %s, expected %s ", contEv.GetInstanceIDHash(), TestInstanceIDHash)
Expand Down

0 comments on commit 098f43f

Please sign in to comment.