Skip to content

Commit

Permalink
Merge pull request #3239 from twz123/backport-3200-to-release-1.25
Browse files Browse the repository at this point in the history
[Backport release-1.25] go 1.19.10
  • Loading branch information
twz123 authored Jun 26, 2023
2 parents daeccef + 74179bb commit 32b44b0
Show file tree
Hide file tree
Showing 12 changed files with 50 additions and 22 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ on:
- main
- release-*
paths:
- docs/**
- mkdocs.yml
- embedded-bins/Makefile.variables
- docs/**

jobs:
build:
Expand All @@ -30,7 +31,7 @@ jobs:
- name: Install dependencies
run: |
# https://github.com/actions/setup-python/issues/521
# https://github.com/actions/python-versions/blob/3.10.5-2650229445/installers/nix-setup-template.sh#L53
# https://github.com/actions/python-versions/blob/3.10.9-3636985951/installers/nix-setup-template.sh#L53
pip install --disable-pip-version-check --require-hashes -r docs/requirements_pip.txt
pip --version
pip install --disable-pip-version-check --require-hashes -r docs/requirements.txt
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,11 @@ jobs:
- name: Make binaries executable
run: chmod +x ./k0s-*/k0s

- name: Fetch Alpine version to use
run: |
alpinePatchVersion="$(./vars.sh alpine_patch_version)"
echo "ALPINE_PATCH_VERSION=$alpinePatchVersion" >>"$GITHUB_ENV"
- name: Build image and push to Docker Hub and GitHub image registry
uses: docker/build-push-action@v3
with:
Expand All @@ -406,6 +411,8 @@ jobs:
tags: |
ghcr.io/k0sproject/k0s:${{ needs.release.outputs.image_tag }}
docker.io/k0sproject/k0s:${{ needs.release.outputs.image_tag }}
build-args: |
ALPINE_VERSION=${{ env.ALPINE_PATCH_VERSION }}
push: true

conformance-test:
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
ARG ARCH
FROM ${ARCH}alpine:3.16
ARG ALPINE_VERSION
FROM docker.io/library/${ARCH}alpine:$ALPINE_VERSION
ARG TARGETARCH

RUN apk add --no-cache bash coreutils findutils iptables curl tini
Expand Down
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ LD_FLAGS += -X github.com/containerd/containerd/version.Revision=$(shell ./embed
endif
LD_FLAGS += $(BUILD_GO_LDFLAGS_EXTRA)

GOLANG_IMAGE ?= golang:$(go_version)-alpine3.16
GOLANG_IMAGE ?= $(golang_buildimage)
K0S_GO_BUILD_CACHE_VOLUME_PATH=$(shell realpath $(K0S_GO_BUILD_CACHE))
GO_ENV ?= docker run --rm \
-v '$(K0S_GO_BUILD_CACHE_VOLUME_PATH)':/run/k0s-build \
Expand Down Expand Up @@ -234,7 +234,10 @@ airgap-image-bundle-linux-arm.tar: .k0sbuild.image-bundler.stamp airgap-images.t
}

.k0sbuild.image-bundler.stamp: hack/image-bundler/*
docker build -t k0sbuild.image-bundler hack/image-bundler
docker build \
--build-arg ALPINE_VERSION=$(alpine_patch_version) \
-t k0sbuild.image-bundler \
hack/image-bundler
touch -- '$@'

.PHONY: $(smoketests)
Expand Down
3 changes: 2 additions & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include ../embedded-bins/Makefile.variables
include Makefile.variables

ifeq ($(OS),Windows_NT)
Expand Down Expand Up @@ -75,7 +76,7 @@ cli:

.docker-image.serve-dev.stamp: Dockerfile.serve-dev requirements_pip.txt requirements.txt Makefile.variables
docker build \
--build-arg PYTHON_IMAGE_VERSION=$(python_version)-alpine3.16 \
--build-arg PYTHON_IMAGE_VERSION=$(python_version)-alpine$(alpine_version) \
-t 'k0sdocs$(basename $@)' -f '$<' .
touch -- '$@'

Expand Down
2 changes: 1 addition & 1 deletion docs/Makefile.variables
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
python_version = 3.10.5
python_version = 3.10.9

k0s_releases_url = https://api.github.com/repos/k0sproject/k0s/releases
20 changes: 10 additions & 10 deletions embedded-bins/Makefile.variables
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
alpine_version = 3.16
alpine_patch_version = $(alpine_version).3
alpine_version = 3.17
alpine_patch_version = $(alpine_version).4
golang_buildimage=docker.io/library/golang:$(go_version)-alpine$(alpine_version)
go_version = 1.19.9
go_version = 1.19.10

runc_version = 1.1.7
runc_buildimage = golang:$(go_version)-alpine3.16
runc_buildimage = $(golang_buildimage)
runc_build_go_tags = "seccomp"
#runc_build_go_cgo_enabled =
#runc_build_go_cgo_cflags =
Expand All @@ -13,7 +13,7 @@ runc_build_go_tags = "seccomp"
runc_build_go_ldflags_extra = "-w -s -extldflags=-static"

containerd_version = 1.6.21
containerd_buildimage = golang:$(go_version)-alpine3.16
containerd_buildimage = $(golang_buildimage)
containerd_build_go_tags = "apparmor,selinux"
containerd_build_shim_go_cgo_enabled = 0
#containerd_build_go_cgo_enabled =
Expand All @@ -23,7 +23,7 @@ containerd_build_shim_go_cgo_enabled = 0
containerd_build_go_ldflags_extra = "-w -s -extldflags=-static"

kubernetes_version = 1.25.11
kubernetes_buildimage = golang:$(go_version)-alpine3.16
kubernetes_buildimage = $(golang_buildimage)
kubernetes_build_go_tags = "providerless"
#kubernetes_build_go_cgo_enabled =
#kubernetes_build_go_cgo_cflags =
Expand All @@ -32,7 +32,7 @@ kubernetes_build_go_flags = "-v"
kubernetes_build_go_ldflags_extra = "-w -s -extldflags=-static"

kine_version = 0.9.9
kine_buildimage = golang:$(go_version)-alpine3.16
kine_buildimage = $(golang_buildimage)
#kine_build_go_tags =
#kine_build_go_cgo_enabled =
kine_build_go_cgo_cflags = "-DSQLITE_ENABLE_DBSTAT_VTAB=1 -DSQLITE_USE_ALLOCA=1" # Flags taken from https://github.com/k3s-io/kine/blob/v0.9.9/scripts/build#L22
Expand All @@ -41,15 +41,15 @@ kine_build_go_ldflags = "-w -s"
kine_build_go_ldflags_extra = "-extldflags=-static"

etcd_version = 3.5.9
etcd_buildimage = golang:$(go_version)-alpine3.16
etcd_buildimage = $(golang_buildimage)
#etcd_build_go_tags =
etcd_build_go_cgo_enabled = 0
#etcd_build_go_cgo_cflags =
#etcd_build_go_flags =
etcd_build_go_ldflags = "-w -s"
#etcd_build_go_ldflags_extra =

konnectivity_buildimage = golang:$(go_version)-alpine3.16
konnectivity_buildimage = $(golang_buildimage)
konnectivity_version = 0.0.32-k0s1
#konnectivity_build_go_tags =
konnectivity_build_go_cgo_enabled = 0
Expand All @@ -59,4 +59,4 @@ konnectivity_build_go_ldflags = "-w -s"
konnectivity_build_go_ldflags_extra = "-extldflags=-static"

iptables_version = 1.8.7
iptables_buildimage = alpine:3.16
iptables_buildimage = docker.io/library/alpine:$(alpine_patch_version)
3 changes: 2 additions & 1 deletion hack/image-bundler/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM alpine:3.16
ARG ALPINE_VERSION
FROM docker.io/library/alpine:$ALPINE_VERSION

RUN apk add containerd
COPY bundler.sh /
Expand Down
1 change: 1 addition & 0 deletions inttest/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ bin/sonobuoy: | bin

.footloose-alpine.stamp: footloose-alpine/Dockerfile $(shell find footloose-alpine/root -type f)
docker build \
--build-arg ALPINE_VERSION=$(alpine_patch_version) \
--build-arg ETCD_ARCH=$(etcd_arch) \
--build-arg ETCD_VERSION=$(etcd_version) \
--build-arg KUBE_VERSION=$(kubernetes_version) \
Expand Down
15 changes: 14 additions & 1 deletion inttest/calico/calico_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@ package calico
import (
"context"
"fmt"
"os/exec"
"path/filepath"
"strings"
"testing"

"github.com/stretchr/testify/require"
"github.com/stretchr/testify/suite"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down Expand Up @@ -85,7 +88,7 @@ func (s *CalicoSuite) TestK0sGetsUp() {
Spec: corev1.PodSpec{
Containers: []corev1.Container{{
Name: "alpine",
Image: "alpine:3.16",
Image: "docker.io/library/alpine:" + getAlpineVersion(s.T()),
Command: []string{"sleep", "infinity"},
}},
NodeSelector: map[string]string{
Expand All @@ -101,6 +104,16 @@ func (s *CalicoSuite) TestK0sGetsUp() {
s.Require().True(strings.Contains(out, "Welcome to nginx"))
}

func getAlpineVersion(t *testing.T) string {
cmd := exec.Command("."+string(filepath.Separator)+"vars.sh", "alpine_version")
cmd.Dir = filepath.Join("..", "..")
out, err := cmd.Output()
require.NoError(t, err)
version, _, _ := strings.Cut(string(out), "\n")
require.NotEmpty(t, version, "Failed to get Alpine version")
return version
}

func TestCalicoSuite(t *testing.T) {
s := CalicoSuite{
common.FootlooseSuite{
Expand Down
5 changes: 3 additions & 2 deletions inttest/footloose-alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM alpine:3.16
ARG ALPINE_VERSION
FROM docker.io/library/alpine:$ALPINE_VERSION

ARG ETCD_ARCH
ARG ETCD_VERSION
Expand All @@ -7,7 +8,7 @@ ARG KUBE_VERSION
# Apply our changes to the image
COPY root/ /

RUN apk add openrc openssh-server bash busybox-initscripts coreutils curl haproxy nginx inotify-tools
RUN apk add openrc openssh-server bash busybox-openrc coreutils curl haproxy nginx inotify-tools
# enable syslog and sshd
RUN rc-update add cgroups boot
RUN rc-update add syslog boot
Expand Down
1 change: 0 additions & 1 deletion inttest/footloose-alpine/root/etc/nginx/conf.d

This file was deleted.

0 comments on commit 32b44b0

Please sign in to comment.