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
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"dockerfile": "${localWorkspaceFolder}/.devcontainer/Dockerfile",
"context": "${localWorkspaceFolder}",
"args": {
"GO_VERSION": "1.26.3",
"GO_VERSION": "1.26.4",
"KUBECTX_VERSION": "0.9.5",
"SVELTOSCTL_VERSION": "0.53.0"
}
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: 1.26.3
go-version: 1.26.4
- name: Build
run: make build
- name: FMT
Expand All @@ -33,7 +33,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: 1.26.3
go-version: 1.26.4
- name: ut
run: make test
env:
Expand All @@ -46,7 +46,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: 1.26.3
go-version: 1.26.4
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
Expand Down Expand Up @@ -74,7 +74,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: 1.26.3
go-version: 1.26.4
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
Expand Down Expand Up @@ -102,7 +102,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: 1.26.3
go-version: 1.26.4
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
Expand Down Expand Up @@ -130,7 +130,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: 1.26.3
go-version: 1.26.4
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
Expand Down Expand Up @@ -158,7 +158,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: 1.26.3
go-version: 1.26.4
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
Expand Down Expand Up @@ -186,7 +186,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: 1.26.3
go-version: 1.26.4
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
Expand Down Expand Up @@ -214,7 +214,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version: 1.26.3
go-version: 1.26.4
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
Expand Down
12 changes: 6 additions & 6 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ linters:
- goconst
- gocritic
- gocyclo
- gomodguard
- gomodguard_v2
- goprintffuncname
- gosec
- govet
Expand Down Expand Up @@ -72,12 +72,10 @@ linters:
- style
gocyclo:
min-complexity: 20
gomodguard:
gomodguard_v2:
blocked:
modules:
- k8s.io/kubernetes:
reason: There is no good, avoidable reason to use this package and often leads to issues such as https://bit.ly/3dlKScY. However, if you disagree please include @ravchama in code review highlighting the reason.
local-replace-directives: true
- module: k8s.io/kubernetes
local-replace-directives: true
govet:
settings:
printf:
Expand Down Expand Up @@ -132,6 +130,7 @@ linters:
- third_party$
- builtin$
- examples$
- internal/test/helpers
issues:
max-issues-per-linter: 0
max-same-issues: 0
Expand All @@ -149,3 +148,4 @@ formatters:
- third_party$
- builtin$
- examples$
- internal/test/helpers
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.3 AS builder
FROM golang:1.26.4 AS builder

ARG BUILDOS
ARG TARGETARCH
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile_WithGit
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.26.3 AS builder
FROM golang:1.26.4 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 @@ -79,7 +79,7 @@ KIND := $(TOOLS_BIN_DIR)/kind
KUBECTL := $(TOOLS_BIN_DIR)/kubectl

GOVULNCHECK_VERSION := "v1.1.4"
GOLANGCI_LINT_VERSION := "v2.11.4"
GOLANGCI_LINT_VERSION := "v2.12.1"
CLUSTERCTL_VERSION := v1.13.2
KIND_VERSION := v0.32.0

Expand Down
5 changes: 3 additions & 2 deletions api/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 14 additions & 14 deletions controllers/chartmanager/chartmanager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@ var _ = Describe("Chart manager", func() {
HelmCharts: []configv1beta1.HelmChart{
{
RepositoryURL: "https://kyverno.github.io/kyverno/",
RepositoryName: "kyverno",
RepositoryName: testKyvernoName,
ChartName: "kyverno/kyverno",
ChartVersion: "v3.0.1",
ReleaseName: "kyverno-latest",
ReleaseNamespace: "kyverno",
ReleaseNamespace: testKyvernoName,
HelmChartAction: configv1beta1.HelmChartActionInstall,
},
{
Expand Down Expand Up @@ -219,12 +219,12 @@ var _ = Describe("Chart manager", func() {
}

prometheusChart := configv1beta1.HelmChart{
RepositoryURL: "https://prometheus-community.github.io/helm-charts",
RepositoryName: "prometheus-community",
ChartName: "prometheus-community/kube-prometheus-stack",
ChartVersion: "40.0.0",
ReleaseName: "prometheus-latest",
ReleaseNamespace: "prometheus",
RepositoryURL: testPrometheusCommunityURL,
RepositoryName: testPrometheusCommunityName,
ChartName: testPrometheusKubeStackChart,
ChartVersion: testPrometheusKubeStackVersion,
ReleaseName: testPrometheusLatestRelease,
ReleaseNamespace: testPrometheusNamespace,
HelmChartAction: configv1beta1.HelmChartActionInstall,
}

Expand Down Expand Up @@ -271,12 +271,12 @@ var _ = Describe("Chart manager", func() {
}

prometheusChart := configv1beta1.HelmChart{
RepositoryURL: "https://prometheus-community.github.io/helm-charts",
RepositoryName: "prometheus-community",
ChartName: "prometheus-community/kube-prometheus-stack",
ChartVersion: "40.0.0",
ReleaseName: "prometheus-latest",
ReleaseNamespace: "prometheus",
RepositoryURL: testPrometheusCommunityURL,
RepositoryName: testPrometheusCommunityName,
ChartName: testPrometheusKubeStackChart,
ChartVersion: testPrometheusKubeStackVersion,
ReleaseName: testPrometheusLatestRelease,
ReleaseNamespace: testPrometheusNamespace,
HelmChartAction: configv1beta1.HelmChartActionInstall,
}

Expand Down
27 changes: 27 additions & 0 deletions controllers/chartmanager/test_constants_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
Copyright 2025. projectsveltos.io. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package chartmanager_test

const (
testKyvernoName = "kyverno"
testPrometheusCommunityURL = "https://prometheus-community.github.io/helm-charts"
testPrometheusCommunityName = "prometheus-community"
testPrometheusKubeStackChart = "prometheus-community/kube-prometheus-stack"
testPrometheusKubeStackVersion = "40.0.0"
testPrometheusLatestRelease = "prometheus-latest"
testPrometheusNamespace = "prometheus"
)
4 changes: 2 additions & 2 deletions controllers/clustercache/cluster_cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ var _ = Describe("Clustercache", func() {
secretObj := &corev1.ObjectReference{
Namespace: secret.Namespace,
Name: secret.Name,
Kind: "Secret",
Kind: testKindSecret,
APIVersion: corev1.SchemeGroupVersion.String(),
}
storedCluster := cacheMgr.GetClusterFromSecret(secretObj)
Expand Down Expand Up @@ -107,7 +107,7 @@ var _ = Describe("Clustercache", func() {
secretObj := &corev1.ObjectReference{
Namespace: secret.Namespace,
Name: secret.Name,
Kind: "Secret",
Kind: testKindSecret,
APIVersion: corev1.SchemeGroupVersion.String(),
}
cacheMgr.RemoveSecret(secretObj)
Expand Down
21 changes: 21 additions & 0 deletions controllers/clustercache/test_constants_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
Copyright 2025. projectsveltos.io. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package clustercache_test

const (
testKindSecret = "Secret"
)
2 changes: 1 addition & 1 deletion controllers/clusterprofile_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ var _ = Describe("ClusterProfileReconciler: requeue methods", func() {
ClusterSelector: libsveltosv1beta1.Selector{
LabelSelector: metav1.LabelSelector{
MatchLabels: map[string]string{
"env": "production",
testEnvLabelKey: testProductionValue,
},
},
},
Expand Down
8 changes: 4 additions & 4 deletions controllers/clusterprofile_transformations_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ var _ = Describe("ClusterProfileReconciler map functions", func() {
Name: upstreamClusterNamePrefix + randomString(),
Namespace: namespace,
Labels: map[string]string{
"env": "production",
testEnvLabelKey: testProductionValue,
},
},
}
Expand All @@ -63,7 +63,7 @@ var _ = Describe("ClusterProfileReconciler map functions", func() {
ClusterSelector: libsveltosv1beta1.Selector{
LabelSelector: metav1.LabelSelector{
MatchLabels: map[string]string{
"env": "production",
testEnvLabelKey: testProductionValue,
},
},
},
Expand All @@ -78,7 +78,7 @@ var _ = Describe("ClusterProfileReconciler map functions", func() {
ClusterSelector: libsveltosv1beta1.Selector{
LabelSelector: metav1.LabelSelector{
MatchLabels: map[string]string{
"env": "qa",
testEnvLabelKey: testQAValue,
},
},
},
Expand Down Expand Up @@ -138,7 +138,7 @@ var _ = Describe("ClusterProfileReconciler map functions", func() {
matchingClusterProfile.Spec.ClusterSelector = libsveltosv1beta1.Selector{
LabelSelector: metav1.LabelSelector{
MatchLabels: map[string]string{
"env": "qa",
testEnvLabelKey: testQAValue,
},
},
}
Expand Down
6 changes: 3 additions & 3 deletions controllers/clusterpromotion_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ func (r *ClusterPromotionReconciler) reconcileStageProfile(ctx context.Context,

forceConflict := true
options := metav1.PatchOptions{
FieldManager: "application/apply-patch",
FieldManager: applyPatchFieldManager,
Force: &forceConflict,
}

Expand Down Expand Up @@ -667,7 +667,7 @@ func getPreCheckDeploymentClusterProfileLabels(clusterPromotion *configv1beta1.C
return map[string]string{
clusterPromotionNameLabel: clusterPromotion.Name,
// Adding a distinct label to easily identify this ClusterProfile as part of the pre-verification step.
preVerificationClusterProfileLabel: "true",
preVerificationClusterProfileLabel: stringTrue,
}
}

Expand Down Expand Up @@ -1086,7 +1086,7 @@ func (r *ClusterPromotionReconciler) reconcilePreHealthCheckDeployment(ctx conte

forceConflict := true
options := metav1.PatchOptions{
FieldManager: "application/apply-patch",
FieldManager: applyPatchFieldManager,
Force: &forceConflict,
}

Expand Down
2 changes: 1 addition & 1 deletion controllers/clusterpromotion_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ var _ = Describe("ClusterPromotionController", func() {

check := libsveltosv1beta1.ValidateHealth{
Group: "",
Version: "v1",
Version: testV1APIVersion,
Kind: "Pod",
LabelFilters: []libsveltosv1beta1.LabelFilter{
{Key: randomString(), Value: randomString(), Operation: libsveltosv1beta1.OperationEqual},
Expand Down
4 changes: 2 additions & 2 deletions controllers/clustersummary_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -1233,7 +1233,7 @@ func getPolicyRefGroupVersionKind(ref *configv1beta1.PolicyRef) *schema.GroupVer
switch ref.Kind {
case string(libsveltosv1beta1.SecretReferencedResourceKind),
string(libsveltosv1beta1.ConfigMapReferencedResourceKind):
return &schema.GroupVersionKind{Group: "", Version: "v1", Kind: ref.Kind}
return &schema.GroupVersionKind{Group: "", Version: coreAPIVersion, Kind: ref.Kind}
case sourcev1.GitRepositoryKind:
return &schema.GroupVersionKind{Group: sourcev1.GroupVersion.Group,
Version: sourcev1.GroupVersion.Version, Kind: ref.Kind}
Expand Down Expand Up @@ -1919,7 +1919,7 @@ func (r *ClusterSummaryReconciler) getClusterSummaryScope(ctx context.Context,
Logger: logger,
ClusterSummary: clusterSummary,
Profile: profile,
ControllerName: "clustersummary",
ControllerName: controllerNameClusterSummary,
})

return clusterSummaryScope, err
Expand Down
Loading