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
8 changes: 4 additions & 4 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Clone the code
uses: actions/checkout@v4
uses: actions/checkout@v7

- name: Setup Go
uses: actions/setup-go@v5
uses: actions/setup-go@v7
with:
go-version-file: go.mod

- name: Run linter
uses: golangci/golangci-lint-action@v6
uses: golangci/golangci-lint-action@v9
with:
version: v1.63.4
version: v2.14.0
18 changes: 12 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,23 @@ jobs:
image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7

- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: docker/setup-qemu-action@v4
- uses: docker/setup-buildx-action@v4

- uses: docker/login-action@v3
- uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- id: meta
uses: docker/metadata-action@v5
uses: docker/metadata-action@v6
env:
# GHCR links a multi-arch package to its repo via the index
# annotation; the Dockerfile LABEL only reaches the per-arch configs.
DOCKER_METADATA_ANNOTATIONS_LEVELS: manifest,index
with:
images: ${{ env.IMAGE }}
tags: |
Expand All @@ -38,11 +42,13 @@ jobs:
type=semver,pattern={{major}}.{{minor}}

- id: build
uses: docker/build-push-action@v6
uses: docker/build-push-action@v7
with:
context: .
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
annotations: ${{ steps.meta.outputs.annotations }}
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Clone the code
uses: actions/checkout@v4
uses: actions/checkout@v7

- name: Setup Go
uses: actions/setup-go@v5
uses: actions/setup-go@v7
with:
go-version-file: go.mod

Expand Down
56 changes: 30 additions & 26 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,15 @@
version: "2"
run:
timeout: 5m
allow-parallel-runners: true

issues:
# don't skip warning about doc comments
# don't exclude the default set of lint
exclude-use-default: false
# restore some of the defaults
# (fill in the rest as needed)
exclude-rules:
- path: "api/*"
linters:
- lll
- path: "internal/*"
linters:
- dupl
- lll
linters:
disable-all: true
default: none
enable:
- copyloopvar
- dupl
- errcheck
- copyloopvar
- ginkgolinter
- goconst
- gocyclo
- gofmt
- goimports
- gosimple
- govet
- ineffassign
- lll
Expand All @@ -36,12 +18,34 @@ linters:
- prealloc
- revive
- staticcheck
- typecheck
- unconvert
- unparam
- unused

linters-settings:
revive:
settings:
revive:
rules:
- name: comment-spacings
exclusions:
generated: lax
rules:
- name: comment-spacings
- linters:
- lll
path: api/*
- linters:
- dupl
- lll
path: internal/*
paths:
- third_party$
- builtin$
- examples$
formatters:
enable:
- gofmt
- goimports
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ ARG TARGETARCH
RUN CGO_ENABLED=0 GOARCH=${TARGETARCH} go build -trimpath -o /out/manager ./cmd

FROM gcr.io/distroless/static:nonroot
LABEL org.opencontainers.image.source="https://github.com/lllamnyp/address-controller"
LABEL org.opencontainers.image.source="https://github.com/cozystack/address-controller"
COPY --from=build /out/manager /manager
USER 65532:65532
ENTRYPOINT ["/manager"]
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# Image coordinates. TAG defaults to something unique per commit; override for
# releases (e.g. make docker-push TAG=v0.1.0) or floating tags (TAG=main).
IMG_REPO ?= ghcr.io/lllamnyp/address-controller
IMG_REPO ?= ghcr.io/cozystack/address-controller
TAG ?= $(shell git describe --tags --always --dirty)
IMG ?= $(IMG_REPO):$(TAG)
PLATFORMS ?= linux/amd64,linux/arm64
Expand Down Expand Up @@ -131,7 +131,7 @@ CONTROLLER_TOOLS_VERSION ?= v0.17.1
ENVTEST_VERSION ?= $(shell go list -m -f "{{ .Version }}" sigs.k8s.io/controller-runtime | awk -F'[v.]' '{printf "release-%d.%d", $$2, $$3}')
#ENVTEST_K8S_VERSION is the version of Kubernetes to use for setting up ENVTEST binaries (i.e. 1.31)
ENVTEST_K8S_VERSION ?= $(shell go list -m -f "{{ .Version }}" k8s.io/api | awk -F'[v.]' '{printf "1.%d", $$3}')
GOLANGCI_LINT_VERSION ?= v1.63.4
GOLANGCI_LINT_VERSION ?= v2.14.0

.PHONY: controller-gen
controller-gen: $(CONTROLLER_GEN) ## Download controller-gen locally if necessary.
Expand All @@ -154,7 +154,7 @@ $(ENVTEST): $(LOCALBIN)
.PHONY: golangci-lint
golangci-lint: $(GOLANGCI_LINT) ## Download golangci-lint locally if necessary.
$(GOLANGCI_LINT): $(LOCALBIN)
$(call go-install-tool,$(GOLANGCI_LINT),github.com/golangci/golangci-lint/cmd/golangci-lint,$(GOLANGCI_LINT_VERSION))
$(call go-install-tool,$(GOLANGCI_LINT),github.com/golangci/golangci-lint/v2/cmd/golangci-lint,$(GOLANGCI_LINT_VERSION))

# go-install-tool will 'go install' any package with custom target and name of binary, if it doesn't exist
# $1 - target path with name of binary
Expand Down
8 changes: 4 additions & 4 deletions PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@ domain: sdn.cozystack.io
layout:
- go.kubebuilder.io/v4
projectName: address-controller
repo: github.com/lllamnyp/address-controller
repo: github.com/cozystack/address-controller
resources:
- api:
crdVersion: v1
domain: sdn.cozystack.io
group: local
kind: IPAddressClass
path: github.com/lllamnyp/address-controller/api/v1alpha1
path: github.com/cozystack/address-controller/api/v1alpha1
version: v1alpha1
- api:
crdVersion: v1
controller: true
domain: sdn.cozystack.io
group: local
kind: IPAddress
path: github.com/lllamnyp/address-controller/api/v1alpha1
path: github.com/cozystack/address-controller/api/v1alpha1
version: v1alpha1
- api:
crdVersion: v1
Expand All @@ -30,6 +30,6 @@ resources:
domain: sdn.cozystack.io
group: local
kind: IPAddressClaim
path: github.com/lllamnyp/address-controller/api/v1alpha1
path: github.com/cozystack/address-controller/api/v1alpha1
version: v1alpha1
version: "3"
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ analogue), which live in separate projects.
**The full contract — state machines, reconciliation algorithms, field
ownership, and driver obligations — is specified in
[docs/design.md](docs/design.md).** The reference driver implementing it is
[metallb-iad](https://github.com/lllamnyp/metallb-iad).
[metallb-iad](https://github.com/cozystack/metallb-iad).

## Resource model

Expand Down Expand Up @@ -96,7 +96,7 @@ cluster. `helm uninstall` leaves the CRDs (and every `IPAddress` ledger
entry) behind by design.

The controller image is published as
`ghcr.io/lllamnyp/address-controller:main` (plus `main-<sha>` and semver tags)
`ghcr.io/cozystack/address-controller:main` (plus `main-<sha>` and semver tags)
by the release workflow on every push to main.

## Development
Expand All @@ -106,6 +106,6 @@ make manifests generate # regenerate CRDs, ClusterRole, and deepcopy after API
make build # build the manager
go test ./internal/controller/
make run # run the controller locally
make docker-build docker-push # publish ghcr.io/lllamnyp/address-controller:<git-sha>
make docker-build docker-push # publish ghcr.io/cozystack/address-controller:<git-sha>
make helm-package # lint and package the chart into dist/
```
2 changes: 1 addition & 1 deletion api/v1alpha1/groupversion_info.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2026 Timofei Larkin.
Copyright 2026 The Cozystack Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion api/v1alpha1/ipaddress_types.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2026 Timofei Larkin.
Copyright 2026 The Cozystack Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion api/v1alpha1/ipaddressclaim_types.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2026 Timofei Larkin.
Copyright 2026 The Cozystack Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion api/v1alpha1/ipaddressclass_types.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2026 Timofei Larkin.
Copyright 2026 The Cozystack Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion api/v1alpha1/well_known.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2026 Timofei Larkin.
Copyright 2026 The Cozystack Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions chart/address-controller/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ keywords:
- ipam
- networking
- cozystack
home: https://github.com/lllamnyp/address-controller
home: https://github.com/cozystack/address-controller
sources:
- https://github.com/lllamnyp/address-controller
- https://github.com/cozystack/address-controller
2 changes: 1 addition & 1 deletion chart/address-controller/values.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Container image for the core controller.
image: ghcr.io/lllamnyp/address-controller:main
image: ghcr.io/cozystack/address-controller:main
imagePullPolicy: IfNotPresent
imagePullSecrets: []

Expand Down
6 changes: 3 additions & 3 deletions cmd/main.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2026 Timofei Larkin.
Copyright 2026 The Cozystack Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -38,8 +38,8 @@ import (
metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server"
"sigs.k8s.io/controller-runtime/pkg/webhook"

localv1alpha1 "github.com/lllamnyp/address-controller/api/v1alpha1"
"github.com/lllamnyp/address-controller/internal/controller"
localv1alpha1 "github.com/cozystack/address-controller/api/v1alpha1"
"github.com/cozystack/address-controller/internal/controller"
// +kubebuilder:scaffold:imports
)

Expand Down
2 changes: 1 addition & 1 deletion docs/design.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
This document records the contract: the resource model, the two state
machines the core drives, the exact reconciliation algorithms, and the
obligations a per-class driver must meet. It is the reference against which
drivers (such as [metallb-iad](https://github.com/lllamnyp/metallb-iad))
drivers (such as [metallb-iad](https://github.com/cozystack/metallb-iad))
are written.

## 1. Scope
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/lllamnyp/address-controller
module github.com/cozystack/address-controller

go 1.23.0
go 1.26

godebug default=go1.23

Expand Down
2 changes: 1 addition & 1 deletion hack/boilerplate.go.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2026 Timofei Larkin.
Copyright 2026 The Cozystack Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
4 changes: 2 additions & 2 deletions internal/controller/indexes.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2026 Timofei Larkin.
Copyright 2026 The Cozystack Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -23,7 +23,7 @@ import (
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"

localv1alpha1 "github.com/lllamnyp/address-controller/api/v1alpha1"
localv1alpha1 "github.com/cozystack/address-controller/api/v1alpha1"
)

// IPAddressClaimRefIndex indexes IPAddress objects by the
Expand Down
4 changes: 2 additions & 2 deletions internal/controller/ipaddress_controller.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2026 Timofei Larkin.
Copyright 2026 The Cozystack Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -30,7 +30,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/reconcile"

localv1alpha1 "github.com/lllamnyp/address-controller/api/v1alpha1"
localv1alpha1 "github.com/cozystack/address-controller/api/v1alpha1"
)

// IPAddressReconciler owns the class-agnostic address lifecycle: deletion
Expand Down
Loading
Loading