tenant

package
Version: v0.0.0-...-7605501 Latest Latest
Warning

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

Go to latest
Published: May 20, 2020 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const VaultAddress = "http://vault:8200"
View Source
const VaultKvPath = "kv"

Variables

This section is empty.

Functions

func Add

func Add(mgr manager.Manager) error

Add creates a new Tenant Controller and adds it to the Manager with default RBAC. The Manager will set fields on the Controller and Start it when the Manager is Started.

func AddManager

func AddManager(mgr manager.Manager, r reconcile.Reconciler) error

func SetupNewReconciler

func SetupNewReconciler(mgr manager.Manager) reconcile.Reconciler

func SetupTestReconcile

func SetupTestReconcile(inner reconcile.Reconciler) (reconcile.Reconciler, chan reconcile.Request)

SetupTestReconcile returns a reconcile.Reconcile implementation that delegates to inner and writes the request to requests after Reconcile is finished.

func StartTestManager

func StartTestManager(mgr manager.Manager, g *gomega.GomegaWithT) (chan struct{}, *sync.WaitGroup)

StartTestManager adds recFn

Types

type ReconcileTenant

type ReconcileTenant struct {
	client.Client
	// contains filtered or unexported fields
}

ReconcileTenant reconciles a Tenant object

func (*ReconcileTenant) ConnecttoVault

func (r *ReconcileTenant) ConnecttoVault(ns string, tenancyname string) (secret.Store, error)

func (*ReconcileTenant) CreateTenancy

func (r *ReconcileTenant) CreateTenancy(ns string, tenancyname string) error

func (*ReconcileTenant) DeleteTenancy

func (r *ReconcileTenant) DeleteTenancy(tenancyname string, ns string) error

func (*ReconcileTenant) GenerateVaultToken

func (r *ReconcileTenant) GenerateVaultToken() (string, error)

To talk to vault generate a per tenancy secret token with Service account. Use this as interface with vault

func (*ReconcileTenant) GetAuthorizationToken

func (r *ReconcileTenant) GetAuthorizationToken(ns string, serviceAccountName string) (string, error)

func (*ReconcileTenant) GetAuthorizationTokenfromSecret

func (r *ReconcileTenant) GetAuthorizationTokenfromSecret(ns string, tenancyname string) (string, error)

func (*ReconcileTenant) GetTenancy

func (r *ReconcileTenant) GetTenancy(ns string, tenancyname string) (secret.Store, error)

func (*ReconcileTenant) Reconcile

func (r *ReconcileTenant) Reconcile(request reconcile.Request) (reconcile.Result, error)

Reconcile reads that state of the cluster for a Tenant object and makes changes based on the state read and what is in the Tenant.Spec Automatically generate RBAC rules to allow the Controller to read and write related resources +kubebuilder:rbac:groups=core,resources=namespaces,verbs=get;list;watch;create;delete +kubebuilder:rbac:groups=rbac.authorization.k8s.io,resources=clusterroles,verbs=get;list;create;update;patch +kubebuilder:rbac:groups=rbac.authorization.k8s.io,resources=clusterrolebindings,verbs=get;list;create;update;patch +kubebuilder:rbac:groups=rbac.authorization.k8s.io,resources=roles,verbs=get;list;create;update;patch +kubebuilder:rbac:groups=rbac.authorization.k8s.io,resources=rolebindings,verbs=get;list;create;update;patch

func (*ReconcileTenant) UpdateMasterToken

func (r *ReconcileTenant) UpdateMasterToken(token string, ns string, tenancyname string, username string) error

func (*ReconcileTenant) UpdateTargetToken

func (r *ReconcileTenant) UpdateTargetToken(token string, ns string, tenancyname string, username string) error

Jump to

Keyboard shortcuts

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