Skip to content
Open
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
31 changes: 15 additions & 16 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
- release-*

env:
GO_VERSION: '1.19'
GO_VERSION: '1.23'

jobs:

Expand Down Expand Up @@ -57,21 +57,20 @@ jobs:
name: Golang Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache: false
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
version: v1.53
args: --timeout=30m
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
check-latest: true
cache-dependency-path: "**/*.sum"
- name: golangci-lint
uses: golangci/golangci-lint-action@v7
with:
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
version: v2.0.2
args: --timeout=30m

# Lints Pull Request commits with commitlint.
#
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
- release-*

env:
GO_VERSION: '1.19'
GO_VERSION: '1.23'
KIND_VERSION: 'v0.14.0'
KIND_IMAGE: 'kindest/node:v1.22.2'
KIND_CLUSTER_NAME: 'e2e-test'
Expand Down
32 changes: 16 additions & 16 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
permissions:
contents: write
env:
GO_VERSION: '1.19'
GO_VERSION: '1.23'

jobs:
Test:
Expand Down Expand Up @@ -46,20 +46,20 @@ jobs:
name: Golang Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache: false
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.53
args: --timeout=30m
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
check-latest: true
cache-dependency-path: "**/*.sum"
- name: golangci-lint
uses: golangci/golangci-lint-action@v7
with:
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
version: v2.0.2
args: --timeout=30m


# Release the artifacts, release note and images.
Expand Down Expand Up @@ -99,7 +99,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.19
go-version: 1.23

- name: Release with GoReleaser
uses: goreleaser/goreleaser-action@v2
Expand Down
86 changes: 77 additions & 9 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,78 @@
run:
skip-files:
- ".*_test.go"
skip-dirs:
- vendor/

version: "2"
linters:
disable:
- errcheck
- unused
default: standard
enable:
- bodyclose
- copyloopvar
- ginkgolinter
- testifylint
- misspell
- nakedret
- unconvert
- unparam
- whitespace
- gocritic
- errorlint
settings:
govet:
enable:
- shadow
misspell:
locale: US
staticcheck:
checks:
- "-QF1008"
gocritic:
enable-all: true
disabled-checks:
- emptyStringTest
- ifElseChain
- singleCaseSwitch
- hugeParam
- unnamedResult
- whyNoLint
- tooManyResultsChecker
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
rules:
- linters:
- errcheck
- unparam
path: _test.go
- linters:
- govet
text: declaration of "err" shadows declaration at line
paths:
- third_party$
- builtin$
- examples$
formatters:
enable:
- gofumpt # drop in replacement for gofmt
- gci # format imports
settings:
gci:
custom-order: true
sections:
- standard
- blank
- dot
- default
- localmodule
gofumpt:
extra-rules: true
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$

run:
allow-parallel-runners: true
timeout: 10m
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.19-alpine3.17 as builder
FROM golang:1.23-alpine3.22 as builder
ARG TARGETOS
ARG TARGETARCH

Expand All @@ -23,7 +23,7 @@ COPY apis/ apis/
# by leaving it empty we can ensure that the container and binary shipped on it will have the same platform.
RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH:-amd64} go build -a -o manager main.go

FROM alpine:3.17
FROM alpine:3.22
WORKDIR /
COPY --from=builder /workspace/manager .

Expand Down
40 changes: 38 additions & 2 deletions charts/templates/crd/apps.kusionstack.io_podtransitionrules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,56 @@ spec:
description: AvailablePolicy is the rule to check if the max
unavailable number is reached by current resource updated.
properties:
maxUnavailablePolicy:
description: MaxUnavailablePolicy is an option to apply
max unavailable by adaptive policy.
properties:
expFunc:
description: |-
ExpFunc is an exponentiation expression to calculate the expected value.
func: f(x) = coeff * x ^ pow.
properties:
coeff:
description: Coeff stands for coefficient in this
exponentiation.
type: string
pow:
description: Pow stands for power in this exponentiation.
type: string
type: object
type: object
maxUnavailableValue:
anyOf:
- type: integer
- type: string
description: |-
MaxUnavailableValue is the expected max unavailable replicas which is allowed to be a integer or a percentage of the whole
MaxUnavailableValue is the expected max unavailable replicas which is allowed to be an integer or a percentage of the whole
number of the target resources.
x-kubernetes-int-or-string: true
minAvailablePolicy:
description: MaxUnavailablePolicy is an option to apply
min available by adaptive policy.
properties:
expFunc:
description: |-
ExpFunc is an exponentiation expression to calculate the expected value.
func: f(x) = coeff * x ^ pow.
properties:
coeff:
description: Coeff stands for coefficient in this
exponentiation.
type: string
pow:
description: Pow stands for power in this exponentiation.
type: string
type: object
type: object
minAvailableValue:
anyOf:
- type: integer
- type: string
description: |-
MinAvailableValue is the expected min available replicas which is allowed to be a integer or a percentage of the whole
MinAvailableValue is the expected min available replicas which is allowed to be an integer or a percentage of the whole
number of the target resources.
x-kubernetes-int-or-string: true
type: object
Expand Down
40 changes: 38 additions & 2 deletions config/crd/bases/apps.kusionstack.io_podtransitionrules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,56 @@ spec:
description: AvailablePolicy is the rule to check if the max
unavailable number is reached by current resource updated.
properties:
maxUnavailablePolicy:
description: MaxUnavailablePolicy is an option to apply
max unavailable by adaptive policy.
properties:
expFunc:
description: |-
ExpFunc is an exponentiation expression to calculate the expected value.
func: f(x) = coeff * x ^ pow.
properties:
coeff:
description: Coeff stands for coefficient in this
exponentiation.
type: string
pow:
description: Pow stands for power in this exponentiation.
type: string
type: object
type: object
maxUnavailableValue:
anyOf:
- type: integer
- type: string
description: |-
MaxUnavailableValue is the expected max unavailable replicas which is allowed to be a integer or a percentage of the whole
MaxUnavailableValue is the expected max unavailable replicas which is allowed to be an integer or a percentage of the whole
number of the target resources.
x-kubernetes-int-or-string: true
minAvailablePolicy:
description: MaxUnavailablePolicy is an option to apply
min available by adaptive policy.
properties:
expFunc:
description: |-
ExpFunc is an exponentiation expression to calculate the expected value.
func: f(x) = coeff * x ^ pow.
properties:
coeff:
description: Coeff stands for coefficient in this
exponentiation.
type: string
pow:
description: Pow stands for power in this exponentiation.
type: string
type: object
type: object
minAvailableValue:
anyOf:
- type: integer
- type: string
description: |-
MinAvailableValue is the expected min available replicas which is allowed to be a integer or a percentage of the whole
MinAvailableValue is the expected min available replicas which is allowed to be an integer or a percentage of the whole
number of the target resources.
x-kubernetes-int-or-string: true
type: object
Expand Down
30 changes: 16 additions & 14 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,28 +1,30 @@
module kusionstack.io/kuperator

go 1.19
go 1.23

toolchain go1.23.8

require (
github.com/evanphx/json-patch v5.7.0+incompatible
github.com/go-logr/logr v1.4.1
github.com/go-logr/logr v1.4.2
github.com/google/uuid v1.4.0
github.com/onsi/ginkgo v1.16.5
github.com/onsi/gomega v1.30.0
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.17.0
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.8.4
golang.org/x/net v0.25.0
k8s.io/api v0.28.4
k8s.io/apimachinery v0.28.4
github.com/stretchr/testify v1.10.0
golang.org/x/net v0.28.0
k8s.io/api v0.33.2
k8s.io/apimachinery v0.33.2
k8s.io/client-go v0.28.4
k8s.io/component-base v0.28.4
k8s.io/component-helpers v0.22.6
k8s.io/klog v1.0.0
k8s.io/klog/v2 v2.100.1
k8s.io/klog/v2 v2.130.1
k8s.io/kubernetes v0.0.0-00010101000000-000000000000
k8s.io/utils v0.0.0-20240102154912-e7106e64919e
kusionstack.io/kube-api v0.6.6
k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738
kusionstack.io/kube-api v0.7.4-0.20250728111735-11fa6b63ac0e
kusionstack.io/kube-utils v0.1.19-0.20250206032419-01aec11b2bfa
kusionstack.io/resourceconsist v0.0.1
sigs.k8s.io/controller-runtime v0.17.3
Expand Down Expand Up @@ -81,11 +83,11 @@ require (
github.com/tjfoc/gmsm v1.3.2 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.26.0 // indirect
golang.org/x/crypto v0.23.0 // indirect
golang.org/x/crypto v0.26.0 // indirect
golang.org/x/oauth2 v0.15.0 // indirect
golang.org/x/sys v0.20.0 // indirect
golang.org/x/term v0.20.0 // indirect
golang.org/x/text v0.16.0 // indirect
golang.org/x/sys v0.23.0 // indirect
golang.org/x/term v0.23.0 // indirect
golang.org/x/text v0.17.0 // indirect
golang.org/x/time v0.5.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
Expand All @@ -99,7 +101,7 @@ require (
k8s.io/apiserver v0.22.6 // indirect
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 // indirect
k8s.io/kubectl v0.29.0
sigs.k8s.io/structured-merge-diff/v4 v4.3.0 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.7.0 // indirect
sigs.k8s.io/yaml v1.4.0 // indirect
)

Expand Down
Loading
Loading