Skip to content

Commit 3493895

Browse files
committed
fix feature flag
1 parent ba81b86 commit 3493895

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

cmd/merge.go

+5-3
Original file line numberDiff line numberDiff line change
@@ -241,9 +241,11 @@ func merge(stdin bool, templateFilePath string, opts flow.Options, json, split b
241241
}
242242
}
243243
}
244-
if bindingYAML != nil || interpolation || len(tags) > 0 || len(templateYAMLs) > 1 {
245-
defstate := flow.NewDefaultState().SetInterpolation(interpolation)
246-
defstate.SetTags(tags...)
244+
if interpolation {
245+
features.SetInterpolation(true)
246+
}
247+
if bindingYAML != nil || features.Size() > 0 || len(tags) > 0 || len(templateYAMLs) > 1 {
248+
defstate := flow.NewDefaultState().SetTags(tags...).SetFeatures(features)
247249
binding = flow.NewEnvironment(
248250
nil, "context", defstate)
249251
if bindingYAML != nil {

features/features.go

+4
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ func (this FeatureFlags) Set(name string, active bool) error {
3838
return nil
3939
}
4040

41+
func (this FeatureFlags) Size() int {
42+
return len(this)
43+
}
44+
4145
func (this FeatureFlags) InterpolationEnabled() bool {
4246
return this.Enabled(INTERPOLATION)
4347
}

0 commit comments

Comments
 (0)