package meta import ( "testing" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "edge-infra.dev/pkg/f8n/warehouse/pallet" ) func TestIsFromPallet(t *testing.T) { is := IsFromPallet(v1.ObjectMeta{Annotations: map[string]string{ pallet.KnnotationName: "shoot", pallet.KnnotationTeam: "ncrvoyix-swt-retail/edge-data-sync", pallet.KnnotationVersion: "0.3.8", pallet.KnnotationRevision: "c018301aldk2", }}) if !is { t.Errorf( "returned false when required annotations were present: %v", []string{pallet.KnnotationTeam, pallet.KnnotationName, pallet.KnnotationRevision, pallet.KnnotationVersion}, ) } isnt := IsFromPallet(v1.ObjectMeta{Annotations: map[string]string{}}) if isnt { t.Error("empty annotations in object meta returned true") } }