Description
Describe the bug
The --feature-gates
CLI flag is not applied until this line:
As a result any featuregate.IsEnabled(myFeatureGateID)
checks during component factory creation (L16 in the same file) will return the default value regardless of the CLI flag. This also effects the contrib repo, for example in the googlecloud exporter this check always returns false.
Steps to reproduce
Perform a featuregate.IsEnabled()
check in a NewFactory()
method, for example here
What did you expect to see?
featuregate checks should work early during factory creation. They may be used to enable/disable features early on during initialization. They shouldn't have different result depending on the time they are called.
What did you see instead?
the --feature-gates
CLI flag has no effect if checked during factory creation.
What version did you use?
main
What config did you use?
N/A
Environment
Linux/go1.18
cc @dashpole
Activity