Skip to content

Commit

Permalink
Merge pull request #119 from gianlucam76/prep-release-0.7
Browse files Browse the repository at this point in the history
Release v0.7.0
  • Loading branch information
gianlucam76 committed Sep 11, 2024
2 parents 07186a3 + 6f88c88 commit 4c813ae
Show file tree
Hide file tree
Showing 13 changed files with 27 additions and 21 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ ARCH ?= $(shell go env GOARCH)
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 ?= main
TAG ?= v0.7.0

.PHONY: all
all: build
Expand Down
6 changes: 3 additions & 3 deletions api/v1alpha1/cleaner_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

libsveltosv1alpha1 "github.com/projectsveltos/libsveltos/api/v1alpha1"
libsveltosv1beta1 "github.com/projectsveltos/libsveltos/api/v1beta1"
)

// Action specifies the action to take on matching resources
Expand Down Expand Up @@ -65,7 +65,7 @@ type ResourceSelector struct {
Kind string `json:"kind"`

// LabelFilters allows to filter resources based on current labels.
LabelFilters []libsveltosv1alpha1.LabelFilter `json:"labelFilters,omitempty"`
LabelFilters []libsveltosv1beta1.LabelFilter `json:"labelFilters,omitempty"`

// Evaluate contains a function "evaluate" in lua language.
// The function will be passed one of the object selected based on
Expand Down Expand Up @@ -94,7 +94,7 @@ type ResourcePolicySet struct {
}

// NotificationType specifies different type of notifications
// +kubebuilder:validation:Enum:=CleanerReport;Slack;Webex;Discord;Teams
// +kubebuilder:validation:Enum:=CleanerReport;Slack;Webex;Discord;Teams;SMTP
type NotificationType string

const (
Expand Down
7 changes: 4 additions & 3 deletions api/v1alpha1/zz_generated.deepcopy.go

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

2 changes: 1 addition & 1 deletion charts/k8s-cleaner/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Major Changes to functions are documented with the version affected. **Before up
| controller.image.pullPolicy | string | `"IfNotPresent"` | Controller Image pull policy |
| controller.image.registry | string | `"docker.io"` | Controller Image Registry |
| controller.image.repository | string | `"projectsveltos/k8s-cleaner"` | Controller Image Repository |
| controller.image.tag | string | `"v0.6.0"` | ControllerImage Tag |
| controller.image.tag | string | `"v0.7.0"` | ControllerImage Tag |
| controller.livenessProbe | object | `{"enabled":true,"httpGet":{"path":"/healthz","port":"healthz","scheme":"HTTP"},"initialDelaySeconds":15,"periodSeconds":20}` | Controller LivenessProbe |
| controller.ports[0].containerPort | int | `8443` | |
| controller.ports[0].name | string | `"metrics"` | |
Expand Down
7 changes: 5 additions & 2 deletions charts/k8s-cleaner/crd/apps.projectsveltos.io_cleaners.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.15.0
controller-gen.kubebuilder.io/version: v0.16.2
name: cleaners.apps.projectsveltos.io
spec:
group: apps.projectsveltos.io
Expand Down Expand Up @@ -76,7 +76,6 @@ spec:
the event) or if no container name is specified "spec.containers[2]" (container with
index 2 in this pod). This syntax is chosen only to have some well-defined way of
referencing a part of an object.
TODO: this design is not final and this field is subject to change in the future.
type: string
kind:
description: |-
Expand Down Expand Up @@ -113,12 +112,16 @@ spec:
- Webex
- Discord
- Teams
- SMTP
type: string
required:
- name
- type
type: object
type: array
x-kubernetes-list-map-keys:
- name
x-kubernetes-list-type: map
resourcePolicySet:
description: ResourcePolicySet identifies a group of resources
properties:
Expand Down
2 changes: 1 addition & 1 deletion charts/k8s-cleaner/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ controller:
# -- Controller Image Repository
repository: projectsveltos/k8s-cleaner
# -- ControllerImage Tag
tag: "v0.6.0"
tag: "v0.7.0"
# -- Controller Image pull policy
pullPolicy: IfNotPresent
# -- Controller ARguments
Expand Down
1 change: 1 addition & 0 deletions config/crd/bases/apps.projectsveltos.io_cleaners.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ spec:
- Webex
- Discord
- Teams
- SMTP
type: string
required:
- name
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: docker.io/projectsveltos/k8s-cleaner:main
- image: docker.io/projectsveltos/k8s-cleaner:v0.7.0
name: controller
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ require (
github.com/onsi/ginkgo/v2 v2.20.2
github.com/onsi/gomega v1.34.2
github.com/pkg/errors v0.9.1
github.com/projectsveltos/libsveltos v0.38.1-0.20240910103404-1bd4a057497d
github.com/projectsveltos/libsveltos v0.38.1-0.20240911110859-956cd4d7adda
github.com/robfig/cron/v3 v3.0.1
github.com/slack-go/slack v0.14.0
github.com/spf13/pflag v1.0.5
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/projectsveltos/libsveltos v0.38.1-0.20240910103404-1bd4a057497d h1:RxnoF/xgBaACvYILpgJn4lU9VgMvBRc3vZv+B0SgcaQ=
github.com/projectsveltos/libsveltos v0.38.1-0.20240910103404-1bd4a057497d/go.mod h1:qlj40eu4Mm1e2d/1/jxQgjevDLM2u/Sk6KE87Tuz67g=
github.com/projectsveltos/libsveltos v0.38.1-0.20240911110859-956cd4d7adda h1:4FrRsZcim4M0uzvgledV0DPAUfhoUkDVI4VvkNv2VI8=
github.com/projectsveltos/libsveltos v0.38.1-0.20240911110859-956cd4d7adda/go.mod h1:qlj40eu4Mm1e2d/1/jxQgjevDLM2u/Sk6KE87Tuz67g=
github.com/prometheus/client_golang v1.20.3 h1:oPksm4K8B+Vt35tUhw6GbSNSgVlVSBH0qELP/7u83l4=
github.com/prometheus/client_golang v1.20.3/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE=
github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E=
Expand Down
4 changes: 2 additions & 2 deletions internal/controller/executor/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import (

appsv1alpha1 "gianlucam76/k8s-cleaner/api/v1alpha1"

libsveltosv1alpha1 "github.com/projectsveltos/libsveltos/api/v1alpha1"
libsveltosv1beta1 "github.com/projectsveltos/libsveltos/api/v1beta1"
logs "github.com/projectsveltos/libsveltos/lib/logsettings"
)

Expand Down Expand Up @@ -336,7 +336,7 @@ func fetchResources(ctx context.Context, resourceSelector *appsv1alpha1.Resource
labelFilter += ","
}
f := resourceSelector.LabelFilters[i]
if f.Operation == libsveltosv1alpha1.OperationEqual {
if f.Operation == libsveltosv1beta1.OperationEqual {
labelFilter += fmt.Sprintf("%s=%s", f.Key, f.Value)
} else {
labelFilter += fmt.Sprintf("%s!=%s", f.Key, f.Value)
Expand Down
6 changes: 3 additions & 3 deletions internal/controller/executor/worker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import (
appsv1alpha1 "gianlucam76/k8s-cleaner/api/v1alpha1"
"gianlucam76/k8s-cleaner/internal/controller/executor"

libsveltosv1alpha1 "github.com/projectsveltos/libsveltos/api/v1alpha1"
libsveltosv1beta1 "github.com/projectsveltos/libsveltos/api/v1beta1"
)

var _ = Describe("Worker", func() {
Expand Down Expand Up @@ -192,10 +192,10 @@ var _ = Describe("Worker", func() {
Kind: "Secret",
Group: "",
Version: "v1",
LabelFilters: []libsveltosv1alpha1.LabelFilter{
LabelFilters: []libsveltosv1beta1.LabelFilter{
{
Key: key,
Operation: libsveltosv1alpha1.OperationEqual,
Operation: libsveltosv1beta1.OperationEqual,
Value: value,
},
},
Expand Down
3 changes: 2 additions & 1 deletion manifest/manifest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ spec:
- Webex
- Discord
- Teams
- SMTP
type: string
required:
- name
Expand Down Expand Up @@ -480,7 +481,7 @@ spec:
- --diagnostics-address=:8443
command:
- /manager
image: docker.io/projectsveltos/k8s-cleaner:main
image: docker.io/projectsveltos/k8s-cleaner:v0.7.0
livenessProbe:
failureThreshold: 3
httpGet:
Expand Down

0 comments on commit 4c813ae

Please sign in to comment.