-
Notifications
You must be signed in to change notification settings - Fork 189
/
apimgmt_controller.go
35 lines (26 loc) · 1.15 KB
/
apimgmt_controller.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
package controllers
import (
azurev1alpha1 "github.com/Azure/azure-service-operator/api/v1alpha1"
"context"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/reconcile"
)
// APIMAPIReconciler reconciles a APIM object
type APIMAPIReconciler struct {
Reconciler *AsyncReconciler
}
var _ reconcile.Reconciler = &APIMAPIReconciler{}
// +kubebuilder:rbac:groups=azure.microsoft.com,resources=apimgmtapis,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=azure.microsoft.com,resources={apimgmtapis/status,apimgmtapis/finalizers},verbs=get;update;patch
// Reconcile attempts to set the desired state snapshot representation of the service in k8s
func (r *APIMAPIReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
return r.Reconciler.Reconcile(ctx, req, &azurev1alpha1.APIMgmtAPI{})
}
// SetupWithManager initializes the control loop for this operator
func (r *APIMAPIReconciler) SetupWithManager(mgr ctrl.Manager) error {
return ctrl.NewControllerManagedBy(mgr).
For(&azurev1alpha1.APIMgmtAPI{}).
Complete(r)
}