Append component params on generate
This commit will append both mandatory and optional prototype parameters to the component params.libsonnet file on `ks gen foo ...`. Default values will be used for optional params where the user does not specify flags to `ks gen foo ...`. Because we are trying to append to jsonnet, we will have to traverse the AST to first identify the location of where to insert the new component params. New components will be inserted at the bottom of the components object, with the params ordered alphabetically.
Showing
- cmd/prototype.go 34 additions, 24 deletionscmd/prototype.go
- metadata/interface.go 1 addition, 1 deletionmetadata/interface.go
- metadata/manager.go 22 additions, 2 deletionsmetadata/manager.go
- metadata/snippet/interface.go 27 additions, 0 deletionsmetadata/snippet/interface.go
- metadata/snippet/params.go 118 additions, 0 deletionsmetadata/snippet/params.go
- metadata/snippet/params_test.go 176 additions, 0 deletionsmetadata/snippet/params_test.go
- prototype/snippet/jsonnet/snippet.go 4 additions, 7 deletionsprototype/snippet/jsonnet/snippet.go
metadata/snippet/interface.go
0 → 100644
metadata/snippet/params.go
0 → 100644
metadata/snippet/params_test.go
0 → 100644
Please register or sign in to comment