Skip to content
Draft
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
9 changes: 5 additions & 4 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# SPDX-FileCopyrightText: SAP SE or an SAP affiliate company
# SPDX-FileCopyrightText: 2026 SAP SE or an SAP affiliate company and IronCore contributors
# SPDX-License-Identifier: Apache-2.0

root = true

[*]
insert_final_newline = true
charset = utf-8
trim_trailing_whitespace = true
indent_style = space
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[{Makefile,go.mod,go.sum,*.go}]
indent_style = tab
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/check-codegen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,18 @@ jobs:
go-version-file: 'go.mod'
- name: Run make generate
run: make generate
- name: Run make manifests
run: make manifests
- name: Run make docs
run: make docs
- name: Run make charts
run: make charts
- name: Run make helm
run: make helm
- name: Run fmt
run: make fmt
- name: Compare the expected and actual generated/* directories
run: |
if [ "$(git diff | wc -l)" -gt "0" ]; then
echo "Detected uncommitted changes after build. Consider running 'make generate && make docs && make charts && make fmt'."
echo "Detected uncommitted changes after build. Consider running 'make generate && make manifests && make docs && make helm && make fmt'."
echo "See status below:"
git diff
exit 1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/kustomize-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- uses: actions/checkout@v6
- name: Install Kustomize
run: |
make install-kustomize
make kustomize
- name: Validate Kustomize
run: |
./hack/validate-kustomize.sh
12 changes: 8 additions & 4 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ jobs:
- uses: actions/setup-go@v6
with:
go-version-file: 'go.mod'
- name: Dependency Licenses Review
run: make check-dependency-licenses
- name: Check if source code files have license header
run: make check-addlicense
- name: Install addlicense
run: go install github.com/google/addlicense@latest
- name: Check License Headers
run: addlicense -check -ignore '**/*.yml' -ignore '**/*.yaml' .
- name: Install go-licenses
run: go install github.com/google/go-licenses@latest
- name: Check Dependency Licenses
run: go-licenses check --include_tests --disallowed_types=restricted,forbidden,unknown ./...
6 changes: 3 additions & 3 deletions .github/workflows/publish-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ jobs:
with:
context: .
build-args: |
BININFO_VERSION=${{ steps.build_args.outputs.version }}
BININFO_COMMIT_HASH=${{ steps.build_args.outputs.commit }}
BININFO_BUILD_DATE=${{ steps.build_args.outputs.date }}
VERSION=${{ steps.build_args.outputs.version }}
GIT_COMMIT=${{ steps.build_args.outputs.commit }}
BUILD_DATE=${{ steps.build_args.outputs.date }}
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ jobs:
- name: Generate release info
run: |
go install github.com/sapcc/go-bits/tools/release-info@latest
mkdir -p build
release-info CHANGELOG.md "$(git describe --tags --abbrev=0)" > build/release-info
mkdir -p dist
release-info CHANGELOG.md "$(git describe --tags --abbrev=0)" > dist/release-info
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v7
with:
args: release --clean --release-notes=./build/release-info
args: release --clean --release-notes=./dist/release-info
version: latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
10 changes: 5 additions & 5 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ jobs:
go-version-file: 'go.mod'
- name: Run prepare make target
run: make generate
- name: Build all binaries
run: make build-all
- name: Build manager binary
run: make build
test:
name: Test
needs: build
Expand All @@ -44,15 +44,15 @@ jobs:
- uses: actions/setup-go@v6
with:
go-version-file: 'go.mod'
- name: Run prepare make target
- name: Run generate make target
run: make generate
- name: Run tests and generate coverage report
run: make build/cover.out
run: make coverage
- name: Archive code coverage results
uses: actions/upload-artifact@v7
with:
name: code-coverage
path: build/cover.out
path: cover.out
code-coverage:
name: Code Coverage Report
needs: test
Expand Down
10 changes: 4 additions & 6 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
# SPDX-FileCopyrightText: 2020 SAP SE or an SAP affiliate company
# SPDX-FileCopyrightText: 2020 SAP SE or an SAP affiliate company and IronCore contributors
# SPDX-License-Identifier: Apache-2.0
version: 2

Expand All @@ -19,7 +19,6 @@ builds:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
goarch:
- amd64
Expand All @@ -29,10 +28,9 @@ builds:
goarch: arm64
ldflags:
- -s -w
- -X github.com/sapcc/go-api-declarations/bininfo.binName=network-operator
- -X github.com/sapcc/go-api-declarations/bininfo.version={{ .Version }}
- -X github.com/sapcc/go-api-declarations/bininfo.commit={{ .FullCommit }}
- -X github.com/sapcc/go-api-declarations/bininfo.buildDate={{ .CommitDate }} # use CommitDate instead of Date for reproducibility
- -X main.version={{ .Version }}
- -X main.gitCommit={{ .FullCommit }}
- -X main.buildDate={{ .CommitDate }} # use CommitDate instead of Date for reproducibility
main: ./cmd
# Set the modified timestamp on the output binary to ensure that builds are reproducible.
mod_timestamp: "{{ .CommitTimestamp }}"
Expand Down
13 changes: 0 additions & 13 deletions .license-scan-overrides.jsonl

This file was deleted.

14 changes: 0 additions & 14 deletions .license-scan-rules.json

This file was deleted.

3 changes: 2 additions & 1 deletion .typos.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# SPDX-FileCopyrightText: 2026 SAP SE
# SPDX-FileCopyrightText: 2026 SAP SE or an SAP affiliate company and IronCore contributors
# SPDX-License-Identifier: Apache-2.0

[default]
extend-ignore-re = [
"Cisco-IOS-XR.*"
Expand Down
20 changes: 10 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

FROM --platform=$BUILDPLATFORM golang:1.26-alpine3.22 AS builder

ARG BININFO_BUILD_DATE
ARG BININFO_COMMIT_HASH
ARG BININFO_VERSION
ARG VERSION
ARG GIT_COMMIT
ARG BUILD_DATE

ARG TARGETOS
ARG TARGETARCH
Expand All @@ -21,19 +21,19 @@ RUN --mount=type=cache,target=/go/pkg/mod \
RUN --mount=type=bind,target=. \
--mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
GOOS=${TARGETOS} GOARCH=${TARGETARCH} GOTOOLCHAIN=local CGO_ENABLED=0 go build -ldflags "-s -w -X github.com/sapcc/go-api-declarations/bininfo.binName=network-operator -X github.com/sapcc/go-api-declarations/bininfo.version=${BININFO_VERSION} -X github.com/sapcc/go-api-declarations/bininfo.commit=${BININFO_COMMIT_HASH} -X github.com/sapcc/go-api-declarations/bininfo.buildDate=${BININFO_BUILD_DATE}" -o /usr/bin/network-operator ./cmd
GOOS=${TARGETOS} GOARCH=${TARGETARCH} GOTOOLCHAIN=local CGO_ENABLED=0 go build -ldflags "-s -w -X main.version=${VERSION} -X main.gitCommit=${GIT_COMMIT} -X main.buildDate=${BUILD_DATE}" -o /usr/bin/network-operator ./cmd

FROM gcr.io/distroless/static:nonroot

ARG BININFO_BUILD_DATE
ARG BININFO_COMMIT_HASH
ARG BININFO_VERSION
ARG VERSION
ARG GIT_COMMIT
ARG BUILD_DATE

LABEL source_repository="https://github.com/ironcore-dev/network-operator" \
org.opencontainers.image.url="https://github.com/ironcore-dev/network-operator" \
org.opencontainers.image.created=${BININFO_BUILD_DATE} \
org.opencontainers.image.revision=${BININFO_COMMIT_HASH} \
org.opencontainers.image.version=${BININFO_VERSION} \
org.opencontainers.image.created=${BUILD_DATE} \
org.opencontainers.image.revision=${GIT_COMMIT} \
org.opencontainers.image.version=${VERSION} \
org.opencontainers.image.licenses="Apache-2.0"

COPY --from=builder /usr/bin/network-operator /manager
Expand Down
Loading
Loading