Skip to content

Commit

Permalink
Merge pull request #19 from gianlucam76/v1beta1
Browse files Browse the repository at this point in the history
Advance to v1beta1
  • Loading branch information
gianlucam76 authored Sep 27, 2024
2 parents 1c8bb83 + c538ce8 commit 1830153
Show file tree
Hide file tree
Showing 24 changed files with 555 additions and 608 deletions.
19 changes: 6 additions & 13 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
linters-settings:
dupl:
threshold: 200
errorlint:
# Use '%w' to format errors.
errorf: true
Expand Down Expand Up @@ -35,11 +33,8 @@ linters-settings:
min-complexity: 20
goimports:
local-prefixes: github.com/projectsveltos
gomnd:
settings:
mnd:
# don't include the "operation" and "assign"
checks: argument,case,condition,return
mnd:
checks: argument,case,condition,return
gomodguard:
# Although this is almost empty, we will evolve the list below with the
# modules we shouldn't use for technical and/or security reasons.
Expand All @@ -51,7 +46,7 @@ linters-settings:
# Don't merge replace directives using local path.
local_replace_directives: true
govet:
check-shadowing: true
shadow: true
settings:
printf:
funcs:
Expand Down Expand Up @@ -110,7 +105,7 @@ linters:
- gocyclo
- gofmt
- goimports
- gomnd
- mnd
- gomodguard
- goprintffuncname
- gosec
Expand Down Expand Up @@ -156,7 +151,7 @@ issues:
exclude-rules:
- path: _test\.go
linters:
- gomnd
- mnd
- grouper
- maintidx

Expand All @@ -176,6 +171,4 @@ run:
allow-parallel-runners: true
# Timeout for analysis
timeout: 5m
# files to skip: they will be analyzed, but issues from them won't be reported.
skip-dirs:
- cmd/example/gen

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.22 as builder
FROM golang:1.22.7 AS builder

ARG BUILDOS
ARG TARGETARCH
Expand Down
16 changes: 8 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Image URL to use all building/pushing image targets
IMG ?= controller:latest
# KUBEBUILDER_ENVTEST_KUBERNETES_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
KUBEBUILDER_ENVTEST_KUBERNETES_VERSION = 1.29.0
KUBEBUILDER_ENVTEST_KUBERNETES_VERSION = 1.31.0

# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
Expand All @@ -25,7 +25,7 @@ ARCH ?= amd64
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 ?= dev
TAG ?= main

.PHONY: all
all: build
Expand Down Expand Up @@ -67,17 +67,17 @@ CLUSTERCTL := $(TOOLS_BIN_DIR)/clusterctl
KIND := $(TOOLS_BIN_DIR)/kind
KUBECTL := $(TOOLS_BIN_DIR)/kubectl

GOLANGCI_LINT_VERSION := "v1.55.2"
CLUSTERCTL_VERSION := "v1.7.1"
GOLANGCI_LINT_VERSION := "v1.59.0"
CLUSTERCTL_VERSION := "v1.8.3"

KUSTOMIZE_VER := v4.5.2
KUSTOMIZE_VER := v5.3.0
KUSTOMIZE_BIN := kustomize
KUSTOMIZE := $(abspath $(TOOLS_BIN_DIR)/$(KUSTOMIZE_BIN)-$(KUSTOMIZE_VER))
KUSTOMIZE_PKG := sigs.k8s.io/kustomize/kustomize/v4
KUSTOMIZE_PKG := sigs.k8s.io/kustomize/kustomize/v5
$(KUSTOMIZE): # Build kustomize from tools folder.
CGO_ENABLED=0 GOBIN=$(TOOLS_BIN_DIR) $(GO_INSTALL) $(KUSTOMIZE_PKG) $(KUSTOMIZE_BIN) $(KUSTOMIZE_VER)

SETUP_ENVTEST_VER := v0.0.0-20240215143116-d0396a3d6f9f
SETUP_ENVTEST_VER := v0.0.0-20240522175850-2e9781e9fc60
SETUP_ENVTEST_BIN := setup-envtest
SETUP_ENVTEST := $(abspath $(TOOLS_BIN_DIR)/$(SETUP_ENVTEST_BIN)-$(SETUP_ENVTEST_VER))
SETUP_ENVTEST_PKG := sigs.k8s.io/controller-runtime/tools/setup-envtest
Expand Down Expand Up @@ -163,7 +163,7 @@ endif
# K8S_VERSION for the Kind cluster can be set as environment variable. If not defined,
# this default value is used
ifndef K8S_VERSION
K8S_VERSION := v1.29.0
K8S_VERSION := v1.31.0
endif

KIND_CONFIG ?= kind-cluster.yaml
Expand Down
4 changes: 2 additions & 2 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ import (

//+kubebuilder:scaffold:imports

libsveltosv1alpha1 "github.com/projectsveltos/libsveltos/api/v1alpha1"
libsveltosv1beta1 "github.com/projectsveltos/libsveltos/api/v1beta1"
"github.com/projectsveltos/libsveltos/lib/crd"
"github.com/projectsveltos/libsveltos/lib/logsettings"
logs "github.com/projectsveltos/libsveltos/lib/logsettings"
Expand Down Expand Up @@ -131,7 +131,7 @@ func main() {
ctx := ctrl.SetupSignalHandler()

logs.RegisterForLogSettings(ctx,
libsveltosv1alpha1.ComponentUIBackend, ctrl.Log.WithName("log-setter"),
libsveltosv1beta1.ComponentUIBackend, ctrl.Log.WithName("log-setter"),
ctrl.GetConfigOrDie())

debug.SetMemoryLimit(gibibytes_per_bytes)
Expand Down
8 changes: 4 additions & 4 deletions config/default/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ resources:
# [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'.
#- ../prometheus

patchesStrategicMerge:
patches:
# Protect the /metrics endpoint by putting it behind auth.
# If you want your controller-manager to expose the /metrics
# endpoint w/o any authn/z, please comment the following line.
- manager_auth_proxy_patch.yaml
- manager_image_patch.yaml
- manager_pull_policy.yaml
- path: manager_auth_proxy_patch.yaml
- path: manager_image_patch.yaml
- path: manager_pull_policy.yaml


# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
Expand Down
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: projectsveltos/ui-backend:dev
- image: projectsveltos/ui-backend:main
name: manager
35 changes: 0 additions & 35 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,6 @@ rules:
- cluster.x-k8s.io
resources:
- clusters
verbs:
- get
- list
- watch
- apiGroups:
- cluster.x-k8s.io
resources:
- clusters/status
verbs:
- get
Expand All @@ -44,21 +37,7 @@ rules:
- config.projectsveltos.io
resources:
- clusterconfigurations
verbs:
- get
- list
- watch
- apiGroups:
- config.projectsveltos.io
resources:
- clustersummaries
verbs:
- get
- list
- watch
- apiGroups:
- config.projectsveltos.io
resources:
- clustersummaries/status
verbs:
- get
Expand All @@ -68,21 +47,7 @@ rules:
- lib.projectsveltos.io
resources:
- debuggingconfigurations
verbs:
- get
- list
- watch
- apiGroups:
- lib.projectsveltos.io
resources:
- sveltosclusters
verbs:
- get
- list
- watch
- apiGroups:
- lib.projectsveltos.io
resources:
- sveltosclusters/status
verbs:
- get
Expand Down
Loading

0 comments on commit 1830153

Please sign in to comment.