teleport
teleport copied to clipboard
Fix PluginV1 fields backward compatibility
What
Fix feature UnmarshalPlugin
compatibility
Extending plugin struct
When a new plugin or new field is added to the PluginV1 struct:
--- a/api/proto/teleport/legacy/types/types.proto
+++ b/api/proto/teleport/legacy/types/types.proto
@@ -5934,6 +5934,8 @@ message PluginOktaSettings {
+
+ bool EnableFeatureX = 5;
}
the UnmarshalPlugin
will marshal proto to the following JSON object:
{
"kind": "plugin",
"version": "v1",
"spec": {
"okta": {
"enableFeatureX": true
}
},
}
}
and the plugin will be successfully installed.
Downgrading Teleport Version
When Teleport is downgraded, the marshal function will fail with an unknown field error, producing a lot of periodic noise, and will not start the plugin, breaking backward compatibility.
This will also occurs when a new plugin type is added to PluginSpecV1
To fix that the AllowUnknownFields: true
needs to be set.