cmd

package
v1.7.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidArgs = errors.New("arguments invalid")
View Source
var ErrInvalidOptions = errors.New("invalid options")
View Source
var ErrLockDataUnchanged = errors.New("lock data unchanged")

Functions

func NewScheme

func NewScheme() (*runtime.Scheme, error)

Types

type Build

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

func NewBuild

func NewBuild(scheme *runtime.Scheme, opts ...BuildOption) *Build

func (*Build) BuildFromSource

func (b *Build) BuildFromSource(ctx context.Context, srcPath string, opts ...BuildFromSourceOption) error

type BuildConfig

type BuildConfig struct {
	Log      logr.Logger
	Resolver DigestResolver
}

func (*BuildConfig) Default

func (c *BuildConfig) Default()

func (*BuildConfig) Option

func (c *BuildConfig) Option(opts ...BuildOption)

type BuildFromSourceConfig

type BuildFromSourceConfig struct {
	Insecure   bool
	OutputPath string
	Tags       []string
	Push       bool
}

func (*BuildFromSourceConfig) Option

func (c *BuildFromSourceConfig) Option(opts ...BuildFromSourceOption)

type BuildFromSourceOption

type BuildFromSourceOption interface {
	ConfigureBuildFromSource(*BuildFromSourceConfig)
}

type BuildOption

type BuildOption interface {
	ConfigureBuild(*BuildConfig)
}

type BuildValidationError

type BuildValidationError struct {
	Msg string
}

func (BuildValidationError) Error

func (u BuildValidationError) Error() string

type Client added in v1.7.0

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

func NewClient added in v1.7.0

func NewClient(client client.Client) *Client

func (*Client) GetObjectDeployment added in v1.7.0

func (c *Client) GetObjectDeployment(ctx context.Context, name string, opts ...GetObjectDeploymentOption) (*ObjectDeployment, error)

func (*Client) GetPackage added in v1.7.0

func (c *Client) GetPackage(ctx context.Context, name string, opts ...GetPackageOption) (*Package, error)

type ClientFactory added in v1.7.0

type ClientFactory interface {
	Client() (*Client, error)
}

type Clock

type Clock interface {
	Now() v1.Time
}

type DefaultClientFactory added in v1.7.0

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

func NewDefaultClientFactory added in v1.7.0

func NewDefaultClientFactory(kcliFactory KubeClientFactory) *DefaultClientFactory

func (*DefaultClientFactory) Client added in v1.7.0

func (f *DefaultClientFactory) Client() (*Client, error)

type DefaultKubeClientFactory added in v1.7.0

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

func NewDefaultKubeClientFactory added in v1.7.0

func NewDefaultKubeClientFactory(scheme *runtime.Scheme, cfgFactory RestConfigFactory) *DefaultKubeClientFactory

func (*DefaultKubeClientFactory) GetKubeClient added in v1.7.0

func (f *DefaultKubeClientFactory) GetKubeClient() (client.Client, error)

type DefaultPackageLoader added in v1.6.6

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

func NewDefaultPackageLoader added in v1.6.6

func NewDefaultPackageLoader(scheme *runtime.Scheme) *DefaultPackageLoader

func (*DefaultPackageLoader) LoadPackage added in v1.6.6

func (l *DefaultPackageLoader) LoadPackage(ctx context.Context, path string) (*packagecontent.Package, error)

type DefaultRestConfigFactory added in v1.7.0

type DefaultRestConfigFactory struct{}

func NewDefaultRestConfigFactory added in v1.7.0

func NewDefaultRestConfigFactory() *DefaultRestConfigFactory

func (*DefaultRestConfigFactory) GetConfig added in v1.7.0

func (f *DefaultRestConfigFactory) GetConfig() (*rest.Config, error)

type DefaultTable added in v1.7.0

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

func NewDefaultTable added in v1.7.0

func NewDefaultTable(opts ...TableOption) *DefaultTable

NewDefaultTable returns a Table implementation which will only select Fields from each row if the Field's name matches the provided Headers. If no Headers are provided all fields will be present in the table Data.

func (*DefaultTable) AddRow added in v1.7.0

func (t *DefaultTable) AddRow(fields ...Field)

func (*DefaultTable) Headers added in v1.7.0

func (t *DefaultTable) Headers() []string

func (*DefaultTable) Rows added in v1.7.0

func (t *DefaultTable) Rows() [][]Field

type DigestResolver

type DigestResolver interface {
	ResolveDigest(ref string, opts ...ResolveDigestOption) (string, error)
}

type Field added in v1.7.0

type Field struct {
	Name  string
	Value any
}

type GenerateLockDataConfig added in v1.7.0

type GenerateLockDataConfig struct {
	Insecure bool
}

func (*GenerateLockDataConfig) Option added in v1.7.0

type GenerateLockDataOption added in v1.7.0

type GenerateLockDataOption interface {
	ConfigureGenerateLockData(*GenerateLockDataConfig)
}

type GetObjectDeploymentConfig added in v1.7.0

type GetObjectDeploymentConfig struct {
	Namespace string
}

func (*GetObjectDeploymentConfig) Option added in v1.7.0

type GetObjectDeploymentOption added in v1.7.0

type GetObjectDeploymentOption interface {
	ConfigureGetObjectDeployment(*GetObjectDeploymentConfig)
}

type GetPackageConfig added in v1.7.0

type GetPackageConfig struct {
	Namespace string
}

func (*GetPackageConfig) Option added in v1.7.0

func (c *GetPackageConfig) Option(opts ...GetPackageOption)

type GetPackageOption added in v1.7.0

type GetPackageOption interface {
	ConfigureGetPackage(*GetPackageConfig)
}

type KubeClientFactory added in v1.7.0

type KubeClientFactory interface {
	GetKubeClient() (client.Client, error)
}

type ObjectDeployment added in v1.7.0

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

func (*ObjectDeployment) CurrentRevision added in v1.7.0

func (d *ObjectDeployment) CurrentRevision() int64

func (*ObjectDeployment) Name added in v1.7.0

func (d *ObjectDeployment) Name() string

func (*ObjectDeployment) Namespace added in v1.7.0

func (d *ObjectDeployment) Namespace() string

func (*ObjectDeployment) ObjectSets added in v1.7.0

func (d *ObjectDeployment) ObjectSets(ctx context.Context) (ObjectSetList, error)

type ObjectSet added in v1.7.0

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

func NewObjectSet added in v1.7.0

func NewObjectSet(obj client.Object) ObjectSet

func (*ObjectSet) ChangeCause added in v1.7.0

func (s *ObjectSet) ChangeCause() string

func (*ObjectSet) HasSucceeded added in v1.7.0

func (s *ObjectSet) HasSucceeded() bool

func (*ObjectSet) MarshalJSON added in v1.7.0

func (s *ObjectSet) MarshalJSON() ([]byte, error)

func (*ObjectSet) MarshalYAML added in v1.7.0

func (s *ObjectSet) MarshalYAML() ([]byte, error)

func (*ObjectSet) Name added in v1.7.0

func (s *ObjectSet) Name() string

func (*ObjectSet) Namespace added in v1.7.0

func (s *ObjectSet) Namespace() string

func (*ObjectSet) Revision added in v1.7.0

func (s *ObjectSet) Revision() int64

type ObjectSetList added in v1.7.0

type ObjectSetList []ObjectSet

func (ObjectSetList) FindRevision added in v1.7.0

func (l ObjectSetList) FindRevision(rev int64) (ObjectSet, bool)

func (ObjectSetList) RenderJSON added in v1.7.0

func (l ObjectSetList) RenderJSON() ([]byte, error)

func (ObjectSetList) RenderTable added in v1.7.0

func (l ObjectSetList) RenderTable(headers ...string) Table

func (ObjectSetList) RenderYAML added in v1.7.0

func (l ObjectSetList) RenderYAML() ([]byte, error)

func (ObjectSetList) Sort added in v1.7.0

func (l ObjectSetList) Sort()

type Package added in v1.7.0

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

func (*Package) CurrentRevision added in v1.7.0

func (p *Package) CurrentRevision() int64

func (*Package) Name added in v1.7.0

func (p *Package) Name() string

func (*Package) Namespace added in v1.7.0

func (p *Package) Namespace() string

func (*Package) ObjectSets added in v1.7.0

func (p *Package) ObjectSets(ctx context.Context) (ObjectSetList, error)

type PackageLoader

type PackageLoader interface {
	LoadPackage(ctx context.Context, path string) (*packagecontent.Package, error)
}

type Puller added in v1.7.0

type Puller interface {
	Pull(ctx context.Context, ref string, opts ...packageimport.PullOption) (packagecontent.Files, error)
}

type RenderPackageConfig

type RenderPackageConfig struct {
	ClusterScope   bool
	ConfigPath     string
	ConfigTestcase string
}

func (*RenderPackageConfig) Option

func (c *RenderPackageConfig) Option(opts ...RenderPackageOption)

type RenderPackageOption

type RenderPackageOption interface {
	ConfigureRenderPackage(*RenderPackageConfig)
}

type ResolveDigestConfig added in v1.7.0

type ResolveDigestConfig struct {
	Insecure bool
}

func (*ResolveDigestConfig) Option added in v1.7.0

func (c *ResolveDigestConfig) Option(opts ...ResolveDigestOption)

type ResolveDigestOption added in v1.7.0

type ResolveDigestOption interface {
	ConfigureResolveDigest(*ResolveDigestConfig)
}

type RestConfigFactory added in v1.7.0

type RestConfigFactory interface {
	GetConfig() (*rest.Config, error)
}

type Table added in v1.7.0

type Table interface {
	// Headers returns the table's headers if any.
	Headers() []string
	// Rows returns a 2-dimensional slice of Fields
	// representing the Table data.
	Rows() [][]Field
}

Table provides a generic table interface for Printer's to consume table data from.

type TableConfig added in v1.7.0

type TableConfig struct {
	Headers []string
}

func (*TableConfig) Option added in v1.7.0

func (c *TableConfig) Option(opts ...TableOption)

type TableOption added in v1.7.0

type TableOption interface {
	ConfigureTable(*TableConfig)
}

type Tree

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

func NewTree

func NewTree(scheme *runtime.Scheme, opts ...TreeOption) *Tree

func (*Tree) RenderPackage

func (t *Tree) RenderPackage(ctx context.Context, srcPath string, opts ...RenderPackageOption) (string, error)

type TreeConfig

type TreeConfig struct {
	Log logr.Logger
}

func (*TreeConfig) Default

func (c *TreeConfig) Default()

func (*TreeConfig) Option

func (c *TreeConfig) Option(opts ...TreeOption)

type TreeOption

type TreeOption interface {
	ConfigureTree(*TreeConfig)
}

type Update

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

func NewUpdate

func NewUpdate(opts ...UpdateOption) *Update

func (*Update) GenerateLockData

func (u *Update) GenerateLockData(ctx context.Context, srcPath string, opts ...GenerateLockDataOption) (data []byte, err error)

type UpdateConfig

type UpdateConfig struct {
	Log      logr.Logger
	Clock    Clock
	Loader   PackageLoader
	Resolver DigestResolver
}

func (*UpdateConfig) Default

func (c *UpdateConfig) Default()

func (*UpdateConfig) Option

func (c *UpdateConfig) Option(opts ...UpdateOption)

type UpdateOption

type UpdateOption interface {
	ConfigureUpdate(*UpdateConfig)
}

type Validate

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

func NewValidate

func NewValidate(scheme *runtime.Scheme, opts ...ValidateOption) *Validate

func (*Validate) ValidatePackage

func (v *Validate) ValidatePackage(ctx context.Context, opts ...ValidatePackageOption) error

type ValidateConfig

type ValidateConfig struct {
	Log    logr.Logger
	Puller Puller
}

func (*ValidateConfig) Default

func (c *ValidateConfig) Default()

func (*ValidateConfig) Option

func (c *ValidateConfig) Option(opts ...ValidateOption)

type ValidateOption

type ValidateOption interface {
	ConfigureValidate(*ValidateConfig)
}

type ValidatePackageConfig

type ValidatePackageConfig struct {
	Insecure        bool
	Path            string
	RemoteReference string
}

func (*ValidatePackageConfig) Option

func (c *ValidatePackageConfig) Option(opts ...ValidatePackageOption)

func (*ValidatePackageConfig) Validate

func (c *ValidatePackageConfig) Validate() error

type ValidatePackageOption

type ValidatePackageOption interface {
	ConfigureValidatePackage(*ValidatePackageConfig)
}

type WithClock

type WithClock struct{ Clock Clock }

func (WithClock) ConfigureUpdate

func (w WithClock) ConfigureUpdate(c *UpdateConfig)

type WithClusterScope

type WithClusterScope bool

func (WithClusterScope) ConfigureRenderPackage

func (w WithClusterScope) ConfigureRenderPackage(c *RenderPackageConfig)

type WithConfigPath

type WithConfigPath string

func (WithConfigPath) ConfigureRenderPackage

func (w WithConfigPath) ConfigureRenderPackage(c *RenderPackageConfig)

type WithConfigTestcase

type WithConfigTestcase string

func (WithConfigTestcase) ConfigureRenderPackage

func (w WithConfigTestcase) ConfigureRenderPackage(c *RenderPackageConfig)

type WithDigestResolver

type WithDigestResolver struct{ Resolver DigestResolver }

func (WithDigestResolver) ConfigureBuild

func (w WithDigestResolver) ConfigureBuild(c *BuildConfig)

func (WithDigestResolver) ConfigureUpdate

func (w WithDigestResolver) ConfigureUpdate(c *UpdateConfig)

type WithHeaders added in v1.7.0

type WithHeaders []string

func (WithHeaders) ConfigureTable added in v1.7.0

func (w WithHeaders) ConfigureTable(c *TableConfig)

type WithInsecure added in v1.7.0

type WithInsecure bool

func (WithInsecure) ConfigureBuildFromSource added in v1.7.0

func (w WithInsecure) ConfigureBuildFromSource(c *BuildFromSourceConfig)

func (WithInsecure) ConfigureGenerateLockData added in v1.7.0

func (w WithInsecure) ConfigureGenerateLockData(c *GenerateLockDataConfig)

func (WithInsecure) ConfigureResolveDigest added in v1.7.0

func (w WithInsecure) ConfigureResolveDigest(c *ResolveDigestConfig)

func (WithInsecure) ConfigureValidatePackage added in v1.7.0

func (w WithInsecure) ConfigureValidatePackage(c *ValidatePackageConfig)

type WithLog

type WithLog struct{ Log logr.Logger }

func (WithLog) ConfigureBuild

func (w WithLog) ConfigureBuild(c *BuildConfig)

func (WithLog) ConfigureTree

func (w WithLog) ConfigureTree(c *TreeConfig)

func (WithLog) ConfigureUpdate

func (w WithLog) ConfigureUpdate(c *UpdateConfig)

func (WithLog) ConfigureValidate

func (w WithLog) ConfigureValidate(c *ValidateConfig)

type WithNamespace added in v1.7.0

type WithNamespace string

func (WithNamespace) ConfigureGetObjectDeployment added in v1.7.0

func (w WithNamespace) ConfigureGetObjectDeployment(c *GetObjectDeploymentConfig)

func (WithNamespace) ConfigureGetPackage added in v1.7.0

func (w WithNamespace) ConfigureGetPackage(c *GetPackageConfig)

type WithOutputPath

type WithOutputPath string

func (WithOutputPath) ConfigureBuildFromSource

func (w WithOutputPath) ConfigureBuildFromSource(c *BuildFromSourceConfig)

type WithPackageLoader

type WithPackageLoader struct{ Loader PackageLoader }

func (WithPackageLoader) ConfigureUpdate

func (w WithPackageLoader) ConfigureUpdate(c *UpdateConfig)

type WithPath

type WithPath string

func (WithPath) ConfigureValidatePackage

func (w WithPath) ConfigureValidatePackage(c *ValidatePackageConfig)

type WithPuller added in v1.7.0

type WithPuller struct{ Puller Puller }

func (WithPuller) ConfigureValidate added in v1.7.0

func (w WithPuller) ConfigureValidate(c *ValidateConfig)

type WithPush

type WithPush bool

func (WithPush) ConfigureBuildFromSource

func (w WithPush) ConfigureBuildFromSource(c *BuildFromSourceConfig)

type WithRemoteReference

type WithRemoteReference string

func (WithRemoteReference) ConfigureValidatePackage

func (w WithRemoteReference) ConfigureValidatePackage(c *ValidatePackageConfig)

type WithTags

type WithTags []string

func (WithTags) ConfigureBuildFromSource

func (w WithTags) ConfigureBuildFromSource(c *BuildFromSourceConfig)

Jump to

Keyboard shortcuts

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