Documentation
¶
Index ¶
- type Options
- type Params
- func (p *Params) AddFlags(flags *pflag.FlagSet)
- func (p *Params) ClientSet() (kubernetes.Interface, error)
- func (p *Params) Namespace() string
- func (p *Params) NewFollower(ctx context.Context, br types.NamespacedName, ...) (*follower.Follower, error)
- func (p *Params) NewPodWatcher(ctx context.Context) (*reactor.PodWatcher, error)
- func (p *Params) RESTConfig() (*rest.Config, error)
- func (p *Params) RequestTimeout() (time.Duration, error)
- func (p *Params) ShipwrightClientSet() (buildclientset.Interface, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Options ¶ added in v0.19.0
type Options func(params *Params)
Options accepts optional functions to override certain parameters
func WithClientset ¶ added in v0.19.0
func WithClientset(kubeClientset kubernetes.Interface, buildClientset buildclientset.Interface) Options
WithClientset updates the shp CLI to use the provided Kubernetes and Build clientsets
func WithConfigFlags ¶ added in v0.19.0
func WithConfigFlags(configFlags *genericclioptions.ConfigFlags) Options
WithConfigFlags updates the shp CLI to use the provided configuration flags
func WithNamespace ¶ added in v0.19.0
WithNamespace updates the shp CLI to use the provided namespace
type Params ¶
type Params struct {
// contains filtered or unexported fields
}
Params is a place for Shipwright CLI to store its runtime parameters, including configured dynamic client and global flags.
func NewParams ¶
NewParams creates a new instance of ShipwrightParams and returns it as an interface value
func NewParamsForTest ¶
func NewParamsForTest(clientset kubernetes.Interface, shpClientset buildclientset.Interface, configFlags *genericclioptions.ConfigFlags, namespace string, failPollInterval *time.Duration, failPollTimeout *time.Duration, ) *Params
NewParamsForTest creates an instance of Params for testing purpose
func (*Params) ClientSet ¶
func (p *Params) ClientSet() (kubernetes.Interface, error)
ClientSet returns a kubernetes clientset.
func (*Params) Namespace ¶
Namespace returns kubernetes namespace with all the overrides from command line and kubernetes config
func (*Params) NewFollower ¶ added in v0.8.0
func (p *Params) NewFollower( ctx context.Context, br types.NamespacedName, ioStreams *genericclioptions.IOStreams, ) (*follower.Follower, error)
NewFollower instantiate a new Follower based on the current instance.
func (*Params) NewPodWatcher ¶ added in v0.8.0
NewPodWatcher instantiate a new PodWatcher based on the current instance.
func (*Params) RESTConfig ¶ added in v0.8.0
RESTConfig returns the rest configuration based on local flags.
func (*Params) RequestTimeout ¶ added in v0.6.0
RequestTimeout returns the setting from k8s --request-timeout param
func (*Params) ShipwrightClientSet ¶
func (p *Params) ShipwrightClientSet() (buildclientset.Interface, error)
ShipwrightClientSet returns a Shipwright Clientset