Update to controller-runtime 0.7.0
controller-runtime methods now accept `client.Object` and `client.ObjectList` rather than `runtime.Object`. This means the adapter interfaces need to change signature, but happily, little else. Since the list adapter is now distinct to the object adapter, `len()` can go there instead of the command-specific interfaces. Signed-off-by: Michael Bridgen <michael@weave.works>
This commit is contained in:
@@ -45,8 +45,7 @@ func init() {
|
||||
}
|
||||
|
||||
type summarisable interface {
|
||||
adapter
|
||||
len() int
|
||||
listAdapter
|
||||
summariseItem(i int, includeNamespace bool) []string
|
||||
headers(includeNamespace bool) []string
|
||||
}
|
||||
@@ -87,7 +86,7 @@ func (get getCommand) run(cmd *cobra.Command, args []string) error {
|
||||
if !allNamespaces {
|
||||
listOpts = append(listOpts, client.InNamespace(namespace))
|
||||
}
|
||||
err = kubeClient.List(ctx, get.list.asRuntimeObject(), listOpts...)
|
||||
err = kubeClient.List(ctx, get.list.asRuntimeList(), listOpts...)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user