puppetlabs-toy-chest / wash

Wide Area SHell: a cloud-native shell for bringing remote infrastructure to your terminal.
https://puppetlabs.github.io/wash
Apache License 2.0
180 stars 29 forks source link

Wash returns wrong type ID for external plugin that uses core plugin entries #727

Closed ekinanp closed 4 years ago

ekinanp commented 4 years ago

Wash lets external plugin authors take advantage of core plugin entries. Currently, only the volume::fs entry is used. These core entries have special type IDs meant to minimize conflicts. For volume::fs, this is __volume::fs__. However, external plugin#List returns the core plugin entry version of volume::fs (i.e. volume.FS); this entry's type ID is the struct class name. Hence, there's a type ID mismatch. This affects commands like find because find cannot recurse into those entries (since its recursion stops at a nil schema).

Fix is to probably wrap core plugin entries into something that implements the external plugin entry interface.

ekinanp commented 4 years ago

Alternative fix is to just munge schema graph to use the raw type ID. E.g. instead of storing as __volume::fs__, we store as plugin.RawTypeID(&volume.FS{}). That's what I'll do.

MikaelSmith commented 4 years ago

Can revert https://github.com/puppetlabs/boltwash/pull/9 once a fix for this is released.