AmitKumarDas / metac

It is metacontroller and more
Apache License 2.0
57 stars 16 forks source link

introduce MatchIntFields to match fields having int values #112

Open AmitKumarDas opened 4 years ago

AmitKumarDas commented 4 years ago

Problem Statement: When MatchFields is applied against following resource, it results into error.

&unstructured.Unstructured{
    Object: map[string]interface{}{
        "kind": "StatefulSet",
        "spec": map[string]interface{}{
            "replicas": 3,
        },
    },
},

This is the error:

.spec.replicas accessor error: 3 is of the type int, expected string
            Field expressions match for key spec.replicas failed
            openebs.io/metac/controller/common/selector.(*Evaluation).isFieldMatch

Solution: Introduce MatchIntFields that caters to nested fields with int as their value.