Skip to content

Commit fc61518

Browse files
authored
fix: only restart composer in case of > 0 exit code (#38)
1 parent 4f0d65e commit fc61518

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

internal/controllers/supergraphschema_controller.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,7 @@ func (r *SuperGraphSchemaReconciler) createReconciler(ctx context.Context, schem
548548
template.Annotations["apollo-controller/spec-version"] = fmt.Sprintf("%d", schema.Generation)
549549
template.Annotations["apollo-controller/subgraphs-checksum"] = checksum
550550

551+
restartPolicy := corev1.ContainerRestartPolicyOnFailure
551552
containers := []corev1.Container{
552553
{
553554
Name: "supergraph-composer",
@@ -556,7 +557,8 @@ func (r *SuperGraphSchemaReconciler) createReconciler(ctx context.Context, schem
556557
"-c",
557558
"supergraph compose /supergraph/supergraph.yaml > /output/schema.graphql",
558559
},
559-
Image: r.DefaultSuperGraphImage,
560+
RestartPolicy: &restartPolicy,
561+
Image: r.DefaultSuperGraphImage,
560562
VolumeMounts: []corev1.VolumeMount{
561563
{
562564
Name: "supergraph-config",
@@ -587,6 +589,13 @@ func (r *SuperGraphSchemaReconciler) createReconciler(ctx context.Context, schem
587589
MountPath: "/output",
588590
},
589591
},
592+
Ports: []corev1.ContainerPort{
593+
{
594+
Name: "http",
595+
ContainerPort: 29000,
596+
Protocol: corev1.ProtocolTCP,
597+
},
598+
},
590599
},
591600
}
592601

0 commit comments

Comments
 (0)