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/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
":prHourlyLimitNone",
":prConcurrentLimitNone",
":ignoreModulesAndTests",
"schedule:monthly",
"schedule:weekly",
"group:allNonMajor",
"replacements:all",
"workarounds:all"
Expand Down
55 changes: 34 additions & 21 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,36 +16,49 @@ env:
STORE_PATH: ''

jobs:
build-test:
build_test:
name: Build Test
runs-on: 'ubuntu-latest'

runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/checkout@v4

- uses: actions/setup-go@v5
with:
go-version: "^1.23"
go-version: "^1.24"
cache: true

- name: Setup Go Cache PATH
id: go-cache-paths
run: |
echo "go-build=$(go env GOCACHE)" >> $GITHUB_OUTPUT
echo "go-mod=$(go env GOMODCACHE)" >> $GITHUB_OUTPUT
- name: Test Build
run: go build -v ./...

lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v5
with:
go-version: "^1.24"
cache: true

- uses: actions/checkout@v4

- name: Go Build Cache
uses: actions/cache@v4
- name: golangci-lint
uses: golangci/[email protected]
with:
path: ${{ steps.go-cache-paths.outputs.go-build }}
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}
args: --timeout=10m

unittest:
name: Unit Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Go Mod Cache
uses: actions/cache@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
path: ${{ steps.go-cache-paths.outputs.go-mod }}
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
go-version: "^1.24"
cache: true

- name: Test Build
run: make build
- name: Unit tests
run: |
go test ./... -coverprofile=coverage.out -covermode=atomic
go tool cover -func coverage.out
5 changes: 2 additions & 3 deletions .github/workflows/pr-docs-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,15 @@ jobs:
with:
fetch-depth: 0

- name: Install Node.js 22.x
- name: Install Node.js 23.x
uses: actions/setup-node@v4
with:
node-version: 22.x
node-version: 23.x

- uses: pnpm/action-setup@v4
name: Install pnpm
with:
run_install: false
version: 9

- name: Get pnpm store directory
shell: bash
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/production-docs-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,15 @@ jobs:
with:
fetch-depth: 0

- name: Install Node.js 22.x
- name: Install Node.js 23.x
uses: actions/setup-node@v4
with:
node-version: 22.x
node-version: 23.x

- uses: pnpm/action-setup@v4
name: Install pnpm
with:
run_install: false
version: 9

- name: Get pnpm store directory
shell: bash
Expand Down
23 changes: 1 addition & 22 deletions .github/workflows/release-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,30 +19,9 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.23'
go-version: '1.24'
cache: true

# Get values for cache paths to be used in later steps
- name: Setup Go Cache PATH
id: go-cache-paths
run: |
echo "go-build=$(go env GOCACHE)" >> $GITHUB_OUTPUT
echo "go-mod=$(go env GOMODCACHE)" >> $GITHUB_OUTPUT

# Cache go build cache, used to speedup go test
- name: Go Build Cache
uses: actions/cache@v4
with:
path: ${{ steps.go-cache-paths.outputs.go-build }}
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}

# Cache go mod cache, used to speedup builds
- name: Go Mod Cache
uses: actions/cache@v4
with:
path: ${{ steps.go-cache-paths.outputs.go-mod }}
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}

- name: GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
Expand Down
125 changes: 69 additions & 56 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,69 +1,82 @@
run:
allow-parallel-runners: true

issues:
exclude:
- "if statements should only be cuddled with assignments" # from wsl
- "if statements should only be cuddled with assignments used in the if statement itself" # from wsl
- "assignments should only be cuddled with other assignments" # from wsl. false positive case: var a bool\nb := true
- "declarations should never be cuddled" # from wsl
# 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: internal/*
linters:
- dupl
linters:
enable-all: true
disable:
- mnd
- depguard
- funlen
- containedctx
- exhaustruct
- testpackage
- varnamelen
- maintidx
- err113
- nlreturn
- wrapcheck
- tagliatelle
- paralleltest
- lll
- contextcheck
- gochecknoglobals
- tagalign
- nilnil
- godot
- godox
- gci
- gocognit
- gocyclo
- cyclop
- ireturn
- gofumpt
- gochecknoinits

linters-settings:
wsl:
allow-assign-and-call: false
strict-append: false
allow-trailing-comment: true
allow-cuddle-declarations: true
allow-separated-leading-comment: true
revive:
rules:
- name: blank-imports
disabled: true
nestif:
# Minimal complexity of if statements to report.
# Default: 5
min-complexity: 9
dupl:
# Tokens count to trigger issue.
# Default: 150
threshold: 1000
mnd:
ignored-functions:
- "context.WithTimeout"
- "strconv.ParseComplex"
ignored-files:
- "examples/.*"
gocritic:
disabled-checks:
- ifElseChain
gosec:
excludes:
- G115

linters:
disable-all: true
enable:
- dupl
- errcheck
- exportloopref
- goconst
- gocyclo
- gofmt
- goimports
- gosimple
- govet
- ineffassign
# - lll
- misspell
- nakedret
- prealloc
- staticcheck
- typecheck
- unconvert
- unparam
- unused
- containedctx
- durationcheck
- errname
- exhaustive
- forcetypeassert
- goheader
- goprintffuncname
# - gosec
- musttag
- nestif
- nolintlint
- nosprintfhostport
- predeclared
- reassign
- revive
- tenv
- testableexamples
- whitespace
- wsl
issues:
exclude:
- "if statements should only be cuddled with assignments" # from wsl
- "if statements should only be cuddled with assignments used in the if statement itself" # from wsl
- "assignments should only be cuddled with other assignments" # from wsl. false positive case: var a bool\nb := true
- "declarations should never be cuddled" # from wsl
exclude-rules:
- path: _test\.go
linters:
- perfsprint
- path: internal\/cli\/.*\.go
linters:
- forbidigo
exclude-dirs:
- apis
- api
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

### Prerequisites

- `go` version `v1.21.0+`
- `go` version `v1.24.0+`
- `docker` version `17.03+`.
- `kubectl` version `v1.11.3+`.
- Access to a Kubernetes `v1.11.3+` cluster (Either kind, minikube is suitable for local development).
Expand Down
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Image URL to use all building/pushing image targets
IMG ?= ghcr.io/nekomeowww/ollama-operator:0.10.1
IMG ?= ghcr.io/nekomeowww/ollama-operator:0.10.7
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
ENVTEST_K8S_VERSION = 1.31.0
ENVTEST_K8S_VERSION = 1.32.0

# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
Expand Down Expand Up @@ -159,10 +159,10 @@ ENVTEST ?= $(LOCALBIN)/setup-envtest-$(ENVTEST_VERSION)
GOLANGCI_LINT = $(LOCALBIN)/golangci-lint-$(GOLANGCI_LINT_VERSION)

## Tool Versions
KUSTOMIZE_VERSION ?= v5.5.0
CONTROLLER_TOOLS_VERSION ?= v0.16.5
ENVTEST_VERSION ?= release-0.17
GOLANGCI_LINT_VERSION ?= v1.60.3
KUSTOMIZE_VERSION ?= v5.6.0
CONTROLLER_TOOLS_VERSION ?= v0.17.2
ENVTEST_VERSION ?= release-0.20
GOLANGCI_LINT_VERSION ?= v1.63.4

.PHONY: kustomize
kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary.
Expand Down
2 changes: 1 addition & 1 deletion cmd/ollama-operator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func init() {

utilruntime.Must(ollamav1.AddToScheme(scheme))
//+kubebuilder:scaffold:scheme
} //nolint:wsl
}

func main() {
var metricsAddr string
Expand Down
2 changes: 1 addition & 1 deletion config/crd/bases/ollama.ayaka.io_models.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.5
controller-gen.kubebuilder.io/version: v0.17.2
name: models.ollama.ayaka.io
spec:
group: ollama.ayaka.io
Expand Down
4 changes: 2 additions & 2 deletions dist/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.5
controller-gen.kubebuilder.io/version: v0.17.2
name: models.ollama.ayaka.io
spec:
group: ollama.ayaka.io
Expand Down Expand Up @@ -8787,7 +8787,7 @@ spec:
- --leader-elect
command:
- /manager
image: ghcr.io/nekomeowww/ollama-operator:0.10.5
image: ghcr.io/nekomeowww/ollama-operator:0.10.7
livenessProbe:
httpGet:
path: /healthz
Expand Down
Loading
Loading