Skip to content

The Tanzu Plugin Runtime provides functionality and helper methods to develop Tanzu CLI plugins

License

Notifications You must be signed in to change notification settings

vmware-tanzu/tanzu-plugin-runtime

Repository files navigation

Tanzu Plugin Runtime

Cross-version API Compatibility Tests

Overview

The Tanzu CLI is based on a plugin architecture. This architecture enables teams to build, own, and release their own piece of functionality as well as enable external partners to integrate with the system.

The Tanzu Plugin Runtime is a library that provides functionality and helper methods to develop Tanzu CLI plugins.

Developers begin plugin development by using the builder plugin to bootstrap a new plugin project. The code generated in the project relies on the runtime to provide some functionality common to all plugins. For more information about the development process, see the Tanzu CLI Plugin Development guide

The library

This Tanzu Plugin Runtime broadly consists of:

  1. CLI UX Component library
  2. Configuration library
  3. Plugin integration
  4. Command helpers
  5. Test helpers

CLI UX Component Library

This package implements reusable CLI user interface components, including:

  • output writers (table, listtable, json, yaml, spinner)
  • prompt
  • selector
  • question

For more details go to Component Library

Configuration Library

This package implements helper functions to read, write and update various Tanzu CLI configuration objects like Contexts, DiscoverySources, CLI Features and environment settings.

For more details about the design and APIs go to Configuration Library

Plugin integration

This package implements helper functions for new plugin creation. This is one of the main packages that each and every plugin will need to import to integrate with the Tanzu CLI. For more information about the development process, see the Tanzu CLI Plugin Development guide

To Manage plugin owned settings

Use

// Plugin owned APIs
// GetTanzuPluginConfigDir Retrieve the tanzu configuration directory that can be used by the plugins to
// create a plugin specific directory to manage plugin owned configurations.
func GetTanzuPluginConfigDir() (string, error)

Example: For handling settings specific to the management-cluster plugin: Utilize GetTanzuPluginConfigDir() to retrieve the plugin configuration directory, which is .config/tanzu/plugins. Subsequently, establish a management-cluster directory within the plugin configuration directory to oversee the relevant settings.

Command Helpers

This package implements command specific helper functions like command deprecation, etc.

Test Helpers

This package implements helper functions to develop test plugins and Cross-version Configuration Library APIs compatibility testing

Besides unit and integration tests, the runtime APIs are also being tested in the presence of other versions runtime client code as part of cross-version API compatibility testing. These tests are important in ensuring interoperability among runtime clients (and hence different generations of CLI plugins)

Cross Version API Compatibility Testing

Cross Version API Compatibility testing ensures that Configuration Library APIs of different Tanzu Plugin Runtime versions work as expected as long as those Tanzu Plugin Runtime versions are supported.

Cross Version API Compatibility testing simulates the interaction of Configuration library APIs provided by different versions of plugin runtimes to ensure that they can interoperate with one another.

For more details go to Cross-version API Compatibility

Contributing

Thanks for taking the time to join our community and start contributing! We welcome pull requests. Feel free to dig through the issues and jump in.

Before you begin

  • Check out the contribution guidelines to learn more about how to contribute.
  • Check out the document here about the project's support process.

About

The Tanzu Plugin Runtime provides functionality and helper methods to develop Tanzu CLI plugins

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages