controllers

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2025 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package controllers contains the Kubernetes operator reconciliation loops for handling the JWTs creation and management.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureSysAccount

func EnsureSysAccount(ctx context.Context, nURL string, c client.Client, operatorNs string, opKp nkeys.KeyPair, rotate bool) (nkeys.KeyPair, string, string, string, error)

EnsureSysAccount returns (sysKP, sysJWT string, sysPub string). If rotate==true it generates a *new* account keypair & JWT, replacing whatever is stored in the Secret.

func EnsureSysResolverUser added in v0.0.2

func EnsureSysResolverUser(ctx context.Context, c client.Client, ns string,
	sysSeed []byte, rotate bool,
) (creds string, err error)

func GetNATSConn added in v0.1.3

func GetNATSConn() (*nats.Conn, error)

GetNATSConn returns a shared connection using env vars:

NATS_URL   – e.g. nats://nats:4222
NATS_CREDS – path to resolver creds (user in $SYS)

func GetOrCreateOperatorKP

func GetOrCreateOperatorKP(ctx context.Context, c client.Client, operatorNs string) (nkeys.KeyPair, string, error)

GetOrCreateOperatorKP ensures a Secret with operator seed & jwt exists and returns a loaded nkeys.KeyPair plus JWT string.

func SetNatsCreds added in v0.1.1

func SetNatsCreds(creds string)

func SetNatsURL added in v0.1.1

func SetNatsURL(url string)

Types

type NatsAccountReconciler

type NatsAccountReconciler struct {
	client.Client
	Scheme     *runtime.Scheme
	OperatorNS string
}

NatsAccountReconciler reconciles a NatsAccount object

func (*NatsAccountReconciler) Reconcile

func (r *NatsAccountReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

func (*NatsAccountReconciler) SetupWithManager

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

type NatsUserReconciler

type NatsUserReconciler struct {
	client.Client
	Scheme     *runtime.Scheme
	OperatorNS string
}

NatsUserReconciler reconciles a NatsUser object

func (*NatsUserReconciler) Reconcile

func (r *NatsUserReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

func (*NatsUserReconciler) SetupWithManager

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

Jump to

Keyboard shortcuts

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