K8s-config-connector: Go client: wrong type definition for Lists

Created on 8 Mar 2021  路  5Comments  路  Source: GoogleCloudPlatform/k8s-config-connector

Checklist

  • [x] I did not find a related open issue.
  • [x] I did not find a solution in the troubleshooting guide: (https://cloud.google.com/config-connector/docs/troubleshooting)
  • [ ] If this issue is time-sensitive, I have submitted a corresponding issue with GCP support.

Bug Description

I'm trying to use the go client package but the type definition for Lists of resources looks wrong. For example for computeInstanceList you have

type ComputeInstanceList struct {
    metav1.TypeMeta   `json:",inline"`
    metav1.ObjectMeta `json:"metadata,omitempty"`
    Items             []ComputeInstance `json:"items"`
}

I would expect metav1.ListMeta instead of metav1.ObjectMeta for Lists

Additional Diagnostic Information

Config Connector Version

GO client version: v1.41.0

bug

Most helpful comment

Yeah this bug prevents us from using the go types as we can't list the objects using the go client. This prevents us from setting watches.

All 5 comments

Hi @averzicco, thanks for reporting the issue. We will look into the fix for it and update this thread when we have more information. Thanks

Yeah this bug prevents us from using the go types as we can't list the objects using the go client. This prevents us from setting watches.

For the record, this bug froze my controller with this error:

pkg/mod/k8s.io/[email protected]/tools/cache/reflector.go:167: Failed to watch *v1beta1.SQLDatabase: failed to list *v1beta1.SQLDatabase: returned object must be a list: object does not implement the List interfaces

@aa250816, @guilhem, and @averzicco, we're really sorry this bug was introduced with our go-clients. We have a fix staged for the next release and will update this thread when the release is out. Thank you for your patience!

This bug has been fixed with v1.45.0 release

Was this page helpful?
0 / 5 - 0 ratings