bundle

package
v0.0.0-...-affaa53 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2019 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CompleteBundle

type CompleteBundle struct {
	Bundle *internal.Bundle
	Charts []*chart.Chart
}

CompleteBundle aggregates a bundle with his chart(s)

func (*CompleteBundle) ID

ID returns the ID of the bundle

type CompleteBundleProvider

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

CompleteBundleProvider provides CompleteBundles from a repository.

func NewProvider

func NewProvider(repo repository, bundleLoader bundleLoader, log logrus.FieldLogger) *CompleteBundleProvider

NewProvider returns new instance of CompleteBundleProvider.

func (*CompleteBundleProvider) ProvideBundles

func (l *CompleteBundleProvider) ProvideBundles() ([]CompleteBundle, error)

ProvideBundles returns a list of bundles with his charts as CompleteBundle instances. In case of bundle processing errors, the won't be stopped - next bundle is processed.

type DocsMeta

type DocsMeta struct {
	Docs []internal.BundleDocs `yaml:"docs"`
}

DocsMeta contains data about bundle's docs fetched from docs/meta.yaml file

func (*DocsMeta) Validate

func (m *DocsMeta) Validate() error

Validate checks the DocsMeta

type DocsProvider

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

DocsProvider allows to maintain the bundles documentation

func NewDocsProvider

func NewDocsProvider(dynamicClient client.Client) *DocsProvider

NewDocsProvider creates a new DocsProvider

func (*DocsProvider) EnsureClusterDocsTopic

func (d *DocsProvider) EnsureClusterDocsTopic(bundle *internal.Bundle) error

EnsureClusterDocsTopic creates ClusterDocsTopic for a given bundle or updates it in case it already exists

func (*DocsProvider) EnsureClusterDocsTopicRemoved

func (d *DocsProvider) EnsureClusterDocsTopicRemoved(id string) error

EnsureClusterDocsTopicRemoved removes ClusterDocsTopic for a given bundle

type FormMeta

type FormMeta struct {
	ID                  string            `yaml:"id"`
	Name                string            `yaml:"name"`
	Version             string            `yaml:"version"`
	Description         string            `yaml:"description"`
	DisplayName         string            `yaml:"displayName"`
	Tags                string            `yaml:"tags"`
	ProviderDisplayName string            `yaml:"providerDisplayName"`
	LongDescription     string            `yaml:"longDescription"`
	DocumentationURL    string            `yaml:"documentationURL"`
	SupportURL          string            `yaml:"supportURL"`
	ImageURL            string            `yaml:"imageURL"`
	Bindable            bool              `yaml:"bindable"`
	ProvisionOnlyOnce   bool              `yaml:"provisionOnlyOnce"`
	Labels              map[string]string `yaml:"labels"`
	Requires            []string          `yaml:"requires"`
	BindingsRetrievable bool              `yaml:"bindingsRetrievable"`
	PlanUpdatable       *bool             `yaml:"planUpdatable"`
}

FormMeta describes the metdata information about the bundle.

func (*FormMeta) MapLabelsToModel

func (m *FormMeta) MapLabelsToModel() internal.Labels

MapLabelsToModel maps the FormMeta.Labels to the model internal.Labels

func (*FormMeta) MapTagsToModel

func (m *FormMeta) MapTagsToModel() []internal.BundleTag

MapTagsToModel maps the FormMeta.Tags to the model internal.BundleTag slice

func (*FormMeta) Validate

func (m *FormMeta) Validate() error

Validate checks the FormMeta if all required fields are set

type HTTPRepository

type HTTPRepository struct {
	IndexFile string
	BaseURL   string
	Client    interface {
		Do(req *http.Request) (*http.Response, error)
	}
}

HTTPRepository represents remote bundle repository which is accessed via HTTP.

func NewHTTPRepository

func NewHTTPRepository(cfg RepositoryConfig) *HTTPRepository

NewHTTPRepository creates new instance of HTTPRepository.

func (*HTTPRepository) BundleReader

func (p *HTTPRepository) BundleReader(name Name, version Version) (r io.ReadCloser, err error)

BundleReader calls repository for a specific bundle and returns means to read bundle content.

func (*HTTPRepository) IndexReader

func (p *HTTPRepository) IndexReader() (r io.ReadCloser, err error)

IndexReader acquire repository index.

func (*HTTPRepository) URLForBundle

func (p *HTTPRepository) URLForBundle(name Name, version Version) string

URLForBundle returns direct URL for getting the bundle

type Loader

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

Loader provides loading of bundles from repository and representing them as bundles and charts.

func NewLoader

func NewLoader(tmpDir string, log logrus.FieldLogger) *Loader

NewLoader returns new instance of Loader.

func (*Loader) Load

func (l *Loader) Load(in io.Reader) (*internal.Bundle, []*chart.Chart, error)

Load takes stream with compressed tgz archive as io.Reader, tries to unpack it to tmp directory, and then loads it as bundle and Helm chart

func (Loader) LoadDir

func (l Loader) LoadDir(path string) (*internal.Bundle, []*chart.Chart, error)

LoadDir takes uncompressed chart in specified directory and loads it.

type Name

type Name string

Name represents name of the Bundle

type Provider

type Provider interface {
	ProvideBundles() ([]CompleteBundle, error)
}

Provider contains method which provides CompleteBundle items.

type RepositoryConfig

type RepositoryConfig struct {
	URL string `json:"URL" valid:"required"`
}

RepositoryConfig provides configuration for HTTP Repository.

func (RepositoryConfig) BaseURL

func (cfg RepositoryConfig) BaseURL() string

BaseURL returns base url to bundles with trailing slash

func (RepositoryConfig) IndexFileName

func (cfg RepositoryConfig) IndexFileName() string

IndexFileName returns name of yaml file with configuration (if not exist return default name)

type RepositoryController

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

RepositoryController is responsible for updating repositories URL on configmap change

func NewRepositoryController

func NewRepositoryController(bundleSyncer bundleSyncer, bundleloader bundleLoader, brokerSyncer brokerSyncer, brokerName string, cfgMapInformer cache.SharedIndexInformer, log logrus.FieldLogger, devMode bool) *RepositoryController

NewRepositoryController returns new RepositoryController instance.

func (*RepositoryController) Run

func (c *RepositoryController) Run(stopCh <-chan struct{})

Run starts the controller for configmaps which provides bundles repos.

type Syncer

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

Syncer is responsible for loading bundles from bundle providers and stores it into the storage.

func NewSyncer

func NewSyncer(bundleOperations bundleOperations, chartOperations chartUpserter, docsTopicsService docsTopicsService, log logrus.FieldLogger) *Syncer

NewSyncer returns new Syncer instance.

func (*Syncer) AddProvider

func (s *Syncer) AddProvider(url string, provider Provider)

AddProvider registers new Provider which provides bundles from a repository and enrich bundles with the url.

func (*Syncer) CleanProviders

func (s *Syncer) CleanProviders()

CleanProviders remove all providers from the map.

func (*Syncer) Execute

func (s *Syncer) Execute() error

Execute performs bundles storage with repositories synchronization.

type Version

type Version string

Version represents version of the Bundle

Directories

Path Synopsis
Code generated by mockery v1.0.0 Code generated by mockery v1.0.0 Code generated by mockery v1.0.0 Code generated by mockery v1.0.0
Code generated by mockery v1.0.0 Code generated by mockery v1.0.0 Code generated by mockery v1.0.0 Code generated by mockery v1.0.0

Jump to

Keyboard shortcuts

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