Skip to content

Go client: wrong type definition for Lists #422

Closed

Description

@averzicco

Checklist

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

Activity

  1. xiaobaitusi commented on Mar 9, 2021

    @xiaobaitusi
    Contributor

    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

  2. aa250816 commented on Mar 22, 2021

    @aa250816

    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.

  3. guilhem commented on Apr 2, 2021

    @guilhem

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

    pkg/mod/k8s.io/client-go@v0.20.5/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
    
  4. caieo commented on Apr 2, 2021

    @caieo
    Contributor

    @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!

  5. averzicco commented on Apr 28, 2021

    @averzicco
    Author

    This bug has been fixed with v1.45.0 release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      ⌂ 换网址