From bb565c094919352c7e05904ecc166abf2c07a34e Mon Sep 17 00:00:00 2001 From: Markus Lehtonen Date: Mon, 22 Apr 2024 18:00:55 +0300 Subject: [PATCH] source: allow multi-type features Allow multiple types of features (flags, attributes, instances) under the same name. --- source/source.go | 9 --------- 1 file changed, 9 deletions(-) diff --git a/source/source.go b/source/source.go index 06cdc5076..24b27b4ff 100644 --- a/source/source.go +++ b/source/source.go @@ -164,25 +164,16 @@ func GetAllFeatures() *nfdv1alpha1.Features { for k, v := range f.Flags { // Prefix feature with the name of the source k = n + "." + k - if typ := features.Exists(k); typ != "" { - panic(fmt.Sprintf("feature source %q returned flag feature %q which already exists (type %q)", n, k, typ)) - } features.Flags[k] = v } for k, v := range f.Attributes { // Prefix feature with the name of the source k = n + "." + k - if typ := features.Exists(k); typ != "" { - panic(fmt.Sprintf("feature source %q returned attribute feature %q which already exists (type %q)", n, k, typ)) - } features.Attributes[k] = v } for k, v := range f.Instances { // Prefix feature with the name of the source k = n + "." + k - if typ := features.Exists(k); typ != "" { - panic(fmt.Sprintf("feature source %q returned instance feature %q which already exists (type %q)", n, k, typ)) - } features.Instances[k] = v } }