Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows: Run 'crc daemon' as task for 'crc setup' #3088

Merged
merged 6 commits into from Mar 31, 2022

Commits on Mar 30, 2022

  1. Windows: Run 'crc daemon' as task for 'crc setup'

    This PR is uses windows powershell to create `crc daemon` as task
    and start it on demand for the current user. This doesn't need any
    elevated privillages to run `crc daemon` for user context. It try to
    perform following tasks
    - Check if there is already crcDaemon task
        + If present does it the latest one using version info
    - Install the task using predefined xml definition
    - Start the task which run the `crc daemon` in background.
    
    There is a known issue with windows powershell when you start a task
    in background using `powershell.exe` then for a second the windows pops
    up and disappear, PowerShell/PowerShell#3028
    have more details around it but as of now this is only the way for
    interactive user context otherwise the task will need the admin
    privillages which we want to avoid.
    praveenkumar committed Mar 30, 2022
    Configuration menu
    Copy the full SHA
    a6d3cc2 View commit details
    Browse the repository at this point in the history
  2. Windows: Add check if admin helper service is running

    Admin helper service is created and started when installer is used.
    Some of the issue we are getting is user directly try to use crc
    from command line and see if the openshift routes are mapped in hosts
    file. This PR is help to detect if the service is running and it doesn't
    need any privilage permission but it doesn't create or start this
    service because that need administrator privilages.
    praveenkumar committed Mar 30, 2022
    Configuration menu
    Copy the full SHA
    99c0c08 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    7be921d View commit details
    Browse the repository at this point in the history

Commits on Mar 31, 2022

  1. Windows Installer: Remove crc daemon task during uninstall

    This PR will remove the crc daemon schedule task during the
    uninstallation, as of now even with this PR when the task is running
    and user try to uninstall then uninstaller warn user that `crc` binary
    in used and user have option to forceful stop it and carry on or go
    to task manager and kill it manually.
    praveenkumar committed Mar 31, 2022
    Configuration menu
    Copy the full SHA
    70e5e28 View commit details
    Browse the repository at this point in the history
  2. Daemon: Remove preflight check from daemon command

    This PR remove preflight checks for daemon command because daemon can
    run independent of a crc setup. the actual check happens when you
    perform a `crc start`. Since those tests run as part of crc daemon which
    takes around 5-6 sec so initial api response become block for 5-6 sec.
    praveenkumar committed Mar 31, 2022
    Configuration menu
    Copy the full SHA
    4582375 View commit details
    Browse the repository at this point in the history
  3. Windows: Check if daemon process is already running

    Without this PR following scenario happen
    - User installed the crc first time and do the setup
    - As part of the setup crc daemon is started by task schedular
    - User reboot
    - Tray autostart with reboot but `crc setup --check-only` fails
    because daemon task is not running.
    
    With this PR, check for daemon task running should first validate
    if an existing process of `crc daemon` is running and the version
    it get from the api should be same as the binary then task running
    check succeed. So this PR will makes `crc setup --check-only` work
    again with tray autostart.
    praveenkumar committed Mar 31, 2022
    Configuration menu
    Copy the full SHA
    aa49011 View commit details
    Browse the repository at this point in the history