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
12 changes: 6 additions & 6 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: 1.26.1
go-version: 1.26.2
- name: Build
run: make build
- name: FMT
Expand All @@ -37,7 +37,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: 1.26.1
go-version: 1.26.2
- name: ut
run: make test
env:
Expand All @@ -50,7 +50,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: 1.26.1
go-version: 1.26.2
- name: fv
run: make create-cluster fv
env:
Expand All @@ -63,7 +63,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: 1.26.1
go-version: 1.26.2
- name: fv-sharding
run: make create-cluster fv-sharding
env:
Expand All @@ -76,7 +76,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: 1.26.1
go-version: 1.26.2
- name: fv-agentless
run: make create-cluster fv-agentless
env:
Expand All @@ -89,7 +89,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: 1.26.1
go-version: 1.26.2
- name: fv-pullmode
run: make create-cluster-pullmode fv-pullmode
env:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.26.1 AS builder
FROM golang:1.26.2 AS builder

ARG BUILDOS
ARG TARGETARCH
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ ARCH ?= $(shell go env GOARCH)
OS ?= $(shell uname -s | tr A-Z a-z)
K8S_LATEST_VER ?= $(shell curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)
export CONTROLLER_IMG ?= $(REGISTRY)/$(IMAGE_NAME)
TAG ?= main
TAG ?= v1.9.0

## Tool Binaries
CONTROLLER_GEN := $(TOOLS_BIN_DIR)/controller-gen
Expand All @@ -59,7 +59,7 @@ KUBECTL := $(TOOLS_BIN_DIR)/kubectl
CLUSTERCTL := $(TOOLS_BIN_DIR)/clusterctl

GOLANGCI_LINT_VERSION := "v2.11.4"
CLUSTERCTL_VERSION := v1.12.5
CLUSTERCTL_VERSION := v1.13.1

KUSTOMIZE_VER := v5.8.0
KUSTOMIZE_BIN := kustomize
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Classifier currently supports the following classification criteria:
1. Kubernetes version
2. Kubernetes resources

For instance, this Classifier instance will match any cluster whose Kubernetes version is greater than or equal to "v1.24.0" and strictly less than "v1.26.1"
For instance, this Classifier instance will match any cluster whose Kubernetes version is greater than or equal to "v1.24.0" and strictly less than "v1.26.2"

```
apiVersion: lib.projectsveltos.io/v1beta1
Expand All @@ -31,7 +31,7 @@ spec:
- comparison: GreaterThanOrEqualTo
version: 1.24.0
- comparison: LessThan
version: 1.26.1
version: 1.26.2
```

When a cluster is a match for a Classifier instances, all classifierLabels will be automatically added to the Cluster instance.
Expand All @@ -45,8 +45,8 @@ Refer to [examples](./examples/) for more complex examples.
## A simple use case: upgrade helm charts automatically when Kubernetes cluster is upgraded
Suppose you are managing several Kubernetes clusters with different versions.
And you want to deploy:
1. OPA Gatekeeper version 3.10.0 in any Kubernetes cluster whose version is >= v1.26.1
2. OPA Gatekeeper version 3.9.0 in any Kubernetes cluster whose version is >= v1.24.0 && < v1.26.1
1. OPA Gatekeeper version 3.10.0 in any Kubernetes cluster whose version is >= v1.26.2
2. OPA Gatekeeper version 3.9.0 in any Kubernetes cluster whose version is >= v1.24.0 && < v1.26.2

You can create following ClusterProfiles and Classifiers in the management cluster:
```
Expand Down Expand Up @@ -102,7 +102,7 @@ spec:
value: v3-10
kubernetesVersionConstraints:
- comparison: GreaterThanOrEqualTo
version: 1.26.1
version: 1.26.2
```

```
Expand All @@ -118,7 +118,7 @@ spec:
- comparison: GreaterThanOrEqualTo
version: 1.24.0
- comparison: LessThan
version: 1.26.1
version: 1.26.2
```

With the above configuration:
Expand Down
2 changes: 1 addition & 1 deletion config/default/manager_auth_proxy_patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ spec:
- "--shard-key="
- --capi-onboard-annotation=
- "--v=5"
- "--version=main"
- "--version=v1.9.0"
- "--registry="
- "--agent-in-mgmt-cluster=false"
2 changes: 1 addition & 1 deletion config/default/manager_image_patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ spec:
spec:
containers:
# Change the value of image field below to your controller image URL
- image: docker.io/projectsveltos/classifier:main
- image: docker.io/projectsveltos/classifier:v1.9.0
name: manager
4 changes: 2 additions & 2 deletions controllers/controllers_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,15 +185,15 @@ func getClassifierReport(classifierName, clusterNamespace, clusterName string) *
}

func getClassifierInstance(name string) *libsveltosv1beta1.Classifier {
classifierLabels := []libsveltosv1beta1.ClassifierLabel{{Key: "version", Value: "v1.26.1"}}
classifierLabels := []libsveltosv1beta1.ClassifierLabel{{Key: "version", Value: "v1.26.2"}}
return &libsveltosv1beta1.Classifier{
ObjectMeta: metav1.ObjectMeta{
Name: name,
},
Spec: libsveltosv1beta1.ClassifierSpec{
KubernetesVersionConstraints: []libsveltosv1beta1.KubernetesVersionConstraint{
{
Version: "1.26.1",
Version: "1.26.2",
Comparison: string(libsveltosv1beta1.ComparisonEqual),
},
},
Expand Down
4 changes: 2 additions & 2 deletions examples/kubernetes_version.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Following Classifier will match any Cluster whose
# Kubernetes version is >= v1.24.0 and < v1.26.1
# Kubernetes version is >= v1.24.0 and < v1.26.2
apiVersion: lib.projectsveltos.io/v1beta1
kind: Classifier
metadata:
Expand All @@ -12,4 +12,4 @@ spec:
- comparison: GreaterThanOrEqualTo
version: 1.24.0
- comparison: LessThan
version: 1.26.1
version: 1.26.2
4 changes: 2 additions & 2 deletions examples/multiple_constraints.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Following Classifier will match any Cluster whose
# Kubernetes version is >= v1.24.0 and < v1.26.1
# Kubernetes version is >= v1.24.0 and < v1.26.2
apiVersion: lib.projectsveltos.io/v1beta1
kind: Classifier
metadata:
Expand All @@ -10,7 +10,7 @@ spec:
value: multiple
kubernetesVersionConstraints:
- comparison: GreaterThanOrEqualTo
version: 1.26.1
version: 1.26.2
deployedResourceConstraint:
- group: ""
version: v1
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/projectsveltos/classifier

go 1.26.1
go 1.26.2

require (
github.com/TwiN/go-color v1.4.1
Expand All @@ -9,7 +9,7 @@ require (
github.com/onsi/ginkgo/v2 v2.28.3
github.com/onsi/gomega v1.40.0
github.com/pkg/errors v0.9.1
github.com/projectsveltos/libsveltos v1.8.1-0.20260504084132-12f98fc4a775
github.com/projectsveltos/libsveltos v1.9.0
github.com/prometheus/client_golang v1.23.2
github.com/spf13/pflag v1.0.10
golang.org/x/text v0.36.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/projectsveltos/libsveltos v1.8.1-0.20260504084132-12f98fc4a775 h1:VtGEtCLH/A6jMji4aDFBmuit9o/+BtLatwFEEkCTTlw=
github.com/projectsveltos/libsveltos v1.8.1-0.20260504084132-12f98fc4a775/go.mod h1:CLKZ+yNQY6x+IzFn5ms9CKms9DzvbuxYwrnzTKYDCWI=
github.com/projectsveltos/libsveltos v1.9.0 h1:vn/tS1nwndxINiutY5w7Ln6OFl1eZ2/3zQceYA5b2gQ=
github.com/projectsveltos/libsveltos v1.9.0/go.mod h1:l8ZYyBJEdJECc1n1AryTfRavSNmZCQCXAXYDnR8Og/I=
github.com/prometheus/client_golang v1.23.2 h1:Je96obch5RDVy3FDMndoUsjAhG5Edi49h0RJWRi/o0o=
github.com/prometheus/client_golang v1.23.2/go.mod h1:Tb1a6LWHB3/SPIzCoaDXI4I8UHKeFTEQ1YCr+0Gyqmg=
github.com/prometheus/client_model v0.6.2 h1:oBsgwpGs7iVziMvrGhE53c/GrLUsZdHnqNwqPLxwZyk=
Expand Down
59 changes: 34 additions & 25 deletions hack/tools/go.mod
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
module github.com/projectsveltos/classifier/hack/tools

go 1.26.1
go 1.26.2

require (
github.com/a8m/envsubst v1.4.3
github.com/onsi/ginkgo/v2 v2.28.1
github.com/onsi/ginkgo/v2 v2.28.3
golang.org/x/oauth2 v0.36.0
golang.org/x/tools v0.44.0
k8s.io/client-go v0.35.4
sigs.k8s.io/controller-tools v0.20.1
k8s.io/client-go v0.36.0
sigs.k8s.io/controller-tools v0.21.0
sigs.k8s.io/kind v0.31.0
)

Expand All @@ -19,21 +19,30 @@ require (
github.com/Masterminds/semver/v3 v3.4.0 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/evanphx/json-patch/v5 v5.9.0 // indirect
github.com/fatih/color v1.18.0 // indirect
github.com/fxamacker/cbor/v2 v2.9.0 // indirect
github.com/fatih/color v1.19.0 // indirect
github.com/fxamacker/cbor/v2 v2.9.1 // indirect
github.com/go-logr/logr v1.4.3 // indirect
github.com/go-openapi/jsonpointer v0.21.0 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/swag v0.23.0 // indirect
github.com/go-openapi/jsonpointer v0.23.1 // indirect
github.com/go-openapi/jsonreference v0.21.5 // indirect
github.com/go-openapi/swag v0.26.0 // indirect
github.com/go-openapi/swag/cmdutils v0.26.0 // indirect
github.com/go-openapi/swag/conv v0.26.0 // indirect
github.com/go-openapi/swag/fileutils v0.26.0 // indirect
github.com/go-openapi/swag/jsonname v0.26.0 // indirect
github.com/go-openapi/swag/jsonutils v0.26.0 // indirect
github.com/go-openapi/swag/loading v0.26.0 // indirect
github.com/go-openapi/swag/mangling v0.26.0 // indirect
github.com/go-openapi/swag/netutils v0.26.0 // indirect
github.com/go-openapi/swag/stringutils v0.26.0 // indirect
github.com/go-openapi/swag/typeutils v0.26.0 // indirect
github.com/go-openapi/swag/yamlutils v0.26.0 // indirect
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
github.com/gobuffalo/flect v1.0.3 // indirect
github.com/google/gnostic-models v0.7.0 // indirect
github.com/google/pprof v0.0.0-20260115054156-294ebfa9ad83 // indirect
github.com/google/gnostic-models v0.7.1 // indirect
github.com/google/pprof v0.0.0-20260402051712-545e8a4df936 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-colorable v0.1.14 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect
Expand All @@ -43,7 +52,7 @@ require (
github.com/spf13/cobra v1.10.2 // indirect
github.com/spf13/pflag v1.0.10 // indirect
github.com/x448/float16 v0.8.4 // indirect
go.yaml.in/yaml/v2 v2.4.3 // indirect
go.yaml.in/yaml/v2 v2.4.4 // indirect
go.yaml.in/yaml/v3 v3.0.4 // indirect
golang.org/x/mod v0.35.0 // indirect
golang.org/x/net v0.53.0 // indirect
Expand All @@ -52,21 +61,21 @@ require (
golang.org/x/telemetry v0.0.0-20260409153401-be6f6cb8b1fa // indirect
golang.org/x/term v0.42.0 // indirect
golang.org/x/text v0.36.0 // indirect
golang.org/x/time v0.9.0 // indirect
google.golang.org/protobuf v1.36.8 // indirect
golang.org/x/time v0.15.0 // indirect
google.golang.org/protobuf v1.36.12-0.20260120151049-f2248ac996af // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/api v0.35.4 // indirect
k8s.io/apiextensions-apiserver v0.35.0 // indirect
k8s.io/apimachinery v0.35.4 // indirect
k8s.io/code-generator v0.35.0 // indirect
k8s.io/api v0.36.0 // indirect
k8s.io/apiextensions-apiserver v0.36.0 // indirect
k8s.io/apimachinery v0.36.0 // indirect
k8s.io/code-generator v0.36.0 // indirect
k8s.io/gengo/v2 v2.0.0-20250922181213-ec3ebc5fd46b // indirect
k8s.io/klog/v2 v2.130.1 // indirect
k8s.io/kube-openapi v0.0.0-20250910181357-589584f1c912 // indirect
k8s.io/utils v0.0.0-20251002143259-bc988d571ff4 // indirect
k8s.io/klog/v2 v2.140.0 // indirect
k8s.io/kube-openapi v0.0.0-20260427204847-8949caaa1199 // indirect
k8s.io/utils v0.0.0-20260319190234-28399d86e0b5 // indirect
sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect
sigs.k8s.io/randfill v1.0.0 // indirect
sigs.k8s.io/structured-merge-diff/v6 v6.3.0 // indirect
sigs.k8s.io/structured-merge-diff/v6 v6.4.0 // indirect
sigs.k8s.io/yaml v1.6.0 // indirect
)
Loading