feat: add an annotations everywhere to ensure folks know what is managed by dokku

This commit is contained in:
Jose Diaz-Gonzalez committed 2024-01-23 03:00:27 -05:00
1 parent dfa7d0f78c
commit 2911218816
1 file changed
+16 -5
+16 -5
View File
@@ -201,14 +201,15 @@ func printResource(input PrintInput) error {
func templateKubernetesDeployment(input Deployment) (appsv1.Deployment, error) { func templateKubernetesDeployment(input Deployment) (appsv1.Deployment, error) {
labels := map[string]string{ labels := map[string]string{
"dokku.com/app-name": input.AppName, "dokku.com/app-name": input.AppName,
"dokku.com/process-type": input.ProcessType,
"dokku.com/app-process-type": fmt.Sprintf("%s-%s", input.AppName, input.ProcessType), "dokku.com/app-process-type": fmt.Sprintf("%s-%s", input.AppName, input.ProcessType),
"dokku.com/process-type": input.ProcessType,
} }
annotations := map[string]string{ annotations := map[string]string{
"dokku.com/app-name": input.AppName, "dokku.com/app-name": input.AppName,
"dokku.com/deployment-id": "DEPLOYMENT_ID_QUOTED",
"dokku.com/process-type": input.ProcessType,
"dokku.com/builder-type": input.ImageSourceType, "dokku.com/builder-type": input.ImageSourceType,
"dokku.com/deployment-id": "DEPLOYMENT_ID_QUOTED",
"dokku.com/managed": "true",
"dokku.com/process-type": input.ProcessType,
} }
secretName := fmt.Sprintf("env-%s.DEPLOYMENT_ID", input.AppName) secretName := fmt.Sprintf("env-%s.DEPLOYMENT_ID", input.AppName)
@@ -347,8 +348,12 @@ func templateKubernetesIngressRoute(input IngressRoute) traefikv1alpha1.IngressR
Namespace: input.Namespace, Namespace: input.Namespace,
Labels: map[string]string{ Labels: map[string]string{
"dokku.com/app-name": input.AppName, "dokku.com/app-name": input.AppName,
"dokku.com/app-process-type": fmt.Sprintf("%s-%s", input.AppName, input.ProcessType),
"dokku.com/process-type": input.ProcessType, "dokku.com/process-type": input.ProcessType,
}, },
Annotations: map[string]string{
"dokku.com/managed": "true",
},
}, },
Spec: traefikv1alpha1.IngressRouteSpec{ Spec: traefikv1alpha1.IngressRouteSpec{
EntryPoints: []string{string(entryPoint)}, EntryPoints: []string{string(entryPoint)},
@@ -389,6 +394,9 @@ func templateKubernetesSecret(input Secret) corev1.Secret {
"dokku.com/app-name": input.AppName, "dokku.com/app-name": input.AppName,
"dokku.com/deployment-id": "DEPLOYMENT_ID_QUOTED", "dokku.com/deployment-id": "DEPLOYMENT_ID_QUOTED",
}, },
Annotations: map[string]string{
"dokku.com/managed": "true",
},
}, },
Data: map[string][]byte{}, Data: map[string][]byte{},
} }
@@ -403,15 +411,18 @@ func templateKubernetesService(input Service) corev1.Service {
Namespace: input.Namespace, Namespace: input.Namespace,
Labels: map[string]string{ Labels: map[string]string{
"dokku.com/app-name": input.AppName, "dokku.com/app-name": input.AppName,
"dokku.com/process-type": "web",
"dokku.com/app-process-type": fmt.Sprintf("%s-%s", input.AppName, "web"), "dokku.com/app-process-type": fmt.Sprintf("%s-%s", input.AppName, "web"),
"dokku.com/process-type": "web",
},
Annotations: map[string]string{
"dokku.com/managed": "true",
}, },
}, },
Spec: corev1.ServiceSpec{ Spec: corev1.ServiceSpec{
Selector: map[string]string{ Selector: map[string]string{
"dokku.com/app-name": input.AppName, "dokku.com/app-name": input.AppName,
"dokku.com/process-type": "web",
"dokku.com/app-process-type": fmt.Sprintf("%s-%s", input.AppName, "web"), "dokku.com/app-process-type": fmt.Sprintf("%s-%s", input.AppName, "web"),
"dokku.com/process-type": "web",
}, },
Ports: []corev1.ServicePort{ Ports: []corev1.ServicePort{
{ {