Documentation ¶
Index ¶
- func ForBroker(submariner *v1alpha1.Submariner, serviceDisc *v1alpha1.ServiceDiscovery) (*rest.Config, string, error)
- type AllContextFn
- type PerContextFn
- type Producer
- func (rcp *Producer) PopulateTestFramework()
- func (rcp *Producer) RunOnAllContexts(function PerContextFn, status reporter.Interface) error
- func (rcp *Producer) RunOnSelectedContext(function PerContextFn, status reporter.Interface) error
- func (rcp *Producer) RunOnSelectedContexts(function AllContextFn, status reporter.Interface) (bool, error)
- func (rcp *Producer) RunOnSelectedPrefixedContext(prefix string, function PerContextFn, status reporter.Interface) (bool, error)
- func (rcp *Producer) SetupFlags(flags *pflag.FlagSet)
- func (rcp *Producer) WithContextsFlag() *Producer
- func (rcp *Producer) WithDefaultNamespace(defaultNamespace string) *Producer
- func (rcp *Producer) WithInClusterFlag() *Producer
- func (rcp *Producer) WithNamespace() *Producer
- func (rcp *Producer) WithPrefixedContext(prefix string) *Producer
- func (rcp *Producer) WithPrefixedNamespace(prefix, prefixedNamespace string) *Producer
- type RestConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ForBroker ¶
func ForBroker(submariner *v1alpha1.Submariner, serviceDisc *v1alpha1.ServiceDiscovery) (*rest.Config, string, error)
Types ¶
type AllContextFn ¶ added in v0.14.0
type PerContextFn ¶ added in v0.14.0
type PerContextFn func(clusterInfo *cluster.Info, namespace string, status reporter.Interface) error
func IfConnectivityInstalled ¶ added in v0.15.0
func IfConnectivityInstalled(functions ...PerContextFn) PerContextFn
func IfServiceDiscoveryInstalled ¶ added in v0.14.0
func IfServiceDiscoveryInstalled(functions ...PerContextFn) PerContextFn
type Producer ¶
type Producer struct {
// contains filtered or unexported fields
}
func NewProducer ¶
func NewProducer() *Producer
NewProducer initialises a blank producer which needs to be set up with flags (see SetupFlags).
func (*Producer) PopulateTestFramework ¶
func (rcp *Producer) PopulateTestFramework()
func (*Producer) RunOnAllContexts ¶ added in v0.14.0
func (rcp *Producer) RunOnAllContexts(function PerContextFn, status reporter.Interface) error
RunOnAllContexts runs the given function on all accessible non-prefixed contexts. If the user has explicitly selected one or more contexts, only those contexts are used. All appropriate contexts are processed, and any errors are aggregated. Returns an error if no contexts are found.
func (*Producer) RunOnSelectedContext ¶ added in v0.14.0
func (rcp *Producer) RunOnSelectedContext(function PerContextFn, status reporter.Interface) error
RunOnSelectedContext runs the given function on the selected context.
func (*Producer) RunOnSelectedContexts ¶ added in v0.14.0
func (rcp *Producer) RunOnSelectedContexts(function AllContextFn, status reporter.Interface) (bool, error)
RunOnSelectedContexts runs the given function on all selected contexts, passing them simultaneously. This specifically handles the "--contexts" (plural) flag. Returns true if there was at least one selected context, false otherwise.
func (*Producer) RunOnSelectedPrefixedContext ¶ added in v0.14.0
func (rcp *Producer) RunOnSelectedPrefixedContext(prefix string, function PerContextFn, status reporter.Interface) (bool, error)
RunOnSelectedPrefixedContext runs the given function on the selected prefixed context. Returns true if there was a selected prefix context, false otherwise.
func (*Producer) SetupFlags ¶ added in v0.14.0
SetupFlags configures the given flags to control the producer settings.
func (*Producer) WithContextsFlag ¶ added in v0.14.0
WithContextsFlag configures the producer to allow multiple contexts to be selected with the --contexts flag. This is only usable with RunOnAllContexts and will act as a filter on the selected contexts.
func (*Producer) WithDefaultNamespace ¶ added in v0.14.0
WithDefaultNamespace configures the producer to set up a namespace flag, with the given default value. The chosen namespace will be passed to the PerContextFn used to process the context.
func (*Producer) WithInClusterFlag ¶ added in v0.14.0
WithInClusterFlag configures the producer to handle an --in-cluster flag, requesting the use of a Kubernetes-provided context.
func (*Producer) WithNamespace ¶ added in v0.14.0
WithNamespace configures the producer to set up a namespace flag. The chosen namespace will be passed to the PerContextFn used to process the context.
func (*Producer) WithPrefixedContext ¶ added in v0.14.0
WithPrefixedContext configures the producer to set up flags using the given prefix.
func (*Producer) WithPrefixedNamespace ¶ added in v0.15.0
WithPrefixedNamespace configures the producer to set up a prefixed namespace flag, with the given default value. The chosen namespace will be passed to the PerContextFn used to process the context.