1
0
mirror of synced 2026-02-13 13:06:56 +00:00

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:
Michael Bridgen
2021-01-13 11:21:26 +00:00
parent b30ef523f8
commit d03280a12f
6 changed files with 75 additions and 19 deletions

View File

@@ -55,8 +55,7 @@ type exportable interface {
// exportableList represents a type that has a list of values, each of
// which is exportable.
type exportableList interface {
adapter
len() int
listAdapter
exportItem(i int) interface{}
}
@@ -79,7 +78,7 @@ func (export exportCommand) run(cmd *cobra.Command, args []string) error {
}
if exportAll {
err = kubeClient.List(ctx, export.list.asRuntimeObject(), client.InNamespace(namespace))
err = kubeClient.List(ctx, export.list.asRuntimeList(), client.InNamespace(namespace))
if err != nil {
return err
}