controllers

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2022 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Requested  = 1
	InProgress = 2
	Stable     = 3
	Error      = 4
	Unknown    = 5
)

Variables

This section is empty.

Functions

func IsNotOlderThan added in v0.0.4

func IsNotOlderThan(res *kremserv1.RbacNegotiation, seconds float64) bool

func SetupK8sClient

func SetupK8sClient() (*kubernetes.Clientset, *rest.Config)

SetupK8sClient returns the configured kubernetes client, it checks if it's running from the k8s context or not and use the correct method to initialize the client from the context

func UpdateStatus added in v0.0.4

func UpdateStatus(c client.Client, ctx context.Context, res *kremserv1.RbacNegotiation, error bool, added bool)

Types

type AppInfo

type AppInfo struct {
	// contains filtered or unexported fields
}

AppInfo bundles the application specific information including logs, service account and list of live pods

type RbacEntry

type RbacEntry struct {
	Verb     string
	Object   RbacResource
	ObjectNS string
}

RbacEntry holds the information about identified rbac entries that has been found in the logs

func FindRbacEntry

func FindRbacEntry(log string, subjectNS string, subject string) *RbacEntry

FindRbacEntry returns the RbacEntry if it was found in the log for given subject and namespace or nil otherwise

type RbacEventHandler

type RbacEventHandler struct {
	client.Client

	Recorder record.EventRecorder
	Config   *internal.Config
	Tracer   trace.Tracer
	// contains filtered or unexported fields
}

RbacEventHandler handles the CRUD event from CR

func (*RbacEventHandler) ClientSet

func (r *RbacEventHandler) ClientSet() *kubernetes.Clientset

ClientSet returns the k8s client

func (*RbacEventHandler) Setup added in v0.0.4

func (r *RbacEventHandler) Setup(ctx context.Context)

Setup Add some initialization stuff in here

type RbacNegotiationReconciler

type RbacNegotiationReconciler struct {
	client.Client

	Scheme   *runtime.Scheme
	Config   *internal.Config
	Recorder record.EventRecorder
	// contains filtered or unexported fields
}

RbacNegotiationReconciler reconciles a RbacNegotiation object

func (*RbacNegotiationReconciler) Reconcile

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.10.0/pkg/reconcile

func (*RbacNegotiationReconciler) SetupWithManager

func (r *RbacNegotiationReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type RbacResource

type RbacResource struct {
	Group string
	Kind  string
}

RbacResource identifies the object of the RBAC triplet (example: apps/Deployment)

Jump to

Keyboard shortcuts

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