Skip to content

Commit

Permalink
fix init secret.
Browse files Browse the repository at this point in the history
  • Loading branch information
lingdie committed Nov 7, 2024
1 parent 5bff8e1 commit f8ad450
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions controllers/devbox/internal/controller/devbox_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,14 @@ func (r *DevboxReconciler) syncSecret(ctx context.Context, devbox *devboxv1alpha
return fmt.Errorf("failed to update secret: %w", err)
}
}

if _, ok := devboxSecret.Data["SEALOS_DEVBOX_AUTHORIZED_KEYS"]; !ok {
devboxSecret.Data["SEALOS_DEVBOX_AUTHORIZED_KEYS"] = devboxSecret.Data["SEALOS_DEVBOX_PUBLIC_KEY"]
if err := r.Update(ctx, devboxSecret); err != nil {
return fmt.Errorf("failed to update secret: %w", err)
}
}

return nil
}
if client.IgnoreNotFound(err) != nil {
Expand Down

0 comments on commit f8ad450

Please sign in to comment.