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

[release-1.27] Use go with alpine 3.18 (#3351) #3384

Merged
merged 1 commit into from
Aug 17, 2023

Conversation

ncopa
Copy link
Collaborator

@ncopa ncopa commented Aug 15, 2023

Description

Fixes #3351

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

How Has This Been Tested?

  • Manual test
  • Auto test added

Checklist:

  • My code follows the style guidelines of this project
  • My commit messages are signed-off
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

The 3.18 includes a fix for a bug in musl libc when there is a
`search .` in /etc/resolv.conf.

Fixes: k0sproject#3351
Ref: https://www.openwall.com/lists/musl/2022/08/31/5

Signed-off-by: Natanael Copa <[email protected]>
@ncopa ncopa requested a review from a team as a code owner August 15, 2023 15:11
@@ -1,6 +1,6 @@
alpine_version = 3.17
alpine_patch_version = $(alpine_version).4
golang_buildimage=docker.io/library/golang:$(go_version)-alpine$(alpine_version)
golang_buildimage=docker.io/library/golang:$(go_version)-alpine3.18
Copy link
Member

Choose a reason for hiding this comment

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

Why only on build image, why not on the general alpine version on line 1?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The problem only affects go compiler. We link statically with CGO_ENABLED=1.

We use alpine 3.17 other places and I thought it would be good to be conservative and continue with that for the stable branch.

Copy link
Member

Choose a reason for hiding this comment

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

Another option to fix this is to explicitly request netgo, like this:

diff --git a/Makefile b/Makefile
index abc282d32..c7c7d9457 100644
--- a/Makefile
+++ b/Makefile
@@ -30,7 +30,7 @@ EMBEDDED_BINS_BUILDMODE ?= docker
 TARGET_OS ?= linux
 BUILD_UID ?= $(shell id -u)
 BUILD_GID ?= $(shell id -g)
-BUILD_GO_FLAGS := -tags osusergo
+BUILD_GO_FLAGS := -tags netgo,osusergo
 BUILD_GO_LDFLAGS_EXTRA :=
 DEBUG ?= false
 

@ncopa ncopa merged commit 0e2035d into k0sproject:release-1.27 Aug 17, 2023
70 checks passed
@ncopa ncopa deleted the go-alpine-3.18 branch August 17, 2023 12:33
@twz123
Copy link
Member

twz123 commented Jan 10, 2024

Backporting to release-1.26 for #3912.

@twz123 twz123 added bug Something isn't working backport/release-1.26 PR that needs to be backported/cherrypicked to release-1.26 branch labels Jan 10, 2024
@k0s-bot
Copy link

k0s-bot commented Jan 10, 2024

Backport failed for release-1.26, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally.

git fetch origin release-1.26
git worktree add -d .worktree/backport-3384-to-release-1.26 origin/release-1.26
cd .worktree/backport-3384-to-release-1.26
git checkout -b backport-3384-to-release-1.26
ancref=$(git merge-base da6987e9a1d3cf3c5f0b0707b479a00837d02972 1217281f787afed3e71abd1f6d554d043c27c453)
git cherry-pick -x $ancref..1217281f787afed3e71abd1f6d554d043c27c453

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/release-1.26 PR that needs to be backported/cherrypicked to release-1.26 branch bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants