library

module
v0.0.0-...-2d305cd Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 27, 2023 License: Apache-2.0

README

crd 使用方法

    rootCtx := context.Background()
	log := r.Log.WithValues("deployment", req.NamespacedName)
	ctx := context.WithValue(rootCtx, helper.LoggerApplicationCtxKey, log)

	// your logic here
	deployment := &appsv1.Deployment{}
	ctr := controller.Controller{
		Client:   r.Client,
		Eventer:  r.Eventer,
		Operator: r,
		Gvk: schema.GroupVersionKind{
			Group:   appsv1.SchemeGroupVersion.Group,
			Version: appsv1.SchemeGroupVersion.Version,
			Kind:    "Deployment",
		},
        LoggerKey: "logger",
        Module: "application",
	}
	deployment.APIVersion = ctr.Gvk.GroupVersion().String()
	deployment.Kind = ctr.Gvk.Kind
	return ctr.Run(ctx, req, deployment)

Directories

Path Synopsis
api
Package exec provides an injectable interface and implementations for running commands.
Package exec provides an injectable interface and implementations for running commands.
Package probe contains utilities for health probing, as well as health status information.
Package probe contains utilities for health probing, as well as health status information.
tcp
udp

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL