feat(): increased test coverage and added simple workflow to build OCI image

This commit is contained in:
2026-01-19 22:07:09 +01:00
parent b7457839cb
commit 181e3e2e49
5 changed files with 194 additions and 42 deletions

35
internal/informer_test.go Normal file
View File

@@ -0,0 +1,35 @@
package internal
import (
"testing"
coordv1 "k8s.io/api/coordination/v1"
)
func TestHandleLease_DryRun(t *testing.T) {
l := &coordv1.Lease{}
l.Name = "cilium-l2announce-abc"
hi := "xx-yy-node-a"
l.Spec.HolderIdentity = &hi
cfg := &Config{CiliumLabel: "lbl", DryRun: true}
handleLease(l, cfg)
}
func TestHandleLease_NonCilium(t *testing.T) {
l := &coordv1.Lease{}
l.Name = "other-lease"
hi := "xx-yy-node-a"
l.Spec.HolderIdentity = &hi
cfg := &Config{CiliumLabel: "lbl", DryRun: true}
handleLease(l, cfg)
}
func TestHandleLease_NoHolderIdentity(t *testing.T) {
l := &coordv1.Lease{}
l.Name = "cilium-l2announce-123"
cfg := &Config{CiliumLabel: "lbl", DryRun: true}
handleLease(l, cfg)
}