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
25 changes: 25 additions & 0 deletions .github/workflows/kustomize-validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# SPDX-FileCopyrightText: 2026 SAP SE or an SAP affiliate company and IronCore contributors
# SPDX-License-Identifier: Apache-2.0

name: Kustomize

on:
pull_request:
branches:
- main
paths-ignore:
- 'docs/**'
- '**/*.md'

jobs:
kustomize-validation:
name: Validate
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install Kustomize
run: |
make install-kustomize
- name: Validate Kustomize
run: |
./hack/validate-kustomize.sh
89 changes: 89 additions & 0 deletions .github/workflows/publish-image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# SPDX-FileCopyrightText: 2026 SAP SE or an SAP affiliate company and IronCore contributors
# SPDX-License-Identifier: Apache-2.0

name: Container Image

on:
push:
tags:
- 'v*'
branches:
- main
paths-ignore:
- 'docs/**'
- '**/*.md'
pull_request:
branches:
- main
paths-ignore:
- 'docs/**'
- '**/*.md'

permissions:
contents: read
packages: write

jobs:
build-and-push-image:
name: Build and Push Docker Image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}
tags: |
# https://github.com/docker/metadata-action#typeedge
type=edge
# https://github.com/docker/metadata-action#latest-tag
type=raw,value=latest,enable={{is_default_branch}}
# https://github.com/docker/metadata-action#typesemver
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
# https://github.com/docker/metadata-action#typeref
type=ref,event=branch
type=ref,event=pr
# https://github.com/docker/metadata-action#typesha
type=sha,format=long
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
id: setup-buildx
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Go Cache for Docker
uses: actions/cache@v4
id: cache
with:
path: |
go-pkg-mod
go-build-cache
key: cache-mount-${{ hashFiles('go.sum') }}
- name: Restore Docker Cache Mounts
uses: reproducible-containers/buildkit-cache-dance@v3.3.2
with:
cache-map: |
{
"go-pkg-mod": "/go/pkg/mod",
"go-build-cache": "/root/.cache/go-build"
}
skip-extraction: ${{ steps.cache.outputs.cache-hit }}
builder: ${{ steps.setup-buildx.outputs.name }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-to: type=gha,mode=max
cache-from: type=gha
8 changes: 1 addition & 7 deletions Makefile.maker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,7 @@ githubWorkflow:
securityChecks:
enabled: true
pushContainerToGhcr:
enabled: true
platforms: "linux/amd64,linux/arm64"
tagStrategy:
- edge
- latest
- semver
- sha
enabled: false

variables:
GO_BUILDENV: 'CGO_ENABLED=0'
Expand Down
2 changes: 1 addition & 1 deletion config/samples/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## Append samples of your project ##
resources:
- v1alpha1_device.yaml
- v1alpha1-dhcprelay.yaml
- v1alpha1_dhcprelay.yaml
- v1alpha1_interface.yaml
- v1alpha1_lldp.yaml
- v1alpha1_banner.yaml
Expand Down
18 changes: 18 additions & 0 deletions hack/validate-kustomize.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env bash
# SPDX-FileCopyrightText: 2025 SAP SE or an SAP affiliate company and IronCore contributors
# SPDX-License-Identifier: Apache-2.0

set -euo pipefail

BASEDIR=$(cd -- "$(dirname -- "$0")" && pwd)

for kustomization in $(find "$BASEDIR/../config" -name "kustomization.yaml"); do
dir=$(dirname "$kustomization")
name=${dir#"$BASEDIR/../"}
if kustomize build "$dir" >/dev/null 2>&1; then
echo "OK: $name"
else
echo "FAILED: $name"
exit 1
fi
done
Loading