feat: deploy caddy service when initialising new cluster on remote machine

This commit is contained in:
Pavel Sviderski
2025-02-18 18:38:38 +10:00
parent 98e1bdc9b5
commit c3b88077ac
4 changed files with 68 additions and 20 deletions
+1
View File
@@ -32,6 +32,7 @@ func (cli *Client) NewCaddyDeployment(image string, filter MachineFilter) (*Depl
image = reference.FamiliarString(latest)
}
// TODO: set restart policy to always. https://github.com/psviderski/uncloud/issues/26
spec := api.ServiceSpec{
Container: api.ContainerSpec{
Command: []string{"caddy", "run", "-c", "/config/caddy.json", "--watch"},
+1 -1
View File
@@ -129,7 +129,7 @@ func (d *Deployment) Validate(ctx context.Context) error {
func (d *Deployment) Run(ctx context.Context) (string, error) {
plan, err := d.Plan(ctx)
if err != nil {
return "", fmt.Errorf("plan: %w", err)
return "", fmt.Errorf("create plan: %w", err)
}
return plan.ServiceID, plan.Execute(ctx, d.cli)