Skip to content

Commit

Permalink
source: allow multi-type features
Browse files Browse the repository at this point in the history
Allow multiple types of features (flags, attributes, instances) under
the same name.
  • Loading branch information
marquiz committed Apr 24, 2024
1 parent 36d3d41 commit c5db8e1
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions source/source.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down

0 comments on commit c5db8e1

Please sign in to comment.