controllers

package
v0.0.0-...-3120ddf Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2021 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateOrUpdateRole

func CreateOrUpdateRole(r *RoleReconciler, role *securityv1alpha1.Role, jsonRole []byte) error

CreateOrUpdateRole - make PUT request to create or update Role

func CreateOrUpdateUser

func CreateOrUpdateUser(r *UserReconciler, user *securityv1alpha1.User, jsonUser []byte) error

CreateOrUpdateUser - make PUT request to create or update User

func CreateRoleMapping

func CreateRoleMapping(role *v1alpha1.Role) error

CreateRoleMapping - create/update RoleMapping object, based on passed role

func CreateTenant

func CreateTenant(role *securityv1alpha1.Role) error

CreateTenant - make PUT request to create or update Tenant

func DeleteTenant

func DeleteTenant(tenant string) error

DeleteTenant - make DELETE request to delete tenant

func GetExistingObject

func GetExistingObject(path, ID string) (bool, []byte, error)

GetExistingObject - make GET request to get existing elsticsearch object

func GetResponseObjectID

func GetResponseObjectID(responseBody []byte) string

GetResponseObjectID - get object ID, if exists

func GetResponseStatus

func GetResponseStatus(response *http.Response) string

GetResponseStatus - return Error or Deployed based on http status code

func MakeAPIRequest

func MakeAPIRequest(method string, path string, jsonBody []byte) (ObjectID string, Status string, ResponseBody []byte, Error error)

MakeAPIRequest - make request to endpoint

func MapAPIRoleMappingObject

func MapAPIRoleMappingObject(role *v1alpha1.Role) *rolemappings.RoleMappingAPISpec

MapAPIRoleMappingObject - map passed role's RoleMapping field to roleMappings API

func MapAlertAPIObject

func MapAlertAPIObject(alert *securityv1alpha1.Alert) (*alerts.AlertAPISpec, error)

MapAlertAPIObject - map CRD model to API

func MapRoleAPIObject

func MapRoleAPIObject(role *securityv1alpha1.Role) (*roles.RoleAPISpec, error)

MapRoleAPIObject - map CRD model to API

func MapUserAPIObject

func MapUserAPIObject(user *securityv1alpha1.User) (*users.UserAPISpec, error)

MapUserAPIObject - map CRD model to API

func SanitizeQuery

func SanitizeQuery(query json.RawMessage) json.RawMessage

SanitizeQuery - parse RawMessage to delete escape characters

func SetAlertStatus

func SetAlertStatus(r *AlertReconciler, alert *securityv1alpha1.Alert, responseResult string, responseBody []byte, alertID string) error

SetAlertStatus set status

func SetRoleStatus

func SetRoleStatus(r *RoleReconciler, role *securityv1alpha1.Role, responseResult string, responseBody []byte) error

SetRoleStatus - parse http response code, set status and update CR

func SetUserStatus

func SetUserStatus(r *UserReconciler, user *securityv1alpha1.User, responseResult string, responseBody []byte) error

SetUserStatus - parse http response code, set status and update CR

func UpdateRoleMapping

func UpdateRoleMapping(name string, jsonRoleMapping []byte) error

UpdateRoleMapping - make request to create or update RoleMapping for "parent" role

Types

type AlertReconciler

type AlertReconciler struct {
	client.Client
	Log    logr.Logger
	Scheme *runtime.Scheme
}

AlertReconciler reconciles a Alert object

func (*AlertReconciler) FinalizeAlert

func (r *AlertReconciler) FinalizeAlert(alert *securityv1alpha1.Alert) error

FinalizeAlert delete alert

func (*AlertReconciler) Reconcile

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

Reconcile main reconcile loop

func (*AlertReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type RoleReconciler

type RoleReconciler struct {
	client.Client
	Log    logr.Logger
	Scheme *runtime.Scheme
}

RoleReconciler reconciles a Role object

func (*RoleReconciler) FinalizeRole

func (r *RoleReconciler) FinalizeRole(role *securityv1alpha1.Role) error

FinalizeRole delete role

func (*RoleReconciler) Reconcile

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

Reconcile main reconcile loop

func (*RoleReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type UserReconciler

type UserReconciler struct {
	client.Client
	Log    logr.Logger
	Scheme *runtime.Scheme
}

UserReconciler reconciles a User object

func (*UserReconciler) FinalizeUser

func (r *UserReconciler) FinalizeUser(user *securityv1alpha1.User) error

FinalizeUser delete user

func (*UserReconciler) Reconcile

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

Reconcile main reconcile loop

func (*UserReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

Jump to

Keyboard shortcuts

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