From aaa48b5909b8245b4c779b148e55e9a7af672136 Mon Sep 17 00:00:00 2001 From: Jacob Payne Date: Thu, 18 Aug 2022 16:16:15 -0700 Subject: [PATCH] fixed arch builds and k3s not starting on openrc --- .github/workflows/publish.yaml | 7 ++----- .github/workflows/pull_request.yaml | 5 +---- Earthfile | 16 ++++++++++++---- main.go | 1 + 4 files changed, 16 insertions(+), 13 deletions(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 1f20d33..fe5847c 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -20,9 +20,6 @@ jobs: - v1.23.9+k3s1 - v1.22.11+k3s2 - v1.21.14+k3s1 - platform: - - linux/amd64 - - linux/arm64 env: REGISTRY: quay.io REGISTRY_USER: ${{ secrets.QUAY_USERNAME }} @@ -36,6 +33,6 @@ jobs: - run: echo $REGISTRY_PASSWORD | docker login -u $REGISTRY_USER --password-stdin $REGISTRY - run: env | grep ACTIONS_ID_TOKEN_REQUEST > .env - run: env | grep REGISTRY >> .env - - run: earthly --ci --push --platform=${{ matrix.platform }} +docker --K3S_VERSION=${{ matrix.k3s-version }} --BASE_IMAGE=${{ matrix.base-image }} - - run: earthly --ci +cosign --K3S_VERSION=${{ matrix.k3s-version }} --BASE_IMAGE=${{ matrix.base-image }} + - run: earthly --ci --push +docker-all-platforms --K3S_VERSION=${{ matrix.k3s-version }} --BASE_IMAGE=${{ matrix.base-image }} + - run: earthly --ci +cosign-all-platforms --K3S_VERSION=${{ matrix.k3s-version }} --BASE_IMAGE=${{ matrix.base-image }} diff --git a/.github/workflows/pull_request.yaml b/.github/workflows/pull_request.yaml index 9ed684d..5f4d95d 100644 --- a/.github/workflows/pull_request.yaml +++ b/.github/workflows/pull_request.yaml @@ -33,13 +33,10 @@ jobs: - v1.23.9+k3s1 - v1.22.11+k3s2 - v1.21.14+k3s1 - platform: - - linux/amd64 - - linux/arm64 steps: - uses: actions/checkout@v2 - uses: docker-practice/actions-setup-docker@master - uses: earthly/actions-setup@v1 with: version: "latest" - - run: earthly --ci --platform=${{ matrix.platform }} +docker --K3S_VERSION=${{ matrix.k3s-version }} --BASE_IMAGE=${{ matrix.base-image }} \ No newline at end of file + - run: earthly --ci +docker-all-platforms --K3S_VERSION=${{ matrix.k3s-version }} --BASE_IMAGE=${{ matrix.base-image }} diff --git a/Earthfile b/Earthfile index 058f38a..186b46b 100644 --- a/Earthfile +++ b/Earthfile @@ -49,10 +49,6 @@ VERSION: SAVE ARTIFACT VERSION VERSION -build-provider: - FROM +go-deps - DO +BUILD_GOLANG --BIN=agent-provider-k3s --SRC=main.go - lint: FROM golang:$GOLANG_VERSION RUN wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s $GOLINT_VERSION @@ -60,6 +56,10 @@ lint: COPY . . RUN golangci-lint run +build-provider: + FROM +go-deps + DO +BUILD_GOLANG --BIN=agent-provider-k3s --SRC=main.go + docker: DO +VERSION ARG VERSION=$(cat VERSION) @@ -118,3 +118,11 @@ cosign: RUN cosign sign $IMAGE_REPOSITORY/${BASE_IMAGE_NAME}-k3s:${BASE_IMAGE_TAG} RUN cosign sign $IMAGE_REPOSITORY/${BASE_IMAGE_NAME}-k3s:${BASE_IMAGE_TAG}_${K3S_VERSION_TAG} RUN cosign sign $IMAGE_REPOSITORY/${BASE_IMAGE_NAME}-k3s:${BASE_IMAGE_TAG}_${K3S_VERSION_TAG}_${VERSION} + +docker-all-platforms: + BUILD --platform=linux/amd64 +docker + BUILD --platform=linux/arm64 +docker + +cosign-all-platforms: + BUILD --platform=linux/amd64 +cosign + BUILD --platform=linux/arm64 +cosign diff --git a/main.go b/main.go index a3627af..983c2f6 100644 --- a/main.go +++ b/main.go @@ -83,6 +83,7 @@ func clusterProvider(cluster clusterplugin.Cluster) yip.YipConfig { If: "[ -x /sbin/openrc-run ]", Commands: []string{ fmt.Sprintf("rc-update add %s default >/dev/null", systemName), + fmt.Sprintf("service %s start", systemName), }, }, {