Skip to content

Commit 7160f1e

Browse files
authored
Merge pull request #866 from gianlucam76/dev
Dev
2 parents 1af2407 + 1e0bdec commit 7160f1e

File tree

80 files changed

+2966
-577
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+2966
-577
lines changed

.github/workflows/main.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- name: checkout
17-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # tag=v4.1.7
17+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1818
- name: Set up Go
19-
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # tag=v5.0.2
19+
uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
2020
with:
2121
go-version: 1.22.7
2222
- name: Build
@@ -33,9 +33,9 @@ jobs:
3333
runs-on: ubuntu-latest
3434
steps:
3535
- name: checkout
36-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # tag=v4.1.7
36+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3737
- name: Set up Go
38-
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # tag=v5.0.2
38+
uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
3939
with:
4040
go-version: 1.22.7
4141
- name: ut
@@ -46,9 +46,9 @@ jobs:
4646
runs-on: ubuntu-latest
4747
steps:
4848
- name: checkout
49-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # tag=v4.1.7
49+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
5050
- name: Set up Go
51-
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # tag=v5.0.2
51+
uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
5252
with:
5353
go-version: 1.22.7
5454
- name: Free Disk Space (Ubuntu)
@@ -74,9 +74,9 @@ jobs:
7474
runs-on: ubuntu-latest
7575
steps:
7676
- name: checkout
77-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # tag=v4.1.7
77+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
7878
- name: Set up Go
79-
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # tag=v5.0.2
79+
uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
8080
with:
8181
go-version: 1.22.7
8282
- name: Free Disk Space (Ubuntu)
@@ -102,9 +102,9 @@ jobs:
102102
runs-on: ubuntu-latest
103103
steps:
104104
- name: checkout
105-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # tag=v4.1.7
105+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
106106
- name: Set up Go
107-
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # tag=v5.0.2
107+
uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
108108
with:
109109
go-version: 1.22.7
110110
- name: Free Disk Space (Ubuntu)

.golangci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ linters:
100100
- errname
101101
- errorlint
102102
- exhaustive
103-
- exportloopref
103+
- copyloopvar
104104
- forbidigo
105105
- funlen
106106
- goconst

Makefile

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ SHELL = /usr/bin/env bash -o pipefail
2222
REGISTRY ?= projectsveltos
2323
IMAGE_NAME ?= addon-controller
2424
ARCH ?= $(shell go env GOARCH)
25-
OS ?= $(shell uname -s | tr A-Z a-z)
25+
26+
OS ?= $(shell uname -s)
27+
OS := $(shell echo $(OS) | tr '[:upper:]' '[:lower:]')
2628
K8S_LATEST_VER ?= $(shell curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)
2729
export CONTROLLER_IMG ?= $(REGISTRY)/$(IMAGE_NAME)
2830
TAG ?= main
@@ -62,14 +64,16 @@ CONTROLLER_GEN := $(TOOLS_BIN_DIR)/controller-gen
6264
ENVSUBST := $(TOOLS_BIN_DIR)/envsubst
6365
GOIMPORTS := $(TOOLS_BIN_DIR)/goimports
6466
GOLANGCI_LINT := $(TOOLS_BIN_DIR)/golangci-lint
67+
GOVULNCHECK := $(TOOLS_BIN_DIR)/govulncheck
6568
GINKGO := $(TOOLS_BIN_DIR)/ginkgo
6669
SETUP_ENVTEST := $(TOOLS_BIN_DIR)/setup_envs
6770
CLUSTERCTL := $(TOOLS_BIN_DIR)/clusterctl
6871
KIND := $(TOOLS_BIN_DIR)/kind
6972
KUBECTL := $(TOOLS_BIN_DIR)/kubectl
7073

71-
GOLANGCI_LINT_VERSION := "v1.59.0"
72-
CLUSTERCTL_VERSION := "v1.8.3"
74+
GOVULNCHECK_VERSION := "v1.1.3"
75+
GOLANGCI_LINT_VERSION := "v1.61.0"
76+
CLUSTERCTL_VERSION := "v1.8.5"
7377

7478
KUSTOMIZE_VER := v5.3.0
7579
KUSTOMIZE_BIN := kustomize
@@ -94,7 +98,7 @@ $(CONVERSION_GEN_BIN): $(CONVERSION_GEN) ## Build a local copy of conversion-gen
9498
$(CONVERSION_GEN): # Build conversion-gen from tools folder.
9599
GOBIN=$(TOOLS_BIN_DIR) $(GO_INSTALL) $(CONVERSION_GEN_PKG) $(CONVERSION_GEN_BIN) $(CONVERSION_GEN_VER)
96100

97-
SETUP_ENVTEST_VER := v0.0.0-20240522175850-2e9781e9fc60
101+
SETUP_ENVTEST_VER := release-0.19
98102
SETUP_ENVTEST_BIN := setup-envtest
99103
SETUP_ENVTEST := $(abspath $(TOOLS_BIN_DIR)/$(SETUP_ENVTEST_BIN)-$(SETUP_ENVTEST_VER))
100104
SETUP_ENVTEST_PKG := sigs.k8s.io/controller-runtime/tools/setup-envtest
@@ -112,9 +116,12 @@ $(CONTROLLER_GEN): $(TOOLS_DIR)/go.mod # Build controller-gen from tools folder.
112116
$(ENVSUBST): $(TOOLS_DIR)/go.mod # Build envsubst from tools folder.
113117
cd $(TOOLS_DIR); $(GOBUILD) -tags=tools -o $(subst $(TOOLS_DIR)/hack/tools/,,$@) github.com/a8m/envsubst/cmd/envsubst
114118

115-
$(GOLANGCI_LINT): # Build golangci-lint from tools folder.
119+
$(GOLANGCI_LINT):
116120
cd $(TOOLS_DIR); ./get-golangci-lint.sh $(GOLANGCI_LINT_VERSION)
117121

122+
$(GOVULNCHECK):
123+
cd $(TOOLS_DIR); ./get-govulncheck.sh $(GOVULNCHECK_VERSION)
124+
118125
$(GOIMPORTS):
119126
cd $(TOOLS_DIR); $(GOBUILD) -tags=tools -o $(subst $(TOOLS_DIR)/hack/tools/,,$@) golang.org/x/tools/cmd/goimports
120127

@@ -180,6 +187,10 @@ vet: ## Run go vet against code.
180187
lint: $(GOLANGCI_LINT) generate ## Lint codebase
181188
$(GOLANGCI_LINT) run -v --fast=false --max-issues-per-linter 0 --max-same-issues 0 --timeout 5m
182189

190+
.PHONY: govulncheck
191+
govulncheck: $(GOVULNCHECK)
192+
$(GOVULNCHECK) ./...
193+
183194
.PHONY: check-manifests
184195
check-manifests: manifests ## Verify manifests file is up to date
185196
test `git status --porcelain $(GENERATED_FILES) | grep -cE '(^\?)|(^ M)'` -eq 0 || (echo "The manifest file changed, please 'make manifests' and commit the results"; exit 1)
@@ -196,7 +207,7 @@ endif
196207
# K8S_VERSION for the Kind cluster can be set as environment variable. If not defined,
197208
# this default value is used
198209
ifndef K8S_VERSION
199-
K8S_VERSION := v1.31.0
210+
K8S_VERSION := v1.31.2
200211
endif
201212

202213
KIND_CONFIG ?= kind-cluster.yaml
@@ -323,7 +334,7 @@ create-workload-cluster: $(KIND) $(KUBECTL)
323334
$(KIND) get kubeconfig --name $(WORKLOAD_CLUSTER_NAME) > test/fv/workload_kubeconfig
324335

325336
@echo "install calico on workload cluster"
326-
$(KUBECTL) --kubeconfig=./test/fv/workload_kubeconfig apply -f https://raw.githubusercontent.com/projectcalico/calico/v3.26.0/manifests/calico.yaml
337+
$(KUBECTL) --kubeconfig=./test/fv/workload_kubeconfig apply -f https://raw.githubusercontent.com/projectcalico/calico/v3.29.0/manifests/calico.yaml
327338

328339
@echo wait for calico pod
329340
$(KUBECTL) --kubeconfig=./test/fv/workload_kubeconfig wait --for=condition=Available deployment/calico-kube-controllers -n kube-system --timeout=$(TIMEOUT)

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[![CI](https://github.com/projectsveltos/addon-controller/actions/workflows/main.yaml/badge.svg)](https://github.com/projectsveltos/addon-controller/actions)
22
[![Go Report Card](https://goreportcard.com/badge/github.com/projectsveltos/addon-controller)](https://goreportcard.com/report/github.com/projectsveltos/addon-controller)
3+
[![Docker Pulls](https://img.shields.io/docker/pulls/projectsveltos/addon-controller.svg)](https://store.docker.com/community/images/projectsveltos/addon-controller)
34
[![Release](https://img.shields.io/github/v/release/projectsveltos/addon-controller)](https://github.com/projectsveltos/addon-controller/releases)
45
[![Slack](https://img.shields.io/badge/join%20slack-%23projectsveltos-brighteen)](https://join.slack.com/t/projectsveltos/shared_invite/zt-1hraownbr-W8NTs6LTimxLPB8Erj8Q6Q)
56
[![License](https://img.shields.io/badge/license-Apache-blue.svg)](LICENSE)
@@ -22,6 +23,8 @@ Sveltos provides precise control over add-on deployment order. Add-ons within a
2223

2324
👉 To get updates [⭐️ star](https://github.com/projectsveltos/addon-controller/stargazers) this repository.
2425

26+
[![Sveltos Dashboard](https://img.youtube.com/vi/GspTTGAmQwk/0.jpg)](https://www.youtube.com/watch?v=GspTTGAmQwk)
27+
2528
## Profiles vs. ClusterProfiles
2629

2730
Projectsveltos offers two powerful tools for managing cluster configurations: **Profiles** and **ClusterProfiles**. Understanding their distinctions is crucial for efficient setup and administration.

api/v1alpha1/conversion_utils.go

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,33 @@ func Convert_v1beta1_HelmChart_To_v1alpha1_HelmChart(src *configv1beta1.HelmChar
6969

7070
return nil
7171
}
72+
73+
func Convert_v1beta1_HelmInstallOptions_To_v1alpha1_HelmInstallOptions(
74+
src *configv1beta1.HelmInstallOptions, dst *HelmInstallOptions, s conversion.Scope) error {
75+
76+
if err := autoConvert_v1beta1_HelmInstallOptions_To_v1alpha1_HelmInstallOptions(src, dst, s); err != nil {
77+
return err
78+
}
79+
80+
return nil
81+
}
82+
83+
func Convert_v1beta1_HelmUninstallOptions_To_v1alpha1_HelmUninstallOptions(
84+
src *configv1beta1.HelmUninstallOptions, dst *HelmUninstallOptions, s conversion.Scope) error {
85+
86+
if err := autoConvert_v1beta1_HelmUninstallOptions_To_v1alpha1_HelmUninstallOptions(src, dst, s); err != nil {
87+
return err
88+
}
89+
90+
return nil
91+
}
92+
93+
func Convert_v1beta1_HelmUpgradeOptions_To_v1alpha1_HelmUpgradeOptions(
94+
src *configv1beta1.HelmUpgradeOptions, dst *HelmUpgradeOptions, s conversion.Scope) error {
95+
96+
if err := autoConvert_v1beta1_HelmUpgradeOptions_To_v1alpha1_HelmUpgradeOptions(src, dst, s); err != nil {
97+
return err
98+
}
99+
100+
return nil
101+
}

api/v1alpha1/spec.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,11 @@ type HelmOptions struct {
155155
// +optional
156156
SkipCRDs bool `json:"skipCRDs,omitempty"`
157157

158+
// SkipSchemaValidation determines if JSON schema validation is disabled.
159+
// +kubebuilder:default:=false
160+
// +optional
161+
SkipSchemaValidation bool `json:"skipSchemaValidation,omitempty"`
162+
158163
// if set, will wait until all Pods, PVCs, Services, and minimum number of Pods of a Deployment, StatefulSet, or ReplicaSet
159164
// are in a ready state before marking the release as successful. It will wait for as long as --timeout
160165
// Default to false

api/v1alpha1/zz_generated.conversion.go

Lines changed: 38 additions & 32 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/v1beta1/clustersummary_types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ type ClusterSummaryStatus struct {
212212
// +kubebuilder:resource:path=clustersummaries,scope=Namespaced
213213
// +kubebuilder:subresource:status
214214
// +kubebuilder:storageversion
215+
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of ClusterSummary"
215216
// +kubebuilder:printcolumn:name="HelmCharts",type="string",JSONPath=".status.featureSummaries[?(@.featureID==\"Helm\")].status",description="Indicates whether HelmCharts are all provisioned",priority=2
216217
// +kubebuilder:printcolumn:name="KustomizeRefs",type="string",JSONPath=".status.featureSummaries[?(@.featureID==\"Kustomize\")].status",description="Indicates whether KustomizeRefs are all provisioned",priority=2
217218
// +kubebuilder:printcolumn:name="PolicyRefs",type="string",JSONPath=".status.featureSummaries[?(@.featureID==\"Resources\")].status",description="Indicates whether PolicyRefs are all provisioned",priority=2

0 commit comments

Comments
 (0)