Documentation ¶
Index ¶
- Variables
- func AddKlogFlags(flags *pflag.FlagSet)
- func InitKlog(w io.Writer)
- func MaybeSetKlogOutput(w io.Writer)
- type Controller
- type ControllerBuilder
- type DeferredClient
- func (d *DeferredClient) Create(ctx context.Context, obj ctrlclient.Object, opts ...ctrlclient.CreateOption) error
- func (d *DeferredClient) Delete(ctx context.Context, obj ctrlclient.Object, opts ...ctrlclient.DeleteOption) error
- func (d *DeferredClient) DeleteAllOf(ctx context.Context, obj ctrlclient.Object, ...) error
- func (d *DeferredClient) Get(ctx context.Context, key ctrlclient.ObjectKey, obj ctrlclient.Object, ...) error
- func (d *DeferredClient) GroupVersionKindFor(obj runtime.Object) (schema.GroupVersionKind, error)
- func (d *DeferredClient) IsObjectNamespaced(obj runtime.Object) (bool, error)
- func (d *DeferredClient) List(ctx context.Context, list ctrlclient.ObjectList, opts ...ctrlclient.ListOption) error
- func (d *DeferredClient) Patch(ctx context.Context, obj ctrlclient.Object, patch ctrlclient.Patch, ...) error
- func (d *DeferredClient) RESTMapper() meta.RESTMapper
- func (d *DeferredClient) Scheme() *runtime.Scheme
- func (d *DeferredClient) Status() ctrlclient.StatusWriter
- func (d *DeferredClient) SubResource(subResource string) ctrlclient.SubResourceClient
- func (d *DeferredClient) Update(ctx context.Context, obj ctrlclient.Object, opts ...ctrlclient.UpdateOption) error
- type TiltServerControllerManager
- func (m *TiltServerControllerManager) GetClient() ctrlclient.Client
- func (m *TiltServerControllerManager) GetManager() ctrl.Manager
- func (m *TiltServerControllerManager) OnChange(_ context.Context, _ store.RStore, _ store.ChangeSummary) error
- func (m *TiltServerControllerManager) SetUp(ctx context.Context, _ store.RStore) error
- func (m *TiltServerControllerManager) TearDown(_ context.Context)
- type UncachedObjects
Constants ¶
This section is empty.
Variables ¶
var ErrClientNotInitialized = errors.New("controller client not initialized")
var WireSet = wire.NewSet( NewTiltServerControllerManager, NewControllerBuilder, ProvideUncachedObjects, ProvideDeferredClient, wire.Bind(new(ctrlclient.Client), new(*DeferredClient)), cluster.WireSet, cmd.WireSet, controllerSet, uiresource.WireSet, uisession.WireSet, uibutton.WireSet, togglebutton.WireSet, tiltfile.WireSet, extensionrepo.WireSet, extension.WireSet, liveupdate.WireSet, configmap.WireSet, dockerimage.WireSet, cmdimage.WireSet, dockercomposeservice.WireSet, imagemap.WireSet, dockercomposelogstream.WireSet, session.WireSet, )
Functions ¶
func AddKlogFlags ¶ added in v0.33.14
func InitKlog ¶ added in v0.33.14
HACK(nick): The Kubernetes libs we use sometimes use klog to log things to os.Stderr. There are no API hooks to configure this. And printing to Stderr scrambles the HUD tty.
Fortunately, klog does initialize itself from flags, so we can backdoor configure it by setting our own flags. Don't do this at home!
func MaybeSetKlogOutput ¶ added in v0.33.14
We've historically had a lot of problems with bad klog output. For example:
everything on google indicates this warning is useless and should be ignored https://github.com/kubernetes/kubernetes/issues/22024
errors that are logged deep within K8s when populating the cache of resource types for a group-version if the group-version has no resource types registered. This is an uncommon but valid scenario that most commonly occurs with prometheus-adapter and the `external.metrics.k8s.io/v1beta1` group if no external metrics are actually registered (but the group will still exist). The K8s code returns an error instead of treating it as empty, which gets logged at an error level so will show up in Tilt logs and leads to confusion, particularly on `tilt down` where they show up mixed in the CLI output. https://github.com/kubernetes/kubernetes/blob/a4e5239bdc3d85f1f90c7811b03dc153d5121ffe/staging/src/k8s.io/client-go/discovery/cached/memory/memcache.go#L212-L221 https://github.com/kubernetes/kubernetes/issues/92480
informer errors when CRDs are removed https://github.com/kubernetes/kubernetes/issues/79610
We're not convinced that controller-runtime logs EVER make sense to show to tilt users, so let's filter them out by default. Users can turn them on with --klog if they want.
Types ¶
type Controller ¶ added in v0.18.12
type Controller interface { reconcile.Reconciler CreateBuilder(mgr ctrl.Manager) (*builder.Builder, error) }
func ProvideControllers ¶ added in v0.18.12
func ProvideControllers( fileWatch *filewatch.Controller, cmds *cmd.Controller, podlogstreams *podlogstream.Controller, kubernetesDiscovery *kubernetesdiscovery.Reconciler, kubernetesApply *kubernetesapply.Reconciler, uis *uisession.Reconciler, uir *uiresource.Reconciler, uib *uibutton.Reconciler, pfr *portforward.Reconciler, tfr *tiltfile.Reconciler, tbr *togglebutton.Reconciler, extr *extension.Reconciler, extrr *extensionrepo.Reconciler, lur *liveupdate.Reconciler, cmr *configmap.Reconciler, dir *dockerimage.Reconciler, cir *cmdimage.Reconciler, clr *cluster.Reconciler, dcr *dockercomposeservice.Reconciler, imr *imagemap.Reconciler, dclsr *dockercomposelogstream.Reconciler, sr *session.Reconciler, ) []Controller
type ControllerBuilder ¶ added in v0.18.12
type ControllerBuilder struct {
// contains filtered or unexported fields
}
func NewControllerBuilder ¶ added in v0.18.12
func NewControllerBuilder(tscm *TiltServerControllerManager, controllers []Controller) *ControllerBuilder
func (*ControllerBuilder) OnChange ¶ added in v0.18.12
func (c *ControllerBuilder) OnChange(_ context.Context, _ store.RStore, _ store.ChangeSummary) error
func (*ControllerBuilder) TearDown ¶ added in v0.19.0
func (c *ControllerBuilder) TearDown(ctx context.Context)
type DeferredClient ¶ added in v0.19.0
type DeferredClient struct {
// contains filtered or unexported fields
}
func ProvideDeferredClient ¶ added in v0.19.0
func ProvideDeferredClient() *DeferredClient
func (*DeferredClient) Create ¶ added in v0.19.0
func (d *DeferredClient) Create(ctx context.Context, obj ctrlclient.Object, opts ...ctrlclient.CreateOption) error
func (*DeferredClient) Delete ¶ added in v0.19.0
func (d *DeferredClient) Delete(ctx context.Context, obj ctrlclient.Object, opts ...ctrlclient.DeleteOption) error
func (*DeferredClient) DeleteAllOf ¶ added in v0.19.0
func (d *DeferredClient) DeleteAllOf(ctx context.Context, obj ctrlclient.Object, opts ...ctrlclient.DeleteAllOfOption) error
func (*DeferredClient) Get ¶ added in v0.19.0
func (d *DeferredClient) Get(ctx context.Context, key ctrlclient.ObjectKey, obj ctrlclient.Object, _ ...ctrlclient.GetOption) error
func (*DeferredClient) GroupVersionKindFor ¶ added in v0.33.0
func (d *DeferredClient) GroupVersionKindFor(obj runtime.Object) (schema.GroupVersionKind, error)
func (*DeferredClient) IsObjectNamespaced ¶ added in v0.33.0
func (d *DeferredClient) IsObjectNamespaced(obj runtime.Object) (bool, error)
func (*DeferredClient) List ¶ added in v0.19.0
func (d *DeferredClient) List(ctx context.Context, list ctrlclient.ObjectList, opts ...ctrlclient.ListOption) error
func (*DeferredClient) Patch ¶ added in v0.19.0
func (d *DeferredClient) Patch(ctx context.Context, obj ctrlclient.Object, patch ctrlclient.Patch, opts ...ctrlclient.PatchOption) error
func (*DeferredClient) RESTMapper ¶ added in v0.19.0
func (d *DeferredClient) RESTMapper() meta.RESTMapper
func (*DeferredClient) Scheme ¶ added in v0.19.0
func (d *DeferredClient) Scheme() *runtime.Scheme
func (*DeferredClient) Status ¶ added in v0.19.0
func (d *DeferredClient) Status() ctrlclient.StatusWriter
func (*DeferredClient) SubResource ¶ added in v0.32.0
func (d *DeferredClient) SubResource(subResource string) ctrlclient.SubResourceClient
func (*DeferredClient) Update ¶ added in v0.19.0
func (d *DeferredClient) Update(ctx context.Context, obj ctrlclient.Object, opts ...ctrlclient.UpdateOption) error
type TiltServerControllerManager ¶
type TiltServerControllerManager struct {
// contains filtered or unexported fields
}
func NewTiltServerControllerManager ¶
func NewTiltServerControllerManager(config *server.APIServerConfig, scheme *runtime.Scheme, deferredClient *DeferredClient, uncachedObjects UncachedObjects) (*TiltServerControllerManager, error)
func (*TiltServerControllerManager) GetClient ¶ added in v0.18.12
func (m *TiltServerControllerManager) GetClient() ctrlclient.Client
func (*TiltServerControllerManager) GetManager ¶ added in v0.18.12
func (m *TiltServerControllerManager) GetManager() ctrl.Manager
func (*TiltServerControllerManager) OnChange ¶
func (m *TiltServerControllerManager) OnChange(_ context.Context, _ store.RStore, _ store.ChangeSummary) error
OnChange is a no-op but used to get initialized in upper along with the API server
func (*TiltServerControllerManager) TearDown ¶
func (m *TiltServerControllerManager) TearDown(_ context.Context)
type UncachedObjects ¶ added in v0.20.7
type UncachedObjects []ctrlclient.Object
func ProvideUncachedObjects ¶ added in v0.20.7
func ProvideUncachedObjects() UncachedObjects