Prep work: move DynamicResult to error.rs, and improve marshal_yaml to write to a writer, not a string
Refuse to unmarshal YAML if there are unknown fields (I spent quite some time with a typo in the YAML :sweat_smile:). Default optional fields so they can be unmarshalled without errors.
Make it possible to annotate a component with a "generic" label, for potential use in a unix pipe by plugins
I used the Kubernetes API way of matching labels in order to be sure it's at least somewhat generic and battle-tested, instead of inventing my own thing. If you go and check the Go code implementing this in k8s, and compare to this implementation, one can see that Rust really shines for this task.
Commits:
DynamicResult
toerror.rs
, and improvemarshal_yaml
to write to a writer, not a stringLabels
trait similar to https://pkg.go.dev/k8s.io/apimachinery@v0.21.1/pkg/labels#LabelsRequirement
enum similar to https://pkg.go.dev/k8s.io/apimachinery@v0.21.1/pkg/labels#NewRequirementclass
to components given other attributesThe sample data I used for
policy.yaml
is:I used the Kubernetes API way of matching labels in order to be sure it's at least somewhat generic and battle-tested, instead of inventing my own thing. If you go and check the Go code implementing this in k8s, and compare to this implementation, one can see that Rust really shines for this task.
@chiplet @twelho