forked from openshift/cert-manager-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcert_manager_cainjector_deployment.go
72 lines (65 loc) · 2.86 KB
/
cert_manager_cainjector_deployment.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
package deployment
import (
"k8s.io/client-go/informers"
"k8s.io/client-go/kubernetes"
configinformers "github.com/openshift/client-go/config/informers/externalversions"
"github.com/openshift/library-go/pkg/controller/factory"
"github.com/openshift/library-go/pkg/operator/events"
"github.com/openshift/library-go/pkg/operator/resource/resourceapply"
"github.com/openshift/library-go/pkg/operator/staticresourcecontroller"
"github.com/openshift/library-go/pkg/operator/status"
"github.com/openshift/library-go/pkg/operator/v1helpers"
"github.com/openshift/cert-manager-operator/pkg/operator/assets"
certmanoperatorinformers "github.com/openshift/cert-manager-operator/pkg/operator/informers/externalversions"
)
const (
certManagerCAInjectorStaticResourcesControllerName = operatorName + "-cainjector-static-resources-"
certManagerCAInjectorDeploymentControllerName = operatorName + "-cainjector-deployment"
certManagerCAInjectorDeploymentFile = "cert-manager-deployment/cainjector/cert-manager-cainjector-deployment.yaml"
)
var (
certManagerCAInjectorAssetFiles = []string{
"cert-manager-deployment/cainjector/cert-manager-cainjector-cr.yaml",
"cert-manager-deployment/cainjector/cert-manager-cainjector-crb.yaml",
"cert-manager-deployment/cainjector/cert-manager-cainjector-leaderelection-rb.yaml",
"cert-manager-deployment/cainjector/cert-manager-cainjector-leaderelection-role.yaml",
"cert-manager-deployment/cainjector/cert-manager-cainjector-sa.yaml",
}
)
func NewCertManagerCAInjectorStaticResourcesController(operatorClient v1helpers.OperatorClient,
kubeClientContainer *resourceapply.ClientHolder,
kubeInformersForNamespaces v1helpers.KubeInformersForNamespaces,
eventsRecorder events.Recorder,
) factory.Controller {
return staticresourcecontroller.NewStaticResourceController(
certManagerCAInjectorStaticResourcesControllerName,
assets.Asset,
certManagerCAInjectorAssetFiles,
kubeClientContainer,
operatorClient,
eventsRecorder,
).AddKubeInformers(kubeInformersForNamespaces)
}
func NewCertManagerCAInjectorDeploymentController(operatorClient v1helpers.OperatorClientWithFinalizers,
certManagerOperatorInformers certmanoperatorinformers.SharedInformerFactory,
infraInformers configinformers.SharedInformerFactory,
kubeClient kubernetes.Interface,
kubeInformersForTargetNamespace informers.SharedInformerFactory,
eventsRecorder events.Recorder, targetVersion string, versionRecorder status.VersionGetter,
trustedCAConfigmapName, cloudCredentialsSecretName string,
) factory.Controller {
return newGenericDeploymentController(
certManagerCAInjectorDeploymentControllerName,
targetVersion,
certManagerCAInjectorDeploymentFile,
operatorClient,
certManagerOperatorInformers,
infraInformers,
kubeClient,
kubeInformersForTargetNamespace,
eventsRecorder,
versionRecorder,
trustedCAConfigmapName,
cloudCredentialsSecretName,
)
}