@@ -3,8 +3,6 @@ package trustmanager
33import (
44 "os"
55 "time"
6-
7- "k8s.io/apimachinery/pkg/util/validation/field"
86)
97
108const (
@@ -14,6 +12,10 @@ const (
1412 // ControllerName is the name of the controller used in logs and events.
1513 ControllerName = trustManagerCommonName + "-controller"
1614
15+ // controllerProcessedAnnotation is the annotation added to trustmanager resource once after
16+ // successful reconciliation by the controller.
17+ controllerProcessedAnnotation = "operator.openshift.io/trust-manager-processed"
18+
1719 // finalizer name for trustmanager.openshift.operator.io resource.
1820 finalizer = "trustmanager.openshift.operator.io/" + ControllerName
1921
@@ -41,70 +43,9 @@ const (
4143 // fieldOwner is the field manager name used for Server-Side Apply operations.
4244 // All resource reconcilers should use this to identify ownership of fields.
4345 fieldOwner = "trust-manager-controller"
44-
45- // trustManagerContainerName is the name of the trust-manager container in the deployment.
46- trustManagerContainerName = "trust-manager"
47-
48- // roleBindingSubjectKind is the kind used in RBAC binding subjects.
49- roleBindingSubjectKind = "ServiceAccount"
50- )
51-
52- // DefaultCAPackage constants.
53- const (
54- // defaultCAPackageConfigMapName is the ConfigMap in the operand namespace that
55- // contains the formatted JSON CA package for trust-manager.
56- defaultCAPackageConfigMapName = "trust-manager-default-ca-package"
57-
58- // defaultCAPackageName is the package name used in the JSON CA package.
59- defaultCAPackageName = "cert-manager-package-openshift"
60-
61- // defaultCAPackageFilename is the filename used for the JSON package inside the ConfigMap.
62- defaultCAPackageFilename = defaultCAPackageName + ".json"
63-
64- // defaultCAPackageVolumeName is the volume name used in the deployment.
65- defaultCAPackageVolumeName = "packages"
66-
67- // defaultCAPackageMountPath is where the package volume is mounted in the container.
68- defaultCAPackageMountPath = "/packages"
69-
70- // defaultCAPackageLocation is the full path to the JSON package file inside the container.
71- defaultCAPackageLocation = defaultCAPackageMountPath + "/" + defaultCAPackageFilename
72-
73- // defaultCAPackageHashAnnotation is the pod template annotation that tracks the CA bundle hash.
74- defaultCAPackageHashAnnotation = "operator.openshift.io/default-ca-package-hash"
75- )
76-
77- // Resource names used for creating resources and cross-referencing between them.
78- // These must be set explicitly on each resource's .metadata.name and on every
79- // field in other resources that references them.
80- const (
81- trustManagerCommonResourceName = "trust-manager"
82-
83- trustManagerServiceAccountName = trustManagerCommonResourceName
84- trustManagerDeploymentName = trustManagerCommonResourceName
85-
86- trustManagerServiceName = trustManagerCommonResourceName
87- trustManagerMetricsServiceName = trustManagerCommonResourceName + "-metrics"
88-
89- trustManagerClusterRoleName = trustManagerCommonResourceName
90- trustManagerClusterRoleBindingName = trustManagerCommonResourceName
91-
92- trustManagerRoleName = trustManagerCommonResourceName
93- trustManagerRoleBindingName = trustManagerCommonResourceName
94-
95- trustManagerLeaderElectionRoleName = trustManagerCommonResourceName + ":leaderelection"
96- trustManagerLeaderElectionRoleBindingName = trustManagerCommonResourceName + ":leaderelection"
97-
98- trustManagerIssuerName = trustManagerCommonResourceName
99- trustManagerCertificateName = trustManagerCommonResourceName
100- trustManagerTLSSecretName = trustManagerCommonResourceName + "-tls"
101-
102- trustManagerWebhookConfigName = trustManagerCommonResourceName
10346)
10447
10548var (
106- trustManagerConfigFieldPath = field .NewPath ("spec" , "trustManagerConfig" )
107- controllerConfigFieldPath = field .NewPath ("spec" , "controllerConfig" )
10849 controllerDefaultResourceLabels = map [string ]string {
10950 "app" : trustManagerCommonName ,
11051 "app.kubernetes.io/name" : trustManagerCommonName ,
@@ -117,25 +58,7 @@ var (
11758
11859// asset names are the files present in the root bindata/ dir. Which are then loaded
11960// and made available by the pkg/operator/assets package.
61+ // TODO: Add more asset names as resources are implemented.
12062const (
12163 serviceAccountAssetName = "trust-manager/resources/serviceaccount_trust-manager.yml"
122-
123- deploymentAssetName = "trust-manager/resources/deployment_trust-manager.yml"
124-
125- serviceAssetName = "trust-manager/resources/service_trust-manager.yml"
126- metricsServiceAssetName = "trust-manager/resources/service_trust-manager-metrics.yml"
127-
128- clusterRoleAssetName = "trust-manager/resources/clusterrole_trust-manager.yml"
129- clusterRoleBindingAssetName = "trust-manager/resources/clusterrolebinding_trust-manager.yml"
130-
131- roleAssetName = "trust-manager/resources/role_trust-manager.yml"
132- roleBindingAssetName = "trust-manager/resources/rolebinding_trust-manager.yml"
133-
134- roleLeaderElectionAssetName = "trust-manager/resources/role_trust-manager:leaderelection.yml"
135- roleBindingLeaderElectionAssetName = "trust-manager/resources/rolebinding_trust-manager:leaderelection.yml"
136-
137- issuerAssetName = "trust-manager/resources/issuer_trust-manager.yml"
138- certificateAssetName = "trust-manager/resources/certificate_trust-manager.yml"
139-
140- validatingWebhookConfigAssetName = "trust-manager/resources/validatingwebhookconfiguration_trust-manager.yml"
14164)
0 commit comments