Implement logic for setting component params
This commit will: 1. Add an interface `SetComponentParams` to metadata.Manager that takes a list of parameters and sets those fields for the given component. 2. Add the jsonnet snippet manipulation logic that does the 'setting'. Parameters are set by: a. Keeping track of the parameters that are to be modified / added -- this defaults to the parameters provided to us. b. Discovering the current parameters in the existing snippet. c. Adding any parameters from (b) that is not in (a). d. Swapping out the old parameters with (c) in the snippet based on the location text span, and returning the new snippet.
Showing
- metadata/interface.go 5 additions, 1 deletionmetadata/interface.go
- metadata/manager.go 14 additions, 0 deletionsmetadata/manager.go
- metadata/snippet/interface.go 11 additions, 0 deletionsmetadata/snippet/interface.go
- metadata/snippet/params.go 83 additions, 9 deletionsmetadata/snippet/params.go
- metadata/snippet/params_test.go 137 additions, 0 deletionsmetadata/snippet/params_test.go
Please register or sign in to comment