Documentation ¶
Index ¶
- Constants
- Variables
- func ExtractAndParseAddons(indexImage, addonIdentifier string) ([]registry.Bundle, error)
- func GetBundleNameVersion(b registry.Bundle) (string, error)
- func GetLatestImageSetVersion(dir string) (string, error)
- func PrintValidationErrors(errs []error)
- type DefaultBundleParser
- type DefaultIndexImageExtractor
- func (obj DefaultIndexImageExtractor) CacheHit(key string) bool
- func (obj DefaultIndexImageExtractor) CacheKey(indexImage, addonName string) string
- func (obj DefaultIndexImageExtractor) CacheLocation() string
- func (obj DefaultIndexImageExtractor) ExtractBundlesFromImage(indexImage, extractTo string) error
- func (obj DefaultIndexImageExtractor) ExtractionPath() string
- func (obj DefaultIndexImageExtractor) ManifestsPath(addonName string) string
- func (obj DefaultIndexImageExtractor) WriteToCache(value string) error
- type DefaultOCMClient
- type DefaultOCMClientOption
- type EnvOCMTokenProvider
- type MetaLoader
- type OCMResponseError
- type OCMTokenProvider
Constants ¶
const ( // (sblaisdo) sretoolbox also uses /tmp/mtcli to extract binary archive DefaultDownloadPath = "/tmp/mtcli-07b10894-0673-4d95-b6ef-0cbd9701c9c3" DefaultCacheDir = "/tmp/mtcli-07b10894-0673-4d95-b6ef-0cbd9701c9c3" DefaultCacheFileName = ".cache" )
const AllAddonsIdentifier = "all"
Variables ¶
Functions ¶
func ExtractAndParseAddons ¶ added in v0.2.0
func GetBundleNameVersion ¶ added in v0.6.0
GetBundleNameVersion - useful for validation error reporting
func GetLatestImageSetVersion ¶ added in v0.6.0
func PrintValidationErrors ¶
func PrintValidationErrors(errs []error)
PrintValidationErrors - helper to pretty print validationErrors
Types ¶
type DefaultBundleParser ¶ added in v0.1.0
type DefaultBundleParser struct{}
func (DefaultBundleParser) ParseBundles ¶ added in v0.1.0
func (obj DefaultBundleParser) ParseBundles(addonName, manifestsDir string) ([]registry.Bundle, error)
type DefaultIndexImageExtractor ¶ added in v0.1.0
type DefaultIndexImageExtractor struct {
// contains filtered or unexported fields
}
func (DefaultIndexImageExtractor) CacheHit ¶ added in v0.1.0
func (obj DefaultIndexImageExtractor) CacheHit(key string) bool
func (DefaultIndexImageExtractor) CacheKey ¶ added in v0.1.0
func (obj DefaultIndexImageExtractor) CacheKey(indexImage, addonName string) string
func (DefaultIndexImageExtractor) CacheLocation ¶ added in v0.1.0
func (obj DefaultIndexImageExtractor) CacheLocation() string
func (DefaultIndexImageExtractor) ExtractBundlesFromImage ¶ added in v0.1.0
func (obj DefaultIndexImageExtractor) ExtractBundlesFromImage(indexImage, extractTo string) error
func (DefaultIndexImageExtractor) ExtractionPath ¶ added in v0.1.0
func (obj DefaultIndexImageExtractor) ExtractionPath() string
func (DefaultIndexImageExtractor) ManifestsPath ¶ added in v0.1.0
func (obj DefaultIndexImageExtractor) ManifestsPath(addonName string) string
func (DefaultIndexImageExtractor) WriteToCache ¶ added in v0.1.0
func (obj DefaultIndexImageExtractor) WriteToCache(value string) error
type DefaultOCMClient ¶ added in v0.8.0
type DefaultOCMClient struct {
// contains filtered or unexported fields
}
DefaultOCMClient implements the 'types.OCMClient' interface and exposes methods by which validators can communicate with OCM.
func NewDefaultOCMClient ¶ added in v0.8.0
func NewDefaultOCMClient(opts ...DefaultOCMClientOption) (*DefaultOCMClient, error)
NewDefaultOCMClient takes a variadic slice of options to configure a default OCM client and applies defaults if no appropriate option is given. An error may be returned if an unusable OCM token is provided or a connection cannot be initialized otherwise the default client is returned.
func (*DefaultOCMClient) CloseConnection ¶ added in v0.8.0
func (c *DefaultOCMClient) CloseConnection() error
func (*DefaultOCMClient) GetSKURules ¶ added in v0.8.0
func (*DefaultOCMClient) Option ¶ added in v0.8.0
func (c *DefaultOCMClient) Option(opt DefaultOCMClientOption)
Option applies the given option to an instance of the DefaultOCMClient.
type DefaultOCMClientOption ¶ added in v0.8.0
type DefaultOCMClientOption func(c *DefaultOCMClient)
DefaultOCMClientOption describes a function which configures a DefaultOCMClient instance.
func DefaultOCMClientAPIURL ¶ added in v0.8.0
func DefaultOCMClientAPIURL(url string) DefaultOCMClientOption
DefaultOCMClientAPIURL updates the URL used to connect to OCM. This option only takes effect if applied prior to connection initialization.
func DefaultOCMClientTokenProvider ¶ added in v0.8.0
func DefaultOCMClientTokenProvider(tp OCMTokenProvider) DefaultOCMClientOption
DefaultOCMClientAPIURL updates the URL used to connect to OCM. This option only takes effect if applied prior to connection initialization.
type EnvOCMTokenProvider ¶ added in v0.8.0
type EnvOCMTokenProvider struct {
// contains filtered or unexported fields
}
EnvOCMTokenProvider provides OCM tokens from the current environment.
func NewEnvOCMTokenProvider ¶ added in v0.8.0
func NewEnvOCMTokenProvider(envVar string) EnvOCMTokenProvider
NewEnvOCMTokenProvider returns an instance of EnvOCMTokenProvider which retrieves OCM tokens from the environment by the given envVar name.
func (EnvOCMTokenProvider) ProvideToken ¶ added in v0.8.0
func (tp EnvOCMTokenProvider) ProvideToken() (string, error)
type MetaLoader ¶ added in v0.3.0
type MetaLoader interface {
Load() (*addonsv1alpha1.AddonMetadataSpec, error)
}
func NewMetaLoader ¶ added in v0.3.0
func NewMetaLoader(addonDir, env, version string) MetaLoader
NewMetaLoader - returns default implementation of the AddonMetaLoader
type OCMResponseError ¶ added in v0.8.0
type OCMResponseError int
OCMResponseError is used to wrap HTTP error (400 - 599) response codes which are returned from a request to OCM.
func (OCMResponseError) Error ¶ added in v0.8.0
func (e OCMResponseError) Error() string
func (OCMResponseError) ServerSide ¶ added in v0.8.0
func (e OCMResponseError) ServerSide() bool
type OCMTokenProvider ¶ added in v0.8.0
type OCMTokenProvider interface { // ProvideToken returns either an access token as an encoded JWT token // or an error if a token could not be provided. ProvideToken() (string, error) }
OCMTokenProvider provides OCM tokens to clients.