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

Remove netgo tag to fix Windows hosts file bug #121

Merged
merged 1 commit into from
Apr 18, 2023
Merged

Conversation

szh
Copy link
Contributor

@szh szh commented Apr 3, 2023

Desired Outcome

Conjur CLI should use Windows hosts file when present.

Implemented Changes

netgo has a bug that prevents it from using the machine's hosts file on Windows. See golang/go#57757.
This PR disables the netgo build flag. It can be reenabled once the above issue is fixed.

Connected Issue/Story

CyberArk internal issue ID: CNJR-904

Changelog

  • The CHANGELOG has been updated, or
  • This PR does not include user-facing changes and doesn't require a
    CHANGELOG update

Test coverage

  • This PR includes new unit and integration tests to go with the code
    changes, or
  • The changes in this PR do not require tests

Documentation

  • Docs (e.g. READMEs) were updated in this PR
  • A follow-up issue to update official docs has been filed here: [insert issue ID]
  • This PR does not require updating any documentation

Behavior

  • This PR changes product behavior and has been reviewed by a PO, or
  • These changes are part of a larger initiative that will be reviewed later, or
  • No behavior was changed with this PR

Security

  • Security architect has reviewed the changes in this PR,
  • These changes are part of a larger initiative with a separate security review, or
  • There are no security aspects to these changes

@szh szh self-assigned this Apr 3, 2023
@szh szh force-pushed the windows-hostsfile branch from 9928722 to 1d32a8c Compare April 3, 2023 19:02
@szh szh added the kind/bug label Apr 3, 2023
@szh szh marked this pull request as ready for review April 3, 2023 19:03
@szh szh requested a review from a team as a code owner April 3, 2023 19:03
@szh
Copy link
Contributor Author

szh commented Apr 4, 2023

CI is failing due to issue that will be fixed when #120 is merged

@szh szh force-pushed the windows-hostsfile branch from 1d32a8c to e3f14ed Compare April 4, 2023 20:04
.goreleaser.yml Outdated
flags:
- -tags=netgo
# - -tags=netgo
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# - -tags=netgo
- -tags={{ if not eq .Os "windows" }}netgo{{ end }}

Let's apply this exclusion only to Windows

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure if this template string is the exact thing we want but something to this effect

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got it working with slightly different syntax - ne instead of not eq

@szh szh force-pushed the windows-hostsfile branch 2 times, most recently from 3bd053d to 8927adc Compare April 17, 2023 14:13
@szh szh requested a review from doodlesbykumbi April 18, 2023 13:19
@szh szh force-pushed the windows-hostsfile branch 2 times, most recently from c6fb44a to 63771ad Compare April 18, 2023 13:23
@szh szh force-pushed the windows-hostsfile branch from 63771ad to 28451db Compare April 18, 2023 13:24
@codeclimate
Copy link

codeclimate bot commented Apr 18, 2023

Code Climate has analyzed commit 28451db and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (50% is the threshold).

This pull request will bring the total coverage in the repository to 81.4% (0.0% change).

View more on Code Climate.

@szh szh merged commit 6e14e68 into master Apr 18, 2023
@szh szh deleted the windows-hostsfile branch April 18, 2023 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants