From c7c7109e41f4542fb6f242c57b597b8fb3103b11 Mon Sep 17 00:00:00 2001 From: Curt Bushko Date: Fri, 26 Aug 2022 12:06:31 -0400 Subject: [PATCH 1/4] Get CNI building with CRT Get CNI building with CRT --- .github/workflows/build.yml | 47 +++++++++++++++++++++++++++++++++++++ .release/ci.hcl | 2 +- control-plane/Dockerfile | 4 ++-- 3 files changed, 50 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f7ac1521ba..3db4536872 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,6 +8,7 @@ on: - main # Push events to branches matching refs/heads/release/** - "release/**" + - "curtbushko/add-cni-to-crt" env: PKG_NAME: "consul-k8s" @@ -90,6 +91,19 @@ jobs: - {go: "${{ needs.get-go-version.outputs.go-version }}", goos: "windows", goarch: "amd64", component: "control-plane", pkg_name: "consul-k8s-control-plane", "bin_name": "consul-k8s-control-plane.exe" } - {go: "${{ needs.get-go-version.outputs.go-version }}", goos: "darwin", goarch: "amd64", component: "control-plane", pkg_name: "consul-k8s-control-plane", "bin_name": "consul-k8s-control-plane" } - {go: "${{ needs.get-go-version.outputs.go-version }}", goos: "darwin", goarch: "arm64", component: "control-plane", pkg_name: "consul-k8s-control-plane", "bin_name": "consul-k8s-control-plane" } + # consul-cni + - {go: "${{ needs.get-go-version.outputs.go-version }}", goos: "freebsd", goarch: "386", component: "control-plane/cni", pkg_name: "consul-cni", "bin_name": "consul-cni" } + - {go: "${{ needs.get-go-version.outputs.go-version }}", goos: "freebsd", goarch: "amd64", component: "control-plane/cni", pkg_name: "consul-cni", "bin_name": "consul-cni" } + - {go: "${{ needs.get-go-version.outputs.go-version }}", goos: "linux", goarch: "386", component: "control-plane/cni", pkg_name: "consul-cni", "bin_name": "consul-cni" } + - {go: "${{ needs.get-go-version.outputs.go-version }}", goos: "linux", goarch: "amd64", component: "control-plane/cni", pkg_name: "consul-cni", "bin_name": "consul-cni" } + - {go: "${{ needs.get-go-version.outputs.go-version }}", goos: "linux", goarch: "arm", component: "control-plane/cni", pkg_name: "consul-cni", "bin_name": "consul-cni" } + - {go: "${{ needs.get-go-version.outputs.go-version }}", goos: "linux", goarch: "arm64", component: "control-plane/cni", pkg_name: "consul-cni", "bin_name": "consul-cni" } + - {go: "${{ needs.get-go-version.outputs.go-version }}", goos: "solaris", goarch: "amd64", component: "control-plane/cni", pkg_name: "consul-cni", "bin_name": "consul-cni" } + - {go: "${{ needs.get-go-version.outputs.go-version }}", goos: "windows", goarch: "386", component: "control-plane/cni", pkg_name: "consul-cni", "bin_name": "consul-cni.exe" } + - {go: "${{ needs.get-go-version.outputs.go-version }}", goos: "windows", goarch: "amd64", component: "control-plane/cni", pkg_name: "consul-cni", "bin_name": "consul-cni.exe" } + - {go: "${{ needs.get-go-version.outputs.go-version }}", goos: "darwin", goarch: "amd64", component: "control-plane/cni", pkg_name: "consul-cni", "bin_name": "consul-cni" } + - {go: "${{ needs.get-go-version.outputs.go-version }}", goos: "darwin", goarch: "arm64", component: "control-plane/cni", pkg_name: "consul-cni", "bin_name": "consul-cni" } + fail-fast: true name: Go ${{ matrix.go }} ${{ matrix.goos }} ${{ matrix.goarch }} ${{ matrix.component }} build @@ -207,6 +221,17 @@ jobs: version: ${{ needs.get-product-version.outputs.product-version }} steps: - uses: actions/checkout@v2 + - uses: actions/download-artifact@v3 + with: + name: consul-cni_${{ needs.get-product-version.outputs.product-version }}_linux_${{ matrix.arch }}.zip + path: control-plane/dist/cni/linux/${{ matrix.arch }} + - name: extract consul-cni zip + env: + ZIP_LOCATION: control-plane/dist/cni/linux/${{ matrix.arch }} + ZIP_NAME: consul-cni_${{ needs.get-product-version.outputs.product-version }}_linux_${{ matrix.arch }}.zip" + run: | + cd "${ZIP_LOCATION}" + unzip -j ${ZIP_NAME} - name: Docker Build (Action) uses: hashicorp/actions-docker-build@v1 with: @@ -241,6 +266,17 @@ jobs: version: ${{ needs.get-product-version.outputs.product-version }} steps: - uses: actions/checkout@v2 + - uses: actions/download-artifact@v3 + with: + name: consul-cni_${{ needs.get-product-version.outputs.product-version }}_linux_${{ matrix.arch }}.zip + path: control-plane/dist/cni/linux/${{ matrix.arch }} + - name: extract consul-cni zip + env: + ZIP_LOCATION: control-plane/dist/cni/linux/${{ matrix.arch }} + ZIP_NAME: consul-cni_${{ needs.get-product-version.outputs.product-version }}_linux_${{ matrix.arch }}.zip" + run: | + cd "${ZIP_LOCATION}" + unzip -j ${ZIP_NAME} - name: Copy LICENSE.md run: cp LICENSE.md ./control-plane @@ -273,6 +309,17 @@ jobs: version: ${{ needs.get-product-version.outputs.product-version }} steps: - uses: actions/checkout@v2 + - uses: actions/download-artifact@v3 + with: + name: consul-cni_${{ needs.get-product-version.outputs.product-version }}_linux_${{ matrix.arch }}.zip + path: control-plane/dist/cni/linux/${{ matrix.arch }} + - name: extract consul-cni zip + env: + ZIP_LOCATION: control-plane/dist/cni/linux/${{ matrix.arch }} + ZIP_NAME: consul-cni_${{ needs.get-product-version.outputs.product-version }}_linux_${{ matrix.arch }}.zip" + run: | + cd ${ZIP_LOCATION} + unzip -j ${ZIP_NAME} - name: Copy LICENSE.md run: cp LICENSE.md ./control-plane diff --git a/.release/ci.hcl b/.release/ci.hcl index 1506406aa4..e0e52a433b 100644 --- a/.release/ci.hcl +++ b/.release/ci.hcl @@ -8,7 +8,7 @@ project "consul-k8s" { github { organization = "hashicorp" repository = "consul-k8s" - release_branches = ["main"] + release_branches = ["curtbushko/add-cni-to-crt"] } } diff --git a/control-plane/Dockerfile b/control-plane/Dockerfile index 459b5f974d..802ec4fab2 100644 --- a/control-plane/Dockerfile +++ b/control-plane/Dockerfile @@ -95,7 +95,7 @@ RUN addgroup ${BIN_NAME} && \ adduser -S -G ${BIN_NAME} 100 COPY dist/${TARGETOS}/${TARGETARCH}/${BIN_NAME} /bin/ -COPY cni/dist/${TARGETOS}/${TARGETARCH}/${CNI_BIN_NAME} /bin/ +COPY dist/cni/${TARGETOS}/${TARGETARCH}/${CNI_BIN_NAME} /bin/ USER 100 CMD /bin/${BIN_NAME} @@ -156,7 +156,7 @@ RUN groupadd --gid 1000 ${BIN_NAME} && \ usermod -a -G root ${BIN_NAME} COPY dist/${TARGETOS}/${TARGETARCH}/${BIN_NAME} /bin/ -COPY cni/dist/${TARGETOS}/${TARGETARCH}/${CNI_BIN_NAME} /bin/ +COPY dist/cni/${TARGETOS}/${TARGETARCH}/${CNI_BIN_NAME} /bin/ USER 100 CMD /bin/${BIN_NAME} From ed465ad68201799fa48707cd86a8d0f3dd499239 Mon Sep 17 00:00:00 2001 From: Curt Bushko Date: Sat, 27 Aug 2022 18:35:47 -0400 Subject: [PATCH 2/4] revert back to main for releases --- .github/workflows/build.yml | 1 - .release/ci.hcl | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3db4536872..b678dde05a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,7 +8,6 @@ on: - main # Push events to branches matching refs/heads/release/** - "release/**" - - "curtbushko/add-cni-to-crt" env: PKG_NAME: "consul-k8s" diff --git a/.release/ci.hcl b/.release/ci.hcl index e0e52a433b..1506406aa4 100644 --- a/.release/ci.hcl +++ b/.release/ci.hcl @@ -8,7 +8,7 @@ project "consul-k8s" { github { organization = "hashicorp" repository = "consul-k8s" - release_branches = ["curtbushko/add-cni-to-crt"] + release_branches = ["main"] } } From c93d7bb9f178d313a334fc59e5baa23e1b6677e4 Mon Sep 17 00:00:00 2001 From: Curt Bushko Date: Sat, 27 Aug 2022 18:41:24 -0400 Subject: [PATCH 3/4] double check that this works --- .github/workflows/build.yml | 10 ++++------ .release/ci.hcl | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b678dde05a..79189bc57d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,6 +8,7 @@ on: - main # Push events to branches matching refs/heads/release/** - "release/**" + - "curtbushko/add-cni-to-crt" env: PKG_NAME: "consul-k8s" @@ -227,10 +228,9 @@ jobs: - name: extract consul-cni zip env: ZIP_LOCATION: control-plane/dist/cni/linux/${{ matrix.arch }} - ZIP_NAME: consul-cni_${{ needs.get-product-version.outputs.product-version }}_linux_${{ matrix.arch }}.zip" run: | cd "${ZIP_LOCATION}" - unzip -j ${ZIP_NAME} + unzip -j *.zip - name: Docker Build (Action) uses: hashicorp/actions-docker-build@v1 with: @@ -272,10 +272,9 @@ jobs: - name: extract consul-cni zip env: ZIP_LOCATION: control-plane/dist/cni/linux/${{ matrix.arch }} - ZIP_NAME: consul-cni_${{ needs.get-product-version.outputs.product-version }}_linux_${{ matrix.arch }}.zip" run: | cd "${ZIP_LOCATION}" - unzip -j ${ZIP_NAME} + unzip -j *.zip - name: Copy LICENSE.md run: cp LICENSE.md ./control-plane @@ -315,10 +314,9 @@ jobs: - name: extract consul-cni zip env: ZIP_LOCATION: control-plane/dist/cni/linux/${{ matrix.arch }} - ZIP_NAME: consul-cni_${{ needs.get-product-version.outputs.product-version }}_linux_${{ matrix.arch }}.zip" run: | cd ${ZIP_LOCATION} - unzip -j ${ZIP_NAME} + unzip -j *.zip - name: Copy LICENSE.md run: cp LICENSE.md ./control-plane diff --git a/.release/ci.hcl b/.release/ci.hcl index 1506406aa4..e0e52a433b 100644 --- a/.release/ci.hcl +++ b/.release/ci.hcl @@ -8,7 +8,7 @@ project "consul-k8s" { github { organization = "hashicorp" repository = "consul-k8s" - release_branches = ["main"] + release_branches = ["curtbushko/add-cni-to-crt"] } } From 6db156d85bf209ecb6862483a16ed093d59afc89 Mon Sep 17 00:00:00 2001 From: Curt Bushko Date: Mon, 29 Aug 2022 10:28:57 -0400 Subject: [PATCH 4/4] revert back to main as release branch --- .github/workflows/build.yml | 1 - .release/ci.hcl | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 79189bc57d..217741fa8a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,7 +8,6 @@ on: - main # Push events to branches matching refs/heads/release/** - "release/**" - - "curtbushko/add-cni-to-crt" env: PKG_NAME: "consul-k8s" diff --git a/.release/ci.hcl b/.release/ci.hcl index e0e52a433b..1506406aa4 100644 --- a/.release/ci.hcl +++ b/.release/ci.hcl @@ -8,7 +8,7 @@ project "consul-k8s" { github { organization = "hashicorp" repository = "consul-k8s" - release_branches = ["curtbushko/add-cni-to-crt"] + release_branches = ["main"] } }