This repository has been archived by the owner on Aug 23, 2023. It is now read-only.
/
dapr_controller_type.go
53 lines (42 loc) · 1.61 KB
/
dapr_controller_type.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package operator
import (
"context"
daprApi "github.com/lburgazzoli/dapr-operator-ng/api/operator/v1alpha1"
"github.com/lburgazzoli/dapr-operator-ng/pkg/controller"
"github.com/lburgazzoli/dapr-operator-ng/pkg/controller/client"
"helm.sh/helm/v3/pkg/chart"
"k8s.io/apimachinery/pkg/types"
"sigs.k8s.io/controller-runtime/pkg/builder"
)
const (
DaprReleaseGeneration = "controlplane.operator.dapr.io/release.generation"
DaprReleaseName = "controlplane.operator.dapr.io/release.name"
DaprReleaseNamespace = "controlplane.operator.dapr.io/release.namespace"
DaprFinalizerName = "controlplane.operator.dapr.io/finalizer"
DaprFieldManager = "dapr-controlplane"
HelmChartsDir = "helm-charts/dapr"
DaprControlPlaneName = "dapr-control-plane"
DaprControlPlaneNamespaceDefault = "dapr-system"
DaprControlPlaneNamespaceEnv = "DAPR_CONTROL_PLANE_NAMESPACE"
DaprConditionReconcile = "Reconcile"
DaprPhaseError = "Error"
DaprPhaseReady = "Ready"
DaprConditionReasonUnsupportedConfiguration = "UnsupportedConfiguration"
)
type HelmOptions struct {
ChartsDir string
}
type ReconciliationRequest struct {
*client.Client
types.NamespacedName
Reconciler *Reconciler
ClusterType controller.ClusterType
Resource *daprApi.DaprControlPlane
Chart *chart.Chart
Overrides map[string]interface{}
}
type Action interface {
Configure(context.Context, *client.Client, *builder.Builder) (*builder.Builder, error)
Run(context.Context, *ReconciliationRequest) error
Cleanup(context.Context, *ReconciliationRequest) error
}