From 0b0e7bc5cdf4cf40c66d6009c361fe1641fc8f88 Mon Sep 17 00:00:00 2001 From: Jinghan Ying Date: Fri, 28 Jan 2022 12:14:49 +0800 Subject: [PATCH] feat(pkg/oomstore): check group category in API Push --- pkg/oomstore/push.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/oomstore/push.go b/pkg/oomstore/push.go index c12a0bb52..5c0abed30 100644 --- a/pkg/oomstore/push.go +++ b/pkg/oomstore/push.go @@ -24,6 +24,9 @@ func (s *OomStore) Push(ctx context.Context, opt types.PushOpt) error { entity := features[0].Entity() group := features[0].Group + if group.Category != types.CategoryStream { + return errdefs.Errorf("Push API is for streaming features only") + } if !stringSliceEqual(features.Names(), featureNames) { return errdefs.Errorf("FeatureNames %v does not match with group's features %v", featureNames, features.Names()) }