Documentation ¶
Index ¶
- Constants
- Variables
- func ErrorControllerNames(invalidNames string, validNames []string) error
- func RegisterFlags()
- func StartMainWithAllControllers(p Platform)
- func StartMainWithSelectedControllers(p Platform)
- type ControllerMap
- type ControllerName
- type FakePlatform
- type Platform
- type PlatformConfig
- type PlatformNameKey
Constants ¶
const ( FlagControllers string = "controllers" )
const ( ControllerTektonConfig ControllerName = "tektonconfig" ControllerTektonPipeline ControllerName = "tektonpipeline" ControllerTektonTrigger ControllerName = "tektontrigger" ControllerTektonInstallerSet ControllerName = "tektoninstallerset" ControllerTektonHub ControllerName = "tektonhub" ControllerTektonChain ControllerName = "tektonchain" ControllerTektonResult ControllerName = "tektonresult" ControllerManualApprovalGate ControllerName = "manualapprovalgate" EnvControllerNames string = "CONTROLLER_NAMES" )
Controllers common to all platforms
Variables ¶
var ( ErrControllerNamesNil = fmt.Errorf("ControllerNames slice should be non-nil") )
Functions ¶
func ErrorControllerNames ¶
ErrorControllerNames is a error message format helper
func RegisterFlags ¶
func RegisterFlags()
RegisterFlags adds platform specific command line flags this logic is written in a separate function to make it convenient to write unit-tests
func StartMainWithAllControllers ¶
func StartMainWithAllControllers(p Platform)
StartMainWithAllControllers calls startMain with all controllers supported by a platform
func StartMainWithSelectedControllers ¶
func StartMainWithSelectedControllers(p Platform)
StartMainWithAllControllers calls startMain with a subset of controllers specified in the platformConfig of a platform
Types ¶
type ControllerMap ¶
type ControllerMap map[ControllerName]injection.NamedControllerConstructor
ControllerMap defines map that maps a name given to a controller(reconciler) to its injection.ControllerConstructor
func (ControllerMap) ControllerConstructors ¶
func (cm ControllerMap) ControllerConstructors() []injection.ControllerConstructor
ControllerConstructor returns a []injection.ControllerConstructor of all controllers (reconciers) supported in a given ControlelrMap Some versions of sharedMain functions in knative/pkg expect a variadic list of supported cotrollers as []injection.ControllerConstructor
func (ControllerMap) ControllerNames ¶
func (cm ControllerMap) ControllerNames() []string
ControllerNames returns a []string of names of all controllers (reconciers) supported in a given ControlelrMap
func (ControllerMap) NamedControllerConstructors ¶
func (cm ControllerMap) NamedControllerConstructors() []injection.NamedControllerConstructor
ControllerConstructor returns a []injection.NamedControllerConstructor of all controllers (reconciers) supported in a given ControlelrMap Some versions of sharedMain functions in knative/pkg expect a variadic list of supported cotrollers as []injection.NamedControllerConstructor
type ControllerName ¶
type ControllerName string
ControllerName defines a name given to a controller(reconciler) in a platform
type FakePlatform ¶
type FakePlatform struct {
// contains filtered or unexported fields
}
func SeededFakePlatform ¶
func SeededFakePlatform(cn []ControllerName, ctrls ControllerMap) *FakePlatform
func (*FakePlatform) AllSupportedControllers ¶
func (fp *FakePlatform) AllSupportedControllers() ControllerMap
func (*FakePlatform) PlatformParams ¶
func (fp *FakePlatform) PlatformParams() PlatformConfig
type Platform ¶
type Platform interface { PlatformParams() PlatformConfig AllSupportedControllers() ControllerMap }
Platform defines a Kubernetes platform (Vanila Kubernetes, OpenShift...)
type PlatformConfig ¶
type PlatformConfig struct { Name string ControllerNames []ControllerName }
PlatformConfig defines basic configuration that all platforms should support
func NewConfigFromEnv ¶
func NewConfigFromEnv() PlatformConfig
NewConfigFromEnv returns PlatformConfig created using inputs from environment variables
func NewConfigFromFlags ¶
func NewConfigFromFlags() PlatformConfig
NewConfigFromFlags returns PlatformConfig created using inputs from command line flags
type PlatformNameKey ¶
type PlatformNameKey struct{}
PlatformNameKey is defines a 'key' for adding platform name to an instance of context.Context