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/codeql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ jobs:

steps:
- name: checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Set up Go
uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version: 1.26.5

- name: Initialize CodeQL
uses: github/codeql-action/init@54f647b7e1bb85c95cddabcd46b0c578ec92bc1a # v4.36.3
uses: github/codeql-action/init@7188fc363630916deb702c7fdcf4e481b751f97a # v4.37.1
with:
languages: ${{ matrix.language }}

Expand All @@ -46,6 +46,6 @@ jobs:
run: go build ./...

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@54f647b7e1bb85c95cddabcd46b0c578ec92bc1a # v4.36.3
uses: github/codeql-action/analyze@7188fc363630916deb702c7fdcf4e481b751f97a # v4.37.1
with:
category: "/language:${{ matrix.language }}"
14 changes: 7 additions & 7 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@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
with:
go-version: 1.26.4
go-version: 1.26.5
- name: Build
run: make build
- name: FMT
Expand All @@ -37,7 +37,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
with:
go-version: 1.26.4
go-version: 1.26.5
- name: ut
run: make test
env:
Expand All @@ -50,7 +50,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
with:
go-version: 1.26.4
go-version: 1.26.5
- name: fv
run: make create-cluster fv
env:
Expand All @@ -63,7 +63,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
with:
go-version: 1.26.4
go-version: 1.26.5
- 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@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
with:
go-version: 1.26.4
go-version: 1.26.5
- 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@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
with:
go-version: 1.26.4
go-version: 1.26.5
- name: fv-pullmode
run: make create-cluster-pullmode fv-pullmode
env:
Expand All @@ -102,7 +102,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
with:
go-version: 1.26.4
go-version: 1.26.5
- name: fv
run: make create-cluster-infra fv-namespace
env:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/scorecard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:

steps:
- name: checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

Expand All @@ -40,6 +40,6 @@ jobs:
retention-days: 5

- name: Upload to code-scanning
uses: github/codeql-action/upload-sarif@54f647b7e1bb85c95cddabcd46b0c578ec92bc1a # v4.36.3
uses: github/codeql-action/upload-sarif@7188fc363630916deb702c7fdcf4e481b751f97a # v4.37.1
with:
sarif_file: results.sarif
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.4 AS builder
FROM golang:1.26.5 AS builder

ARG BUILDOS
ARG TARGETARCH
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ KUBECTL := $(TOOLS_BIN_DIR)/kubectl
CLUSTERCTL := $(TOOLS_BIN_DIR)/clusterctl

GOLANGCI_LINT_VERSION := "v2.12.2"
CLUSTERCTL_VERSION := v1.13.3
CLUSTERCTL_VERSION := v1.13.4

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 @@ -30,7 +30,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.4"
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.5"

```
apiVersion: lib.projectsveltos.io/v1beta1
Expand All @@ -45,7 +45,7 @@ spec:
- comparison: GreaterThanOrEqualTo
version: 1.24.0
- comparison: LessThan
version: 1.26.4
version: 1.26.5
```

When a cluster is a match for a Classifier instances, all classifierLabels will be automatically added to the Cluster instance.
Expand All @@ -59,8 +59,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.4
2. OPA Gatekeeper version 3.9.0 in any Kubernetes cluster whose version is >= v1.24.0 && < v1.26.4
1. OPA Gatekeeper version 3.10.0 in any Kubernetes cluster whose version is >= v1.26.5
2. OPA Gatekeeper version 3.9.0 in any Kubernetes cluster whose version is >= v1.24.0 && < v1.26.5

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

```
Expand All @@ -132,7 +132,7 @@ spec:
- comparison: GreaterThanOrEqualTo
version: 1.24.0
- comparison: LessThan
version: 1.26.4
version: 1.26.5
```

With the above configuration:
Expand Down
4 changes: 2 additions & 2 deletions controllers/controllers_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,15 +197,15 @@ func getClassifierReport(classifierName, clusterNamespace, clusterName string) *
}

func getClassifierInstance(name string) *libsveltosv1beta1.Classifier {
classifierLabels := []libsveltosv1beta1.ClassifierLabel{{Key: classifierLabelVersion, Value: "v1.26.4"}}
classifierLabels := []libsveltosv1beta1.ClassifierLabel{{Key: classifierLabelVersion, Value: "v1.26.5"}}
return &libsveltosv1beta1.Classifier{
ObjectMeta: metav1.ObjectMeta{
Name: name,
},
Spec: libsveltosv1beta1.ClassifierSpec{
KubernetesVersionConstraints: []libsveltosv1beta1.KubernetesVersionConstraint{
{
Version: "1.26.4",
Version: "1.26.5",
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.4
# Kubernetes version is >= v1.24.0 and < v1.26.5
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.4
version: 1.26.5
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.4
# Kubernetes version is >= v1.24.0 and < v1.26.5
apiVersion: lib.projectsveltos.io/v1beta1
kind: Classifier
metadata:
Expand All @@ -10,7 +10,7 @@ spec:
value: multiple
kubernetesVersionConstraints:
- comparison: GreaterThanOrEqualTo
version: 1.26.4
version: 1.26.5
deployedResourceConstraint:
- group: ""
version: v1
Expand Down
56 changes: 28 additions & 28 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
module github.com/projectsveltos/classifier

go 1.26.4
go 1.26.5

require (
github.com/TwiN/go-color v1.4.1
github.com/gdexlab/go-render v1.0.1
github.com/go-logr/logr v1.4.3
github.com/go-logr/logr v1.4.4
github.com/onsi/ginkgo/v2 v2.32.0
github.com/onsi/gomega v1.42.1
github.com/pkg/errors v0.9.1
github.com/projectsveltos/libsveltos v1.12.1-0.20260717183230-6bffa4189087
github.com/prometheus/client_golang v1.23.2
github.com/projectsveltos/libsveltos v1.12.1-0.20260723073052-095dee392300
github.com/prometheus/client_golang v1.24.0
github.com/spf13/pflag v1.0.10
github.com/yuin/gopher-lua v1.1.2
golang.org/x/text v0.38.0
k8s.io/api v0.36.2
k8s.io/apiextensions-apiserver v0.36.2
k8s.io/apimachinery v0.36.2
k8s.io/client-go v0.36.2
k8s.io/component-base v0.36.2
golang.org/x/text v0.40.0
k8s.io/api v0.36.3
k8s.io/apiextensions-apiserver v0.36.3
k8s.io/apimachinery v0.36.3
k8s.io/client-go v0.36.3
k8s.io/component-base v0.36.3
k8s.io/klog/v2 v2.140.0
k8s.io/utils v0.0.0-20260626114624-be93311217bd
sigs.k8s.io/cluster-api v1.13.3
k8s.io/utils v0.0.0-20260707023825-cf1189d6abe3
sigs.k8s.io/cluster-api v1.13.4
sigs.k8s.io/controller-runtime v0.24.1
sigs.k8s.io/yaml v1.6.0
)
Expand All @@ -39,18 +39,18 @@ require (
github.com/Masterminds/sprig/v3 v3.3.0 // indirect
github.com/antlr4-go/antlr/v4 v4.13.1 // indirect
github.com/aws/aws-sdk-go-v2 v1.42.1 // indirect
github.com/aws/aws-sdk-go-v2/config v1.32.27 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.19.26 // indirect
github.com/aws/aws-sdk-go-v2/config v1.32.30 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.19.29 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.30 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.30 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.30 // indirect
github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.31 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.13 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.30 // indirect
github.com/aws/aws-sdk-go-v2/service/signin v1.2.2 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.31.5 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.36.8 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.43.5 // indirect
github.com/aws/aws-sdk-go-v2/service/signin v1.4.1 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.32.1 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.37.1 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.44.1 // indirect
github.com/aws/smithy-go v1.27.3 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/blang/semver/v4 v4.0.0 // indirect
Expand All @@ -70,7 +70,7 @@ require (
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
github.com/gobuffalo/flect v1.0.3 // indirect
github.com/golang-jwt/jwt/v5 v5.3.1 // indirect
github.com/google/cel-go v0.28.1 // indirect
github.com/google/cel-go v0.29.2 // indirect
github.com/google/gnostic-models v0.7.0 // indirect
github.com/google/go-cmp v0.7.0 // indirect
github.com/google/pprof v0.0.0-20260402051712-545e8a4df936 // indirect
Expand All @@ -96,8 +96,8 @@ require (
github.com/projectsveltos/lua-utils/glua-sprig v0.0.0-20251212200258-2b3cdcb7c0f5 // indirect
github.com/projectsveltos/lua-utils/glua-strings v0.0.0-20251212200258-2b3cdcb7c0f5 // indirect
github.com/prometheus/client_model v0.6.2 // indirect
github.com/prometheus/common v0.67.5 // indirect
github.com/prometheus/procfs v0.19.2 // indirect
github.com/prometheus/common v0.70.0 // indirect
github.com/prometheus/procfs v0.21.1 // indirect
github.com/shopspring/decimal v1.4.0 // indirect
github.com/spf13/cast v1.10.0 // indirect
github.com/spf13/cobra v1.10.2 // indirect
Expand All @@ -112,18 +112,18 @@ require (
go.opentelemetry.io/otel/sdk v1.43.0 // indirect
go.opentelemetry.io/otel/trace v1.43.0 // indirect
go.opentelemetry.io/proto/otlp v1.10.0 // 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/crypto v0.53.0 // indirect
golang.org/x/exp v0.0.0-20251219203646-944ab1f22d93 // indirect
golang.org/x/mod v0.36.0 // indirect
golang.org/x/mod v0.37.0 // indirect
golang.org/x/net v0.56.0 // indirect
golang.org/x/oauth2 v0.36.0 // indirect
golang.org/x/sync v0.21.0 // indirect
golang.org/x/sys v0.46.0 // indirect
golang.org/x/sync v0.22.0 // indirect
golang.org/x/sys v0.47.0 // indirect
golang.org/x/term v0.44.0 // indirect
golang.org/x/time v0.14.0 // indirect
golang.org/x/tools v0.45.0 // indirect
golang.org/x/tools v0.47.0 // indirect
gomodules.xyz/jsonpatch/v2 v2.5.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20260401024825-9d38bb4040a9 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20260401024825-9d38bb4040a9 // indirect
Expand All @@ -132,10 +132,10 @@ require (
gopkg.in/evanphx/json-patch.v4 v4.13.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apiserver v0.36.2 // indirect
k8s.io/apiserver v0.36.3 // indirect
k8s.io/cluster-bootstrap v0.36.0 // indirect
k8s.io/kube-openapi v0.0.0-20260427204847-8949caaa1199 // indirect
k8s.io/streaming v0.36.2 // indirect
k8s.io/streaming v0.36.3 // indirect
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.34.0 // indirect
sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect
sigs.k8s.io/kustomize/api v0.21.1 // indirect
Expand Down
Loading