controllers

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2024 License: MPL-2.0 Imports: 42 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GraphKey = "graph_ref"
)
View Source
const SubgraphField = ".subgraphs_refs.name"
View Source
const (
	TLSSecretType = "kubernetes.io/tls"
)

Variables

View Source
var (
	ErrSubgrapReferenceExistsInGraph  = errors.New("subgraph is referenced in SuperGraph")
	ErrSubgrapReferenceExistsInApiDef = errors.New("subgraph is referenced in ApiDefinition")
)
View Source
var ErrMultipleLinkSubGraph = errors.New("linking one SubGraph to multiple ApiDefinition is forbidden")
View Source
var ErrOperatorContextIsStillInUse = errors.
	New("Operator context is used by other resources." +
		"Please check operator context status to find exact list of resources")
View Source
var ErrSuperGraphReference = errors.New("SuperGraph is referenced in ApiDefinition")

Functions

func EncodeNS added in v0.12.0

func EncodeNS(decoded string) string

EncodeNS encodes given decoded string based on base64.

func GetContext added in v0.7.0

func GetContext(
	ctx context.Context,
	ns string,
	client client.Client,
	target *model.Target,
	log logr.Logger,
) (*v1alpha1.OperatorContext, error)

GetContext returns a OperatorContext resource from k8s cluster with namespace/name derived from target. When Spec.FromSecret is provided this reads the secret and loads the environment from it. Values set in .Spec.Env takes precedence over the values from secret

func HttpContext added in v0.12.0

func HttpContext(
	ctx context.Context,
	rClient client.Client,
	env *environment.Env,
	object client.Object,
	log logr.Logger,
) (environment.Env, context.Context, error)

HttpContext creates a context.Context for Tyk API Client.

Types

type APIDescriptionReconciler added in v0.7.0

type APIDescriptionReconciler struct {
	client.Client
	Log       logr.Logger
	Scheme    *runtime.Scheme
	Universal universal.Client
	Env       environment.Env
}

APIDescriptionReconciler reconciles a APIDescription object

func (*APIDescriptionReconciler) Reconcile added in v0.7.0

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

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

func (*APIDescriptionReconciler) SetupWithManager added in v0.7.0

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

SetupWithManager sets up the controller with the Manager.

type ApiDefinitionReconciler

type ApiDefinitionReconciler struct {
	client.Client
	Log      logr.Logger
	Scheme   *runtime.Scheme
	Env      environment.Env
	Recorder record.EventRecorder
}

ApiDefinitionReconciler reconciles a ApiDefinition object

func (*ApiDefinitionReconciler) Reconcile

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

func (*ApiDefinitionReconciler) SetupWithManager

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

SetupWithManager initializes the api definition controller.

type IngressReconciler

type IngressReconciler struct {
	client.Client
	Log      logr.Logger
	Scheme   *runtime.Scheme
	Env      environment.Env
	Recorder record.EventRecorder
}

IngressReconciler watches and reconciles Ingress objects

func (*IngressReconciler) Reconcile

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

Reconcile perform reconciliation logic for Ingress resource that is managed by the operator.

func (*IngressReconciler) SetupWithManager

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

SetupWithManager initializes ingress controller manager

type NewSecretType added in v0.9.0

type NewSecretType struct {
	ObjectOld struct {
		Type string `json:"type"`
	} `json:"ObjectOld"`
	ObjectNew struct {
		Type string `json:"type"`
	} `json:"ObjectNew"`
	Object struct {
		Type string `json:"type"`
	} `json:"Object"`
}

NewSecretType represents a structure for new Kubernetes Secret Object.

type OperatorContextReconciler added in v0.8.2

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

OperatorContextReconciler reconciles a OperatorContext object

func (*OperatorContextReconciler) Reconcile added in v0.8.2

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state. TODO(user): Modify the Reconcile function to compare the state specified by the OperatorContext object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.

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

func (*OperatorContextReconciler) SetupWithManager added in v0.8.2

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

SetupWithManager sets up the controller with the Manager.

type PortalAPICatalogueReconciler added in v0.7.0

type PortalAPICatalogueReconciler struct {
	client.Client
	Log    logr.Logger
	Scheme *runtime.Scheme
	Env    environment.Env
}

PortalAPICatalogueReconciler reconciles a PortalAPICatalogue object

func (*PortalAPICatalogueReconciler) Reconcile added in v0.7.0

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

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state. TODO(user): Modify the Reconcile function to compare the state specified by the PortalAPICatalogue object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.

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

func (*PortalAPICatalogueReconciler) SetupWithManager added in v0.7.0

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

SetupWithManager sets up the controller with the Manager.

type PortalConfigReconciler added in v0.7.0

type PortalConfigReconciler struct {
	client.Client
	Log    logr.Logger
	Scheme *runtime.Scheme
	Env    environment.Env
}

PortalConfigReconciler reconciles a PortalConfig object

func (*PortalConfigReconciler) Reconcile added in v0.7.0

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

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state. TODO(user): Modify the Reconcile function to compare the state specified by the PortalConfig object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.

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

func (*PortalConfigReconciler) SetupWithManager added in v0.7.0

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

SetupWithManager sets up the controller with the Manager.

type SecretCertReconciler

type SecretCertReconciler struct {
	client.Client
	Log    logr.Logger
	Scheme *runtime.Scheme
	Env    environment.Env
}

SecretCertReconciler reconciles a Cert object

func (*SecretCertReconciler) Reconcile

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

type SecurityPolicyReconciler

type SecurityPolicyReconciler struct {
	client.Client
	Log      logr.Logger
	Scheme   *runtime.Scheme
	Env      environment.Env
	Recorder record.EventRecorder
}

SecurityPolicyReconciler reconciles a SecurityPolicy object

func (*SecurityPolicyReconciler) Reconcile

Reconcile reconciles SecurityPolicy custom resources

func (*SecurityPolicyReconciler) SetupWithManager

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

SetupWithManager initializes the security policy controller.

type SubGraphReconciler added in v0.10.0

type SubGraphReconciler struct {
	client.Client
	Log    logr.Logger
	Env    environment.Env
	Scheme *runtime.Scheme
}

SubGraphReconciler reconciles a SubGraph object

func (*SubGraphReconciler) Reconcile added in v0.10.0

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

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 (*SubGraphReconciler) SetupWithManager added in v0.10.0

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

SetupWithManager sets up the controller with the Manager.

type SuperGraphReconciler added in v0.10.0

type SuperGraphReconciler struct {
	client.Client
	Log    logr.Logger
	Scheme *runtime.Scheme
	Env    environment.Env
}

SuperGraphReconciler reconciles a SuperGraph object

func (*SuperGraphReconciler) Reconcile added in v0.10.0

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

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 (*SuperGraphReconciler) SetupWithManager added in v0.10.0

func (r *SuperGraphReconciler) 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