Make ResourceList follow k8s api conventions

Make optional fields as pointers.
Add omitempty for optional fields.
This commit is contained in:
Mengqi Yu
2021-11-08 21:35:49 -08:00
parent 37ab5579f0
commit 374d790a21
4 changed files with 35 additions and 25 deletions

View File

@@ -47,12 +47,12 @@ type ResourceList struct {
// kind: Example
// spec:
// foo: var
FunctionConfig *yaml.RNode `yaml:"functionConfig" json:"functionConfig"`
FunctionConfig *yaml.RNode `yaml:"functionConfig,omitempty" json:"functionConfig,omitempty"`
// Results is ResourceList.results output value.
// Validating functions can optionally use this field to communicate structured
// validation error data to downstream functions.
Results Results `yaml:"results" json:"results"`
Results Results `yaml:"results,omitempty" json:"results,omitempty"`
}
// ResourceListProcessor is implemented by configuration functions built with this framework