lando / mssql

The Official MSSQL Lando Plugin
https://docs.lando.dev/mssql
GNU General Public License v3.0
0 stars 3 forks source link

Recent MSSQL changes cause healthcheck to fail #36

Closed sdunham closed 3 weeks ago

sdunham commented 2 months ago

Lando version: v3.21.2 Lando mssql plugin version: 1.2.0

I'd open a PR for these updates, but I'm not 100% sure what the best way to address the first one is, so I figured I'd start with an issue.

  1. Recent updates to MSSQL have changed the path of the sqlcmd bin. Instead of being available at /opt/mssql-tools/bin, it's now available at /opt/mssql-tools18/bin. I'm unsure if it makes sense to just replace that path in the service's path config or include both for backward compatibility.
  2. They also recently added a new option to sqlcmd for setting the encryption mode. It's set to mandatory by default, which throws an error because of the use of a self-signed cert.

Here's a reduced test case which illustrates the first issue:

name: mssql-test
services:
  myservice:
    type: mssql

This one fixes the first issue via an override of the path config data and shows the second:

name: mssql-test
services:
  myservice:
    type: mssql
    path:
      - '/usr/local/sbin'
      - '/usr/local/bin'
      - '/usr/sbin'
      - '/usr/bin'
      - '/sbin'
      - '/bin'
      - '/opt/mssql-tools18/bin'

And this one addresses both issues:

name: mssql-test
services:
  myservice:
    type: mssql
    healthcheck: "sqlcmd -U sa -H myservice -P he11oTHERE -Q quit -N o"
    path:
      - '/usr/local/sbin'
      - '/usr/local/bin'
      - '/usr/sbin'
      - '/usr/bin'
      - '/sbin'
      - '/bin'
      - '/opt/mssql-tools18/bin'
AaronFeledy commented 2 months ago

Thanks for digging into this. I'd say include both in path because users can specify older images and we want those to work too.