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
24 changes: 12 additions & 12 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@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version: 1.27.1
go-version: 1.27.3
- name: Build
run: make build
- name: FMT
Expand All @@ -37,72 +37,72 @@ jobs:
- name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version: 1.27.1
go-version: 1.27.3
- name: ut
run: make test
env:
UT: true
FV:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- name: checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version: 1.27.1
go-version: 1.27.3
- name: fv
run: make create-cluster fv
env:
FV: true
FV_SHARDING:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- name: checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version: 1.27.1
go-version: 1.27.3
- name: fv-sharding
run: make create-cluster fv-sharding
env:
FV: true
FV_AGENTLESS:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- name: checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version: 1.27.1
go-version: 1.27.3
- name: fv-agentless
run: make create-cluster fv-agentless
env:
FV: true
FV_PULLMODE:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- name: checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version: 1.27.1
go-version: 1.27.3
- name: fv-pullmode
run: make create-cluster-pullmode fv-pullmode
env:
FV: true
FV-NAMESPACE:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- name: checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version: 1.27.1
go-version: 1.27.3
- name: fv
run: make create-cluster-infra fv-namespace
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.27.1 AS builder
FROM golang:1.27.3 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 @@ -59,7 +59,7 @@ KIND := $(TOOLS_BIN_DIR)/kind
KUBECTL := $(TOOLS_BIN_DIR)/kubectl
CLUSTERCTL := $(TOOLS_BIN_DIR)/clusterctl

GOLANGCI_LINT_VERSION := "v2.13.2"
GOLANGCI_LINT_VERSION := "v2.15.0"
CLUSTERCTL_VERSION := v1.14.3

KUSTOMIZE_VER := v5.8.0
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.27.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.27.3"

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

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.27.1
2. OPA Gatekeeper version 3.9.0 in any Kubernetes cluster whose version is >= v1.24.0 && < v1.27.1
1. OPA Gatekeeper version 3.10.0 in any Kubernetes cluster whose version is >= v1.27.3
2. OPA Gatekeeper version 3.9.0 in any Kubernetes cluster whose version is >= v1.24.0 && < v1.27.3

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.27.1
version: 1.27.3
```

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

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.27.1"}}
classifierLabels := []libsveltosv1beta1.ClassifierLabel{{Key: classifierLabelVersion, Value: "v1.27.3"}}
return &libsveltosv1beta1.Classifier{
ObjectMeta: metav1.ObjectMeta{
Name: name,
},
Spec: libsveltosv1beta1.ClassifierSpec{
KubernetesVersionConstraints: []libsveltosv1beta1.KubernetesVersionConstraint{
{
Version: "1.27.1",
Version: "1.27.3",
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.27.1
# Kubernetes version is >= v1.24.0 and < v1.27.3
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.27.1
version: 1.27.3
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.27.1
# Kubernetes version is >= v1.24.0 and < v1.27.3
apiVersion: lib.projectsveltos.io/v1beta1
kind: Classifier
metadata:
Expand All @@ -10,7 +10,7 @@ spec:
value: multiple
kubernetesVersionConstraints:
- comparison: GreaterThanOrEqualTo
version: 1.27.1
version: 1.27.3
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,6 +1,6 @@
module github.com/projectsveltos/classifier

go 1.27.1
go 1.27.3

require (
github.com/TwiN/go-color v1.4.1
Expand All @@ -9,16 +9,16 @@ require (
github.com/onsi/ginkgo/v2 v2.33.1
github.com/onsi/gomega v1.44.0
github.com/pkg/errors v0.9.1
github.com/projectsveltos/libsveltos v1.16.1-0.20261027071955-43c9158346ce
github.com/projectsveltos/libsveltos v1.16.1-0.20261028113114-eb12e8579496
github.com/prometheus/client_golang v1.25.0
github.com/spf13/pflag v1.0.10
github.com/yuin/gopher-lua v1.1.2
golang.org/x/text v0.43.0
k8s.io/api v0.37.1
k8s.io/apiextensions-apiserver v0.37.1
k8s.io/apimachinery v0.37.1
k8s.io/client-go v0.37.1
k8s.io/component-base v0.37.1
k8s.io/api v0.37.2
k8s.io/apiextensions-apiserver v0.37.2
k8s.io/apimachinery v0.37.2
k8s.io/client-go v0.37.2
k8s.io/component-base v0.37.2
k8s.io/klog/v2 v2.140.0
k8s.io/utils v0.0.0-20261023123148-ca04ba58ecab
sigs.k8s.io/cluster-api v1.14.3
Expand All @@ -28,32 +28,32 @@ require (
)

require (
cel.dev/cel-go v0.32.0 // indirect
cel.dev/cel-go v0.33.1 // indirect
cel.dev/expr v0.25.3 // indirect
cloud.google.com/go/compute/metadata v0.9.0 // indirect
dario.cat/mergo v1.0.2 // indirect
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.23.2 // indirect
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.14.1 // indirect
github.com/Azure/azure-sdk-for-go/sdk/internal v1.12.0 // indirect
github.com/AzureAD/microsoft-authentication-library-for-go v1.8.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.23.3 // indirect
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.15.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/internal v1.13.0 // indirect
github.com/AzureAD/microsoft-authentication-library-for-go v1.10.1 // indirect
github.com/Masterminds/goutils v1.1.1 // indirect
github.com/Masterminds/semver/v3 v3.5.0 // indirect
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.47.1 // indirect
github.com/aws/aws-sdk-go-v2/config v1.33.6 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.20.6 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.20.1 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.4 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.4 // indirect
github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.4 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.19 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.4 // indirect
github.com/aws/aws-sdk-go-v2/service/signin v1.10.1 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.38.1 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.43.1 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.51.1 // indirect
github.com/aws/smithy-go v1.28.1 // indirect
github.com/aws/aws-sdk-go-v2 v1.47.5 // indirect
github.com/aws/aws-sdk-go-v2/config v1.33.12 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.20.12 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.20.5 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.8 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.8 // indirect
github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.8 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.23 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.8 // indirect
github.com/aws/aws-sdk-go-v2/service/signin v1.12.0 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.39.0 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.44.0 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.51.6 // indirect
github.com/aws/smithy-go v1.28.7 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/blang/semver/v4 v4.0.0 // indirect
github.com/cenkalti/backoff/v5 v5.0.3 // indirect
Expand Down Expand Up @@ -142,10 +142,10 @@ require (
google.golang.org/protobuf v1.36.12 // indirect
gopkg.in/evanphx/json-patch.v4 v4.13.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
k8s.io/apiserver v0.37.1 // indirect
k8s.io/apiserver v0.37.2 // indirect
k8s.io/cluster-bootstrap v0.36.3 // indirect
k8s.io/kube-openapi v0.0.0-20260721132016-d427ff9ee9ad // indirect
k8s.io/streaming v0.37.1 // indirect
k8s.io/streaming v0.37.2 // indirect
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.36.0 // indirect
sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect
sigs.k8s.io/kustomize/api v0.21.2 // indirect
Expand Down
Loading
Loading