Error generating CRD: `DeepCopy of "interface{}" is unsupported`

119 Views Asked by At

I want to define a CRD struct and generate Custom resource that has a field that can take up any value.

If the struct was to be something like:

type MyStruct struct{
    MyField interface{} `json:"myfield"`
}

I would like MyField to store a number or a string in the CRD:

myfield:2

or

myfield:"somestring"

However I get an error:

DeepCopy of "interface{}" is unsupported. Instead, use named interfaces with DeepCopy<named-interface> as one of the methods.

How do I work around this problem?

0

There are 0 best solutions below