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

feat: replace github.com/denisenkom/go-mssqldb with github.com/microsoft/go-mssqldb #13524

Merged
merged 3 commits into from
Jul 7, 2023

Conversation

powersj
Copy link
Contributor

@powersj powersj commented Jun 30, 2023

fixes: #12745

@telegraf-tiger telegraf-tiger bot added the feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin label Jun 30, 2023
@powersj
Copy link
Contributor Author

powersj commented Jun 30, 2023

@minwal, @AsafMah,

I need some help ensuring this PR does not regress you or our users of the azure data explorer output. This PR updates the go-mssqldb from github.com/denisenkom/go-mssqldb to github.com/microsoft/go-mssqldb.

Most of the changes are drop in except the following commit to azure data explorer output: 00cb07e

There are two changes I am concerned about:

  1. The way we login. I did not see a drop in replacement for NewAuthorizerFromEnvironmentWithResource. The WithDefaultAzureCredential does state that it looks at "The order of auth will be via environment variables, managed identity and Azure CLI." Which I think aligns with the current behavior.
  2. The create table and table mappings, kuso.NewStmt is deprecated and replaced with kql.New(). I was not sure if my updates are enough given I am missing the suppress warnings statement that was previously there.

Can either of you try this out or verify that I have made the correct changes?

@soccypowa,

Since you were also interested in the replacement of the go-msssqldb dependency, can you give this a shot to verify your kerberos support works?

Thanks!

@soccypowa
Copy link
Contributor

soccypowa commented Jul 3, 2023

@powersj

I made a build of your branch and took it for a spin. For some reason though I got only NTLM auth in my test environment, realised that I get the same behaviour with my own updated "ugly build" go-mssqldb v1.3.0, while my old one, made in the excact same way with go-mssqldb v0.17.1-0.20221011173445-537893aca440 just works. I tried to do a fast "read up" on wether MSFT changed some behaviour or not, I mean they have changed default settings in many of their other drivers so why not this one. Have not found any such indications, but if my working schedule allows me I will look into this, in any case out of curiosity. Nice work getting the change in place though!

Update:
Ok, seemingly it is isolated to one of my hosts, the others get Kerberos as expected. So in other words this looks great!

@powersj powersj marked this pull request as ready for review July 7, 2023 15:48
@powersj powersj added the ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. label Jul 7, 2023
Copy link
Contributor

@srebhan srebhan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. We should try to remove the go.mod replacement as soon as possible IMO...

go.mod Outdated
@@ -484,3 +484,5 @@ require (
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)

replace github.com/microsoft/go-mssqldb v1.3.0 => github.com/powersj/go-mssqldb v1.3.0-fix2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any PR we can watch to remove this replacement ASAP?

@srebhan srebhan assigned powersj and unassigned srebhan Jul 7, 2023
@srebhan
Copy link
Contributor

srebhan commented Jul 7, 2023

@powersj giving this back to you in case you want to wait for the upstream PR to be merged...

@powersj
Copy link
Contributor Author

powersj commented Jul 7, 2023

@srebhan Upstream PR is merged, thanks for catching the replace was still there. I've updated the go.mod to use the latest commit and removed the replace.

@telegraf-tiger
Copy link
Contributor

telegraf-tiger bot commented Jul 7, 2023

Download PR build artifacts for linux_amd64.tar.gz, darwin_amd64.tar.gz, and windows_amd64.zip.
Downloads for additional architectures and packages are available below.

⚠️ This pull request increases the Telegraf binary size by 3.37 % for linux amd64 (new size: 193.7 MB, nightly size 187.4 MB)

📦 Click here to get additional PR build artifacts

Artifact URLs

DEB RPM TAR GZ ZIP
amd64.deb aarch64.rpm darwin_amd64.tar.gz windows_amd64.zip
arm64.deb armel.rpm darwin_arm64.tar.gz windows_arm64.zip
armel.deb armv6hl.rpm freebsd_amd64.tar.gz windows_i386.zip
armhf.deb i386.rpm freebsd_armv7.tar.gz
i386.deb ppc64le.rpm freebsd_i386.tar.gz
mips.deb riscv64.rpm linux_amd64.tar.gz
mipsel.deb s390x.rpm linux_arm64.tar.gz
ppc64el.deb x86_64.rpm linux_armel.tar.gz
riscv64.deb linux_armhf.tar.gz
s390x.deb linux_i386.tar.gz
linux_mips.tar.gz
linux_mipsel.tar.gz
linux_ppc64le.tar.gz
linux_riscv64.tar.gz
linux_s390x.tar.gz

@powersj powersj merged commit c050c01 into influxdata:master Jul 7, 2023
24 checks passed
@powersj powersj deleted the fix/12745 branch July 7, 2023 17:01
@srebhan srebhan added this to the v1.28.0 milestone Jul 10, 2023
powersj added a commit that referenced this pull request Jul 10, 2023
@srebhan srebhan modified the milestones: v1.28.0, v1.27.2 Jul 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrade mssql/sqlserver plugins from denisenkom/go-mssqldb to microsoft/go-mssqldb
3 participants