Documentation
¶
Overview ¶
The args package contains arguments for running controllers and admission webhooks
Example ¶
package main
import (
"flag"
"github.com/kubernetes-sigs/kubebuilder/pkg/config"
"github.com/kubernetes-sigs/kubebuilder/pkg/inject/args"
)
func main() {
flag.Parse()
config := config.GetConfigOrDie()
// Create base arguments for initializing controllers
var _ = args.CreateInjectArgs(config)
}
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InjectArgs ¶
type InjectArgs struct {
// Config is the rest config to talk to an API server
Config *rest.Config
// KubernetesClientSet is a clientset to talk to Kuberntes apis
KubernetesClientSet kubernetes.Interface
// KubernetesInformers contains a Kubernetes informers factory
KubernetesInformers informers.SharedInformerFactory
// ControllerManager is the controller manager
ControllerManager *controller.ControllerManager
// EventBroadcaster
EventBroadcaster record.EventBroadcaster
}
InjectArgs are the common arguments for initializing controllers and admission hooks
func CreateInjectArgs ¶
func CreateInjectArgs(config *rest.Config) InjectArgs
CreateInjectArgs returns new arguments for initializing objects
Example ¶
package main
import (
"flag"
"github.com/kubernetes-sigs/kubebuilder/pkg/config"
"github.com/kubernetes-sigs/kubebuilder/pkg/inject/args"
)
func main() {
flag.Parse()
config := config.GetConfigOrDie()
// Create base arguments for initializing controllers
var _ = args.CreateInjectArgs(config)
}
func (InjectArgs) CreateRecorder ¶
func (iargs InjectArgs) CreateRecorder(name string) record.EventRecorder
CreateRecorder returns a new recorder
Example ¶
package main
import (
"flag"
"github.com/kubernetes-sigs/kubebuilder/pkg/config"
"github.com/kubernetes-sigs/kubebuilder/pkg/inject/args"
)
func main() {
flag.Parse()
config := config.GetConfigOrDie()
iargs := args.CreateInjectArgs(config)
var _ = iargs.CreateRecorder("ControllerName")
}
type Injector ¶
type Injector struct {
// CRDs are CRDs that may be created / updated at startup
CRDs []*apiextensionsv1beta1.CustomResourceDefinition
// PolicyRules are RBAC policy rules that may be installed with the controller
PolicyRules []rbacv1.PolicyRule
// GroupVersions are the api group versions in the CRDs
GroupVersions []schema.GroupVersion
// Runnables objects run with RunArguments
Runnables []Runnable
// RunFns are functions run with RunArguments
RunFns []RunFn
// ControllerManager is used to register Informers and Controllers
ControllerManager *controller.ControllerManager
}
Injector is used by code generators to register code generated objects
type RunFn ¶
type RunFn func(arguments run.RunArguments) error
RunFn can be registered with an Injector and run
type Runnable ¶
type Runnable interface {
Run(arguments run.RunArguments) error
}
Runnable can be registered with an Injector and run
Click to show internal directories.
Click to hide internal directories.