Hello, I’m trying to make a client to work with istio virtualservices
This is my object definition
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// VirtualService is a Istio VirtualService resource
type VirtualService struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec MyVirtualService `json:"spec"`
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// VirtualServiceList is a list of VirtualService resources
type VirtualServiceList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata"`
Items []VirtualService `json:"items"`
}
type MyVirtualService istiov1alpha3.VirtualService
func (in *MyVirtualService) DeepCopyInto(out *MyVirtualService) {
*out = *in
return
}
I use k8s code generation to create my client, my get method looks like this:
func (c *virtualServices) Get(name string, options v1.GetOptions) (result *v1alpha3.VirtualService, err error) {
result = &v1alpha3.VirtualService{}
err = c.client.Get().
Namespace(c.ns).
Resource("virtualservices").
Name(name).
VersionedParams(&options, schema.ParameterCodec).
Do().
Into(result)
return
}
It seems to work fine however some fields are always null. For example, route match header selectors and faults are always null. This is my return object for a virtualservice with a valid fault:
spec: hosts: - details http: - route: - destination: host: details subset: v1 weight: 63 - destination: host: details subset: v2 weight: 37 fault: delay: percent: 100 HttpDelayType: null
The HttpDelayType is null.
Am I doing something wrong or is this maybe just a version issue?
Does anyone have a go-client or way of working with the istio CRDs with go?