Skip to content

Commit 645310e

Browse files
AlexsJonesclaude
andauthored
chore: migrate to Go 1.26 and controller-gen v0.21.0 (#822)
Upstream k8s.io dependencies have moved past Go 1.24; Renovate PRs touching them now drag the go directive forward. This aligns the operator with k8sgpt-ai/k8sgpt#1689. - go.mod: go 1.26.3, toolchain go1.26.5 - controller-gen: v0.16.0 -> v0.21.0 (v0.16.0 fails to compile under go1.26 via its x/tools v0.24.0 dependency) - regenerate CRDs/deepcopy; also picks up previously ungenerated DeploymentLabels/DeploymentAnnotations schema entries - CI workflows: Go pins -> 1.26 (release.yaml/build_container.yaml envs were stale at 1.19/1.21) - Dockerfile builder image: golang:1.26-alpine3.23 Signed-off-by: Alex Jones <alexsimonjones@gmail.com> Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
1 parent b85f719 commit 645310e

10 files changed

Lines changed: 38 additions & 10 deletions

File tree

.github/workflows/build_container.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ on:
1313
- "**.md"
1414

1515
env:
16-
GO_VERSION: "~1.21"
16+
GO_VERSION: "~1.26"
1717
IMAGE_NAME: "k8sgpt-operator"
1818
defaults:
1919
run:

.github/workflows/release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
workflow_dispatch:
99
env:
1010
# Default minimum version of Go to support.
11-
DEFAULT_GO_VERSION: 1.19
11+
DEFAULT_GO_VERSION: 1.26
1212
REGISTRY: ghcr.io
1313
GITHUB_PAGES_BRANCH: gh_pages
1414

.github/workflows/test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- main
77

88
env:
9-
GO_VERSION: "~1.24"
9+
GO_VERSION: "~1.26"
1010

1111
jobs:
1212
build:

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Build the manager binary
2-
FROM --platform=$BUILDPLATFORM golang:1.24-alpine3.21 AS builder
2+
FROM --platform=$BUILDPLATFORM golang:1.26-alpine3.23 AS builder
33

44
ARG TARGETOS
55
ARG TARGETARCH

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ ENVTEST ?= $(LOCALBIN)/setup-envtest
173173

174174
## Tool Versions
175175
KUSTOMIZE_VERSION ?= v3.8.7
176-
CONTROLLER_TOOLS_VERSION ?= v0.16.0
176+
CONTROLLER_TOOLS_VERSION ?= v0.21.0
177177

178178
KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"
179179
.PHONY: kustomize

api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/core.k8sgpt.ai_k8sgpts.yaml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.16.0
6+
controller-gen.kubebuilder.io/version: v0.21.0
77
name: k8sgpts.core.k8sgpt.ai
88
spec:
99
group: core.k8sgpt.ai
@@ -352,6 +352,20 @@ spec:
352352
type: string
353353
type: object
354354
type: array
355+
deploymentAnnotations:
356+
additionalProperties:
357+
type: string
358+
description: |-
359+
DeploymentAnnotations allows adding custom annotations to the K8sGPT Deployment
360+
for integration with monitoring systems and other infrastructure components.
361+
type: object
362+
deploymentLabels:
363+
additionalProperties:
364+
type: string
365+
description: |-
366+
DeploymentLabels allows adding custom labels to the K8sGPT Deployment for
367+
organizational tracking, monitoring, logging, and cost allocation purposes.
368+
type: object
355369
extraOptions:
356370
properties:
357371
backstage:

config/crd/bases/core.k8sgpt.ai_mutations.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.16.0
6+
controller-gen.kubebuilder.io/version: v0.21.0
77
name: mutations.core.k8sgpt.ai
88
spec:
99
group: core.k8sgpt.ai

config/crd/bases/core.k8sgpt.ai_results.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.16.0
6+
controller-gen.kubebuilder.io/version: v0.21.0
77
name: results.core.k8sgpt.ai
88
spec:
99
group: core.k8sgpt.ai

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
module github.com/k8sgpt-ai/k8sgpt-operator
22

3-
go 1.24.0
3+
go 1.26.3
44

5-
toolchain go1.24.5
5+
toolchain go1.26.5
66

77
require (
88
buf.build/gen/go/k8sgpt-ai/k8sgpt/grpc/go v1.5.1-20241118152629-1379a5a1889d.2

0 commit comments

Comments
 (0)