pluginmanager

package
v1.1.0-dev Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 17, 2023 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Overview

Package pluginmanager is responsible for plugin discovery and installation

Index

Constants

View Source
const (

	// ManifestFileName is the file name for the manifest.
	ManifestFileName = "manifest.yaml"
	// PluginManifestFileName is the file name for the manifest.
	PluginManifestFileName = "plugin_manifest.yaml"
	// PluginFileName is the file name for the plugin info.
	PluginFileName = "plugin.yaml"
)
View Source
const HTTP = "http"
View Source
const HTTPS = "https"
View Source
const True = "true"

Variables

This section is empty.

Functions

func AvailablePlugins

func AvailablePlugins() ([]discovery.Discovered, error)

AvailablePlugins returns the list of available plugins including discovered and installed plugins. Plugin discovery happens for all active contexts

func AvailablePluginsFromLocalSource

func AvailablePluginsFromLocalSource(localPath string) ([]discovery.Discovered, error)

AvailablePluginsFromLocalSource returns the list of available plugins from local source

func Clean

func Clean() error

Clean deletes all plugins and tests.

func DeletePlugin

func DeletePlugin(options DeletePluginOptions) error

DeletePlugin deletes a plugin.

func DescribePlugin

func DescribePlugin(pluginName string, target configtypes.Target) (info *cli.PluginInfo, err error)

DescribePlugin describes a plugin.

func DiscoverPluginGroups added in v0.0.4

func DiscoverPluginGroups(options ...discovery.DiscoveryOptions) ([]*plugininventory.PluginGroup, error)

DiscoverPluginGroups returns the available plugin groups

func DiscoverPlugins

func DiscoverPlugins() ([]discovery.Discovered, []discovery.Discovered)

DiscoverPlugins returns all the discovered plugins including standalone and context-scoped plugins Context scoped plugin discovery happens for all active contexts

func DiscoverPluginsFromLocalSource

func DiscoverPluginsFromLocalSource(localPath string) ([]discovery.Discovered, error)

DiscoverPluginsFromLocalSource returns the available plugins that are discovered from the provided local path

func DiscoverServerPlugins

func DiscoverServerPlugins() ([]discovery.Discovered, error)

DiscoverServerPlugins returns the available plugins associated all the active contexts

func DiscoverStandalonePlugins

func DiscoverStandalonePlugins(options ...discovery.DiscoveryOptions) ([]discovery.Discovered, error)

DiscoverStandalonePlugins returns the available standalone plugins

func DiscoveredFromPlugininfo

func DiscoveredFromPlugininfo(p *cli.PluginInfo) discovery.Discovered

DiscoveredFromPlugininfo returns discovered plugin object from k8sV1alpha1

func FindVersion

func FindVersion(recommendedPluginVersion, requestedVersion string) string

func GetAdditionalTestPluginDiscoveries added in v1.0.0

func GetAdditionalTestPluginDiscoveries() []configtypes.PluginDiscovery

GetAdditionalTestPluginDiscoveries returns an array of plugin discoveries that are meant to be used for testing new plugin version. The comma-separated list of such discoveries can be specified through the environment variable "TANZU_CLI_ADDITIONAL_PLUGIN_DISCOVERY_IMAGES_TEST_ONLY". Each entry in the variable should be the URI of an OCI image of the DB of the discovery in question.

func GetRecommendedVersionOfPlugin

func GetRecommendedVersionOfPlugin(pluginName string, target configtypes.Target) (string, error)

GetRecommendedVersionOfPlugin returns recommended version of the plugin

func InitializePlugin

func InitializePlugin(plugin *cli.PluginInfo) error

InitializePlugin initializes the plugin configuration

func InstallPluginFromContext added in v0.0.4

func InstallPluginFromContext(pluginName, version string, target configtypes.Target, contextName string) error

InstallPluginFromContext installs a plugin by name, version and target as a context-scope plugin.

func InstallPluginsFromEssentialPluginGroup added in v1.0.0

func InstallPluginsFromEssentialPluginGroup() (string, error)

InstallPluginsFromEssentialPluginGroup is a function that installs or upgrades the essential plugin groups.

func InstallPluginsFromGroup added in v0.0.4

func InstallPluginsFromGroup(pluginName, groupIDAndVersion string, options ...PluginManagerOptions) (string, error)

InstallPluginsFromGroup installs either the specified plugin or all plugins from the specified group version. If the group version is not specified, the latest available version will be used. The group identifier including the version used is returned.

func InstallPluginsFromLocalSource

func InstallPluginsFromLocalSource(pluginName, version string, target configtypes.Target, localPath string, installTestPlugin bool) error

InstallPluginsFromLocalSource installs plugin from local source directory nolint: gocyclo

func InstallStandalonePlugin added in v0.0.4

func InstallStandalonePlugin(pluginName, version string, target configtypes.Target) error

InstallStandalonePlugin installs a plugin by name, version and target as a standalone plugin.

func IsPluginsFromPluginGroupInstalled added in v1.0.0

func IsPluginsFromPluginGroupInstalled(name, version string, options ...PluginManagerOptions) (bool, bool, error)

IsPluginsFromPluginGroupInstalled checks if all plugins from a specific group are installed and if a new version is available. This function uses cache data to verify rather than fetching the inventory image

func SyncPlugins

func SyncPlugins() error

SyncPlugins will install the plugins required by the current contexts. If the central-repo is disabled, all discovered plugins will be installed.

func UpgradePlugin

func UpgradePlugin(pluginName, version string, target configtypes.Target) error

UpgradePlugin upgrades a plugin from the given repository.

func ValidatePlugin

func ValidatePlugin(p *cli.PluginInfo) (err error)

ValidatePlugin validates the plugin info.

Types

type DeletePluginOptions

type DeletePluginOptions struct {
	Target      configtypes.Target
	PluginName  string
	ForceDelete bool
}

type PluginManagerOptions added in v1.0.0

type PluginManagerOptions func(p *PluginManagerOpts)

func DisableLogs added in v1.0.0

func DisableLogs() PluginManagerOptions

func EnableLogs added in v1.0.0

func EnableLogs() PluginManagerOptions

type PluginManagerOpts added in v1.0.0

type PluginManagerOpts struct {
	// contains filtered or unexported fields
}

PluginManagerOpts options to customize plugin lifecycle operations

func NewPluginManagerOpts added in v1.0.0

func NewPluginManagerOpts(opts ...PluginManagerOptions) *PluginManagerOpts

NewPluginManagerOpts creates a new PluginManagerOpts instance with provided options.

func (*PluginManagerOpts) GetLogMode added in v1.0.0

func (p *PluginManagerOpts) GetLogMode() bool

GetLogMode sets the log mode based on the environment variable.

func (*PluginManagerOpts) ResetLogMode added in v1.0.0

func (p *PluginManagerOpts) ResetLogMode()

ResetLogMode reset the log mode to show logs

func (*PluginManagerOpts) SetLogMode added in v1.0.0

func (p *PluginManagerOpts) SetLogMode()

SetLogMode sets the log mode based on the environment variable.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL