Documentation ¶
Overview ¶
Package config provides functions for the tanzu cli configuration
Package config contains useful functionality for config updates
Index ¶
- Constants
- Variables
- func AddBomRepoIfMissing(config *configtypes.ClientConfig) booldeprecated
- func AddCompatibilityFileIfMissing(config *configtypes.ClientConfig) booldeprecated
- func AddDefaultFeatureFlagsIfMissing(config *configtypes.ClientConfig, defaultFeatureFlags map[string]bool) bool
- func ConfigureCEIPOptIn() error
- func ConfigureDefaultFeatureFlagsIfMissing(defaultFeatureFlags map[string]bool) error
- func ConfigureEULA(alwaysPrompt bool) error
- func ConfigureEnvVariables()
- func GetAdditionalTestDiscoveryImages() []string
- func GetDefaultStandaloneDiscoveryImage() string
- func GetDefaultStandaloneDiscoveryLocalPath() string
- func GetDefaultStandaloneDiscoveryType() string
- func GetTrustedArtifactLocations() []string
- func GetTrustedRegistries() []string
- func IsCompatibleEULAAccepted(acceptedVersions []string) bool
- func PopulateDefaultCentralDiscovery(force bool) error
- func UpdateEULAAcceptance(status configlib.EULAStatus) error
Constants ¶
const AdvancedRepositoryName = "advanced"
AdvancedRepositoryName is the advanced repository name.
const CoreRepositoryName = "core"
CoreRepositoryName is the core repository name.
const DefaultEdition = "tkg"
DefaultEdition is the edition assumed when there is no value in the local config file
const DefaultTMCPluginsArtifactRepository = "https://tmc-cli.s3-us-west-2.amazonaws.com/plugins/artifacts"
DefaultTMCPluginsArtifactRepository is the S3 bucket repository for TMC plugins.
const DefaultVersionSelector = configtypes.NoUnstableVersions //nolint:staticcheck // Deprecated
DefaultVersionSelector is to only use stable versions of plugins
Variables ¶
var ( // DefaultAllowedPluginRepositories this can be comma separated list of allowed registries DefaultAllowedPluginRepositories = "" DefaultStandaloneDiscoveryRepository = "" DefaultStandaloneDiscoveryImagePath = "" DefaultStandaloneDiscoveryImageTag = "" DefaultStandaloneDiscoveryName = "default" // DefaultStandaloneDiscoveryNameLocal Used for local discovery of sources. // Changing the default-local discovery source label to default and default will be used as a local discovery source // default and default-local will co-exist in the config.yaml i.e. If local discovery source is used and is now assigned the default name, the discovery source named default-local will still exist. // And recommend that it be manually removed from the config file. DefaultStandaloneDiscoveryNameLocal = "default" DefaultStandaloneDiscoveryType = common.DistributionTypeOCI DefaultStandaloneDiscoveryLocalPath = "" )
Default Standalone Discovery configuration Value of this variables gets assigned during build time
var AdvancedGCPBucketRepository = configtypes.GCPPluginRepository{ BucketName: "tanzu-cli-advanced-plugins", Name: AdvancedRepositoryName, }
AdvancedGCPBucketRepository is the GCP bucket repository for advanced plugins.
var CoreBucketName = "tanzu-cli-framework"
CoreBucketName is the name of the core plugin repository bucket to use.
var CoreGCPBucketRepository = configtypes.GCPPluginRepository{ BucketName: CoreBucketName, Name: CoreRepositoryName, }
CoreGCPBucketRepository is the default GCP bucket repository.
var ( // CurrentEULAVersion (vMajor.Minor.Patch) is the version of the EULA to // display if user has not agreed to a compatible EULA. // A user is considered to have accepted the EULA if one of the recorded // accepted semver versions matches in the major.minor of this value. // If this value is empty, however, any previously recorded acceptance // is considered valid. CurrentEULAVersion = "" )
var DefaultRepositories = []configtypes.PluginRepository{ { GCPPluginRepository: &CoreGCPBucketRepository, }, }
DefaultRepositories are the default repositories for the CLI.
Functions ¶
func AddBomRepoIfMissing
deprecated
func AddBomRepoIfMissing(config *configtypes.ClientConfig) bool
AddBomRepoIfMissing adds the bomRepository to the client configuration if it is not already present
Deprecated: This method is deprecated
func AddCompatibilityFileIfMissing
deprecated
func AddCompatibilityFileIfMissing(config *configtypes.ClientConfig) bool
AddCompatibilityFileIfMissing adds the compatibility file to the client configuration to ensure it can be downloaded
Deprecated: This method is deprecated
func AddDefaultFeatureFlagsIfMissing ¶
func AddDefaultFeatureFlagsIfMissing(config *configtypes.ClientConfig, defaultFeatureFlags map[string]bool) bool
AddDefaultFeatureFlagsIfMissing augments the given configuration object with any default feature flags that do not already have a value and returns TRUE if any were added (so the config can be written out to disk, if the caller wants to)
func ConfigureCEIPOptIn ¶ added in v0.80.0
func ConfigureCEIPOptIn() error
ConfigureCEIPOptIn checks and configures the User CEIP Opt-in choice in the tanzu configuration file
func ConfigureDefaultFeatureFlagsIfMissing ¶
ConfigureDefaultFeatureFlagsIfMissing configures default feature-flags to ClientConfig if missing
func ConfigureEULA ¶ added in v0.90.0
ConfigureEULA checks and configures the user's EULA acceptance status
func ConfigureEnvVariables ¶
func ConfigureEnvVariables()
ConfigureEnvVariables reads and configures provided environment variables as part of tanzu configuration file
func GetAdditionalTestDiscoveryImages ¶ added in v0.80.0
func GetAdditionalTestDiscoveryImages() []string
GetAdditionalTestDiscoveryImages would return the private discovery images or test discovery images. The private discovery images("TANZU_CLI_PRIVATE_PLUGIN_DISCOVERY_IMAGES") was introduced to support the backward compatibility where if there are customers using CLIPlugin CR to point to their private repository. It would be deprecated once we confirm there are no users using it but will continue supporting additional testing plugin discoveries. It would be mutually exclusive with "TANZU_CLI_ADDITIONAL_PLUGIN_DISCOVERY_IMAGES_TEST_ONLY" environment variable. Users can use only one of them and "TANZU_CLI_PRIVATE_PLUGIN_DISCOVERY_IMAGES" takes the priority
func GetDefaultStandaloneDiscoveryImage ¶
func GetDefaultStandaloneDiscoveryImage() string
GetDefaultStandaloneDiscoveryImage returns the default Standalone Discovery image from the configured build time variables
func GetDefaultStandaloneDiscoveryLocalPath ¶
func GetDefaultStandaloneDiscoveryLocalPath() string
GetDefaultStandaloneDiscoveryLocalPath returns default standalone discovery local path
func GetDefaultStandaloneDiscoveryType ¶
func GetDefaultStandaloneDiscoveryType() string
GetDefaultStandaloneDiscoveryType returns the default standalone discovery type
func GetTrustedArtifactLocations ¶
func GetTrustedArtifactLocations() []string
GetTrustedArtifactLocations returns the list of trusted URI prefixes that can be trusted for downloading the CLIPlugins. Currently, this includes only the "tanzu-cli-advanced-plugins" GCP bucket where TMC plugins are stored. Other exceptions can be added as and when necessary.
func GetTrustedRegistries ¶
func GetTrustedRegistries() []string
GetTrustedRegistries returns the list of trusted registries that can be used for downloading the CLIPlugins
func IsCompatibleEULAAccepted ¶ added in v1.1.0
func PopulateDefaultCentralDiscovery ¶ added in v0.90.0
func UpdateEULAAcceptance ¶ added in v1.1.0
func UpdateEULAAcceptance(status configlib.EULAStatus) error
UpdateEULAAcceptance updates the user's EULA accept status, and records the current EULA version as accepted, if necessary
Types ¶
This section is empty.