wolgod opened a new issue, #1233:
URL: https://github.com/apache/apisix-ingress-controller/issues/1233
### Issue description
When I use ApisixV2beta3Client to create apisixUpstream
```
apisixUpstream := client.ApisixUpstreams(namespace)
_, err = apisixUpstream.Create(cont, ing, metav1.CreateOptions{})
```
The following error will be reported
```
ApisixUpstream in version "v2beta3" cannot be handled as a ApisixUpstream:
unmarshalerDecoder: Object 'Kind' is missing in
'{"metadata":{"name":"ttt-test1","namespace":"ns-2424","creationTimestamp":null},"spec":{"scheme":"grpc"},"status":{}}',
error found in #10 byte of ...|tatus":{}}
|..., bigger context ...|stamp":null},"spec":{"scheme":"grpc"},"status":{}}
|...
```
除非我在构建apisixUpstream的显示指定typeMeta
```
au := apisixv2beta3.ApisixUpstreamConfig{
Scheme: SchemeGRPC,
}
typeMeta := metav1.TypeMeta{
Kind: "ApisixUpstream",
APIVersion: ApisixVersion,
}
apisixUpstream := &apisixv2beta3.ApisixUpstream{
TypeMeta: typeMeta,
ObjectMeta: metav1.ObjectMeta{
Name: entityService.RIngress.IngressName,
Namespace: namespace,
},
Spec: &apisixv2beta3.ApisixUpstreamSpec{
ApisixUpstreamConfig: au,
},
}
```
### Environment
- your apisix-ingress-controller version (output of
apisix-ingress-controller version --long):1.4.1
- your Kubernetes cluster version (output of kubectl version):1.20
- if you run apisix-ingress-controller in Bare-metal environment, also show
your OS version (uname -a):centos7.4
### Minimal test code / Steps to reproduce
When I use ApisixV2beta3Client to create apisixUpstream
```
apisixUpstream := client.ApisixUpstreams(namespace)
_, err = apisixUpstream.Create(cont, ing, metav1.CreateOptions{})
```
The following error will be reported
```
ApisixUpstream in version "v2beta3" cannot be handled as a ApisixUpstream:
unmarshalerDecoder: Object 'Kind' is missing in
'{"metadata":{"name":"ttt-test1","namespace":"ns-2424","creationTimestamp":null},"spec":{"scheme":"grpc"},"status":{}}',
error found in #10 byte of ...|tatus":{}}
|..., bigger context ...|stamp":null},"spec":{"scheme":"grpc"},"status":{}}
|...
```
除非我在构建apisixUpstream的显示指定typeMeta
```
au := apisixv2beta3.ApisixUpstreamConfig{
Scheme: SchemeGRPC,
}
typeMeta := metav1.TypeMeta{
Kind: "ApisixUpstream",
APIVersion: ApisixVersion,
}
apisixUpstream := &apisixv2beta3.ApisixUpstream{
TypeMeta: typeMeta,
ObjectMeta: metav1.ObjectMeta{
Name: entityService.RIngress.IngressName,
Namespace: namespace,
},
Spec: &apisixv2beta3.ApisixUpstreamSpec{
ApisixUpstreamConfig: au,
},
}
```
### Actual result
不需要显示指定typeMeta
### Error log
ApisixUpstream in version "v2beta3" cannot be handled as a ApisixUpstream:
unmarshalerDecoder: Object 'Kind' is missing in
'{"metadata":{"name":"ttt-test1","namespace":"ns-2424","creationTimestamp":null},"spec":{"scheme":"grpc"},"status":{}}',
error found in #10 byte of ...|tatus":{}}
|..., bigger context ...|stamp":null},"spec":{"scheme":"grpc"},"status":{}}
|...
### Expected result
_No response_
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]