Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
with:
version: latest
- name: Delete pre-installed shellcheck
run: sudo rm -f $(which shellcheck)
run: sudo rm -f "$(which shellcheck)"
- name: Run shellcheck
run: make run-shellcheck
- name: Dependency Licenses Review
Expand Down
69 changes: 69 additions & 0 deletions .github/workflows/helm-oci-package-ghcr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
################################################################################
# This file is AUTOGENERATED with <https://github.com/sapcc/go-makefile-maker> #
# Edit Makefile.maker.yaml instead. #
################################################################################

# SPDX-FileCopyrightText: 2024 SAP SE or an SAP affiliate company
# SPDX-License-Identifier: Apache-2.0

name: Helm OCI Package GHCR
"on":
push:
branches:
- main
tags:
- '*'
workflow_dispatch: {}
permissions:
contents: read
packages: write
jobs:
build-and-push-helm-package:
name: Build and publish Helm Chart OCI
runs-on: large_runner_16core_64gb
steps:
- name: Check out code
uses: actions/checkout@v6
with:
fetch-depth: 0
fetch-tags: true
- name: Install Helm
uses: azure/setup-helm@v4
- name: Lint Helm Chart
run: helm lint charts/kvm-node-agent
- name: Package Helm Chart
run: |
# try to detect a version from the git tags, set APP_VERSION only if this commit has been tagged
APP_VERSION=$(git describe --tags --exact-match ${{ github.sha }} 2>/dev/null || echo "")
if [ -n "$APP_VERSION" ]; then
VERSION=$(echo -n "$APP_VERSION" | sed -E 's/^v//')
else
VERSION=$((git describe --tags --abbrev=0 2>/dev/null | sed -E 's/^v//') || echo "")
fi

# use the git sha as app-version, if no version could be detected from the tags
if [ -z "$APP_VERSION" ]; then
APP_VERSION=$(echo -n "sha-${{ github.sha }}")
fi
# use the git sha as helm version suffix, version is semver
if [ -z "$VERSION" ] && [ -n "$APP_VERSION" ]; then
VERSION="$(helm show chart charts/kvm-node-agent | grep -E "^version:" | awk '{print $2}' )+${APP_VERSION:0:11}"
fi

HELM_ARGS=--dependency-update
if [ -n "$APP_VERSION" ]; then
HELM_ARGS="$HELM_ARGS --app-version $APP_VERSION"
fi
if [ -n "$VERSION" ]; then
HELM_ARGS="$HELM_ARGS --version $VERSION"
fi
echo "Running helm package with $HELM_ARGS"
helm package charts/kvm-node-agent --destination ./chart $HELM_ARGS
- name: Log in to the Container registry
uses: docker/login-action@v4
with:
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
username: ${{ github.actor }}
- name: Push Helm Chart to ghcr.io
run: helm push ./chart/*.tgz oci://ghcr.io/${{ github.repository_owner }}/charts
48 changes: 0 additions & 48 deletions .github/workflows/publish-helm.yml

This file was deleted.

10 changes: 0 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,3 @@ repos:
entry: sh -c "gmake check || make check"
language: system
pass_filenames: false
- id: helmify
name: helmify
entry: sh -c "gmake helmify || make helmify"
language: system
pass_filenames: false
- id: go-build
name: go build
entry: sh -c "gmake build-all || make build-all"
language: system
pass_filenames: false
8 changes: 2 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,7 @@ FORCE:

.PHONY: install-crds
install-crds: generate ## Install CRDs into the K8s cluster specified in ~/.kube/config.
kubectl kustomize config/crd | kubectl apply -f -

.PHONY: helmify
helmify:
kubectl kustomize config/default | helmify -crd-dir charts/kvm-node-agent
kubectl apply -f charts/kvm-node-agent/crds/kvm.cloud.sap_*.yaml

install-goimports: FORCE
@if ! hash goimports 2>/dev/null; then printf "\e[1;36m>> Installing goimports (this may take a while)...\e[0m\n"; go install golang.org/x/tools/cmd/goimports@latest; fi
Expand Down Expand Up @@ -125,7 +121,7 @@ check: FORCE static-check build/cover.html build-all

generate: install-controller-gen
@printf "\e[1;36m>> controller-gen\e[0m\n"
@controller-gen crd rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases
@controller-gen crd rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=charts/kvm-node-agent/crds
@controller-gen object:headerFile="hack/boilerplate.go.txt" paths="./..."
@controller-gen applyconfiguration paths="./..."

Expand Down
10 changes: 4 additions & 6 deletions Makefile.maker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ binaries:

controllerGen:
enabled: true
crdOutputPath: config/crd/bases
crdOutputPath: charts/kvm-node-agent/crds
objectHeaderFile: hack/boilerplate.go.txt
rbacRoleName: manager-role

Expand Down Expand Up @@ -45,6 +45,8 @@ githubWorkflow:
- semver
- edge
- sha
pushHelmChartToGhcr:
path: charts/kvm-node-agent
license:
enabled: true

Expand Down Expand Up @@ -81,8 +83,4 @@ verbatim: |

.PHONY: install-crds
install-crds: generate ## Install CRDs into the K8s cluster specified in ~/.kube/config.
kubectl kustomize config/crd | kubectl apply -f -

.PHONY: helmify
helmify:
kubectl kustomize config/default | helmify -crd-dir charts/kvm-node-agent
kubectl apply -f charts/kvm-node-agent/crds/kvm.cloud.sap_*.yaml
156 changes: 0 additions & 156 deletions charts/kvm-node-agent/crds/migration-crd.yaml

This file was deleted.

1 change: 0 additions & 1 deletion charts/kvm-node-agent/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ controllerManager:
pkiPath: /pki
image:
repository: ghcr.io/cobaltcore-dev/kvm-node-agent
tag: latest
resources:
limits:
cpu: 500m
Expand Down
Loading
Loading