cmd

package
v1.8.3 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 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

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

func NewClient

func NewClient(client client.Client) *Client

func (*Client) GetObjectDeployment

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

func (*Client) GetPackage

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

type ClientFactory

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

type Clock

type Clock interface {
	Now() v1.Time
}

type DefaultClientFactory

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

func NewDefaultClientFactory

func NewDefaultClientFactory(kcliFactory KubeClientFactory) *DefaultClientFactory

func (*DefaultClientFactory) Client

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

type DefaultKubeClientFactory

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

func NewDefaultKubeClientFactory

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

func (*DefaultKubeClientFactory) GetKubeClient

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

type DefaultPackageLoader

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

func NewDefaultPackageLoader

func NewDefaultPackageLoader(scheme *runtime.Scheme) *DefaultPackageLoader

func (*DefaultPackageLoader) LoadPackage

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

type DefaultRestConfigFactory

type DefaultRestConfigFactory struct{}

func NewDefaultRestConfigFactory

func NewDefaultRestConfigFactory() *DefaultRestConfigFactory

func (*DefaultRestConfigFactory) GetConfig

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

type DefaultTable

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

func NewDefaultTable

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

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

func (*DefaultTable) Headers

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

func (*DefaultTable) Rows

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

type DigestResolver

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

type Field

type Field struct {
	Name  string
	Value any
}

type GenerateLockDataConfig

type GenerateLockDataConfig struct {
	Insecure bool
}

func (*GenerateLockDataConfig) Option

type GenerateLockDataOption

type GenerateLockDataOption interface {
	ConfigureGenerateLockData(*GenerateLockDataConfig)
}

type GetObjectDeploymentConfig

type GetObjectDeploymentConfig struct {
	Namespace string
}

func (*GetObjectDeploymentConfig) Option

type GetObjectDeploymentOption

type GetObjectDeploymentOption interface {
	ConfigureGetObjectDeployment(*GetObjectDeploymentConfig)
}

type GetPackageConfig

type GetPackageConfig struct {
	Namespace string
}

func (*GetPackageConfig) Option

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

type GetPackageOption

type GetPackageOption interface {
	ConfigureGetPackage(*GetPackageConfig)
}

type KubeClientFactory

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

type ObjectDeployment

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

func (*ObjectDeployment) CurrentRevision

func (d *ObjectDeployment) CurrentRevision() int64

func (*ObjectDeployment) Name

func (d *ObjectDeployment) Name() string

func (*ObjectDeployment) Namespace

func (d *ObjectDeployment) Namespace() string

func (*ObjectDeployment) ObjectSets

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

type ObjectSet

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

func NewObjectSet

func NewObjectSet(obj client.Object) ObjectSet

func (*ObjectSet) ChangeCause

func (s *ObjectSet) ChangeCause() string

func (*ObjectSet) HasSucceeded

func (s *ObjectSet) HasSucceeded() bool

func (*ObjectSet) MarshalJSON

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

func (*ObjectSet) MarshalYAML

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

func (*ObjectSet) Name

func (s *ObjectSet) Name() string

func (*ObjectSet) Namespace

func (s *ObjectSet) Namespace() string

func (*ObjectSet) Revision

func (s *ObjectSet) Revision() int64

type ObjectSetList

type ObjectSetList []ObjectSet

func (ObjectSetList) FindRevision

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

func (ObjectSetList) RenderJSON

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

func (ObjectSetList) RenderTable

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

func (ObjectSetList) RenderYAML

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

func (ObjectSetList) Sort

func (l ObjectSetList) Sort()

type Package

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

func (*Package) CurrentRevision

func (p *Package) CurrentRevision() int64

func (*Package) Name

func (p *Package) Name() string

func (*Package) Namespace

func (p *Package) Namespace() string

func (*Package) ObjectSets

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

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

type ResolveDigestConfig struct {
	Insecure bool
}

func (*ResolveDigestConfig) Option

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

type ResolveDigestOption

type ResolveDigestOption interface {
	ConfigureResolveDigest(*ResolveDigestConfig)
}

type RestConfigFactory

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

type Table

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

type TableConfig struct {
	Headers []string
}

func (*TableConfig) Option

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

type TableOption

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

type WithHeaders []string

func (WithHeaders) ConfigureTable

func (w WithHeaders) ConfigureTable(c *TableConfig)

type WithInsecure

type WithInsecure bool

func (WithInsecure) ConfigureBuildFromSource

func (w WithInsecure) ConfigureBuildFromSource(c *BuildFromSourceConfig)

func (WithInsecure) ConfigureGenerateLockData

func (w WithInsecure) ConfigureGenerateLockData(c *GenerateLockDataConfig)

func (WithInsecure) ConfigureResolveDigest

func (w WithInsecure) ConfigureResolveDigest(c *ResolveDigestConfig)

func (WithInsecure) ConfigureValidatePackage

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

type WithNamespace string

func (WithNamespace) ConfigureGetObjectDeployment

func (w WithNamespace) ConfigureGetObjectDeployment(c *GetObjectDeploymentConfig)

func (WithNamespace) ConfigureGetPackage

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

type WithPuller struct{ Puller Puller }

func (WithPuller) ConfigureValidate

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