-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: updates api, operator, and kubelet-metrics-reexporter
- Loading branch information
1 parent
35c5736
commit a429608
Showing
4 changed files
with
51 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,74 @@ | ||
name: build kubelet metrics reexporter | ||
|
||
on: | ||
workflow_call: | ||
|
||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
jobs: | ||
kubelet-metrics-reexporter: | ||
release: | ||
runs-on: ubuntu-latest | ||
name: kubelet-metrics-reexporter | ||
env: | ||
SUBMODULE: kubelet-metrics-reexporter | ||
|
||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: docker setup | ||
uses: nxtcoder17/actions/.github/actions/setup-docker@main | ||
with: | ||
submodules: recursive | ||
docker_username: ${{ github.actor }} | ||
docker_password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Setup Build Environment | ||
id: setup | ||
uses: ./.github/actions/setup/ | ||
- name: use nix flakes | ||
uses: nxtcoder17/actions/.github/actions/setup-nix-cachix@main | ||
working-directory: ./kubelet-metrics-reexporter | ||
with: | ||
github_token: "${{ secrets.GITHUB_TOKEN }}" | ||
flake_lock: ./flake.lock | ||
nix_develop_arguments: ".#default" | ||
|
||
enable_go: true | ||
go_mod_file: ${{ env.SUBMODULE }}/go.mod | ||
go_sum_file: ${{ env.SUBMODULE }}/go.sum | ||
go_build_cache_key: ${{env.SUBMODULE}} | ||
cachix_cache_name: "kloudlite" | ||
cachix_auth_token: ${{ secrets.CACHIX_AUTH_TOKEN }} | ||
|
||
enable_task: true | ||
enable_upx: true | ||
- name: go cache | ||
uses: nxtcoder17/actions/.github/actions/setup-cache-go@gh-actions/tricks | ||
working-directory: ./kubelet-metrics-reexporter | ||
with: | ||
cache_key: "kubelet-metrics-reexporter" | ||
|
||
enable_docker: true | ||
- name: generate image tag | ||
uses: nxtcoder17/actions/.github/actions/generate-image-tag@gh-actions/tricks | ||
|
||
- name: Build & Push Kubelet Metrics ReExporter | ||
- name: Building Binary | ||
working-directory: ./kubelet-metrics-reexporter | ||
env: | ||
IMAGE_TAG: ${{ steps.setup.outputs.image_tag }} | ||
OVERRIDE_PUSHED_IMAGE: ${{ steps.setup.outputs.override_pushed_image }} | ||
CGO_ENABLED: 0 | ||
run: | | ||
pushd $SUBMODULE | ||
task build out=kubelet-metrics-reexporter GOARCH=$(go env GOARCH) | ||
- name: Build And Push Image | ||
working-directory: ./kubelet-metrics-reexporter | ||
if: ${{ env.IMAGE_TAG != '' }} | ||
# if: startsWith(github.ref, 'refs/heads/release') || startsWith(github.ref, 'refs/tags/') | ||
run: |+ | ||
set +e | ||
image=ghcr.io/${{ github.repository }}/$SUBMODULE:$IMAGE_TAG | ||
echo "building image: $image" | ||
image_name="ghcr.io/${{ github.repository }}" | ||
docker manifest inspect $image | ||
docker manifest inspect $image_name:$IMAGE_TAG | ||
exit_status=$? | ||
if [ $exit_status -eq 0 ]; then | ||
[ "$OVERRIDE_PUSHED_IMAGE" = "false" ] && echo "image ($image) already exists, and override image is disable, exiting" && exit 0 | ||
[ "$OVERRIDE_PUSHED_IMAGE" = "false" ] && echo "image ($image_name:$IMAGE_TAG) already exists, and override image is disable, exiting" && exit 0 | ||
echo "image exists, but override pushed image is set to true. proceeding with building image" | ||
fi | ||
set -e | ||
task docker:build-n-push Image="$image" | ||
popd | ||
task container:build-and-push image="$image_name:$IMAGE_TAG" | ||
Submodule api
updated
7 files
Submodule kubelet-metrics-reexporter
updated
11 files
+0 −1 | .direnv/flake-profile | |
+0 −1 | .direnv/flake-profile-1-link | |
+21 −58 | .github/workflows/release.yml | |
+1 −0 | .gitignore | |
+3 −3 | Dockerfile | |
+24 −10 | Taskfile.yml | |
+6 −6 | flake.lock | |
+0 −3 | flake.nix | |
+2 −0 | internal/kloudlite/metric_labels.go | |
+1 −0 | internal/parser/parser_test.go | |
+1 −1 | main.go |
Submodule operator
updated
13 files